@optimum-intelligence/opti-ui 0.7.5 → 0.7.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/CHANGELOG.md +14 -0
- package/README.md +4 -1
- package/dist/components/map/Map.d.ts +29 -3
- package/dist/components/map/Map.js +332 -160
- package/dist/components/map/Map.js.map +1 -1
- package/dist/components.json +17 -3
- package/dist/llms-full.txt +7 -8
- package/dist/opti-ui.css +2 -0
- package/package.json +1 -1
package/dist/llms-full.txt
CHANGED
|
@@ -2973,21 +2973,20 @@ hovered areas get a heavier outline.
|
|
|
2973
2973
|
### Map.Points
|
|
2974
2974
|
|
|
2975
2975
|
Many simple points (sensors, stops, events) as one circle layer. Items with a `label` get it drawn in
|
|
2976
|
-
the circle by a symbol layer on the same source, so thousands of numbered stops
|
|
2977
|
-
dozen styled pins with HTML
|
|
2976
|
+
the circle by a symbol layer on the same source from `labelMinZoom` on, so thousands of numbered stops
|
|
2977
|
+
stay fast. With `cluster`, dense areas become count bubbles. For a few dozen styled pins with HTML
|
|
2978
|
+
content, use `Map.Marker` instead.
|
|
2978
2979
|
|
|
2979
2980
|
```tsx
|
|
2980
|
-
//
|
|
2981
|
-
<Map.Points
|
|
2982
|
-
items={trucks.flatMap((truck, t) =>
|
|
2983
|
-
truck.stops.map((stop, i) => ({ id: stop.id, coordinates: stop.position, colorIndex: t, label: i + 1 })),
|
|
2984
|
-
)}
|
|
2985
|
-
/>
|
|
2981
|
+
// A fleet's stops over two months, merged into count bubbles at low zoom.
|
|
2982
|
+
<Map.Points items={stops} cluster={{ radius: 40 }} onItemClick={(stop) => setPicked(stop)} />
|
|
2986
2983
|
```
|
|
2987
2984
|
|
|
2988
2985
|
| Prop | Type | Default | Description |
|
|
2989
2986
|
| --- | --- | --- | --- |
|
|
2990
2987
|
| `items` | `MapPointItem[]` | | Points to draw, all in one GeoJSON source and one circle layer. |
|
|
2988
|
+
| `labelMinZoom?` | `number` | `12` | Zoom from which item `label`s are drawn. Below it labelled points render as plain dots and MapLibre skips the label layer, so wide views stay readable and pan as fast as unlabelled points. `0` always shows labels. |
|
|
2989
|
+
| `cluster?` | `boolean \| MapClusterOptions` | `false` | Merges nearby points into count bubbles that split as you zoom in, using MapLibre's built-in clustering; a click on a bubble zooms to where it splits. `true` uses a 50 px radius up to zoom 14. Bubbles are not items, so they never reach `onItemClick` or `onItemHover`, and a selected point inside one is not highlighted until it splits. The counts need a style with a `glyphs` URL, like `label`. |
|
|
2991
2990
|
| `selectedIds?` | `string[]` | | Ids of selected points. While it is not empty, other points fade to `--oui-map-dim-opacity`. |
|
|
2992
2991
|
| `onItemClick?` | `(item: MapPointItem, event: MapLayerMouseEvent) => void` | | Called with the clicked point. |
|
|
2993
2992
|
| `onItemHover?` | `(item: MapPointItem \| null, event: MapLayerMouseEvent) => void` | | Called with the point under the pointer, and with `null` when the pointer leaves it. |
|
package/dist/opti-ui.css
CHANGED
|
@@ -136,6 +136,8 @@
|
|
|
136
136
|
--oui-color-chart-7: var(--oui-color-yellow);
|
|
137
137
|
--oui-color-chart-8: var(--oui-color-accent);
|
|
138
138
|
--oui-map-casing-color: var(--oui-color-surface);
|
|
139
|
+
--oui-map-cluster-color: var(--oui-color-primary);
|
|
140
|
+
--oui-map-cluster-text-color: var(--oui-color-on-primary);
|
|
139
141
|
--oui-color-inverse: var(--oui-color-brand);
|
|
140
142
|
--oui-color-on-inverse: #ffffff;
|
|
141
143
|
--oui-color-on-inverse-muted: rgba(255, 255, 255, 0.72);
|
package/package.json
CHANGED