Live Demo: GitHub Pages
Main dependencies:
- Application Server: Node
- Compiler: TypeScript
- Bundler: Webpack
- Task Runner: Gulp
- Pixi.js: Pixi.js
- pixi-viewport: pixi-viewport
- D3.js: D3.js
- Electron: Electron
Node and TypeScript should be installed globally.
$> git clone <url> <new folder>
$> cd <new folder>
$> npm installCommands should be run under a bash shell.
The following command builds and runs the project in development mode with Hot Reload.
$> npx gulp serveThe following command builds the project in production mode.
$> npx gulp buildThe following command runs the project as an Electron application.
$> npx gulp electronThe following command compiles a standalone Electron application for the operating system it was called on.
You can find the output under standalone/ in the project directory.
$> npx gulp buildElectronAppThe following command compiles a standalone Electron application for Microsoft Windows x64.
You can find the output under standalone/ in the project directory.
$> npx gulp buildElectronWinAppThe following command compiles a standalone Electron application for MacOS.
You can find the output under standalone/ in the project directory.
$> npx gulp buildElectronMacAppThe following command compiles a standalone Electron application for Linux operating systems.
You can find the output under standalone/ in the project directory.
$> npx gulp buildElectronLinuxAppThe following command compiles standalone Electron applications for all available platforms.
You can find the output under standalone/ in the project directory.
$> npx gulp buildElectronAllAppsThe following command cleans the dist/ folder which includes the bundled source code.
$> npx gulp cleanThe following command cleans the dist/ folder which includes the bundled source code,
as well as the node_modules/ folder.
$> npx gulp cleanAllThe following command constructs a .json dataset from a specified folder. This folder
can then be viewed and navigated within VoroTree. Specify input folder and output name
in the data/folderdatasetconfig.js file.
$> npx gulp constructFolderDatasetGithub Pages offers two ways of hosting your project. Either through an index.html within the root of your
repository or with an index.html within a docs/ folder in your repository. In this repository the way of
using a docs/ folder was chosen to avoid unnecessary or unwanted inclusion of updates to the hosted version
of VoroTree. To deploy a new version of VoroTree to the repository follow these steps:
- Run the gulp deploy command to build the project and place all necessary files in the appropriate folder:
$> npx gulp deploy- Add and push all changes in the
docs/folder to the git repository. Once these changes enter the "main/master" branch, GitHub Pages will automatically update the source code of the hosted page.
Six datasets are included in the VoroTree application for demonstration purposes.
-
Highly edited version of Country, Regional and World GDP (Gross Domestic Product) dataset. Only some countries were selected to produce a smaller dataset for demonstration purposes.
-
Custom car manufacturer dataset constructed by the author. It spans over a selection of car manufacturers divided by country of origin and select models of the brand.
-
Adapted Primate dataset which is originally taken from the Tree of Life project. Represents the tree of species of Primates.
-
Drug dataset. A drug classification from the USA, that categorizes drugs according to substances and uses.
-
Wikipedia editors over the world. The nationalities of Wikipedia page editors. Editors are grouped by naionality per Wikipedia page language. Larger entries represent 100 or more editors, while smaller ones represent between 5 and 99 editors.
-
Google product taxonomy - the list of categories used by Google to help departmentalize products in a shopping feed.
The tool supports JSON and CSV files which need to have the following format in order to visualize the data properly.
- Name is used as the label of the polygon.
- Children or Parent, depending on the file type used, define the hierarchical nature of your data.
- Weight influences the size of the polygon. Only the leaves should have this property. If the weight is not given, the size of the polygon depends on the amount of children.
- Any other attributes of a data point that are a number are automatically added to the settings menu as a weight accessor. So any other numerical attributes in your data can also be used to weight the visualization i.e. Size, Age etc..
{
"name": "America",
"children": [
{
"name": "North America",
"children": [
{"name": "United States", "weight": 24.32},
{"name": "Canada", "weight": 2.09},
{"name": "Mexico", "weight": 1.54}
]
},
{
"name": "South America",
"children": [
{"name": "Brazil", "weight": 2.39},
{"name": "Argentina", "weight": 0.79},
{"name": "Venezuela", "weight": 0.5},
{"name": "Colombia", "weight": 0.39}
]
}
]
}
To create a Voronoi Treemap from a CSV file, the columns name and parent are required. The weight is optional as described above.
name,parent,weight
cars,,
owned,cars,
traded,cars,
learned,cars,
pilot,owned,40
325ci,owned,40
accord,owned,20
chevette,traded,10
odyssey,learned,20
maxima,learned,10However, if parents are not unique, the tool requires id, name and parentId to create a hierarchy from this data set.
id,name,parentId,weight
1,Father,,
2,Alice,1,
3,Alice,1,
4,Bob,2,10
5,Doris,3,20MIT