Skip to content
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

[feature request] Replace standard graph layout algorithm to something more correct. #103

Open
Claus1 opened this issue Mar 11, 2023 · 4 comments
Labels
feature request New feature or request

Comments

@Claus1
Copy link

Claus1 commented Mar 11, 2023

For me standard graph layout algorithm is the weakest place in the library. Almost useless for drawing for my cases
image

At least it has to be
image

@dash14 dash14 added the feature request New feature or request label Mar 15, 2023
@dash14
Copy link
Owner

dash14 commented Mar 15, 2023

Hi @Claus1,

Thank you for your feedback! As you pointed out, v-network-graph does not have a feature for layouts that take into account the connection relationships of the graph.

The appropriate layout will vary depending on the application being developed. With v-network-graph, it is possible to specify the display position of each node individually. Therefore, for now, I would appreciate it if developers could implement the desired layout by specifying it in the layouts prop.

Something similar to the layout you have shown may be achieved by using dagre. You may have already seen it, but here is a link to an example I created earlier.
https://dash14.github.io/v-network-graph/examples/layout.html#automatic-layout

However, I do think that it would be useful to have several typical layouts available. Therefore, there is a possibility that I will incorporate some layouts in the future.

Best Regards

@Claus1
Copy link
Author

Claus1 commented Mar 15, 2023

Hi dash14! I integrated dagre but anyway it doesn't suit for me because big graphs looks not good (edges has to be curved and not crossed for that when possible) and the drawing is too slow, comparing with cytoscape or sigmajs. Better to point somewhere in docs that.

@dash14
Copy link
Owner

dash14 commented Mar 16, 2023

@Claus1
Thank you for your reply!
Sorry to hear that you have already tried dagre.

Note that regarding the performance of drawing large graphs, since cytoscape and sigmajs are WebGL-based, it is difficult for v-network-graph, which is SVG-based, to achieve the same level of performance in the first place.

Currently, layout algorithms are outside the scope of v-network-graph, but I would consider providing some algorithms in the future.
Thank you for your feedback!

@jlpereira
Copy link

Hi @dash14

First I want to thank you for your amazing work on this library!!

Reading this issue I realize I'm not the only one having performance issues when working with large graphics. D3 uses SVG to create graphs, I have created some with hundreds of nodes and the performance was great. In the case of your library, are you sure the performance issue is related to SVG and not reactive data? I ran into a similar performance issue when working with a leaflet map passing reactive data to it. After removing the reactivity, the map worked without a problem. But I don't know if this is the case here.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants