jimmybow / visdcc

Dash Core Components for Visualization.
MIT License
144 stars 18 forks source link

Setting the fontColor of the node labels #35

Closed doolingdavidrs21 closed 2 years ago

doolingdavidrs21 commented 3 years ago

IS there a way within the options argument to set the node label colors, either globally for all nodes or ideally individually for different nodes, looping through the nodes?

jimmybow commented 2 years ago

you need to set color for each node or edge by id
{ 'nodes':[ {'id': 1, 'color': color_A}, {'id': 2, 'color': color_B}, {'id': 3, 'color': color_C}, {'id': 4, 'color': color_D} ], 'edges':[ {'id':'1-3', 'from': 1, 'to': 3}, {'id':'1-2', 'from': 1, 'to': 2} ] } See documents of vis.js : https://visjs.github.io/vis-network/docs/network/