pyvis icon indicating copy to clipboard operation
pyvis copied to clipboard

keep orientation of edge label

Open laimaretto opened this issue 3 years ago • 1 comments

Hi! So I have a plot of a computer network, and as such, I want to visualize the ports connecting each element.

Here you can see two of such elements, so device CO015 on port 1/2/5 is connected to device CO013 on port 1/2/7.

image

However, if do move CO015 a little bit, the label of the edge now is inverted...

image

... and now it seems that CO015 is using port 1/2/7, when this is actually not true. I think you can see the problem with this.

Is there an option to enable so that edge labels will not be inverted or rotated as you move nodes? In other words: how to avoid the label flipping? The idea would be that the label wouldn't be flipped no matter the position of the nodes ...

image

I'm parametrizing Pyvis with these options:

G.set_options("""
		var options = {
			"nodes": {
				"size":13,
			  	"font": {
			    	"size": 11
			  	}
			},
			"edges": {
				"arrowStrikethrough": false,
				"color": {
				"inherit": true
				},
				"font": {
				"size": 10,
				"align": "top"
				},
				"smooth": false
			},
			"manipulation": {
				"enabled": true,
				"initiallyActive": true
			},
			"physics": {
				"barnesHut": {
					"centralGravity": 0.2,
					"springLength": 100,
					"springConstant": 0.01,
					"damping": 0.7,
					"avoidOverlap": 1
				},
			"maxVelocity": 5,
			"minVelocity": 0.47,
			"solver": "barnesHut"
			}
		}
		""")

Thanks!

laimaretto avatar Jan 25 '21 01:01 laimaretto

Hi, any help with this, maybe? I think this should be possible by setting the options, but I'm not sure ... any suggestion would be of help...

Thanks!

laimaretto avatar Apr 29 '21 12:04 laimaretto