ds-visualizer
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

ds-visualizer

Generate visualization of complex data structure on the fly

Table of contents

Features

  • Visualize complex data structure (currently only include Tree and Undirected 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.

License

MIT

Package Sidebar

Install

npm i ds-visualizer

Weekly Downloads

0

Version

1.0.8

License

MIT

Unpacked Size

18.4 kB

Total Files

37

Last publish

Collaborators

  • hizen2501