Skip to content

jsongraph/jgf-dot

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

jgf-dot [UNMAINTAINED]

[UNMAINTAINED - dependent on graphlib-dot which is unmaintained and only works for JGF version 1.0]

The JGF team welcomes who would like to take over maintaining it.

Convert a json graph into a dot file for use with Graphviz and other visualizers

Command line

Install nodejs and run:

npm install -g jgf-dot

Then you can do the conversion using either:

cat graph.json | jgfdot > graph.dot
jgfdot graph.json > graph.dot

jgfdot

Reads a json graph from STDIN or file_name and outputs the Dot file to STDOUT

Docker

Install docker and run:

docker build -t jgfdot .
cat example/graph.json | docker run --rm --interactive jgfdot

Javascript API

You can also use the programmatic API to convert json graph objects to dot file strings

var toDot = require("jgf-dot");

var graph = require("./graph.json");

var fs = require("fs");

var dot = toDot(graph);

fs.writeFileSync("graph.dot", dot, "utf8");

NOTE: Currently the graph isn't being valdated before it gets parsed, but that feature is on the todo list.

About

[DEPRECATED] Convert a json graph into a dot file for use with Graphviz and other visualizers

Resources

License

Stars

Watchers

Forks

Packages

No packages published