javascriptcanvasvis.jschap-links-library

vis.js add a small circle inside a box node


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 ?


Solution

  • 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