FlowMiniMap

A scaled SVG overview of the graph with a draggable viewport rectangle.

Category: display · WCAG 2.1-AA · flow, minimap, overview, chrome

Props

PropTypeDefaultDescription
nodesFlowNode[]The nodes to render.
viewportViewportThe current pan/zoom viewport to reflect in the minimap.
containerWidthnumberWidth of the flow container, used to scale the minimap.
containerHeightnumberHeight of the flow container, used to scale the minimap.
widthnumber200Width in px.
heightnumber150Height in px.
position'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'bottom-rightPosition of the component.
onViewportChange(viewport: Viewport) => voidCalled with the new viewport when the minimap is dragged.
classNamestringAdditional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

Examples

Graph overview

() => (
  <FlowMiniMap
    nodes={[
      { id: 'a', position: { x: 0, y: 0 } },
      { id: 'b', position: { x: 220, y: 120 } },
      { id: 'c', position: { x: 440, y: 0 } },
    ]}
    viewport={{ x: 0, y: 0, zoom: 1 }}
    containerWidth={400}
    containerHeight={300}
  />
)

Related components

← Back to docs