@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.
@@ -339,7 +339,7 @@
339
339
  },
340
340
  {
341
341
  "name": "data",
342
- "description": "Data URL (JSON, GeoJSON, CSV/TSV, Arrow/GeoArrow IPC, Shapefile .shp, KML) or wss:// stream; omit for inline <script type=\"application/json\">."
342
+ "description": "Data URL (JSON, GeoJSON, CSV/TSV, Arrow/GeoArrow IPC, Shapefile .shp, KML, GPX, FlatGeobuf .fgb, GeoParquet .parquet, CityJSON) or wss:// stream; omit for inline <script type=\"application/json\">."
343
343
  },
344
344
  {
345
345
  "name": "label",
@@ -430,19 +430,19 @@
430
430
  },
431
431
  {
432
432
  "name": "get-position",
433
- "description": "Accessor for deck.gl getPosition — expression language: $field, scale(), arithmetic."
433
+ "description": "Accessor for deck.gl getPosition — expression language: $field, scale(), formatDate(), arithmetic."
434
434
  },
435
435
  {
436
436
  "name": "get-fill-color",
437
- "description": "Accessor for deck.gl getFillColor — expression language: $field, scale(), arithmetic."
437
+ "description": "Accessor for deck.gl getFillColor — expression language: $field, scale(), formatDate(), arithmetic."
438
438
  },
439
439
  {
440
440
  "name": "get-line-color",
441
- "description": "Accessor for deck.gl getLineColor — expression language: $field, scale(), arithmetic."
441
+ "description": "Accessor for deck.gl getLineColor — expression language: $field, scale(), formatDate(), arithmetic."
442
442
  },
443
443
  {
444
444
  "name": "get-radius",
445
- "description": "Accessor for deck.gl getRadius — expression language: $field, scale(), arithmetic."
445
+ "description": "Accessor for deck.gl getRadius — expression language: $field, scale(), formatDate(), arithmetic."
446
446
  },
447
447
  {
448
448
  "name": "radius",
@@ -526,7 +526,7 @@
526
526
  },
527
527
  {
528
528
  "name": "highlight-color",
529
- "description": "Accessor for deck.gl highlightColor — expression language: $field, scale(), arithmetic."
529
+ "description": "Accessor for deck.gl highlightColor — expression language: $field, scale(), formatDate(), arithmetic."
530
530
  },
531
531
  {
532
532
  "name": "radius-scale",
@@ -558,15 +558,15 @@
558
558
  },
559
559
  {
560
560
  "name": "get-line-width",
561
- "description": "Accessor for deck.gl getLineWidth — expression language: $field, scale(), arithmetic."
561
+ "description": "Accessor for deck.gl getLineWidth — expression language: $field, scale(), formatDate(), arithmetic."
562
562
  },
563
563
  {
564
564
  "name": "get-pixel-offset",
565
- "description": "Accessor for deck.gl getPixelOffset — expression language: $field, scale(), arithmetic."
565
+ "description": "Accessor for deck.gl getPixelOffset — expression language: $field, scale(), formatDate(), arithmetic."
566
566
  },
567
567
  {
568
568
  "name": "get-point-radius",
569
- "description": "Accessor for deck.gl getPointRadius — expression language: $field, scale(), arithmetic."
569
+ "description": "Accessor for deck.gl getPointRadius — expression language: $field, scale(), formatDate(), arithmetic."
570
570
  },
571
571
  {
572
572
  "name": "point-radius-units",
@@ -578,7 +578,7 @@
578
578
  },
579
579
  {
580
580
  "name": "get-elevation",
581
- "description": "Accessor for deck.gl getElevation — expression language: $field, scale(), arithmetic."
581
+ "description": "Accessor for deck.gl getElevation — expression language: $field, scale(), formatDate(), arithmetic."
582
582
  },
583
583
  {
584
584
  "name": "extruded",
@@ -638,23 +638,23 @@
638
638
  },
639
639
  {
640
640
  "name": "get-icon",
641
- "description": "Accessor for deck.gl getIcon — expression language: $field, scale(), arithmetic."
641
+ "description": "Accessor for deck.gl getIcon — expression language: $field, scale(), formatDate(), arithmetic."
642
642
  },
643
643
  {
644
644
  "name": "get-icon-angle",
645
- "description": "Accessor for deck.gl getIconAngle — expression language: $field, scale(), arithmetic."
645
+ "description": "Accessor for deck.gl getIconAngle — expression language: $field, scale(), formatDate(), arithmetic."
646
646
  },
