@macrostrat/column-views 3.8.0 → 3.10.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 (173) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/dist/animated-age-window.cjs +51 -0
  3. package/dist/animated-age-window.cjs.map +1 -0
  4. package/dist/animated-age-window.d.ts +51 -0
  5. package/dist/animated-age-window.js +51 -0
  6. package/dist/animated-age-window.js.map +1 -0
  7. package/dist/column.cjs +11 -1
  8. package/dist/column.cjs.map +1 -1
  9. package/dist/column.d.ts +11 -0
  10. package/dist/column.js +11 -1
  11. package/dist/column.js.map +1 -1
  12. package/dist/correlation-chart/main.cjs +24 -12
  13. package/dist/correlation-chart/main.cjs.map +1 -1
  14. package/dist/correlation-chart/main.d.ts +8 -1
  15. package/dist/correlation-chart/main.js +24 -12
  16. package/dist/correlation-chart/main.js.map +1 -1
  17. package/dist/data-provider/store.cjs +17 -4
  18. package/dist/data-provider/store.cjs.map +1 -1
  19. package/dist/data-provider/store.d.ts +6 -1
  20. package/dist/data-provider/store.js +17 -4
  21. package/dist/data-provider/store.js.map +1 -1
  22. package/dist/index.cjs +17 -42
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.ts +3 -1
  25. package/dist/index.js +3 -34
  26. package/dist/index.js.map +1 -1
  27. package/dist/prepare-units/composite-scale.cjs +94 -8
  28. package/dist/prepare-units/composite-scale.cjs.map +1 -1
  29. package/dist/prepare-units/composite-scale.d.ts +39 -0
  30. package/dist/prepare-units/composite-scale.js +96 -10
  31. package/dist/prepare-units/composite-scale.js.map +1 -1
  32. package/dist/prepare-units/helpers.cjs +0 -1
  33. package/dist/prepare-units/helpers.cjs.map +1 -1
  34. package/dist/prepare-units/helpers.js +0 -1
  35. package/dist/prepare-units/helpers.js.map +1 -1
  36. package/dist/prepare-units/index.cjs +33 -12
  37. package/dist/prepare-units/index.cjs.map +1 -1
  38. package/dist/prepare-units/index.js +34 -13
  39. package/dist/prepare-units/index.js.map +1 -1
  40. package/dist/prepare-units/types.cjs.map +1 -1
  41. package/dist/prepare-units/types.d.ts +13 -0
  42. package/dist/prepare-units/types.js.map +1 -1
  43. package/dist/section.cjs +4 -2
  44. package/dist/section.cjs.map +1 -1
  45. package/dist/section.d.ts +4 -1
  46. package/dist/section.js +4 -2
  47. package/dist/section.js.map +1 -1
  48. package/dist/units/boxes.cjs +22 -39
  49. package/dist/units/boxes.cjs.map +1 -1
  50. package/dist/units/boxes.js +24 -41
  51. package/dist/units/boxes.js.map +1 -1
  52. package/dist/units/composite.cjs +12 -12
  53. package/dist/units/composite.cjs.map +1 -1
  54. package/dist/units/composite.js +12 -12
  55. package/dist/units/composite.js.map +1 -1
  56. package/dist/units/index.cjs +7 -11
  57. package/dist/units/index.cjs.map +1 -1
  58. package/dist/units/index.d.ts +0 -1
  59. package/dist/units/index.js +4 -9
  60. package/dist/units/index.js.map +1 -1
  61. package/package.json +10 -31
  62. package/src/animated-age-window.ts +120 -0
  63. package/src/column.ts +24 -0
  64. package/src/correlation-chart/main.ts +30 -8
  65. package/src/data-provider/store.ts +21 -2
  66. package/src/index.ts +4 -1
  67. package/src/prepare-units/composite-scale.ts +210 -10
  68. package/src/prepare-units/helpers.ts +0 -2
  69. package/src/prepare-units/index.ts +68 -14
  70. package/src/prepare-units/types.ts +13 -0
  71. package/src/section.ts +6 -0
  72. package/src/units/boxes.ts +37 -56
  73. package/src/units/composite.ts +21 -12
  74. package/src/units/index.ts +9 -26
  75. package/dist/maps/column-correlation/core.cjs +0 -288
  76. package/dist/maps/column-correlation/core.cjs.map +0 -1
  77. package/dist/maps/column-correlation/core.d.ts +0 -9
  78. package/dist/maps/column-correlation/core.js +0 -286
  79. package/dist/maps/column-correlation/core.js.map +0 -1
  80. package/dist/maps/column-correlation/index.d.ts +0 -2
  81. package/dist/maps/column-correlation/state.cjs +0 -193
  82. package/dist/maps/column-correlation/state.cjs.map +0 -1
  83. package/dist/maps/column-correlation/state.d.ts +0 -62
  84. package/dist/maps/column-correlation/state.js +0 -190
  85. package/dist/maps/column-correlation/state.js.map +0 -1
  86. package/dist/maps/column-navigation/index.d.ts +0 -2
  87. package/dist/maps/column-navigation/mapbox/index.cjs +0 -215
  88. package/dist/maps/column-navigation/mapbox/index.cjs.map +0 -1
  89. package/dist/maps/column-navigation/mapbox/index.d.ts +0 -38
  90. package/dist/maps/column-navigation/mapbox/index.js +0 -213
  91. package/dist/maps/column-navigation/mapbox/index.js.map +0 -1
  92. package/dist/maps/column-navigation/mapbox/keyboard-navigation.cjs +0 -105
  93. package/dist/maps/column-navigation/mapbox/keyboard-navigation.cjs.map +0 -1
  94. package/dist/maps/column-navigation/mapbox/keyboard-navigation.d.ts +0 -8
  95. package/dist/maps/column-navigation/mapbox/keyboard-navigation.js +0 -105
  96. package/dist/maps/column-navigation/mapbox/keyboard-navigation.js.map +0 -1
  97. package/dist/maps/column-navigation/mapbox/state.cjs +0 -73
  98. package/dist/maps/column-navigation/mapbox/state.cjs.map +0 -1
  99. package/dist/maps/column-navigation/mapbox/state.d.ts +0 -23
  100. package/dist/maps/column-navigation/mapbox/state.js +0 -71
  101. package/dist/maps/column-navigation/mapbox/state.js.map +0 -1
  102. package/dist/maps/column-navigation/svg/animated.d.ts +0 -1
  103. package/dist/maps/column-navigation/svg/data-fetcher.cjs +0 -25
  104. package/dist/maps/column-navigation/svg/data-fetcher.cjs.map +0 -1
  105. package/dist/maps/column-navigation/svg/data-fetcher.d.ts +0 -6
  106. package/dist/maps/column-navigation/svg/data-fetcher.js +0 -25
  107. package/dist/maps/column-navigation/svg/data-fetcher.js.map +0 -1
  108. package/dist/maps/column-navigation/svg/index.cjs +0 -94
  109. package/dist/maps/column-navigation/svg/index.cjs.map +0 -1
  110. package/dist/maps/column-navigation/svg/index.d.ts +0 -9
  111. package/dist/maps/column-navigation/svg/index.js +0 -93
  112. package/dist/maps/column-navigation/svg/index.js.map +0 -1
  113. package/dist/maps/column-navigation/svg/layers.cjs +0 -177
  114. package/dist/maps/column-navigation/svg/layers.cjs.map +0 -1
  115. package/dist/maps/column-navigation/svg/layers.d.ts +0 -54
  116. package/dist/maps/column-navigation/svg/layers.js +0 -174
  117. package/dist/maps/column-navigation/svg/layers.js.map +0 -1
  118. package/dist/maps/column-navigation/utils/keyboard-navigation.cjs +0 -50
  119. package/dist/maps/column-navigation/utils/keyboard-navigation.cjs.map +0 -1
  120. package/dist/maps/column-navigation/utils/keyboard-navigation.d.ts +0 -10
  121. package/dist/maps/column-navigation/utils/keyboard-navigation.js +0 -50
  122. package/dist/maps/column-navigation/utils/keyboard-navigation.js.map +0 -1
  123. package/dist/maps/index.d.ts +0 -4
  124. package/dist/maps/inset-map/index.cjs +0 -71
  125. package/dist/maps/inset-map/index.cjs.map +0 -1
  126. package/dist/maps/inset-map/index.d.ts +0 -16
  127. package/dist/maps/inset-map/index.js +0 -69
  128. package/dist/maps/inset-map/index.js.map +0 -1
  129. package/dist/maps/layers/columns.cjs +0 -165
  130. package/dist/maps/layers/columns.cjs.map +0 -1
  131. package/dist/maps/layers/columns.d.ts +0 -28
  132. package/dist/maps/layers/columns.js +0 -165
  133. package/dist/maps/layers/columns.js.map +0 -1
  134. package/dist/maps/layers/index.d.ts +0 -2
  135. package/dist/maps/layers/units.cjs +0 -207
  136. package/dist/maps/layers/units.cjs.map +0 -1
  137. package/dist/maps/layers/units.d.ts +0 -14
  138. package/dist/maps/layers/units.js +0 -204
  139. package/dist/maps/layers/units.js.map +0 -1
  140. package/dist/units/colors.cjs +0 -115
  141. package/dist/units/colors.cjs.map +0 -1
  142. package/dist/units/colors.d.ts +0 -20
  143. package/dist/units/colors.js +0 -113
  144. package/dist/units/colors.js.map +0 -1
  145. package/dist/units/resolvers.cjs +0 -125
  146. package/dist/units/resolvers.cjs.map +0 -1
  147. package/dist/units/resolvers.d.ts +0 -8
  148. package/dist/units/resolvers.js +0 -125
  149. package/dist/units/resolvers.js.map +0 -1
  150. package/src/maps/column-correlation/column-correlation-map.stories.ts +0 -108
  151. package/src/maps/column-correlation/core.ts +0 -342
  152. package/src/maps/column-correlation/index.ts +0 -2
  153. package/src/maps/column-correlation/state.ts +0 -315
  154. package/src/maps/column-navigation/index.ts +0 -2
  155. package/src/maps/column-navigation/mapbox/column-navigation-map.stories.ts +0 -278
  156. package/src/maps/column-navigation/mapbox/index.ts +0 -276
  157. package/src/maps/column-navigation/mapbox/keyboard-navigation.ts +0 -133
  158. package/src/maps/column-navigation/mapbox/state.ts +0 -119
  159. package/src/maps/column-navigation/svg/animated.ts +0 -78
  160. package/src/maps/column-navigation/svg/column-navigation-svg-map.stories.ts +0 -46
  161. package/src/maps/column-navigation/svg/data-fetcher.ts +0 -34
  162. package/src/maps/column-navigation/svg/index.ts +0 -96
  163. package/src/maps/column-navigation/svg/layers.ts +0 -233
  164. package/src/maps/column-navigation/utils/keyboard-navigation.ts +0 -58
  165. package/src/maps/index.ts +0 -4
  166. package/src/maps/inset-map/index.ts +0 -87
  167. package/src/maps/inset-map/inset-map.stories.ts +0 -20
  168. package/src/maps/layers/columns.ts +0 -216
  169. package/src/maps/layers/index.ts +0 -2
  170. package/src/maps/layers/units.ts +0 -286
  171. package/src/maps/unit-map.stories.ts +0 -79
  172. package/src/units/colors.ts +0 -183
  173. package/src/units/resolvers.ts +0 -141
package/CHANGELOG.md CHANGED
@@ -1,5 +1,130 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.10.0] - 2026-09-01 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/column-views-v3.9.0...@macrostrat/column-views-v3.10.0)
4
+
5
+ ### Minor Changes
6
+
7
+ - Improve the internal structure of the correlation map store
8
+ [4738d3df](https://github.com/UW-Macrostrat/web-components/commit/4738d3df1bdec8f4b233af215cadc0422ed562e8)
9
+ - Created the @macrostrat/map-views module for specific map interactions and
10
+ [4738d3df](https://github.com/UW-Macrostrat/web-components/commit/4738d3df1bdec8f4b233af215cadc0422ed562e8)
11
+ high-level views around Macrostrat maps.
12
+
13
+ ### Patch Changes
14
+
15
+ - Improve the rendering of correlation chart units
16
+ [4738d3df](https://github.com/UW-Macrostrat/web-components/commit/4738d3df1bdec8f4b233af215cadc0422ed562e8)
17
+ - Updated dependencies
18
+ [4738d3df](https://github.com/UW-Macrostrat/web-components/commit/4738d3df1bdec8f4b233af215cadc0422ed562e8)
19
+ - Updated dependencies
20
+ [03860266](https://github.com/UW-Macrostrat/web-components/commit/038602669f6d71fed4b847cd55c9d7c32885c054)
21
+ - Updated dependencies
22
+ [4738d3df](https://github.com/UW-Macrostrat/web-components/commit/4738d3df1bdec8f4b233af215cadc0422ed562e8)
23
+ - @macrostrat/map-views@1.0.0
24
+ - @macrostrat/scoped-store@1.1.0
25
+ - @macrostrat/stratigraphy-utils@1.4.0
26
+ - @macrostrat/api-types@1.3.0
27
+
28
+ ## [3.9.0] - 2026-08-25 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/column-views-v3.8.0...@macrostrat/column-views-v3.9.0)
29
+
30
+ ### Minor Changes
31
+
32
+ - Add `useAnimatedAgeWindow`: animates a column/correlation-chart's rendered
33
+ `t_age`/`b_age` for smooth pan-and-contract navigation at constant
34
+ `pixelScale` (density), driving the existing clipping + zig-zag unit edges. It
35
+ runs on the shared `useAnimatedDomain` core from `@macrostrat/timescale`.
36
+ Threads `isTransitioning` / `hideLabelsWhileTransitioning` flags through
37
+ `Column`/`CorrelationChart` → `ColumnProvider`; labels stay visible through
38
+ the animation by default, with an opt-in toggle to hide them. New stories for
39
+ the correlation chart and a single stratigraphic column, each with a
40
+ fixed-`pixelScale` variant and a label-hiding toggle.
41
+ [0247a5a2](https://github.com/UW-Macrostrat/web-components/commit/0247a5a2e12062fdb5e586b4b5dca9c3c6490127)
42
+
43
+ Add `windowPadding` (px): how much of the sections abutting the rendered
44
+ `t_age`/`b_age` window to reveal, so neighboring stratigraphy — and its
45
+ timescale intervals — stay visible and navigable when zoomed in. Available on
46
+ `Column` and `CorrelationChart`.
47
+
48
+ Unit density is now derived from the units the rendered window actually shows,
49
+ measured by their visible duration — so `targetUnitHeight` describes the units
50
+ on screen at any zoom depth, rather than the containing section's overall
51
+ average. A section the window doesn't reach falls back to its own units at
52
+ full duration and is drawn at its own scale. This removes the need for any
53
+ zoom-factor input: clipping shortens visible durations, which raises density,
54
+ so a column renders identically whether a window was animated to or set
55
+ directly.
56
+
57
+ Age columns now lay every section out at its **full extent** and apply the
58
+ rendered window as the last step, rather than clipping units and section
59
+ bounds up front. A section abutting the window therefore keeps its own density
60
+ and `minSectionHeight`, and is then trimmed to exactly the requested sliver —
61
+ previously such a fragment had its density re-derived from the few units that
62
+ survived the clip and was re-inflated to the floor, with its scale stretched
63
+ to match. Sections clipped by the window itself still honor
64
+ `minSectionHeight`, expanding their scale rather than rendering a sliver; only
65
+ the padding margin past the window renders at exactly its requested pixels.
66
+ Those final densities are resolved before the padding budget is spent, so a
67
+ margin measures the pixels requested rather than those pixels times whatever
68
+ stretch its neighbor needed — otherwise a short interval (a Holocene beside a
69
+ Pleistocene) is swallowed by its own margin. This also makes `windowPadding`
70
+ exact (it is spent against real section pixel heights; unconformity gaps
71
+ aren't charged, so padding smaller than `unconformityHeight` can still reach
72
+ across one) and stops unconformity-collapse decisions from shifting as the
73
+ window moves. Hybrid and externally-supplied scales keep the previous
74
+ clip-then-lay-out path.
75
+
76
+ Stabilize composite-scale package keys (positional index instead of
77
+ `package-${b_age}-${t_age}`) so the correlation chart's packages, columns, and
78
+ timescale reconcile instead of remounting on every animation frame. Unit
79
+ labels re-fit when a transition settles (via `SizeAwareLabel`'s
80
+ `remeasureKey`), not on intermediate frames.
81
+
82
+ `Column` now forwards `onClickTimescaleInterval` and `timescaleIntervalStyle`
83
+ to its composite timescale (via `CompositeTimescale`'s new
84
+ `onClickInterval`/`intervalStyle` props), so a standalone column supports
85
+ click-to-zoom interval navigation and per-interval styling (e.g. bolding the
86
+ selected interval).
87
+
88
+ Add an interval-zoom story (grouped with the other animation stories under
89
+ `Column views/Column animations`): clicking a timescale interval animates the
90
+ window to it, a preceding/postdating interval moves along the timescale, and
91
+ clicking the selected interval zooms out a level. The timescale shows a fixed
92
+ 3-level window that slides with the selected interval's rank (always one
93
+ coarser level to navigate up, one finer to drill down), independent of the
94
+ layout. `targetUnitHeight`, `minSectionHeight` and `windowPadding` are plain
95
+ display controls — there is no zoom-level input.
96
+
97
+ ### Patch Changes
98
+
99
+ - Fix two zoom-sync issues exposed by animated age-window zoom:
100
+ [0247a5a2](https://github.com/UW-Macrostrat/web-components/commit/0247a5a2e12062fdb5e586b4b5dca9c3c6490127)
101
+
102
+ - Age-axis (`AgeAxis`) now redraws when the scale's domain/range changes (not
103
+ just its object identity), and builds a fresh d3 axis generator each render.
104
+ Reusing the generator retained stale `.tickValues()` config, so a section
105
+ that was short (explicit first/last ticks) and later stretched kept those
106
+ out-of-domain tick values — leaving some axes with no labels. Both surfaced
107
+ once stable React keys stopped the axis remounting per frame.
108
+ - The inline-label/note tracker (`LabelTrackerProvider`) re-syncs to the
109
+ _current_ visible unit set on zoom. Its stale gate froze the "unlabeled" set
110
+ once the unit set changed, so a unit whose label now fit inline also kept
111
+ rendering as a note; it now recomputes over current units.
112
+
113
+ - Updated dependencies
114
+ [0247a5a2](https://github.com/UW-Macrostrat/web-components/commit/0247a5a2e12062fdb5e586b4b5dca9c3c6490127)
115
+ - Updated dependencies
116
+ [0247a5a2](https://github.com/UW-Macrostrat/web-components/commit/0247a5a2e12062fdb5e586b4b5dca9c3c6490127)
117
+ - Updated dependencies
118
+ [0247a5a2](https://github.com/UW-Macrostrat/web-components/commit/0247a5a2e12062fdb5e586b4b5dca9c3c6490127)
119
+ - Updated dependencies
120
+ [0247a5a2](https://github.com/UW-Macrostrat/web-components/commit/0247a5a2e12062fdb5e586b4b5dca9c3c6490127)
121
+ - Updated dependencies
122
+ [0247a5a2](https://github.com/UW-Macrostrat/web-components/commit/0247a5a2e12062fdb5e586b4b5dca9c3c6490127)
123
+ - @macrostrat/timescale@3.2.0
124
+ - @macrostrat/column-components@2.1.0
125
+ - @macrostrat/ui-components@5.2.0
126
+ - @macrostrat/map-styles@2.2.7
127
+
3
128
  ## [3.8.0] - 2026-08-02 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/column-views-v3.7.0...@macrostrat/column-views-v3.8.0)
4
129
 
5
130
  ### Minor Changes
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const timescale = require("@macrostrat/timescale");
5
+ function useAnimatedAgeWindow(options) {
6
+ const { fullExtent, duration } = options;
7
+ const extent = React.useMemo(() => toDomain(fullExtent), [
8
+ fullExtent?.t_age,
9
+ fullExtent?.b_age
10
+ ]);
11
+ const anim = timescale.useAnimatedDomain({ extent, duration });
12
+ const zoomToWindow = React.useCallback(
13
+ (target, opts = {}) => {
14
+ anim.animateTo([target.b_age, target.t_age], {
15
+ duration: opts.duration
16
+ });
17
+ },
18
+ [anim.animateTo]
19
+ );
20
+ const zoomToInterval = React.useCallback(
21
+ (interval, opts = {}) => {
22
+ zoomToWindow({ t_age: interval.lag, b_age: interval.eag }, opts);
23
+ },
24
+ [zoomToWindow]
25
+ );
26
+ const reset = React.useCallback(
27
+ (opts = {}) => {
28
+ if (fullExtent == null) return;
29
+ zoomToWindow(fullExtent, opts);
30
+ },
31
+ [zoomToWindow, fullExtent?.t_age, fullExtent?.b_age]
32
+ );
33
+ return {
34
+ window: toWindow(anim.domain),
35
+ isAnimating: anim.isAnimating,
36
+ isFullExtent: anim.isFullExtent,
37
+ zoomToWindow,
38
+ zoomToInterval,
39
+ reset
40
+ };
41
+ }
42
+ function toDomain(w) {
43
+ if (w == null) return null;
44
+ return [w.b_age, w.t_age];
45
+ }
46
+ function toWindow(d) {
47
+ if (d == null) return null;
48
+ return { t_age: d[1], b_age: d[0] };
49
+ }
50
+ exports.useAnimatedAgeWindow = useAnimatedAgeWindow;
51
+ //# sourceMappingURL=animated-age-window.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-age-window.cjs","sources":["../src/animated-age-window.ts"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport { AgeDomain, useAnimatedDomain } from \"@macrostrat/timescale\";\n\n/** A rendered age window, ordered as the column props expect:\n * `t_age` is the younger (top) bound, `b_age` the older (bottom) bound. */\nexport interface AgeWindow {\n t_age: number;\n b_age: number;\n}\n\nexport interface AnimateWindowOptions {\n duration?: number;\n}\n\nexport interface UseAnimatedAgeWindowOptions {\n /** The full data extent — the window to reset to, and the initial window.\n * `null` until the data (and hence extent) is known. */\n fullExtent: AgeWindow | null;\n /** Animation duration in ms (default 750). */\n duration?: number;\n}\n\nexport interface AnimatedAgeWindow {\n /** The current animated window to feed to `t_age`/`b_age` column props\n * (`null` until `fullExtent` is known). */\n window: AgeWindow | null;\n isAnimating: boolean;\n /** True when the window is (approximately) the full extent. */\n isFullExtent: boolean;\n /** Pan-and-contract to an explicit window (clamped to the full extent).\n * Density (`pixelScale`) is left untouched — this is not a zoom. */\n zoomToWindow(target: AgeWindow, opts?: AnimateWindowOptions): void;\n /** Pan-and-contract to a timescale interval, using `eag`/`lag`. */\n zoomToInterval(\n interval: { eag: number; lag: number },\n opts?: AnimateWindowOptions,\n ): void;\n /** Ease back to the full extent. */\n reset(opts?: AnimateWindowOptions): void;\n}\n\n/**\n * Animate the rendered age window (`t_age`/`b_age`) of a column or correlation\n * chart. This is the \"animate the current zoom approach\" model: narrowing the\n * window re-lays-out the column with explicit clipping — units past the bounds\n * get a zig-zag edge, unconformities keep their fixed `unconformityHeight`, and\n * `pixelScale` (density) is untouched, so a sub-interval click **pans and\n * contracts** at constant density rather than zooming. Joint domain/range\n * change (true zoom) stays under the user's direct control via `pixelScale`.\n *\n * The animation itself is `useAnimatedDomain` from `@macrostrat/timescale` —\n * the same state machine that drives the timescale's `useZoomableScale`. This\n * hook only maps an `[older, younger]` domain onto `{ b_age, t_age }`; it\n * animates the window you ask for and nothing more. Revealing a margin of the\n * neighboring column is the *layout's* job, via the `windowPadding` prop (px),\n * which is resolved against real section heights rather than predicted here.\n */\nexport function useAnimatedAgeWindow(\n options: UseAnimatedAgeWindowOptions,\n): AnimatedAgeWindow {\n const { fullExtent, duration } = options;\n\n const extent = useMemo(() => toDomain(fullExtent), [\n fullExtent?.t_age,\n fullExtent?.b_age,\n ]);\n\n const anim = useAnimatedDomain({ extent, duration });\n\n const zoomToWindow = useCallback(\n (target: AgeWindow, opts: AnimateWindowOptions = {}) => {\n anim.animateTo([target.b_age, target.t_age], {\n duration: opts.duration,\n });\n },\n [anim.animateTo],\n );\n\n const zoomToInterval = useCallback(\n (\n interval: { eag: number; lag: number },\n opts: AnimateWindowOptions = {},\n ) => {\n zoomToWindow({ t_age: interval.lag, b_age: interval.eag }, opts);\n },\n [zoomToWindow],\n );\n\n const reset = useCallback(\n (opts: AnimateWindowOptions = {}) => {\n if (fullExtent == null) return;\n zoomToWindow(fullExtent, opts);\n },\n [zoomToWindow, fullExtent?.t_age, fullExtent?.b_age],\n );\n\n return {\n window: toWindow(anim.domain),\n isAnimating: anim.isAnimating,\n isFullExtent: anim.isFullExtent,\n zoomToWindow,\n zoomToInterval,\n reset,\n };\n}\n\n/** `{t_age, b_age}` ↔ the core's `[older, younger]` domain. */\nfunction toDomain(w: AgeWindow): AgeDomain;\nfunction toDomain(w: AgeWindow | null): AgeDomain | null;\nfunction toDomain(w: AgeWindow | null): AgeDomain | null {\n if (w == null) return null;\n return [w.b_age, w.t_age];\n}\n\nfunction toWindow(d: AgeDomain): AgeWindow;\nfunction toWindow(d: AgeDomain | null): AgeWindow | null;\nfunction toWindow(d: AgeDomain | null): AgeWindow | null {\n if (d == null) return null;\n return { t_age: d[1], b_age: d[0] };\n}\n"],"names":["useMemo","useAnimatedDomain","useCallback"],"mappings":";;;;AAyDO,SAAS,qBACd,SACmB;AACnB,QAAM,EAAE,YAAY,SAAA,IAAa;AAEjC,QAAM,SAASA,MAAAA,QAAQ,MAAM,SAAS,UAAU,GAAG;AAAA,IACjD,YAAY;AAAA,IACZ,YAAY;AAAA,EAAA,CACb;AAED,QAAM,OAAOC,UAAAA,kBAAkB,EAAE,QAAQ,UAAU;AAEnD,QAAM,eAAeC,MAAAA;AAAAA,IACnB,CAAC,QAAmB,OAA6B,OAAO;AACtD,WAAK,UAAU,CAAC,OAAO,OAAO,OAAO,KAAK,GAAG;AAAA,QAC3C,UAAU,KAAK;AAAA,MAAA,CAChB;AAAA,IACH;AAAA,IACA,CAAC,KAAK,SAAS;AAAA,EAAA;AAGjB,QAAM,iBAAiBA,MAAAA;AAAAA,IACrB,CACE,UACA,OAA6B,OAC1B;AACH,mBAAa,EAAE,OAAO,SAAS,KAAK,OAAO,SAAS,IAAA,GAAO,IAAI;AAAA,IACjE;AAAA,IACA,CAAC,YAAY;AAAA,EAAA;AAGf,QAAM,QAAQA,MAAAA;AAAAA,IACZ,CAAC,OAA6B,CAAA,MAAO;AACnC,UAAI,cAAc,KAAM;AACxB,mBAAa,YAAY,IAAI;AAAA,IAC/B;AAAA,IACA,CAAC,cAAc,YAAY,OAAO,YAAY,KAAK;AAAA,EAAA;AAGrD,SAAO;AAAA,IACL,QAAQ,SAAS,KAAK,MAAM;AAAA,IAC5B,aAAa,KAAK;AAAA,IAClB,cAAc,KAAK;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;AAKA,SAAS,SAAS,GAAuC;AACvD,MAAI,KAAK,KAAM,QAAO;AACtB,SAAO,CAAC,EAAE,OAAO,EAAE,KAAK;AAC1B;AAIA,SAAS,SAAS,GAAuC;AACvD,MAAI,KAAK,KAAM,QAAO;AACtB,SAAO,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAA;AAClC;;"}
@@ -0,0 +1,51 @@
1
+ /** A rendered age window, ordered as the column props expect:
2
+ * `t_age` is the younger (top) bound, `b_age` the older (bottom) bound. */
3
+ export interface AgeWindow {
4
+ t_age: number;
5
+ b_age: number;
6
+ }
7
+ export interface AnimateWindowOptions {
8
+ duration?: number;
9
+ }
10
+ export interface UseAnimatedAgeWindowOptions {
11
+ /** The full data extent — the window to reset to, and the initial window.
12
+ * `null` until the data (and hence extent) is known. */
13
+ fullExtent: AgeWindow | null;
14
+ /** Animation duration in ms (default 750). */
15
+ duration?: number;
16
+ }
17
+ export interface AnimatedAgeWindow {
18
+ /** The current animated window to feed to `t_age`/`b_age` column props
19
+ * (`null` until `fullExtent` is known). */
20
+ window: AgeWindow | null;
21
+ isAnimating: boolean;
22
+ /** True when the window is (approximately) the full extent. */
23
+ isFullExtent: boolean;
24
+ /** Pan-and-contract to an explicit window (clamped to the full extent).
25
+ * Density (`pixelScale`) is left untouched — this is not a zoom. */
26
+ zoomToWindow(target: AgeWindow, opts?: AnimateWindowOptions): void;
27
+ /** Pan-and-contract to a timescale interval, using `eag`/`lag`. */
28
+ zoomToInterval(interval: {
29
+ eag: number;
30
+ lag: number;
31
+ }, opts?: AnimateWindowOptions): void;
32
+ /** Ease back to the full extent. */
33
+ reset(opts?: AnimateWindowOptions): void;
34
+ }
35
+ /**
36
+ * Animate the rendered age window (`t_age`/`b_age`) of a column or correlation
37
+ * chart. This is the "animate the current zoom approach" model: narrowing the
38
+ * window re-lays-out the column with explicit clipping — units past the bounds
39
+ * get a zig-zag edge, unconformities keep their fixed `unconformityHeight`, and
40
+ * `pixelScale` (density) is untouched, so a sub-interval click **pans and
41
+ * contracts** at constant density rather than zooming. Joint domain/range
42
+ * change (true zoom) stays under the user's direct control via `pixelScale`.
43
+ *
44
+ * The animation itself is `useAnimatedDomain` from `@macrostrat/timescale` —
45
+ * the same state machine that drives the timescale's `useZoomableScale`. This
46
+ * hook only maps an `[older, younger]` domain onto `{ b_age, t_age }`; it
47
+ * animates the window you ask for and nothing more. Revealing a margin of the
48
+ * neighboring column is the *layout's* job, via the `windowPadding` prop (px),
49
+ * which is resolved against real section heights rather than predicted here.
50
+ */
51
+ export declare function useAnimatedAgeWindow(options: UseAnimatedAgeWindowOptions): AnimatedAgeWindow;
@@ -0,0 +1,51 @@
1
+ import { useMemo, useCallback } from "react";
2
+ import { useAnimatedDomain } from "@macrostrat/timescale";
3
+ function useAnimatedAgeWindow(options) {
4
+ const { fullExtent, duration } = options;
5
+ const extent = useMemo(() => toDomain(fullExtent), [
6
+ fullExtent?.t_age,
7
+ fullExtent?.b_age
8
+ ]);
9
+ const anim = useAnimatedDomain({ extent, duration });
10
+ const zoomToWindow = useCallback(
11
+ (target, opts = {}) => {
12
+ anim.animateTo([target.b_age, target.t_age], {
13
+ duration: opts.duration
14
+ });
15
+ },
16
+ [anim.animateTo]
17
+ );
18
+ const zoomToInterval = useCallback(
19
+ (interval, opts = {}) => {
20
+ zoomToWindow({ t_age: interval.lag, b_age: interval.eag }, opts);
21
+ },
22
+ [zoomToWindow]
23
+ );
24
+ const reset = useCallback(
25
+ (opts = {}) => {
26
+ if (fullExtent == null) return;
27
+ zoomToWindow(fullExtent, opts);
28
+ },
29
+ [zoomToWindow, fullExtent?.t_age, fullExtent?.b_age]
30
+ );
31
+ return {
32
+ window: toWindow(anim.domain),
33
+ isAnimating: anim.isAnimating,
34
+ isFullExtent: anim.isFullExtent,
35
+ zoomToWindow,
36
+ zoomToInterval,
37
+ reset
38
+ };
39
+ }
40
+ function toDomain(w) {
41
+ if (w == null) return null;
42
+ return [w.b_age, w.t_age];
43
+ }
44
+ function toWindow(d) {
45
+ if (d == null) return null;
46
+ return { t_age: d[1], b_age: d[0] };
47
+ }
48
+ export {
49
+ useAnimatedAgeWindow
50
+ };
51
+ //# sourceMappingURL=animated-age-window.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animated-age-window.js","sources":["../src/animated-age-window.ts"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport { AgeDomain, useAnimatedDomain } from \"@macrostrat/timescale\";\n\n/** A rendered age window, ordered as the column props expect:\n * `t_age` is the younger (top) bound, `b_age` the older (bottom) bound. */\nexport interface AgeWindow {\n t_age: number;\n b_age: number;\n}\n\nexport interface AnimateWindowOptions {\n duration?: number;\n}\n\nexport interface UseAnimatedAgeWindowOptions {\n /** The full data extent — the window to reset to, and the initial window.\n * `null` until the data (and hence extent) is known. */\n fullExtent: AgeWindow | null;\n /** Animation duration in ms (default 750). */\n duration?: number;\n}\n\nexport interface AnimatedAgeWindow {\n /** The current animated window to feed to `t_age`/`b_age` column props\n * (`null` until `fullExtent` is known). */\n window: AgeWindow | null;\n isAnimating: boolean;\n /** True when the window is (approximately) the full extent. */\n isFullExtent: boolean;\n /** Pan-and-contract to an explicit window (clamped to the full extent).\n * Density (`pixelScale`) is left untouched — this is not a zoom. */\n zoomToWindow(target: AgeWindow, opts?: AnimateWindowOptions): void;\n /** Pan-and-contract to a timescale interval, using `eag`/`lag`. */\n zoomToInterval(\n interval: { eag: number; lag: number },\n opts?: AnimateWindowOptions,\n ): void;\n /** Ease back to the full extent. */\n reset(opts?: AnimateWindowOptions): void;\n}\n\n/**\n * Animate the rendered age window (`t_age`/`b_age`) of a column or correlation\n * chart. This is the \"animate the current zoom approach\" model: narrowing the\n * window re-lays-out the column with explicit clipping — units past the bounds\n * get a zig-zag edge, unconformities keep their fixed `unconformityHeight`, and\n * `pixelScale` (density) is untouched, so a sub-interval click **pans and\n * contracts** at constant density rather than zooming. Joint domain/range\n * change (true zoom) stays under the user's direct control via `pixelScale`.\n *\n * The animation itself is `useAnimatedDomain` from `@macrostrat/timescale` —\n * the same state machine that drives the timescale's `useZoomableScale`. This\n * hook only maps an `[older, younger]` domain onto `{ b_age, t_age }`; it\n * animates the window you ask for and nothing more. Revealing a margin of the\n * neighboring column is the *layout's* job, via the `windowPadding` prop (px),\n * which is resolved against real section heights rather than predicted here.\n */\nexport function useAnimatedAgeWindow(\n options: UseAnimatedAgeWindowOptions,\n): AnimatedAgeWindow {\n const { fullExtent, duration } = options;\n\n const extent = useMemo(() => toDomain(fullExtent), [\n fullExtent?.t_age,\n fullExtent?.b_age,\n ]);\n\n const anim = useAnimatedDomain({ extent, duration });\n\n const zoomToWindow = useCallback(\n (target: AgeWindow, opts: AnimateWindowOptions = {}) => {\n anim.animateTo([target.b_age, target.t_age], {\n duration: opts.duration,\n });\n },\n [anim.animateTo],\n );\n\n const zoomToInterval = useCallback(\n (\n interval: { eag: number; lag: number },\n opts: AnimateWindowOptions = {},\n ) => {\n zoomToWindow({ t_age: interval.lag, b_age: interval.eag }, opts);\n },\n [zoomToWindow],\n );\n\n const reset = useCallback(\n (opts: AnimateWindowOptions = {}) => {\n if (fullExtent == null) return;\n zoomToWindow(fullExtent, opts);\n },\n [zoomToWindow, fullExtent?.t_age, fullExtent?.b_age],\n );\n\n return {\n window: toWindow(anim.domain),\n isAnimating: anim.isAnimating,\n isFullExtent: anim.isFullExtent,\n zoomToWindow,\n zoomToInterval,\n reset,\n };\n}\n\n/** `{t_age, b_age}` ↔ the core's `[older, younger]` domain. */\nfunction toDomain(w: AgeWindow): AgeDomain;\nfunction toDomain(w: AgeWindow | null): AgeDomain | null;\nfunction toDomain(w: AgeWindow | null): AgeDomain | null {\n if (w == null) return null;\n return [w.b_age, w.t_age];\n}\n\nfunction toWindow(d: AgeDomain): AgeWindow;\nfunction toWindow(d: AgeDomain | null): AgeWindow | null;\nfunction toWindow(d: AgeDomain | null): AgeWindow | null {\n if (d == null) return null;\n return { t_age: d[1], b_age: d[0] };\n}\n"],"names":[],"mappings":";;AAyDO,SAAS,qBACd,SACmB;AACnB,QAAM,EAAE,YAAY,SAAA,IAAa;AAEjC,QAAM,SAAS,QAAQ,MAAM,SAAS,UAAU,GAAG;AAAA,IACjD,YAAY;AAAA,IACZ,YAAY;AAAA,EAAA,CACb;AAED,QAAM,OAAO,kBAAkB,EAAE,QAAQ,UAAU;AAEnD,QAAM,eAAe;AAAA,IACnB,CAAC,QAAmB,OAA6B,OAAO;AACtD,WAAK,UAAU,CAAC,OAAO,OAAO,OAAO,KAAK,GAAG;AAAA,QAC3C,UAAU,KAAK;AAAA,MAAA,CAChB;AAAA,IACH;AAAA,IACA,CAAC,KAAK,SAAS;AAAA,EAAA;AAGjB,QAAM,iBAAiB;AAAA,IACrB,CACE,UACA,OAA6B,OAC1B;AACH,mBAAa,EAAE,OAAO,SAAS,KAAK,OAAO,SAAS,IAAA,GAAO,IAAI;AAAA,IACjE;AAAA,IACA,CAAC,YAAY;AAAA,EAAA;AAGf,QAAM,QAAQ;AAAA,IACZ,CAAC,OAA6B,CAAA,MAAO;AACnC,UAAI,cAAc,KAAM;AACxB,mBAAa,YAAY,IAAI;AAAA,IAC/B;AAAA,IACA,CAAC,cAAc,YAAY,OAAO,YAAY,KAAK;AAAA,EAAA;AAGrD,SAAO;AAAA,IACL,QAAQ,SAAS,KAAK,MAAM;AAAA,IAC5B,aAAa,KAAK;AAAA,IAClB,cAAc,KAAK;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;AAKA,SAAS,SAAS,GAAuC;AACvD,MAAI,KAAK,KAAM,QAAO;AACtB,SAAO,CAAC,EAAE,OAAO,EAAE,KAAK;AAC1B;AAIA,SAAS,SAAS,GAAuC;AACvD,MAAI,KAAK,KAAM,QAAO;AACtB,SAAO,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAA;AAClC;"}
package/dist/column.cjs CHANGED
@@ -36,11 +36,14 @@ function Column(props) {
36
36
  pixelScale,
37
37
  minPixelScale = 0.2,
38
38
  minSectionHeight = 50,
39
+ windowPadding = 0,
39
40
  collapseSmallUnconformities = true,
40
41
  allowUnitSelection = false,
41
42
  hybridScale,
42
43
  scale,
43
44
  axisType,
45
+ isTransitioning,
46
+ hideLabelsWhileTransitioning,
44
47
  ref,
45
48
  ...rest
46
49
  } = props;
@@ -70,6 +73,7 @@ function Column(props) {
70
73
  pixelScale,
71
74
  minPixelScale: _minPixelScale,
72
75
  minSectionHeight: _minSectionHeight,
76
+ windowPadding,
73
77
  collapseSmallUnconformities,
74
78
  // TODO: consider unifying scale and hybridScale options
75
79
  scale,
@@ -95,6 +99,8 @@ function Column(props) {
95
99
  allowUnitSelection: showUnitPopover || allowUnitSelection,
96
100
  onUnitSelected,
97
101
  selectedUnit,
102
+ isTransitioning,
103
+ hideLabelsWhileTransitioning,
98
104
  ref
99
105
  },
100
106
  column_module.default(ColumnInner, { ageAxisComponent, ...rest }, [
@@ -126,6 +132,8 @@ function ColumnInner(props) {
126
132
  timescaleLevels,
127
133
  maxInternalColumns,
128
134
  onMouseOver,
135
+ onClickTimescaleInterval,
136
+ timescaleIntervalStyle,
129
137
  ageAxisComponent = ageAxis.CompositeAgeAxis
130
138
  } = props;
131
139
  const { axisType } = store.useMacrostratColumnData();
@@ -162,7 +170,9 @@ function ColumnInner(props) {
162
170
  column_module.default(ageAxisComponent),
163
171
  column_module.default.if(_showTimescale)(section.CompositeTimescale, {
164
172
  levels: timescaleLevels,
165
- unconformityLabels: _timescaleUnconformityLabels
173
+ unconformityLabels: _timescaleUnconformityLabels,
174
+ onClickInterval: onClickTimescaleInterval,
175
+ intervalStyle: timescaleIntervalStyle
166
176
  }),
167
177
  column_module.default(section.SectionsColumn, {
168
178
  unitComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"column.cjs","sources":["../src/column.ts"],"sourcesContent":["import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n RefObject,\n} from \"react\";\nimport h from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n ColumnRef,\n UnitKeyboardNavigation,\n useColumnRef,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\ninterface BaseColumnProps extends Omit<\n SectionSharedProps,\n \"unconformityLabels\"\n> {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n ref?: RefObject<ColumnRef>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n collapseSmallUnconformities = true,\n allowUnitSelection = false,\n hybridScale,\n scale,\n axisType,\n ref,\n ...rest\n } = props;\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight: number | null = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n {\n units,\n sections,\n totalHeight,\n axisType: _axisType,\n allowUnitSelection: showUnitPopover || allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n ref,\n },\n h(ColumnInner, { ageAxisComponent, ...rest }, [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ]),\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n const columnRef = useColumnRef();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":["ColumnAxisType","CompositeAgeAxis","HybridScaleType","ApproximateHeightAxis","usePreparedColumnUnits","h","NonIdealState","MacrostratColumnDataProvider","UnitSelectionPopover","UnitKeyboardNavigation","extractPadding","UnitComponent","useMacrostratColumnData","useColumnRef","CompositeTimescale","SectionsColumn","useUnitSelectionDispatch","useCallback","useCompositeScale","useDarkMode","Box","classNames","Identifier","DataField","ReferencesField"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4FO,SAAS,OAAO,OAAoB;AACzC,QAAM;AAAA,IACJ,kBAAkB;AAAA,IAClB,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,IACnB;AAAA,IACA,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,8BAA8B;AAAA,IAC9B,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAIJ,MAAI,oBAAmC;AACvC,MAAI,oBAAoB;AACxB,MAAI,iBAAiB;AACrB,MAAI,cAAc,MAAM;AACtB,wBAAoB;AACpB,wBAAoB;AACpB,qBAAiB;AAAA,EACnB;AAGA,MAAI,YAAY,YAAYA,iBAAAA,eAAe;AAC3C,MAAI,mBAAmBC,QAAAA;AACvB,MACE,aAAa,SAASC,MAAAA,gBAAgB,qBACtC,aAAaF,iBAAAA,eAAe,KAC5B;AAEA,uBAAmBG,QAAAA;AACnB,gBAAYH,iBAAAA,eAAe;AAAA,EAC7B;AAEA,QAAM,EAAE,UAAU,OAAO,YAAA,IAAgBI,MAAAA,uBAAuB,UAAU;AAAA,IACxE,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,EAAA,CACD;AAED,MAAI,SAAS,WAAW,GAAG;AACzB,WAAOC,cAAAA;AAAAA,MACL;AAAA,MACAA,cAAAA,QAAEC,KAAAA,eAAe;AAAA,QACf,OAAO;AAAA,QACP,aAA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H;;;;"}
1
+ {"version":3,"file":"column.cjs","sources":["../src/column.ts"],"sourcesContent":["import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n RefObject,\n} from \"react\";\nimport h from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n ColumnRef,\n UnitKeyboardNavigation,\n useColumnRef,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport type {\n TimescaleClickHandler,\n IntervalStyleBuilder,\n} from \"@macrostrat/timescale\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\ninterface BaseColumnProps extends Omit<\n SectionSharedProps,\n \"unconformityLabels\"\n> {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n /** Called when a timescale interval is clicked (e.g. to zoom the age range). */\n onClickTimescaleInterval?: TimescaleClickHandler;\n /** Per-interval style for the timescale (e.g. to bold the selected interval). */\n timescaleIntervalStyle?: IntervalStyleBuilder;\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n /** True while the age window is animating (e.g. from `useAnimatedAgeWindow`),\n * so per-frame label/pattern recalculation can be skipped. */\n isTransitioning?: boolean;\n /** Hide unit labels while transitioning (perf escape hatch; default false —\n * labels stay visible through the animation). */\n hideLabelsWhileTransitioning?: boolean;\n ref?: RefObject<ColumnRef>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n windowPadding = 0,\n collapseSmallUnconformities = true,\n allowUnitSelection = false,\n hybridScale,\n scale,\n axisType,\n isTransitioning,\n hideLabelsWhileTransitioning,\n ref,\n ...rest\n } = props;\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight: number | null = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n windowPadding,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n {\n units,\n sections,\n totalHeight,\n axisType: _axisType,\n allowUnitSelection: showUnitPopover || allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n isTransitioning,\n hideLabelsWhileTransitioning,\n ref,\n },\n h(ColumnInner, { ageAxisComponent, ...rest }, [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ]),\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n onClickTimescaleInterval,\n timescaleIntervalStyle,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n const columnRef = useColumnRef();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n onClickInterval: onClickTimescaleInterval,\n intervalStyle: timescaleIntervalStyle,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":["ColumnAxisType","CompositeAgeAxis","HybridScaleType","ApproximateHeightAxis","usePreparedColumnUnits","h","NonIdealState","MacrostratColumnDataProvider","UnitSelectionPopover","UnitKeyboardNavigation","extractPadding","UnitComponent","useMacrostratColumnData","useColumnRef","CompositeTimescale","SectionsColumn","useUnitSelectionDispatch","useCallback","useCompositeScale","useDarkMode","Box","classNames","Identifier","DataField","ReferencesField"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0GO,SAAS,OAAO,OAAoB;AACzC,QAAM;AAAA,IACJ,kBAAkB;AAAA,IA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/dist/column.d.ts CHANGED
@@ -4,6 +4,7 @@ import { ColumnRef } from './data-provider';
4
4
  import { SectionSharedProps } from './section';
5
5
  import { MergeSectionsMode, ColumnHeightScaleOptions } from './prepare-units';
6
6
  import { UnitLong } from '@macrostrat/api-types';
7
+ import { TimescaleClickHandler, IntervalStyleBuilder } from '@macrostrat/timescale';
7
8
  import { ScaleContinuousNumeric } from 'd3-scale';
8
9
  interface BaseColumnProps extends Omit<SectionSharedProps, "unconformityLabels"> {
9
10
  className?: string;
@@ -13,6 +14,10 @@ interface BaseColumnProps extends Omit<SectionSharedProps, "unconformityLabels">
13
14
  maxInternalColumns?: number;
14
15
  showTimescale?: boolean;
15
16
  timescaleLevels?: number | [number, number];
17
+ /** Called when a timescale interval is clicked (e.g. to zoom the age range). */
18
+ onClickTimescaleInterval?: TimescaleClickHandler;
19
+ /** Per-interval style for the timescale (e.g. to bold the selected interval). */
20
+ timescaleIntervalStyle?: IntervalStyleBuilder;
16
21
  unconformityLabels?: boolean | UnconformityLabelPlacement;
17
22
  onMouseOver?: (unit: UnitLong | null, height: number | null, evt: MouseEvent) => void;
18
23
  }
@@ -30,6 +35,12 @@ export interface ColumnProps extends Padding, BaseColumnProps, ColumnHeightScale
30
35
  onUnitSelected?: (unitID: number | null, unit: any) => void;
31
36
  unconformityHeight?: number;
32
37
  scale?: ScaleContinuousNumeric<number, number>;
38
+ /** True while the age window is animating (e.g. from `useAnimatedAgeWindow`),
39
+ * so per-frame label/pattern recalculation can be skipped. */
40
+ isTransitioning?: boolean;
41
+ /** Hide unit labels while transitioning (perf escape hatch; default false —
42
+ * labels stay visible through the animation). */
43
+ hideLabelsWhileTransitioning?: boolean;
33
44
  ref?: RefObject<ColumnRef>;
34
45
  }
35
46
  export declare function Column(props: ColumnProps): import('react').ReactElement<import('react').FunctionComponentElement<import('@blueprintjs/core').NonIdealStateProps>, string | import('react').JSXElementConstructor<any>> | import('react').FunctionComponentElement<import('./data-provider').ColumnDataProviderProps<import('@macrostrat/api-types').BaseUnit>>;
package/dist/column.js CHANGED
@@ -32,11 +32,14 @@ function Column(props) {
32
32
  pixelScale,
33
33
  minPixelScale = 0.2,
34
34
  minSectionHeight = 50,
35
+ windowPadding = 0,
35
36
  collapseSmallUnconformities = true,
36
37
  allowUnitSelection = false,
37
38
  hybridScale,
38
39
  scale,
39
40
  axisType,
41
+ isTransitioning,
42
+ hideLabelsWhileTransitioning,
40
43
  ref,
41
44
  ...rest
42
45
  } = props;
@@ -66,6 +69,7 @@ function Column(props) {
66
69
  pixelScale,
67
70
  minPixelScale: _minPixelScale,
68
71
  minSectionHeight: _minSectionHeight,
72
+ windowPadding,
69
73
  collapseSmallUnconformities,
70
74
  // TODO: consider unifying scale and hybridScale options
71
75
  scale,
@@ -91,6 +95,8 @@ function Column(props) {
91
95
  allowUnitSelection: showUnitPopover || allowUnitSelection,
92
96
  onUnitSelected,
93
97
  selectedUnit,
98
+ isTransitioning,
99
+ hideLabelsWhileTransitioning,
94
100
  ref
95
101
  },
96
102
  h(ColumnInner, { ageAxisComponent, ...rest }, [
@@ -122,6 +128,8 @@ function ColumnInner(props) {
122
128
  timescaleLevels,
123
129
  maxInternalColumns,
124
130
  onMouseOver,
131
+ onClickTimescaleInterval,
132
+ timescaleIntervalStyle,
125
133
  ageAxisComponent = CompositeAgeAxis
126
134
  } = props;
127
135
  const { axisType } = useMacrostratColumnData();
@@ -158,7 +166,9 @@ function ColumnInner(props) {
158
166
  h(ageAxisComponent),
159
167
  h.if(_showTimescale)(CompositeTimescale, {
160
168
  levels: timescaleLevels,
161
- unconformityLabels: _timescaleUnconformityLabels
169
+ unconformityLabels: _timescaleUnconformityLabels,
170
+ onClickInterval: onClickTimescaleInterval,
171
+ intervalStyle: timescaleIntervalStyle
162
172
  }),
163
173
  h(SectionsColumn, {
164
174
  unitComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"column.js","sources":["../src/column.ts"],"sourcesContent":["import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n RefObject,\n} from \"react\";\nimport h from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n ColumnRef,\n UnitKeyboardNavigation,\n useColumnRef,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\ninterface BaseColumnProps extends Omit<\n SectionSharedProps,\n \"unconformityLabels\"\n> {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n ref?: RefObject<ColumnRef>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n collapseSmallUnconformities = true,\n allowUnitSelection = false,\n hybridScale,\n scale,\n axisType,\n ref,\n ...rest\n } = props;\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight: number | null = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n {\n units,\n sections,\n totalHeight,\n axisType: _axisType,\n allowUnitSelection: showUnitPopover || allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n ref,\n },\n h(ColumnInner, { ageAxisComponent, ...rest }, [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ]),\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n const columnRef = useColumnRef();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA4FO,SAAS,OAAO,OAAoB;AACzC,QAAM;AAAA,IACJ,kBAAkB;AAAA,IAClB,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,IACnB;AAAA,IACA,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,8BAA8B;AAAA,IAC9B,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAIJ,MAAI,oBAAmC;AACvC,MAAI,oBAAoB;AACxB,MAAI,iBAAiB;AACrB,MAAI,cAAc,MAAM;AACtB,wBAAoB;AACpB,wBAAoB;AACpB,qBAAiB;AAAA,EACnB;AAGA,MAAI,YAAY,YAAY,eAAe;AAC3C,MAAI,mBAAmB;AACvB,MACE,aAAa,SAAS,gBAAgB,qBACtC,aAAa,eAAe,KAC5B;AAEA,uBAAmB;AACnB,gBAAY,eAAe;AAAA,EAC7B;AAEA,QAAM,EAAE,UAAU,OAAO,YAAA,IAAgB,uBAAuB,UAAU;AAAA,IACxE,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,EAAA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mBAAe,MAAM,MAAM,IAAI;AAAA,EACjC,GAAG,CAAC,YAAY,CAAC;AAEjB,MAAI,gBAAgB,MAAM;AACxB,WAAO;AAAA,MACL;AAAA,MACA,aAAa;AAAA,MACb,aAAa;AAAA,MACb,YAAY;AAAA,IAAA;AAAA,EAEhB;AAEA,SAAO,EAAE,aAAa,aAAa,aAAa,YAAY,QAAA;AAC9D;AAOO,SAAS,gBAAgB,OAA6B;AAC3D,QAAM,EAAE,WAAW,GAAG,KAAA,IAAS;AAC/B,QAAM,WAAW,YAAA;AAEjB,SAAO,EAAE,KAAK;AAAA,IACZ,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,aAAa,UAAU,aAAa;AAAA,MAAA;AAAA,MAEtC;AAAA,IAAA;AAAA,IAEF,GAAG;AAAA,EAAA,CACJ;AACH;AAEO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,eAAe;AAAA,EACf,iBAAiB;AACnB,GAAG;AACD,MAAI,QAAQ,KAAM,QAAO;AACzB,SAAO,EAAE,mBAAmB;AAAA,IAC1B,EAAE,wBAAwB;AAAA,MACxB,EAAE,MAAM,KAAK,QAAQ;AAAA,MACrB,EAAE,GAAG,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,KAAK,QAAQ,CAAC;AAAA,IAAA,CAC5D;AAAA,IACD,EAAE,WAAW,EAAE,KAAK,MAAM,OAAO,SAAS,OAAO,KAAK,WAAW;AAAA,IACjE,EAAE,GAAG,cAAc,EAAE,iBAAiB;AAAA,MACpC,MAAM,KAAK;AAAA,MACX,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,WAAW;AAAA,IAAA,CACZ;AAAA,EAAA,CACF;AACH;"}
1
+ {"version":3,"file":"column.js","sources":["../src/column.ts"],"sourcesContent":["import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n RefObject,\n} from \"react\";\nimport h from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n ColumnRef,\n UnitKeyboardNavigation,\n useColumnRef,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport type {\n TimescaleClickHandler,\n IntervalStyleBuilder,\n} from \"@macrostrat/timescale\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\ninterface BaseColumnProps extends Omit<\n SectionSharedProps,\n \"unconformityLabels\"\n> {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n /** Called when a timescale interval is clicked (e.g. to zoom the age range). */\n onClickTimescaleInterval?: TimescaleClickHandler;\n /** Per-interval style for the timescale (e.g. to bold the selected interval). */\n timescaleIntervalStyle?: IntervalStyleBuilder;\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n /** True while the age window is animating (e.g. from `useAnimatedAgeWindow`),\n * so per-frame label/pattern recalculation can be skipped. */\n isTransitioning?: boolean;\n /** Hide unit labels while transitioning (perf escape hatch; default false —\n * labels stay visible through the animation). */\n hideLabelsWhileTransitioning?: boolean;\n ref?: RefObject<ColumnRef>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n windowPadding = 0,\n collapseSmallUnconformities = true,\n allowUnitSelection = false,\n hybridScale,\n scale,\n axisType,\n isTransitioning,\n hideLabelsWhileTransitioning,\n ref,\n ...rest\n } = props;\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight: number | null = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n windowPadding,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n {\n units,\n sections,\n totalHeight,\n axisType: _axisType,\n allowUnitSelection: showUnitPopover || allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n isTransitioning,\n hideLabelsWhileTransitioning,\n ref,\n },\n h(ColumnInner, { ageAxisComponent, ...rest }, [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ]),\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n onClickTimescaleInterval,\n timescaleIntervalStyle,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n const columnRef = useColumnRef();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n onClickInterval: onClickTimescaleInterval,\n intervalStyle: timescaleIntervalStyle,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0GO,SAAS,OAAO,OAAoB;AACzC,QAAM;AAAA,IACJ,kBAAkB;AAAA,IAClB,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,IACnB;AAAA,IACA,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,8BAA8B;AAAA,IAC9B,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AAIJ,MAAI,oBAAmC;AACvC,MAAI,oBAAoB;AACxB,MAAI,iBAAiB;AACrB,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