I would like to simply show/hide the labels of the edges of my vis.js-network - is this possible?
I have tried to update the edges in the vis.js-data structure:
- Delete the
labelproperty - doesn't work - Set the
labeltoundefined- doesn't work - Set the
labelto''- doesn't work - Set the
labelto' '- works
I would prefer a network-wise toggle of some kind, but I haven't found one.
Is there a better way of doing this?
An alternative to updating the
labelproperty on each edge is to change the font color to be transparent for all edges. ThesetOptions()method can be used to update the options and will apply all edges in the network. The optionsedges.font.colorandedges.font.strokeColorshould both be updated, then returned to their original values to display the edges.Example below and also at https://jsfiddle.net/rk9s87ud/.