<!-- GENERATED by scripts/build-llms.mjs from llms/data.md — do not edit this file. -->

# `lr-flow-minimap`

- **Import** `import '@aceshooting/lyra-ui/components/lr-flow-minimap.js';` (stable tag alias; registers the tag)
- **Class** `LyraFlowMinimap`, also available unregistered from `@aceshooting/lyra-ui/components/data/flow-minimap/flow-minimap.class.js`
- **Family** `components/data/` — see `llms/index.md` for its siblings
- **Status** `stable` since `4.0.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** none
- **Themeable via** 7 parts, 10 custom properties — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-flow-minimap`

A corner overview map of a `lr-flow-canvas`: scaled node rectangles plus a draggable viewport
rectangle, for orientation and fast navigation on canvases larger than the screen. Draws no edges
(nodes only, matching the React Flow/n8n minimap convention) and never reads `nodes` itself —
geometry always comes from the canvas's `registerCompanion()` snapshots, so the two can never
disagree.

**Properties:**

- `for: string = ''` — id of the target `lr-flow-canvas`; when empty, the nearest ancestor canvas
  is used (the slotted-into-a-corner-slot case, the primary wiring)
- `label: string = ''` — accessible name for the map region. A host `aria-label` takes precedence,
  followed by `label`, then the localized default
- `frame: 'card' | 'plain' = 'card'` (reflected) — container treatment, on the library-wide `frame`
  vocabulary. `'plain'` removes `[part="base"]`'s border, background and corner radius, for a
  minimap placed in a host panel or toolbar that already draws its own surface, so the frame isn't
  doubled. The map's own hover/click affordances and the viewport rect stay either way — only the
  outer `base` decoration goes. Mirrors `lr-flow-controls`'/`lr-flow-run-status`'s identical `frame`.

**Events:** none.

**Slots:** none.

**CSS parts:** `base` (the root wrapper; drops its border, background and corner radius under
`frame="plain"`), `map` (the scaled SVG), `node` (one rect per node), `viewport` (the
exact visible view rectangle), `viewport-hit-area` (the transparent draggable/focusable target),
`instructions` (visually hidden keyboard help), and `live-region` (the `aria-hidden` mirror of the
latest viewport-change text).

**Themeable custom properties:** `--lr-flow-minimap-inline-size` (default `12rem`),
`--lr-flow-minimap-block-size` (default `8rem`), plus the shared
`--lr-flow-status-color` and the explicit palette hooks
`--lr-flow-status-pending-color`, `--lr-flow-status-running-color`,
`--lr-flow-status-success-color`, `--lr-flow-status-error-color`, and
`--lr-flow-status-denied-color`.
`--lr-flow-minimap-viewport-color` (default `var(--lr-color-brand)`) colors `[part="viewport"]`'s
fill (mixed 15% into transparent) and stroke, independent of every per-status node fill above.
`--lr-flow-minimap-viewport-min-size` (default `var(--lr-icon-button-size)`, normally 40px) floors
only the transparent `viewport-hit-area` along each axis. The visible `viewport` remains the exact
viewport-to-content ratio. The token inherits from ancestors; set it to `0` to opt out.

**Optional peer deps:** none.

```html
<lr-flow-canvas id="canvas" style="height:480px">
  <lr-flow-minimap slot="bottom-end" for="canvas"></lr-flow-minimap>
</lr-flow-canvas>
```

**Known gotchas:**

- Never resolves `nodes`/`edges` on its own — it subscribes to `registerCompanion()` and repaints
  from whatever snapshot the canvas last pushed, so it can only ever show what the canvas itself
  currently renders.
- A locked snapshot makes the hit area unfocusable and inert: no pointer, click, wheel, or keyboard
  shortcut can mutate the canvas.
- Dragging the viewport rectangle calls the canvas's `setViewport()` directly; there's no separate
  event to wire up. A completed drag consumes only the browser-synthesized click following its
  `pointerup`; a canceled or lost-capture drag leaves the next genuine map click available for
  click-to-center navigation.
- On a canvas whose node bounds dwarf the visible viewport — the case the minimap exists for — the
  raw viewport rectangle can collapse to a couple of pixels. The separate transparent hit area is
  floored and grown symmetrically around the exact visible rectangle; keyboard and drag math still
  read the canvas viewport directly.

**Additional API surface:**

- `part="instructions"` — Visually hidden keyboard instructions for the viewport.
- `part="live-region"` — Visually hidden, `aria-hidden` mirror of the latest viewport-change text.
  The initial companion snapshot is silent. Keyboard, map-click, and wheel viewport changes append
  their next rAF-coalesced snapshot to the document's shared light-DOM polite sink; a completed
  viewport drag appends its final position once, while canceled/lost-capture drags remain silent.
  Repeated identical snapshots are still separate additions.

---
