You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Labels should be rendered in black and not change colors
Labels are initially rendered as the same color as their edge, when resizing the labels all change to the same color, which is the color of the last edge added in the code (see small example below).
Steps to reproduce: Click here and resize with the mouse/zoom feature and watch the label color get messed up. It also sets the labelColor and the global label color but neither of those work. Note that if you switch the order that the edges are added the final label color follows that.
There are multiple different topics here. First, there are multiple issues in your code sample:
Directly mutating the sigmaInstance.settings will modify the settings indeed, but sigma will not catch it. This explains why the color changes after interacting with sigma. The proper way to update sigma's settings is to use the methods setSetting, setSettings or updateSetting
The renderer object in your settings definition is useless now, and looks a lot like some things that were recognized in sigma version 1, before we dropped the canvas (ie no WebGL) support
The edgeLabelColor setting has to be either shaped as { color: '#000' } (as in your first example), or as { attribute: 'labelColor', color: '#000' } (in which case, color is the default/fallback labels color, for those who do not have proper labelColor values)
There is absolutely no proper documentation on this polymorphism for the edgeLabelColor setting (nor for the similar labelColor, actually). I'll add some in the Customizing graph appearance as soon as I can.
Steps to reproduce: Click here and resize with the mouse/zoom feature and watch the label color get messed up. It also sets the labelColor and the global label color but neither of those work. Note that if you switch the order that the edges are added the final label color follows that.
https://codesandbox.io/p/sandbox/sigma-template-forked-znjq75
The text was updated successfully, but these errors were encountered: