Expand description
The three traits — the ONLY things that differ between a map view and a graph view.
Everything else a viewer does (cull, tessellate, place labels, composite, pick) is identical whether the thing on screen is a road or a call edge. This module names the difference and nothing else:
| trait | question it answers | map answer | graph answer |
|---|---|---|---|
PositionSource | where is feature id? | Mercator(lat, lon) | the layout’s node position |
ElevationSource | how high is it? | terrain heightfield | 0.0, or a metric (centrality / risk) |
Hierarchy | what does “one step deeper” mean? | the next zoom band | expand this cluster |
§Why f64 world space
Web-Mercator at zoom 22 and a graph drilled six levels deep have the same
bug: f32 runs out of mantissa and geometry jitters. The engine therefore
keeps world space in f64 and only becomes f32 at the relative-to-eye
split (super::rte) — one fix, both problems.
§Why object-safe
Use case 7 — a graph drawn on geography — needs two different position
sources live in the same frame. That is only expressible if the engine can
hold &[&dyn PositionSource], so every method here is object-safe: no
generic methods, no Self: Sized, no associated types on the hot path.
Structs§
- Band
- One rung of a
Bandshierarchy. - Bands
- Bands — THE shared hierarchy. A map zoom pyramid and a graph
cluster-expansion tree are both a list of
Bands; nothing in the engine distinguishes them. - Flat
- Flat —
Z = 0. Use cases 1, 3 and 4. Zero cost: the engine special-cases az_range()of(0, 0)and skips the elevation pass entirely. - Flatten
- Flatten — one level, everything in it. The honest hierarchy of a small graph or a single-zoom overlay; also the migration floor, so a renderer can move onto the engine before it has a real LOD story.
- Identity
- Identity — the position IS the coordinate. Use case 3 (the flat 2D overlay) and any caller that already laid its own content out.
- Layout
- Layout — positions produced by a layout algorithm that keeps running
(force-directed, hierarchical, metro). Arithmetically identical to
Identity; the difference isgeneration, which every engine-side cache keys on. - Metric
- Metric — per-feature scalar × a scale. Use cases 5 and 6: node height IS betweenness centrality, or a Mímir risk score.
- Projected
- Projected — a source that pushes raw
(a, b)pairs through a pure function. This is the seam a geographic projection plugs into withoutfacett-corelearning what a latitude is:facett-geomapsupplies|lon, lat| mercator(lon, lat)and gets aPositionSourceback. - Sampled
- Sampled — height from a pure
(x, y) -> zfunction plus a declared range.facett-geomapwraps its terrain heightfield in this;facett-corenever learns what a DEM is. - World
Aabb - An axis-aligned world-space box — the culler’s unit of work, and the only
thing the
Hierarchylevels are really made of (a coarse level is a set of bounding volumes that stand in for the fine level beneath it). - World
Pos - A position in engine world space, always
f64.
Traits§
- Elevation
Source - How high is feature
id? - Hierarchy
- What does one step deeper mean?
- Position
Source - Where is feature
id?