4 ms·
Nice work! I needed to use something to render directed graph in the browser and the biggest problem was the download size. This library is 851KB gzip, which
by _lce0 10y ago
Nice work!
I needed to use something to render directed graph in the browser and the biggest problem was the download size.
This library is 851KB gzip, which is way better than the 1.3MB I was using.
Maybe being able to bundle the engines (and output format) as separate modules could reduce its size?
So once again, great work!
- jodrellblank 10y agoMermaid.js can render directed graphs in the browser, and the minimised JS and CSS are ~620 KB. https://github.com/knsv/mermaid/tree/master/dist https://github.com/knsv/mermaid/tree/master/dist e.g. live online editor: http://knsv.github.io/mermaid/live_editor/#/edit/Z3JhcGggVEQKICAgIEJbImZhOmZhLXR3aXR0ZXIgZm9yIHBlYWNlIl0KICAgIEItLT5DW2ZhOmZhLWJhbiBmb3JiaWRkZW5dCiAgICBCLS0-RChmYTpmYS1zcGlubmVyKTsKICAgIEItLT5FKEEgZmE6ZmEtY2FtZXJhLXJldHJvIHBlcmhhcHM_KTs http://knsv.github.io/mermaid/live_editor/#/edit/Z3JhcGggVEQ...
- johnlbevan2 10y agoRelated HN Post: https://news.ycombinator.com/item?id=13326065 https://news.ycombinator.com/item?id=13326065
- jvehent 10y agoI just implemented directed graphs with cytoscape.js and it was fairly straightforward.
- hackcasual 10y agoWebAssembly would help reduce the size.
- ygra 10y agoIf you just want to render something and don't need layout, this could be very small. I guess, d3 might be one of the more popular options. At work I'm working on a graph drawing library and we have quite a bit more layout code; heck, for a hierarchical layout (akin to dot) you'd need about 4 or 5 MiB (no idea how well it gzips right now, though) of JS. Good layout algorithms can be complex, and thus large.
- a_e_k 10y agoHmm. Downloading the current viz.js from the releases page (v1.4.1) gives me a file that compresses down to 632K when I use 7-zip on its highest settings (7z -mx=9 -mfb=258 -mpass=15 -tgzip a viz.js.gz viz.js).