almende / vis

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

Network: Drawing the labels on top #3527

Open umpani opened 6 years ago

umpani commented 6 years ago

Hi,

at first: You are doning a great job. The code AND the support!!

Now once again a question.

Is it possible to draw the networkgraph layer by layer. I have a huge network with a lot of nodes an labels. The nodes are above the edges. This is ok. But I would like to draw all labels above nodes and edges. Acually, the labels where drawn together with the nodes, so some nodes are above labels. So you cannot read them anymore.

Is there a possibility to change the drawingorder?

Thanks umpani

wimrijnders commented 6 years ago

Sorry, no. At the moment, labels are drawn together with the nodes/edges they belong to.

Although it's an interesting question. Similar thought have popped up about being able to draw on specific layers, for example #2600. The drawing order will have to be revisited at some point.

wimrijnders commented 6 years ago

I suppose the least intrusive way to get this to work, is to have an option to specify drawing labels on top. That way backward compatibility would be retained. Does that make sense to you?

wimrijnders commented 6 years ago

Thank you for the kind words by the way.

I do my best to answer promptly to everyone, but it's too much, I can't keep up and I gave up doing so. I try not to think too much about those issues I haven't managed to respond to. You got lucky, I guess.

umpani commented 6 years ago

Yes this is a possible way to manage the issue. There might be situations, where it's important do draw the layers not on top. So, an option for this might be useful.

Thanks

wimrijnders commented 6 years ago

You know, I'm inclined to agree with you. I'm making this a feature request.

Edit: I changed the title, if you don't mind.

umpani commented 6 years ago

Great!

justinharrell commented 6 years ago

One thing that would be nice to go along with this and should be straight forward to change is having selected edges labels drawn first. Nodes do this, so if you select a node obscured by another it brings it to the front.

Basically selected items should always draw first.

wimrijnders commented 6 years ago

@justinharrell noted. However, they should still be drawn under the nodes.

This looks superficially easy, but it wouldn't hurt to do a good think about the implementation. It would solve a number of outstanding issues (which I don't have the energy right now to scavenge for). E.g. specifying the level of the before/after drawing callbacks would be beneficial, in relation to the drawing order of edges/nodes/labels.