@macrostrat/column-views 3.11.0 → 3.12.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 (130) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/dist/age-model/data.cjs +57 -0
  3. package/dist/age-model/data.cjs.map +1 -0
  4. package/dist/age-model/data.d.ts +29 -0
  5. package/dist/age-model/data.js +57 -0
  6. package/dist/age-model/data.js.map +1 -0
  7. package/dist/age-model/details.cjs +261 -0
  8. package/dist/age-model/details.cjs.map +1 -0
  9. package/dist/age-model/details.d.ts +39 -0
  10. package/dist/age-model/details.js +258 -0
  11. package/dist/age-model/details.js.map +1 -0
  12. package/dist/age-model/details.module.sass.cjs +42 -0
  13. package/dist/age-model/details.module.sass.cjs.map +1 -0
  14. package/dist/age-model/details.module.sass.js +40 -0
  15. package/dist/age-model/details.module.sass.js.map +1 -0
  16. package/dist/age-model/index.d.ts +5 -0
  17. package/dist/age-model/legacy.cjs +28 -0
  18. package/dist/age-model/legacy.cjs.map +1 -0
  19. package/dist/age-model/legacy.d.ts +6 -0
  20. package/dist/age-model/legacy.js +26 -0
  21. package/dist/age-model/legacy.js.map +1 -0
  22. package/dist/age-model/surfaces.cjs +355 -0
  23. package/dist/age-model/surfaces.cjs.map +1 -0
  24. package/dist/age-model/surfaces.d.ts +68 -0
  25. package/dist/age-model/surfaces.js +352 -0
  26. package/dist/age-model/surfaces.js.map +1 -0
  27. package/dist/age-model/surfaces.module.sass.cjs +45 -0
  28. package/dist/age-model/surfaces.module.sass.cjs.map +1 -0
  29. package/dist/age-model/surfaces.module.sass.js +43 -0
  30. package/dist/age-model/surfaces.module.sass.js.map +1 -0
  31. package/dist/age-model/types.cjs +229 -0
  32. package/dist/age-model/types.cjs.map +1 -0
  33. package/dist/age-model/types.d.ts +112 -0
  34. package/dist/age-model/types.js +229 -0
  35. package/dist/age-model/types.js.map +1 -0
  36. package/dist/column-views.css +389 -57
  37. package/dist/column.cjs +20 -13
  38. package/dist/column.cjs.map +1 -1
  39. package/dist/column.d.ts +21 -6
  40. package/dist/column.js +21 -14
  41. package/dist/column.js.map +1 -1
  42. package/dist/column.module.sass.cjs +19 -15
  43. package/dist/column.module.sass.cjs.map +1 -1
  44. package/dist/column.module.sass.js +19 -15
  45. package/dist/column.module.sass.js.map +1 -1
  46. package/dist/data-provider/store.cjs +34 -1
  47. package/dist/data-provider/store.cjs.map +1 -1
  48. package/dist/data-provider/store.d.ts +5 -0
  49. package/dist/data-provider/store.js +35 -2
  50. package/dist/data-provider/store.js.map +1 -1
  51. package/dist/index.cjs +54 -3
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.d.ts +3 -1
  54. package/dist/index.js +54 -3
  55. package/dist/index.js.map +1 -1
  56. package/dist/notes.cjs +11 -2
  57. package/dist/notes.cjs.map +1 -1
  58. package/dist/notes.d.ts +11 -1
  59. package/dist/notes.js +11 -2
  60. package/dist/notes.js.map +1 -1
  61. package/dist/prepare-units/composite-scale.cjs +18 -16
  62. package/dist/prepare-units/composite-scale.cjs.map +1 -1
  63. package/dist/prepare-units/composite-scale.js +18 -16
  64. package/dist/prepare-units/composite-scale.js.map +1 -1
  65. package/dist/prepare-units/density.cjs +83 -0
  66. package/dist/prepare-units/density.cjs.map +1 -0
  67. package/dist/prepare-units/density.d.ts +92 -0
  68. package/dist/prepare-units/density.js +83 -0
  69. package/dist/prepare-units/density.js.map +1 -0
  70. package/dist/prepare-units/index.cjs +15 -7
  71. package/dist/prepare-units/index.cjs.map +1 -1
  72. package/dist/prepare-units/index.d.ts +1 -0
  73. package/dist/prepare-units/index.js +15 -7
  74. package/dist/prepare-units/index.js.map +1 -1
  75. package/dist/prepare-units/types.cjs.map +1 -1
  76. package/dist/prepare-units/types.d.ts +34 -13
  77. package/dist/prepare-units/types.js.map +1 -1
  78. package/dist/section.cjs +108 -24
  79. package/dist/section.cjs.map +1 -1
  80. package/dist/section.d.ts +66 -6
  81. package/dist/section.js +109 -25
  82. package/dist/section.js.map +1 -1
  83. package/dist/timescale-zoom.cjs +191 -0
  84. package/dist/timescale-zoom.cjs.map +1 -0
  85. package/dist/timescale-zoom.d.ts +74 -0
  86. package/dist/timescale-zoom.js +191 -0
  87. package/dist/timescale-zoom.js.map +1 -0
  88. package/dist/unit-details/age-range.cjs +1 -0
  89. package/dist/unit-details/age-range.cjs.map +1 -1
  90. package/dist/unit-details/age-range.d.ts +5 -1
  91. package/dist/unit-details/age-range.js +1 -0
  92. package/dist/unit-details/age-range.js.map +1 -1
  93. package/dist/units/composite.cjs +4 -1
  94. package/dist/units/composite.cjs.map +1 -1
  95. package/dist/units/composite.d.ts +2 -0
  96. package/dist/units/composite.js +4 -1
  97. package/dist/units/composite.js.map +1 -1
  98. package/package.json +7 -7
  99. package/src/age-model/data.ts +98 -0
  100. package/src/age-model/details.module.sass +108 -0
  101. package/src/age-model/details.ts +333 -0
  102. package/src/age-model/index.ts +5 -0
  103. package/src/age-model/legacy.ts +30 -0
  104. package/src/age-model/surfaces.module.sass +168 -0
  105. package/src/age-model/surfaces.ts +568 -0
  106. package/src/age-model/types.ts +392 -0
  107. package/src/column.module.sass +59 -8
  108. package/src/column.ts +49 -23
  109. package/src/data-provider/store.ts +50 -1
  110. package/src/index.ts +5 -1
  111. package/src/notes.ts +20 -2
  112. package/src/prepare-units/composite-scale.ts +34 -31
  113. package/src/prepare-units/density.ts +197 -0
  114. package/src/prepare-units/index.ts +25 -6
  115. package/src/prepare-units/types.ts +34 -13
  116. package/src/section.ts +219 -33
  117. package/src/timescale-zoom.ts +341 -0
  118. package/src/unit-details/age-range.ts +3 -3
  119. package/src/units/composite.ts +11 -0
  120. package/dist/age-model-overlay.cjs +0 -50
  121. package/dist/age-model-overlay.cjs.map +0 -1
  122. package/dist/age-model-overlay.d.ts +0 -24
  123. package/dist/age-model-overlay.js +0 -48
  124. package/dist/age-model-overlay.js.map +0 -1
  125. package/dist/age-model-overlay.module.sass.cjs +0 -12
  126. package/dist/age-model-overlay.module.sass.cjs.map +0 -1
  127. package/dist/age-model-overlay.module.sass.js +0 -11
  128. package/dist/age-model-overlay.module.sass.js.map +0 -1
  129. package/src/age-model-overlay.module.sass +0 -11
  130. package/src/age-model-overlay.ts +0 -96