647
647
  {
648
648
  "name": "get-icon-color",
649
- "description": "Accessor for deck.gl getIconColor — expression language: $field, scale(), arithmetic."
649
+ "description": "Accessor for deck.gl getIconColor — expression language: $field, scale(), formatDate(), arithmetic."
650
650
  },
651
651
  {
652
652
  "name": "get-icon-pixel-offset",
653
- "description": "Accessor for deck.gl getIconPixelOffset — expression language: $field, scale(), arithmetic."
653
+ "description": "Accessor for deck.gl getIconPixelOffset — expression language: $field, scale(), formatDate(), arithmetic."
654
654
  },
655
655
  {
656
656
  "name": "get-icon-size",
657
- "description": "Accessor for deck.gl getIconSize — expression language: $field, scale(), arithmetic."
657
+ "description": "Accessor for deck.gl getIconSize — expression language: $field, scale(), formatDate(), arithmetic."
658
658
  },
659
659
  {
660
660
  "name": "text-size-max-pixels",
@@ -722,43 +722,43 @@
722
722
  },
723
723
  {
724
724
  "name": "get-text",
725
- "description": "Accessor for deck.gl getText — expression language: $field, scale(), arithmetic."
725
+ "description": "Accessor for deck.gl getText — expression language: $field, scale(), formatDate(), arithmetic."
726
726
  },
727
727
  {
728
728
  "name": "get-text-angle",
729
- "description": "Accessor for deck.gl getTextAngle — expression language: $field, scale(), arithmetic."
729
+ "description": "Accessor for deck.gl getTextAngle — expression language: $field, scale(), formatDate(), arithmetic."
730
730
  },
731
731
  {
732
732
  "name": "get-text-color",
733
- "description": "Accessor for deck.gl getTextColor — expression language: $field, scale(), arithmetic."
733
+ "description": "Accessor for deck.gl getTextColor — expression language: $field, scale(), formatDate(), arithmetic."
734
734
  },
735
735
  {
736
736
  "name": "get-text-pixel-offset",
737
- "description": "Accessor for deck.gl getTextPixelOffset — expression language: $field, scale(), arithmetic."
737
+ "description": "Accessor for deck.gl getTextPixelOffset — expression language: $field, scale(), formatDate(), arithmetic."
738
738
  },
739
739
  {
740
740
  "name": "get-text-size",
741
- "description": "Accessor for deck.gl getTextSize — expression language: $field, scale(), arithmetic."
741
+ "description": "Accessor for deck.gl getTextSize — expression language: $field, scale(), formatDate(), arithmetic."
742
742
  },
743
743
  {
744
744
  "name": "get-text-anchor",
745
- "description": "Accessor for deck.gl getTextAnchor — expression language: $field, scale(), arithmetic."
745
+ "description": "Accessor for deck.gl getTextAnchor — expression language: $field, scale(), formatDate(), arithmetic."
746
746
  },
747
747
  {
748
748
  "name": "get-text-alignment-baseline",
749
- "description": "Accessor for deck.gl getTextAlignmentBaseline — expression language: $field, scale(), arithmetic."
749
+ "description": "Accessor for deck.gl getTextAlignmentBaseline — expression language: $field, scale(), formatDate(), arithmetic."
750
750
  },
751
751
  {
752
752
  "name": "get-text-background-color",
753
- "description": "Accessor for deck.gl getTextBackgroundColor — expression language: $field, scale(), arithmetic."
753
+ "description": "Accessor for deck.gl getTextBackgroundColor — expression language: $field, scale(), formatDate(), arithmetic."
754
754
  },
755
755
  {
756
756
  "name": "get-text-border-color",
757
- "description": "Accessor for deck.gl getTextBorderColor — expression language: $field, scale(), arithmetic."
757
+ "description": "Accessor for deck.gl getTextBorderColor — expression language: $field, scale(), formatDate(), arithmetic."
758
758
  },
759
759
  {
760
760
  "name": "get-text-border-width",
761
- "description": "Accessor for deck.gl getTextBorderWidth — expression language: $field, scale(), arithmetic."
761
+ "description": "Accessor for deck.gl getTextBorderWidth — expression language: $field, scale(), formatDate(), arithmetic."
762
762
  },
763
763
  {
764
764
  "name": "line-joint-rounded",
@@ -790,7 +790,7 @@
790
790
  },
791
791
  {
792
792
  "name": "get-polygon",
793
- "description": "Accessor for deck.gl getPolygon — expression language: $field, scale(), arithmetic."
793
+ "description": "Accessor for deck.gl getPolygon — expression language: $field, scale(), formatDate(), arithmetic."
794
794
  },
795
795
  {
796
796
  "name": "full3d",
@@ -798,15 +798,15 @@
798
798
  },
