@nika-js/onlymap 0.5.3 → 0.5.6

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/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  That's a complete app: a no-token MapLibre basemap, data-driven colors and sizes, a legend, and a click-for-details popup. Edit any attribute on the live DOM and the map updates — the manifest *is* the state.
36
36
 
37
- It's also designed to be written **by AI agents**: HTML is a reliable generation target, [`llms.txt`](llms.txt) teaches the format, and `OmMap.validate()` returns structured errors with actionable fixes — a real feedback loop instead of a blank canvas.
37
+ It's also designed to be written **by AI agents**: HTML is a reliable generation target, [`llms.txt`](llms.txt) teaches the format, and `OmMap.validate()` returns structured errors **and warnings** with actionable fixes — a real feedback loop instead of a blank canvas (heed both: an "unknown attribute" warning means a prop is being silently dropped).
38
38
 
39
39
  > ⚠️ **Status: v0.2.** Proprietary — free for non-commercial use with attribution; commercial licensing terms are in [LICENSE.md](LICENSE.md). APIs may still move before 1.0.
40
40
 
@@ -46,7 +46,7 @@ deck.gl is the best WebGL data-visualization engine there is — and OnlyMapJS i
46
46
  |---|---|---|
47
47
  | Setup | `new Deck({...})`, canvas + basemap sync wiring | one `<om-map>` element (or `<OmMap>` in React) |
48
48
  | State | your reducers/stores drive `setProps` | the manifest **is** the state — edit an attribute, the map reconciles; undo/redo built in |
49
- | Data loading | fetch + parse + reload yourself | `data="…"` — GeoJSON, CSV, Arrow/GeoArrow, Shapefile, KML, CityJSON, WebSocket streams, polled REST, tiled XYZ/vector (`TileLayer`/`MVTLayer`); GeoTIFF/COG rasters via `type="COGLayer"` |
49
+ | Data loading | fetch + parse + reload yourself | `data="…"` — GeoJSON, CSV, Arrow/GeoArrow, Shapefile, KML, GPX, FlatGeobuf, GeoParquet, CityJSON, WebSocket streams, polled REST, tiled XYZ/vector (`TileLayer`/`MVTLayer`); GeoTIFF/COG rasters via `type="COGLayer"` |
50
50
  | Accessors | JS functions + `updateTriggers` bookkeeping | `get-*` expressions; update triggers derived automatically |
51
51
  | UI | build legends/popups/filters from scratch | built-in widgets, overlays, behaviors — declarative |
52
52
  | Testing | mock WebGL or ship untested | `OmMap.validate`, IR snapshots, headless behavioral harness |
@@ -69,7 +69,7 @@ Or with no build step at all, straight from a CDN:
69
69
 
70
70
  The bare package URL serves `dist/onlymap.standalone.js`, a single-file bundle built for exactly this (jsDelivr too). Use a CDN that serves the package's raw files — **not** a rebundling CDN like esm.sh, which re-splits the bundle into duplicate copies of the deck.gl/luma.gl runtime and breaks every layer's shader compilation.
71
71
 
72
- Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with 628 unit/behavioral tests and 58 Playwright GPU tests.
72
+ Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with 630 unit/behavioral tests and 58 Playwright GPU tests.
73
73
 
