Skip to content

What algorithm is using for nodeAutoColorBy? #525

Answered by vasturiano
dzhai5 asked this question in Q&A
Discussion options

You must be logged in to vote

@dzhai5 if auto-coloring is enabled, nodes that don't already have a color associated get assigned one according to the criteria set in nodeAutoColorBy.
The colors come from d3's schemePaired.

Relevant source code:
https://github.com/vasturiano/three-forcegraph/blob/d091b6f7d09a0fd35032cad560b19dcbfe76bd3f/src/forcegraph-kapsule.js#L611-L614

https://github.com/vasturiano/three-forcegraph/blob/master/src/utils/color-utils.js

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dzhai5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants