Okilele
Okilele

Reputation: 85

In vis-network how to disable color change when selected or onmouseover

When selecting a node or onmouseover background and border color change. Background is set to default #D2E5FF. I do not want it changes and need to disable this feature.

I know using color: {highlight: { border: 'red', background: 'yellow' }}, in options I can set a color but this does not fix my problem as each of the nodes has its own color.

Upvotes: 0

Views: 460

Answers (2)

Mugges
Mugges

Reputation: 13

You can disable hover in options:

interaction: {
   hover: false,
   hoverConnectedEdges: false
   select: false,
   selectConnectedEdges: false
}

Upvotes: 0

Okilele
Okilele

Reputation: 85

It seems there is no way to forbid vis to highlight a selected node. But in your click handler you can unselect the node very easily:

network.selectNodes([])

Upvotes: 0

Related Questions