NetiPlot

Options — NetiPlotOptions

The options prop accepts a nested configuration object. All fields are optional.

<NetiPlotReact
  graph={graph}
  options={{
    nodes: { showLabels: true, defaultSize: 24 },
    edges: { arrowheads: true },
    layoutOptions: { fitOnUpdate: true },
  }}
/>

nodesNetiPlotNodeOptions

FieldTypeDefaultDescription
showLabelsbooleantrueShow node labels
defaultSizenumber20Default node radius in pixels
nodeFillStylestringDefault fill colour for nodes
scaleCompensationfalseDisable size scaling with zoom

edgesNetiPlotEdgeOptions

FieldTypeDefaultDescription
showLabelsbooleanfalseShow edge labels
arrowheadsbooleanfalseRender arrowheads on edges
lineStylestring'solid''solid' or 'dashed'

cameraOptionsNetiPlotCameraOptions

FieldTypeDescription
fitAllPadding{ horizontal: number; vertical: number }Padding applied when fitting all nodes into view

layoutOptionsNetiPlotLayoutOptions

FieldTypeDefaultDescription
fitOnUpdatebooleanfalseZoom to fit after each layout run

Additional keys are passed through to custom layouter functions.

hoverNetiPlotHoverOptions

Tooltip shown when hovering a node or edge (React renderer).

FieldTypeDefaultDescription
nodeRenderer(node) => ReactNode | nullRender tooltip content for a node
edgeRenderer(edge) => ReactNode | nullRender tooltip content for an edge
delaynumber750Milliseconds before tooltip appears
widthnumber200Tooltip width in px (used for positioning)
heightnumber150Tooltip height in px (used for positioning)
hover: {
  nodeRenderer: (node) => <div><strong>{node.label}</strong></div>,
  delay: 400,
}

interactionNetiPlotInteractionOptions

FieldTypeDefaultDescription
allowGraphInteractionbooleantrueAllow dragging nodes
allowShapeInteractionbooleanfalseAllow selecting and resizing background shapes

showMutedOverlayboolean

When true, renders a semi-transparent overlay behind the edit layer.