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
Something like this project, a JS library which supports the generation of arbitrary-length sequences of visually distinct colors, would make this fairly simple. Pseudocode for implementing this feature:
Identify the number of unique values of the given attribute (depending on the situation, we should probably do this with a case insensitive search). Let's call this value c. We should probably define a default value, if it's not guaranteed that every node will have the attribute in question defined.
Save all unique values as an array or something.
var colorList = distinctColors({count: c});
Next, iterate over the array of unique values to create an Object mapping of unique value to a distinct color. Might wanna define a helper function to convert Color objects to hex color strings. This mapping should probably be a global variable, so it can be accessed multiple times.
At this point we can just modify getNodeColorization() or something accordingly, using the mapping as a guide.
The text was updated successfully, but these errors were encountered:
e.g. an assigned
species
attribute or something.Something like this project, a JS library which supports the generation of arbitrary-length sequences of visually distinct colors, would make this fairly simple. Pseudocode for implementing this feature:
c
. We should probably define a default value, if it's not guaranteed that every node will have the attribute in question defined.var colorList = distinctColors({count: c});
Color
objects to hex color strings. This mapping should probably be a global variable, so it can be accessed multiple times.getNodeColorization()
or something accordingly, using the mapping as a guide.The text was updated successfully, but these errors were encountered: