codeout / inet-henge

Generate d3.js based Network Diagram from JSON data.
MIT License
257 stars 38 forks source link

Store a fixed position in the .json file? #28

Open guillaumeVilar opened 3 years ago

guillaumeVilar commented 3 years ago

Hi,

I was wondering if there is a way to store fixed position inside the .json file?

If I understand correctly the positionCache option will store the position in the browser cache. I would like to store a fixed position in the json file so all the users will see the same initial diagram.

Thanks a lot for your help.

codeout commented 3 years ago

No, we cannot define node positions in .json file currently. But I think the same .json will generate the same initial diagram as the library places nodes according to the internal rule, not randomly, does it?

If you see different initial diagrams from the same .json, we need to think about your suggestion.

A pull request will be always welcomed :)