799
799
  {
800
800
  "name": "get-subtext",
801
- "description": "Accessor for deck.gl getSubtext — expression language: $field, scale(), arithmetic."
801
+ "description": "Accessor for deck.gl getSubtext — expression language: $field, scale(), formatDate(), arithmetic."
802
802
  },
803
803
  {
804
804
  "name": "get-color",
805
- "description": "Accessor for deck.gl getColor — expression language: $field, scale(), arithmetic."
805
+ "description": "Accessor for deck.gl getColor — expression language: $field, scale(), formatDate(), arithmetic."
806
806
  },
807
807
  {
808
808
  "name": "get-size",
809
- "description": "Accessor for deck.gl getSize — expression language: $field, scale(), arithmetic."
809
+ "description": "Accessor for deck.gl getSize — expression language: $field, scale(), formatDate(), arithmetic."
810
810
  },
811
811
  {
812
812
  "name": "layout",
@@ -826,15 +826,15 @@
826
826
  },
827
827
  {
828
828
  "name": "get-orientation",
829
- "description": "Accessor for deck.gl getOrientation — expression language: $field, scale(), arithmetic."
829
+ "description": "Accessor for deck.gl getOrientation — expression language: $field, scale(), formatDate(), arithmetic."
830
830
  },
831
831
  {
832
832
  "name": "get-scale",
833
- "description": "Accessor for deck.gl getScale — expression language: $field, scale(), arithmetic."
833
+ "description": "Accessor for deck.gl getScale — expression language: $field, scale(), formatDate(), arithmetic."
834
834
  },
835
835
  {
836
836
  "name": "get-translation",
837
- "description": "Accessor for deck.gl getTranslation — expression language: $field, scale(), arithmetic."
837
+ "description": "Accessor for deck.gl getTranslation — expression language: $field, scale(), formatDate(), arithmetic."
838
838
  },
839
839
  {
840
840
  "name": "size-scale",
@@ -854,7 +854,7 @@
854
854
  },
855
855
  {
856
856
  "name": "get-transform-matrix",
857
- "description": "Accessor for deck.gl getTransformMatrix — expression language: $field, scale(), arithmetic."
857
+ "description": "Accessor for deck.gl getTransformMatrix — expression language: $field, scale(), formatDate(), arithmetic."
858
858
  },
859
859
  {
860
860
  "name": "tileset",
@@ -878,7 +878,7 @@
878
878
  },
879
879
  {
880
880
  "name": "get-point-color",
881
- "description": "Accessor for deck.gl getPointColor — expression language: $field, scale(), arithmetic."
881
+ "description": "Accessor for deck.gl getPointColor — expression language: $field, scale(), formatDate(), arithmetic."
882
882
  },
883
883
  {
884
884
  "name": "loader",
@@ -906,31 +906,31 @@
906
906
  },
907
907
  {
908
908
  "name": "get-source-position",
909
- "description": "Accessor for deck.gl getSourcePosition — expression language: $field, scale(), arithmetic."
909
+ "description": "Accessor for deck.gl getSourcePosition — expression language: $field, scale(), formatDate(), arithmetic."
910
910
  },
911
911
  {
912
912
  "name": "get-target-position",
913
- "description": "Accessor for deck.gl getTargetPosition — expression language: $field, scale(), arithmetic."
913
+ "description": "Accessor for deck.gl getTargetPosition — expression language: $field, scale(), formatDate(), arithmetic."
914
914
  },
915
915
  {
916
916
  "name": "get-source-color",
917
- "description": "Accessor for deck.gl getSourceColor — expression language: $field, scale(), arithmetic."
917
+ "description": "Accessor for deck.gl getSourceColor — expression language: $field, scale(), formatDate(), arithmetic."
918
918
  },
919
919
  {
920
920
  "name": "get-target-color",
921
- "description": "Accessor for deck.gl getTargetColor — expression language: $field, scale(), arithmetic."
921
+ "description": "Accessor for deck.gl getTargetColor — expression language: $field, scale(), formatDate(), arithmetic."
922
922
  },
923
923
  {
924
924
  "name": "get-width",
925
- "description": "Accessor for deck.gl getWidth — expression language: $field, scale(), arithmetic."
925
+ "description": "Accessor for deck.gl getWidth — expression language: $field, scale(), formatDate(), arithmetic."
926
926
  },
927
927
  {
928
928
  "name": "get-height",
929
- "description": "Accessor for deck.gl getHeight — expression language: $field, scale(), arithmetic."
929
+ "description": "Accessor for deck.gl getHeight — expression language: $field, scale(), formatDate(), arithmetic."
930
930
  },
