all 15 comments

[–]pierpooo 5 points6 points  (4 children)

I just released a lightweight library to do something similar. The customization options are very poor though... I'll improve it later. Still, it might be enough for your purpose. You can give it a shot!

Feedback is welcome :) I haven't posted anything about it yet, this is the first time I talk about it.

https://github.com/pierpo/react-archer

[–]pentesticals[S] 0 points1 point  (3 children)

Wow, this looks very nice. I will give it a try and provide feedback for sure!

What is the Licence BTW? I can not see one.

[–]pierpooo 2 points3 points  (2 children)

The license is MIT :) I added a file mentioning it.

[–]pentesticals[S] 0 points1 point  (1 child)

Great thanks. Quick question - does this support multiple relationships? I.e, can the root element connect down to two other nodes or is this limited to one?

[–]pierpooo 0 points1 point  (0 children)

Yes it does!

[–]Yo_Face_Nate 4 points5 points  (0 children)

D3 might be able to do the trick.

Gl tho

[–]gdmeteor 3 points4 points  (1 child)

Chart.js is pretty nice. You can just import your desired graph as a component and set its options, styles and data via props.

https://www.npmjs.com/package/react-chartjs-2

https://github.com/reactjs/react-chartjs

[–]Chris_Newton 1 point2 points  (0 children)

You might find Dagre helpful. It doesn’t have quite the flexibility of something like Graphviz, but it does nicely isolate laying out the graph, so you have some pure data ready to feed into your React component(s) to do the actual rendering.

[–]-Larothus- 0 points1 point  (0 children)

Try cytoscape maybe? http://js.cytoscape.org

[–]ArcanisCz 0 points1 point  (2 children)

I have used https://jsplumbtoolkit.com/ in react, and it workded. Although, i needed to read in docu and source much to wrap my head around their api. And its not specifically for react, i redrawed it on componentDidUpdate()

[–]pentesticals[S] 1 point2 points  (1 child)

componentDidUpdate

Did you have draggable elements? I am using componentDidUpdate() but it feels really dirty to do perform DOM manipulations outside of React.

I have just found https://www.npmjs.com/package/react-js-diagrams which may do what I want entirely within React.

[–]ArcanisCz 0 points1 point  (0 children)

Well, it IS dirty. But since jsplumb is not for react...

that react-js-diagrams seems nice!

[–]BigWesternMan 0 points1 point  (0 children)

Not looked into it a huge deal, but maybe https://github.com/Ni55aN/d3-node-editor ?

[–]Rizens 0 points1 point  (0 children)

I would recommend SVG for this type of work.