74
74
  The [examples](https://github.com/NikaGeospatial/onlymapjs/tree/main/examples) are the best tour: widgets, behaviors & overlays, basemaps, columnar/Arrow data, manual drawing, 3D models, scene lighting (with the native lighting widget), DEM terrain, a live WebSocket ship feed, and a polled driver fleet.
75
75
 
@@ -96,9 +96,21 @@ get-position="[$lon, $lat]"
96
96
  get-radius="$population * 0.001"
97
97
  get-fill-color="$value > 100 ? [255,0,0] : [0,128,255]"
98
98
  get-fill-color="scale($depth, sequential, ['#ffffcc','#800026'], domain=[0,700])"
99
+ get-text="formatDate($time, 'datetime', 'UTC')"
99
100
  ```
100
101
 
101
- Built-ins: `scale()` (types: `sequential`, `diverging`, `threshold`, `sqrt`, `log`, `pow` — explicit `domain=` required), `colorRamp()`, `clamp()`, `lerp()`, and `Math.*`. Multi-line accessors go in a `<script type="om/accessors">` block; genuinely arbitrary JS needs an explicit `js` opt-in on the layer. Untrusted (agent-written) expressions are safe by construction: the compiler is an AST whitelist, not an eval.
102
+ Built-ins: `scale()` (types: `sequential`, `diverging`, `threshold`, `sqrt`, `log`, `pow` — explicit `domain=` required), `colorRamp()`, `clamp()`, `lerp()`, `formatDate()`, and `Math.*`. `formatDate(value, style?, timeZone?)` turns epoch-millisecond or ISO values into readable labels; styles are `date`, `datetime` (default), `time`, and `iso`, with `UTC` as the default zone (`local` or an IANA zone such as `Asia/Singapore` are explicit alternatives). Multi-line accessors go in a `<script type="om/accessors">` block; genuinely arbitrary JS needs an explicit `js` opt-in on the layer. Untrusted (agent-written) expressions are safe by construction: the compiler is an AST whitelist, not an eval.
103
+
104
+ Date-valued filter sliders use the same contract without a custom widget:
105
+
106
+ ```html
107
+ <om-layer id="quakes" type="GeoJsonLayer" data="./quakes.geojson"
108
+ filter-field="time" filter-range="[1782889284760,1785480717910]"></om-layer>
109
+ <om-widget type="filter" layer="quakes" field="time"
110
+ format="date" date-style="datetime" time-zone="UTC"></om-widget>
111
+ ```
112
+
113
+ Numeric timestamps are always epoch **milliseconds**, never guessed as seconds. Invalid date values render as an empty label rather than crashing an accessor or widget.
102
114
 
103
115
  ### Data sources
104
116
 
@@ -80,6 +80,7 @@ hand.
80
80
  | @probe.gl/env | 4.1.1 | MIT |
81
81
  | @probe.gl/log | 4.1.1 | MIT |
82
82
  | @probe.gl/stats | 4.1.1 | MIT |
83
+ | @repeaterjs/repeater | 3.0.6 | MIT |
83
84
  | @swc/helpers | 0.5.23 | Apache-2.0 |
84
85
  | @tmcw/togeojson | 4.7.0 | BSD-2-Clause |
85
86
  | @turf/boolean-clockwise | 5.1.5 | MIT |
@@ -133,11 +134,15 @@ hand.
133
134
  | find-replace | 5.0.2 | MIT |
134
135
  | flatbuffers | 25.9.23 | Apache-2.0 |
135
136
  | flatbush | 4.6.2 | ISC |
137
+ | flatgeobuf | 4.4.0 | BSD-3-Clause |
136
138
  | flatqueue | 3.1.0 | ISC |
137
139
  | fzstd | 0.1.1 | MIT |
138
140
  | gl-matrix | 3.4.4 | MIT |
139
141
  | h3-js | 4.5.0 | Apache-2.0 |
140
142
  | has-flag | 4.0.0 | MIT |
143
+ | hyparquet | 1.27.1 | MIT |
144
+ | hyparquet-compressors | 1.1.1 | MIT |
145
+ | hysnappy | 1.0.0 | MIT |
141
146
  | iconv-lite | 0.4.24 | MIT |
142
147
  | ieee754 | 1.2.1 | BSD-3-Clause |
143
148
  | image-size | 0.7.5 | MIT |
@@ -177,6 +182,7 @@ hand.
177
182
  | safe-buffer | 5.1.2 | MIT |
178
183
  | safer-buffer | 2.1.2 | MIT |
179
184
  | setimmediate | 1.0.5 | MIT |
185
+ | slice-source | 0.4.1 | BSD-3-Clause |
180
186
  | snappyjs | 0.6.1 | MIT |
181
187
  | sprintf-js | 1.0.3 | BSD-3-Clause |
182
188
  | string_decoder | 1.1.1 | MIT |
@@ -3431,6 +3437,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3431
3437
  THE SOFTWARE.
3432
3438
  ```
3433
3439
 
3440
+ ## @repeaterjs/repeater@3.0.6 (MIT)
3441
+
3442
+ ```
3443
+ License: MIT (no license file shipped in the package)
3444
+ ```
3445
+
3434
3446
  ## @swc/helpers@0.5.23 (Apache-2.0)
3435
3447
 
3436
3448
  ```
@@ -5332,6 +5344,20 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
5332
5344
  THIS SOFTWARE.
5333
5345
  ```
5334
5346
 
5347
+ ## flatgeobuf@4.4.0 (BSD-3-Clause)
5348
+
5349
+ ```
5350
+ Copyright (c) 2018, Björn Harrtell
5351
+
5352
+ Redistribution and use in source and binary forms, with or without
5353
+ modification, are permitted provided that the following conditions are met:
5354
+
5355
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
5356
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
5357
+
5358
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5359
+ ```
5360
+
5335
5361
  ## flatqueue@3.1.0 (ISC)
5336
5362
 
5337
5363
  ```
@@ -5622,6 +5648,42 @@ The above copyright notice and this permission notice shall be included in all c
5622
5648
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5623
5649
  ```
5624
5650
 
5651
+ ## hyparquet@1.27.1 (MIT)
5652
+
5653
+ ```
5654
+ The MIT License (MIT)
5655
+
5656
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5657
+
5658
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5659
+
5660
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5661
+ ```
5662
+
5663
+ ## hyparquet-compressors@1.1.1 (MIT)
5664
+
5665
+ ```
5666
+ The MIT License (MIT)
5667
+
5668
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5669
+
5670
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5671
+
5672
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5673
+ ```
5674
+
5675
+ ## hysnappy@1.0.0 (MIT)
5676
+
5677
+ ```
5678
+ The MIT License (MIT)
5679
+
5680
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5681
+
5682
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5683
+
5684
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5685
+ ```
5686
+
5625
5687
  ## iconv-lite@0.4.24 (MIT)
5626
5688
 
5627
5689
  ```
@@ -7476,6 +7538,37 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
7476
7538
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7477
7539
  ```
7478
7540
 
7541
+ ## slice-source@0.4.1 (BSD-3-Clause)
7542
+
7543
+ ```
7544
+ Copyright (c) 2016, Michael Bostock
7545
+ All rights reserved.
7546
+
7547
+ Redistribution and use in source and binary forms, with or without
7548
+ modification, are permitted provided that the following conditions are met:
7549
+
7550
+ * Redistributions of source code must retain the above copyright notice, this
7551
+ list of conditions and the following disclaimer.
7552
+
7553
+ * Redistributions in binary form must reproduce the above copyright notice,
7554
+ this list of conditions and the following disclaimer in the documentation
7555
+ and/or other materials provided with the distribution.
7556
+
7557
+ * The name Michael Bostock may not be used to endorse or promote products
7558
+ derived from this software without specific prior written permission.
7559
+
7560
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
7561
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
7562
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7563
+ DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
7564
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
7565
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7566
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
7567
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
7568
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
7569
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7570
+ ```
7571
+
7479
7572
  ## snappyjs@0.6.1 (MIT)
7480
7573
 
7481
7574
  ```