almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

Vis network giving backward direction edges in new vis versions 4.20 and 4.21 #4175

Open jhabap18 opened 5 years ago

jhabap18 commented 5 years ago

I have an vis example in vis 4.9 and vis 4.21 . In vis 4.9 it is drawing nodes in a way where edges are in forward direction but in 4.21 behavior is changed now. We have now backward direction edges also. User may want to see the network where edge direction is always forward for cleaner visualization.

attached images- Vis 4.9 4 9vis

Vis 4.21 vis4 21

Please suggest workaround in 4.20/4.21 to achieve this.

With vis 4.9 http://jsfiddle.net/prashantjhaba/sdfhcm6r/1/

with vis 4.21 https://jsfiddle.net/prashantjhaba/348nuste/

adamschachne commented 5 years ago

In your second example, you have an edge: {"from":"N-1897344219","to":"N1369236262","id":"N-1897344219|N1369236262"},

If you want all edges to point "forward", then can't you just swap the from and to?

jhabap18 commented 5 years ago

Hi, I want all edges to be forward but can't swap 'from' and 'to' of any edge. My data is coming like this only. Any other workaround please? Is there a major algorithm change in newer version because of which it's giving backward edges?

adamschachne commented 5 years ago

Try changing these in your hierarchical options:

"direction":"RL",
"sortMethod":"hubsize"
jhabap18 commented 5 years ago

It's working . Let me try with several other examples

jhabap18 commented 5 years ago

It doesn't work for some other examples as different groups come in same level. like below image-

image

Any other workaround- :) ?

jhabap18 commented 5 years ago

Hi Adam, any other workaround please? Last version for vis where only forward edges getting created is 4.10 .