This is great, and I was just now preparing to sit down to slog through implementing something like along these lines. You just saved me a lot of time.
I really like the idea that the library doesn't try to do automatic layout, and you need to specify a nodes X/Y coords.
There are a few similar libraries where their layout algorithm is super frustarting and its implementation's so hard coupled it's really hard to change or use your own.
That's why we tried to make this library as simple as possible. It doesn't do any state updates besides the positions. You can easily store state inside nodes and change it as seen in the custom node example https://react-flow.netlify.app/custom-node
19 comments
[ 2.7 ms ] story [ 44.0 ms ] threadThere are a lot of similarly great React libraries that focus on just one high-level component. A few of my favorites that have saved me tons of time:
- react-grid-layout (https://github.com/STRML/react-grid-layout) for draggable / resizable grids with an easily-serializable layout.
- react-mosaic (https://github.com/nomcopter/react-mosaic) for tiling / movable window layouts.
- react-table (https://react-table.js.org/) for a very powerful, expandable table implementation.
Any visual coding scenario really.
https://ldd.github.io/react-tech-tree/#examples
So the answer is, to make games!
I used it my library for my own game here:
https://ldd.itch.io/nu
Or set up CI pipeline with this.
Or in cases when you want end users to set up flows, but they can't code.
There are a few similar libraries where their layout algorithm is super frustarting and its implementation's so hard coupled it's really hard to change or use your own.
For example if the nodes are objects in C++ and the edges are relations, you want to know the names of the members that point to the other nodes.
Labels on the edges would also be nice.
https://ldd.github.io/react-tech-tree/
It imitates a long X-Men family tree and slay the spire's room selection.
But this seems pretty cool, and a natural next-step to what I wanted to make.
http://www.webgraphviz.com/