No description
Find a file
2017-09-01 14:54:55 +02:00
build first working version 2017-09-01 14:54:55 +02:00
example first working version 2017-09-01 14:54:55 +02:00
grammar first working version 2017-09-01 14:54:55 +02:00
src first working version 2017-09-01 14:54:55 +02:00
.gitignore initial draft 2017-09-01 10:47:30 +02:00
LICENSE Initial commit 2017-08-31 12:26:35 +02:00
package.json first working version 2017-09-01 14:54:55 +02:00
README.md initial draft 2017-09-01 10:47:30 +02:00
rollup.config.js first working version 2017-09-01 14:54:55 +02:00

d3-dot-graph

This module provides D3js compatible library to parse and load files in graphviz .dot (graph description language) format.

why?

While working on Java Platform Module System migration projects coming with Java 9 (as of August 2017), I am havily using jdeps which is generating DOT (.dot) files. These are usually visualized using dot tool of graphviz.

In most cases it is enough, but I wanted to have nicer d3js visualization and interaction.

usage

Usage is identical with well known ´d3.json([url], [callback])´ or ´d3.csv([url], [callback])´.

d3.dot("/path/to/graph.dot", function(error, graph) {
  if (error) throw error;
  console.log(JSON.stringify(graph, null, true));
  //{
  //  "nodes": [ {"id": "Myriel"}, {"id": "Napoleon"}],
  //  "links": [ {"source": "Myriel"}, {"target": "Napoleon"}]
  //}  
});

parser

The parser was generated using PEG.js. The grammer is taken from here cpettitt/graphlib-dot. Thanks to Chris Pettitt.

You can also use parser independently from loader and converter.

build

notes