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

question : any suggestions on hierarchical layout for many many nodes on same level? #117

Closed
dockstreet opened this issue Nov 25, 2016 · 3 comments

Comments

@dockstreet
Copy link

dockstreet commented Nov 25, 2016

Question - We have been trying out the levels feature for nodes and that is working well when we have a limited set of nodes. Are there any suggestions around handling cases where you have an extensive list of nodes on the same level. What we are seeing is sometimes the text for the labels will run together. We have attempted to use avoid overlap for the nodes and various other visPhysics combinations by trial an error. Perhaps someone has run into this and there is a way to make the layout more clean?

Maybe this could be resolved like a staggered level or alternating levels? In other words a level which would intentionally have nodes slightly higher , slightly lower alternating so that the nodes labels would not overlap . Not sure how that would work?

One other thing I've noticed is that if I don't set the damping, unrelated nodes will also move. Dampening also effects the expansion of the nodes making them closer together, which sometimes is not desirable.

Is there any other unpublished guidance/recipes on how to vary many of the visPhysics parameters based on the set of nodes & edges? I'm aware of this http://visjs.org/examples/network/other/configuration.html and this almende/vis#555 , but not sure if there is anything else. Maybe a possible enhancement would be to include an example in
shiny::runApp(system.file("shiny", package = "visNetwork")) to showcase the features?

I will try to come up with a MCVE to demonstrate what i'm seeing, it may take me a bit of time as I will have to do a lot of redaction, thanks for the patience.

@dockstreet dockstreet changed the title any suggestions on hierarchical layout for many many nodes on same line? any suggestions on hierarchical layout for many many nodes on same level? Nov 25, 2016
@dockstreet dockstreet changed the title any suggestions on hierarchical layout for many many nodes on same level? question : any suggestions on hierarchical layout for many many nodes on same level? Nov 28, 2016
@bthieurmel
Copy link
Contributor

If you don't know / test, you can use the configuration tools with R also (not in RStudio viewer) :

nodes <- data.frame(id = 1:100, level = c(1,rep(2,99)))
edges <- data.frame(from = rep(1, 99), to = c(2:100))

visNetwork(nodes, edges) %>%
  visHierarchicalLayout() %>%
  visConfigure(enabled = TRUE)

@dockstreet
Copy link
Author

This is great info and helpful ! thanks

I also found this : almende/vis#1964

I asked if the labels could be added to the physics

@dockstreet
Copy link
Author

I'm closing this as I believe the answer makes sense, and labels may in fact need to be part of the physics - perhaps almende/vis#1964 may need to be addressed firstly.

Thanks for the guidance

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

No branches or pull requests

2 participants