Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a yaml or json dialect for general purposes graphviz?

I see wireviz is defined using yaml and builds on graphviz. I’ve always wanted to do more with graphviz but reluctant to use the [dot language][0] graphviz uses by default.

[0]: http://graphviz.org/doc/info/lang.html



There are stuff that converts yaml to dot, like https://gist.github.com/rchrd2/247d1f1e86fa3749429791cf45705...

but honestly just write dot, it's a simple format

see also https://codefreezr.github.io/awesome-graphviz/


Yeah after doing more research I’m leaning towards just writing dot. It does look nice.

Still, from a programmatic standpoint is there JSON equivalent? If wanted to build something like WireViz I would think that would be the most strait forward approach. I know there are lots of libs that compose it with mixes classes but I rather just build json objects...


I just found out that graphviz supports json as output. Check out https://graphviz.org/doc/info/output.html#d:json

(found this here https://stackoverflow.com/a/51443514)

I'm pretty sure that there's some tool out there to convert Graphviz's own json format back to dot

Perhaps https://github.com/jsongraph/jgf-dot do it

And if not, https://codefreezr.github.io/awesome-graphviz/#generators-an... might contain something useful


Cool! Can you use the json as input?


I suppose https://github.com/jsongraph/jgf-dot does exactly that, but not exactly with Graphviz's own json syntax, but using this spec:

https://github.com/jsongraph/json-graph-specification


Looks like the The dot language originated in something called [Webdot][0]

[0]: https://gitlab.com/graphviz/webdot


It's much older. https://linux.die.net/man/1/dot references papers from 1989.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: