sigma.js icon indicating copy to clipboard operation
sigma.js copied to clipboard

Showing Node Labels without Edge Labels

Open Gykonik opened this issue 2 years ago • 1 comments

Is there a way to enforce node labels using graph.setNodeAttribute(nodeKey, "forceLabel", true) without simultaneously enforcing edge labels? I aim to have separate toggles for "Enforce Node Labels" and "Enforce Edge Labels". While the latter works as intended, the former inadvertently enforces all edge labels, which is undesirable.

Upon examining the Sigma.js code, I identified that this line triggers the automatic insertion of edge labels through the edgeLabelsToDisplayFromNodes function.

Currently, I haven't found any setting or customization option to prevent this behavior. Is there an existing solution, or should this be seen as a potential feature enhancement?

Gykonik avatar Oct 26 '23 11:10 Gykonik

This is the setting I use, works for me

        labelDensity: 1000, // magic number, it works and I didn't investigate much more
        labelRenderedSizeThreshold: 0, // display labels even if the node is small/zoomed out/packed
        renderLabels: true,
        renderEdgeLabels: false,

f-gueguen avatar Dec 04 '23 02:12 f-gueguen