931
931
  {
932
932
  "name": "get-tilt",
933
- "description": "Accessor for deck.gl getTilt — expression language: $field, scale(), arithmetic."
933
+ "description": "Accessor for deck.gl getTilt — expression language: $field, scale(), formatDate(), arithmetic."
934
934
  },
935
935
  {
936
936
  "name": "great-circle",
@@ -1026,7 +1026,7 @@
1026
1026
  },
1027
1027
  {
1028
1028
  "name": "get-angle",
1029
- "description": "Accessor for deck.gl getAngle — expression language: $field, scale(), arithmetic."
1029
+ "description": "Accessor for deck.gl getAngle — expression language: $field, scale(), formatDate(), arithmetic."
1030
1030
  },
1031
1031
  {
1032
1032
  "name": "joint-rounded",
@@ -1046,11 +1046,11 @@
1046
1046
  },
1047
1047
  {
1048
1048
  "name": "get-path",
1049
- "description": "Accessor for deck.gl getPath — expression language: $field, scale(), arithmetic."
1049
+ "description": "Accessor for deck.gl getPath — expression language: $field, scale(), formatDate(), arithmetic."
1050
1050
  },
1051
1051
  {
1052
1052
  "name": "get-normal",
1053
- "description": "Accessor for deck.gl getNormal — expression language: $field, scale(), arithmetic."
1053
+ "description": "Accessor for deck.gl getNormal — expression language: $field, scale(), formatDate(), arithmetic."
1054
1054
  },
1055
1055
  {
1056
1056
  "name": "_normalize",
@@ -1066,15 +1066,15 @@
1066
1066
  },
1067
1067
  {
1068
1068
  "name": "get-background-color",
1069
- "description": "Accessor for deck.gl getBackgroundColor — expression language: $field, scale(), arithmetic."
1069
+ "description": "Accessor for deck.gl getBackgroundColor — expression language: $field, scale(), formatDate(), arithmetic."
1070
1070
  },
1071
1071
  {
1072
1072
  "name": "get-border-color",
1073
- "description": "Accessor for deck.gl getBorderColor — expression language: $field, scale(), arithmetic."
1073
+ "description": "Accessor for deck.gl getBorderColor — expression language: $field, scale(), formatDate(), arithmetic."
1074
1074
  },
1075
1075
  {
1076
1076
  "name": "get-border-width",
1077
- "description": "Accessor for deck.gl getBorderWidth — expression language: $field, scale(), arithmetic."
1077
+ "description": "Accessor for deck.gl getBorderWidth — expression language: $field, scale(), formatDate(), arithmetic."
1078
1078
  },
1079
1079
  {
1080
1080
  "name": "background-border-radius",
@@ -1134,23 +1134,23 @@
1134
1134
  },
1135
1135
  {
1136
1136
  "name": "get-alignment-baseline",
1137
- "description": "Accessor for deck.gl getAlignmentBaseline — expression language: $field, scale(), arithmetic."
1137
+ "description": "Accessor for deck.gl getAlignmentBaseline — expression language: $field, scale(), formatDate(), arithmetic."
1138
1138
  },
1139
1139
  {
1140
1140
  "name": "get-content-box",
1141
- "description": "Accessor for deck.gl getContentBox — expression language: $field, scale(), arithmetic."
1141
+ "description": "Accessor for deck.gl getContentBox — expression language: $field, scale(), formatDate(), arithmetic."
1142
1142
  },
1143
1143
  {
1144
1144
  "name": "get-pentagon",
1145
- "description": "Accessor for deck.gl getPentagon — expression language: $field, scale(), arithmetic."
1145
+ "description": "Accessor for deck.gl getPentagon — expression language: $field, scale(), formatDate(), arithmetic."
1146
1146
  },
1147
1147
  {
1148
1148
  "name": "get-geohash",
1149
- "description": "Accessor for deck.gl getGeohash — expression language: $field, scale(), arithmetic."
1149
+ "description": "Accessor for deck.gl getGeohash — expression language: $field, scale(), formatDate(), arithmetic."
1150
1150
  },
1151
1151
  {
1152
1152
  "name": "get-hexagons",
1153
- "description": "Accessor for deck.gl getHexagons — expression language: $field, scale(), arithmetic."
1153
+ "description": "Accessor for deck.gl getHexagons — expression language: $field, scale(), formatDate(), arithmetic."
1154
1154
  },
1155
1155
  {
1156
1156
  "name": "high-precision",
@@ -1162,7 +1162,7 @@
1162
1162
  },
