Network - interaction

Used for all user interaction with the network. Handles mouse and touch events as well as the navigation buttons and the popups.

Back to overview.

Options

The options for the interaction module have to be contained in an object titled 'interaction'.

Click on the full options or shorthand options to show how these options are supposed to be used.


This is a list of all the methods in the public API. They are collected here from all individual modules.

NameTypeDefaultDescription
dragNodes Boolean true When true, the nodes that are not fixed can be dragged by the user.
dragView Boolean true When true, the view can be dragged around by the user.
hideEdgesOnDrag Boolean false When true, the edges are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.
hideNodesOnDrag Boolean false When true, the nodes are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.
hover Boolean false When true, the nodes use their hover colors when the mouse moves over them.
hoverConnectedEdges Boolean true When true, on hovering over a node, it's connecting edges are highlighted.
keyboard Object or Boolean Object When true, the keyboard shortcuts are enabled with the default settings. For further customization, you can supply an object.
multiselect Boolean false When true, a longheld click (or touch) as well as a control-click will add to the selection.
navigationButtons Boolean false When true, navigation buttons are drawn on the network canvas. These are HTML buttons and can be completely customized using CSS.
selectable BooleantrueWhen true, the nodes and edges can be selected by the user.
selectConnectedEdges BooleantrueWhen true, on selecting a node, its connecting edges are highlighted.
tooltipDelay Number 300 When nodes or edges have a defined 'title' field, this can be shown as a pop-up tooltip. The tooltip itself is an HTML element that can be fully styled using CSS. The delay is the amount of time in milliseconds it takes before the tooltip is shown.
zoomView Boolean true When true, the user can zoom in.