|
1 | 1 | # Render Graph Visualizations |
2 | 2 |
|
3 | | -This [node.js](https://nodejs.org/de) project provides the script [renderVisualizations.js](./renderVisualizations.js) to save all graph visualizations as image files. |
| 3 | +This [node.js](https://nodejs.org/de) project provides the script [renderVisualizations.js](./renderVisualizations.js) to render all graph visualizations as image files. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Run `npm ci` in this directory to download all necessary dependencies. |
| 8 | + |
| 9 | +## How it works |
| 10 | + |
4 | 11 | [renderVisualizations.js](./renderVisualizations.js) uses these three steps: |
5 | 12 |
|
6 | | -- opens every HTML file with [Puppeteer](https://pptr.dev) in a headless browser |
7 | | -- takes screenshots of all contained [HTML5 Canvas elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas?retiredLocale=de) |
8 | | -- saves them as [PNG](https://en.wikipedia.org/wiki/PNG) files in the current directory |
| 13 | +- Opens every HTML file in this directory and its subdirectories with [Puppeteer](https://pptr.dev) in a headless browser |
| 14 | +- Takes screenshots of all contained [HTML5 Canvas elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas?retiredLocale=de) |
| 15 | +- Creates a directory with the name of the HTML converted to snake case in the current directory |
| 16 | +- Saves all screenshots as [PNG](https://en.wikipedia.org/wiki/PNG) files into that newly created directory |
9 | 17 |
|
10 | | -## Example |
| 18 | +## How to run it in the CLI |
11 | 19 |
|
12 | | -If the current working directory is e.g. `temp/projectname/reports/graph-visualizations` within this repository, |
13 | | -then the command would look like this: |
| 20 | +Under the assumption that your current working directory is `temp/projectname/reports/graph-visualizations` in the root directory of this repository, then the command would look like this: |
14 | 21 |
|
15 | 22 | ```shell |
16 | 23 | node ./../../../../graph-visualization/renderVisualizations |
17 | 24 | ``` |
| 25 | + |
| 26 | +## How to open it in the browser |
| 27 | + |
| 28 | +- Open one of the HTML files in the Browser using `file://` prefix followed by the full path or using a Live Server. |
| 29 | +- Enter the password for the local Neo4j database `neo4j` that you have chosen as initial password. |
| 30 | +- Wait until the orange frames turn green and use drag'n'drop or scrolling to see the part of the Graph you're interested in. |
| 31 | +- Currently, the frames are intentionally very large to get a practicable resolution for saving the images. This might get refined in future. |
| 32 | + |
| 33 | +## Scripts |
| 34 | + |
| 35 | +- [renderVisualizations.js](./renderVisualizations.js) is the main Node.js script that renders the Graph Visualizations using a Command Line Interface (CLI) |
| 36 | +- [vis-configuration-presets.js](./vis-configuration-presets.js) contains functions that return predefined visualization configurations. Currently (May 2024), there is only one configuration for visualizing hierarchical, topology sorted Graphs. |
| 37 | +- [visualization-pagination.js](./visualization-pagination.js) provides pagination for visualizing large Graphs by splitting them up into smaller Subgraphs all in separate images. |
0 commit comments