A React library to design Diagrams with ease
github.com
github.com
I've been googling for this kind of library in the past couple of weeks and keep looking for "workflow editor" etc but simply haven't come up with any of these libraries.
I happen to be using a tablet now (Windows 2-in-1 device); going through all the examples on their Github page, all of them work perfectly with a pen (stylus)! That's impressive; something most interactive web stuff I've seen can't get right (collaborative whiteboards particularly suck at handling actual pens).
0: https://kitemaker.co, issue tracker loaded with hotkeys with a super rich issue editor
You should go and check it out!
[0]: https://ldd.github.io/react-tech-tree/
source (MIT): https://github.com/ldd/react-tech-tree
BUT i will give this one a chance :)
Add a few nodes so that I have node 1, node 2, node 3, node 4 then delete node 3, and add another node. I get two node 4
Now if I try to drag any of the two node 4, it always thinks I want to drag the latest node 4 that was added...
@@ -2,6 +2,8 @@
import Diagram, { createSchema, useSchema } from 'beautiful-react-diagrams';
import { Button } from 'beautiful-react-ui';
+let lastid=1
+
const initialSchema = createSchema({
nodes: [
{
@@ -39,8 +41,8 @@ const UncontrolledDiagram = () => {
const addNewNode = () => {
const nextNode = {
- id: `node-${schema.nodes.length+1}`,
- content: `Node ${schema.nodes.length+1}`,
+ id: `node-${lastid+=1}`,
+ content: `Node ${lastid}`,
coordinates: [
schema.nodes[schema.nodes.length - 1].coordinates[0] + 100,
schema.nodes[schema.nodes.length - 1].coordinates[1],Changing it to be a random string that gets created inside addNewNode instead removes all those issues.
We use Ember so we can't really embed this, but this is exactly what we need.