ZoomCharts Documentation

Version: 1.21.1 (2024-11-08)

NetChart.settings.nodeMenu

This section is defined by the type ItemsChartSettingsNodeMenu.

Configurable node menu with option to specify a range of displaying buttons.

Properties

Inherited from: ItemsChartSettingsMenu
Version 1.12.0: added support for the custom buttons.

Buttons to show in the node menu. It is possible to use both custom buttons and built-in buttons. When built-in buttons are used, they will be shown and hidden as necessary based on the node state. For example, the "unfocus" button will only be available for focused nodes; the "expand" button will only be available if there are hidden neighbor nodes, etc.

Currently the following built-in buttons are supported:

  • "btn:expand" - expands the node. All nodes that are linked to this node are shown.
  • "btn:collapse" - collapses the node. In focusnodes navigation this hides all linked nodes with a smaller relevance; in other navigation modes this hides this node and all linked nodes.
  • "btn:close" - closes the node. Unavailable for focusnodes navigation; in other navigation modes hides all linked nodes that do not have any links to nodes other than this node or nodes directly linked to this node.
  • "btn:focus" - focuses the node. This is most useful for focusnodes navigation, but available for all navigation modes.
  • "btn:unfocus" - unfocuses the node. This is most useful for focusnodes navigation but available for all navigation modes.
  • "btn:lock" - pins the node in place and prevents the layout algorithm from moving it around.
  • "btn:unlock" - unpins the node and allows the layout algorithm to position the node as necessary.
  • "btn:hide" - Hides this node.
  • "expand" - Composite setting including "btn:expand", "btn:collapse" and "btn:close"
  • "focus" - Composite setting including "btn:focus" and "btn:unfocus"
  • "lock" - Composite setting including "btn:lock" and "btn:unlock"
  • "hide" - Same as "btn:hide", included for backwards compatibility
contentsFunction: (data: ItemsChartDataObjectNode, node: ItemsChartNode, callback: (result: string | HTMLElement) => void) => string | HTMLElement
Default value: null
Inherited from: ItemsChartSettingsMenu
Version 1.9.0: added the ability to return HTMLElement.

Prepare html string or DOM element to include in the menu. Called whenever a menu is about to be shown.

If this callback is not defined, the menu will display the label of the element.

Parameters
callback: (result: string | HTMLElement) => void
Parameters
Return value
Data type: string | string | HTMLElement

A HTML string or DOM element to include in the menu. Alternatively return null and call callback() later.

enabled: boolean
Default value: true
Inherited from: ItemsChartSettingsMenu

Show/hide node/link menu.

position: "pointer" | "center" | "outside"
Default value: "outside"

Where the menu is positioned relative to the node

showData: boolean
Default value: false
Inherited from: ItemsChartSettingsMenu

Whether to add a view data button to the menu. Useful for debugging.

X