@macrostrat/column-views 1.0.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.
- package/CHANGELOG.md +14 -0
- package/README.md +3 -0
- package/dist/age-axis.7ce58d66.js +41 -0
- package/dist/age-axis.7ce58d66.js.map +1 -0
- package/dist/boxes.6d3192e6.js +164 -0
- package/dist/boxes.6d3192e6.js.map +1 -0
- package/dist/boxes.module.998ff312.js +13 -0
- package/dist/boxes.module.998ff312.js.map +1 -0
- package/dist/boxes.module.dd631fe3.css +4 -0
- package/dist/boxes.module.dd631fe3.css.map +1 -0
- package/dist/carbon-isotopes.6d9bddcf.js +11 -0
- package/dist/carbon-isotopes.6d9bddcf.js.map +1 -0
- package/dist/column.e35a471f.js +149 -0
- package/dist/column.e35a471f.js.map +1 -0
- package/dist/column.e901b5d4.js +117 -0
- package/dist/column.e901b5d4.js.map +1 -0
- package/dist/column.module.2e29259c.js +22 -0
- package/dist/column.module.2e29259c.js.map +1 -0
- package/dist/column.module.35184ea7.css +157 -0
- package/dist/column.module.35184ea7.css.map +1 -0
- package/dist/column.module.35ba04e7.js +34 -0
- package/dist/column.module.35ba04e7.js.map +1 -0
- package/dist/column.module.c9df6edf.css +138 -0
- package/dist/column.module.c9df6edf.css.map +1 -0
- package/dist/composite.494beffc.js +153 -0
- package/dist/composite.494beffc.js.map +1 -0
- package/dist/composite.module.5cc0e747.css +4 -0
- package/dist/composite.module.5cc0e747.css.map +1 -0
- package/dist/composite.module.6359deba.js +13 -0
- package/dist/composite.module.6359deba.js.map +1 -0
- package/dist/core.f3824dd8.js +89 -0
- package/dist/core.f3824dd8.js.map +1 -0
- package/dist/data-area.f9bb9ad9.js +86 -0
- package/dist/data-area.f9bb9ad9.js.map +1 -0
- package/dist/data-provider.61ef7f9a.js +25 -0
- package/dist/data-provider.61ef7f9a.js.map +1 -0
- package/dist/helpers.2af05ee4.js +94 -0
- package/dist/helpers.2af05ee4.js.map +1 -0
- package/dist/index.d.ts +363 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/index.module.8fad0020.js +37 -0
- package/dist/index.module.8fad0020.js.map +1 -0
- package/dist/index.module.de76feb2.css +65 -0
- package/dist/index.module.de76feb2.css.map +1 -0
- package/dist/isotopes-column.b5442b4d.js +163 -0
- package/dist/isotopes-column.b5442b4d.js.map +1 -0
- package/dist/layers.946aaa37.js +231 -0
- package/dist/layers.946aaa37.js.map +1 -0
- package/dist/map.e782010f.js +82 -0
- package/dist/map.e782010f.js.map +1 -0
- package/dist/names.ab14789e.js +65 -0
- package/dist/names.ab14789e.js.map +1 -0
- package/dist/providers.abcb2cbe.js +25 -0
- package/dist/providers.abcb2cbe.js.map +1 -0
- package/dist/resolvers.2949c4c0.js +83 -0
- package/dist/resolvers.2949c4c0.js.map +1 -0
- package/dist/section.6f6fc929.js +118 -0
- package/dist/section.6f6fc929.js.map +1 -0
- package/dist/selection-popover.7e008544.js +60 -0
- package/dist/selection-popover.7e008544.js.map +1 -0
- package/dist/selection-popover.module.2732ebc0.css +34 -0
- package/dist/selection-popover.module.2732ebc0.css.map +1 -0
- package/dist/selection-popover.module.fdbfb40e.js +22 -0
- package/dist/selection-popover.module.fdbfb40e.js.map +1 -0
- package/dist/selection.add9f8b0.js +117 -0
- package/dist/selection.add9f8b0.js.map +1 -0
- package/dist/store.c5271371.js +18 -0
- package/dist/store.c5271371.js.map +1 -0
- package/dist/types.ff938b22.js +18 -0
- package/dist/types.ff938b22.js.map +1 -0
- package/dist/unit-details.0c1edd00.js +209 -0
- package/dist/unit-details.0c1edd00.js.map +1 -0
- package/dist/units.5ec6a44c.js +42 -0
- package/dist/units.5ec6a44c.js.map +1 -0
- package/package.json +66 -0
- package/src/age-axis.ts +42 -0
- package/src/carbon-isotopes/column.module.sass +136 -0
- package/src/carbon-isotopes/column.ts +131 -0
- package/src/carbon-isotopes/core.ts +78 -0
- package/src/carbon-isotopes/data-area.ts +96 -0
- package/src/carbon-isotopes/data-provider.ts +19 -0
- package/src/carbon-isotopes/index.ts +3 -0
- package/src/carbon-isotopes/isotopes-column.ts +214 -0
- package/src/column.module.sass +114 -0
- package/src/column.ts +185 -0
- package/src/helpers.ts +133 -0
- package/src/index.ts +7 -0
- package/src/map/animated.ts +78 -0
- package/src/map/index.ts +86 -0
- package/src/map/layers.ts +316 -0
- package/src/providers.ts +34 -0
- package/src/section.ts +129 -0
- package/src/selection-popover.module.sass +27 -0
- package/src/selection-popover.ts +71 -0
- package/src/store.ts +12 -0
- package/src/unit-details/index.module.sass +51 -0
- package/src/unit-details/index.ts +215 -0
- package/src/units/boxes.module.sass +3 -0
- package/src/units/boxes.ts +221 -0
- package/src/units/composite.module.sass +2 -0
- package/src/units/composite.ts +266 -0
- package/src/units/index.ts +36 -0
- package/src/units/names.ts +118 -0
- package/src/units/resolvers.ts +111 -0
- package/src/units/selection.ts +167 -0
- package/src/units/types.ts +26 -0
- package/src/units/units.scss +16 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {Columns as $347c34ac01fb689b$export$f02cc02ad0e0bba3, CurrentColumn as $347c34ac01fb689b$export$b9d912252344e099, MeasurementsLayer as $347c34ac01fb689b$export$2254347cd20e6080, processTopoJSON as $347c34ac01fb689b$export$4ad66a3119e1afaa, ColumnFeatures as $347c34ac01fb689b$export$f177ff57c101017a, ColumnKeyboardNavigation as $347c34ac01fb689b$export$8c41dd563753848, useColumnData as $347c34ac01fb689b$export$6b70218db02fa4ce, ColumnCenters as $347c34ac01fb689b$export$4d8f6e6df85d9012} from "./layers.946aaa37.js";
|
|
2
|
+
import {useRef as $dvC2Q$useRef} from "react";
|
|
3
|
+
import $dvC2Q$macrostrathyper from "@macrostrat/hyper";
|
|
4
|
+
import {Globe as $dvC2Q$Globe, LandLayer as $dvC2Q$LandLayer} from "@macrostrat/svg-map-components";
|
|
5
|
+
import {geoCentroid as $dvC2Q$geoCentroid} from "d3-geo";
|
|
6
|
+
import {useElementSize as $dvC2Q$useElementSize} from "@macrostrat/ui-components";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function $157bdadaa2bcfcf5$export$c4313db718750a5a(props) {
|
|
15
|
+
const { center: center, children: children, style: style, margin: margin, className: className, allowZoom: allowZoom, ...rest } = props;
|
|
16
|
+
let { scale: scale } = props;
|
|
17
|
+
const ref = (0, $dvC2Q$useRef)(null);
|
|
18
|
+
const sz = (0, $dvC2Q$useElementSize)(ref);
|
|
19
|
+
const { width: width, height: height } = sz ?? {
|
|
20
|
+
width: 0,
|
|
21
|
+
height: 0
|
|
22
|
+
};
|
|
23
|
+
if (scale == null) scale = Math.min(width, height) + 2 * margin;
|
|
24
|
+
let zoomScaleExtent = null;
|
|
25
|
+
if (allowZoom) zoomScaleExtent = [
|
|
26
|
+
0.1 * Math.min(width, height),
|
|
27
|
+
2 * Math.max(width, height)
|
|
28
|
+
];
|
|
29
|
+
return (0, $dvC2Q$macrostrathyper)("div.map-area", {
|
|
30
|
+
ref: ref,
|
|
31
|
+
style: style,
|
|
32
|
+
className: className
|
|
33
|
+
}, [
|
|
34
|
+
(0, $dvC2Q$macrostrathyper)((0, $dvC2Q$Globe), {
|
|
35
|
+
width: width,
|
|
36
|
+
height: height,
|
|
37
|
+
margin: margin,
|
|
38
|
+
center: center,
|
|
39
|
+
allowDrag: true,
|
|
40
|
+
allowZoom: allowZoom,
|
|
41
|
+
keepNorthUp: true,
|
|
42
|
+
zoomScaleExtent: zoomScaleExtent,
|
|
43
|
+
...rest,
|
|
44
|
+
scale: scale
|
|
45
|
+
}, [
|
|
46
|
+
(0, $dvC2Q$macrostrathyper)((0, $dvC2Q$LandLayer)),
|
|
47
|
+
children
|
|
48
|
+
])
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
const $157bdadaa2bcfcf5$export$d9144ecbc6b090c5 = (props)=>{
|
|
52
|
+
const { currentColumn: currentColumn, setCurrentColumn: setCurrentColumn, children: children, style: style, margin: margin = 10, scale: scale, className: className, showInProcessColumns: showInProcessColumns = false, ...rest } = props;
|
|
53
|
+
const columnCenter = (0, $dvC2Q$geoCentroid)(currentColumn);
|
|
54
|
+
return (0, $dvC2Q$macrostrathyper)($157bdadaa2bcfcf5$export$c4313db718750a5a, {
|
|
55
|
+
center: columnCenter,
|
|
56
|
+
style: style,
|
|
57
|
+
margin: margin,
|
|
58
|
+
scale: scale,
|
|
59
|
+
className: className
|
|
60
|
+
}, [
|
|
61
|
+
children,
|
|
62
|
+
(0, $dvC2Q$macrostrathyper)((0, $347c34ac01fb689b$export$f02cc02ad0e0bba3), {
|
|
63
|
+
onChange: setCurrentColumn,
|
|
64
|
+
col_id: currentColumn?.properties.col_id,
|
|
65
|
+
...rest
|
|
66
|
+
}),
|
|
67
|
+
(0, $dvC2Q$macrostrathyper).if(showInProcessColumns)((0, $347c34ac01fb689b$export$f02cc02ad0e0bba3), {
|
|
68
|
+
onChange: setCurrentColumn,
|
|
69
|
+
col_id: currentColumn?.properties.col_id,
|
|
70
|
+
status_code: "in process",
|
|
71
|
+
color: "rgba(200,150,150, 0.5)",
|
|
72
|
+
...rest
|
|
73
|
+
}),
|
|
74
|
+
(0, $dvC2Q$macrostrathyper).if(currentColumn != null)((0, $347c34ac01fb689b$export$b9d912252344e099), {
|
|
75
|
+
feature: currentColumn
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
export {$157bdadaa2bcfcf5$export$c4313db718750a5a as ResizableMapFrame, $157bdadaa2bcfcf5$export$d9144ecbc6b090c5 as ColumnNavigatorMap, $347c34ac01fb689b$export$2254347cd20e6080 as MeasurementsLayer, $347c34ac01fb689b$export$4ad66a3119e1afaa as processTopoJSON, $347c34ac01fb689b$export$f177ff57c101017a as ColumnFeatures, $347c34ac01fb689b$export$8c41dd563753848 as ColumnKeyboardNavigation, $347c34ac01fb689b$export$6b70218db02fa4ce as useColumnData, $347c34ac01fb689b$export$f02cc02ad0e0bba3 as Columns, $347c34ac01fb689b$export$4d8f6e6df85d9012 as ColumnCenters, $347c34ac01fb689b$export$b9d912252344e099 as CurrentColumn};
|
|
82
|
+
//# sourceMappingURL=map.e782010f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAOA,SAAS,0CAAkB,KAAK;IAC9B,MAAM,UAAE,MAAM,YAAE,QAAQ,SAAE,KAAK,UAAE,MAAM,aAAE,SAAS,aAAE,SAAS,EAAE,GAAG,MAAM,GACtE;IACF,IAAI,SAAE,KAAK,EAAE,GAAG;IAChB,MAAM,MAAM,CAAA,GAAA,aAAK,EAAE;IACnB,MAAM,KAAK,CAAA,GAAA,qBAAa,EAAE;IAC1B,MAAM,SAAE,KAAK,UAAE,MAAM,EAAE,GAAG,MAAM;QAAE,OAAO;QAAG,QAAQ;IAAE;IACtD,IAAI,SAAS,MACX,QAAQ,KAAK,GAAG,CAAC,OAAO,UAAU,IAAI;IAGxC,IAAI,kBAAkB;IAEtB,IAAI,WACF,kBAAkB;QAChB,MAAM,KAAK,GAAG,CAAC,OAAO;QACtB,IAAI,KAAK,GAAG,CAAC,OAAO;KACrB;IAGH,OAAO,CAAA,GAAA,sBAAA,EAAE,gBAAgB;aAAE;eAAK;mBAAO;IAAU,GAAG;QAClD,CAAA,GAAA,sBAAA,EACE,CAAA,GAAA,YAAI,GACJ;mBACE;oBACA;oBACA;oBACA;YACA,WAAW;uBACX;YACA,aAAa;6BACb;YACA,GAAG,IAAI;mBACP;QACF,GACA;YAAC,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,gBAAQ;YAAI;SAAS;KAE3B;AACH;AAEA,MAAM,4CAAqB,CAAC;IAC1B,MAAM,iBACJ,aAAa,oBACb,gBAAgB,YAChB,QAAQ,SACR,KAAK,UACL,SAAS,WACT,KAAK,aACL,SAAS,wBACT,uBAAuB,OACvB,GAAG,MACJ,GAAG;IAEJ,MAAM,eAAe,CAAA,GAAA,kBAAU,EAAE;IAEjC,OAAO,CAAA,GAAA,sBAAA,EACL,2CACA;QAAE,QAAQ;eAAc;gBAAO;eAAQ;mBAAO;IAAU,GACxD;QACE;QACA,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,yCAAM,GAAG;YACT,UAAU;YACV,QAAQ,eAAe,WAAW;YAClC,GAAG,IAAI;QACT;QACA,CAAA,GAAA,sBAAA,EAAE,EAAE,CAAC,sBAAsB,CAAA,GAAA,yCAAM,GAAG;YAClC,UAAU;YACV,QAAQ,eAAe,WAAW;YAClC,aAAa;YACb,OAAO;YACP,GAAG,IAAI;QACT;QACA,CAAA,GAAA,sBAAA,EAAE,EAAE,CAAC,iBAAiB,MAAM,CAAA,GAAA,yCAAY,GAAG;YAAE,SAAS;QAAc;KACrE;AAEL","sources":["packages/column-views/src/map/index.ts"],"sourcesContent":["import { useRef } from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport { Globe, LandLayer } from \"@macrostrat/svg-map-components\";\nimport { geoCentroid } from \"d3-geo\";\nimport { useElementSize } from \"@macrostrat/ui-components\";\nimport { Columns, CurrentColumn } from \"./layers\";\n\nfunction ResizableMapFrame(props) {\n const { center, children, style, margin, className, allowZoom, ...rest } =\n props;\n let { scale } = props;\n const ref = useRef(null);\n const sz = useElementSize(ref);\n const { width, height } = sz ?? { width: 0, height: 0 };\n if (scale == null) {\n scale = Math.min(width, height) + 2 * margin;\n }\n\n let zoomScaleExtent = null;\n\n if (allowZoom) {\n zoomScaleExtent = [\n 0.1 * Math.min(width, height),\n 2 * Math.max(width, height),\n ];\n }\n\n return h(\"div.map-area\", { ref, style, className }, [\n h(\n Globe,\n {\n width,\n height,\n margin,\n center,\n allowDrag: true,\n allowZoom,\n keepNorthUp: true,\n zoomScaleExtent,\n ...rest,\n scale,\n },\n [h(LandLayer), children]\n ),\n ]);\n}\n\nconst ColumnNavigatorMap = (props) => {\n const {\n currentColumn,\n setCurrentColumn,\n children,\n style,\n margin = 10,\n scale,\n className,\n showInProcessColumns = false,\n ...rest\n } = props;\n\n const columnCenter = geoCentroid(currentColumn);\n\n return h(\n ResizableMapFrame,\n { center: columnCenter, style, margin, scale, className },\n [\n children,\n h(Columns, {\n onChange: setCurrentColumn,\n col_id: currentColumn?.properties.col_id,\n ...rest,\n }),\n h.if(showInProcessColumns)(Columns, {\n onChange: setCurrentColumn,\n col_id: currentColumn?.properties.col_id,\n status_code: \"in process\",\n color: \"rgba(200,150,150, 0.5)\",\n ...rest,\n }),\n h.if(currentColumn != null)(CurrentColumn, { feature: currentColumn }),\n ]\n );\n};\n\nexport * from \"./layers\";\nexport { ColumnNavigatorMap, ResizableMapFrame };\n"],"names":[],"version":3,"file":"map.e782010f.js.map"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {transformAxisType as $faf1eba02aecac6a$export$ab2a19f8a72df19b} from "./types.ff938b22.js";
|
|
2
|
+
import $9nAGB$macrostrathyper from "@macrostrat/hyper";
|
|
3
|
+
import $9nAGB$react, {useContext as $9nAGB$useContext, useCallback as $9nAGB$useCallback} from "react";
|
|
4
|
+
import {ColumnContext as $9nAGB$ColumnContext, NotesColumn as $9nAGB$NotesColumn} from "@macrostrat/column-components";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
function $bc17276da4abb183$export$2f2e65a797f8fc1e(div, opts) {
|
|
11
|
+
const { axisType: axisType } = opts;
|
|
12
|
+
const key = (0, $faf1eba02aecac6a$export$ab2a19f8a72df19b)(axisType);
|
|
13
|
+
return {
|
|
14
|
+
height: div[`b_${key}`],
|
|
15
|
+
top_height: div[`t_${key}`],
|
|
16
|
+
data: div,
|
|
17
|
+
id: div.unit_id
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const $bc17276da4abb183$export$c9757aeb43a67df0 = (div)=>{
|
|
21
|
+
return div.unit_name.replace("Mbr", "Member").replace("Fm", "Formation").replace("Gp", "Group");
|
|
22
|
+
};
|
|
23
|
+
function $bc17276da4abb183$var$UnitDataColumn_(props) {
|
|
24
|
+
const ctx = (0, $9nAGB$useContext)((0, $9nAGB$ColumnContext));
|
|
25
|
+
const { left: left, noteComponent: noteComponent, shouldRenderNote: shouldRenderNote = (note, i)=>true, minimumHeight: minimumHeight = 0, divisions: divisions = ctx?.divisions, ...rest } = props;
|
|
26
|
+
const { scale: scale } = ctx;
|
|
27
|
+
const minimumHeightFilter = (0, $9nAGB$useCallback)((d)=>{
|
|
28
|
+
if (minimumHeight == 0) return true;
|
|
29
|
+
const dy = Math.abs(scale(d.top_height) - scale(d.height));
|
|
30
|
+
return dy > minimumHeight;
|
|
31
|
+
}, [
|
|
32
|
+
scale,
|
|
33
|
+
minimumHeight
|
|
34
|
+
]);
|
|
35
|
+
if (divisions == null) return null;
|
|
36
|
+
const notes = divisions.filter(shouldRenderNote).map((d)=>$bc17276da4abb183$export$2f2e65a797f8fc1e(d, {
|
|
37
|
+
axisType: ctx.axisType
|
|
38
|
+
})).filter(minimumHeightFilter);
|
|
39
|
+
return (0, $9nAGB$macrostrathyper)((0, $9nAGB$NotesColumn), {
|
|
40
|
+
transform: `translate(${left || 0})`,
|
|
41
|
+
editable: false,
|
|
42
|
+
noteComponent: noteComponent,
|
|
43
|
+
notes: notes,
|
|
44
|
+
forceOptions: {
|
|
45
|
+
nodeSpacing: 1
|
|
46
|
+
},
|
|
47
|
+
...rest
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const $bc17276da4abb183$export$6316e673796ccb55 = (0, $9nAGB$react).memo($bc17276da4abb183$var$UnitDataColumn_);
|
|
51
|
+
function $bc17276da4abb183$export$594d19cdd88f8c16(props) {
|
|
52
|
+
const { nameForDivision: nameForDivision = $bc17276da4abb183$export$c9757aeb43a67df0, noteComponent: noteComponent, ...rest } = props;
|
|
53
|
+
const NoteComponent = (props)=>{
|
|
54
|
+
const { note: note } = props;
|
|
55
|
+
return (0, $9nAGB$macrostrathyper)("p.col-note-label", nameForDivision(note.data));
|
|
56
|
+
};
|
|
57
|
+
return (0, $9nAGB$macrostrathyper)($bc17276da4abb183$export$6316e673796ccb55, {
|
|
58
|
+
noteComponent: noteComponent ?? NoteComponent,
|
|
59
|
+
...rest
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export {$bc17276da4abb183$export$2f2e65a797f8fc1e as noteForDivision, $bc17276da4abb183$export$c9757aeb43a67df0 as defaultNameFunction, $bc17276da4abb183$export$6316e673796ccb55 as UnitDataColumn, $bc17276da4abb183$export$594d19cdd88f8c16 as UnitNamesColumn};
|
|
65
|
+
//# sourceMappingURL=names.ab14789e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AA4BA,SAAS,0CACP,GAAU,EACV,IAAkC;IAElC,MAAM,YAAE,QAAQ,EAAE,GAAG;IAErB,MAAM,MAAM,CAAA,GAAA,yCAAgB,EAAE;IAC9B,OAAO;QACL,QAAQ,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC;QACvB,YAAY,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC;QAC3B,MAAM;QACN,IAAI,IAAI,OAAO;IACjB;AACF;AAEA,MAAM,4CAAsB,CAAC;IAC3B,OAAO,IAAI,SAAS,CACjB,OAAO,CAAC,OAAO,UACf,OAAO,CAAC,MAAM,aACd,OAAO,CAAC,MAAM;AACnB;AAEA,SAAS,sCAAgB,KAAoB;IAC3C,MAAM,MAAM,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,oBAAY;IACnC,MAAM,QACJ,IAAI,iBACJ,aAAa,oBACb,mBAAmB,CAAC,MAA8B,IAAc,qBAChE,gBAAgB,cAChB,YAAY,KAAK,WACjB,GAAG,MACJ,GAAG;IAEJ,MAAM,SAAE,KAAK,EAAE,GAAG;IAElB,MAAM,sBAAsB,CAAA,GAAA,kBAAU,EACpC,CAAC;QACC,IAAI,iBAAiB,GAAG,OAAO;QAC/B,MAAM,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM;QACxD,OAAO,KAAK;IACd,GACA;QAAC;QAAO;KAAc;IAGxB,IAAI,aAAa,MAAM,OAAO;IAC9B,MAAM,QAAoB,UACvB,MAAM,CAAC,kBACP,GAAG,CAAC,CAAC,IAAa,0CAAgB,GAAG;YAAE,UAAU,IAAI,QAAQ;QAAC,IAC9D,MAAM,CAAC;IAEV,OAAO,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,kBAAU,GAAG;QACpB,WAAW,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpC,UAAU;uBACV;eACA;QACA,cAAc;YACZ,aAAa;QACf;QACA,GAAG,IAAI;IACT;AACF;AAEA,MAAM,4CAAiB,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC;AAQ3B,SAAS,0CAAgB,KAAqB;IACnD,MAAM,mBACJ,kBAAkB,0DAClB,aAAa,EACb,GAAG,MACJ,GAAG;IAEJ,MAAM,gBAAgB,CAAC;QACrB,MAAM,QAAE,IAAI,EAAE,GAAG;QACjB,OAAO,CAAA,GAAA,sBAAA,EAAE,oBAAoB,gBAAgB,KAAK,IAAI;IACxD;IAEA,OAAO,CAAA,GAAA,sBAAA,EAAE,2CAAgB;QACvB,eAAe,iBAAiB;QAChC,GAAG,IAAI;IACT;AACF","sources":["packages/column-views/src/units/names.ts"],"sourcesContent":["import h from \"@macrostrat/hyper\";\nimport { useContext, useCallback } from \"react\";\nimport {\n ColumnContext,\n ColumnAxisType,\n NotesColumn,\n NotesColumnProps,\n} from \"@macrostrat/column-components\";\nimport type { ColumnDivision } from \"@macrostrat/column-components\";\nimport { IUnit, transformAxisType } from \"./types\";\nimport React from \"react\";\n\ninterface UnitDataProps extends NotesColumnProps {\n left?: number;\n transform?: string;\n noteComponent?: React.ComponentType<any>;\n shouldRenderNote?(div: ColumnDivision | IUnit, index: number): boolean;\n divisions?: IUnit[];\n minimumHeight?: number;\n}\n\ntype UnitNote = {\n height: number;\n top_height: number;\n data: IUnit;\n id: number;\n};\n\nfunction noteForDivision(\n div: IUnit,\n opts: { axisType: ColumnAxisType }\n): UnitNote {\n const { axisType } = opts;\n\n const key = transformAxisType(axisType);\n return {\n height: div[`b_${key}`],\n top_height: div[`t_${key}`],\n data: div,\n id: div.unit_id,\n };\n}\n\nconst defaultNameFunction = (div) => {\n return div.unit_name\n .replace(\"Mbr\", \"Member\")\n .replace(\"Fm\", \"Formation\")\n .replace(\"Gp\", \"Group\");\n};\n\nfunction UnitDataColumn_(props: UnitDataProps) {\n const ctx = useContext(ColumnContext);\n const {\n left,\n noteComponent,\n shouldRenderNote = (note: ColumnDivision | IUnit, i: number) => true,\n minimumHeight = 0,\n divisions = ctx?.divisions,\n ...rest\n } = props;\n\n const { scale } = ctx;\n\n const minimumHeightFilter = useCallback(\n (d) => {\n if (minimumHeight == 0) return true;\n const dy = Math.abs(scale(d.top_height) - scale(d.height));\n return dy > minimumHeight;\n },\n [scale, minimumHeight]\n );\n\n if (divisions == null) return null;\n const notes: UnitNote[] = divisions\n .filter(shouldRenderNote)\n .map((d: IUnit) => noteForDivision(d, { axisType: ctx.axisType }))\n .filter(minimumHeightFilter);\n\n return h(NotesColumn, {\n transform: `translate(${left || 0})`,\n editable: false,\n noteComponent,\n notes,\n forceOptions: {\n nodeSpacing: 1,\n },\n ...rest,\n });\n}\n\nconst UnitDataColumn = React.memo(UnitDataColumn_);\n\ninterface UnitNamesProps extends UnitDataProps {\n nameForDivision?(obj: IUnit): string;\n paddingLeft?: number;\n width: number;\n}\n\nexport function UnitNamesColumn(props: UnitNamesProps) {\n const {\n nameForDivision = defaultNameFunction,\n noteComponent,\n ...rest\n } = props;\n\n const NoteComponent = (props) => {\n const { note } = props;\n return h(\"p.col-note-label\", nameForDivision(note.data));\n };\n\n return h(UnitDataColumn, {\n noteComponent: noteComponent ?? NoteComponent,\n ...rest,\n });\n}\n\nexport type { UnitNamesProps };\nexport { defaultNameFunction, noteForDivision, UnitDataColumn };\n"],"names":[],"version":3,"file":"names.ab14789e.js.map"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import $jRQsC$macrostrathyper from "@macrostrat/hyper";
|
|
2
|
+
import {ColumnProvider as $jRQsC$ColumnProvider, ColumnAxisType as $jRQsC$ColumnAxisType} from "@macrostrat/column-components";
|
|
3
|
+
import {APIProvider as $jRQsC$APIProvider} from "@macrostrat/ui-components";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function $29bf41d89292aad4$export$9e42f9b6e0d67c7d(props) {
|
|
9
|
+
// A column provider specialized the Macrostrat API
|
|
10
|
+
return (0, $jRQsC$macrostrathyper)((0, $jRQsC$ColumnProvider), {
|
|
11
|
+
axisType: (0, $jRQsC$ColumnAxisType).AGE,
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function $29bf41d89292aad4$export$3098013bc6cc316d({ children: children, useDev: useDev = false, baseURL: baseURL }) {
|
|
16
|
+
baseURL ??= useDev ? "https://dev2.macrostrat.org/api/v2" : "https://macrostrat.org/api/v2";
|
|
17
|
+
return (0, $jRQsC$macrostrathyper)((0, $jRQsC$APIProvider), {
|
|
18
|
+
baseURL: baseURL,
|
|
19
|
+
unwrapResponse: (res)=>res.success.data
|
|
20
|
+
}, children);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export {$29bf41d89292aad4$export$9e42f9b6e0d67c7d as MacrostratColumnProvider, $29bf41d89292aad4$export$3098013bc6cc316d as MacrostratAPIProvider};
|
|
25
|
+
//# sourceMappingURL=providers.abcb2cbe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;AAKO,SAAS,0CAAyB,KAAK;IAC5C,mDAAmD;IACnD,OAAO,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,qBAAa,GAAG;QAAE,UAAU,CAAA,GAAA,qBAAa,EAAE,GAAG;QAAE,GAAG,KAAK;IAAC;AACpE;AAQO,SAAS,0CAAsB,YACpC,QAAQ,UACR,SAAS,gBACT,OAAO,EACU;IACjB,YAAY,SACR,uCACA;IAEJ,OAAO,CAAA,GAAA,sBAAA,EACL,CAAA,GAAA,kBAAU,GACV;iBACE;QACA,gBAAgB,CAAC,MAAQ,IAAI,OAAO,CAAC,IAAI;IAC3C,GACA;AAEJ","sources":["packages/column-views/src/providers.ts"],"sourcesContent":["import h from \"@macrostrat/hyper\";\nimport { ColumnProvider, ColumnAxisType } from \"@macrostrat/column-components\";\nimport { APIProvider } from \"@macrostrat/ui-components\";\nimport { ReactNode } from \"react\";\n\nexport function MacrostratColumnProvider(props) {\n // A column provider specialized the Macrostrat API\n return h(ColumnProvider, { axisType: ColumnAxisType.AGE, ...props });\n}\n\ntype APIProviderProps = {\n children: ReactNode;\n useDev?: boolean;\n baseURL?: string;\n};\n\nexport function MacrostratAPIProvider({\n children,\n useDev = false,\n baseURL,\n}: APIProviderProps) {\n baseURL ??= useDev\n ? \"https://dev2.macrostrat.org/api/v2\"\n : \"https://macrostrat.org/api/v2\";\n\n return h(\n APIProvider,\n {\n baseURL,\n unwrapResponse: (res) => res.success.data,\n },\n children\n );\n}\n"],"names":[],"version":3,"file":"providers.abcb2cbe.js.map"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const $d3e69bd163d41f63$var$symbolIndex = {
|
|
2
|
+
"dolomite-limestone": 641,
|
|
3
|
+
lime_mudstone: 627,
|
|
4
|
+
sandstone: 607,
|
|
5
|
+
"quartz arenite": 607,
|
|
6
|
+
litharenite: 608,
|
|
7
|
+
sand: 608,
|
|
8
|
+
siltstone: 616,
|
|
9
|
+
silt: 616,
|
|
10
|
+
"dolomitic siltstone": 616,
|
|
11
|
+
shale: 620,
|
|
12
|
+
limestone: 627,
|
|
13
|
+
dolomite: 642,
|
|
14
|
+
conglomerate: 602,
|
|
15
|
+
carbonate: 627,
|
|
16
|
+
"dolomite-mudstone": 642,
|
|
17
|
+
dolostone: 642,
|
|
18
|
+
mudstone: 620,
|
|
19
|
+
"sandy-dolomite": 645,
|
|
20
|
+
quartzite: 702,
|
|
21
|
+
halite: 668,
|
|
22
|
+
basalt: 717,
|
|
23
|
+
rhyolite: 722,
|
|
24
|
+
andesite: 723,
|
|
25
|
+
till: 681,
|
|
26
|
+
loess: 684,
|
|
27
|
+
"calcareous ooze": 653,
|
|
28
|
+
chalk: 626,
|
|
29
|
+
gravel: 601,
|
|
30
|
+
plutonic: 721,
|
|
31
|
+
granite: 719,
|
|
32
|
+
clay: 660,
|
|
33
|
+
syenite: 722,
|
|
34
|
+
tuff: 711,
|
|
35
|
+
volcanic: 725,
|
|
36
|
+
metamorphic: 707,
|
|
37
|
+
volcaniclastic: 714,
|
|
38
|
+
migmatite: 709,
|
|
39
|
+
gneiss: 708,
|
|
40
|
+
tonalite: 727,
|
|
41
|
+
granodiorite: 725,
|
|
42
|
+
monzonite: 723,
|
|
43
|
+
argillite: 624
|
|
44
|
+
};
|
|
45
|
+
const $d3e69bd163d41f63$export$7be7d732f3de9464 = (d)=>{
|
|
46
|
+
let liths = d.lith;
|
|
47
|
+
let environs = d.environ.map((d)=>d.name).join(" ");
|
|
48
|
+
liths.sort((a, b)=>b.prop - a.prop);
|
|
49
|
+
//console.log(d, d.unit_name, liths.map(d => d.name), environs)
|
|
50
|
+
let sym = null;
|
|
51
|
+
// overrides for IODP columns
|
|
52
|
+
if (d.unit_name == "clay") return "650";
|
|
53
|
+
if (d.unit_name == "calcareous clay") return "651";
|
|
54
|
+
for (const k of liths){
|
|
55
|
+
if (k.name == "sandstone") {
|
|
56
|
+
// Special cases for sandstone
|
|
57
|
+
if (environs.includes("dune")) return "609";
|
|
58
|
+
if (environs.includes("marine")) return "608";
|
|
59
|
+
if (environs.includes("shore")) return "611";
|
|
60
|
+
if (environs.includes("loess")) return "686";
|
|
61
|
+
}
|
|
62
|
+
if (k.name == "conglomerate") {
|
|
63
|
+
// Special cases for sandstone
|
|
64
|
+
if (environs.includes("fluvial")) return "603";
|
|
65
|
+
}
|
|
66
|
+
if (k.name.includes("tuff")) return "711";
|
|
67
|
+
sym = $d3e69bd163d41f63$var$symbolIndex[k.name];
|
|
68
|
+
if (sym != null) return sym;
|
|
69
|
+
if (k.type == "volcanic") return "725";
|
|
70
|
+
}
|
|
71
|
+
return sym;
|
|
72
|
+
};
|
|
73
|
+
const $d3e69bd163d41f63$var$patternScale = {
|
|
74
|
+
"609": 1.5,
|
|
75
|
+
"603": 1.5
|
|
76
|
+
};
|
|
77
|
+
const $d3e69bd163d41f63$export$e8deec7b02ce51eb = (id)=>{
|
|
78
|
+
return $d3e69bd163d41f63$var$patternScale[`${id}`] ?? 1;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
export {$d3e69bd163d41f63$export$7be7d732f3de9464 as resolveID, $d3e69bd163d41f63$export$e8deec7b02ce51eb as scalePattern};
|
|
83
|
+
//# sourceMappingURL=resolvers.2949c4c0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA,MAAM,oCAAc;IAClB,sBAAsB;IACtB,eAAe;IACf,WAAW;IACX,kBAAkB;IAClB,aAAa;IACb,MAAM;IACN,WAAW;IACX,MAAM;IACN,uBAAuB;IACvB,OAAO;IACP,WAAW;IACX,UAAU;IACV,cAAc;IACd,WAAW;IACX,qBAAqB;IACrB,WAAW;IACX,UAAU;IACV,kBAAkB;IAClB,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,mBAAmB;IACnB,OAAO;IACP,QAAQ;IACR,UAAU;IACV,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;IACN,UAAU;IACV,aAAa;IACb,gBAAgB;IAChB,WAAW;IACX,QAAQ;IACR,UAAU;IACV,cAAc;IACd,WAAW;IACX,WAAW;AACb;AAEA,MAAM,4CAAY,CAAC;IACjB,IAAI,QAAQ,EAAE,IAAI;IAClB,IAAI,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAM,EAAE,IAAI,EAAE,IAAI,CAAC;IACjD,MAAM,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,IAAI,GAAG,EAAE,IAAI;IAEpC,+DAA+D;IAE/D,IAAI,MAAM;IAEV,6BAA6B;IAC7B,IAAI,EAAE,SAAS,IAAI,QACjB,OAAO;IAET,IAAI,EAAE,SAAS,IAAI,mBACjB,OAAO;IAGT,KAAK,MAAM,KAAK,MAAO;QACrB,IAAI,EAAE,IAAI,IAAI,aAAa;YACzB,8BAA8B;YAC9B,IAAI,SAAS,QAAQ,CAAC,SACpB,OAAO;YAET,IAAI,SAAS,QAAQ,CAAC,WACpB,OAAO;YAET,IAAI,SAAS,QAAQ,CAAC,UACpB,OAAO;YAET,IAAI,SAAS,QAAQ,CAAC,UACpB,OAAO;QAEX;QAEA,IAAI,EAAE,IAAI,IAAI,gBAAgB;YAC5B,8BAA8B;YAC9B,IAAI,SAAS,QAAQ,CAAC,YACpB,OAAO;QAEX;QAEA,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,SAClB,OAAO;QAET,MAAM,iCAAW,CAAC,EAAE,IAAI,CAAC;QACzB,IAAI,OAAO,MACT,OAAO;QAGT,IAAI,EAAE,IAAI,IAAI,YACZ,OAAO;IAEX;IACA,OAAO;AACT;AAEA,MAAM,qCAAe;IACnB,OAAO;IACP,OAAO;AACT;AAEA,MAAM,4CAAe,CAAC;IACpB,OAAO,kCAAY,CAAC,GAAG,IAAI,CAAC,IAAI;AAClC","sources":["packages/column-views/src/units/resolvers.ts"],"sourcesContent":["const symbolIndex = {\n \"dolomite-limestone\": 641,\n lime_mudstone: 627,\n sandstone: 607,\n \"quartz arenite\": 607,\n litharenite: 608,\n sand: 608,\n siltstone: 616,\n silt: 616,\n \"dolomitic siltstone\": 616,\n shale: 620,\n limestone: 627,\n dolomite: 642,\n conglomerate: 602,\n carbonate: 627,\n \"dolomite-mudstone\": 642,\n dolostone: 642,\n mudstone: 620,\n \"sandy-dolomite\": 645,\n quartzite: 702,\n halite: 668,\n basalt: 717,\n rhyolite: 722,\n andesite: 723,\n till: 681,\n loess: 684,\n \"calcareous ooze\": 653,\n chalk: 626,\n gravel: 601,\n plutonic: 721,\n granite: 719,\n clay: 660,\n syenite: 722,\n tuff: 711,\n volcanic: 725,\n metamorphic: 707,\n volcaniclastic: 714,\n migmatite: 709,\n gneiss: 708,\n tonalite: 727,\n granodiorite: 725,\n monzonite: 723,\n argillite: 624,\n};\n\nconst resolveID = (d: any) => {\n let liths = d.lith;\n let environs = d.environ.map((d) => d.name).join(\" \");\n liths.sort((a, b) => b.prop - a.prop);\n\n //console.log(d, d.unit_name, liths.map(d => d.name), environs)\n\n let sym = null;\n\n // overrides for IODP columns\n if (d.unit_name == \"clay\") {\n return \"650\";\n }\n if (d.unit_name == \"calcareous clay\") {\n return \"651\";\n }\n\n for (const k of liths) {\n if (k.name == \"sandstone\") {\n // Special cases for sandstone\n if (environs.includes(\"dune\")) {\n return \"609\";\n }\n if (environs.includes(\"marine\")) {\n return \"608\";\n }\n if (environs.includes(\"shore\")) {\n return \"611\";\n }\n if (environs.includes(\"loess\")) {\n return \"686\";\n }\n }\n\n if (k.name == \"conglomerate\") {\n // Special cases for sandstone\n if (environs.includes(\"fluvial\")) {\n return \"603\";\n }\n }\n\n if (k.name.includes(\"tuff\")) {\n return \"711\";\n }\n sym = symbolIndex[k.name];\n if (sym != null) {\n return sym;\n }\n\n if (k.type == \"volcanic\") {\n return \"725\";\n }\n }\n return sym;\n};\n\nconst patternScale = {\n \"609\": 1.5,\n \"603\": 1.5,\n};\n\nconst scalePattern = (id) => {\n return patternScale[`${id}`] ?? 1;\n};\n\nexport { resolveID, scalePattern };\n"],"names":[],"version":3,"file":"resolvers.2949c4c0.js.map"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {CompositeUnitsColumn as $8c8238faa5cde49c$export$a6684360fef0406e} from "./composite.494beffc.js";
|
|
2
|
+
import {AgeAxis as $43794af7643cdf40$export$25ce20521d0ab97d} from "./age-axis.7ce58d66.js";
|
|
3
|
+
import {MacrostratColumnProvider as $29bf41d89292aad4$export$9e42f9b6e0d67c7d} from "./providers.abcb2cbe.js";
|
|
4
|
+
import $3m1Sk$columnmodule2e29259cjs from "./column.module.2e29259c.js";
|
|
5
|
+
import "./column.module.c9df6edf.css";
|
|
6
|
+
import {useMemo as $3m1Sk$useMemo} from "react";
|
|
7
|
+
import {Timescale as $3m1Sk$Timescale, TimescaleOrientation as $3m1Sk$TimescaleOrientation} from "@macrostrat/timescale";
|
|
8
|
+
import {ColumnSVG as $3m1Sk$ColumnSVG} from "@macrostrat/column-components";
|
|
9
|
+
import $3m1Sk$macrostrathyper from "@macrostrat/hyper";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const $7d0f52717c0de7e1$var$h = (0, $3m1Sk$macrostrathyper).styled((0, ($parcel$interopDefault($3m1Sk$columnmodule2e29259cjs))));
|
|
24
|
+
function $7d0f52717c0de7e1$export$6e2c8f0811a474ce(props) {
|
|
25
|
+
// Section with "squishy" time scale
|
|
26
|
+
const { data: data, range: _range, pixelScale: _pixelScale, unitComponent: unitComponent, showLabels: showLabels = true, targetUnitHeight: targetUnitHeight = 20, width: width = 300, columnWidth: columnWidth = 150, unitComponentProps: unitComponentProps, showLabelColumn: showLabelColumn = true } = props;
|
|
27
|
+
const b_age = Math.max(...data.map((d)=>d.b_age));
|
|
28
|
+
const t_age = Math.min(...data.map((d)=>d.t_age));
|
|
29
|
+
const range = (0, $3m1Sk$useMemo)(()=>{
|
|
30
|
+
if (_range == null) return [
|
|
31
|
+
b_age,
|
|
32
|
+
t_age
|
|
33
|
+
];
|
|
34
|
+
return _range;
|
|
35
|
+
}, [
|
|
36
|
+
_range,
|
|
37
|
+
b_age,
|
|
38
|
+
t_age
|
|
39
|
+
]);
|
|
40
|
+
const dAge = (0, $3m1Sk$useMemo)(()=>range[0] - range[1], [
|
|
41
|
+
range
|
|
42
|
+
]);
|
|
43
|
+
const pixelScale = (0, $3m1Sk$useMemo)(()=>{
|
|
44
|
+
if (_pixelScale != null) return _pixelScale;
|
|
45
|
+
const targetHeight = targetUnitHeight * data.length;
|
|
46
|
+
return Math.ceil(targetHeight / dAge);
|
|
47
|
+
}, [
|
|
48
|
+
_pixelScale,
|
|
49
|
+
targetUnitHeight,
|
|
50
|
+
data.length,
|
|
51
|
+
dAge
|
|
52
|
+
]);
|
|
53
|
+
const height = (0, $3m1Sk$useMemo)(()=>dAge * pixelScale, [
|
|
54
|
+
dAge,
|
|
55
|
+
pixelScale
|
|
56
|
+
]);
|
|
57
|
+
/** Ensure that we can arrange units into the maximum number
|
|
58
|
+
* of columns defined by unitComponentProps, but that we don't
|
|
59
|
+
* use more than necessary.
|
|
60
|
+
*/ const _unitComponentProps = (0, $3m1Sk$useMemo)(()=>{
|
|
61
|
+
return {
|
|
62
|
+
...unitComponentProps,
|
|
63
|
+
nColumns: Math.min(Math.max(...data.map((d)=>d.column)) + 1, unitComponentProps?.nColumns ?? 2)
|
|
64
|
+
};
|
|
65
|
+
}, [
|
|
66
|
+
data,
|
|
67
|
+
unitComponentProps
|
|
68
|
+
]);
|
|
69
|
+
return $7d0f52717c0de7e1$var$h((0, $29bf41d89292aad4$export$9e42f9b6e0d67c7d), {
|
|
70
|
+
divisions: data,
|
|
71
|
+
range: range,
|
|
72
|
+
pixelsPerMeter: pixelScale
|
|
73
|
+
}, [
|
|
74
|
+
$7d0f52717c0de7e1$var$h((0, $43794af7643cdf40$export$25ce20521d0ab97d), {
|
|
75
|
+
width: 20,
|
|
76
|
+
padding: 0,
|
|
77
|
+
paddingV: 10,
|
|
78
|
+
showLabel: false
|
|
79
|
+
}),
|
|
80
|
+
$7d0f52717c0de7e1$var$h("div.timescale-container", {
|
|
81
|
+
style: {
|
|
82
|
+
marginTop: `10px`
|
|
83
|
+
}
|
|
84
|
+
}, [
|
|
85
|
+
$7d0f52717c0de7e1$var$h((0, $3m1Sk$Timescale), {
|
|
86
|
+
orientation: (0, $3m1Sk$TimescaleOrientation).VERTICAL,
|
|
87
|
+
length: height,
|
|
88
|
+
levels: $7d0f52717c0de7e1$var$timescaleLevels,
|
|
89
|
+
absoluteAgeScale: true,
|
|
90
|
+
showAgeAxis: false,
|
|
91
|
+
ageRange: range
|
|
92
|
+
})
|
|
93
|
+
]),
|
|
94
|
+
$7d0f52717c0de7e1$var$h((0, $3m1Sk$ColumnSVG), {
|
|
95
|
+
innerWidth: showLabels ? width : columnWidth,
|
|
96
|
+
paddingRight: 1,
|
|
97
|
+
paddingLeft: 1,
|
|
98
|
+
paddingV: 10,
|
|
99
|
+
innerHeight: height
|
|
100
|
+
}, $7d0f52717c0de7e1$var$h((0, $8c8238faa5cde49c$export$a6684360fef0406e), {
|
|
101
|
+
showLabelColumn: showLabelColumn,
|
|
102
|
+
width: showLabels ? width : columnWidth,
|
|
103
|
+
columnWidth: columnWidth,
|
|
104
|
+
gutterWidth: 5,
|
|
105
|
+
showLabels: showLabels,
|
|
106
|
+
unitComponent: unitComponent,
|
|
107
|
+
unitComponentProps: _unitComponentProps
|
|
108
|
+
}))
|
|
109
|
+
]);
|
|
110
|
+
}
|
|
111
|
+
const $7d0f52717c0de7e1$var$timescaleLevels = [
|
|
112
|
+
2,
|
|
113
|
+
5
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export {$7d0f52717c0de7e1$export$6e2c8f0811a474ce as Section};
|
|
118
|
+
//# sourceMappingURL=section.6f6fc929.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,wEAAK;AAuBrB,SAAS,0CAAQ,KAAmB;IACzC,oCAAoC;IACpC,MAAM,QACJ,IAAI,EACJ,OAAO,MAAM,EACb,YAAY,WAAW,iBACvB,aAAa,cACb,aAAa,wBACb,mBAAmB,WACnB,QAAQ,kBACR,cAAc,yBACd,kBAAkB,mBAClB,kBAAkB,MACnB,GAAG;IAEJ,MAAM,QAAQ,KAAK,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,IAAM,EAAE,KAAK;IACjD,MAAM,QAAQ,KAAK,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,IAAM,EAAE,KAAK;IAEjD,MAAM,QAAQ,CAAA,GAAA,cAAM,EAAE;QACpB,IAAI,UAAU,MACZ,OAAO;YAAC;YAAO;SAAM;QAEvB,OAAO;IACT,GAAG;QAAC;QAAQ;QAAO;KAAM;IAEzB,MAAM,OAAO,CAAA,GAAA,cAAM,EAAE,IAAM,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,EAAE;QAAC;KAAM;IAEvD,MAAM,aAAa,CAAA,GAAA,cAAM,EAAE;QACzB,IAAI,eAAe,MAAM,OAAO;QAChC,MAAM,eAAe,mBAAmB,KAAK,MAAM;QACnD,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC,GAAG;QAAC;QAAa;QAAkB,KAAK,MAAM;QAAE;KAAK;IAErD,MAAM,SAAS,CAAA,GAAA,cAAM,EAAE,IAAM,OAAO,YAAY;QAAC;QAAM;KAAW;IAElE;;;GAGC,GACD,MAAM,sBAAsB,CAAA,GAAA,cAAM,EAAE;QAClC,OAAO;YACL,GAAG,kBAAkB;YACrB,UAAU,KAAK,GAAG,CAChB,KAAK,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,IAAM,EAAE,MAAM,KAAK,GACzC,oBAAoB,YAAY;QAEpC;IACF,GAAG;QAAC;QAAM;KAAmB;IAE7B,OAAO,wBACL,CAAA,GAAA,yCAAuB,GACvB;QACE,WAAW;eACX;QACA,gBAAgB;IAClB,GACA;QACE,wBAAE,CAAA,GAAA,yCAAM,GAAG;YACT,OAAO;YACP,SAAS;YACT,UAAU;YACV,WAAW;QACb;QACA,wBAAE,2BAA2B;YAAE,OAAO;gBAAE,WAAW,CAAC,IAAI,CAAC;YAAC;QAAE,GAAG;YAC7D,wBAAE,CAAA,GAAA,gBAAQ,GAAG;gBACX,aAAa,CAAA,GAAA,2BAAmB,EAAE,QAAQ;gBAC1C,QAAQ;gBACR,QAAQ;gBACR,kBAAkB;gBAClB,aAAa;gBACb,UAAU;YACZ;SACD;QACD,wBACE,CAAA,GAAA,gBAAQ,GACR;YACE,YAAY,aAAa,QAAQ;YACjC,cAAc;YACd,aAAa;YACb,UAAU;YACV,aAAa;QACf,GACA,wBAAE,CAAA,GAAA,yCAAmB,GAAG;YACtB,iBAAiB;YACjB,OAAO,aAAa,QAAQ;yBAC5B;YACA,aAAa;wBACb;2BACA;YACA,oBAAoB;QACtB;KAEH;AAEL;AAEA,MAAM,wCAAkB;IAAC;IAAG;CAAE","sources":["packages/column-views/src/section.ts"],"sourcesContent":["import { CompositeUnitsColumn, IUnit } from \"./units\";\nimport { ReactNode, useMemo } from \"react\";\nimport { AgeAxis } from \"./age-axis\";\nimport { Timescale, TimescaleOrientation } from \"@macrostrat/timescale\";\nimport { ColumnSVG } from \"@macrostrat/column-components\";\nimport { MacrostratColumnProvider } from \"./index\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./column.module.sass\";\n\nconst h = hyper.styled(styles);\n\nexport interface SectionInfo {\n section_id: number | number[];\n t_age: number;\n b_age: number;\n units: IUnit[];\n}\n\nexport interface IColumnProps {\n data: IUnit[];\n pixelScale?: number;\n range?: [number, number];\n unitComponent?: React.FunctionComponent<any>;\n unitComponentProps?: any;\n showLabels?: boolean;\n width?: number;\n columnWidth?: number;\n targetUnitHeight?: number;\n children?: ReactNode;\n showLabelColumn?: boolean;\n}\n\nexport function Section(props: IColumnProps) {\n // Section with \"squishy\" time scale\n const {\n data,\n range: _range,\n pixelScale: _pixelScale,\n unitComponent,\n showLabels = true,\n targetUnitHeight = 20,\n width = 300,\n columnWidth = 150,\n unitComponentProps,\n showLabelColumn = true,\n } = props;\n\n const b_age = Math.max(...data.map((d) => d.b_age));\n const t_age = Math.min(...data.map((d) => d.t_age));\n\n const range = useMemo(() => {\n if (_range == null) {\n return [b_age, t_age];\n }\n return _range;\n }, [_range, b_age, t_age]);\n\n const dAge = useMemo(() => range[0] - range[1], [range]);\n\n const pixelScale = useMemo(() => {\n if (_pixelScale != null) return _pixelScale;\n const targetHeight = targetUnitHeight * data.length;\n return Math.ceil(targetHeight / dAge);\n }, [_pixelScale, targetUnitHeight, data.length, dAge]);\n\n const height = useMemo(() => dAge * pixelScale, [dAge, pixelScale]);\n\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */\n const _unitComponentProps = useMemo(() => {\n return {\n ...unitComponentProps,\n nColumns: Math.min(\n Math.max(...data.map((d) => d.column)) + 1,\n unitComponentProps?.nColumns ?? 2\n ),\n };\n }, [data, unitComponentProps]);\n\n return h(\n MacrostratColumnProvider,\n {\n divisions: data,\n range,\n pixelsPerMeter: pixelScale, // Actually pixels per myr\n },\n [\n h(AgeAxis, {\n width: 20,\n padding: 0,\n paddingV: 10,\n showLabel: false,\n }),\n h(\"div.timescale-container\", { style: { marginTop: `10px` } }, [\n h(Timescale, {\n orientation: TimescaleOrientation.VERTICAL,\n length: height,\n levels: timescaleLevels as [number, number],\n absoluteAgeScale: true,\n showAgeAxis: false,\n ageRange: range as [number, number],\n }),\n ]),\n h(\n ColumnSVG,\n {\n innerWidth: showLabels ? width : columnWidth,\n paddingRight: 1,\n paddingLeft: 1,\n paddingV: 10,\n innerHeight: height,\n },\n h(CompositeUnitsColumn, {\n showLabelColumn: showLabelColumn,\n width: showLabels ? width : columnWidth,\n columnWidth,\n gutterWidth: 5,\n showLabels,\n unitComponent,\n unitComponentProps: _unitComponentProps,\n })\n ),\n ]\n );\n}\n\nconst timescaleLevels = [2, 5];\n"],"names":[],"version":3,"file":"section.6f6fc929.js.map"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "./selection-popover.module.2732ebc0.css";
|
|
2
|
+
import $5gkYa$selectionpopovermodulefdbfb40ejs from "./selection-popover.module.fdbfb40e.js";
|
|
3
|
+
import {useSelectedUnit as $4d5d1c15f39f6a14$export$f0dd93f90aa8e5da} from "./selection.add9f8b0.js";
|
|
4
|
+
import {UnitDetailsPanel as $5e9557c2513b08ab$export$fbd245232df17557} from "./unit-details.0c1edd00.js";
|
|
5
|
+
import $5gkYa$macrostrathyper from "@macrostrat/hyper";
|
|
6
|
+
import {Popover as $5gkYa$Popover} from "@blueprintjs/core";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const $80d4db83aa9ba807$var$h = (0, $5gkYa$macrostrathyper).styled((0, ($parcel$interopDefault($5gkYa$selectionpopovermodulefdbfb40ejs))));
|
|
18
|
+
function $80d4db83aa9ba807$export$6716aecc2c9afbe2({ style: style, children: children, boundary: boundary }) {
|
|
19
|
+
const content = $80d4db83aa9ba807$var$h($80d4db83aa9ba807$export$9c92b113c87f36f1, children);
|
|
20
|
+
return $80d4db83aa9ba807$var$h("div.popover-main", {
|
|
21
|
+
style: style
|
|
22
|
+
}, $80d4db83aa9ba807$var$h((0, $5gkYa$Popover), // @ts-ignore
|
|
23
|
+
{
|
|
24
|
+
content: content,
|
|
25
|
+
isOpen: true,
|
|
26
|
+
usePortal: false,
|
|
27
|
+
boundary: boundary,
|
|
28
|
+
position: "right"
|
|
29
|
+
}, $80d4db83aa9ba807$var$h("span.popover-target")));
|
|
30
|
+
}
|
|
31
|
+
function $80d4db83aa9ba807$export$9c92b113c87f36f1({ children: children }) {
|
|
32
|
+
return $80d4db83aa9ba807$var$h("div.legend-panel-outer", {
|
|
33
|
+
onClick (e) {
|
|
34
|
+
// Stop events from leaking to the parent
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
}
|
|
37
|
+
}, [
|
|
38
|
+
$80d4db83aa9ba807$var$h("div.legend-info-panel", children)
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
function $80d4db83aa9ba807$export$db1115efab13710d(props) {
|
|
42
|
+
const { position: position } = props;
|
|
43
|
+
const unit = (0, $4d5d1c15f39f6a14$export$f0dd93f90aa8e5da)();
|
|
44
|
+
if (unit == null) return null;
|
|
45
|
+
return $80d4db83aa9ba807$var$h("div.unit-popover-container", $80d4db83aa9ba807$var$h($80d4db83aa9ba807$export$6716aecc2c9afbe2, {
|
|
46
|
+
style: {
|
|
47
|
+
position: "absolute",
|
|
48
|
+
top: position?.y,
|
|
49
|
+
width: position?.width,
|
|
50
|
+
left: position?.x,
|
|
51
|
+
height: position?.height
|
|
52
|
+
}
|
|
53
|
+
}, $80d4db83aa9ba807$var$h((0, $5e9557c2513b08ab$export$fbd245232df17557), {
|
|
54
|
+
unit: unit
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export {$80d4db83aa9ba807$export$6716aecc2c9afbe2 as UnitDetailsPopover, $80d4db83aa9ba807$export$9c92b113c87f36f1 as LegendPopoverContainer, $80d4db83aa9ba807$export$db1115efab13710d as UnitSelectionPopover};
|
|
60
|
+
//# sourceMappingURL=selection-popover.7e008544.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAOA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,kFAAK;AAErB,SAAS,0CAAmB,SACjC,KAAK,YACL,QAAQ,YACR,QAAQ,EAKT;IACC,MAAM,UAAU,wBAAE,2CAAwB;IAE1C,OAAO,wBACL,oBACA;eACE;IACF,GACA,wBACE,CAAA,GAAA,cAAM,GACN,aAAa;IACb;iBAAE;QAAS,QAAQ;QAAM,WAAW;kBAAO;QAAU,UAAU;IAAQ,GACvE,wBAAE;AAGR;AAEO,SAAS,0CAAuB,YAAE,QAAQ,EAAE;IACjD,OAAO,wBACL,0BACA;QACE,SAAQ,CAAC;YACP,yCAAyC;YACzC,EAAE,eAAe;QACnB;IACF,GACA;QAAC,wBAAE,yBAAyB;KAAU;AAE1C;AAEO,SAAS,0CAAqB,KAAK;IACxC,MAAM,YAAE,QAAQ,EAAE,GAAG;IACrB,MAAM,OAAO,CAAA,GAAA,yCAAc;IAC3B,IAAI,QAAQ,MACV,OAAO;IAGT,OAAO,wBACL,8BACA,wBACE,2CACA;QACE,OAAO;YACL,UAAU;YACV,KAAK,UAAU;YACf,OAAO,UAAU;YACjB,MAAM,UAAU;YAChB,QAAQ,UAAU;QACpB;IACF,GACA,wBAAE,CAAA,GAAA,yCAAe,GAAG;cAAE;IAAK;AAGjC","sources":["packages/column-views/src/selection-popover.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport { Button, Popover } from \"@blueprintjs/core\";\nimport { DOMElement } from \"react\";\nimport styles from \"./selection-popover.module.sass\";\nimport { useSelectedUnit } from \"./units\";\nimport { UnitDetailsPanel } from \"./unit-details\";\n\nconst h = hyper.styled(styles);\n\nexport function UnitDetailsPopover({\n style,\n children,\n boundary,\n}: {\n style: object;\n children: React.ReactNode;\n boundary?: DOMElement<any, any>;\n}) {\n const content = h(LegendPopoverContainer, children);\n\n return h(\n \"div.popover-main\",\n {\n style,\n },\n h(\n Popover,\n // @ts-ignore\n { content, isOpen: true, usePortal: false, boundary, position: \"right\" },\n h(\"span.popover-target\")\n )\n );\n}\n\nexport function LegendPopoverContainer({ children }) {\n return h(\n \"div.legend-panel-outer\",\n {\n onClick(e) {\n // Stop events from leaking to the parent\n e.stopPropagation();\n },\n },\n [h(\"div.legend-info-panel\", children)]\n );\n}\n\nexport function UnitSelectionPopover(props) {\n const { position } = props;\n const unit = useSelectedUnit();\n if (unit == null) {\n return null;\n }\n\n return h(\n \"div.unit-popover-container\",\n h(\n UnitDetailsPopover,\n {\n style: {\n position: \"absolute\",\n top: position?.y,\n width: position?.width,\n left: position?.x,\n height: position?.height,\n },\n },\n h(UnitDetailsPanel, { unit })\n )\n );\n}\n"],"names":[],"version":3,"file":"selection-popover.7e008544.js.map"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.e_hMea_popover-main {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
position: absolute;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.e_hMea_popover-main .bp5-overlay {
|
|
7
|
+
pointer-events: all;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.e_hMea_popover-main .bp5-popover-target {
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
outline: 2px solid #f22;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
line-height: 0;
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.e_hMea_legend-panel-outer {
|
|
20
|
+
background-color: var(--panel-background-color);
|
|
21
|
+
width: 25em;
|
|
22
|
+
max-height: 60vh;
|
|
23
|
+
overflow-y: scroll;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.e_hMea_legend-info-panel {
|
|
27
|
+
padding: 1em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.e_hMea_legend-json-view {
|
|
31
|
+
margin-left: -.5em;
|
|
32
|
+
padding-left: 0;
|
|
33
|
+
}
|
|
34
|
+
/*# sourceMappingURL=selection-popover.module.2732ebc0.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAAA;;;;;AAIE;;;;AAGA;;;;;;;;;AAQF;;;;;;;AAMA;;;;AAGA","sources":["packages/column-views/src/selection-popover.module.sass"],"sourcesContent":[".popover-main\n position: absolute\n pointer-events: none\n\n :global(.bp5-overlay)\n pointer-events: all\n\n :global(.bp5-popover-target)\n height: 100%\n width: 100%\n display: block\n line-height: 0\n pointer-events: none\n outline: 2px solid #f22\n\n.legend-panel-outer\n width: 25em\n max-height: 60vh\n overflow-y: scroll\n background-color: var(--panel-background-color)\n\n.legend-info-panel\n padding: 1em\n\n.legend-json-view\n padding-left: 0\n margin-left: -0.5em\n"],"names":[],"version":3,"file":"selection-popover.module.2732ebc0.css.map"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
function $parcel$export(e, n, v, s) {
|
|
3
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
4
|
+
}
|
|
5
|
+
var $0dec71dd06d873d2$exports = {};
|
|
6
|
+
|
|
7
|
+
$parcel$export($0dec71dd06d873d2$exports, "legend-info-panel", () => $0dec71dd06d873d2$export$bf3f08f04957302d, (v) => $0dec71dd06d873d2$export$bf3f08f04957302d = v);
|
|
8
|
+
$parcel$export($0dec71dd06d873d2$exports, "legend-json-view", () => $0dec71dd06d873d2$export$259f01a14528542c, (v) => $0dec71dd06d873d2$export$259f01a14528542c = v);
|
|
9
|
+
$parcel$export($0dec71dd06d873d2$exports, "legend-panel-outer", () => $0dec71dd06d873d2$export$54b6d567a500a54c, (v) => $0dec71dd06d873d2$export$54b6d567a500a54c = v);
|
|
10
|
+
$parcel$export($0dec71dd06d873d2$exports, "popover-main", () => $0dec71dd06d873d2$export$85b6d6914dbd94dc, (v) => $0dec71dd06d873d2$export$85b6d6914dbd94dc = v);
|
|
11
|
+
var $0dec71dd06d873d2$export$bf3f08f04957302d;
|
|
12
|
+
var $0dec71dd06d873d2$export$259f01a14528542c;
|
|
13
|
+
var $0dec71dd06d873d2$export$54b6d567a500a54c;
|
|
14
|
+
var $0dec71dd06d873d2$export$85b6d6914dbd94dc;
|
|
15
|
+
$0dec71dd06d873d2$export$bf3f08f04957302d = `e_hMea_legend-info-panel`;
|
|
16
|
+
$0dec71dd06d873d2$export$259f01a14528542c = `e_hMea_legend-json-view`;
|
|
17
|
+
$0dec71dd06d873d2$export$54b6d567a500a54c = `e_hMea_legend-panel-outer`;
|
|
18
|
+
$0dec71dd06d873d2$export$85b6d6914dbd94dc = `e_hMea_popover-main`;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export {$0dec71dd06d873d2$exports as default};
|
|
22
|
+
//# sourceMappingURL=selection-popover.module.fdbfb40e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAHA,4CAAsC,CAAC,wBAAwB,CAAC;AAChE,4CAAqC,CAAC,uBAAuB,CAAC;AAC9D,4CAAuC,CAAC,yBAAyB,CAAC;AAClE,4CAAiC,CAAC,mBAAmB,CAAC","sources":["packages/column-views/src/selection-popover.module.sass"],"sourcesContent":[".popover-main\n position: absolute\n pointer-events: none\n\n :global(.bp5-overlay)\n pointer-events: all\n\n :global(.bp5-popover-target)\n height: 100%\n width: 100%\n display: block\n line-height: 0\n pointer-events: none\n outline: 2px solid #f22\n\n.legend-panel-outer\n width: 25em\n max-height: 60vh\n overflow-y: scroll\n background-color: var(--panel-background-color)\n\n.legend-info-panel\n padding: 1em\n\n.legend-json-view\n padding-left: 0\n margin-left: -0.5em\n"],"names":[],"version":3,"file":"selection-popover.module.fdbfb40e.js.map"}
|