-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Without Server #49
Comments
The json-based editor doesn't rely on the server, neither for layout nor for diagram generation. The corresponding code can be found here. |
Great, thanks for the pointer! I am looking into wrapping this as a React library. |
Have you considered publishing the client as a package on NPM to make it easier to reuse the rendering logic without having to copy all the code? |
Not really. The example page simply evolved over time. Publishing a clean package with minimum requirements and a proper interface requires at least a little effort :). Also, I'm not sure if sprotty already offers something as they frequently use ELK for layout. @spoenemann? |
Yep, totally understand. I was thinking that over just using ELK, Sprotty offers an actual engine to materialize the graph on the page, as a replacement for something like cytoscapejs |
FYI, there's been a discussion a while back regarding simple rendering: kieler/elkjs#85. Unfortunately, I've never found the time to look at it in further detail. |
Thanks for the pointer! I noticed that in the JSON editor, you have to put in the width and height explicitly for the nodes. However, with the elkt you don't. Do you know if it's possible to use the JS only code to automatically compute the widths and height based on the size of the node (the labels, etc)? |
Slightly off-topic to the issue:
|
Thanks for the other pointers. In trying to figure out how to get the browser based only method to generate node sizes, I also found kieler/elkjs#128 (comment) where you say:
Could you point me to where it does this estimation to see if I could use it with the code in the current JSON viewer to automatically try to size the nodes based on their label sizes? |
Not off the top of my head as that happens somewhere in sprotty. |
Not sure whether that's what you're looking for, but we have https://www.npmjs.com/package/sprotty-elk |
Is it possible to create a similar editor without having a backend Java server? I see that elkjs lets you do the layout client side.
The text was updated successfully, but these errors were encountered: