@macrostrat/column-views 3.9.0 → 3.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.
Files changed (138) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/column-views.css +10 -0
  3. package/dist/correlation-chart/main.cjs +11 -3
  4. package/dist/correlation-chart/main.cjs.map +1 -1
  5. package/dist/correlation-chart/main.d.ts +1 -1
  6. package/dist/correlation-chart/main.js +11 -3
  7. package/dist/correlation-chart/main.js.map +1 -1
  8. package/dist/index.cjs +18 -42
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +4 -34
  12. package/dist/index.js.map +1 -1
  13. package/dist/unit-details/age-window-tag.cjs +68 -0
  14. package/dist/unit-details/age-window-tag.cjs.map +1 -0
  15. package/dist/unit-details/age-window-tag.d.ts +26 -0
  16. package/dist/unit-details/age-window-tag.js +66 -0
  17. package/dist/unit-details/age-window-tag.js.map +1 -0
  18. package/dist/unit-details/age-window-tag.module.sass.cjs +12 -0
  19. package/dist/unit-details/age-window-tag.module.sass.cjs.map +1 -0
  20. package/dist/unit-details/age-window-tag.module.sass.js +11 -0
  21. package/dist/unit-details/age-window-tag.module.sass.js.map +1 -0
  22. package/dist/unit-details/index.d.ts +1 -0
  23. package/dist/units/boxes.cjs +3 -3
  24. package/dist/units/boxes.cjs.map +1 -1
  25. package/dist/units/boxes.js +3 -3
  26. package/dist/units/boxes.js.map +1 -1
  27. package/dist/units/index.cjs +7 -11
  28. package/dist/units/index.cjs.map +1 -1
  29. package/dist/units/index.d.ts +0 -1
  30. package/dist/units/index.js +4 -9
  31. package/dist/units/index.js.map +1 -1
  32. package/package.json +6 -27
  33. package/src/correlation-chart/main.ts +14 -2
  34. package/src/index.ts +3 -1
  35. package/src/unit-details/age-window-tag.module.sass +10 -0
  36. package/src/unit-details/age-window-tag.ts +102 -0
  37. package/src/unit-details/index.ts +1 -0
  38. package/src/units/boxes.ts +7 -4
  39. package/src/units/index.ts +9 -26
  40. package/dist/maps/column-correlation/core.cjs +0 -288
  41. package/dist/maps/column-correlation/core.cjs.map +0 -1
  42. package/dist/maps/column-correlation/core.d.ts +0 -9
  43. package/dist/maps/column-correlation/core.js +0 -286
  44. package/dist/maps/column-correlation/core.js.map +0 -1
  45. package/dist/maps/column-correlation/index.d.ts +0 -2
  46. package/dist/maps/column-correlation/state.cjs +0 -193
  47. package/dist/maps/column-correlation/state.cjs.map +0 -1
  48. package/dist/maps/column-correlation/state.d.ts +0 -62
  49. package/dist/maps/column-correlation/state.js +0 -190
  50. package/dist/maps/column-correlation/state.js.map +0 -1
  51. package/dist/maps/column-navigation/index.d.ts +0 -2
  52. package/dist/maps/column-navigation/mapbox/index.cjs +0 -215
  53. package/dist/maps/column-navigation/mapbox/index.cjs.map +0 -1
  54. package/dist/maps/column-navigation/mapbox/index.d.ts +0 -38
  55. package/dist/maps/column-navigation/mapbox/index.js +0 -213
  56. package/dist/maps/column-navigation/mapbox/index.js.map +0 -1
  57. package/dist/maps/column-navigation/mapbox/keyboard-navigation.cjs +0 -105
  58. package/dist/maps/column-navigation/mapbox/keyboard-navigation.cjs.map +0 -1
  59. package/dist/maps/column-navigation/mapbox/keyboard-navigation.d.ts +0 -8
  60. package/dist/maps/column-navigation/mapbox/keyboard-navigation.js +0 -105
  61. package/dist/maps/column-navigation/mapbox/keyboard-navigation.js.map +0 -1
  62. package/dist/maps/column-navigation/mapbox/state.cjs +0 -73
  63. package/dist/maps/column-navigation/mapbox/state.cjs.map +0 -1
  64. package/dist/maps/column-navigation/mapbox/state.d.ts +0 -23
  65. package/dist/maps/column-navigation/mapbox/state.js +0 -71
  66. package/dist/maps/column-navigation/mapbox/state.js.map +0 -1
  67. package/dist/maps/column-navigation/svg/animated.d.ts +0 -1
  68. package/dist/maps/column-navigation/svg/data-fetcher.cjs +0 -25
  69. package/dist/maps/column-navigation/svg/data-fetcher.cjs.map +0 -1
  70. package/dist/maps/column-navigation/svg/data-fetcher.d.ts +0 -6
  71. package/dist/maps/column-navigation/svg/data-fetcher.js +0 -25
  72. package/dist/maps/column-navigation/svg/data-fetcher.js.map +0 -1
  73. package/dist/maps/column-navigation/svg/index.cjs +0 -94
  74. package/dist/maps/column-navigation/svg/index.cjs.map +0 -1
  75. package/dist/maps/column-navigation/svg/index.d.ts +0 -9
  76. package/dist/maps/column-navigation/svg/index.js +0 -93
  77. package/dist/maps/column-navigation/svg/index.js.map +0 -1
  78. package/dist/maps/column-navigation/svg/layers.cjs +0 -177
  79. package/dist/maps/column-navigation/svg/layers.cjs.map +0 -1
  80. package/dist/maps/column-navigation/svg/layers.d.ts +0 -54
  81. package/dist/maps/column-navigation/svg/layers.js +0 -174
  82. package/dist/maps/column-navigation/svg/layers.js.map +0 -1
  83. package/dist/maps/column-navigation/utils/keyboard-navigation.cjs +0 -50
  84. package/dist/maps/column-navigation/utils/keyboard-navigation.cjs.map +0 -1
  85. package/dist/maps/column-navigation/utils/keyboard-navigation.d.ts +0 -10
  86. package/dist/maps/column-navigation/utils/keyboard-navigation.js +0 -50
  87. package/dist/maps/column-navigation/utils/keyboard-navigation.js.map +0 -1
  88. package/dist/maps/index.d.ts +0 -4
  89. package/dist/maps/inset-map/index.cjs +0 -71
  90. package/dist/maps/inset-map/index.cjs.map +0 -1
  91. package/dist/maps/inset-map/index.d.ts +0 -16
  92. package/dist/maps/inset-map/index.js +0 -69
  93. package/dist/maps/inset-map/index.js.map +0 -1
  94. package/dist/maps/layers/columns.cjs +0 -165
  95. package/dist/maps/layers/columns.cjs.map +0 -1
  96. package/dist/maps/layers/columns.d.ts +0 -28
  97. package/dist/maps/layers/columns.js +0 -165
  98. package/dist/maps/layers/columns.js.map +0 -1
  99. package/dist/maps/layers/index.d.ts +0 -2
  100. package/dist/maps/layers/units.cjs +0 -207
  101. package/dist/maps/layers/units.cjs.map +0 -1
  102. package/dist/maps/layers/units.d.ts +0 -14
  103. package/dist/maps/layers/units.js +0 -204
  104. package/dist/maps/layers/units.js.map +0 -1
  105. package/dist/units/colors.cjs +0 -115
  106. package/dist/units/colors.cjs.map +0 -1
  107. package/dist/units/colors.d.ts +0 -20
  108. package/dist/units/colors.js +0 -113
  109. package/dist/units/colors.js.map +0 -1
  110. package/dist/units/resolvers.cjs +0 -125
  111. package/dist/units/resolvers.cjs.map +0 -1
  112. package/dist/units/resolvers.d.ts +0 -8
  113. package/dist/units/resolvers.js +0 -125
  114. package/dist/units/resolvers.js.map +0 -1
  115. package/src/maps/column-correlation/column-correlation-map.stories.ts +0 -108
  116. package/src/maps/column-correlation/core.ts +0 -342
  117. package/src/maps/column-correlation/index.ts +0 -2
  118. package/src/maps/column-correlation/state.ts +0 -315
  119. package/src/maps/column-navigation/index.ts +0 -2
  120. package/src/maps/column-navigation/mapbox/column-navigation-map.stories.ts +0 -278
  121. package/src/maps/column-navigation/mapbox/index.ts +0 -276
  122. package/src/maps/column-navigation/mapbox/keyboard-navigation.ts +0 -133
  123. package/src/maps/column-navigation/mapbox/state.ts +0 -119
  124. package/src/maps/column-navigation/svg/animated.ts +0 -78
  125. package/src/maps/column-navigation/svg/column-navigation-svg-map.stories.ts +0 -46
  126. package/src/maps/column-navigation/svg/data-fetcher.ts +0 -34
  127. package/src/maps/column-navigation/svg/index.ts +0 -96
  128. package/src/maps/column-navigation/svg/layers.ts +0 -233
  129. package/src/maps/column-navigation/utils/keyboard-navigation.ts +0 -58
  130. package/src/maps/index.ts +0 -4
  131. package/src/maps/inset-map/index.ts +0 -87
  132. package/src/maps/inset-map/inset-map.stories.ts +0 -20
  133. package/src/maps/layers/columns.ts +0 -216
  134. package/src/maps/layers/index.ts +0 -2
  135. package/src/maps/layers/units.ts +0 -286
  136. package/src/maps/unit-map.stories.ts +0 -79
  137. package/src/units/colors.ts +0 -183
  138. package/src/units/resolvers.ts +0 -141
@@ -1,288 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const mapboxReact = require("@macrostrat/mapbox-react");
4
- const mapboxGl = require("mapbox-gl");
5
- const h = require("@macrostrat/hyper");
6
- const React = require("react");
7
- const mapboxUtils = require("@macrostrat/mapbox-utils");
8
- const state = require("./state.cjs");
9
- const index = require("../inset-map/index.cjs");
10
- const mapStyles = require("@macrostrat/map-styles");
11
- const columns = require("../layers/columns.cjs");
12
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
- const h__default = /* @__PURE__ */ _interopDefault(h);
14
- function ColumnCorrelationMap(props) {
15
- const { padding = 50, children, columnColor, projectID, ...rest } = props;
16
- return h__default.default(
17
- index.InsetMap,
18
- {
19
- ...rest,
20
- boxZoom: false,
21
- dragRotate: false
22
- },
23
- [
24
- h__default.default(ColumnsLayer, { color: columnColor }),
25
- h__default.default(SelectedColumnsLayer),
26
- h__default.default(MapClickHandler),
27
- h__default.default(ColumnInteractionHandler),
28
- h__default.default(HoveredColumnHighlight),
29
- h__default.default(ColumnZoomer, { padding }),
30
- h__default.default(SectionLine, { padding }),
31
- children
32
- ]
33
- );
34
- }
35
- function ColumnZoomer({ padding }) {
36
- const zoomColumn = state.useCorrelationMapStore((state2) => state2.zoomColumn);
37
- const zoomNonce = state.useCorrelationMapStore((state2) => state2.zoomNonce);
38
- const columns2 = state.useCorrelationMapStore((state2) => state2.columns);
39
- const bounds = React.useMemo(() => {
40
- if (zoomColumn == null || columns2 == null) return null;
41
- const col = columns2.find((c) => c.properties?.col_id === zoomColumn);
42
- if (col?.geometry == null) return null;
43
- const b = new mapboxGl.LngLatBounds();
44
- forEachCoordinate(col.geometry, (coord) => b.extend(coord));
45
- return b.isEmpty() ? null : b;
46
- }, [zoomColumn, zoomNonce, columns2]);
47
- mapboxReact.useMapEaseTo({ bounds, padding: padding * 2 });
48
- return null;
49
- }
50
- function forEachCoordinate(geometry, fn) {
51
- const walk = (coords) => {
52
- if (typeof coords[0] === "number") {
53
- fn(coords);
54
- } else {
55
- for (const c of coords) walk(c);
56
- }
57
- };
58
- if (geometry?.coordinates != null) walk(geometry.coordinates);
59
- }
60
- const columnLayers = ["columns-fill", "columns-points"];
61
- function MapClickHandler() {
62
- const onClickMap = state.useCorrelationMapStore((state2) => state2.onClickMap);
63
- mapboxReact.useMapClickHandler(
64
- (e) => {
65
- onClickMap(e, { type: "Point", coordinates: e.lngLat.toArray() });
66
- },
67
- [onClickMap]
68
- );
69
- return null;
70
- }
71
- function ColumnInteractionHandler() {
72
- const toggleColumn = state.useCorrelationMapStore((state2) => state2.toggleColumn);
73
- const setHoveredColumn = state.useCorrelationMapStore(
74
- (state2) => state2.setHoveredColumn
75
- );
76
- const isManual = state.useCorrelationMapStore(
77
- (state2) => state2.selectionMode === "manual"
78
- );
79
- const hoveredRef = React.useRef(null);
80
- mapboxReact.useMapStyleOperator(
81
- (map) => {
82
- if (!isManual) return;
83
- const onClick = (e) => {
84
- const colID = e.features?.[0]?.properties?.col_id;
85
- if (colID != null) toggleColumn(colID);
86
- };
87
- map.on("click", columnLayers, onClick);
88
- return () => map.off("click", columnLayers, onClick);
89
- },
90
- [isManual, toggleColumn]
91
- );
92
- mapboxReact.useMapStyleOperator(
93
- (map) => {
94
- const clearHover = () => {
95
- if (hoveredRef.current != null) {
96
- map.setFeatureState(
97
- { source: "columns", id: hoveredRef.current },
98
- { hover: false }
99
- );
100
- hoveredRef.current = null;
101
- }
102
- };
103
- const onMove = (e) => {
104
- const f = e.features?.[0];
105
- if (f == null) return;
106
- if (hoveredRef.current !== f.id) {
107
- clearHover();
108
- map.setFeatureState({ source: "columns", id: f.id }, { hover: true });
109
- hoveredRef.current = f.id;
110
- }
111
- setHoveredColumn(f.properties?.col_id ?? null);
112
- map.getCanvas().style.cursor = "pointer";
113
- };
114
- const onLeave = () => {
115
- clearHover();
116
- setHoveredColumn(null);
117
- map.getCanvas().style.cursor = "";
118
- };
119
- map.on("mousemove", columnLayers, onMove);
120
- map.on("mouseleave", columnLayers, onLeave);
121
- return () => {
122
- map.off("mousemove", columnLayers, onMove);
123
- map.off("mouseleave", columnLayers, onLeave);
124
- clearHover();
125
- };
126
- },
127
- [setHoveredColumn]
128
- );
129
- return null;
130
- }
131
- function HoveredColumnHighlight() {
132
- const hoveredColumn = state.useCorrelationMapStore((state2) => state2.hoveredColumn);
133
- const columns2 = state.useCorrelationMapStore((state2) => state2.columns);
134
- const appliedRef = React.useRef(null);
135
- mapboxReact.useMapStyleOperator(
136
- (map) => {
137
- if (appliedRef.current != null) {
138
- map.setFeatureState(
139
- { source: "columns", id: appliedRef.current },
140
- { highlighted: false }
141
- );
142
- appliedRef.current = null;
143
- }
144
- if (hoveredColumn == null || columns2 == null) return;
145
- const col = columns2.find((c) => c.properties?.col_id === hoveredColumn);
146
- const id = col?.id ?? col?.properties?.col_id;
147
- if (id == null) return;
148
- map.setFeatureState({ source: "columns", id }, { highlighted: true });
149
- appliedRef.current = id;
150
- },
151
- [hoveredColumn, columns2]
152
- );
153
- return null;
154
- }
155
- function SelectedColumnsLayer() {
156
- mapboxReact.useOverlayStyle(() => selectedColumnsStyle, []);
157
- const focusedColumns = state.useCorrelationMapStore(
158
- (state2) => state2.focusedColumns
159
- );
160
- mapboxReact.useMapStyleOperator(
161
- (map) => {
162
- let features = focusedColumns;
163
- const data = {
164
- type: "FeatureCollection",
165
- features
166
- };
167
- const columnCentroidLine = {
168
- type: "Feature",
169
- geometry: {
170
- type: "LineString",
171
- coordinates: features.map(
172
- (col) => col.properties.centroid.geometry.coordinates
173
- )
174
- },
175
- properties: {}
176
- };
177
- mapboxUtils.setGeoJSON(map, "selected-columns", data);
178
- mapboxUtils.setGeoJSON(map, "selected-column-centroids", {
179
- type: "FeatureCollection",
180
- features: [columnCentroidLine]
181
- });
182
- },
183
- [focusedColumns]
184
- );
185
- return null;
186
- }
187
- function ColumnsLayer({ enabled = true, color }) {
188
- const columns$1 = state.useCorrelationMapStore((state2) => state2.columns);
189
- return h__default.default(columns.BaseColumnsLayer, { enabled, color, columns: columns$1 });
190
- }
191
- const selectedColumnsStyle = {
192
- version: 8,
193
- sources: {
194
- "selected-columns": mapboxUtils.buildGeoJSONSource(),
195
- "selected-column-centroids": mapboxUtils.buildGeoJSONSource()
196
- },
197
- layers: [
198
- {
199
- id: "selected-columns-fill",
200
- type: "fill",
201
- source: "selected-columns",
202
- paint: {
203
- "fill-color": "rgba(255, 0, 0, 0.1)"
204
- }
205
- },
206
- {
207
- id: "selected-column-centroids-line",
208
- type: "line",
209
- source: "selected-column-centroids",
210
- paint: {
211
- "line-color": "rgba(255, 0, 0, 0.8)",
212
- "line-width": 2,
213
- "line-dasharray": [2, 2]
214
- }
215
- },
216
- {
217
- id: "selected-column-centroids-points",
218
- type: "circle",
219
- source: "selected-column-centroids",
220
- paint: {
221
- "circle-radius": 4,
222
- "circle-color": "rgba(255, 0, 0, 0.8)"
223
- }
224
- }
225
- ]
226
- };
227
- const lineOfSectionStyle = {
228
- version: 8,
229
- sources: {
230
- elevationMarker: mapboxUtils.buildGeoJSONSource(),
231
- crossSectionLine: mapboxUtils.buildGeoJSONSource(),
232
- crossSectionEndpoints: mapboxUtils.buildGeoJSONSource()
233
- },
234
- layers: mapStyles.buildCrossSectionLayers()
235
- };
236
- function SectionLine({ padding }) {
237
- mapboxReact.useOverlayStyle(() => lineOfSectionStyle, []);
238
- const focusedLine = state.useCorrelationMapStore((state2) => state2.focusedLine);
239
- const focusedColumns = state.useCorrelationMapStore(
240
- (state2) => state2.focusedColumns
241
- );
242
- mapboxReact.useMapStyleOperator(
243
- (map) => {
244
- if (focusedLine == null) {
245
- mapboxUtils.setGeoJSON(map, "crossSectionLine", emptyFeatureCollection);
246
- mapboxUtils.setGeoJSON(map, "crossSectionEndpoints", emptyFeatureCollection);
247
- return;
248
- }
249
- const data = {
250
- type: "FeatureCollection",
251
- features: [
252
- {
253
- type: "Feature",
254
- geometry: focusedLine,
255
- properties: { id: "focusedLine" }
256
- }
257
- ]
258
- };
259
- mapboxUtils.setGeoJSON(map, "crossSectionLine", data);
260
- mapboxUtils.setGeoJSON(map, "crossSectionEndpoints", {
261
- type: "FeatureCollection",
262
- features: focusedLine.coordinates.map((coord) => ({
263
- type: "Feature",
264
- geometry: { type: "Point", coordinates: coord },
265
- properties: {}
266
- }))
267
- });
268
- },
269
- [focusedLine]
270
- );
271
- const bounds = React.useMemo(() => {
272
- const coords = focusedLine != null && focusedLine.coordinates.length >= 2 ? focusedLine.coordinates : focusedColumns.map((c) => c.properties.centroid.geometry.coordinates);
273
- if (coords.length < 2) return null;
274
- const bounds2 = new mapboxGl.LngLatBounds();
275
- for (const coord of coords) {
276
- bounds2.extend(coord);
277
- }
278
- return bounds2;
279
- }, [focusedLine, focusedColumns]);
280
- mapboxReact.useMapEaseTo({ bounds, padding, trackResize: true });
281
- return null;
282
- }
283
- const emptyFeatureCollection = {
284
- type: "FeatureCollection",
285
- features: []
286
- };
287
- exports.ColumnCorrelationMap = ColumnCorrelationMap;
288
- //# sourceMappingURL=core.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.cjs","sources":["../../../src/maps/column-correlation/core.ts"],"sourcesContent":["import {\n useMapClickHandler,\n useMapEaseTo,\n useMapStyleOperator,\n useOverlayStyle,\n} from \"@macrostrat/mapbox-react\";\nimport { LngLatBounds, Style } from \"mapbox-gl\";\nimport h from \"@macrostrat/hyper\";\nimport { Feature, FeatureCollection } from \"geojson\";\nimport { ReactNode, useMemo, useRef } from \"react\";\nimport { setGeoJSON, buildGeoJSONSource } from \"@macrostrat/mapbox-utils\";\n\nimport { useCorrelationMapStore } from \"./state\";\nimport { InsetMap, type InsetMapProps } from \"../inset-map\";\nimport { BaseColumnsLayer } from \"../layers\";\nimport { buildCrossSectionLayers } from \"@macrostrat/map-styles\";\n\nexport interface CorrelationMapProps extends InsetMapProps {\n padding?: number;\n children?: ReactNode;\n accessToken?: string;\n columnColor?: string;\n}\n\nexport function ColumnCorrelationMap(props: CorrelationMapProps) {\n const { padding = 50, children, columnColor, projectID, ...rest } = props;\n\n return h(\n InsetMap,\n {\n ...rest,\n boxZoom: false,\n dragRotate: false,\n },\n [\n h(ColumnsLayer, { color: columnColor }),\n h(SelectedColumnsLayer),\n h(MapClickHandler),\n h(ColumnInteractionHandler),\n h(HoveredColumnHighlight),\n h(ColumnZoomer, { padding }),\n h(SectionLine, { padding }),\n children,\n ],\n );\n}\n\nfunction ColumnZoomer({ padding }: { padding: number }) {\n /** Frame a single column when `zoomColumn` is set (e.g. header click). */\n const zoomColumn = useCorrelationMapStore((state) => state.zoomColumn);\n const zoomNonce = useCorrelationMapStore((state) => state.zoomNonce);\n const columns = useCorrelationMapStore((state) => state.columns);\n\n const bounds = useMemo(() => {\n if (zoomColumn == null || columns == null) return null;\n const col = columns.find((c) => c.properties?.col_id === zoomColumn);\n if (col?.geometry == null) return null;\n const b = new LngLatBounds();\n forEachCoordinate(col.geometry, (coord) => b.extend(coord as [number, number]));\n return b.isEmpty() ? null : b;\n // zoomNonce forces a fresh bounds object so repeat clicks re-frame\n }, [zoomColumn, zoomNonce, columns]);\n\n useMapEaseTo({ bounds, padding: padding * 2 });\n return null;\n}\n\nfunction forEachCoordinate(geometry: any, fn: (coord: number[]) => void) {\n const walk = (coords: any) => {\n if (typeof coords[0] === \"number\") {\n fn(coords);\n } else {\n for (const c of coords) walk(c);\n }\n };\n if (geometry?.coordinates != null) walk(geometry.coordinates);\n}\n\nconst columnLayers = [\"columns-fill\", \"columns-points\"];\n\nfunction MapClickHandler() {\n const onClickMap = useCorrelationMapStore((state) => state.onClickMap);\n\n useMapClickHandler(\n (e) => {\n onClickMap(e, { type: \"Point\", coordinates: e.lngLat.toArray() });\n },\n [onClickMap],\n );\n\n return null;\n}\n\nfunction ColumnInteractionHandler() {\n /** Per-column click (manual selection) and hover highlighting. */\n const toggleColumn = useCorrelationMapStore((state) => state.toggleColumn);\n const setHoveredColumn = useCorrelationMapStore(\n (state) => state.setHoveredColumn,\n );\n const isManual = useCorrelationMapStore(\n (state) => state.selectionMode === \"manual\",\n );\n const hoveredRef = useRef<number | string | null>(null);\n\n // Click a column to toggle it in/out of the selection (manual mode only)\n useMapStyleOperator(\n (map) => {\n if (!isManual) return;\n const onClick = (e) => {\n const colID = e.features?.[0]?.properties?.col_id;\n if (colID != null) toggleColumn(colID);\n };\n map.on(\"click\", columnLayers, onClick);\n return () => map.off(\"click\", columnLayers, onClick);\n },\n [isManual, toggleColumn],\n );\n\n // Hover highlighting (via the columns layer's `hover` feature-state)\n useMapStyleOperator(\n (map) => {\n const clearHover = () => {\n if (hoveredRef.current != null) {\n map.setFeatureState(\n { source: \"columns\", id: hoveredRef.current },\n { hover: false },\n );\n hoveredRef.current = null;\n }\n };\n const onMove = (e) => {\n const f = e.features?.[0];\n if (f == null) return;\n if (hoveredRef.current !== f.id) {\n clearHover();\n map.setFeatureState({ source: \"columns\", id: f.id }, { hover: true });\n hoveredRef.current = f.id;\n }\n setHoveredColumn(f.properties?.col_id ?? null);\n map.getCanvas().style.cursor = \"pointer\";\n };\n const onLeave = () => {\n clearHover();\n setHoveredColumn(null);\n map.getCanvas().style.cursor = \"\";\n };\n map.on(\"mousemove\", columnLayers, onMove);\n map.on(\"mouseleave\", columnLayers, onLeave);\n return () => {\n map.off(\"mousemove\", columnLayers, onMove);\n map.off(\"mouseleave\", columnLayers, onLeave);\n clearHover();\n };\n },\n [setHoveredColumn],\n );\n\n return null;\n}\n\nfunction HoveredColumnHighlight() {\n /** Reflects the store's `hoveredColumn` on the map (e.g. when a column is\n * hovered elsewhere in the UI) using the `highlighted` feature-state. */\n const hoveredColumn = useCorrelationMapStore((state) => state.hoveredColumn);\n const columns = useCorrelationMapStore((state) => state.columns);\n const appliedRef = useRef<number | string | null>(null);\n\n useMapStyleOperator(\n (map) => {\n if (appliedRef.current != null) {\n map.setFeatureState(\n { source: \"columns\", id: appliedRef.current },\n { highlighted: false },\n );\n appliedRef.current = null;\n }\n if (hoveredColumn == null || columns == null) return;\n const col = columns.find((c) => c.properties?.col_id === hoveredColumn);\n const id = (col as any)?.id ?? col?.properties?.col_id;\n if (id == null) return;\n map.setFeatureState({ source: \"columns\", id }, { highlighted: true });\n appliedRef.current = id;\n },\n [hoveredColumn, columns],\n );\n\n return null;\n}\n\nfunction SelectedColumnsLayer() {\n useOverlayStyle(() => selectedColumnsStyle, []);\n\n const focusedColumns = useCorrelationMapStore(\n (state) => state.focusedColumns,\n );\n\n useMapStyleOperator(\n (map) => {\n let features = focusedColumns;\n\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features,\n };\n\n const columnCentroidLine: Feature = {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: features.map(\n (col) => col.properties.centroid.geometry.coordinates,\n ),\n },\n properties: {},\n };\n\n setGeoJSON(map, \"selected-columns\", data);\n setGeoJSON(map, \"selected-column-centroids\", {\n type: \"FeatureCollection\",\n features: [columnCentroidLine],\n });\n },\n [focusedColumns],\n );\n return null;\n}\n\nfunction ColumnsLayer({ enabled = true, color }) {\n const columns = useCorrelationMapStore((state) => state.columns);\n return h(BaseColumnsLayer, { enabled, color, columns });\n}\n\nconst selectedColumnsStyle: Style = {\n version: 8,\n sources: {\n \"selected-columns\": buildGeoJSONSource(),\n \"selected-column-centroids\": buildGeoJSONSource(),\n },\n layers: [\n {\n id: \"selected-columns-fill\",\n type: \"fill\",\n source: \"selected-columns\",\n paint: {\n \"fill-color\": \"rgba(255, 0, 0, 0.1)\",\n },\n },\n {\n id: \"selected-column-centroids-line\",\n type: \"line\",\n source: \"selected-column-centroids\",\n paint: {\n \"line-color\": \"rgba(255, 0, 0, 0.8)\",\n \"line-width\": 2,\n \"line-dasharray\": [2, 2],\n },\n },\n {\n id: \"selected-column-centroids-points\",\n type: \"circle\",\n source: \"selected-column-centroids\",\n paint: {\n \"circle-radius\": 4,\n \"circle-color\": \"rgba(255, 0, 0, 0.8)\",\n },\n },\n ],\n};\n\nconst lineOfSectionStyle: Style = {\n version: 8,\n sources: {\n elevationMarker: buildGeoJSONSource(),\n crossSectionLine: buildGeoJSONSource(),\n crossSectionEndpoints: buildGeoJSONSource(),\n },\n layers: buildCrossSectionLayers(),\n};\n\nfunction SectionLine({ padding }: { padding: number }) {\n useOverlayStyle(() => lineOfSectionStyle, []);\n const focusedLine = useCorrelationMapStore((state) => state.focusedLine);\n const focusedColumns = useCorrelationMapStore(\n (state) => state.focusedColumns,\n );\n\n // Setup focused line (only drawn in line-of-section mode)\n useMapStyleOperator(\n (map) => {\n if (focusedLine == null) {\n // Clear any previously-drawn line (e.g. after switching to manual mode)\n setGeoJSON(map, \"crossSectionLine\", emptyFeatureCollection);\n setGeoJSON(map, \"crossSectionEndpoints\", emptyFeatureCollection);\n return;\n }\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features: [\n {\n type: \"Feature\",\n geometry: focusedLine,\n properties: { id: \"focusedLine\" },\n },\n ],\n };\n\n setGeoJSON(map, \"crossSectionLine\", data);\n setGeoJSON(map, \"crossSectionEndpoints\", {\n type: \"FeatureCollection\",\n features: focusedLine.coordinates.map((coord) => ({\n type: \"Feature\",\n geometry: { type: \"Point\", coordinates: coord },\n properties: {},\n })),\n });\n },\n [focusedLine],\n );\n\n const bounds = useMemo(() => {\n // In line mode, frame the line; in manual mode, frame the selected columns\n const coords: number[][] =\n focusedLine != null && focusedLine.coordinates.length >= 2\n ? focusedLine.coordinates\n : focusedColumns.map((c) => c.properties.centroid.geometry.coordinates);\n if (coords.length < 2) return null;\n const bounds = new LngLatBounds();\n for (const coord of coords) {\n bounds.extend(coord as [number, number]);\n }\n return bounds;\n }, [focusedLine, focusedColumns]);\n\n useMapEaseTo({ bounds, padding, trackResize: true });\n\n return null;\n}\n\nconst emptyFeatureCollection: FeatureCollection = {\n type: \"FeatureCollection\",\n features: [],\n};\n"],"names":["h","InsetMap","useCorrelationMapStore","state","columns","useMemo","LngLatBounds","useMapEaseTo","useMapClickHandler","useRef","useMapStyleOperator","useOverlayStyle","setGeoJSON","BaseColumnsLayer","buildGeoJSONSource","buildCrossSectionLayers","bounds"],"mappings":";;;;;;;;;;;;;AAwBO,SAAS,qBAAqB,OAA4B;AAC/D,QAAM,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A,MACF;AAGFA,6BAAW,KAAK,oBAAoB,IAAI;AACxCA,kBAAAA,WAAW,KAAK,yBAAyB;AAAA,QACvC,MAAM;AAAA,QACN,UAAU,YAAY,YAAY,IAAI,CAAC,WAAW;AAAA,UAChD,MAAM;AAAA,UACN,UAAU,EAAE,MAAM,SAAS,aAAa,MAAA;AAAA,UACxC,YAAY,CAAA;AAAA,QAAC,EACb;AAAA,MAAA,CACH;AAAA,IACH;AAAA,IACA,CAAC,WAAW;AAAA,EAAA;AAGd,QAAM,SAASP,MAAAA,QAAQ,MAAM;AAE3B,UAAM,SACJ,eAAe,QAAQ,YAAY,YAAY,UAAU,IACrD,YAAY,cACZ,eAAe,IAAI,CAAC,MAAM,EAAE,WAAW,SAAS,SAAS,WAAW;AAC1E,QAAI,OAAO,SAAS,EAAG,QAAO;AAC9B,UAAMW,UAAS,IAAIV,sBAAA;AACnB,eAAW,SAAS,QAAQ;AAC1BU,cAAO,OAAO,KAAyB;AAAA,IACzC;AACA,WAAOA;AAAAA,EACT,GAAG,CAAC,aAAa,cAAc,CAAC;AAEhCT,cAAAA,aAAa,EAAE,QAAQ,SAAS,aAAa,MAAM;AAEnD,SAAO;AACT;AAEA,MAAM,yBAA4C;AAAA,EAChD,MAAM;AAAA,EACN,UAAU,CAAA;AACZ;;"}
@@ -1,9 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { InsetMapProps } from '../inset-map';
3
- export interface CorrelationMapProps extends InsetMapProps {
4
- padding?: number;
5
- children?: ReactNode;
6
- accessToken?: string;
7
- columnColor?: string;
8
- }
9
- export declare function ColumnCorrelationMap(props: CorrelationMapProps): import('react').FunctionComponentElement<InsetMapProps>;
@@ -1,286 +0,0 @@
1
- import { useOverlayStyle, useMapStyleOperator, useMapClickHandler, useMapEaseTo } from "@macrostrat/mapbox-react";
2
- import { LngLatBounds } from "mapbox-gl";
3
- import h from "@macrostrat/hyper";
4
- import { useRef, useMemo } from "react";
5
- import { setGeoJSON, buildGeoJSONSource } from "@macrostrat/mapbox-utils";
6
- import { useCorrelationMapStore } from "./state.js";
7
- import { InsetMap } from "../inset-map/index.js";
8
- import { buildCrossSectionLayers } from "@macrostrat/map-styles";
9
- import { BaseColumnsLayer } from "../layers/columns.js";
10
- function ColumnCorrelationMap(props) {
11
- const { padding = 50, children, columnColor, projectID, ...rest } = props;
12
- return h(
13
- InsetMap,
14
- {
15
- ...rest,
16
- boxZoom: false,
17
- dragRotate: false
18
- },
19
- [
20
- h(ColumnsLayer, { color: columnColor }),
21
- h(SelectedColumnsLayer),
22
- h(MapClickHandler),
23
- h(ColumnInteractionHandler),
24
- h(HoveredColumnHighlight),
25
- h(ColumnZoomer, { padding }),
26
- h(SectionLine, { padding }),
27
- children
28
- ]
29
- );
30
- }
31
- function ColumnZoomer({ padding }) {
32
- const zoomColumn = useCorrelationMapStore((state) => state.zoomColumn);
33
- const zoomNonce = useCorrelationMapStore((state) => state.zoomNonce);
34
- const columns = useCorrelationMapStore((state) => state.columns);
35
- const bounds = useMemo(() => {
36
- if (zoomColumn == null || columns == null) return null;
37
- const col = columns.find((c) => c.properties?.col_id === zoomColumn);
38
- if (col?.geometry == null) return null;
39
- const b = new LngLatBounds();
40
- forEachCoordinate(col.geometry, (coord) => b.extend(coord));
41
- return b.isEmpty() ? null : b;
42
- }, [zoomColumn, zoomNonce, columns]);
43
- useMapEaseTo({ bounds, padding: padding * 2 });
44
- return null;
45
- }
46
- function forEachCoordinate(geometry, fn) {
47
- const walk = (coords) => {
48
- if (typeof coords[0] === "number") {
49
- fn(coords);
50
- } else {
51
- for (const c of coords) walk(c);
52
- }
53
- };
54
- if (geometry?.coordinates != null) walk(geometry.coordinates);
55
- }
56
- const columnLayers = ["columns-fill", "columns-points"];
57
- function MapClickHandler() {
58
- const onClickMap = useCorrelationMapStore((state) => state.onClickMap);
59
- useMapClickHandler(
60
- (e) => {
61
- onClickMap(e, { type: "Point", coordinates: e.lngLat.toArray() });
62
- },
63
- [onClickMap]
64
- );
65
- return null;
66
- }
67
- function ColumnInteractionHandler() {
68
- const toggleColumn = useCorrelationMapStore((state) => state.toggleColumn);
69
- const setHoveredColumn = useCorrelationMapStore(
70
- (state) => state.setHoveredColumn
71
- );
72
- const isManual = useCorrelationMapStore(
73
- (state) => state.selectionMode === "manual"
74
- );
75
- const hoveredRef = useRef(null);
76
- useMapStyleOperator(
77
- (map) => {
78
- if (!isManual) return;
79
- const onClick = (e) => {
80
- const colID = e.features?.[0]?.properties?.col_id;
81
- if (colID != null) toggleColumn(colID);
82
- };
83
- map.on("click", columnLayers, onClick);
84
- return () => map.off("click", columnLayers, onClick);
85
- },
86
- [isManual, toggleColumn]
87
- );
88
- useMapStyleOperator(
89
- (map) => {
90
- const clearHover = () => {
91
- if (hoveredRef.current != null) {
92
- map.setFeatureState(
93
- { source: "columns", id: hoveredRef.current },
94
- { hover: false }
95
- );
96
- hoveredRef.current = null;
97
- }
98
- };
99
- const onMove = (e) => {
100
- const f = e.features?.[0];
101
- if (f == null) return;
102
- if (hoveredRef.current !== f.id) {
103
- clearHover();
104
- map.setFeatureState({ source: "columns", id: f.id }, { hover: true });
105
- hoveredRef.current = f.id;
106
- }
107
- setHoveredColumn(f.properties?.col_id ?? null);
108
- map.getCanvas().style.cursor = "pointer";
109
- };
110
- const onLeave = () => {
111
- clearHover();
112
- setHoveredColumn(null);
113
- map.getCanvas().style.cursor = "";
114
- };
115
- map.on("mousemove", columnLayers, onMove);
116
- map.on("mouseleave", columnLayers, onLeave);
117
- return () => {
118
- map.off("mousemove", columnLayers, onMove);
119
- map.off("mouseleave", columnLayers, onLeave);
120
- clearHover();
121
- };
122
- },
123
- [setHoveredColumn]
124
- );
125
- return null;
126
- }
127
- function HoveredColumnHighlight() {
128
- const hoveredColumn = useCorrelationMapStore((state) => state.hoveredColumn);
129
- const columns = useCorrelationMapStore((state) => state.columns);
130
- const appliedRef = useRef(null);
131
- useMapStyleOperator(
132
- (map) => {
133
- if (appliedRef.current != null) {
134
- map.setFeatureState(
135
- { source: "columns", id: appliedRef.current },
136
- { highlighted: false }
137
- );
138
- appliedRef.current = null;
139
- }
140
- if (hoveredColumn == null || columns == null) return;
141
- const col = columns.find((c) => c.properties?.col_id === hoveredColumn);
142
- const id = col?.id ?? col?.properties?.col_id;
143
- if (id == null) return;
144
- map.setFeatureState({ source: "columns", id }, { highlighted: true });
145
- appliedRef.current = id;
146
- },
147
- [hoveredColumn, columns]
148
- );
149
- return null;
150
- }
151
- function SelectedColumnsLayer() {
152
- useOverlayStyle(() => selectedColumnsStyle, []);
153
- const focusedColumns = useCorrelationMapStore(
154
- (state) => state.focusedColumns
155
- );
156
- useMapStyleOperator(
157
- (map) => {
158
- let features = focusedColumns;
159
- const data = {
160
- type: "FeatureCollection",
161
- features
162
- };
163
- const columnCentroidLine = {
164
- type: "Feature",
165
- geometry: {
166
- type: "LineString",
167
- coordinates: features.map(
168
- (col) => col.properties.centroid.geometry.coordinates
169
- )
170
- },
171
- properties: {}
172
- };
173
- setGeoJSON(map, "selected-columns", data);
174
- setGeoJSON(map, "selected-column-centroids", {
175
- type: "FeatureCollection",
176
- features: [columnCentroidLine]
177
- });
178
- },
179
- [focusedColumns]
180
- );
181
- return null;
182
- }
183
- function ColumnsLayer({ enabled = true, color }) {
184
- const columns = useCorrelationMapStore((state) => state.columns);
185
- return h(BaseColumnsLayer, { enabled, color, columns });
186
- }
187
- const selectedColumnsStyle = {
188
- version: 8,
189
- sources: {
190
- "selected-columns": buildGeoJSONSource(),
191
- "selected-column-centroids": buildGeoJSONSource()
192
- },
193
- layers: [
194
- {
195
- id: "selected-columns-fill",
196
- type: "fill",
197
- source: "selected-columns",
198
- paint: {
199
- "fill-color": "rgba(255, 0, 0, 0.1)"
200
- }
201
- },
202
- {
203
- id: "selected-column-centroids-line",
204
- type: "line",
205
- source: "selected-column-centroids",
206
- paint: {
207
- "line-color": "rgba(255, 0, 0, 0.8)",
208
- "line-width": 2,
209
- "line-dasharray": [2, 2]
210
- }
211
- },
212
- {
213
- id: "selected-column-centroids-points",
214
- type: "circle",
215
- source: "selected-column-centroids",
216
- paint: {
217
- "circle-radius": 4,
218
- "circle-color": "rgba(255, 0, 0, 0.8)"
219
- }
220
- }
221
- ]
222
- };
223
- const lineOfSectionStyle = {
224
- version: 8,
225
- sources: {
226
- elevationMarker: buildGeoJSONSource(),
227
- crossSectionLine: buildGeoJSONSource(),
228
- crossSectionEndpoints: buildGeoJSONSource()
229
- },
230
- layers: buildCrossSectionLayers()
231
- };
232
- function SectionLine({ padding }) {
233
- useOverlayStyle(() => lineOfSectionStyle, []);
234
- const focusedLine = useCorrelationMapStore((state) => state.focusedLine);
235
- const focusedColumns = useCorrelationMapStore(
236
- (state) => state.focusedColumns
237
- );
238
- useMapStyleOperator(
239
- (map) => {
240
- if (focusedLine == null) {
241
- setGeoJSON(map, "crossSectionLine", emptyFeatureCollection);
242
- setGeoJSON(map, "crossSectionEndpoints", emptyFeatureCollection);
243
- return;
244
- }
245
- const data = {
246
- type: "FeatureCollection",
247
- features: [
248
- {
249
- type: "Feature",
250
- geometry: focusedLine,
251
- properties: { id: "focusedLine" }
252
- }
253
- ]
254
- };
255
- setGeoJSON(map, "crossSectionLine", data);
256
- setGeoJSON(map, "crossSectionEndpoints", {
257
- type: "FeatureCollection",
258
- features: focusedLine.coordinates.map((coord) => ({
259
- type: "Feature",
260
- geometry: { type: "Point", coordinates: coord },
261
- properties: {}
262
- }))
263
- });
264
- },
265
- [focusedLine]
266
- );
267
- const bounds = useMemo(() => {
268
- const coords = focusedLine != null && focusedLine.coordinates.length >= 2 ? focusedLine.coordinates : focusedColumns.map((c) => c.properties.centroid.geometry.coordinates);
269
- if (coords.length < 2) return null;
270
- const bounds2 = new LngLatBounds();
271
- for (const coord of coords) {
272
- bounds2.extend(coord);
273
- }
274
- return bounds2;
275
- }, [focusedLine, focusedColumns]);
276
- useMapEaseTo({ bounds, padding, trackResize: true });
277
- return null;
278
- }
279
- const emptyFeatureCollection = {
280
- type: "FeatureCollection",
281
- features: []
282
- };
283
- export {
284
- ColumnCorrelationMap
285
- };
286
- //# sourceMappingURL=core.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.js","sources":["../../../src/maps/column-correlation/core.ts"],"sourcesContent":["import {\n useMapClickHandler,\n useMapEaseTo,\n useMapStyleOperator,\n useOverlayStyle,\n} from \"@macrostrat/mapbox-react\";\nimport { LngLatBounds, Style } from \"mapbox-gl\";\nimport h from \"@macrostrat/hyper\";\nimport { Feature, FeatureCollection } from \"geojson\";\nimport { ReactNode, useMemo, useRef } from \"react\";\nimport { setGeoJSON, buildGeoJSONSource } from \"@macrostrat/mapbox-utils\";\n\nimport { useCorrelationMapStore } from \"./state\";\nimport { InsetMap, type InsetMapProps } from \"../inset-map\";\nimport { BaseColumnsLayer } from \"../layers\";\nimport { buildCrossSectionLayers } from \"@macrostrat/map-styles\";\n\nexport interface CorrelationMapProps extends InsetMapProps {\n padding?: number;\n children?: ReactNode;\n accessToken?: string;\n columnColor?: string;\n}\n\nexport function ColumnCorrelationMap(props: CorrelationMapProps) {\n const { padding = 50, children, columnColor, projectID, ...rest } = props;\n\n return h(\n InsetMap,\n {\n ...rest,\n boxZoom: false,\n dragRotate: false,\n },\n [\n h(ColumnsLayer, { color: columnColor }),\n h(SelectedColumnsLayer),\n h(MapClickHandler),\n h(ColumnInteractionHandler),\n h(HoveredColumnHighlight),\n h(ColumnZoomer, { padding }),\n h(SectionLine, { padding }),\n children,\n ],\n );\n}\n\nfunction ColumnZoomer({ padding }: { padding: number }) {\n /** Frame a single column when `zoomColumn` is set (e.g. header click). */\n const zoomColumn = useCorrelationMapStore((state) => state.zoomColumn);\n const zoomNonce = useCorrelationMapStore((state) => state.zoomNonce);\n const columns = useCorrelationMapStore((state) => state.columns);\n\n const bounds = useMemo(() => {\n if (zoomColumn == null || columns == null) return null;\n const col = columns.find((c) => c.properties?.col_id === zoomColumn);\n if (col?.geometry == null) return null;\n const b = new LngLatBounds();\n forEachCoordinate(col.geometry, (coord) => b.extend(coord as [number, number]));\n return b.isEmpty() ? null : b;\n // zoomNonce forces a fresh bounds object so repeat clicks re-frame\n }, [zoomColumn, zoomNonce, columns]);\n\n useMapEaseTo({ bounds, padding: padding * 2 });\n return null;\n}\n\nfunction forEachCoordinate(geometry: any, fn: (coord: number[]) => void) {\n const walk = (coords: any) => {\n if (typeof coords[0] === \"number\") {\n fn(coords);\n } else {\n for (const c of coords) walk(c);\n }\n };\n if (geometry?.coordinates != null) walk(geometry.coordinates);\n}\n\nconst columnLayers = [\"columns-fill\", \"columns-points\"];\n\nfunction MapClickHandler() {\n const onClickMap = useCorrelationMapStore((state) => state.onClickMap);\n\n useMapClickHandler(\n (e) => {\n onClickMap(e, { type: \"Point\", coordinates: e.lngLat.toArray() });\n },\n [onClickMap],\n );\n\n return null;\n}\n\nfunction ColumnInteractionHandler() {\n /** Per-column click (manual selection) and hover highlighting. */\n const toggleColumn = useCorrelationMapStore((state) => state.toggleColumn);\n const setHoveredColumn = useCorrelationMapStore(\n (state) => state.setHoveredColumn,\n );\n const isManual = useCorrelationMapStore(\n (state) => state.selectionMode === \"manual\",\n );\n const hoveredRef = useRef<number | string | null>(null);\n\n // Click a column to toggle it in/out of the selection (manual mode only)\n useMapStyleOperator(\n (map) => {\n if (!isManual) return;\n const onClick = (e) => {\n const colID = e.features?.[0]?.properties?.col_id;\n if (colID != null) toggleColumn(colID);\n };\n map.on(\"click\", columnLayers, onClick);\n return () => map.off(\"click\", columnLayers, onClick);\n },\n [isManual, toggleColumn],\n );\n\n // Hover highlighting (via the columns layer's `hover` feature-state)\n useMapStyleOperator(\n (map) => {\n const clearHover = () => {\n if (hoveredRef.current != null) {\n map.setFeatureState(\n { source: \"columns\", id: hoveredRef.current },\n { hover: false },\n );\n hoveredRef.current = null;\n }\n };\n const onMove = (e) => {\n const f = e.features?.[0];\n if (f == null) return;\n if (hoveredRef.current !== f.id) {\n clearHover();\n map.setFeatureState({ source: \"columns\", id: f.id }, { hover: true });\n hoveredRef.current = f.id;\n }\n setHoveredColumn(f.properties?.col_id ?? null);\n map.getCanvas().style.cursor = \"pointer\";\n };\n const onLeave = () => {\n clearHover();\n setHoveredColumn(null);\n map.getCanvas().style.cursor = \"\";\n };\n map.on(\"mousemove\", columnLayers, onMove);\n map.on(\"mouseleave\", columnLayers, onLeave);\n return () => {\n map.off(\"mousemove\", columnLayers, onMove);\n map.off(\"mouseleave\", columnLayers, onLeave);\n clearHover();\n };\n },\n [setHoveredColumn],\n );\n\n return null;\n}\n\nfunction HoveredColumnHighlight() {\n /** Reflects the store's `hoveredColumn` on the map (e.g. when a column is\n * hovered elsewhere in the UI) using the `highlighted` feature-state. */\n const hoveredColumn = useCorrelationMapStore((state) => state.hoveredColumn);\n const columns = useCorrelationMapStore((state) => state.columns);\n const appliedRef = useRef<number | string | null>(null);\n\n useMapStyleOperator(\n (map) => {\n if (appliedRef.current != null) {\n map.setFeatureState(\n { source: \"columns\", id: appliedRef.current },\n { highlighted: false },\n );\n appliedRef.current = null;\n }\n if (hoveredColumn == null || columns == null) return;\n const col = columns.find((c) => c.properties?.col_id === hoveredColumn);\n const id = (col as any)?.id ?? col?.properties?.col_id;\n if (id == null) return;\n map.setFeatureState({ source: \"columns\", id }, { highlighted: true });\n appliedRef.current = id;\n },\n [hoveredColumn, columns],\n );\n\n return null;\n}\n\nfunction SelectedColumnsLayer() {\n useOverlayStyle(() => selectedColumnsStyle, []);\n\n const focusedColumns = useCorrelationMapStore(\n (state) => state.focusedColumns,\n );\n\n useMapStyleOperator(\n (map) => {\n let features = focusedColumns;\n\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features,\n };\n\n const columnCentroidLine: Feature = {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: features.map(\n (col) => col.properties.centroid.geometry.coordinates,\n ),\n },\n properties: {},\n };\n\n setGeoJSON(map, \"selected-columns\", data);\n setGeoJSON(map, \"selected-column-centroids\", {\n type: \"FeatureCollection\",\n features: [columnCentroidLine],\n });\n },\n [focusedColumns],\n );\n return null;\n}\n\nfunction ColumnsLayer({ enabled = true, color }) {\n const columns = useCorrelationMapStore((state) => state.columns);\n return h(BaseColumnsLayer, { enabled, color, columns });\n}\n\nconst selectedColumnsStyle: Style = {\n version: 8,\n sources: {\n \"selected-columns\": buildGeoJSONSource(),\n \"selected-column-centroids\": buildGeoJSONSource(),\n },\n layers: [\n {\n id: \"selected-columns-fill\",\n type: \"fill\",\n source: \"selected-columns\",\n paint: {\n \"fill-color\": \"rgba(255, 0, 0, 0.1)\",\n },\n },\n {\n id: \"selected-column-centroids-line\",\n type: \"line\",\n source: \"selected-column-centroids\",\n paint: {\n \"line-color\": \"rgba(255, 0, 0, 0.8)\",\n \"line-width\": 2,\n \"line-dasharray\": [2, 2],\n },\n },\n {\n id: \"selected-column-centroids-points\",\n type: \"circle\",\n source: \"selected-column-centroids\",\n paint: {\n \"circle-radius\": 4,\n \"circle-color\": \"rgba(255, 0, 0, 0.8)\",\n },\n },\n ],\n};\n\nconst lineOfSectionStyle: Style = {\n version: 8,\n sources: {\n elevationMarker: buildGeoJSONSource(),\n crossSectionLine: buildGeoJSONSource(),\n crossSectionEndpoints: buildGeoJSONSource(),\n },\n layers: buildCrossSectionLayers(),\n};\n\nfunction SectionLine({ padding }: { padding: number }) {\n useOverlayStyle(() => lineOfSectionStyle, []);\n const focusedLine = useCorrelationMapStore((state) => state.focusedLine);\n const focusedColumns = useCorrelationMapStore(\n (state) => state.focusedColumns,\n );\n\n // Setup focused line (only drawn in line-of-section mode)\n useMapStyleOperator(\n (map) => {\n if (focusedLine == null) {\n // Clear any previously-drawn line (e.g. after switching to manual mode)\n setGeoJSON(map, \"crossSectionLine\", emptyFeatureCollection);\n setGeoJSON(map, \"crossSectionEndpoints\", emptyFeatureCollection);\n return;\n }\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features: [\n {\n type: \"Feature\",\n geometry: focusedLine,\n properties: { id: \"focusedLine\" },\n },\n ],\n };\n\n setGeoJSON(map, \"crossSectionLine\", data);\n setGeoJSON(map, \"crossSectionEndpoints\", {\n type: \"FeatureCollection\",\n features: focusedLine.coordinates.map((coord) => ({\n type: \"Feature\",\n geometry: { type: \"Point\", coordinates: coord },\n properties: {},\n })),\n });\n },\n [focusedLine],\n );\n\n const bounds = useMemo(() => {\n // In line mode, frame the line; in manual mode, frame the selected columns\n const coords: number[][] =\n focusedLine != null && focusedLine.coordinates.length >= 2\n ? focusedLine.coordinates\n : focusedColumns.map((c) => c.properties.centroid.geometry.coordinates);\n if (coords.length < 2) return null;\n const bounds = new LngLatBounds();\n for (const coord of coords) {\n bounds.extend(coord as [number, number]);\n }\n return bounds;\n }, [focusedLine, focusedColumns]);\n\n useMapEaseTo({ bounds, padding, trackResize: true });\n\n return null;\n}\n\nconst emptyFeatureCollection: FeatureCollection = {\n type: \"FeatureCollection\",\n features: [],\n};\n"],"names":["bounds"],"mappings":";;;;;;;;;AAwBO,SAAS,qBAAqB,OAA4B;AAC/D,QAAM,EAAE,UAAU,IAAI,UAAU,aAAa,WAAW,GAAG,SAAS;AAEpE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,SAAS;AAAA,MACT,YAAY;AAAA,IAAA;AAAA,IAEd;AAAA,MACE,EAAE,cAAc,EAAE,OAAO,aAAa;AAAA,MACtC,EAAE,oBAAoB;AAAA,MACtB,EAAE,eAAe;AAAA,MACjB,EAAE,wBAAwB;AAAA,MAC1B,EAAE,sBAAsB;AAAA,MACxB,EAAE,cAAc,EAAE,SAAS;AAAA,MAC3B,EAAE,aAAa,EAAE,SAAS;AAAA,MAC1B;AAAA,IAAA;AAAA,EACF;AAEJ;AAEA,SAAS,aAAa,EAAE,WAAgC;AAEtD,QAAM,aAAa,uBAAuB,CAAC,UAAU,MAAM,UAAU;AACrE,QAAM,YAAY,uBAAuB,CAAC,UAAU,MAAM,SAAS;AACnE,QAAM,UAAU,uBAAuB,CAAC,UAAU,MAAM,OAAO;AAE/D,QAAM,SAAS,QAAQ,MAAM;AAC3B,QAAI,cA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