--- title: Node Map component setup description: The Node Map provides an interactive graph with nodes and edges. This component is available only on the ServiceNow Store.Specify the nodes and edges that the Node Map component displays. Configure the style, persisted state, context menus, and other aspects of how the nodes and edges are displayed.If you have chosen a preset containing events, data handlers for those events are pre-selected by the controller, and no manual configuration is required. If the component has events that aren't included in the preset, you must add data handlers manually to configure those events.The Node Map requires a node macro component to render the nodes view. You can use the default node macro component or select a custom macro component. locale: en-US canonical_url: https://www.servicenow.com/docs/r/application-development/ui-builder/node-map-component-uib-setup.html release: brazil product: UI Builder classification: ui-builder topic_type: task last_updated: "2026-09-10" reading_time_minutes: 27 breadcrumb: [UIB Setup Information, UI Builder, Builder library, Developing your application, Classic app development, Building applications] --- # Node Map component setup The Node Map provides an interactive graph with nodes and edges. This component is available only on the ServiceNow Store. ## Before you begin This component contains a preset configuration. Presets automatically configure properties and event handlers for a component, making the component ready to work when you add it to a page. You can apply one preset to a single instance of a component on a page. For more information, see [Automatically configure components using presets](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/presets.md). A preset connects to a controller, which acts as a data resource for the component. Controllers provide the configuration data and event binding the component needs to function in your experience. For more information see [Bind data to UI pages using controllers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/controllers.md). This task assumes you have placed the component on the page and are ready to configure the properties and events. For instructions on accessing and using features in UI Builder, see [Customize UI Builder pages using components](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/work-components.md). **Note:** This document describes the latest component functionality. Go to the store to make sure you have the latest version of the component. Role required: admin or ui\_builder\_admin ## Procedure 1. Define a label for your Node Map that differentiates it from other components in the content tree. A descriptive label makes finding the component easier in a large list of components. For instructions on using the content tree, see [Manage UI pages and page variants](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/work-pages.md). \[Omitted image "node-map-content-tree.png"\] Alt text: Node map component in the page content tree. 2. Select the Node Map component, using one of these methods: - Click anywhere within the component. - Select the Node Map label you created for your component in the content tree. The configuration options appear in the setup panel on the right. \[Omitted image "node-map-config-tab.png"\] Alt text: Shows the config panel for node map **Parent Topic:**[UIB Setup Information](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/uib-setup-information.md) ## Node Map component properties Specify the nodes and edges that the Node Map component displays. Configure the style, persisted state, context menus, and other aspects of how the nodes and edges are displayed. ### Available presets Presets are intended to suit a specific use case. However, you can override a property that has a preset value with a custom configuration if necessary for your design. For details on overriding and resetting presets, see [Override a component preset](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/presets.md). **Important:** Preset values that you override aren't updated automatically when you upgrade the instance. - **__Unified map__** This preset connects user interactions to the node map with expand/collapse, programmatic selection, and home node. This preset requires the **Unified map** controller. **Note:** This preset is intended for use with Configuration Management Database \(CMDB\) data and may not be suitable for other data. Properties included in this preset are: - Node items - Edge items - Map layout - Home node - Fit to screen - Expanded group nodes - Hidden nodes - Hidden edges - Selected Element Id - Disable edges context menu - Disable 'show hidden connections' - Control panel buttons - Disable Collapse All - Show error state - Reduce motion ### Properties
| Label \[property\] | Description |
|---|---|
| Node items\[nodes\] | The node elements to draw on the map. Each node has its own node data object. For more information, see the example [Node items and edge items](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/node-map-component-uib-setup.md).Object structure: - `id` \{String\} \(Required\): Unique ID for the node. - `groupIds` \{Array\}: Tells which groups this node is a member of. Currently only one group is supported. - `isInactive` \{Boolean\}: Sets the node as inactive/disabled. Special style is applied and interactions are blocked. - `isGroup` \{Boolean\}: Sets the node as being a group. A special style for groups is applied in runtime. - `hideExpandCollapse` \{Boolean\}: Hides the expand/collapse button on the actions bar for a group node. - `partition` \{Integer\}: Sets the relative order of node layers. Nodes with a lower partition number appear above nodes with higher numbers. To optimize the layout, the node map might automatically split nodes with the same partition value into multiple layers. The default value is `0`. This property applies only if the map layout is **layered-groups**. - `fixedLayer` \{number\}: Negative or positive integer defining the order of node layers. This property applies only if the map layout is **unified-vertical**. - `tooltipContent` \{String\}: Custom tooltip content in valid HTML that displays when moving a cursor over the node. - `width` \{Number\}: Sets fixed width in pixels for this node, overriding the global setting. - `height` \{Number\}: Sets fixed height in pixels for this node, overriding the global setting. - `viewData` \{Object\}: Contains any properties that the Node macro component receives. For an example, see [Choosing the node macro component](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/node-map-component-uib-setup.md). The `primaryLabel` and `secondaryLabel` properties are reserved for the primary and secondary labels of the node, respectively. **Note:** - The Node data object isn’t restrictive. Add any more properties that you need. - You can also set the node items through data binding. When doing so, bear in mind that the parameters of the nodes and of the edges must match to avoid UI Builder timing issues when updating client state variables. Therefore, wrap node and edge client state variables into one JSON object. For example, here you wrap the variables into the `data` object, which you would put into the client state script: ``` data = { "nodes":{}, "edges":{} } ``` When you update the state, also update the data client state and bind it to the properties. For example, bind the properties to the `data` client state like this: ``` nodes: @state.data.nodes edges: @state.data.edges ``` And update the state in the client state script with this: ``` setState('data', data); ``` Here is a client script showing both the construction of the `data` object and the update to the state and the bound data client state: ```json const nodes = []; // new nodes data const edges = []; // new edges data const data = { nodes, edges }; api.setState('data', data); ``` |
| Edge items\[edges\] | Connection elements to draw as edges between the nodes. For more information, see the example [Node items and edge items](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/node-map-component-uib-setup.md).Object structure: - `id` \{String\} \(Required\): Unique ID for the edge. - `style` \{solid\|dashed\}: The style of the edge line. - `direction` \{original\|reverse\|none\}: The arrow direction. The `none` direction hides the arrow. - `sourceId` \{String\} \(Required\): The ID of the source node. - `targetId` \{String\} \(Required\): The ID of the target node. - `label` \{String\}: The textual label. - `tooltipContent` \{String\}: Custom tooltip content in valid HTML that displays when moving a cursor over the edge. - `status` \{String\}: The status of an edge shown with a color. The choices are primary \(dark purple\), critical \(red\), selection-primary \(gray\), high \(orange\), warning \(gold\), moderate \(lilac\), info \(blue\), positive \(green\), teal, brown, gray, green, green-yellow, magenta, orange, pink, purple, yellow, and none \(gray\). The choices are associated with CSS properties in the theme, and their colors can be customized. **Note:** - The Edge data object isn’t restrictive. Add any more properties that you need. - You can also set this property through data binding. When doing so, bear in mind that the parameters of the nodes and of the edges must match to avoid UI Builder timing issues when updating client state variables. For more information, see the note for the nodes property. |
| Map layout\[layout\] | The layout for calculating the position of nodes and edges.Choices are: - **hierarchical-topdown** \(default\) - **layered-groups** - **unified-force** - **unified-vertical** - **horizontal** **Note:** The "unified" layouts are optimized for use with Configuration Management Database \(CMDB\) data. They may not be suitable for other data. |
| Hide edge arrows\[hideEdgeArrows\] | When true, displays all edges as non-directional, without arrows.Default: **false** |
| Reduce spacing between nodes\[reduceNodeSpacing\] | Reduce vertical/horizontal space between nodes.Default: **false** |
| Merged edge segments\[mergeEdgeSegments\] | Merge edge lines for a more compact map view. This property applies only if the map layout is **layered-groups**.Default: **false** |
| Label scaling\[canLabelScale\] | Enables the label scaling.Default: **true** |
| Re-layout requested\[reLayoutRequested\] | An object that contains a timestamp that can be passed down to trigger a map re-layout.Default: **\{\\"timestamp\\": 1699889486659\}** |
| Label \[property\] | Description |
|---|---|
| Node view macrocomponent\[nodeMacroponent\] | Reference or sys\_id of a macro component to use as a custom node representation. You can choose from any Next Experience Components or a page in your workspace. If you don’t make a choice, the default node is used. For more information, see [Choosing the node macro component](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/application-development/ui-builder/node-map-component-uib-setup.md).Type: string Default: Node map default node |
| Node shape\[nodeShape\] | The shape of the nodes. Node map calculates edge length based on the node shape.Choices are: - Circle - Rectangle Default: Rectangle |
| Width\[nodeWidthMode\] | Select how the widths of node macro components are defined globally. The choices are:- **Fixed node width**: As specified in `nodeWidth`. - **Max node width**: Width set automatically but with the upper limit specified in `maxNodeWidth`. When a node exceeds this width, a horizontal scrollbar appears. - **Auto width**: Width set automatically with no limit. See the note after this table. Default: **Fixed node width** |
| Node width\[nodeWidth\] | The global node width in pixels when Width is set to **Fixed node width**.Default: **150** |
| Max node width\[maxNodeWidth\] | The maximum allowed width for nodes, defined in pixels. |
| Height\[nodeHeightMode\] | Select how the heights of node macro components are defined globally. The choices are:- **Fixed node height**: As specified in `nodeHeight`. - **Max node height**: Automatic node height with the upper limit specified in `maxNodeHeight`. When a node exceeds this height, a vertical scrollbar appears. - **Auto height**: Automatic unrestricted node height \(auto\). See the note after this table. Default: **Fixed node height** |
| Node height\[nodeHeight\] | The fixed node height in pixels when **Height** is set to **Fixed node height**.Default: **123** |
| Node spacing\[nodeSpacing\] | Space between nodes in the Force layout. Use values between 1 and 1000.Default: 250 |
| Max node height\[maxNodeHeight\] | The maximum height for all nodes, defined in pixels. |
| Default size\[nodeSize\] | The default size for nodes. Can be overridden in the node configuration. |
| Label \[property\] | Description |
|---|---|
| Home node\[homeNodeId\] | ID of the node to be set as 'Home.' In runtime, a special style is applied to identify the node. |
| Align to node ID\[alignToNodeId\] | Centers the viewport around the specified node. |
| Expanded group nodes\[expandedGroupNodeIds\] | Indicates which group nodes are expanded. These group nodes have a **Collapse** action in the action bar instead of an **Expand** action. |
| Hidden nodes\[hiddenNodeIds\] | IDs of nodes to hide. Hidden nodes participate in map layout but aren’t drawn and aren’t reachable on the map. |
| Hidden edges\[hiddenEdgeIds\] | IDs of edges to hide. Hidden edges participate in map layout but aren’t drawn and aren’t reachable on the map. |
| Inactive nodes \[inactiveNodeIds\] | A JSON array of nodes that you specify as inactive. Inactive nodes participate in map layout, but appear as inactive \(disabled\). |
| Inactive edges\[inactiveEdgeIds\] | A JSON array of edges that you specify as inactive. Inactive edges participate in map layout, but appear as inactive \(disabled\). |
| Manage element selection \[manageElementSelection\] | When turned on, nodes and edges can only be selected programmatically, using the selectedElementId property. Default: turned off \(false\) |
| Fit to screen \[fitToScreen\] | Resizes the map to fit into the view port.Default: false |
| Selected Element Id \[selectedElementId\] | ID of selected node or edge. This feature is only activated when the `manageElementSelection` property is turned on.\(Deprecated: Use `selectedElements` instead\) |
| Selected Elements\[selectedElements\] | JSON array that contains the elements IDs to be auto selected. This feature is only activated when the `manageElementSelection` property is turned on. |
| Label \[property\] | Description |
|---|---|
| Disable nodes context menu\[disableNodesContextMenu\] | Disables the **More actions** context menu on the action bar for nodes.Default: **false** |
| Selection mode\[selectionMode\] | Sets the map selection mode. Only available when `manageElementSelection` is set to **false**.Choices: - Single - Multiple - \{\["single","multiple"\]\} Default: **single** |
| Suspend re-layout\[suspendReLayout\] | Prevent map elements from repositioning while new data is being added.Default: **false** |
| Disable edges context menu\[disableEdgesContextMenu\] | Disables the **More actions** context menu on the action bar for edges.Default: **false** |
| Contextual menu items\[contextualActions\] | Array of DropdownItems in the **More actions** contextual menu in the action bar. The array follows anyOf logic and can contain any number of items with or without children. Items without children have the following properties:- `id` \(string \| number\): Unique identifier for the item. - `label` \{string\}: Text that describes the item. - `count` \{number\}: Numeric indicator displayed next to the item. - `icon` \{string\}: Name of the icon to display next to the item. See the `now-icon` API and icon gallery for the list of valid names. Cannot be used with `presence`. - `presence` enum: \["available" \| "away" \| "busy" \| "offline"\]: Online status of a user to display in a list of users or statuses. Cannot be used with `icon`. - `disabled` \{Boolean\}: When true, the item is visible but not selectable by the user. - `keepMenuOpen` \{Boolean\}: Option for a menu item to stay open after selecting it to display a multi-level menu. - `type` \{string\} enum: \["node" \| "edge"\]: Whether the item is a node or an edge. - `behavior` \{string\} enum: \["default" \| "connection" \| "mousePosition"\]: A predefined behavior for the action. The default behavior is to dispatch an event when an item is clicked. The connection behavior is specific to type="node" and starts the process of adding connections between nodes. The mousePosition behavior is to use the last known open map menu position for adding new nodes. Items with children have only the `id` and `label`properties from this list directly in their subschema. They also contain a `children` array of items with the following properties: - `id` - `label` - `count` - `icon` - `presence` - `disabled` The `required` keys for each array identify the id and label pairs of required items and child items or entire `children` arrays that are required. |
| Map contextual menu items\[mapContextualActions\] | Array of contextual menu items to present in the map contextual menu. The contents are identical to the `contextualActions` property. |
| Disable expand\[disableExpand\] | When true, disables the "Expand/Collapse this group" action on all group nodes.Default: **false** |
| Disable 'home'\[disableHome\] | When true, disables the Home action on all nodes. Users are then unable to select a node as 'home.'Default: **false** |
| Disable 'show hidden connections'\[disableHiddenConnections\] | When true, turns off the hidden connections action on all nodes.Default: **false** |
| Disable control panel menu\[disableControlPanel\] | When true, turns off the control panel menu and its related events.Default: **false** |
| Control panel buttons \[controlPanelButtons\] | Array of additional buttons to present in the control panel.Array item properties: - `id` \{string\}: Unique identifier for the button. - `tooltipContent` \{string\}: Translatable tooltip text for the button. - `icon` \{string\}: Icon to use for the button. See the `now-icon` API and icon gallery for the list of valid names. - `order` \{integer\}: Relative position of the button on the control panel. - `disabled` \{boolean\}: When true, the button is visible but not selectable by the user. - `separator` \{boolean\}: When true, the button is separated by lines. |
| Disable align home node \[disableAlignHomeNode\] | Disable the 'Align to home node' feature and remove its button from control panel.Default: **false** |
| Disable Collapse All\[disableCollapseAll\] | Disable collapse all, remove its button from control panel. Can be bound to data, such as `@data.unified_map_1.disableControlPanelCollapseAll`.Default: **true** |
| Disable find on map \[disableFind\] | When turned on, hides the find on map input control.Default: **false** |
| Disable minimap \[disableMinimap\] | Removes the minimap view and functionality.Default: **false** |
| Manage auto group edges\[manageAutoGroupEdges\] | Overrides the automatic creation of edges between group and its direct children. An edges array must be supplied when enabling this property.Default: **false** |
| Enable magnification effect\[enableMagnificationEffect\] | When turned on, the user sees a magnification effect when they hover over a node.Default: **false** |
| Label \[property\] | Description |
|---|---|
| Show loading state\[isLoading\] | When true, enables loading spinner.Default: **false** |
| Override loading state message\[loadingMessage\] | \(Optional\) A message to show with the loading spinner in place of the default message, when `isLoading=true`. |
| Show empty state\[isEmpty\] | When true, shows the empty state placeholder message.Default: **false** |
| Override empty state message\[emptyMessage\] | \(Optional\) A message to show with the empty state banner instead of the default message, when `isEmpty=true`. |
| Show error state\[isError\] | When true, shows error state banner.Default: **false** |
| Override error state message\[errorMessage\] | \(Optional\) A message to show with the error state banner in place of the default message, when `isEmpty=true`. |
| Controls position\[controlsPosition\] | An object containing a positioning of minimap, control panel, and finder controls.Default: `{\"minimap\": \"bottom-end\", \"controlPanel\": \"end\", \"find\": \"top-start\"}` |
| Label \[property\] | Description |
|---|---|
| Reduce Motion \[reduceMotion\] | Enables accessibility mode where animations are not allowed. This property is sent to the component by sn-node-map.Default: **false** |
| Always show invisible controls \[showHiddenControls\] | When turned on, reveals all invisible controls inside the component. When off, some controls may be hidden until the relevant element is hovered over or focused.Default: **false** |
| Event | Description |
|---|---|
| Map view readySN\_NODE\_MAP\#MAP\_VIEW\_READY | The map view has finished rendering. No set payload. |
| Wrapped node eventSN\_NODE\_MAP\#WRAPPED\_NODE\_EVENT | Wrapping event for any custom COMPONENT\_NODE\_EVENT action inside the node.Payload: - Source node `node`: Data object of the node that triggered this action. - Wrapped action `wrappedAction`: Original COMPONENT\_NODE\_EVENT dispatched from the node component. |
| Map elements selectedSN\_NODE\_MAP\#ELEMENTS\_SELECTED | Contains current nodes and edges that are selected.Payload: - Selected nodes `nodes`: Array of the selected nodes, if any exist. - Selected edge `edge`: Array of the selected edges, if any. |
| Map element selectedSN\_NODE\_MAP\#ELEMENT\_SELECTED | A specific node or edge is selected. If the selection is reset, so that nothing is selected, the event dispatches with an empty payload.Payload: - Selected node `node`: Data object of the selected node \(if a node was selected\). - Selected edge `edge`: Data object of the selected edge \(if an edge was selected\). |
| Map element selection requestedSN\_NODE\_MAP\#ELEMENT\_SELECTION\_REQUESTED | A node or edge was requested to be selected or deselected.Payload: - Requested node `node`: Data object of the requested node to select \(if a node was requested\). - Requested edge `edge`: Data object of the requested edge \(if an edge was requested\). |
| Home node requestedSN\_NODE\_MAP\#HOME\_NODE\_REQUESTED | Dispatched when the Home button on the action bar for a node is clicked. Configure a handler to set that node as Home.Payload: Source node `node`: Data object of the node that triggered this action. |
| Show hidden connections requestedSN\_NODE\_MAP\#SHOW\_HIDDEN\_CONNECTIONS\_REQUESTED | Dispatched when the Hidden connection button on the action bar is clicked. Configure a handler to show hidden connections or hide them if they currently are shown.Payload: Source node `node`: Data object of the node that triggered this action. |
| Node expand requestedSN\_NODE\_MAP\#EXPAND\_REQUESTED | On a collapsed group node, dispatched when the Expand button on the action bar is clicked. Configure a handler to show the child nodes.Payload: Source node `node`: Data object of the node that triggered this action. |
| Node collapse requestedSN\_NODE\_MAP\#COLLAPSE\_REQUESTED | On an expanded group node, dispatched when the Collapse button on the action bar is clicked. Configure a handler to hide the child nodes.Payload: Source node `node`: Data object of the node that triggered this action. |
| Collapse allSN\_NODE\_MAP\#COLLAPSE\_ALL\_REQUESTED | The **Collapse all** button was clicked in the control panel. No payload. |
| Contextual menu openedSN\_NODE\_MAP\#CONTEXT\_MENU\_OPENED | The "More actions" menu is opened in the action bar on a node or an edge.Payload: - Selected node `node`: Data object of the selected node \(if a node was selected\). - Selected edge `edge`: Data object of the selected edge \(if an edge was selected\). - Item type `type`: The item type: node or edge. - Is selected `isSelected`: A flag to indicate whether the item is selected. |
| Contextual menu item clickedSN\_NODE\_MAP\#CONTEXT\_MENU\_ITEM\_CLICKED | An action item is clicked in the "More actions" contextual menu. The payload identifies the item as well as the node or edge.Payload: - Selected node `node`: Data object of the selected node \(if a node was selected\). - Selected edge `edge`: Data object of the selected edge \(if an edge was selected\). - Clicked menu item `item`: The DropdownItem that was clicked in the contextual menu. |
| Map center aligned to a nodeSN\_NODE\_MAP\#MAP\_ALIGNED\_TO\_NODE | The map is aligned to center around a selected node. The node is selected with the `alignToNodeId` property.Payload: Selected node `node`: Data object of the aligned node. |
| Export map was clickedSN\_NODE\_MAP\#EXPORT\_REQUESTED | Notifies when the export map button was clicked. No payload. |
| Export map was savedSN\_NODE\_MAP\#EXPORT\_COMPLETED | Notifies when the map export is completed. No payload. |
| Fit to screenSN\_NODE\_MAP\#FIT\_TO\_SCREEN\_COMPLETED | Notification that the map has finished fitting itself to the screen size. No payload. |
| Control panel custom action clickedSN\_NODE\_MAP\#CONTROL\_PANEL\_CUSTOM\_BUTTON\_CLICKED | Notification that a custom button on the control panel was clicked.Payload: Button id `buttonId`, the id of the custom action that was clicked. |
| Find on map requestedSN\_NODE\_MAP\#FIND\_REQUESTED | Notification that the user has tried to find an element.Payload: - Find term `term`: The find term string that the user typed - Element id `id`: The id of the element being sought - Element type `type`: The type of the element being sought, either node or edge |
| Connection target node selectedSN\_NODE\_MAP\#CONNECTION\_TARGET\_SELECTED | Notifies the user when a target node was selected for the new connection.Payload: - Clicked menu item `item`: The DropdownItem that was clicked in the contextual menu. - Source node `sourceNode`: The source node of the new connection. - Target node `targetNode`: The target node of the new connection. |