@@ -10,7 +10,7 @@ import { useMacrostratDefs } from "@macrostrat/data-provider";
10
10
  import h from "./age-range.module.sass";
11
11
  import { formatProportion, formatRange } from "./utils";
12
12
  import classNames from "classnames";
13
- import { useMemo } from "react";
13
+ import { ReactNode, useMemo } from "react";
14
14
 
15
15
  export function AgeField({ unit, children, ...rest }) {
16
16
  const [_b_age, _t_age, _unit] = getAgeRange(unit);
@@ -221,8 +221,8 @@ function getProportion(age: number, interval: IntervalShort): number | null {
221
221
  return (interval.b_age - age) / (interval.b_age - interval.t_age);
222
222
  }
223
223
 
224
- function Proportion({ value }) {
225
- let content = null;
224
+ export function Proportion({ value }: { value: number }) {
225
+ let content: ReactNode | null = null;
226
226
  if (value == 0) {
227
227
  content = "base";
228
228
  } else if (value == 1) {
@@ -118,6 +118,8 @@ type ICompositeUnitProps = BaseUnitProps & {
118
118
  showLabelColumn?: boolean;
119
119
  noteComponent?: React.FC<any>;
120
120
  shouldRenderNote?: (d: any) => boolean;
121
+ /** Suppress the label for a unit drawn thinner than this many pixels */
122
+ labelSuppressHeight?: number;
121
123
  };
122
124
 
123
125
  interface CompositeUnitProps {
@@ -159,6 +161,13 @@ export function AnnotatedUnitsColumn(props: ICompositeUnitProps) {
159
161
  return null;
160
162
  }
161
163
 
164
+ /** A unit drawn thinner than this gets no label. The notes column can place
165
+ * a label away from its unit and run a leader line back, so a thin unit is
166
+ * labelable in principle — but below a pixel or two there is nothing on the
167
+ * page to lead back to, and a dense column spends its labels on units the
168
+ * reader cannot see. */
169
+ const DEFAULT_LABEL_SUPPRESS_HEIGHT = 2;
170
+
162
171
  export function SectionLabelsColumn(props: ICompositeUnitProps) {
163
172
  // Section with "squishy" time scale
164
173
  const {
@@ -167,6 +176,7 @@ export function SectionLabelsColumn(props: ICompositeUnitProps) {
167
176
  labelOffset = 30,
168
177
  noteComponent,
169
178
  shouldRenderNote,
179
+ labelSuppressHeight = DEFAULT_LABEL_SUPPRESS_HEIGHT,
170
180
  } = props;
171
181
 
172
182
  const { totalHeight, axisType } = useMacrostratColumnData();
@@ -198,6 +208,7 @@ export function SectionLabelsColumn(props: ICompositeUnitProps) {
198
208
  divisions: unitsToLabel,
199
209
  paddingLeft: labelOffset,
200
210
  width,
211
+ minimumHeight: labelSuppressHeight,
201
212
  noteComponent,
202
213
  shouldRenderNote,
203
214
  scale: _compositeScale,
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const h$1 = require("@macrostrat/hyper");
4
- const ageModelOverlay_module = require("./age-model-overlay.module.sass.cjs");
5
- const uiComponents = require("@macrostrat/ui-components");
6
- const dynamicScales = require("./prepare-units/dynamic-scales.cjs");
7
- const store = require("./data-provider/store.cjs");
8
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
9
- const h__default = /* @__PURE__ */ _interopDefault(h$1);
10
- const h = h__default.default.styled(ageModelOverlay_module);
11
- function BoundaryAgeModelOverlay() {
12
- const col_id = store.useMacrostratUnits()?.[0]?.col_id;
13
- const scale = store.useCompositeScale();
14
- const ageModel = uiComponents.useAPIResult(
15
- "https://dev.macrostrat.org/api/v2/age_model",
16
- { col_id },
17
- (res) => res.success.data
18
- );
19
- if (ageModel == null) {
20
- return null;
21
- }
22
- return h(
23
- "div.boundary-age-model",
24
- ageModel.map((surface) => {
25
- const height = scale(surface.model_age);
26
- return h("div.boundary-age-model-surface", {
27
- key: surface.boundary_id,
28
- style: { top: `${height}px` }
29
- });
30
- })
31
- );
32
- }
33
- function ComputedSurfacesOverlay() {
34
- const units = store.useMacrostratUnits();
35
- const surfaces = dynamicScales.buildColumnSurfaces(units);
36
- const scale = store.useCompositeScale();
37
- return h(
38
- "div.boundary-age-model",
39
- surfaces.map((surface) => {
40
- const height = scale(surface.age);
41
- return h("div.boundary-age-model-surface", {
42
- key: surface.index,
43
- style: { top: `${height}px` }
44
- });
45
- })
46
- );
47
- }
48
- exports.BoundaryAgeModelOverlay = BoundaryAgeModelOverlay;
49
- exports.ComputedSurfacesOverlay = ComputedSurfacesOverlay;
50
- //# sourceMappingURL=age-model-overlay.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"age-model-overlay.cjs","sources":["../src/age-model-overlay.ts"],"sourcesContent":["/** An in-development overlay for a column's age model.\n *\n * Age model info:\n * {\n * \"boundary_id\": 8049,\n * \"col_id\": 432,\n * \"section_id\": 3104,\n * \"interval_id\": 268,\n * \"interval_name\": \"Calymmian\",\n * \"age_bottom\": 1600,\n * \"age_top\": 1400,\n * \"rel_position\": 0.85,\n * \"model_age\": 1430,\n * \"boundary_status\": \"absolute\",\n * \"boundary_type\": \"\",\n * \"boundary_position\": null,\n * \"unit_below\": 11541,\n * \"unit_above\": 0,\n * \"ref_id\": 217\n * },\n *\n * */\n\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./age-model-overlay.module.sass\";\nimport { useAPIResult } from \"@macrostrat/ui-components\";\nimport { useCompositeScale, useMacrostratUnits } from \"./data-provider\";\nimport { buildColumnSurfaces } from \"./prepare-units/dynamic-scales\";\nimport { ExtUnit } from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nconst h = hyper.styled(styles);\n\ninterface AgeModelSurface {\n boundary_id: number;\n col_id: number;\n section_id: number;\n interval_id: number;\n interval_name: string;\n age_bottom: number;\n age_top: number;\n rel_position: number;\n model_age: number;\n boundary_status: \"absolute\" | \"relative\" | \"modeled\";\n boundary_type: string;\n boundary_position: null | number;\n unit_below: number;\n unit_above: number;\n ref_id: number;\n}\n\nexport function BoundaryAgeModelOverlay() {\n const col_id = (useMacrostratUnits() as ExtUnit[])?.[0]?.col_id;\n const scale = useCompositeScale();\n\n const ageModel = useAPIResult(\n \"https://dev.macrostrat.org/api/v2/age_model\",\n { col_id },\n (res) => res.success.data,\n );\n\n if (ageModel == null) {\n return null;\n }\n\n return h(\n \"div.boundary-age-model\",\n ageModel.map((surface) => {\n const height = scale(surface.model_age);\n\n return h(\"div.boundary-age-model-surface\", {\n key: surface.boundary_id,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n\nexport function ComputedSurfacesOverlay() {\n /** Overlay showing age surfaces. This is like the boundary age model overlay but\n * it is computed on the fly from unit tops and bottoms.\n */\n const units = useMacrostratUnits() as UnitLong[];\n const surfaces = buildColumnSurfaces(units);\n const scale = useCompositeScale();\n\n return h(\n \"div.boundary-age-model\",\n surfaces.map((surface) => {\n const height = scale(surface.age);\n return h(\"div.boundary-age-model-surface\", {\n key: surface.index,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n"],"names":["hyper","styles","useMacrostratUnits","useCompositeScale","useAPIResult","buildColumnSurfaces"],"mappings":";;;;;;;;;AA8BA,MAAM,IAAIA,WAAAA,QAAM,OAAOC,sBAAM;AAoBtB,SAAS,0BAA0B;AACxC,QAAM,SAAUC,MAAAA,uBAAqC,CAAC,GAAG;AACzD,QAAM,QAAQC,MAAAA,kBAAA;AAEd,QAAM,WAAWC,aAAAA;AAAAA,IACf;AAAA,IACA,EAAE,OAAA;AAAA,IACF,CAAC,QAAQ,IAAI,QAAQ;AAAA,EAAA;AAGvB,MAAI,YAAY,MAAM;AACpB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,SAAS,IAAI,CAAC,YAAY;AACxB,YAAM,SAAS,MAAM,QAAQ,SAAS;AAEtC,aAAO,EAAE,kCAAkC;AAAA,QACzC,KAAK,QAAQ;AAAA,QACb,OAAO,EAAE,KAAK,GAAG,MAAM,KAAA;AAAA,MAAK,CAC7B;AAAA,IACH,CAAC;AAAA,EAAA;AAEL;AAEO,SAAS,0BAA0B;AAIxC,QAAM,QAAQF,MAAAA,mBAAA;AACd,QAAM,WAAWG,cAAAA,oBAAoB,KAAK;AAC1C,QAAM,QAAQF,MAAAA,kBAAA;AAEd,SAAO;AAAA,IACL;AAAA,IACA,SAAS,IAAI,CAAC,YAAY;AACxB,YAAM,SAAS,MAAM,QAAQ,GAAG;AAChC,aAAO,EAAE,kCAAkC;AAAA,QACzC,KAAK,QAAQ;AAAA,QACb,OAAO,EAAE,KAAK,GAAG,MAAM,KAAA;AAAA,MAAK,CAC7B;AAAA,IACH,CAAC;AAAA,EAAA;AAEL;;;"}
@@ -1,24 +0,0 @@
1
- /** An in-development overlay for a column's age model.
2
- *
3
- * Age model info:
4
- * {
5
- * "boundary_id": 8049,
6
- * "col_id": 432,
7
- * "section_id": 3104,
8
- * "interval_id": 268,
9
- * "interval_name": "Calymmian",
10
- * "age_bottom": 1600,
11
- * "age_top": 1400,
12
- * "rel_position": 0.85,
13
- * "model_age": 1430,
14
- * "boundary_status": "absolute",
15
- * "boundary_type": "",
16
- * "boundary_position": null,
17
- * "unit_below": 11541,
18
- * "unit_above": 0,
19
- * "ref_id": 217
20
- * },
21
- *
22
- * */
23
- export declare function BoundaryAgeModelOverlay(): import('react').DOMElement<any, Element> | null;
24
- export declare function ComputedSurfacesOverlay(): import('react').DOMElement<import('react').DOMAttributes<Element>, Element>;
@@ -1,48 +0,0 @@
1
- import h$1 from "@macrostrat/hyper";
2
- import h$2 from "./age-model-overlay.module.sass.js";
3
- import { useAPIResult } from "@macrostrat/ui-components";
4
- import { buildColumnSurfaces } from "./prepare-units/dynamic-scales.js";
5
- import { useMacrostratUnits, useCompositeScale } from "./data-provider/store.js";
6
- const h = h$1.styled(h$2);
7
- function BoundaryAgeModelOverlay() {
8
- const col_id = useMacrostratUnits()?.[0]?.col_id;
9
- const scale = useCompositeScale();
10
- const ageModel = useAPIResult(
11
- "https://dev.macrostrat.org/api/v2/age_model",
12
- { col_id },
13
- (res) => res.success.data
14
- );
15
- if (ageModel == null) {
16
- return null;
17
- }
18
- return h(
19
- "div.boundary-age-model",
20
- ageModel.map((surface) => {
21
- const height = scale(surface.model_age);
22
- return h("div.boundary-age-model-surface", {
23
- key: surface.boundary_id,
24
- style: { top: `${height}px` }
25
- });
26
- })
27
- );
28
- }
29
- function ComputedSurfacesOverlay() {
30
- const units = useMacrostratUnits();
31
- const surfaces = buildColumnSurfaces(units);
32
- const scale = useCompositeScale();
33
- return h(
34
- "div.boundary-age-model",
35
- surfaces.map((surface) => {
36
- const height = scale(surface.age);
37
- return h("div.boundary-age-model-surface", {
38
- key: surface.index,
39
- style: { top: `${height}px` }
40
- });
41
- })
42
- );
43
- }
44
- export {
45
- BoundaryAgeModelOverlay,
46
- ComputedSurfacesOverlay
47
- };
48
- //# sourceMappingURL=age-model-overlay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"age-model-overlay.js","sources":["../src/age-model-overlay.ts"],"sourcesContent":["/** An in-development overlay for a column's age model.\n *\n * Age model info:\n * {\n * \"boundary_id\": 8049,\n * \"col_id\": 432,\n * \"section_id\": 3104,\n * \"interval_id\": 268,\n * \"interval_name\": \"Calymmian\",\n * \"age_bottom\": 1600,\n * \"age_top\": 1400,\n * \"rel_position\": 0.85,\n * \"model_age\": 1430,\n * \"boundary_status\": \"absolute\",\n * \"boundary_type\": \"\",\n * \"boundary_position\": null,\n * \"unit_below\": 11541,\n * \"unit_above\": 0,\n * \"ref_id\": 217\n * },\n *\n * */\n\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./age-model-overlay.module.sass\";\nimport { useAPIResult } from \"@macrostrat/ui-components\";\nimport { useCompositeScale, useMacrostratUnits } from \"./data-provider\";\nimport { buildColumnSurfaces } from \"./prepare-units/dynamic-scales\";\nimport { ExtUnit } from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nconst h = hyper.styled(styles);\n\ninterface AgeModelSurface {\n boundary_id: number;\n col_id: number;\n section_id: number;\n interval_id: number;\n interval_name: string;\n age_bottom: number;\n age_top: number;\n rel_position: number;\n model_age: number;\n boundary_status: \"absolute\" | \"relative\" | \"modeled\";\n boundary_type: string;\n boundary_position: null | number;\n unit_below: number;\n unit_above: number;\n ref_id: number;\n}\n\nexport function BoundaryAgeModelOverlay() {\n const col_id = (useMacrostratUnits() as ExtUnit[])?.[0]?.col_id;\n const scale = useCompositeScale();\n\n const ageModel = useAPIResult(\n \"https://dev.macrostrat.org/api/v2/age_model\",\n { col_id },\n (res) => res.success.data,\n );\n\n if (ageModel == null) {\n return null;\n }\n\n return h(\n \"div.boundary-age-model\",\n ageModel.map((surface) => {\n const height = scale(surface.model_age);\n\n return h(\"div.boundary-age-model-surface\", {\n key: surface.boundary_id,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n\nexport function ComputedSurfacesOverlay() {\n /** Overlay showing age surfaces. This is like the boundary age model overlay but\n * it is computed on the fly from unit tops and bottoms.\n */\n const units = useMacrostratUnits() as UnitLong[];\n const surfaces = buildColumnSurfaces(units);\n const scale = useCompositeScale();\n\n return h(\n \"div.boundary-age-model\",\n surfaces.map((surface) => {\n const height = scale(surface.age);\n return h(\"div.boundary-age-model-surface\", {\n key: surface.index,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n"],"names":["hyper","styles"],"mappings":";;;;;AA8BA,MAAM,IAAIA,IAAM,OAAOC,GAAM;AAoBtB,SAAS,0BAA0B;AACxC,QAAM,SAAU,uBAAqC,CAAC,GAAG;AACzD,QAAM,QAAQ,kBAAA;AAEd,QAAM,WAAW;AAAA,IACf;AAAA,IACA,EAAE,OAAA;AAAA,IACF,CAAC,QAAQ,IAAI,QAAQ;AAAA,EAAA;AAGvB,MAAI,YAAY,MAAM;AACpB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,SAAS,IAAI,CAAC,YAAY;AACxB,YAAM,SAAS,MAAM,QAAQ,SAAS;AAEtC,aAAO,EAAE,kCAAkC;AAAA,QACzC,KAAK,QAAQ;AAAA,QACb,OAAO,EAAE,KAAK,GAAG,MAAM,KAAA;AAAA,MAAK,CAC7B;AAAA,IACH,CAAC;AAAA,EAAA;AAEL;AAEO,SAAS,0BAA0B;AAIxC,QAAM,QAAQ,mBAAA;AACd,QAAM,WAAW,oBAAoB,KAAK;AAC1C,QAAM,QAAQ,kBAAA;AAEd,SAAO;AAAA,IACL;AAAA,IACA,SAAS,IAAI,CAAC,YAAY;AACxB,YAAM,SAAS,MAAM,QAAQ,GAAG;AAChC,aAAO,EAAE,kCAAkC;AAAA,QACzC,KAAK,QAAQ;AAAA,QACb,OAAO,EAAE,KAAK,GAAG,MAAM,KAAA;AAAA,MAAK,CAC7B;AAAA,IACH,CAAC;AAAA,EAAA;AAEL;"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- const h$1 = require("@macrostrat/hyper");
3
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
4
- const h__default = /* @__PURE__ */ _interopDefault(h$1);
5
- const styles = {
6
- "boundary-age-model": "_boundary-age-model_16scl_1",
7
- "boundary-age-model-surface": "_boundary-age-model-surface_16scl_8"
8
- };
9
- let h = h__default.default.styled(styles);
10
- Object.assign(h, styles);
11
- module.exports = h;
12
- //# sourceMappingURL=age-model-overlay.module.sass.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"age-model-overlay.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,11 +0,0 @@
1
- import h$1 from "@macrostrat/hyper";
2
- const styles = {
3
- "boundary-age-model": "_boundary-age-model_16scl_1",
4
- "boundary-age-model-surface": "_boundary-age-model-surface_16scl_8"
5
- };
6
- let h = h$1.styled(styles);
7
- Object.assign(h, styles);
8
- export {
9
- h as default
10
- };
11
- //# sourceMappingURL=age-model-overlay.module.sass.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"age-model-overlay.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,11 +0,0 @@
1
- .boundary-age-model
2
- top: 0
3
- left: 0
4
- position: absolute
5
- width: 100%
6
-
7
- .boundary-age-model-surface
8
- left: 0
9
- right: 0
10
- position: absolute
11
- border-top: 1px solid lightgreen
@@ -1,96 +0,0 @@
1
- /** An in-development overlay for a column's age model.
2
- *
3
- * Age model info:
4
- * {
5
- * "boundary_id": 8049,
6
- * "col_id": 432,
7
- * "section_id": 3104,
8
- * "interval_id": 268,
9
- * "interval_name": "Calymmian",
10
- * "age_bottom": 1600,
11
- * "age_top": 1400,
12
- * "rel_position": 0.85,
13
- * "model_age": 1430,
14
- * "boundary_status": "absolute",
15
- * "boundary_type": "",
16
- * "boundary_position": null,
17
- * "unit_below": 11541,
18
- * "unit_above": 0,
19
- * "ref_id": 217
20
- * },
21
- *
22
- * */
23
-
24
- import hyper from "@macrostrat/hyper";
25
- import styles from "./age-model-overlay.module.sass";
26
- import { useAPIResult } from "@macrostrat/ui-components";
27
- import { useCompositeScale, useMacrostratUnits } from "./data-provider";
28
- import { buildColumnSurfaces } from "./prepare-units/dynamic-scales";
29
- import { ExtUnit } from "./prepare-units";
30
- import { UnitLong } from "@macrostrat/api-types";
31
- const h = hyper.styled(styles);
32
-
33
- interface AgeModelSurface {
34
- boundary_id: number;
35
- col_id: number;
36
- section_id: number;
37
- interval_id: number;
38
- interval_name: string;
39
- age_bottom: number;
40
- age_top: number;
41
- rel_position: number;
42
- model_age: number;
43
- boundary_status: "absolute" | "relative" | "modeled";
44
- boundary_type: string;
45
- boundary_position: null | number;
46
- unit_below: number;
47
- unit_above: number;
48
- ref_id: number;
49
- }
50
-
51
- export function BoundaryAgeModelOverlay() {
52
- const col_id = (useMacrostratUnits() as ExtUnit[])?.[0]?.col_id;
53
- const scale = useCompositeScale();
54
-
55
- const ageModel = useAPIResult(
56
- "https://dev.macrostrat.org/api/v2/age_model",
57
- { col_id },
58
- (res) => res.success.data,
59
- );
60
-
61
- if (ageModel == null) {
62
- return null;
63
- }
64
-
65
- return h(
66
- "div.boundary-age-model",
67
- ageModel.map((surface) => {
68
- const height = scale(surface.model_age);
69
-
70
- return h("div.boundary-age-model-surface", {
71
- key: surface.boundary_id,
72
- style: { top: `${height}px` },
73
- });
74
- }),
75
- );
76
- }
77
-
78
- export function ComputedSurfacesOverlay() {
79
- /** Overlay showing age surfaces. This is like the boundary age model overlay but
80
- * it is computed on the fly from unit tops and bottoms.
81
- */
82
- const units = useMacrostratUnits() as UnitLong[];
83
- const surfaces = buildColumnSurfaces(units);
84
- const scale = useCompositeScale();
85
-
86
- return h(
87
- "div.boundary-age-model",
88
- surfaces.map((surface) => {
89
- const height = scale(surface.age);
90
- return h("div.boundary-age-model-surface", {
91
- key: surface.index,
92
- style: { top: `${height}px` },
93
- });
94
- }),
95
- );
96
- }