jagenjo / litegraph.js

A graph node engine and editor written in Javascript similar to PD or UDK Blueprints, comes with its own editor in HTML5 Canvas2D. The engine can run client side or server side using Node. It allows to export graphs as JSONs to be included in applications independently.
MIT License
6.56k stars 700 forks source link

Investigate if toposort could be useful for auto position of nodes #9

Closed kriffe closed 6 years ago

kriffe commented 6 years ago

Perhaps the toposort library could be used for automatic node placement (if not already implemented)?

Or perhaps it could be useful in some other way.

https://www.npmjs.com/package/toposort

Used in https://github.com/GooTechnologies/shader-graph

jagenjo commented 6 years ago

I can implement it easily, I already have the level where every node belongs. I will try

kriffe commented 6 years ago

Great!

Looks like the package is designed to be a node module (used with require). If you rewrite the last lines in topsort.js as an optional export (see below) it can be tested. And if it works good I can publish a fork on npm with the optional and we can include it as a dependency in through npm (npm install package.json --save topsort)

Original end of file

//... 
module.exports = topsort

End of file rewrite for include as Githubissues.

  • Githubissues is a development platform for aggregating issues.