WebGraphviz: Graphviz in the Browser
11–20 of 22 posts
Re: WebGraphviz: Graphviz in the Browser
#12While this is certainly interesting, I've been looking for a JS tikz port using
Re: WebGraphviz: Graphviz in the Browser
#13There's no way, right? Was JS even this functional back in 93?
Hmm, I wonder what the cite at the bottom means then:
Object Oriented Graphs
Stephen North, 3/19/93
Searching Stephen North brings up a very interesting Google Scholar page full of citations about graphs and dot: https://scholar.google.com/citations?user=_QJP9-0AAAAJ&hl=en
Neato. (Ha. Cue yakety-yak music.)
Holy moly! Attention HN, we have a delightful mystery on our hands! Sound the alarm: http://www.webgraphviz.com/viz.js
So who cares? Well, it's clojure-compiled for one, so all the variables are all Yu Ugy Jagugnug (i.e. Worf would understand).
For two, the js-beautified version is 56,586 lines! What could this be?
It's all hardcore math/algorithm type code. No comments, no indication of how to pick up the scent. Hmmm.
Welp, there goes my afteroon. See you on the flipside. tugs feverishly at massive ball of string^Wyarn^WJS
Here's a beautified gist, if you want to dig. https://gist.github.com/anonymous/52cd90a1fa9c36b1b3e87a431d...
(Seriously though, WTF is going on in that file? The last time I saw 55k lines of condensed algorithms, it was when I concatenated together all of emacs' source code from one of its earliest commits.)
Oh.. Is this just emscripten? It looks like compiler output. Yeah, "g | 0" is an asm.js trick.
Man.. This is a really effective way to obfuscate code, holy moly. So I'm guessing that's just graphviz's C code?
EDIT: Yup. At the very bottom, there's a single string, literally the only string in the entire file that gives any clue what the heck is going on: "vizRenderFromString".
And indeed, it leads us to https://github.com/mdaines/viz.js/blob/a8f5fd9ec41482e31bb0b... and more generally to the viz.js codebase: https://github.com/mdaines/viz.js
Oh, duh. Graphviz was written back in '93, and that sample code contains a citation back to its author.
What a cool program! And a cool sequence of layers... I love the onion-y nature of modern computing.
Re: WebGraphviz: Graphviz in the Browser
#14Re: WebGraphviz: Graphviz in the Browser
#15Re: WebGraphviz: Graphviz in the Browser
#16I personally find http://viz-js.com to be superior.
For people who don't know Viz.js, it is basically GraphViz compiled for the web as ASM.js using emscripten plus a convenient way to call it. Usage is simple: you give the DOT code, and it returns an SVG document as string (other formats are actually supported).
Viz.js is awesome. Thanks Mike Daines! And obviously, thanks Graphviz!
Webgraphiz uses a viz.js file. Is it actually the same Viz.js? (edit: yes, it is)
Re: WebGraphviz: Graphviz in the Browser
#17Re: WebGraphviz: Graphviz in the Browser
#18While this is certainly interesting, I've been looking for a JS tikz port using
visjs.org can render graphs using canvas : http://visjs.org/network_examples.html
[1]: https://www.sharelatex.com/blog/2013/05/28/How-to-draw-Vecto...
Re: WebGraphviz: Graphviz in the Browser
#19Graphviz can output to svg and that's all this seems to be doing. I guess it saves you install it.
Re: WebGraphviz: Graphviz in the Browser
#20Wait, was this really written in 93? There's no way, right? Was JS even this functional back in 93? Hmm, I wonder what the cite at the bottom means then: Object Oriented Graphs Stephen North, 3/19/93 Searching Stephen North brings up a very interesting Google Scholar page full of citations about graphs and dot: https://scholar.google.com/citations?user=_QJP9-0AAAAJ&hl=en Neato. (Ha. Cue yakety-yak music.) Holy moly!…