@nika-js/onlymap 0.10.9 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +15 -3
- package/dist/{basemap-B2VvspL4.js → basemap-Bg73oXUb.js} +2 -2
- package/dist/cartograph/element-base.d.ts +9 -0
- package/dist/cartograph/elements/om-legend.d.ts +4 -0
- package/dist/cartograph.js +517 -495
- package/dist/cartograph.standalone.js +1307 -1285
- package/dist/cluster-index.d.ts +77 -0
- package/dist/cluster-options.d.ts +92 -0
- package/dist/ctx.d.ts +2 -0
- package/dist/elements/om-map.d.ts +6 -0
- package/dist/{geoparquet-BJQC6zwS.js → geoparquet-BASBa9tf.js} +1 -1
- package/dist/{globe-view-C3Gaf--d.js → globe-view-CTkofOiM.js} +1 -1
- package/dist/{hillshade-CNtzlYlz.js → hillshade-DdVEO8lc.js} +1 -1
- package/dist/html-data.d.ts +1 -1
- package/dist/{index-CQdTYZ08.js → index-BCDmJfeb.js} +3 -3
- package/dist/{index-j_Ojvo4x.js → index-BLfj5bIo.js} +1 -1
- package/dist/{index-Cp2kquh5.js → index-BOjo5N6i.js} +1 -1
- package/dist/{index-DPEWcZeV.js → index-C-YAnesV.js} +17527 -16473
- package/dist/{index-CI0vdi2E.js → index-C7CNrOGW.js} +1 -1
- package/dist/{index-a-wOE5hE.js → index-CVAyXg52.js} +1 -1
- package/dist/{index-D2RzlXff.js → index-DbfTOgYl.js} +1 -1
- package/dist/{index-m3UsmxCq.js → index-DsLNa_IB.js} +2 -2
- package/dist/{index-C3S0FWlc.js → index-FtNZZGWv.js} +3 -3
- package/dist/ir-snapshot.d.ts +10 -0
- package/dist/ir.d.ts +9 -0
- package/dist/layer-registry.d.ts +8 -0
- package/dist/layers/cluster-layer.d.ts +111 -0
- package/dist/{lerc-Bv4RLXha.js → lerc-CoNq0xxX.js} +1 -1
- package/dist/onlymap.standalone.js +35944 -34890
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-Cpbyy4I3.js → post-process-effect-CrZoIEYa.js} +1 -1
- package/dist/programmatic.d.ts +6 -0
- package/dist/{raster-D_HU2WuR.js → raster-CZMdghdy.js} +3 -3
- package/dist/{raster-pipeline-BmcWLImS.js → raster-pipeline-n2wrLc9r.js} +1 -1
- package/dist/runtime-core.d.ts +24 -0
- package/dist/{text-on-path-ClLwT2eS.js → text-on-path-CHkHjky-.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-CCCIYwWt.js → zarr-DRBhsEZZ.js} +2 -2
- package/docs/cartograph.md +13 -7
- package/llms.txt +3 -2
- package/onlymapjs.attributes.json +33 -0
- package/onlymapjs.html-data.json +113 -1
- package/package.json +7 -3
- package/skills/onlymapjs/SKILL.md +3 -2
- package/skills/onlymapjs/references/react.md +1 -0
- package/skills/onlymapjs/references/syntax.md +48 -2
- package/docs/design/arrows.md +0 -182
- package/docs/design/carto-substrate.md +0 -1067
- package/docs/design/cog-v2.md +0 -223
- package/docs/design/extensions.md +0 -250
- package/docs/design/frame-sources.md +0 -229
- package/docs/design/hillshade.md +0 -290
- package/docs/design/paced-flyby.md +0 -42
- package/docs/design/trace-link-failure.md +0 -20
|
@@ -16,8 +16,8 @@ Vite/npm project:
|
|
|
16
16
|
Static CDN page (raw-file CDNs only — unpkg/jsDelivr; never esm.sh or another rebundling CDN, which duplicates the WebGL runtime and breaks layer shaders):
|
|
17
17
|
|
|
18
18
|
```html
|
|
19
|
-
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.
|
|
20
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.
|
|
19
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.11.0/dist/onlymapjs.css">
|
|
20
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.11.0"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Always include `onlymapjs.css` — it carries the MapLibre basemap styles and the no-JS fallback rules (`<om-fallback>` / default banner). For the fallback to work in script-disabled previews it must load without JavaScript: a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages (a bundler-emitted stylesheet is fine in npm projects).
|
|
@@ -168,6 +168,42 @@ One `<om-widget type="filter">` per dimension — each moves its own field's ran
|
|
|
168
168
|
|
|
169
169
|
`visible-zoom-range="[8, 14]"` — scale-dependent visibility, the QGIS/ArcGIS/Mapbox everyday pattern: the layer renders only at min ≤ zoom < max (min inclusive, max exclusive — the minzoom/maxzoom convention). Universal: valid on every layer type, unlike the tile-only `visible-min-zoom`/`visible-max-zoom` deck props. Composes with `visible` (both must allow); a zoom-hidden layer stays a full scene member — legend, layer-switcher, and `ctx` still list it. Malformed values are ignored with a warning (`validate` reports them structurally).
|
|
170
170
|
|
|
171
|
+
## Clustering (`ScatterplotLayer`, `GeoJsonLayer` with Point features, `IconLayer`)
|
|
172
|
+
|
|
173
|
+
`cluster="true"` merges points that would overlap on screen into count bubbles that split apart as the reader zooms in. A TOGGLE on the point layer, never a separate layer type: the layer keeps its id, data, its own `get-*` symbology for the points that stand alone at the current zoom, its picks, behaviors and actions.
|
|
174
|
+
|
|
175
|
+
```html
|
|
176
|
+
<om-layer id="plants" type="ScatterplotLayer" data="./plants.csv"
|
|
177
|
+
get-position="[$lon, $lat]" color="#2563eb" radius="4" radius-units="pixels"
|
|
178
|
+
cluster="true"
|
|
179
|
+
cluster-radius="50" cluster-max-zoom="16" cluster-min-points="2" <!-- the defaults, MapLibre's names -->
|
|
180
|
+
cluster-properties="sum:capacity_mw,mode:fuel"
|
|
181
|
+
get-cluster-radius="scale($count / $count_max, sqrt, [12, 36], domain=[0, 1])" <!-- the default -->
|
|
182
|
+
get-cluster-fill-color="$mode_fuel == 'Hydro' ? '#0ea5e9' : '#64748b'"
|
|
183
|
+
pickable></om-layer>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
| Attribute | Meaning |
|
|
187
|
+
|---|---|
|
|
188
|
+
| `cluster` | `"true"` turns clustering on. |
|
|
189
|
+
| `cluster-radius` | Cluster radius in screen pixels (default 50). |
|
|
190
|
+
| `cluster-max-zoom` | The last zoom at which clusters still form (default 16); past it every point stands alone. |
|
|
191
|
+
| `cluster-min-points` | Fewest points that make a cluster (default 2). |
|
|
192
|
+
| `cluster-properties` | `"op:field,…"` with op `sum` `min` `max` `mean` `mode` → `$op_field` on every bubble (`$sum_capacity_mw`, `$mode_fuel`), beside `$count`. `mode` is the commonest value — the way to colour a bubble by category. |
|
|
193
|
+
| `cluster-click` | `expand` (default: a click flies to the zoom where the bubble splits) or `none`. |
|
|
194
|
+
| `cluster-label` | `"false"` drops the count text. |
|
|
195
|
+
| `get-cluster-radius` | Bubble radius in px — an expression over the cluster fields. |
|
|
196
|
+
| `get-cluster-fill-color` / `get-cluster-line-color` | Bubble fill/outline. Default fill: the layer's own `color`, else blue; outline white. |
|
|
197
|
+
| `get-cluster-label` | Bubble text (default `$count_abbreviated`, e.g. `1.2k`). |
|
|
198
|
+
|
|
199
|
+
Cluster fields available to `get-cluster-*`: `$count`, `$count_abbreviated`, `$count_total` (all points), `$zoom`, the aggregates, and — for scaling — `$count_max` and `$<aggregate>_max` / `_min`: the largest/smallest value among ALL clusters at the bubble's own zoom. Divide by them, as the default radius does, and a size or colour ramp stays meaningful at every zoom (a literal `domain=[2, 1000]` is right at z3 and collapses every bubble at z11). `scale()` domains must be literals, so this normalisation is the way to get a zoom-adaptive ramp.
|
|
200
|
+
|
|
201
|
+
Picks: a bubble pick's object carries `cluster: true`, `cluster_id`, `count`, `position` and the aggregates — `<om-overlay>` templates read `{{count}}` / `{{sum_capacity_mw}}`; a standalone point picks as itself. Give each kind its own behavior with `pick="point"` / `pick="cluster"` on `<om-behavior>` (a point's click card, a bubble's hover tooltip) — without it one card would open, half-empty, for both. `map.clusterLeaves(layerId, clusterId, limit?)` returns the rows inside a bubble. Action `expand-cluster` (payload: a pick, or `{layer, clusterId}`) flies to the split zoom, eased over 600 ms — the default click already does this. A runtime on/off switch is `set-layer-attribute` `{ layer, name: "cluster", value: "true"|"false" }` from a widget button; `ctx.layers[i].cluster` reports the current state.
|
|
202
|
+
|
|
203
|
+
Zoom bands ("bubbles far out, icons close in"): two layers over the same file, each with its own `visible-zoom-range` — the clustered `ScatterplotLayer` on `[0, 12]` with `cluster-max-zoom="11"` (so nothing is still bubbled at the hand-over) and an `IconLayer` on `[12, 24]`. The URL is fetched once; each layer needs its own id, `label`, and behaviors. Hard cut at the boundary, not a cross-fade.
|
|
204
|
+
|
|
205
|
+
Rules: Point data only — a `GeoJsonLayer` with any line or polygon feature refuses to cluster (structured error; give those features their own layer). `cluster-*` on any other layer type is a validation error. Not applied on a projected (`crs=`) sheet (renders unclustered, warns once). Row caps count the raw rows, not the bubbles.
|
|
206
|
+
|
|
171
207
|
Attribute-contract tooling: the package also ships `onlymapjs.attributes.json` — a machine-readable per-layer-type attribute list generated from the same registry the runtime validates against. CI checks that emit `<om-layer>` markup should validate attributes per `type=` against it, NOT against the editor IntelliSense file (`onlymapjs.html-data.json`), which is a flat per-tag union and cannot express "valid on TileLayer, not GeoJsonLayer". An attribute is accepted on a type iff it appears in the contract's `universal` list or `layers[<type>]`.
|
|
172
208
|
|
|
173
209
|
Categorical filtering is a SEPARATE mechanism from numeric (deck.gl's own `categorySize`, a discrete keep-list test, not a range) — same shape, own attributes, and combines with an active numeric filter (a row must pass both):
|
|
@@ -691,6 +727,7 @@ A separate lazy entry (`import "@nika-js/onlymap/cartograph"`; CDN: `https://unp
|
|
|
691
727
|
|
|
692
728
|
- A live frame georeferences whatever its map shows. Zoomed out past the whole world, the map wraps inside the frame like any web map — the graticule labels each copy by where it is on the globe, and the scale bar measures its own row — and the frame never limits or rewrites the camera. Once the map inside a frame settles after a pan, rotate or tilt, the frame's georeference follows the map's own view: north arrow, scale bar, graticule, locator inset and `{{frame.<id>.scale}}` describe what is on screen, and freezing captures that view. `max-pitch` and `min-zoom` on `<om-map>` are author-set controls (a kiosk map that should stay upright or within an area); nothing sets them for you.
|
|
693
729
|
- `<om-legend for>` derives rows from the live map's own symbology (classified breaks included); literal rows via `derived="false"` + `<om-legend-row>` children.
|
|
730
|
+
- Styling is a short list of attributes, each the theme's own `--om-carto-*` property scoped to the element: the page takes `bg`, `color`, `font` (beside `theme=`); a legend takes `bg`, `color`, `stroke`, `font-size` (pt), `padding` (mm); `<om-scalebar>`, `<om-north>` and `<om-graticule>` take `color`; `<om-text>` has `color`/`bg`/`font`/`font-size`/`weight`/`align`, `<om-shape>` has `fill`/`stroke`. There is no `background=`, `border=` or `padding=` anywhere else — the validator names each as unknown.
|
|
694
731
|
- `<om-atlas for="<frame-id>" layer="<layer-id>">` renders one page per feature sequentially and exports a ZIP. Frames follow with `atlas-fit="feature"` (without it every page shows the same view). `atlas-margin` is a FRACTION of the feature's extent (default 0.15, useful range 0.1–0.3) — the one spatial number here that is NOT millimetres; `atlas-margin="10"` pads each side by ten feature-widths and shows every page as a speck — the validator warns on any margin above 2, and on a margin set without `atlas-fit="feature"`, which does nothing. Readers page with the arrow keys / PageUp / PageDown / Home / End or the on-sheet pager (screen-only, never printed or exported; `pager="none"` on `<om-atlas>` removes it); a cross-origin host gets `atlas-page` messages posted to its window and can post `{source:"onlymap-cartograph-host", type:"atlas-seek", index}` back.
|
|
695
732
|
- Output: `page.print()` / `?print=1` (PDF at page size), `renderCartograph(page, {dpi})` / `?export=png&dpi=300` (PNG). Press attributes: `bleed`, `crop-marks`, `safe-zone` (screen-only), `flatten`. `cvd="deuteranopia|…"` simulates colour-vision deficiency; `lintLegendColours()` flags collapsing palettes.
|
|
696
733
|
- Free plan injects a small foot credit — suppressed by an authored `om-text` crediting OnlyMap or a paid key on a live frame's map.
|
|
@@ -726,6 +763,13 @@ Declarative event to action binding.
|
|
|
726
763
|
|
|
727
764
|
Events: `click`, `hover`, `drag`, `load`, `data-loaded`.
|
|
728
765
|
|
|
766
|
+
`pick="point"` / `pick="cluster"` — on a `cluster="true"` layer, fire only for standalone points or only for count bubbles (absent = both). A template cannot branch, so this is how a point gets its card and a bubble its own tooltip:
|
|
767
|
+
|
|
768
|
+
```html
|
|
769
|
+
<om-behavior on="click" layer="plants" pick="point" action="show-overlay" target="detail"></om-behavior>
|
|
770
|
+
<om-behavior on="hover" layer="plants" pick="cluster" action="show-tooltip" template="#bubble-tip"></om-behavior>
|
|
771
|
+
```
|
|
772
|
+
|
|
729
773
|
Common built-in actions:
|
|
730
774
|
|
|
731
775
|
- `show-overlay`, `hide-overlay`
|
|
@@ -733,6 +777,8 @@ Common built-in actions:
|
|
|
733
777
|
- `toggle-layer`
|
|
734
778
|
- `set-effect` — payload `{ preset }` (a preset name, or `"none"` to remove it); optional `<op>-<param>` knob overrides, e.g. `{ preset: "vintage", "grain-amount": 0.02 }`. Writes one `<om-effect preset>` child, so it is undoable; NOT story-rewindable yet (rewind restores `<om-map>` attributes, this adds an element). A hand-composed op chain is left alone.
|
|
735
779
|
- `set-pickable` — payload `{ layer, pickable: true|false|"3d" }`; writes/removes the layer's `pickable` attribute at runtime (turns popups/tooltips/hover behaviors on or off per layer — the viewer-facing popup toggle), story-capturable and undoable
|
|
780
|
+
- `set-layer-attribute` — payload `{ layer, name, value }`; writes ANY `<om-layer>` attribute at runtime by its kebab-case name (`{ layer: "plants", name: "cluster", value: "true" }`, `{ name: "radius", value: 8 }`); `value: null` (or `remove: true`) removes it. The generic twin of a React prop change — live, story-capturable and undoable like `toggle-layer`. The one refusal is `name: "id"`.
|
|
781
|
+
- `expand-cluster` — payload: a cluster pick (`{ feature, layer }`) or `{ layer, clusterId }`, optional `duration`; flies to the zoom where the bubble splits (eased 600 ms by default). The default click on a bubble already does this (`cluster-click="expand"`); the action is for `cluster-click="none"` layers and hosts.
|
|
736
782
|
- `highlight-feature` — sets the layer's `highlighted-id`; style the selection with `highlight-color="[220, 38, 38, 255]"` (or hex) on the `<om-layer>` — a constant color, not a `get-*` accessor
|
|
737
783
|
- `zoom-to-feature`
|
|
738
784
|
- `filter-layer`
|
package/docs/design/arrows.md
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
# `<om-arrow>` — routed indicator arrows for cartographs
|
|
2
|
-
|
|
3
|
-
Callouts, leaders and connectors in the draw.io sense: an arrow that **attaches** to
|
|
4
|
-
things (a page point, another element, a geographic position inside a frame) and
|
|
5
|
-
**routes** between them in a chosen style — straight, cardinal-only orthogonal, curved,
|
|
6
|
-
or the technical-illustration "diagonal then horizontal" leader.
|
|
7
|
-
|
|
8
|
-
Cartograph-only. Pure DOM/SVG furniture with a canvas painter, no map runtime, so it
|
|
9
|
-
lives in `src/cartograph/` in full compliance with the lazy-core rule. Targeting one
|
|
10
|
-
release; independent of the substrate plan (`carto-substrate.md`), and deconflicted
|
|
11
|
-
with it in that document's §13.5: arrows are furniture, so they stay vector even where
|
|
12
|
-
the substrate rasterises a map frame on export, and the freeze-to-vector work leaves
|
|
13
|
-
their geographic anchors alone. The plane view makes those anchors *exact* — an
|
|
14
|
-
orthographic frame's corners are an affine map of the projection plane, so a geographic
|
|
15
|
-
anchor on a projected sheet no longer carries the homography's interior residue
|
|
16
|
-
(measured at 7.12mm at the centre of a 180x120mm sheet when fitted in the wrong plane).
|
|
17
|
-
Label placement and leader lines are shared follow-up work owned by the placement pass
|
|
18
|
-
(§13.6), not by this element.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## What exists, and why it is not enough
|
|
23
|
-
|
|
24
|
-
`<om-shape kind="arrow">` draws a straight arrow from its box's top-left to its
|
|
25
|
-
bottom-right (`elements/om-shape.ts:91`). It has no anchors, no routing, one head
|
|
26
|
-
style, and its geometry is the box — so pointing at a feature means computing a box by
|
|
27
|
-
hand and re-computing it when anything moves. It stays as the simple case; `<om-arrow>`
|
|
28
|
-
supersedes it for anything anchored or routed, and the validator says so.
|
|
29
|
-
|
|
30
|
-
## Model — the parts that decide everything else
|
|
31
|
-
|
|
32
|
-
### 1. An arrow has no authored box
|
|
33
|
-
|
|
34
|
-
Every other placed element is `x y w h` in mm (`schema.ts:43`, `paint.ts:boxMm`). An
|
|
35
|
-
arrow's box is **derived** from its routed path plus head size, because its identity is
|
|
36
|
-
its two ends, not a rectangle. `z`, `locked`, `hidden` apply; `x y w h rotation` are
|
|
37
|
-
validation errors on `<om-arrow>` (fix: move the ends).
|
|
38
|
-
|
|
39
|
-
This is not a restriction on *where* an arrow can go. A **floating arrow** is simply two
|
|
40
|
-
page points — `from="120,40" to="150,60"` — attached to nothing; the box attributes are
|
|
41
|
-
rejected only because the ends already carry the position, and two sources of truth
|
|
42
|
-
for one placement is how furniture drifts. The element still writes the
|
|
43
|
-
derived box through `applyPlacement()` so stacking and hit-testing behave like any
|
|
44
|
-
other furniture.
|
|
45
|
-
|
|
46
|
-
*Consequence for consumers:* `nika-agent`'s selection overlay finds placed elements by
|
|
47
|
-
`hasAttribute("x")` (`CartographSelectionOverlay.tsx:234`) and drags them by writing
|
|
48
|
-
`x y`. Arrows need an **endpoint-handle** mode that writes `from`/`to`. That is a
|
|
49
|
-
consumer ticket, filed with Phase 2.
|
|
50
|
-
|
|
51
|
-
### 2. Three anchor forms, one grammar, both ends
|
|
52
|
-
|
|
53
|
-
| Form | Example | Resolves to |
|
|
54
|
-
|---|---|---|
|
|
55
|
-
| Page point | `from="120,40"` | that mm point |
|
|
56
|
-
| Element | `from="#callout"` | a point on that element's box edge — side auto-chosen from relative position, or forced with `from-side="left|right|top|bottom|center"` and `from-offset="0…1"` along the side |
|
|
57
|
-
| Geographic | `to="#main@-122.42,37.78"` | `frame.georef.project(lngLat)` → frame-relative mm, plus the frame's box → page mm |
|
|
58
|
-
|
|
59
|
-
The geographic form is the reason to build this at all: a callout that stays on the
|
|
60
|
-
feature. It works identically on live and static frames because both expose the same
|
|
61
|
-
`FrameGeoref` (`docs/cartograph.md`, "Georeferencing"), and it is exactly the mapping
|
|
62
|
-
`overview-of` already performs for a frame footprint (`om-frame.ts:452`).
|
|
63
|
-
|
|
64
|
-
Element anchors attach to the **rotated** box when the target has `rotation`.
|
|
65
|
-
A `gap="1mm"` standoff keeps the tip off the target's edge (draw.io's perimeter spacing).
|
|
66
|
-
|
|
67
|
-
### 3. Compute the path once; both renderers draw it
|
|
68
|
-
|
|
69
|
-
`textlayout.ts` states the rule: two measurers disagree at the margins, so the DOM and
|
|
70
|
-
the canvas exporter draw *the same computed boxes*. Arrows follow it. A pure
|
|
71
|
-
`src/cartograph/route.ts` turns `(fromMm, toMm, sides, style, knobs)` into a list of
|
|
72
|
-
path commands and head polygons in page mm; `om-arrow.ts` writes them as an SVG `d`
|
|
73
|
-
and `paintCartograph()` replays them on the 2D context. One geometry, two outputs, no
|
|
74
|
-
drift — and a headless unit test per routing style against golden paths.
|
|
75
|
-
|
|
76
|
-
### 4. Refresh follows the things it depends on
|
|
77
|
-
|
|
78
|
-
Furniture re-renders on `om-frame-view` (`om-cartograph.ts:81`), which covers geographic
|
|
79
|
-
anchors on a live frame and every atlas page refit. Element anchors additionally observe
|
|
80
|
-
the target's placement attributes (`x y w h rotation`) with the `scheduleRender()`
|
|
81
|
-
coalescing that `element-base.ts` already provides, so a consumer dragging a text box
|
|
82
|
-
drags its arrow.
|
|
83
|
-
|
|
84
|
-
## Attributes
|
|
85
|
-
|
|
86
|
-
```html
|
|
87
|
-
<om-arrow from="#callout-1" from-side="right"
|
|
88
|
-
to="#main@-122.4194,37.7749"
|
|
89
|
-
route="elbow" angle="45deg"
|
|
90
|
-
end="arrow" head-size="2.5mm" gap="1mm"
|
|
91
|
-
stroke="#1a1612" stroke-width="0.35mm"></om-arrow>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
| Attribute | Values / units | Default |
|
|
95
|
-
|---|---|---|
|
|
96
|
-
| `from`, `to` | anchor grammar above | required |
|
|
97
|
-
| `from-side`, `to-side` | `left right top bottom center auto` | `auto` |
|
|
98
|
-
| `from-offset`, `to-offset` | `0…1` along the side | `0.5` |
|
|
99
|
-
| `route` | `straight orthogonal curved elbow` | `straight` |
|
|
100
|
-
| `via` | `[[x,y],…]` page mm waypoints | none |
|
|
101
|
-
| `angle` | `elbow` only — the diagonal's angle | `45deg` |
|
|
102
|
-
| `elbow-axis` | `elbow` only — the final run: `horizontal vertical` | `horizontal` |
|
|
103
|
-
| `elbow-length` | `elbow` only — pin the diagonal instead of deriving it | derived |
|
|
104
|
-
| `curvature` | `curved` only, `0…1` | `0.5` |
|
|
105
|
-
| `corner-radius` | `orthogonal` only, mm | `0` |
|
|
106
|
-
| `start`, `end` | `none arrow open dot bar diamond` | `none`, `arrow` |
|
|
107
|
-
| `head-size` | mm | `2.5mm` |
|
|
108
|
-
| `gap` | mm standoff from an element anchor | `0` |
|
|
109
|
-
| `stroke`, `stroke-width`, `dash`, `opacity` | as `<om-shape>`; `dash` in mm | theme `--om-carto-arrow-stroke`, falling back to the shape stroke |
|
|
110
|
-
| `label` | short text at the path midpoint | none |
|
|
111
|
-
| `label-at`, `label-side` | `0…1`; `above below on` | `0.5`, `above` |
|
|
112
|
-
|
|
113
|
-
Lengths are millimetres, as everywhere on the sheet.
|
|
114
|
-
|
|
115
|
-
## Routing styles
|
|
116
|
-
|
|
117
|
-
**`straight`.** One segment; with `via`, a polyline.
|
|
118
|
-
|
|
119
|
-
**`orthogonal`** — the cardinal-only case. Segments are horizontal or vertical, never
|
|
120
|
-
diagonal. The exit direction is the attached side (or the dominant axis for a bare
|
|
121
|
-
point); the router chooses the fewest bends that work — 0, an L (one bend), or a Z
|
|
122
|
-
(two bends, with the middle segment placed at the midpoint). `corner-radius` rounds the
|
|
123
|
-
bends. With `via`, every consecutive pair must share an x or a y — the validator
|
|
124
|
-
rejects a diagonal waypoint with the fix "add an intermediate point".
|
|
125
|
-
|
|
126
|
-
**`curved`.** A cubic Bézier whose tangents leave perpendicular to the attached sides
|
|
127
|
-
(or along the chord for bare points); `curvature` scales the control-arm length from
|
|
128
|
-
0 (a straight line) to 1 (a full S). With `via`, a Catmull-Rom spline through the
|
|
129
|
-
points, converted to cubics.
|
|
130
|
-
|
|
131
|
-
**`elbow`** — the "diagonal then horizontal" leader of technical drawing. A segment
|
|
132
|
-
at `angle` from `from`, then an axis-aligned run to `to`. The diagonal's length is
|
|
133
|
-
*derived*: where the ray from `from` meets the axis line through `to`; `elbow-length`
|
|
134
|
-
pins it instead, and the run then meets `to` with a second bend. `elbow-axis="vertical"`
|
|
135
|
-
flips the final run.
|
|
136
|
-
|
|
137
|
-
No obstacle avoidance: `via` is the manual escape hatch, which is also what draw.io
|
|
138
|
-
users reach for when its auto-router does the wrong thing.
|
|
139
|
-
|
|
140
|
-
## Validation
|
|
141
|
-
|
|
142
|
-
Every entry an error with a fix, in the `<om-effect>` validator's idiom:
|
|
143
|
-
|
|
144
|
-
- dangling `#id` (either form) — error, and the **visible unlinked placeholder** from
|
|
145
|
-
`refs.ts`, never nothing: an arrow that silently vanishes is indistinguishable on
|
|
146
|
-
paper from one the author removed;
|
|
147
|
-
- geographic anchor on a frame with a degenerate georef — error;
|
|
148
|
-
- geographic anchor that projects **outside** its frame's box — warning (may be
|
|
149
|
-
intentional for an inset; say so);
|
|
150
|
-
- `x y w h rotation` on `<om-arrow>` — error, fix: move the ends;
|
|
151
|
-
- non-axis-aligned `via` under `orthogonal` — error, fix as above;
|
|
152
|
-
- `from` and `to` resolve to the same point — warning;
|
|
153
|
-
- unknown `route`, `start`, `end`, side — error listing the values;
|
|
154
|
-
- `<om-shape kind="arrow">` with a `for=` or anything anchor-like — hint to `<om-arrow>`.
|
|
155
|
-
|
|
156
|
-
## Surfaces
|
|
157
|
-
|
|
158
|
-
`schema.ts` entry (`PLACED_ATTR_NAMES` minus the box attrs, plus the table above);
|
|
159
|
-
`cartograph/html-data.ts` with `values(...)` for every enum; `validate.ts` in the
|
|
160
|
-
`FURNITURE_TAGS` set; `docs/cartograph.md` element table; an example sheet with all four
|
|
161
|
-
routes pointing at one earthquake; skill + `llms.txt`; architecture traceability;
|
|
162
|
-
CHANGELOG.
|
|
163
|
-
|
|
164
|
-
## Phases
|
|
165
|
-
|
|
166
|
-
**Phase 1 — `route.ts`.** Pure routing for all four styles, `via`, heads, `gap`, side
|
|
167
|
-
auto-selection. Gate: golden-path unit tests per style; orthogonal output contains no
|
|
168
|
-
diagonal segment for any of a fuzzed set of endpoint pairs.
|
|
169
|
-
|
|
170
|
-
**Phase 2 — the element.** Anchors, derived box, refresh wiring, DOM + canvas painters,
|
|
171
|
-
validation, IntelliSense. Gate: DOM-rendered and canvas-painted arrows match pixel-wise
|
|
172
|
-
at 96 and 300 dpi; a geographic anchor follows a live frame's camera and an atlas
|
|
173
|
-
refit; the consumer ticket for endpoint handles is filed.
|
|
174
|
-
|
|
175
|
-
**Phase 3 — finish.** `label`, `corner-radius`, the example sheet, doc-sync.
|
|
176
|
-
|
|
177
|
-
## Non-goals
|
|
178
|
-
|
|
179
|
-
- Obstacle avoidance and line jumps over crossings (`via` covers the need).
|
|
180
|
-
- Anchoring to a *feature* by id inside a frame (would need the runtime; a
|
|
181
|
-
geographic point is the static equivalent and works on frozen sheets).
|
|
182
|
-
- Multi-segment labels or text along the path.
|