1163
1163
  {
1164
1164
  "name": "get-hexagon",
1165
- "description": "Accessor for deck.gl getHexagon — expression language: $field, scale(), arithmetic."
1165
+ "description": "Accessor for deck.gl getHexagon — expression language: $field, scale(), formatDate(), arithmetic."
1166
1166
  },
1167
1167
  {
1168
1168
  "name": "extent",
@@ -1226,11 +1226,11 @@
1226
1226
  },
1227
1227
  {
1228
1228
  "name": "get-quadkey",
1229
- "description": "Accessor for deck.gl getQuadkey — expression language: $field, scale(), arithmetic."
1229
+ "description": "Accessor for deck.gl getQuadkey — expression language: $field, scale(), formatDate(), arithmetic."
1230
1230
  },
1231
1231
  {
1232
1232
  "name": "get-s2-token",
1233
- "description": "Accessor for deck.gl getS2Token — expression language: $field, scale(), arithmetic."
1233
+ "description": "Accessor for deck.gl getS2Token — expression language: $field, scale(), formatDate(), arithmetic."
1234
1234
  },
1235
1235
  {
1236
1236
  "name": "elevation-data",
@@ -1266,7 +1266,7 @@
1266
1266
  },
1267
1267
  {
1268
1268
  "name": "get-timestamps",
1269
- "description": "Accessor for deck.gl getTimestamps — expression language: $field, scale(), arithmetic."
1269
+ "description": "Accessor for deck.gl getTimestamps — expression language: $field, scale(), formatDate(), arithmetic."
1270
1270
  },
1271
1271
  {
1272
1272
  "name": "grid-origin",
@@ -1274,7 +1274,7 @@
1274
1274
  },
1275
1275
  {
1276
1276
  "name": "get-weight",
1277
- "description": "Accessor for deck.gl getWeight — expression language: $field, scale(), arithmetic."
1277
+ "description": "Accessor for deck.gl getWeight — expression language: $field, scale(), formatDate(), arithmetic."
1278
1278
  },
1279
1279
  {
1280
1280
  "name": "gpu-aggregation",
@@ -1302,11 +1302,11 @@
1302
1302
  },
1303
1303
  {
1304
1304
  "name": "get-color-value",
1305
- "description": "Accessor for deck.gl getColorValue — expression language: $field, scale(), arithmetic."
1305
+ "description": "Accessor for deck.gl getColorValue — expression language: $field, scale(), formatDate(), arithmetic."
1306
1306
  },
1307
1307
  {
1308
1308
  "name": "get-color-weight",
1309
- "description": "Accessor for deck.gl getColorWeight — expression language: $field, scale(), arithmetic."
1309
+ "description": "Accessor for deck.gl getColorWeight — expression language: $field, scale(), formatDate(), arithmetic."
1310
1310
  },
1311
1311
  {
1312
1312
  "name": "color-aggregation",
@@ -1334,11 +1334,11 @@
1334
1334
  },
1335
1335
  {
1336
1336
  "name": "get-elevation-value",
1337
- "description": "Accessor for deck.gl getElevationValue — expression language: $field, scale(), arithmetic."
1337
+ "description": "Accessor for deck.gl getElevationValue — expression language: $field, scale(), formatDate(), arithmetic."
1338
1338
  },
1339
1339
  {
1340
1340
  "name": "get-elevation-weight",
1341
- "description": "Accessor for deck.gl getElevationWeight — expression language: $field, scale(), arithmetic."
1341
+ "description": "Accessor for deck.gl getElevationWeight — expression language: $field, scale(), formatDate(), arithmetic."
1342
1342
  },
1343
1343
  {
1344
1344
  "name": "elevation-aggregation",
@@ -1769,6 +1769,40 @@
1769
1769
  "name": "field",
1770
1770
  "description": "Data field (filter / vega-lite widgets)."
1771
1771
  },
1772
+ {
1773
+ "name": "format",
1774
+ "description": "Filter value-label format. Use date for epoch-millisecond fields; default number.",
1775
+ "values": [
1776
+ {
1777
+ "name": "number"
1778
+ },
1779
+ {
1780
+ "name": "date"
1781
+ }
1782
+ ]
1783
+ },
1784
+ {
1785
+ "name": "date-style",
1786
+ "description": "Filter date label style when format=\"date\".",
1787
+ "values": [
1788
+ {
1789
+ "name": "date"
1790
+ },
1791
+ {
1792
+ "name": "datetime"
1793
+ },
1794
+ {
1795
+ "name": "time"
1796
+ },
1797
+ {
1798
+ "name": "iso"
1799
+ }
1800
+ ]
1801
+ },
1802
+ {
1803
+ "name": "time-zone",
1804
+ "description": "Filter date label time zone when format=\"date\": UTC (default), local, or an IANA zone such as Asia/Singapore."
1805
+ },
1772
1806
  {
1773
1807
  "name": "story",
1774
1808
  "description": "Story id (player widget)."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.5.3",
3
+ "version": "0.5.6",
4
4
  "description": "Declarative deck.gl maps for HTML and React — interactive WebGL mapping with GeoJSON/CSV/Arrow data, MapLibre basemaps, widgets, popups, and live streams from a custom-element manifest or typed React components. TypeScript, no build step.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "publishConfig": {
@@ -150,8 +150,11 @@
150
150
  "d3-color": "^3.1.0",
151
151
  "d3-interpolate": "^3.0.1",
152
152
  "d3-scale": "^4.0.2",
153
+ "flatgeobuf": "^4.4.0",
153
154
  "fzstd": "^0.1.1",
154
155
  "happy-dom": "^20.10.6",
156
+ "hyparquet": "^1.27.1",
157
+ "hyparquet-compressors": "^1.1.1",
155
158
  "jotai": "^2.20.2",
156
159
  "maplibre-gl": "^5.24.0",
157
160
  "mobx": "^6.16.1",
@@ -23,7 +23,7 @@ Use OnlyMapJS as a declarative HTML map library. Write custom elements such as `
23
23
  </script>
24
24
  ```
25
25
 
26
- For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.5.3` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.5.3/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
26
+ For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.5.6` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.5.6/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
27
27
 
28
28
  ## React Projects
29
29
 
@@ -52,6 +52,8 @@ Load the smallest reference needed for the task:
52
52
  - Attribute names are kebab-case: `get-fill-color`, `radius-units`, `line-width-min-pixels`.
53
53
  - Accessor values are expressions: `get-position="[$lon, $lat]"`.
54
54
  - `scale()` always needs an explicit `domain=`.
55
+ - Format epoch-millisecond or ISO fields with the safe `formatDate()` built-in, e.g. `get-text="formatDate($time, 'datetime', 'UTC')"`. Do not use `new Date()`, `Intl`, or method calls in restricted expressions.
56
+ - For a built-in filter over epoch milliseconds, add `format="date"` with optional `date-style="date|datetime|time|iso"` and `time-zone="UTC|local|<IANA zone>"`; do not hand-roll a time slider only to format its labels.
55
57
  - ScatterplotLayer points need an explicit size — `radius="6" radius-units="pixels"`, `get-radius="..."`, or `radius-min-pixels="..."`: deck's default is 1 METER, sub-pixel at city zooms, and validation warns on layers with no radius source.
56
58
  - Prefer canonical color expressions — a `sequential`/`diverging`/`threshold` `scale()` or an equality ternary chain — over hand-rolled arithmetic: the legend widget parses these shapes and renders a matching gradient ramp / class ranges / category palette automatically.
57
59
  - Inline handlers such as `onclick` are wrong. Use `data-emit`, `<om-behavior>`, or widget scripts.
@@ -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.5.3/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.5.3"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.5.6/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.5.6"></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).
@@ -81,10 +81,21 @@ get-position="[$lon, $lat]"
81
81
  get-radius="$population * 0.001"
82
82
  get-fill-color="$value > 100 ? [255,0,0] : [0,128,255]"
83
83
  get-fill-color="scale($depth, sequential, ['#ffffcc','#800026'], domain=[0,700])"
84
+ get-text="formatDate($time, 'datetime', 'UTC')"
84
85
  ```
85
86
 
86
87
  `$field` works on flat rows, GeoJSON properties, columnar JSON, CSV/TSV columns, and Arrow point columns.
87
88
 
89
+ Date formatting is a safe built-in rather than an opt-in to arbitrary JavaScript:
90
+
91
+ ```html
92
+ get-text="formatDate($time)"
93
+ get-text="formatDate($time, 'date')"
94
+ get-text="formatDate($time, 'datetime', 'Asia/Singapore')"
95
+ ```
96
+
97
+ `formatDate(value, style?, timeZone?)` accepts epoch-millisecond numbers/numeric strings or ISO date strings. Numeric values are always milliseconds—multiply Unix seconds by 1000 before formatting. Styles are `date`, `datetime` (default), `time`, and `iso`; the default time zone is `UTC`, while `local` opts into the viewer's zone and IANA names select a specific zone. Invalid values produce an empty string. Restricted expressions still reject `new Date()`, `Intl`, and instance-method calls.
98
+
88
99
  Smart shorthands:
89
100
 
90
101
  - `color="#1f9e89"` sets a constant `getFillColor` when no explicit `get-fill-color` exists, and always feeds the legend swatch.
@@ -102,6 +113,17 @@ Filtering:
102
113
  filter-field="magnitude" filter-range="[4, 10]"
103
114
  ```
