Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Graphviz for client-side auto layout #928

Open
astoeckel opened this issue Nov 3, 2017 · 1 comment
Open

Use Graphviz for client-side auto layout #928

astoeckel opened this issue Nov 3, 2017 · 1 comment

Comments

@astoeckel
Copy link
Contributor

astoeckel commented Nov 3, 2017

This issue is to document my crazy idea to use graphviz for improved auto-layout in nengo GUI. This would have some advantages:

  • Possibly better layout for hierarchical networks
  • Generated dot graph descriptions could be re-used to generate high-quality network renderings for publications, etc.

So my proposal would be the following:

  • When the user clicks the auto-layout button, on the client-side, translate the graph datastructure to an appropriate .dot representation (in memory). The same .dot file can be easily offered for download as well (e.g. via URL.createObjectURL)
  • Pass the .dot file to a stripped-down graphviz running on the client (the WASM version), tell graphviz to generate layout data only (plain format)
  • Turn the layout data into the nengo-gui SVG representation

Graphviz is licensed under a permissive licesne (Eclipse Public License), so this shouldn't be an issue.

See [1] for a WASM/asmJS version of graphviz and [2] for a demo. Some functionality can surely be thrown away to reduce the binary size (at the moment 700kB asmJS, WASM is probably 2-3 times smaller)
[1] https://github.com/mdaines/viz.js
[2] http://viz-js.com/

@jgosmann
Copy link
Collaborator

jgosmann commented Nov 4, 2017

Somewhat related (in so far as it was also an attempt to use GraphViz, but not inside the GUI): nengo/nengo#524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants