0

Using Vis.js, I'm trying to create a network graph that displays a collection of nodes. Each node is box shaped with some text inside it. I want to add a small colored circle besides the text that will change it's color depends on the data provided.

Is such functionality even possible in Vis, if so, how could I achieve it ?

rene
  • 41,474
  • 78
  • 114
  • 152
svarog
  • 9,477
  • 4
  • 61
  • 77

1 Answers1

1

It's not possible to add something like a dot inside the box, you can only display plain text.

You can give the box and text itself a custom color, or you can give the nodes a shape dot (text is then displayed below the nodes), and give the node a specific color.

Example: http://visjs.org/examples/network/06_groups.html

Shrout1
  • 2,497
  • 4
  • 42
  • 65
Jos de Jong
  • 6,602
  • 3
  • 38
  • 58
  • In the end I've turned to D3.js, and just concatenated a small rectangular HTML template to a connecting line and added a small circle shape on top of it. – svarog Feb 06 '15 at 08:17
  • how did you use a rectangular html template as a node in D3.js? – user151496 May 05 '15 at 15:15