jacomyal / sigma.js

A JavaScript library aimed at visualizing graphs of thousands of nodes and edges
https://www.sigmajs.org/
MIT License
11.31k stars 1.59k forks source link

Draw hierarchy for unhovered labels and node #1451

Open StockerGaming opened 3 months ago

StockerGaming commented 3 months ago

When writing custom label renderers, the label is always drawn on top of any nodes, including the one that belongs to the label. #1444 is related to this issue. When adjusting the draw hierarchy of unhovered nodes via CSS so that they are drawn over labels, nodes are also drawn on top of labels of other nodes, which is not my intention. Is there a way to get nodes drawn only over their own labels right now?

Many thanks.

StockerGaming commented 2 months ago

Another thing that control over this would prevent is situations like this: grafik Here the label of the right node is drawn above the laben of the left node, while its node is drawn under the label of the left node, which is visually confusing

jacomyal commented 1 month ago

Hi @StockerGaming,

Normally, there is an additional layer, sigma-hoverNodes, that renders only the highlighted and hovered nodes, on top of the hover labels. Weirdly, in your capture, this layer seems to be missing. By the way, I just added a new documentation page, to better describe sigma's layers and what they do, and how to manipulate custom layers: https://www.sigmajs.org/docs/advanced/layers

It looks like it is either an issue from your code, where you would wrongly manipulate the layers, or you reached some case where sigma breaks for some reason... Could you please try to produce some minimal code to reproduce this issue? Thanks!