Fragiola

API: primitives (@fragiola/flow-react, @fragiola/flow-vue, @fragiola/flow-svelte, @fragiola/flow-angular)

MiniMapNode

MiniMapNode is one node in the MiniMap, a rectangle of the node's box in flow coordinates, marked while the node is selected.

MiniMapNode comes from @fragiola/flow-react/minimap (@fragiola/flow-vue/minimap) and goes inside MiniMap. It renders an SVG rect of its node's box from the minimap's view, in flow coordinates, and nothing when the node is not shown. Give it its fill, through data-selected for the selected look.

<MiniMap>
    {(view) =>
        view.nodes.map((node) => (
            <MiniMapNode key={node.nodeId} nodeId={node.nodeId} className="fill-gray-300 data-selected:fill-blue-500" />
        ))
    }
</MiniMap>

Props

MiniMapNodeProps extends the common primitive props and every SVG attribute of a rect.

proptypedefaultdescription
nodeIdstringrequiredthe node it stands for

State

MiniMapNodeState, what className, style and render receive:

fieldtypedescription
nodeIdstringthe node
selectedbooleanthe node is selected (selection())

Data attributes

attributevalue
data-flow-part"minimap-node"
data-flow-idthe node's id
data-selectedpresent while the node is selected