104
115
 
116
+ For an epoch-millisecond filter, format the built-in widget's numeric labels declaratively:
117
+
118
+ ```html
119
+ <om-layer id="quakes" type="GeoJsonLayer" data="./quakes.geojson"
120
+ filter-field="time" filter-range="[1782889284760, 1785480717910]"></om-layer>
121
+ <om-widget type="filter" layer="quakes" field="time"
122
+ format="date" date-style="datetime" time-zone="UTC"></om-widget>
123
+ ```
124
+
125
+ `format` is `number` (default) or `date`. With `format="date"`, `date-style` uses the same four styles as `formatDate()` and `time-zone` defaults to `UTC`.
126
+
105
127
 
106
128
 
107
129
  ### Built-In Layer Types
@@ -151,6 +173,9 @@ External layer classes become manifest types via `OmMap.registerLayer({type, dec
151
173
  | Arrow / GeoArrow IPC | `data="./big.arrow"` | Points stay columnar; lines/polygons become GeoJSON features. |
152
174
  | Shapefile | `data="./countries.shp"` | Loads sidecars and joins `.dbf` attributes. |
153
175
  | KML | `data="./tour.kml"` | Placemarks become GeoJSON features. |
176
+ | GPX | `data="./hike.gpx"` (opt. `#waypoints`/`#tracks`/`#routes`) | Waypoints/tracks/routes → GeoJSON features, each tagged `_gpxKind`; a URL fragment selects one part (no fragment = all). |
177
+ | FlatGeobuf | `data="./cities.fgb"` | Cloud-native binary vector — whole-file decode to GeoJSON features (bbox-streaming is a later phase). |
178
+ | GeoParquet | `data="./data.parquet"` (or `.geoparquet`) | Cloud-native columnar vector — all-Point files stay columnar, lines/polygons become GeoJSON features; needs the `geo` metadata (WKB geometry) and CRS84/EPSG:4326 (a projected CRS errors — reproject first). |
154
179
  | CityJSON | `data="./tile.city.json"` | 3D city models → extruded footprints, or `?om-surfaces=1` for real per-face roof geometry; see below. |
155
180
  | CityJSONSeq | `data="./tile.city.jsonl"` | Same, streamed line by line as it downloads. |
156
181
  | WebSocket | `data="wss://feed" key="id" flush="250ms" source="decoder"` | Upsert-by-key stream. |
@@ -296,11 +321,30 @@ Examples:
296
321
  ```html
297
322
  <om-widget type="legend" position="bottom-right" title="Layers" interactive></om-widget>
298
323
  <om-widget type="filter" layer="quakes" field="magnitude" position="top-left"></om-widget>
324
+ <om-widget type="filter" layer="quakes" field="time" format="date"
325
+ date-style="datetime" time-zone="UTC" position="bottom-center"></om-widget>
299
326
  <om-widget type="draw" target="sketch" modes="point line polygon" save="both"></om-widget>
300
327
  <om-widget type="basemap-switcher" options="positron dark-matter liberty osm" position="top-right"></om-widget>
301
328
  ```
302
329
 
