ds-visualizer
v1.0.8
Published
Generate visualization of complex data structure on the fly
Downloads
1
Maintainers
Readme
ds-visualizer
Generate visualization of complex data structure on the fly
Table of contents
Features
- Visualize complex data structure (currently only include
Tree
andUndirected Graph
)
Installing
Using npm:
$ npm install ds-visualizer
Using yarn:
$ yarn add ds-visualizer
Example
note: CommonJS usage
Tree
const { BinaryTree } = require("ds-visualizer");
const simpleTree = [3, 9, 20, null, null, 15, 7, 8];
const tree = new BinaryTree(simpleTree);
tree.visualize("output/tree.svg");
// A tree.svg file will be generate with the visualization of the data structure
Graph
const { Graph } = require("ds-visualizer");
const simpleGraph = [
[1, 3],
[0, 2],
[1, 3],
[0, 2]
];
const graph = new Graph(simpleGraph);
graph.visualize("output/graph.svg");
// A graph.svg file will be generate with the visualization of the data structure
Credits
This project is heavily inspired by the python package written by Bill Tran. Please check out his work if you ever use Python.
Contributing
For more info on how to contribute to ds-visualizer, see the docs.