@nika-js/onlymap 0.10.10 → 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 +13 -0
- package/README.md +14 -2
- package/dist/{basemap-BH76eQA0.js → basemap-Bg73oXUb.js} +2 -2
- 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-DzKLe-0r.js → geoparquet-BASBa9tf.js} +1 -1
- package/dist/{globe-view-B-prUQFh.js → globe-view-CTkofOiM.js} +1 -1
- package/dist/{hillshade-CDng2Jsi.js → hillshade-DdVEO8lc.js} +1 -1
- package/dist/html-data.d.ts +1 -1
- package/dist/{index-laD2SEAB.js → index-BCDmJfeb.js} +3 -3
- package/dist/{index-DOfIeNux.js → index-BLfj5bIo.js} +1 -1
- package/dist/{index-D86S8KJ1.js → index-BOjo5N6i.js} +1 -1
- package/dist/{index-DvEcTZ4i.js → index-C-YAnesV.js} +17527 -16473
- package/dist/{index-CpLydTmE.js → index-C7CNrOGW.js} +1 -1
- package/dist/{index-Rvd-zFrS.js → index-CVAyXg52.js} +1 -1
- package/dist/{index-cwieLGSg.js → index-DbfTOgYl.js} +1 -1
- package/dist/{index-8Fj-yh7f.js → index-DsLNa_IB.js} +2 -2
- package/dist/{index-CIo8LgRZ.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-BJB4-X6n.js → lerc-CoNq0xxX.js} +1 -1
- package/dist/onlymap.standalone.js +35944 -34890
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-Bd5plkno.js → post-process-effect-CrZoIEYa.js} +1 -1
- package/dist/programmatic.d.ts +6 -0
- package/dist/{raster-DJ6vvro6.js → raster-CZMdghdy.js} +3 -3
- package/dist/{raster-pipeline-BQhNhrPq.js → raster-pipeline-n2wrLc9r.js} +1 -1
- package/dist/runtime-core.d.ts +24 -0
- package/dist/{text-on-path-CrqchF3O.js → text-on-path-CHkHjky-.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-oAkG7ZLM.js → zarr-DRBhsEZZ.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/llms.txt +2 -1
- package/onlymapjs.attributes.json +33 -0
- package/onlymapjs.html-data.json +68 -0
- 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 +47 -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
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.
|