303
- Custom widget:
330
+ ### Custom widgets & event emission
331
+
332
+ **Reach for a built-in first.** A plain value/time slider is a built-in:
333
+ `<om-widget type="filter" layer="quakes" field="time" format="date">` — it
334
+ renders readable date labels AND wires the `filter-layer` action for you (pair
335
+ it with the layer's `filter-field`). Author a custom widget ONLY for bespoke UI
336
+ or logic the built-ins don't cover — most "it looked right but didn't work"
337
+ widgets should have been a `type="filter"`/`legend`/`vega-lite` built-in.
338
+
339
+ A custom widget is an `<om-widget>` with **no `type`** plus inline HTML and a
340
+ `<script type="om/widget">` block. The script is full JS, evaluated ONCE at
341
+ connect with `this` bound to the `<om-widget>` element: set `this.watch` (a
342
+ list of re-render triggers) and `this.render = (ctx) => {…}`. `vegaEmbed`/`d3`
343
+ are available. Content renders in shadow DOM — reach it with `this.$(selector)`
344
+ and `this.root`.
345
+
346
+ **Read map state** through `ctx` (the `render` argument), re-rendering when a
347
+ watched token fires:
304
348
 
305
349
  ```html
306
350
  <om-widget position="top-left">
@@ -315,20 +359,60 @@ Custom widget:
315
359
  </om-widget>
316
360
  ```
317
361
 
318
- Widget context:
319
-
320
- - `ctx.layers`
321
- - `ctx.data(id)`
322
- - `ctx.dataInViewport(id)`
323
- - `ctx.stats(id, field, { scope: "viewport" })`
324
- - `ctx.selection`
325
- - `ctx.viewport`
326
- - `ctx.history` `{ canUndo, canRedo }`; re-render on changes via the `history` watch token
327
- - `ctx.emit(action, payload)`
328
-
329
- Watch tokens: `data:<layerId>`, `viewport`, `selection`, `layers` (fires on layer add/remove, visibility, and filter changes), `basemap`, `lighting`, `terrain`, `history`, `widgets` (fires on a `widgets-hidden` hide-all toggle).
330
-
331
- Use `this.$()` and `this.root`; widgets render in shadow DOM.
362
+ - `ctx.layers`, `ctx.data(id)`, `ctx.dataInViewport(id)`,
363
+ `ctx.stats(id, field, { scope: "viewport" })`, `ctx.selection`,
364
+ `ctx.viewport`, `ctx.history` (`{ canUndo, canRedo }`).
365
+ - Watch tokens: `data:<layerId>`, `viewport`, `selection`, `layers` (add/remove,
366
+ visibility, filter changes), `basemap`, `lighting`, `terrain`, `history`,
367
+ `widgets` (`widgets-hidden` hide-all toggle).
368
+
369
+ **Drive the map — the emission contract.** This is the part authors get wrong.
370
+ A widget NEVER mutates the map directly and NEVER dispatches its own
371
+ `CustomEvent` hoping the map listens. It **emits a registered action**, exactly
372
+ two ways:
373
+
374
+ 1. **Declarative `data-emit`** (no script): `data-emit="<action>"` + `data-*`
375
+ payload keys on an element. Fires on **click** (non-form elements) or
376
+ **change** (form controls — `input`/`select`/`textarea`, whose `.value` is
377
+ auto-merged into the payload). `data-*` keys camelCase (`data-feature-id` →
378
+ `featureId`) and arrive as **strings** — fine for `toggle-layer`/`fly-to`,
379
+ but a numeric/array payload (a slider's `range: [min, max]`) needs `ctx.emit`.
380
+ ```html
381
+ <button data-emit="toggle-layer" data-layer="quakes">Toggle quakes</button>
382
+ ```
383
+
384
+ 2. **Programmatic `ctx.emit(action, payload)`** — for typed payloads. Wire it
385
+ INSIDE `render` so `ctx` is in scope, assigning `.oninput`/`.onclick`
386
+ (idempotent across re-renders; prefer over `addEventListener`, which stacks a
387
+ fresh listener every render):
388
+ ```html
389
+ <om-widget position="bottom-center">
390
+ <input id="day" type="range" min="1" max="14" step="1" value="1">
391
+ <script type="om/widget">
392
+ this.render = (ctx) => {
393
+ this.$("#day").oninput = (e) => {
394
+ const d = Number(e.target.value);
395
+ ctx.emit("filter-layer", { layer: "quakes", field: "day", range: [d, d] });
396
+ };
397
+ };
398
+ </script>
399
+ </om-widget>
400
+ ```
401
+
402
+ **NEVER inline handlers** (`onclick="…"`, `oninput="ctx.emit(…)"`): `ctx` is not
403
+ a global, they execute in page scope, and CSP blocks them — the widget looks
404
+ right and silently emits nothing. This is the #1 custom-widget failure, and
405
+ validation errors on it.
406
+
407
+ **Actions a widget can emit** (payload keys): `filter-layer`
408
+ `{layer, field?, range:[min,max]}` (value/time sliders), `toggle-layer`
409
+ `{layer, visible?}`, `fly-to` `{center:[lng,lat], zoom?, pitch?, bearing?,
410
+ duration?}`, `zoom-to-feature` `{layer, featureId, duration?}`, `set-basemap`
411
+ `{basemap}`, `set-lighting`/`set-terrain`, `highlight-feature`
412
+ `{layer, featureId}`, `show-overlay`/`hide-overlay` `{target}`,
413
+ `story-play`/`story-pause`/`story-seek` `{story, t?}`, `undo`/`redo`,
414
+ `zoom-in`/`zoom-out`, `set-widgets-visible` `{visible}`. Register your own with
415
+ `OmMap.registerAction(name, (payload, mapEl) => …)`.
332
416
 
333
417
  ### `<om-overlay>`
334
418
 
@@ -494,4 +578,3 @@ For 3D Tiles LOD/refinement experiments, use:
494
578
  maximum-memory-usage="256"
495
579
  view-distance-scale="0.85"></om-layer>
496
580
  ```
497
-