sim51 / react-sigma

Sigma React component
https://sim51.github.io/react-sigma/
Other
158 stars 27 forks source link

Instantiating with a given graph instance #17

Closed jacomyal closed 2 years ago

jacomyal commented 2 years ago

Currently, as I understand, react-sigma-v2 always initializes itself its own graphology instance.

In some of my applications, I tend to separate my views tree from my data logic, and I like to load my data and to initialize the graphology instance myself. Also, I've had other cases with a graphology instance that always exists (for graph algorithms, for instance), but that is not always displayed using sigma. Finally, as I write right now a classic app rendering GEXF graphs on web pages, it feels really weird to have to instantiate the SigmaContainer React component before having an actual graph to give. I always start by managing my data, and then, I deal with rendering.

For those cases, it would really help to allow giving react-sigma-v2 a graphology instance.

sim51 commented 2 years ago

With v2, it's possible, you can take a look at the live example : https://sim51.github.io/react-sigma/docs/example