1# llimphi-widget-navigator23**Data-agnostic** node navigator in two switchable modes: **tree** (`tree`) and
4**graph** (`nodegraph`).
56It was born so `pata` could show nouser's **Monads** and their files in a
7sidebar, but the widget knows nothing about nouser: it receives a forest of
8`NavNode`s (opaque id + label + `NavKind` + children) and emits `Msg`s on
9interaction. The caller maps each `id` to whatever it means (a `MonadId`, a path)
10and decides what to do on select/open.
1112Like the rest of the Llimphi widgets it is **render-only and stateless**: the
13state (which nodes are expanded, which one is selected, which mode it is in)
14lives in the App's `Model`; the widget only paints and notifies.
1516- **Tree** — reuses `llimphi_widget_tree`. The navigator flattens the forest
17 honouring `is_expanded`, draws an icon per `NavKind` between the chevron and
18 the label, and wires toggle / select / context per row.
19- **Graph** — reuses `llimphi_widget_nodegraph`. It places the visible nodes in
20 columns by depth, with **containment** wires (parent→child). The selected node
21 is highlighted; dragging a node selects it; right-click opens the context menu.
2223```ignore24navigator_view(
25 NavSpec { roots: &model.nodes, mode: model.mode,
26 selected: model.selected, palette, guides: true },
27 |id| model.expanded.contains(&id),
28 Msg::Toggle, Msg::Select, Some(Msg::Open),
29)
30```3132---
3334Part of **llimphi** — see [llimphi](../../README.md).
README.md
llimphi-widget-navigator
Data-agnostic node navigator in two switchable modes: tree (tree) and
graph (nodegraph).
It was born so pata could show nouser's Monads and their files in a
sidebar, but the widget knows nothing about nouser: it receives a forest of
NavNodes (opaque id + label + NavKind + children) and emits Msgs on
interaction. The caller maps each id to whatever it means (a MonadId, a path)
and decides what to do on select/open.
Like the rest of the Llimphi widgets it is render-only and stateless: the
state (which nodes are expanded, which one is selected, which mode it is in)
lives in the App's Model; the widget only paints and notifies.
Tree — reuses llimphi_widget_tree. The navigator flattens the forest
honouring is_expanded, draws an icon per NavKind between the chevron and
the label, and wires toggle / select / context per row.
Graph — reuses llimphi_widget_nodegraph. It places the visible nodes in
columns by depth, with containment wires (parent→child). The selected node
is highlighted; dragging a node selects it; right-click opens the context menu.