grapheco/InteractiveGraph

Cannot change node's color after using app.insertNodes()

SmoothJM opened this issue · 2 comments

Hi! I would like to ask you a question about change the theme, especially changing nodes' color. I am using app.insertNodes() to insert nodes and edges into the graph, but I notice that all new nodes color is default blue color instead of the color I defined when I create GraphNavigator. I also used app.updateTheme(), but it can only change the nodes shape or all nodes color to be one color instead of changing nodes color to be different color in the pre-defined group object.

image
image

The data structure:
{ categories: string[]}
is defined in GSON. If you want to insert nodes into screen, you need use the data structure defined in Vis.js:
{group: string}
An example is shown in the figure below (used your theme in issue).
image
image

got it. Thanks!