@macrostrat/column-views 2.4.2 → 2.4.3
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 +4 -0
- package/dist/esm/{column-views.1b5bf0c6.js → column-views.0b3c0d18.js} +5 -2
- package/dist/esm/column-views.0b3c0d18.js.map +1 -0
- package/dist/esm/{column-views.88b2418b.js → column-views.0ed9da35.js} +3 -3
- package/dist/esm/{column-views.88b2418b.js.map → column-views.0ed9da35.js.map} +1 -1
- package/dist/esm/{column-views.82eb5026.js → column-views.0faf79a9.js} +3 -3
- package/dist/esm/{column-views.82eb5026.js.map → column-views.0faf79a9.js.map} +1 -1
- package/dist/esm/{column-views.8ce33ec6.js → column-views.19539293.js} +2 -2
- package/dist/esm/{column-views.8ce33ec6.js.map → column-views.19539293.js.map} +1 -1
- package/dist/esm/{column-views.ce5251f7.js → column-views.1af3ec1f.js} +2 -2
- package/dist/esm/{column-views.ce5251f7.js.map → column-views.1af3ec1f.js.map} +1 -1
- package/dist/esm/{column-views.1ef55568.js → column-views.2a0010a3.js} +3 -3
- package/dist/esm/{column-views.1ef55568.js.map → column-views.2a0010a3.js.map} +1 -1
- package/dist/esm/{column-views.f35c4621.js → column-views.334c3947.js} +2 -2
- package/dist/esm/{column-views.f35c4621.js.map → column-views.334c3947.js.map} +1 -1
- package/dist/esm/{column-views.c93b63db.js → column-views.337b40a2.js} +3 -3
- package/dist/esm/{column-views.c93b63db.js.map → column-views.337b40a2.js.map} +1 -1
- package/dist/esm/{column-views.633c42a3.js → column-views.33d35a44.js} +25 -3
- package/dist/esm/column-views.33d35a44.js.map +1 -0
- package/dist/esm/{column-views.c1e507e6.js → column-views.362aae9a.js} +2 -2
- package/dist/esm/{column-views.c1e507e6.js.map → column-views.362aae9a.js.map} +1 -1
- package/dist/esm/{column-views.083fb787.js → column-views.4252a555.js} +5 -5
- package/dist/esm/{column-views.083fb787.js.map → column-views.4252a555.js.map} +1 -1
- package/dist/esm/{column-views.99cb1c41.js → column-views.45c70ba4.js} +3 -3
- package/dist/esm/{column-views.99cb1c41.js.map → column-views.45c70ba4.js.map} +1 -1
- package/dist/esm/{column-views.40d3688c.js → column-views.47b7d9ca.js} +2 -2
- package/dist/esm/{column-views.40d3688c.js.map → column-views.47b7d9ca.js.map} +1 -1
- package/dist/esm/{column-views.b4e1236d.js → column-views.47ca059d.js} +3 -3
- package/dist/esm/column-views.47ca059d.js.map +1 -0
- package/dist/esm/{column-views.3090f246.js → column-views.636d6553.js} +2 -2
- package/dist/esm/{column-views.3090f246.js.map → column-views.636d6553.js.map} +1 -1
- package/dist/esm/{column-views.a94e99a2.js → column-views.64f6ddd3.js} +2 -2
- package/dist/esm/{column-views.a94e99a2.js.map → column-views.64f6ddd3.js.map} +1 -1
- package/dist/esm/{column-views.88436022.js → column-views.6519a353.js} +2 -2
- package/dist/esm/{column-views.88436022.js.map → column-views.6519a353.js.map} +1 -1
- package/dist/esm/{column-views.18655508.js → column-views.6cff6659.js} +4 -4
- package/dist/esm/{column-views.18655508.js.map → column-views.6cff6659.js.map} +1 -1
- package/dist/esm/{column-views.fedccce9.js → column-views.70387120.js} +2 -2
- package/dist/esm/{column-views.fedccce9.js.map → column-views.70387120.js.map} +1 -1
- package/dist/esm/{column-views.3ae8f23d.js → column-views.74837922.js} +2 -2
- package/dist/esm/{column-views.3ae8f23d.js.map → column-views.74837922.js.map} +1 -1
- package/dist/esm/{column-views.e885211d.js → column-views.7bfb4318.js} +2 -2
- package/dist/esm/{column-views.e885211d.js.map → column-views.7bfb4318.js.map} +1 -1
- package/dist/esm/{column-views.f56e604d.js → column-views.7dc53f1b.js} +4 -4
- package/dist/esm/{column-views.f56e604d.js.map → column-views.7dc53f1b.js.map} +1 -1
- package/dist/esm/{column-views.ab2cc6cb.js → column-views.85df21ec.js} +11 -10
- package/dist/esm/column-views.85df21ec.js.map +1 -0
- package/dist/esm/{column-views.4e9b8594.js → column-views.87c589b7.js} +2 -2
- package/dist/esm/{column-views.4e9b8594.js.map → column-views.87c589b7.js.map} +1 -1
- package/dist/esm/{column-views.77322764.js → column-views.8da2b857.js} +2 -2
- package/dist/esm/{column-views.77322764.js.map → column-views.8da2b857.js.map} +1 -1
- package/dist/esm/{column-views.b957dc19.js → column-views.8fb37de7.js} +2 -2
- package/dist/esm/{column-views.b957dc19.js.map → column-views.8fb37de7.js.map} +1 -1
- package/dist/esm/{column-views.d4e50f74.js → column-views.905ddea0.js} +3 -3
- package/dist/esm/{column-views.d4e50f74.js.map → column-views.905ddea0.js.map} +1 -1
- package/dist/esm/{column-views.91c18fe3.js → column-views.9512c5d5.js} +10 -10
- package/dist/esm/{column-views.91c18fe3.js.map → column-views.9512c5d5.js.map} +1 -1
- package/dist/esm/{column-views.85d57d04.js → column-views.9905b91c.js} +4 -4
- package/dist/esm/{column-views.85d57d04.js.map → column-views.9905b91c.js.map} +1 -1
- package/dist/esm/{column-views.275ba52b.js → column-views.a4f394fe.js} +2 -2
- package/dist/esm/{column-views.275ba52b.js.map → column-views.a4f394fe.js.map} +1 -1
- package/dist/esm/{column-views.dd2d5a6d.js → column-views.b2142cd8.js} +5 -5
- package/dist/esm/{column-views.dd2d5a6d.js.map → column-views.b2142cd8.js.map} +1 -1
- package/dist/esm/{column-views.6f0d4f3a.js → column-views.b7cf0da2.js} +2 -2
- package/dist/esm/{column-views.6f0d4f3a.js.map → column-views.b7cf0da2.js.map} +1 -1
- package/dist/esm/{column-views.af4278f0.js → column-views.b88d4bbe.js} +3 -3
- package/dist/esm/{column-views.af4278f0.js.map → column-views.b88d4bbe.js.map} +1 -1
- package/dist/esm/{column-views.5ec7294d.js → column-views.c750a6df.js} +3 -3
- package/dist/esm/{column-views.5ec7294d.js.map → column-views.c750a6df.js.map} +1 -1
- package/dist/esm/{column-views.fc4860bd.js → column-views.cb1cc9f2.js} +4 -4
- package/dist/esm/{column-views.fc4860bd.js.map → column-views.cb1cc9f2.js.map} +1 -1
- package/dist/esm/{column-views.f904e6d7.js → column-views.ce000969.js} +3 -3
- package/dist/esm/{column-views.f904e6d7.js.map → column-views.ce000969.js.map} +1 -1
- package/dist/esm/{column-views.ee2fd38f.js → column-views.d7740949.js} +3 -3
- package/dist/esm/{column-views.ee2fd38f.js.map → column-views.d7740949.js.map} +1 -1
- package/dist/esm/{column-views.088a0274.js → column-views.d7e6bf67.js} +2 -2
- package/dist/esm/{column-views.088a0274.js.map → column-views.d7e6bf67.js.map} +1 -1
- package/dist/esm/{column-views.e6882667.js → column-views.dac0a3bb.js} +5 -5
- package/dist/esm/{column-views.e6882667.js.map → column-views.dac0a3bb.js.map} +1 -1
- package/dist/esm/{column-views.11353c2c.js → column-views.e13a0a76.js} +4 -4
- package/dist/esm/{column-views.11353c2c.js.map → column-views.e13a0a76.js.map} +1 -1
- package/dist/esm/{column-views.5e830e7c.js → column-views.ea08f667.js} +8 -8
- package/dist/esm/{column-views.5e830e7c.js.map → column-views.ea08f667.js.map} +1 -1
- package/dist/esm/{column-views.bc83a85d.js → column-views.fe42d2fc.js} +2 -2
- package/dist/esm/{column-views.bc83a85d.js.map → column-views.fe42d2fc.js.map} +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/node/column-views.048fdcaf.js +2 -0
- package/dist/node/column-views.048fdcaf.js.map +1 -0
- package/dist/node/{column-views.796fc1de.js → column-views.04a72b35.js} +2 -2
- package/dist/node/{column-views.796fc1de.js.map → column-views.04a72b35.js.map} +1 -1
- package/dist/node/{column-views.94c8ce3e.js → column-views.0619e2da.js} +2 -2
- package/dist/node/{column-views.94c8ce3e.js.map → column-views.0619e2da.js.map} +1 -1
- package/dist/node/{column-views.66663668.js → column-views.0af5912d.js} +2 -2
- package/dist/node/{column-views.66663668.js.map → column-views.0af5912d.js.map} +1 -1
- package/dist/node/{column-views.eecdc727.js → column-views.0d254fd3.js} +2 -2
- package/dist/node/{column-views.eecdc727.js.map → column-views.0d254fd3.js.map} +1 -1
- package/dist/node/{column-views.54f7a243.js → column-views.109cb0c8.js} +2 -2
- package/dist/node/{column-views.54f7a243.js.map → column-views.109cb0c8.js.map} +1 -1
- package/dist/node/{column-views.f4063bc8.js → column-views.15b5cecc.js} +2 -2
- package/dist/node/{column-views.f4063bc8.js.map → column-views.15b5cecc.js.map} +1 -1
- package/dist/node/{column-views.6f0cb059.js → column-views.183745c0.js} +2 -2
- package/dist/node/{column-views.6f0cb059.js.map → column-views.183745c0.js.map} +1 -1
- package/dist/node/{column-views.080781ca.js → column-views.2e2158f5.js} +2 -2
- package/dist/node/{column-views.080781ca.js.map → column-views.2e2158f5.js.map} +1 -1
- package/dist/node/{column-views.f93b4175.js → column-views.306acd3f.js} +2 -2
- package/dist/node/{column-views.f93b4175.js.map → column-views.306acd3f.js.map} +1 -1
- package/dist/node/{column-views.0818254f.js → column-views.31153f29.js} +2 -2
- package/dist/node/{column-views.0818254f.js.map → column-views.31153f29.js.map} +1 -1
- package/dist/node/{column-views.6051e986.js → column-views.31da008b.js} +2 -2
- package/dist/node/{column-views.6051e986.js.map → column-views.31da008b.js.map} +1 -1
- package/dist/node/column-views.40e758b3.js +2 -0
- package/dist/node/column-views.40e758b3.js.map +1 -0
- package/dist/node/{column-views.ffbffec7.js → column-views.4a28d695.js} +2 -2
- package/dist/node/{column-views.ffbffec7.js.map → column-views.4a28d695.js.map} +1 -1
- package/dist/node/{column-views.d30231cb.js → column-views.5987bc26.js} +2 -2
- package/dist/node/{column-views.d30231cb.js.map → column-views.5987bc26.js.map} +1 -1
- package/dist/node/{column-views.784bac2a.js → column-views.5bb858c9.js} +2 -2
- package/dist/node/{column-views.784bac2a.js.map → column-views.5bb858c9.js.map} +1 -1
- package/dist/node/{column-views.fe7a5452.js → column-views.5cbada24.js} +2 -2
- package/dist/node/{column-views.fe7a5452.js.map → column-views.5cbada24.js.map} +1 -1
- package/dist/node/{column-views.8c00beb4.js → column-views.5fcd2be6.js} +2 -2
- package/dist/node/{column-views.8c00beb4.js.map → column-views.5fcd2be6.js.map} +1 -1
- package/dist/node/{column-views.bdf05ed4.js → column-views.78b2d234.js} +2 -2
- package/dist/node/{column-views.bdf05ed4.js.map → column-views.78b2d234.js.map} +1 -1
- package/dist/node/{column-views.5908556a.js → column-views.8bee789c.js} +2 -2
- package/dist/node/{column-views.5908556a.js.map → column-views.8bee789c.js.map} +1 -1
- package/dist/node/{column-views.18e86c2d.js → column-views.90c36c0b.js} +2 -2
- package/dist/node/{column-views.18e86c2d.js.map → column-views.90c36c0b.js.map} +1 -1
- package/dist/node/{column-views.87d31e0a.js → column-views.a2476e39.js} +2 -2
- package/dist/node/{column-views.87d31e0a.js.map → column-views.a2476e39.js.map} +1 -1
- package/dist/node/{column-views.39b71a38.js → column-views.a8f5ee28.js} +2 -2
- package/dist/node/{column-views.39b71a38.js.map → column-views.a8f5ee28.js.map} +1 -1
- package/dist/node/{column-views.5f3f8ccf.js → column-views.ad60c02f.js} +2 -2
- package/dist/node/{column-views.5f3f8ccf.js.map → column-views.ad60c02f.js.map} +1 -1
- package/dist/node/{column-views.72c3c6e7.js → column-views.add5e42b.js} +2 -2
- package/dist/node/{column-views.72c3c6e7.js.map → column-views.add5e42b.js.map} +1 -1
- package/dist/node/{column-views.4d8fc443.js → column-views.aff55599.js} +2 -2
- package/dist/node/{column-views.4d8fc443.js.map → column-views.aff55599.js.map} +1 -1
- package/dist/node/{column-views.4d573ded.js → column-views.b2e5f823.js} +2 -2
- package/dist/node/{column-views.4d573ded.js.map → column-views.b2e5f823.js.map} +1 -1
- package/dist/node/{column-views.64fc40d6.js → column-views.b57e5e6e.js} +2 -2
- package/dist/node/{column-views.64fc40d6.js.map → column-views.b57e5e6e.js.map} +1 -1
- package/dist/node/{column-views.a596b1f5.js → column-views.ba9108fe.js} +2 -2
- package/dist/node/column-views.ba9108fe.js.map +1 -0
- package/dist/node/{column-views.b6613ab0.js → column-views.c16a19fb.js} +2 -2
- package/dist/node/{column-views.b6613ab0.js.map → column-views.c16a19fb.js.map} +1 -1
- package/dist/node/{column-views.74fcfb9c.js → column-views.c3097d9a.js} +2 -2
- package/dist/node/{column-views.74fcfb9c.js.map → column-views.c3097d9a.js.map} +1 -1
- package/dist/node/{column-views.fa5ee6de.js → column-views.c4c15e2b.js} +2 -2
- package/dist/node/{column-views.fa5ee6de.js.map → column-views.c4c15e2b.js.map} +1 -1
- package/dist/node/{column-views.58b336f1.js → column-views.c651b684.js} +2 -2
- package/dist/node/{column-views.58b336f1.js.map → column-views.c651b684.js.map} +1 -1
- package/dist/node/{column-views.447008d0.js → column-views.cf41a6d7.js} +2 -2
- package/dist/node/{column-views.447008d0.js.map → column-views.cf41a6d7.js.map} +1 -1
- package/dist/node/{column-views.5fd6e11a.js → column-views.d22bf15c.js} +2 -2
- package/dist/node/{column-views.5fd6e11a.js.map → column-views.d22bf15c.js.map} +1 -1
- package/dist/node/{column-views.5c02450b.js → column-views.d737de1e.js} +2 -2
- package/dist/node/{column-views.5c02450b.js.map → column-views.d737de1e.js.map} +1 -1
- package/dist/node/{column-views.0d48f51d.js → column-views.da902c44.js} +2 -2
- package/dist/node/{column-views.0d48f51d.js.map → column-views.da902c44.js.map} +1 -1
- package/dist/node/{column-views.003e0c17.js → column-views.e0e20136.js} +2 -2
- package/dist/node/{column-views.003e0c17.js.map → column-views.e0e20136.js.map} +1 -1
- package/dist/node/{column-views.7e895e1a.js → column-views.ec0087a2.js} +2 -2
- package/dist/node/{column-views.7e895e1a.js.map → column-views.ec0087a2.js.map} +1 -1
- package/dist/node/{column-views.375529b1.js → column-views.f2e82230.js} +2 -2
- package/dist/node/{column-views.375529b1.js.map → column-views.f2e82230.js.map} +1 -1
- package/dist/node/{column-views.d86e6c7d.js → column-views.fb3ed7cc.js} +2 -2
- package/dist/node/{column-views.d86e6c7d.js.map → column-views.fb3ed7cc.js.map} +1 -1
- package/dist/node/column-views.fcb243a2.js +2 -0
- package/dist/node/column-views.fcb243a2.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
- package/src/correlation-chart/stories/correlation-chart.stories.ts +1 -24
- package/src/correlation-chart/stories/utils.ts +24 -0
- package/src/maps/_shared/styles.ts +12 -2
- package/src/maps/column-navigation/mapbox/index.ts +1 -0
- package/src/prepare-units/composite-scale.ts +9 -1
- package/src/prepare-units/helpers.ts +2 -2
- package/src/unit-details/panel.ts +15 -7
- package/dist/esm/column-views.1b5bf0c6.js.map +0 -1
- package/dist/esm/column-views.633c42a3.js.map +0 -1
- package/dist/esm/column-views.ab2cc6cb.js.map +0 -1
- package/dist/esm/column-views.b4e1236d.js.map +0 -1
- package/dist/node/column-views.021a6961.js +0 -2
- package/dist/node/column-views.021a6961.js.map +0 -1
- package/dist/node/column-views.139b0855.js +0 -2
- package/dist/node/column-views.139b0855.js.map +0 -1
- package/dist/node/column-views.5e73411d.js +0 -2
- package/dist/node/column-views.5e73411d.js.map +0 -1
- package/dist/node/column-views.a596b1f5.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format
|
|
|
4
4
|
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
|
|
5
5
|
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [2.4.3] - 2026-01-06
|
|
8
|
+
|
|
9
|
+
- Fix error with unit notes for height-based columns
|
|
10
|
+
|
|
7
11
|
## [2.4.2] - 2025-12-19
|
|
8
12
|
|
|
9
13
|
Update minimum versions of dependencies
|
|
@@ -216,7 +216,10 @@ function $728f6cf6c12cd490$export$3ada7641926a616d(sections, interpolateUnconfor
|
|
|
216
216
|
const scale = (age)=>{
|
|
217
217
|
for (const s of scales){
|
|
218
218
|
const domain = s.domain();
|
|
219
|
-
if (age >= domain[0] && age <= domain[domain.length - 1])
|
|
219
|
+
if (domain[0] < domain[domain.length - 1] && age >= domain[0] && age <= domain[domain.length - 1]) // Age axes
|
|
220
|
+
return s(age);
|
|
221
|
+
else if (age <= domain[0] && age >= domain[domain.length - 1]) // Normal axes like height
|
|
222
|
+
return s(age);
|
|
220
223
|
}
|
|
221
224
|
return null;
|
|
222
225
|
};
|
|
@@ -316,4 +319,4 @@ function $728f6cf6c12cd490$export$edbf01b435c75274(sections, threshold, opts) {
|
|
|
316
319
|
|
|
317
320
|
|
|
318
321
|
export {$728f6cf6c12cd490$export$e7184dd8bb3302ed as buildCompositeScaleInfo, $728f6cf6c12cd490$export$d6235b492bceb8c5 as createPackageScale, $728f6cf6c12cd490$export$67442a0f5bef147b as finalizeSectionHeights, $728f6cf6c12cd490$export$7d3f3129a1a4b84e as computeSectionHeights, $728f6cf6c12cd490$export$3ada7641926a616d as createCompositeScale, $728f6cf6c12cd490$export$edbf01b435c75274 as collapseUnconformitiesByPixelHeight};
|
|
319
|
-
//# sourceMappingURL=column-views.
|
|
322
|
+
//# sourceMappingURL=column-views.0b3c0d18.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAkBO,SAAS,0CACd,WAA+B,EAC/B,kBAA0B;IAE1B;;GAEC,GAED,IAAI,cAAc,qBAAqB;IACvC,IAAI,uBAAuB;IAE3B,MAAM,YAAsC,EAAE;IAC9C,KAAK,MAAM,SAAS,YAAa;QAC/B,MAAM,UAAE,MAAM,SAAE,KAAK,EAAE,GAAG;QAC1B,MAAM,CAAC,OAAO,MAAM,GAAG;QACvB,MAAM,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,OAAO;QAEvC,UAAU,IAAI,CAAC;YACb,GAAG,0CAAmB,OAAO,YAAY;iBACzC;YACA,QAAQ;YACR,oDAAoD;YACpD,YAAY,cAAc;QAC5B;QAEA,MAAM,cAAc,KAAK,GAAG,CAAC,MAAM,SAAS,MAAM;QAClD,uBAAuB,cAAc;QACrC,cAAc,uBAAuB;IACvC;IACA,eAAe,qBAAqB;IACpC,OAAO;qBACL;QACA,UAAU;IACZ;AACF;AAEO,SAAS,0CACd,QAAmC,EACnC,kBAA0B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CAAC;YACjB,iBAAiB;QACnB;IACF;IACA,IAAI,kBAAkB,MACpB,YAAY,IAAI,CAAC;IAGnB,OAAO;AACT","sources":["packages/column-views/src/prepare-units/composite-scale.ts"],"sourcesContent":["import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { ensureArray, getUnitHeightRange } from \"./utils\";\nimport { ScaleContinuousNumeric, scaleLinear } from \"d3-scale\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { buildHybridScale } from \"./dynamic-scales\";\nimport { ExtUnit, HybridScaleType, SectionInfo } from \"./types\";\nimport type {\n ColumnScaleOptions,\n CompositeColumnData,\n CompositeScaleData,\n PackageLayoutData,\n PackageScaleInfo,\n PackageScaleLayoutData,\n SectionScaleOptions,\n} from \"./types\";\n\n// Composite scale information augmented with units in each package\n\nexport function buildCompositeScaleInfo(\n inputScales: PackageScaleInfo[],\n unconformityHeight: number,\n): CompositeScaleData {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n let totalHeight = unconformityHeight / 2;\n let lastSectionTopHeight = 0;\n\n const packages2: PackageScaleLayoutData[] = [];\n for (const group of inputScales) {\n const { domain, scale } = group;\n const [b_age, t_age] = domain;\n const key = `package-${b_age}-${t_age}`;\n\n packages2.push({\n ...createPackageScale(group, totalHeight),\n key,\n offset: totalHeight,\n // Unconformity height above this particular section\n paddingTop: totalHeight - lastSectionTopHeight,\n });\n\n const pixelHeight = Math.abs(scale(b_age) - scale(t_age));\n lastSectionTopHeight = totalHeight + pixelHeight;\n totalHeight = lastSectionTopHeight + unconformityHeight;\n }\n totalHeight += unconformityHeight / 2;\n return {\n totalHeight,\n sections: packages2,\n };\n}\n\nexport function finalizeSectionHeights<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n unconformityHeight: number,\n): CompositeColumnData<T> {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n const sectionScales = sections.map((d) => d.scaleInfo);\n\n const { totalHeight, sections: packages } = buildCompositeScaleInfo(\n sectionScales,\n unconformityHeight,\n );\n\n // This could perhaps be simplified.\n const sections1: PackageLayoutData<T>[] = [];\n for (const i in sections) {\n const group = sections[i];\n const scaleInfo = packages[i];\n sections1.push({\n ...group,\n key: scaleInfo.key,\n scaleInfo,\n });\n }\n return {\n totalHeight,\n sections: sections1,\n };\n}\n\nexport interface SectionInfoWithScale<\n T extends UnitLong = ExtUnit,\n> extends SectionInfo<T> {\n scaleInfo: PackageScaleInfo;\n}\n\nexport function computeSectionHeights<T extends UnitLong>(\n sections: SectionInfo<T>[],\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n return sections.map((group) => {\n return addScaleToSection<T>(group, opts);\n });\n}\n\nfunction addScaleToSection<T extends UnitLong = ExtUnit>(\n group: SectionInfo<T>,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T> {\n const { t_age, b_age, t_pos, b_pos, units } = group;\n let _range = null;\n // if t_age and b_age are set for a group, use them to define the range...\n if (opts.axisType == ColumnAxisType.AGE) {\n _range = [b_age, t_age];\n } else {\n _range = [b_pos, t_pos];\n }\n\n const scaleInfo = buildSectionScale<T>(units, {\n ...opts,\n domain: _range,\n });\n\n return {\n ...group,\n scaleInfo,\n };\n}\n\nfunction buildSectionScale<T extends UnitLong>(\n data: T[],\n opts: SectionScaleOptions,\n): PackageScaleInfo {\n const {\n targetUnitHeight = 20,\n minPixelScale = 0.2,\n axisType,\n minSectionHeight,\n scale,\n hybridScale,\n } = opts;\n const domain = opts.domain ?? findSectionHeightRange(data, axisType);\n\n const dAge = Math.abs(domain[0] - domain[1]);\n\n let _pixelScale = opts.pixelScale;\n let pixelHeight: number;\n\n if (hybridScale != null) {\n /** In an equidistant surfaces scale, we want to determine the heights of surfaces\n * and then distribute units evenly between them.\n * This is somewhat like an ordinal scale\n */\n if (hybridScale.type === HybridScaleType.EquidistantSurfaces) {\n _pixelScale ??= targetUnitHeight;\n }\n\n return buildHybridScale(hybridScale, data, domain, {\n pixelOffset: 0,\n pixelScale: _pixelScale,\n });\n }\n\n if (scale == null) {\n if (_pixelScale == null) {\n const avgAgeRange = findAverageUnitHeight(data, axisType);\n // Get pixel height necessary to render average unit at target height\n _pixelScale = Math.max(targetUnitHeight / avgAgeRange, minPixelScale);\n\n // OLD METHOD that cares about overall section height vs. individual unit height\n // 0.2 pixel per myr is the floor scale\n //const targetHeight = targetUnitHeight * data.length;\n // 1 pixel per myr is the floor scale\n //_pixelScale = Math.max(targetHeight / dAge, minPixelScale);\n }\n\n let height = dAge * _pixelScale;\n // If height is less than minSectionHeight, set it to minSectionHeight\n const _minSectionHeight = minSectionHeight ?? targetUnitHeight ?? 0;\n pixelHeight = Math.max(height, _minSectionHeight);\n _pixelScale = pixelHeight / dAge;\n } else {\n // If a scale is provided, use it to compute pixel height\n pixelHeight = Math.abs(scale(domain[0]) - scale(domain[1]));\n }\n\n return createPackageScale(\n { scale, domain, pixelHeight, pixelScale: _pixelScale },\n 0,\n );\n}\n\nexport function createPackageScale(\n def: PackageScaleInfo,\n offset: number = 0,\n): PackageScaleInfo {\n /** Build a section scale */\n // Domain should be oriented from bottom to top, but scale is oriented from top to bottom\n const { domain, pixelScale, pixelHeight, scale, heightScale } = def;\n\n if (scale == null && pixelScale == null) {\n throw new Error(\"Either scale or pixelScale must be provided\");\n }\n\n let _scale: ScaleContinuousNumeric<number, number>;\n if (scale == null) {\n _scale = scaleLinear()\n .domain([domain[1], domain[0]])\n .range([offset, pixelHeight + offset]);\n } else {\n const domain0 = scale.domain();\n const range0 = scale.range();\n _scale = scale\n .copy()\n .domain(domain0)\n .range(range0.map((d) => d + offset));\n }\n\n _scale.clamp();\n\n let _heightScale = null;\n if (heightScale != null) {\n // Adjust height scale as well\n const range0 = scale.range();\n _heightScale = heightScale.copy().range(range0.map((d) => d + offset));\n _heightScale.clamp();\n }\n\n return {\n domain,\n pixelScale,\n pixelHeight,\n scale: _scale,\n // Internal details for hybrid scales. TODO: improve this\n heightScale: _heightScale,\n };\n}\n\nfunction findSectionHeightRange(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): [number, number] {\n if (axisType == null) {\n throw new Error(\"Axis type is not set\");\n }\n if (axisType === ColumnAxisType.AGE) {\n const t_age = Math.min(...data.map((d) => d.t_age));\n const b_age = Math.max(...data.map((d) => d.b_age));\n return [b_age, t_age];\n } else if (\n axisType == ColumnAxisType.DEPTH ||\n axisType == ColumnAxisType.ORDINAL\n ) {\n const t_pos = Math.min(...data.map((d) => d.t_pos));\n const b_pos = Math.max(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n } else if (axisType == ColumnAxisType.HEIGHT) {\n const t_pos = Math.max(...data.map((d) => d.t_pos));\n const b_pos = Math.min(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n }\n}\n\nfunction findAverageUnitHeight(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): number {\n const unitHeights = data.map((d) => {\n const [b_pos, t_pos] = getUnitHeightRange(d, axisType);\n return Math.abs(b_pos - t_pos);\n });\n return unitHeights.reduce((a, b) => a + b, 0) / unitHeights.length;\n}\n\nexport interface CompositeColumnScale {\n (age: number): number | null;\n copy(): CompositeColumnScale;\n domain(): [number, number];\n invert(pixelHeight: number): number | null;\n clamp(clamp: boolean): void;\n}\n\nexport function createCompositeScale(\n sections: PackageLayoutData[],\n interpolateUnconformities: boolean = false,\n): CompositeColumnScale {\n /** Create a scale that works across multiple packages */\n\n const scales: ScaleContinuousNumeric<number, number>[] = [];\n\n let lastScale: ScaleContinuousNumeric<number, number> | null = null;\n for (const section of sections) {\n const _scale = section.scaleInfo.scale.copy().clamp(true);\n scales.push(_scale);\n if (lastScale != null && interpolateUnconformities) {\n // Add a new scale that interpolates between lastScale and _scale\n const lastDomain = lastScale.domain();\n const lastRange = lastScale.range();\n const currentDomain = _scale.domain();\n const currentRange = _scale.range();\n\n const interpScale = scaleLinear()\n .domain([lastDomain[lastDomain.length - 1], currentDomain[0]])\n .range([lastRange[lastRange.length - 1], currentRange[0]])\n .clamp(true);\n scales.push(interpScale);\n }\n lastScale = _scale;\n }\n\n const scale: CompositeColumnScale = (age) => {\n for (const s of scales) {\n const domain = s.domain();\n if (\n domain[0] < domain[domain.length - 1] &&\n age >= domain[0] &&\n age <= domain[domain.length - 1]\n ) {\n // Age axes\n return s(age);\n } else if (age <= domain[0] && age >= domain[domain.length - 1]) {\n // Normal axes like height\n return s(age);\n }\n }\n return null;\n };\n\n scale.copy = () => {\n return createCompositeScale(sections, interpolateUnconformities);\n };\n\n scale.domain = () => {\n /** Return the domain of the scale */\n const vals = sections.flatMap((d) => d.scaleInfo.domain);\n if (vals[0] < vals[vals.length - 1]) {\n // age axes\n return [Math.min(...vals), Math.max(...vals)];\n }\n // Normal axes like height\n return [Math.max(...vals), Math.min(...vals)];\n };\n\n scale.invert = (pixelHeight) => {\n /** Invert the scale to get the age at a given pixel height */\n // Iterate through the sections to find the correct one\n for (const scale of scales) {\n const range = scale.range();\n if (\n pixelHeight > Math.min(...range) &&\n pixelHeight <= Math.max(...range)\n ) {\n console.log(\"Inverting scale at pixel height\", pixelHeight);\n return scale.invert(pixelHeight);\n }\n }\n return null;\n };\n\n scale.clamp = (clamp: boolean) => {\n /** Clamp all constituent scales */\n for (const s of scales) {\n s.clamp(clamp);\n }\n };\n\n return scale;\n}\n\n/** Collapse sections separated by unconformities that are smaller than a given pixel height. */\nexport function collapseUnconformitiesByPixelHeight<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n threshold: number,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n const newSections = [];\n let currentSection: SectionInfoWithScale<T> | null = null;\n for (const nextSection of sections) {\n if (currentSection == null) {\n currentSection = nextSection;\n continue;\n }\n let heights: [number, number];\n let pxHeights: [number, number];\n if (opts.axisType !== ColumnAxisType.AGE) {\n heights = [nextSection.t_pos, currentSection.b_pos];\n } else {\n heights = [nextSection.t_age, currentSection.b_age];\n }\n\n const _diff = (vals: number[]) => {\n return Math.abs(vals[0] - vals[1]);\n };\n\n pxHeights = [\n _diff(heights.map(nextSection.scaleInfo.scale)),\n _diff(heights.map(currentSection.scaleInfo.scale)),\n ];\n\n const pxHeight = Math.min(...pxHeights);\n\n if (pxHeight < threshold) {\n let t_pos: number;\n let b_pos: number;\n if (\n opts.axisType == ColumnAxisType.AGE ||\n opts.axisType == ColumnAxisType.DEPTH\n ) {\n t_pos = Math.min(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.max(currentSection.b_pos, nextSection.b_pos);\n } else {\n t_pos = Math.max(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.min(currentSection.b_pos, nextSection.b_pos);\n }\n\n // We need to merge the sections\n const compositeSection0: SectionInfo<T> = {\n units: [...currentSection.units, ...nextSection.units],\n section_id: [\n ...ensureArray(currentSection.section_id),\n ...ensureArray(nextSection.section_id),\n ],\n t_age: Math.min(currentSection.t_age, nextSection.t_age),\n b_age: Math.max(currentSection.b_age, nextSection.b_age),\n t_pos,\n b_pos,\n };\n\n currentSection = addScaleToSection(compositeSection0, opts);\n } else {\n // We need to keep the section\n newSections.push(currentSection);\n currentSection = nextSection;\n }\n }\n if (currentSection != null) {\n newSections.push(currentSection);\n }\n\n return newSections;\n}\n"],"names":[],"version":3,"file":"column-views.0b3c0d18.js.map"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./column-views.321af3ae.css";
|
|
2
2
|
import $lfxOo$columnviews22ec902bjs from "./column-views.22ec902b.js";
|
|
3
|
-
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d} from "./column-views.
|
|
4
|
-
import {AgeLabel as $448b24baeef3b229$export$37ebfd237811b1eb} from "./column-views.
|
|
3
|
+
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d} from "./column-views.362aae9a.js";
|
|
4
|
+
import {AgeLabel as $448b24baeef3b229$export$37ebfd237811b1eb} from "./column-views.85df21ec.js";
|
|
5
5
|
import $lfxOo$macrostrathyper from "@macrostrat/hyper";
|
|
6
6
|
import {ColumnContext as $lfxOo$ColumnContext, ColumnAxis as $lfxOo$ColumnAxis, ColumnAxisType as $lfxOo$ColumnAxisType, SVG as $lfxOo$SVG, AgeAxis as $lfxOo$AgeAxis} from "@macrostrat/column-components";
|
|
7
7
|
import {useContext as $lfxOo$useContext} from "react";
|
|
@@ -138,4 +138,4 @@ function $43794af7643cdf40$export$20d84abfcfa68dfa({ age: age }) {
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
export {$43794af7643cdf40$export$64204d5cbb3e8227 as VerticalAxisLabel, $43794af7643cdf40$export$40b6b0e4520eeb34 as CompositeAgeAxis, $43794af7643cdf40$export$ac30ca3cf5df959d as CompositeAgeAxisCore, $43794af7643cdf40$export$82731b9607850ca6 as ApproximateHeightAxis, $43794af7643cdf40$export$20d84abfcfa68dfa as AgeCursor};
|
|
141
|
-
//# sourceMappingURL=column-views.
|
|
141
|
+
//# sourceMappingURL=column-views.0ed9da35.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,uEAAK;AAE5B,MAAM,oCAAc,CAAC,SAAE,KAAK,eAAE,cAAc,gBAAI,aAAa,OAAO;IAClE,MAAM,eAAE,WAAW,EAAE,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,oBAAY;IAC/C,iCAAiC;IACjC,IAAI,IAAI,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,cAAc,cAAc;IAExD,OAAO,wBAAE,UAAU;QAAE,WAAW;IAAkB,GAAG;QACnD,wBAAE,CAAA,GAAA,iBAAS,GAAG;YACZ,OAAO;wBACP;QACF;KACD;AACH;AAEO,SAAS,0CAAkB,KAAK;IACrC,MAAM,SAAE,QAAQ,aAAO,OAAO,iBAAM,SAAS,UAAE,MAAM,EAAE,GAA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Y,CAAA,GAAA,qBAAa,EAAE,KAAK,EAAE;QACpC,aAAa;QACb,YAAY;IACd,OAAO,IAAI,YAAY,CAAA,GAAA,qBAAa,EAAE,MAAM,EAAE;QAC5C,aAAa;QACb,YAAY;IACd;IAEA,OAAO,wBAAE,0BAA0B,MAAM;QACvC,wBAAE,2CAAmB;YACnB,OAAO;YACP,MAAM;YACN,QAAQ;QACV;QACA,wBACE,CAAA,GAAA,UAAE,GACF;YACE,WAAW;YACX,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC;gBAAE,QAAQ,GAAG,YAAY,EAAE,CAAC;YAAC;YACnD,OAAO;YACP,QAAQ;QACV,GACA,SAAS,GAAG,CAAC,CAAC,OAAO;YACnB,MAAM,OAAE,GAAG,SAAE,KAAK,EAAE,GAAG;YAEvB,OAAO,wBAAE,CAAA,GAAA,cAAM,GAAG;qBAChB;gBACA,WAAW;uBACX;gBACA,eAAe;YACjB;QACF;KAEH;AACH;AAEO,SAAS,0CAAU,OAAE,GAAG,EAAE;IAC/B,qEAAqE,GACrE,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAC9B,MAAM,WAAW,MAAM;IAEvB,IAAI,OAAO,QAAQ,YAAY,MAC7B,OAAO;IAGT,OAAO,wBACL,kBACA;QACE,OAAO;YACL,KAAK;QACP;IACF,GACA;QAAC,wBAAE;QAAa,wBAAE,CAAA,GAAA,yCAAO,GAAG;iBAAE;YAAK,WAAW;QAAQ;KAAG;AAE7D","sources":["packages/column-views/src/age-axis.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport {\n SVG,\n ColumnAxis,\n ColumnContext,\n ColumnAxisType,\n AgeAxis,\n} from \"@macrostrat/column-components\";\nimport { useContext } from \"react\";\nimport styles from \"./age-axis.module.sass\";\nimport { useCompositeScale, useMacrostratColumnData } from \"./data-provider\";\nimport { Parenthetical } from \"@macrostrat/data-components\";\nimport { AgeLabel } from \"./unit-details\";\nimport { PackageScaleLayoutData } from \"./prepare-units\";\n\nconst h = hyper.styled(styles);\n\nconst AgeAxisCore = ({ ticks, tickSpacing = 40, showDomain = false }) => {\n const { pixelHeight } = useContext(ColumnContext);\n // A tick roughly every 40 pixels\n let v = Math.max(Math.round(pixelHeight / tickSpacing), 1);\n\n return h(\"g.axis\", { transform: \"translate(20 0)\" }, [\n h(ColumnAxis, {\n ticks: v,\n showDomain,\n }),\n ]);\n};\n\nexport function VerticalAxisLabel(props) {\n const { label = \"Age\", unit = \"Ma\", className, height } = props;\n return h(\n \"div.column-axis-label.age-axis-label\",\n { className, style: { height } },\n [\n label,\n \" \",\n h.if(unit)(Parenthetical, { className: \"age-axis-unit\" }, unit),\n ],\n );\n}\n\ninterface CompositeAgeAxisProps {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function CompositeAgeAxis(rest: CompositeAgeAxisProps) {\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n return {\n key: `section-${section.section_id}`,\n ...section.scaleInfo,\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport function ApproximateHeightAxis(rest: CompositeAgeAxisProps) {\n /** Axis to show approximate height based on dynamic column scales */\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n const { scaleInfo } = section;\n if (scaleInfo.heightScale == null) {\n throw new Error(\"No height scale available for section\");\n }\n return {\n key: `section-${section.section_id}`,\n ...scaleInfo,\n scale: scaleInfo.heightScale, // Use height scale instead of age scale\n // This only works with dynamic columns\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n axisLabel: \"Approx. height\",\n axisUnit: \"m\",\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport interface CompositeStratigraphicScaleInfo extends CompositeAgeAxisProps {\n axisType: ColumnAxisType;\n axisLabel?: string;\n axisUnit?: string;\n totalHeight: number;\n packages: PackageScaleLayoutData[];\n}\n\nexport function CompositeAgeAxisCore(props: CompositeStratigraphicScaleInfo) {\n const { axisType, axisLabel, axisUnit, totalHeight, packages, ...rest } =\n props;\n\n if (axisType == ColumnAxisType.ORDINAL) {\n return null;\n }\n\n let _axisLabel: string = axisLabel ?? \"Age\";\n let _axisUnit = axisUnit ?? \"Ma\";\n if (axisType == ColumnAxisType.DEPTH) {\n _axisLabel = \"Depth\";\n _axisUnit = \"m\";\n } else if (axisType == ColumnAxisType.HEIGHT) {\n _axisLabel = \"Height\";\n _axisUnit = \"m\";\n }\n\n return h(\"div.composite-age-axis\", rest, [\n h(VerticalAxisLabel, {\n label: _axisLabel,\n unit: _axisUnit,\n height: totalHeight,\n }),\n h(\n SVG,\n {\n className: \"age-axis-column\",\n style: { width: `22px`, height: `${totalHeight}px` },\n width: 22,\n height: totalHeight,\n },\n packages.map((group, i) => {\n const { key, scale } = group;\n\n return h(AgeAxis, {\n key,\n className: \"age-axis\",\n scale,\n tickSizeOuter: 3,\n });\n }),\n ),\n ]);\n}\n\nexport function AgeCursor({ age }) {\n /** A cursor that shows the age at a specific point on the age axis. */\n const scale = useCompositeScale();\n const heightPx = scale(age);\n\n if (age == null || heightPx == null) {\n return null;\n }\n\n return h(\n \"div.age-cursor\",\n {\n style: {\n top: heightPx,\n },\n },\n [h(\"div.line\"), h(AgeLabel, { age, className: \"label\" })],\n );\n}\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,uEAAK;AAE5B,MAAM,oCAAc,CAAC,SAAE,KAAK,eAAE,cAAc,gBAAI,aAAa,OAAO;IAClE,MAAM,eAAE,WAAW,EAAE,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,oBAAY;IAC/C,iCAAiC;IACjC,IAAI,IAAI,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,cAAc,cAAc;IAExD,OAAO,wBAAE,UAAU;QAAE,WAAW;IAAkB,G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AE,WAAW,YAAE,QAAQ,EAAE,GAAG,MAAM,GACrE;IAEF,IAAI,YAAY,CAAA,GAAA,qBAAa,EAAE,OAAO,EACpC,OAAO;IAGT,IAAI,aAAqB,aAAa;IACtC,IAAI,YAAY,YAAY;IAC5B,IAAI,YAAY,CAAA,GAAA,qBAAa,EAAE,KAAK,EAAE;QACpC,aAAa;QACb,YAAY;IACd,OAAO,IAAI,YAAY,CAAA,GAAA,qBAAa,EAAE,MAAM,EAAE;QAC5C,aAAa;QACb,YAAY;IACd;IAEA,OAAO,wBAAE,0BAA0B,MAAM;QACvC,wBAAE,2CAAmB;YACnB,OAAO;YACP,MAAM;YACN,QAAQ;QACV;QACA,wBACE,CAAA,GAAA,UAAE,GACF;YACE,WAAW;YACX,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC;gBAAE,QAAQ,GAAG,YAAY,EAAE,CAAC;YAAC;YACnD,OAAO;YACP,QAAQ;QACV,GACA,SAAS,GAAG,CAAC,CAAC,OAAO;YACnB,MAAM,OAAE,GAAG,SAAE,KAAK,EAAE,GAAG;YAEvB,OAAO,wBAAE,CAAA,GAAA,cAAM,GAAG;qBAChB;gBACA,WAAW;uBACX;gBACA,eAAe;YACjB;QACF;KAEH;AACH;AAEO,SAAS,0CAAU,OAAE,GAAG,EAAE;IAC/B,qEAAqE,GACrE,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAC9B,MAAM,WAAW,MAAM;IAEvB,IAAI,OAAO,QAAQ,YAAY,MAC7B,OAAO;IAGT,OAAO,wBACL,kBACA;QACE,OAAO;YACL,KAAK;QACP;IACF,GACA;QAAC,wBAAE;QAAa,wBAAE,CAAA,GAAA,yCAAO,GAAG;iBAAE;YAAK,WAAW;QAAQ;KAAG;AAE7D","sources":["packages/column-views/src/age-axis.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport {\n SVG,\n ColumnAxis,\n ColumnContext,\n ColumnAxisType,\n AgeAxis,\n} from \"@macrostrat/column-components\";\nimport { useContext } from \"react\";\nimport styles from \"./age-axis.module.sass\";\nimport { useCompositeScale, useMacrostratColumnData } from \"./data-provider\";\nimport { Parenthetical } from \"@macrostrat/data-components\";\nimport { AgeLabel } from \"./unit-details\";\nimport { PackageScaleLayoutData } from \"./prepare-units\";\n\nconst h = hyper.styled(styles);\n\nconst AgeAxisCore = ({ ticks, tickSpacing = 40, showDomain = false }) => {\n const { pixelHeight } = useContext(ColumnContext);\n // A tick roughly every 40 pixels\n let v = Math.max(Math.round(pixelHeight / tickSpacing), 1);\n\n return h(\"g.axis\", { transform: \"translate(20 0)\" }, [\n h(ColumnAxis, {\n ticks: v,\n showDomain,\n }),\n ]);\n};\n\nexport function VerticalAxisLabel(props) {\n const { label = \"Age\", unit = \"Ma\", className, height } = props;\n return h(\n \"div.column-axis-label.age-axis-label\",\n { className, style: { height } },\n [\n label,\n \" \",\n h.if(unit)(Parenthetical, { className: \"age-axis-unit\" }, unit),\n ],\n );\n}\n\ninterface CompositeAgeAxisProps {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function CompositeAgeAxis(rest: CompositeAgeAxisProps) {\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n return {\n key: `section-${section.section_id}`,\n ...section.scaleInfo,\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport function ApproximateHeightAxis(rest: CompositeAgeAxisProps) {\n /** Axis to show approximate height based on dynamic column scales */\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n const { scaleInfo } = section;\n if (scaleInfo.heightScale == null) {\n throw new Error(\"No height scale available for section\");\n }\n return {\n key: `section-${section.section_id}`,\n ...scaleInfo,\n scale: scaleInfo.heightScale, // Use height scale instead of age scale\n // This only works with dynamic columns\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n axisLabel: \"Approx. height\",\n axisUnit: \"m\",\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport interface CompositeStratigraphicScaleInfo extends CompositeAgeAxisProps {\n axisType: ColumnAxisType;\n axisLabel?: string;\n axisUnit?: string;\n totalHeight: number;\n packages: PackageScaleLayoutData[];\n}\n\nexport function CompositeAgeAxisCore(props: CompositeStratigraphicScaleInfo) {\n const { axisType, axisLabel, axisUnit, totalHeight, packages, ...rest } =\n props;\n\n if (axisType == ColumnAxisType.ORDINAL) {\n return null;\n }\n\n let _axisLabel: string = axisLabel ?? \"Age\";\n let _axisUnit = axisUnit ?? \"Ma\";\n if (axisType == ColumnAxisType.DEPTH) {\n _axisLabel = \"Depth\";\n _axisUnit = \"m\";\n } else if (axisType == ColumnAxisType.HEIGHT) {\n _axisLabel = \"Height\";\n _axisUnit = \"m\";\n }\n\n return h(\"div.composite-age-axis\", rest, [\n h(VerticalAxisLabel, {\n label: _axisLabel,\n unit: _axisUnit,\n height: totalHeight,\n }),\n h(\n SVG,\n {\n className: \"age-axis-column\",\n style: { width: `22px`, height: `${totalHeight}px` },\n width: 22,\n height: totalHeight,\n },\n packages.map((group, i) => {\n const { key, scale } = group;\n\n return h(AgeAxis, {\n key,\n className: \"age-axis\",\n scale,\n tickSizeOuter: 3,\n });\n }),\n ),\n ]);\n}\n\nexport function AgeCursor({ age }) {\n /** A cursor that shows the age at a specific point on the age axis. */\n const scale = useCompositeScale();\n const heightPx = scale(age);\n\n if (age == null || heightPx == null) {\n return null;\n }\n\n return h(\n \"div.age-cursor\",\n {\n style: {\n top: heightPx,\n },\n },\n [h(\"div.line\"), h(AgeLabel, { age, className: \"label\" })],\n );\n}\n"],"names":[],"version":3,"file":"column-views.0ed9da35.js.map"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {getSectionAgeRange as $663a0cdd08b02256$export$8093438ec3e4c6fd, getSectionPosRange as $663a0cdd08b02256$export$483b05c497fd70c6, groupUnitsIntoSectionsByOverlap as $663a0cdd08b02256$export$bb26cdbde9c8c08b, groupUnitsIntoSectionsBySectionID as $663a0cdd08b02256$export$eeade20e3eee4638, mergeOverlappingSections as $663a0cdd08b02256$export$e7bb744b9be37f3d, preprocessSectionUnit as $663a0cdd08b02256$export$47e05aac3f0b77d4, preprocessUnits as $663a0cdd08b02256$export$55543e159517d62d} from "./column-views.
|
|
2
|
-
import {collapseUnconformitiesByPixelHeight as $728f6cf6c12cd490$export$edbf01b435c75274, computeSectionHeights as $728f6cf6c12cd490$export$7d3f3129a1a4b84e, finalizeSectionHeights as $728f6cf6c12cd490$export$67442a0f5bef147b} from "./column-views.
|
|
1
|
+
import {getSectionAgeRange as $663a0cdd08b02256$export$8093438ec3e4c6fd, getSectionPosRange as $663a0cdd08b02256$export$483b05c497fd70c6, groupUnitsIntoSectionsByOverlap as $663a0cdd08b02256$export$bb26cdbde9c8c08b, groupUnitsIntoSectionsBySectionID as $663a0cdd08b02256$export$eeade20e3eee4638, mergeOverlappingSections as $663a0cdd08b02256$export$e7bb744b9be37f3d, preprocessSectionUnit as $663a0cdd08b02256$export$47e05aac3f0b77d4, preprocessUnits as $663a0cdd08b02256$export$55543e159517d62d} from "./column-views.47ca059d.js";
|
|
2
|
+
import {collapseUnconformitiesByPixelHeight as $728f6cf6c12cd490$export$edbf01b435c75274, computeSectionHeights as $728f6cf6c12cd490$export$7d3f3129a1a4b84e, finalizeSectionHeights as $728f6cf6c12cd490$export$67442a0f5bef147b} from "./column-views.0b3c0d18.js";
|
|
3
3
|
import {MergeSectionsMode as $b6657fba8924a702$export$e1644389ce074058, agesOverlap as $b6657fba8924a702$export$d92a67740c050efb, unitsOverlap as $b6657fba8924a702$export$f1a15f539858307, getUnitHeightRange as $b6657fba8924a702$export$70e712e2ac0237a, getPositionWithinUnit as $b6657fba8924a702$export$441710fb21b4ae09, createUnitSorter as $b6657fba8924a702$export$ab14c04795685c55, ensureArray as $b6657fba8924a702$export$d0c8ecbd4ed8940c, ensureRealFloat as $b6657fba8924a702$export$97de5b0a6b4e4dac} from "./column-views.052498a6.js";
|
|
4
4
|
import {HybridScaleType as $1254c5929638d7f9$export$45e8e2d7a1794c23, HeightMethod as $1254c5929638d7f9$export$e40aae6f0de9bb95} from "./column-views.079119f4.js";
|
|
5
5
|
import {ColumnAxisType as $iaXiN$ColumnAxisType} from "@macrostrat/column-components";
|
|
@@ -139,4 +139,4 @@ function $76e92a964ee11b97$export$be8c5a449df4bde4(units, options) {
|
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
export {$76e92a964ee11b97$export$206a0cb85295e433 as usePreparedColumnUnits, $76e92a964ee11b97$export$be8c5a449df4bde4 as prepareColumnUnits, $663a0cdd08b02256$export$55543e159517d62d as preprocessUnits, $b6657fba8924a702$export$e1644389ce074058 as MergeSectionsMode, $b6657fba8924a702$export$f1a15f539858307 as unitsOverlap, $b6657fba8924a702$export$70e712e2ac0237a as getUnitHeightRange, $b6657fba8924a702$export$d92a67740c050efb as agesOverlap, $b6657fba8924a702$export$441710fb21b4ae09 as getPositionWithinUnit, $b6657fba8924a702$export$ab14c04795685c55 as createUnitSorter, $b6657fba8924a702$export$d0c8ecbd4ed8940c as ensureArray, $b6657fba8924a702$export$97de5b0a6b4e4dac as ensureRealFloat, $1254c5929638d7f9$export$45e8e2d7a1794c23 as HybridScaleType, $1254c5929638d7f9$export$e40aae6f0de9bb95 as HeightMethod};
|
|
142
|
-
//# sourceMappingURL=column-views.
|
|
142
|
+
//# sourceMappingURL=column-views.0faf79a9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAgCO,SAAS,0CACd,IAAgB,EAChB,OAA6B;IAE7B;;GAEC,GACD,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,OAAO,0CAAmB,MAAM;IAClC,GAAG;QAAC;WAAS,OAAO,MAAM,CAAC;KAAS;AACtC;AAEO,SAAS,0CACd,KAAiB,EACjB,OAA6B;IAE7B,wDAAwD,GAExD,IAAI,SAAE,KAAK,SAAE,KAAK,SAAE,KAAK,SAAE,KAAK,EAAE,GAAG;IAErC,MA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CAAA,GAAA,yCAAoB,EAAE,UAAU;IAEzD,IAAI,+BAA+B,eAAe,MAAM;QACtD,sDAAsD;QACtD,gEAAgE;QAChE,IAAI,YAAY,sBAAsB;QACtC,IAAI,OAAO,+BAA+B,UACxC,YAAY;QAGd,qBAAqB,CAAA,GAAA,yCAAkC,EACrD,oBACA,WACA;IAEJ;IAEA;;KAEG,GACH,IAAI,eAAE,WAAW,EAAE,UAAU,SAAS,EAAE,GAAG,CAAA,GAAA,yCAAqB,EAC9D,oBACA;IAGF;;;KAGG,GACH,MAAM,cAAc,UAAU,GAAG,CAAC,CAAC;QACjC,OAAO;YACL,GAAG,OAAO;YACV,OAAO,CAAA,GAAA,yCAAc,EAAE,SAAS;QAClC;IACF;IAEA;;;GAGC,GACD,MAAM,SAAS,YAAY,MAAM,CAAC,CAAC,KAAK;QACtC,MAAM,SAAE,KAAK,EAAE,GAAG;QAClB,KAAK,MAAM,QAAQ,MACjB,IAAI,IAAI,CAAC;QAEX,OAAO;IACT,GAAG,EAAE;IAEL,OAAO;QACL,OAAO;QACP,aAAa,gBAAgB;QAC7B,UAAU;IACZ;AACF","sources":["packages/column-views/src/prepare-units/index.ts"],"sourcesContent":["import {\n getSectionAgeRange,\n getSectionPosRange,\n groupUnitsIntoSectionsByOverlap,\n groupUnitsIntoSectionsBySectionID,\n mergeOverlappingSections,\n preprocessSectionUnit,\n preprocessUnits,\n} from \"./helpers\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { useMemo } from \"react\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport {\n collapseUnconformitiesByPixelHeight,\n computeSectionHeights,\n finalizeSectionHeights,\n type CompositeColumnScale,\n} from \"./composite-scale\";\nimport {\n agesOverlap,\n MergeSectionsMode,\n PrepareColumnOptions,\n PreparedColumnData,\n unitsOverlap,\n} from \"./utils\";\nimport { SectionInfo } from \"./types\";\n\nexport * from \"./utils\";\nexport * from \"./types\";\nexport { preprocessUnits };\nexport type { CompositeColumnScale };\n\nexport function usePreparedColumnUnits(\n data: UnitLong[],\n options: PrepareColumnOptions,\n): PreparedColumnData {\n /** This function wraps and memoizes all preparation steps for converting\n * an array of units from the /units route to a form ready for usage.\n */\n return useMemo(() => {\n return prepareColumnUnits(data, options);\n }, [data, ...Object.values(options)]);\n}\n\nexport function prepareColumnUnits(\n units: UnitLong[],\n options: PrepareColumnOptions,\n): PreparedColumnData {\n /** Prepare units for rendering into Macrostrat columns */\n\n let { t_age, b_age, t_pos, b_pos } = options;\n\n const {\n mergeSections = MergeSectionsMode.OVERLAPPING,\n axisType,\n unconformityHeight,\n collapseSmallUnconformities = false,\n hybridScale,\n scale,\n } = options;\n\n let _totalHeight = null;\n\n if (scale != null) {\n // Set t_age and b_age based on scale domain if not already set\n const domain = scale.domain();\n if (axisType == ColumnAxisType.AGE) {\n if (t_age == null) t_age = Math.min(...domain);\n if (b_age == null) b_age = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_age) - scale(t_age));\n } else {\n if (t_pos == null) t_pos = Math.min(...domain);\n if (b_pos == null) b_pos = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_pos) - scale(t_pos));\n }\n }\n\n // Start by ensuring that ages and positions are numbers\n // also set up some values for eODP-style columns\n let units1 = units.map(preprocessSectionUnit);\n\n /** Prototype filtering to age range */\n units1 = units1.filter((d) => {\n // Filter units by t_age and b_age, inclusive\n if (axisType == ColumnAxisType.AGE) {\n return agesOverlap(d, { t_age, b_age });\n } else {\n return unitsOverlap(d, { t_pos, b_pos } as any, axisType);\n }\n });\n\n let mergeMode = mergeSections;\n // if (axisType != ColumnAxisType.AGE) {\n // // For non-age columns, we always merge sections.\n // // This is because the \"groupUnitsIntoSections\" function is not well-defined\n // // for non-age columns.\n // mergeMode = MergeSectionsMode.ALL;\n // }\n\n let sections0: SectionInfo<UnitLong>[];\n if (mergeMode == MergeSectionsMode.ALL) {\n // For the \"merge sections\" mode, we need to create a single section\n const [b_unit_pos, t_unit_pos] = getSectionPosRange(units1, axisType);\n const [b_unit_age, t_unit_age] = getSectionAgeRange(units1);\n sections0 = [\n {\n section_id: 0,\n /**\n * If ages limits are directly specified, use them to define the section bounds.\n * */\n t_pos: t_unit_pos,\n b_pos: b_unit_pos,\n t_age: t_unit_age,\n b_age: b_unit_age,\n units: units1,\n },\n ];\n } else if (axisType == ColumnAxisType.AGE) {\n sections0 = groupUnitsIntoSectionsBySectionID(units1, axisType);\n } else {\n sections0 = groupUnitsIntoSectionsByOverlap(units1, axisType);\n }\n\n // Limit sections to the range specified by t_age/b_age or t_pos/b_pos global options\n for (let section of sections0) {\n if (axisType == ColumnAxisType.AGE) {\n section.t_age = Math.max(section.t_age, t_age ?? -Infinity);\n section.b_age = Math.min(section.b_age, b_age ?? Infinity);\n } else if (axisType == ColumnAxisType.DEPTH) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n } else if (axisType == ColumnAxisType.HEIGHT) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n }\n }\n\n /** Merging overlapping sections really only makes sense for age/height/depth\n * columns. Ordinal columns are numbered by section so merging them\n * results in collisions.\n */\n let sections = sections0;\n if (\n mergeSections == MergeSectionsMode.OVERLAPPING &&\n axisType == ColumnAxisType.AGE\n ) {\n sections = mergeOverlappingSections(sections);\n }\n // Filter out undefined sections just in case\n sections = sections.filter((d) => d != null);\n\n // SCALES\n\n /* Compute pixel scales etc. for sections\n * We need to do this now to determine which unconformities\n * are small enough to collapse.\n */\n let sectionsWithScales = computeSectionHeights(sections, options);\n\n if (collapseSmallUnconformities && hybridScale == null) {\n // Collapse small unconformities in pixel height space\n // TODO: this doesn't seem to work properly for non-age columns?\n let threshold = unconformityHeight ?? 30;\n if (typeof collapseSmallUnconformities == \"number\") {\n threshold = collapseSmallUnconformities;\n }\n\n sectionsWithScales = collapseUnconformitiesByPixelHeight(\n sectionsWithScales,\n threshold,\n options,\n );\n }\n\n /** Prepare section scale information using groups.\n * Total height is computed from section scales.\n * */\n let { totalHeight, sections: sections2 } = finalizeSectionHeights(\n sectionsWithScales,\n unconformityHeight,\n );\n\n /** For each section, find units that are overlapping.\n * We do this after merging sections so that we can\n * handle cases where there are overlapping units across sections\n * */\n const sectionsOut = sections2.map((section) => {\n return {\n ...section,\n units: preprocessUnits(section, axisType),\n };\n });\n\n /** Reconstitute the units so that they are sorted by section and properly enhanced.\n * This is mostly important so that unit keyboard navigation\n * predictably selects adjacent units.\n */\n const units2 = sectionsOut.reduce((acc, group) => {\n const { units } = group;\n for (const unit of units) {\n acc.push(unit);\n }\n return acc;\n }, []);\n\n return {\n units: units2,\n totalHeight: _totalHeight ?? totalHeight,\n sections: sectionsOut,\n };\n}\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAgCO,SAAS,0CACd,IAAgB,EAChB,OAA6B;IAE7B;;GAEC,GACD,OAAO,CAAA,GAAA,cAAM,EAAE;QACb,OAAO,0CAAmB,MAAM;IAClC,GAAG;QAAC;WAAS,OAAO,MAAM,CAAC;KAAS;AACtC;AAEO,SAAS,0CACd,KAAiB,EACjB,OAA6B;IAE7B,wDAAwD,GAExD,IAAI,SAAE,KAAK,SAAE,KAAK,SAAE,KAAK,SAAE,KAAK,EAAE,GAAG;IAErC,MAAM,iBACJ,gBAAgB,CAAA,GAAA,yCAAgB,EAAE,WAAW,YAC7C,QAAQ,sBACR,kBAAkB,+BAClB,8BAA8B,oBAC9B,WAAW,SACX,KAAK,EACN,GAAG;IAEJ,IAAI,eAAe;IAEnB,IAAI,SAAS,MAAM;QACjB,+DAA+D;QAC/D,MAAM,SAAS,MAAM,MAAM;QAC3B,IAAI,YAAY,CAAA,GAAA,qBAAa,EAAE,GAAG,EAAE;YAClC,IAAI,SAAS,MAAM,QAAQ,KAAK,GAAG,IAAI;YACvC,IAAI,SAAS,MAAM,QAAQ,KAAK,GAAG,IAAI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jC,OAAO;YACL,GAAG,OAAO;YACV,OAAO,CAAA,GAAA,yCAAc,EAAE,SAAS;QAClC;IACF;IAEA;;;GAGC,GACD,MAAM,SAAS,YAAY,MAAM,CAAC,CAAC,KAAK;QACtC,MAAM,SAAE,KAAK,EAAE,GAAG;QAClB,KAAK,MAAM,QAAQ,MACjB,IAAI,IAAI,CAAC;QAEX,OAAO;IACT,GAAG,EAAE;IAEL,OAAO;QACL,OAAO;QACP,aAAa,gBAAgB;QAC7B,UAAU;IACZ;AACF","sources":["packages/column-views/src/prepare-units/index.ts"],"sourcesContent":["import {\n getSectionAgeRange,\n getSectionPosRange,\n groupUnitsIntoSectionsByOverlap,\n groupUnitsIntoSectionsBySectionID,\n mergeOverlappingSections,\n preprocessSectionUnit,\n preprocessUnits,\n} from \"./helpers\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { useMemo } from \"react\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport {\n collapseUnconformitiesByPixelHeight,\n computeSectionHeights,\n finalizeSectionHeights,\n type CompositeColumnScale,\n} from \"./composite-scale\";\nimport {\n agesOverlap,\n MergeSectionsMode,\n PrepareColumnOptions,\n PreparedColumnData,\n unitsOverlap,\n} from \"./utils\";\nimport { SectionInfo } from \"./types\";\n\nexport * from \"./utils\";\nexport * from \"./types\";\nexport { preprocessUnits };\nexport type { CompositeColumnScale };\n\nexport function usePreparedColumnUnits(\n data: UnitLong[],\n options: PrepareColumnOptions,\n): PreparedColumnData {\n /** This function wraps and memoizes all preparation steps for converting\n * an array of units from the /units route to a form ready for usage.\n */\n return useMemo(() => {\n return prepareColumnUnits(data, options);\n }, [data, ...Object.values(options)]);\n}\n\nexport function prepareColumnUnits(\n units: UnitLong[],\n options: PrepareColumnOptions,\n): PreparedColumnData {\n /** Prepare units for rendering into Macrostrat columns */\n\n let { t_age, b_age, t_pos, b_pos } = options;\n\n const {\n mergeSections = MergeSectionsMode.OVERLAPPING,\n axisType,\n unconformityHeight,\n collapseSmallUnconformities = false,\n hybridScale,\n scale,\n } = options;\n\n let _totalHeight = null;\n\n if (scale != null) {\n // Set t_age and b_age based on scale domain if not already set\n const domain = scale.domain();\n if (axisType == ColumnAxisType.AGE) {\n if (t_age == null) t_age = Math.min(...domain);\n if (b_age == null) b_age = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_age) - scale(t_age));\n } else {\n if (t_pos == null) t_pos = Math.min(...domain);\n if (b_pos == null) b_pos = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_pos) - scale(t_pos));\n }\n }\n\n // Start by ensuring that ages and positions are numbers\n // also set up some values for eODP-style columns\n let units1 = units.map(preprocessSectionUnit);\n\n /** Prototype filtering to age range */\n units1 = units1.filter((d) => {\n // Filter units by t_age and b_age, inclusive\n if (axisType == ColumnAxisType.AGE) {\n return agesOverlap(d, { t_age, b_age });\n } else {\n return unitsOverlap(d, { t_pos, b_pos } as any, axisType);\n }\n });\n\n let mergeMode = mergeSections;\n // if (axisType != ColumnAxisType.AGE) {\n // // For non-age columns, we always merge sections.\n // // This is because the \"groupUnitsIntoSections\" function is not well-defined\n // // for non-age columns.\n // mergeMode = MergeSectionsMode.ALL;\n // }\n\n let sections0: SectionInfo<UnitLong>[];\n if (mergeMode == MergeSectionsMode.ALL) {\n // For the \"merge sections\" mode, we need to create a single section\n const [b_unit_pos, t_unit_pos] = getSectionPosRange(units1, axisType);\n const [b_unit_age, t_unit_age] = getSectionAgeRange(units1);\n sections0 = [\n {\n section_id: 0,\n /**\n * If ages limits are directly specified, use them to define the section bounds.\n * */\n t_pos: t_unit_pos,\n b_pos: b_unit_pos,\n t_age: t_unit_age,\n b_age: b_unit_age,\n units: units1,\n },\n ];\n } else if (axisType == ColumnAxisType.AGE) {\n sections0 = groupUnitsIntoSectionsBySectionID(units1, axisType);\n } else {\n sections0 = groupUnitsIntoSectionsByOverlap(units1, axisType);\n }\n\n // Limit sections to the range specified by t_age/b_age or t_pos/b_pos global options\n for (let section of sections0) {\n if (axisType == ColumnAxisType.AGE) {\n section.t_age = Math.max(section.t_age, t_age ?? -Infinity);\n section.b_age = Math.min(section.b_age, b_age ?? Infinity);\n } else if (axisType == ColumnAxisType.DEPTH) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n } else if (axisType == ColumnAxisType.HEIGHT) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n }\n }\n\n /** Merging overlapping sections really only makes sense for age/height/depth\n * columns. Ordinal columns are numbered by section so merging them\n * results in collisions.\n */\n let sections = sections0;\n if (\n mergeSections == MergeSectionsMode.OVERLAPPING &&\n axisType == ColumnAxisType.AGE\n ) {\n sections = mergeOverlappingSections(sections);\n }\n // Filter out undefined sections just in case\n sections = sections.filter((d) => d != null);\n\n // SCALES\n\n /* Compute pixel scales etc. for sections\n * We need to do this now to determine which unconformities\n * are small enough to collapse.\n */\n let sectionsWithScales = computeSectionHeights(sections, options);\n\n if (collapseSmallUnconformities && hybridScale == null) {\n // Collapse small unconformities in pixel height space\n // TODO: this doesn't seem to work properly for non-age columns?\n let threshold = unconformityHeight ?? 30;\n if (typeof collapseSmallUnconformities == \"number\") {\n threshold = collapseSmallUnconformities;\n }\n\n sectionsWithScales = collapseUnconformitiesByPixelHeight(\n sectionsWithScales,\n threshold,\n options,\n );\n }\n\n /** Prepare section scale information using groups.\n * Total height is computed from section scales.\n * */\n let { totalHeight, sections: sections2 } = finalizeSectionHeights(\n sectionsWithScales,\n unconformityHeight,\n );\n\n /** For each section, find units that are overlapping.\n * We do this after merging sections so that we can\n * handle cases where there are overlapping units across sections\n * */\n const sectionsOut = sections2.map((section) => {\n return {\n ...section,\n units: preprocessUnits(section, axisType),\n };\n });\n\n /** Reconstitute the units so that they are sorted by section and properly enhanced.\n * This is mostly important so that unit keyboard navigation\n * predictably selects adjacent units.\n */\n const units2 = sectionsOut.reduce((acc, group) => {\n const { units } = group;\n for (const unit of units) {\n acc.push(unit);\n }\n return acc;\n }, []);\n\n return {\n units: units2,\n totalHeight: _totalHeight ?? totalHeight,\n sections: sectionsOut,\n };\n}\n"],"names":[],"version":3,"file":"column-views.0faf79a9.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76} from "./column-views.
|
|
1
|
+
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76} from "./column-views.362aae9a.js";
|
|
2
2
|
import {line as $iZTQD$line} from "d3-shape";
|
|
3
3
|
import {createContext as $iZTQD$createContext, useContext as $iZTQD$useContext} from "react";
|
|
4
4
|
import $iZTQD$macrostrathyper from "@macrostrat/hyper";
|
|
@@ -83,4 +83,4 @@ const $5f39f3d52558a1d0$export$919dbb10b6b5b75 = ()=>(0, $iZTQD$useContext)($5f3
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
export {$5f39f3d52558a1d0$export$309ef8546e07d921 as IsotopesDataArea, $5f39f3d52558a1d0$export$4cb5d059db4e2bd as IsotopeDataPoint, $5f39f3d52558a1d0$export$628a3ef6eb9c3a89 as IsotopeDataLine, $5f39f3d52558a1d0$export$919dbb10b6b5b75 as useDataLocator};
|
|
86
|
-
//# sourceMappingURL=column-views.
|
|
86
|
+
//# sourceMappingURL=column-views.19539293.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAMA,MAAM,iCAAW,CAAC,OAAO;IACvB,MAAM,SAAS,MAAM,MAAM;IAC3B,OAAO,MAAM,CAAC,EAAE,GAAG,MAAM,MAAM,CAAC,EAAE;AACpC;AAEA,MAAM,2CAAqB,SAAU,IAAI;IACvC,MAAM,UAAE,MAAM,SAAE,KAAK,aAAE,SAAS,EAAE,GAAG,MAAM,GAAG;IAC9C,OAAO,SAAU,CAAC,EAAE,IAAI,CAAC;QACvB,MAAM,SAAS,UAAU;QACzB,IAAI,CAAC,+BAAS,OAAO,S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AK,MAAM,SAAS;YACpB;YACA;QACA,GAAG;QACH,GAAG,IAAI;IACT;AACF;AAEA,MAAM,4CAAkB,SAAU,KAAK;IACrC,MAAM,EAAE,QAAQ,UAAU,EAAE,GAAG,MAAM,GAAG;IACxC,MAAM,eAAE,WAAW,EAAE,GAAG,CAAA,GAAA,iBAAS,EAAE;IACnC,OAAO,CAAA,GAAA,sBAAA,EAAE,QAAQ;QACf,GAAG,YAAY;QACf,MAAM;QACN,GAAG,IAAI;IACT;AACF;AAEA,MAAM,2CAAiB,IAAM,CAAA,GAAA,iBAAS,EAAE","sources":["packages/column-views/src/facets/carbon-isotopes/data-area.ts"],"sourcesContent":["import { line } from \"d3-shape\";\nimport { createContext, useContext } from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport { ColumnLayoutContext } from \"@macrostrat/column-components\";\nimport { useCompositeScale } from \"../../data-provider\";\n\nconst inDomain = (scale, num) => {\n const domain = scale.domain();\n return domain[0] < num < domain[1];\n};\n\nconst createPointLocator = function (opts) {\n const { xScale, scale, getHeight, ...rest } = opts;\n return function (d, s = 0) {\n const height = getHeight(d);\n if (!inDomain(scale, height)) return null;\n return [xScale(d.value), scale(height)];\n };\n};\n\nconst IsotopesDataContext = createContext(null);\n\nexport interface DataAreaProps {\n clipY: boolean;\n parameter: string;\n corrected: boolean;\n system: string;\n children: React.ReactNode;\n getHeight?: Function;\n}\n\nconst IsotopesDataArea = function (props: DataAreaProps) {\n const xScale = useContext(ColumnLayoutContext)?.xScale;\n\n const scale = useCompositeScale();\n\n let { corrected, system, children, getHeight, clipY = false } = props;\n if (getHeight == null) {\n getHeight = function (d) {\n if (d.height == null) {\n console.log(d);\n }\n return d.height;\n };\n }\n\n // Handlers for creating points and lines\n const pointLocator = createPointLocator({\n xScale,\n scale,\n corrected,\n system,\n getHeight,\n });\n\n let column = \"avg_\" + system;\n if (corrected) {\n column += \"_corr\";\n }\n const lineLocator = line()\n .x((d) => xScale(d[column]))\n // @ts-ignore\n .y((d) => scale(d.height));\n\n const value = { pointLocator, lineLocator, corrected, system, clipY };\n return h(IsotopesDataContext.Provider, { value }, h(\"g.data\", children));\n};\n\nconst IsotopeDataPoint = function (props) {\n const { pointLocator } = useContext(IsotopesDataContext);\n const { datum, strokeWidth, ...rest } = props;\n const loc = pointLocator(datum);\n if (loc == null) return null;\n const [cx, cy] = loc;\n\n return h(\"circle\", {\n key: datum.sample_id,\n cx,\n cy,\n r: 2,\n ...rest,\n });\n};\n\nconst IsotopeDataLine = function (props) {\n const { values: lineValues, ...rest } = props;\n const { lineLocator } = useContext(IsotopesDataContext);\n return h(\"path\", {\n d: lineLocator(lineValues),\n fill: \"transparent\",\n ...rest,\n });\n};\n\nconst useDataLocator = () => useContext(IsotopesDataContext);\n\nexport { IsotopesDataArea, IsotopeDataPoint, IsotopeDataLine, useDataLocator };\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAMA,MAAM,iCAAW,CAAC,OAAO;IACvB,MAAM,SAAS,MAAM,MAAM;IAC3B,OAAO,MAAM,CAAC,EAAE,GAAG,MAAM,MAAM,CAAC,EAAE;AACpC;AAEA,MAAM,2CAAqB,SAAU,IAAI;IACvC,MAAM,UAAE,MAAM,SAAE,KAAK,aAAE,SAAS,EAAE,GAAG,MAAM,GAAG;IAC9C,OAAO,SAAU,CAAC,EAAE,IAAI,CAAC;QACvB,MAAM,SAAS,UAAU;QACzB,IAAI,CAAC,+BAAS,OAAO,SAAS,OAAO;QACrC,OAAO;YAAC,OAAO,EAAE,KAAK;YAAG,MAAM;SAAQ;IACzC;AACF;AAEA,MAAM,4CAAsB,CAAA,GAAA,oBAAY,EAAE;AAW1C,MAAM,4CAAmB,SAAU,KAAoB;IACrD,MAAM,SAAS,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0BAAkB,IAAI;IAEhD,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,IAAI,aAAE,SAAS,UAAE,MAAM,YAAE,QAAQ,aAAE,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CAAiB,IAAM,CAAA,GAAA,iBAAS,EAAE","sources":["packages/column-views/src/facets/carbon-isotopes/data-area.ts"],"sourcesContent":["import { line } from \"d3-shape\";\nimport { createContext, useContext } from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport { ColumnLayoutContext } from \"@macrostrat/column-components\";\nimport { useCompositeScale } from \"../../data-provider\";\n\nconst inDomain = (scale, num) => {\n const domain = scale.domain();\n return domain[0] < num < domain[1];\n};\n\nconst createPointLocator = function (opts) {\n const { xScale, scale, getHeight, ...rest } = opts;\n return function (d, s = 0) {\n const height = getHeight(d);\n if (!inDomain(scale, height)) return null;\n return [xScale(d.value), scale(height)];\n };\n};\n\nconst IsotopesDataContext = createContext(null);\n\nexport interface DataAreaProps {\n clipY: boolean;\n parameter: string;\n corrected: boolean;\n system: string;\n children: React.ReactNode;\n getHeight?: Function;\n}\n\nconst IsotopesDataArea = function (props: DataAreaProps) {\n const xScale = useContext(ColumnLayoutContext)?.xScale;\n\n const scale = useCompositeScale();\n\n let { corrected, system, children, getHeight, clipY = false } = props;\n if (getHeight == null) {\n getHeight = function (d) {\n if (d.height == null) {\n console.log(d);\n }\n return d.height;\n };\n }\n\n // Handlers for creating points and lines\n const pointLocator = createPointLocator({\n xScale,\n scale,\n corrected,\n system,\n getHeight,\n });\n\n let column = \"avg_\" + system;\n if (corrected) {\n column += \"_corr\";\n }\n const lineLocator = line()\n .x((d) => xScale(d[column]))\n // @ts-ignore\n .y((d) => scale(d.height));\n\n const value = { pointLocator, lineLocator, corrected, system, clipY };\n return h(IsotopesDataContext.Provider, { value }, h(\"g.data\", children));\n};\n\nconst IsotopeDataPoint = function (props) {\n const { pointLocator } = useContext(IsotopesDataContext);\n const { datum, strokeWidth, ...rest } = props;\n const loc = pointLocator(datum);\n if (loc == null) return null;\n const [cx, cy] = loc;\n\n return h(\"circle\", {\n key: datum.sample_id,\n cx,\n cy,\n r: 2,\n ...rest,\n });\n};\n\nconst IsotopeDataLine = function (props) {\n const { values: lineValues, ...rest } = props;\n const { lineLocator } = useContext(IsotopesDataContext);\n return h(\"path\", {\n d: lineLocator(lineValues),\n fill: \"transparent\",\n ...rest,\n });\n};\n\nconst useDataLocator = () => useContext(IsotopesDataContext);\n\nexport { IsotopesDataArea, IsotopeDataPoint, IsotopeDataLine, useDataLocator };\n"],"names":[],"version":3,"file":"column-views.19539293.js.map"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./column-views.54c1f382.css";
|
|
2
2
|
import $5tCNh$columnviews17a70358js from "./column-views.17a70358.js";
|
|
3
3
|
import {getPositionWithinUnit as $b6657fba8924a702$export$441710fb21b4ae09, getUnitHeightRange as $b6657fba8924a702$export$70e712e2ac0237a} from "./column-views.052498a6.js";
|
|
4
|
-
import {ColumnNotes as $9e52fe4012c88296$export$fc5babae10f3f77d} from "./column-views.
|
|
4
|
+
import {ColumnNotes as $9e52fe4012c88296$export$fc5babae10f3f77d} from "./column-views.45c70ba4.js";
|
|
5
5
|
import $5tCNh$macrostrathyper from "@macrostrat/hyper";
|
|
6
6
|
import {ColumnAxisType as $5tCNh$ColumnAxisType} from "@macrostrat/column-components";
|
|
7
7
|
|
|
@@ -136,4 +136,4 @@ function $50d219504625a431$export$4e649f790614b299(data, scale, axisType, groupD
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
export {$50d219504625a431$export$9d101e1fcb2166a6 as standardizeMeasurementHeight, $50d219504625a431$export$8f2afa8ddee7317e as mergeHeightRanges, $50d219504625a431$export$ce5c4f2fdf4e644d as BaseMeasurementsColumn, $50d219504625a431$export$653e47a7a0da0f0d as TruncatedList, $50d219504625a431$export$4e649f790614b299 as groupNotesByPixelDistance};
|
|
139
|
-
//# sourceMappingURL=column-views.
|
|
139
|
+
//# sourceMappingURL=column-views.1af3ec1f.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GA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AAI,EAAE,MAAM;QAEtE,IAAI,YAAY,eAAe;YAC7B,IAAI,gBAAgB,MAClB,MAAM,IAAI,MAAM;YAElB,2BAA2B;YAC3B,aAAa,IAAI,CAAC,IAAI,IAAI,EAAE,IAAI;YAChC,sBAAsB;YACtB,MAAM,aAAa,EAAE,UAAU,IAAI,EAAE,MAAM;YAC3C,IACE,aAAa,CAAA,GAAA,qBAAa,EAAE,GAAG,IAC/B,aAAa,CAAA,GAAA,qBAAa,EAAE,KAAK,EAEjC,gBAAgB;YAChB,aAAa,UAAU,GAAG,KAAK,GAAG,CAAC,aAAa,UAAU,EAAE;iBAE5D,aAAa,UAAU,GAAG,KAAK,GAAG,CAAC,aAAa,UAAU,EAAE;YAE9D,aAAa,EAAE,GAAG,GAAG,aAAa,MAAM,CAAC,CAAC,EAAE,aAAa,UAAU,EAAE;QACvE,OAAO;YACL,oBAAoB;YACpB,eAAe;gBAAE,GAAG,CAAC;gBAAE,MAAM;uBAAI,EAAE,IAAI;iBAAC;YAAC;YACzC,uBACE,MAAM,aAAa,MAAM,KACzB,MAAM,aAAa,UAAU,KAC7B;YACF,YAAY,IAAI,CAAC;QACnB;IACF;IAEA,OAAO;AACT","sources":["packages/column-views/src/facets/measurements/base.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport styles from \"./base.module.sass\";\nimport {\n type CompositeColumnScale,\n getPositionWithinUnit,\n getUnitHeightRange,\n} from \"../../prepare-units\";\nimport { ColumnNotes } from \"../../notes\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nconst h = hyper.styled(styles);\n\ntype GetHeightRangeFn<T> = (\n data: T,\n unit: UnitLong | null,\n axisType: ColumnAxisType,\n) => MeasurementHeightData;\n\nexport interface BaseMeasurementsColumnProps<T> {\n data: T[];\n noteComponent?: any;\n width?: number;\n paddingLeft?: number;\n className?: string;\n // TODO: these props are confusing\n getUnitID?: (d: T) => number | string;\n isMatchingUnit?: (d: T, unit: UnitLong) => boolean;\n getHeightRange?: GetHeightRangeFn<T>;\n deltaConnectorAttachment?: number;\n focusedNoteComponent?: any;\n}\n\nexport interface ColumnMeasurementData<T = any> extends MeasurementHeightData {\n data: T;\n id: string | number;\n}\n\ntype MeasurementPositionInformation =\n | MeasurementHeightData\n | {\n unit_id: number;\n unit_rel_pos?: number;\n };\n\nexport function standardizeMeasurementHeight(\n pos: MeasurementPositionInformation,\n units: UnitLong[],\n axisType: ColumnAxisType,\n): MeasurementHeightData | null {\n /** Get a standardized height representation from position information for\n * a measurement\n */\n if (\"height\" in pos) {\n return pos;\n }\n const unit = units.find((u) => u.unit_id === pos.unit_id);\n if (unit == null) {\n return null;\n }\n if (pos.unit_rel_pos != null) {\n const res = getPositionWithinUnit(pos.unit_rel_pos, unit, axisType);\n if (res == null) return null;\n return { height: res };\n } else {\n const [height, top_height] = getUnitHeightRange(unit, axisType);\n return { height, top_height };\n }\n}\n\nexport function mergeHeightRanges(\n data: MeasurementHeightData[],\n axisType: ColumnAxisType,\n): MeasurementHeightData {\n /** Merge multiple height ranges into a single range */\n const heights = [];\n\n for (const d of data) {\n heights.push(d.height);\n if (d.top_height != null) {\n heights.push(d.top_height);\n }\n }\n\n let height: number;\n let top_height: number;\n if (axisType === ColumnAxisType.AGE || axisType === ColumnAxisType.DEPTH) {\n height = Math.max(...heights);\n top_height = Math.min(...heights);\n } else {\n height = Math.min(...heights);\n top_height = Math.max(...heights);\n }\n\n if (top_height === height) {\n return { height };\n }\n return { height, top_height };\n}\n\nexport type MeasurementHeightData = {\n height: number;\n top_height?: number | null;\n};\n\nexport function BaseMeasurementsColumn({\n data,\n noteComponent,\n width = 500,\n paddingLeft = 40,\n className,\n deltaConnectorAttachment,\n focusedNoteComponent,\n}: BaseMeasurementsColumnProps<any>) {\n if (data == null) return null;\n\n return h(\n \"div.measurements-column\",\n { className },\n h(ColumnNotes, {\n width,\n paddingLeft,\n notes: data,\n noteComponent,\n deltaConnectorAttachment,\n focusedNoteComponent,\n }),\n );\n}\n\ninterface TruncatedListProps {\n data: any[];\n className?: string;\n maxItems?: number;\n itemRenderer?: (props: { data: any }) => any;\n}\n\nexport function TruncatedList({\n data,\n className,\n maxItems = 5,\n itemRenderer = (p) => h(\"span\", p.data),\n}: TruncatedListProps) {\n let tooMany = null;\n let d1 = data;\n if (data.length > maxItems) {\n const n = data.length - maxItems;\n d1 = data.slice(0, maxItems);\n tooMany = h(\"li.too-many\", `and ${n} more`);\n }\n\n return h(\"ul.truncated-list\", { className }, [\n d1.map((d, i) => {\n return h(\"li.element\", { key: i }, h(itemRenderer, { data: d }));\n }),\n tooMany,\n ]);\n}\n\nexport function groupNotesByPixelDistance<T = any>(\n data: ColumnMeasurementData<T[]>[],\n scale: CompositeColumnScale,\n axisType: ColumnAxisType,\n groupDistance: number,\n) {\n /** Group notes that are within a certain pixel distance of each other\n * in display space\n */\n if (data.length === 0 || groupDistance <= 0) return data;\n if (axisType === ColumnAxisType.AGE || axisType === ColumnAxisType.DEPTH) {\n data.sort((a, b) => b.height - a.height);\n } else {\n // Sort data by height (ascending up the column)\n data.sort((a, b) => a.height - b.height);\n }\n\n const groupedData: ColumnMeasurementData<T[]>[] = [];\n let currentGroup: ColumnMeasurementData<T[]> | null = null;\n let currentGroupPosition: number = Infinity;\n\n for (const d of data) {\n // Check distance from current max position\n // Pixels go up as we go down in the section\n\n // The _top_ of the next group must be within groupDistance of the\n // _bottom_ of the current group. This makes sure that we don't collapse\n // groups that are separated by a large distance\n const distance = currentGroupPosition - scale(d.top_height ?? d.height);\n\n if (distance <= groupDistance) {\n if (currentGroup == null) {\n throw new Error(\"Current group is null when it shouldn't be\");\n }\n // Merge into current group\n currentGroup.data.push(...d.data);\n // Update height range\n const top_height = d.top_height ?? d.height;\n if (\n axisType === ColumnAxisType.AGE ||\n axisType === ColumnAxisType.DEPTH\n ) {\n // Inverted axis\n currentGroup.top_height = Math.min(currentGroup.top_height, top_height);\n } else {\n currentGroup.top_height = Math.max(currentGroup.top_height, top_height);\n }\n currentGroup.id = `${currentGroup.height}-${currentGroup.top_height}`;\n } else {\n // Start a new group\n currentGroup = { ...d, data: [...d.data] };\n currentGroupPosition =\n scale(currentGroup.height) ??\n scale(currentGroup.top_height) ??\n Infinity;\n groupedData.push(currentGroup);\n }\n }\n\n return groupedData;\n}\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,uEAAK;AAkCrB,SAAS,0CACd,GAAmC,EACnC,KAAiB,EACjB,QAAwB;IAExB;;GAEC,GACD,IAAI,YAAY,KACd,OAAO;IAET,MAAM,OAAO,MAAM,IAAI,CAAC,CAAC,IAAM,EAAE,OAAO,KAAK,IAAI,OAAO;IACxD,IAAI,QAAQ,MACV,OAAO;IAET,IAAI,IAAI,YAAY,IAAI,MAAM;QAC5B,MAAM,MAAM,CAAA,GAAA,yCAAoB,EAAE,IAAI,YAAY,EAAE,MAAM;QAC1D,IAAI,OAAO,MAAM,OAAO;QACxB,OAAO;YAAE,QAAQ;QAAI;IACvB,OAAO;QACL,MAAM,CAAC,QAAQ,WAAW,GAAG,CAAA,GAAA,wCAAiB,EAAE,MAAM;QACtD,OAAO;oBAAE;wBAAQ;QAAW;IAC9B;AACF;AAEO,SAAS,0CACd,IAA6B,EAC7B,QAAwB;IAExB,qDAAqD,GACrD,MAAM,UAAU,EAAE;IAElB,KAAK,MAAM,KAAK,KAAM;QACpB,QAAQ,IAAI,CAAC,EAAE,MAAM;QACrB,IAAI,EAAE,UAAU,IAAI,MAClB,QAAQ,IAAI,CAAC,EAAE,UAAU;IAE7B;IAEA,IAAI;IACJ,IAAI;IACJ,IAAI,aAAa,CAAA,GAAA,qBAAa,EAAE,GAAG,IAAI,aAAa,CAAA,GAAA,qBAAa,EAAE,KAAK,EAAE;QACxE,SAAS,KAAK,GAAG,IAAI;QACrB,aAAa,KAAK,GAAG,I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AM,GAAG,EAAE,MAAM;SAEvC,gDAAgD;IAChD,KAAK,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,MAAM,GAAG,EAAE,MAAM;IAGzC,MAAM,cAA4C,EAAE;IACpD,IAAI,eAAkD;IACtD,IAAI,uBAA+B;IAEnC,KAAK,MAAM,KAAK,KAAM;QACpB,2CAA2C;QAC3C,4CAA4C;QAE5C,kEAAkE;QAClE,wEAAwE;QACxE,gDAAgD;QAChD,MAAM,WAAW,uBAAuB,MAAM,EAAE,UAAU,IAAI,EAAE,MAAM;QAEtE,IAAI,YAAY,eAAe;YAC7B,IAAI,gBAAgB,MAClB,MAAM,IAAI,MAAM;YAElB,2BAA2B;YAC3B,aAAa,IAAI,CAAC,IAAI,IAAI,EAAE,IAAI;YAChC,sBAAsB;YACtB,MAAM,aAAa,EAAE,UAAU,IAAI,EAAE,MAAM;YAC3C,IACE,aAAa,CAAA,GAAA,qBAAa,EAAE,GAAG,IAC/B,aAAa,CAAA,GAAA,qBAAa,EAAE,KAAK,EAEjC,gBAAgB;YAChB,aAAa,UAAU,GAAG,KAAK,GAAG,CAAC,aAAa,UAAU,EAAE;iBAE5D,aAAa,UAAU,GAAG,KAAK,GAAG,CAAC,aAAa,UAAU,EAAE;YAE9D,aAAa,EAAE,GAAG,GAAG,aAAa,MAAM,CAAC,CAAC,EAAE,aAAa,UAAU,EAAE;QACvE,OAAO;YACL,oBAAoB;YACpB,eAAe;gBAAE,GAAG,CAAC;gBAAE,MAAM;uBAAI,EAAE,IAAI;iBAAC;YAAC;YACzC,uBACE,MAAM,aAAa,MAAM,KACzB,MAAM,aAAa,UAAU,KAC7B;YACF,YAAY,IAAI,CAAC;QACnB;IACF;IAEA,OAAO;AACT","sources":["packages/column-views/src/facets/measurements/base.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport styles from \"./base.module.sass\";\nimport {\n type CompositeColumnScale,\n getPositionWithinUnit,\n getUnitHeightRange,\n} from \"../../prepare-units\";\nimport { ColumnNotes } from \"../../notes\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nconst h = hyper.styled(styles);\n\ntype GetHeightRangeFn<T> = (\n data: T,\n unit: UnitLong | null,\n axisType: ColumnAxisType,\n) => MeasurementHeightData;\n\nexport interface BaseMeasurementsColumnProps<T> {\n data: T[];\n noteComponent?: any;\n width?: number;\n paddingLeft?: number;\n className?: string;\n // TODO: these props are confusing\n getUnitID?: (d: T) => number | string;\n isMatchingUnit?: (d: T, unit: UnitLong) => boolean;\n getHeightRange?: GetHeightRangeFn<T>;\n deltaConnectorAttachment?: number;\n focusedNoteComponent?: any;\n}\n\nexport interface ColumnMeasurementData<T = any> extends MeasurementHeightData {\n data: T;\n id: string | number;\n}\n\ntype MeasurementPositionInformation =\n | MeasurementHeightData\n | {\n unit_id: number;\n unit_rel_pos?: number;\n };\n\nexport function standardizeMeasurementHeight(\n pos: MeasurementPositionInformation,\n units: UnitLong[],\n axisType: ColumnAxisType,\n): MeasurementHeightData | null {\n /** Get a standardized height representation from position information for\n * a measurement\n */\n if (\"height\" in pos) {\n return pos;\n }\n const unit = units.find((u) => u.unit_id === pos.unit_id);\n if (unit == null) {\n return null;\n }\n if (pos.unit_rel_pos != null) {\n const res = getPositionWithinUnit(pos.unit_rel_pos, unit, axisType);\n if (res == null) return null;\n return { height: res };\n } else {\n const [height, top_height] = getUnitHeightRange(unit, axisType);\n return { height, top_height };\n }\n}\n\nexport function mergeHeightRanges(\n data: MeasurementHeightData[],\n axisType: ColumnAxisType,\n): MeasurementHeightData {\n /** Merge multiple height ranges into a single range */\n const heights = [];\n\n for (const d of data) {\n heights.push(d.height);\n if (d.top_height != null) {\n heights.push(d.top_height);\n }\n }\n\n let height: number;\n let top_height: number;\n if (axisType === ColumnAxisType.AGE || axisType === ColumnAxisType.DEPTH) {\n height = Math.max(...heights);\n top_height = Math.min(...heights);\n } else {\n height = Math.min(...heights);\n top_height = Math.max(...heights);\n }\n\n if (top_height === height) {\n return { height };\n }\n return { height, top_height };\n}\n\nexport type MeasurementHeightData = {\n height: number;\n top_height?: number | null;\n};\n\nexport function BaseMeasurementsColumn({\n data,\n noteComponent,\n width = 500,\n paddingLeft = 40,\n className,\n deltaConnectorAttachment,\n focusedNoteComponent,\n}: BaseMeasurementsColumnProps<any>) {\n if (data == null) return null;\n\n return h(\n \"div.measurements-column\",\n { className },\n h(ColumnNotes, {\n width,\n paddingLeft,\n notes: data,\n noteComponent,\n deltaConnectorAttachment,\n focusedNoteComponent,\n }),\n );\n}\n\ninterface TruncatedListProps {\n data: any[];\n className?: string;\n maxItems?: number;\n itemRenderer?: (props: { data: any }) => any;\n}\n\nexport function TruncatedList({\n data,\n className,\n maxItems = 5,\n itemRenderer = (p) => h(\"span\", p.data),\n}: TruncatedListProps) {\n let tooMany = null;\n let d1 = data;\n if (data.length > maxItems) {\n const n = data.length - maxItems;\n d1 = data.slice(0, maxItems);\n tooMany = h(\"li.too-many\", `and ${n} more`);\n }\n\n return h(\"ul.truncated-list\", { className }, [\n d1.map((d, i) => {\n return h(\"li.element\", { key: i }, h(itemRenderer, { data: d }));\n }),\n tooMany,\n ]);\n}\n\nexport function groupNotesByPixelDistance<T = any>(\n data: ColumnMeasurementData<T[]>[],\n scale: CompositeColumnScale,\n axisType: ColumnAxisType,\n groupDistance: number,\n) {\n /** Group notes that are within a certain pixel distance of each other\n * in display space\n */\n if (data.length === 0 || groupDistance <= 0) return data;\n if (axisType === ColumnAxisType.AGE || axisType === ColumnAxisType.DEPTH) {\n data.sort((a, b) => b.height - a.height);\n } else {\n // Sort data by height (ascending up the column)\n data.sort((a, b) => a.height - b.height);\n }\n\n const groupedData: ColumnMeasurementData<T[]>[] = [];\n let currentGroup: ColumnMeasurementData<T[]> | null = null;\n let currentGroupPosition: number = Infinity;\n\n for (const d of data) {\n // Check distance from current max position\n // Pixels go up as we go down in the section\n\n // The _top_ of the next group must be within groupDistance of the\n // _bottom_ of the current group. This makes sure that we don't collapse\n // groups that are separated by a large distance\n const distance = currentGroupPosition - scale(d.top_height ?? d.height);\n\n if (distance <= groupDistance) {\n if (currentGroup == null) {\n throw new Error(\"Current group is null when it shouldn't be\");\n }\n // Merge into current group\n currentGroup.data.push(...d.data);\n // Update height range\n const top_height = d.top_height ?? d.height;\n if (\n axisType === ColumnAxisType.AGE ||\n axisType === ColumnAxisType.DEPTH\n ) {\n // Inverted axis\n currentGroup.top_height = Math.min(currentGroup.top_height, top_height);\n } else {\n currentGroup.top_height = Math.max(currentGroup.top_height, top_height);\n }\n currentGroup.id = `${currentGroup.height}-${currentGroup.top_height}`;\n } else {\n // Start a new group\n currentGroup = { ...d, data: [...d.data] };\n currentGroupPosition =\n scale(currentGroup.height) ??\n scale(currentGroup.top_height) ??\n Infinity;\n groupedData.push(currentGroup);\n }\n }\n\n return groupedData;\n}\n"],"names":[],"version":3,"file":"column-views.1af3ec1f.js.map"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {fetchAllColumns as $33a46f9423c8104a$export$45bd78cd093090fa, useColumnFeatures as $33a46f9423c8104a$export$e3270a4e30e40ff9, fetchLithologies as $33a46f9423c8104a$export$1aa679bd5e605f82, fetchIntervals as $33a46f9423c8104a$export$5d2ec2e733dfe6c7, fetchEnvironments as $33a46f9423c8104a$export$780b4b253712916c, fetchRefs as $33a46f9423c8104a$export$cd7bfa0860f58b96, fetchStratNames as $33a46f9423c8104a$export$8ea8f45a7ffe4183, fetchUnits as $33a46f9423c8104a$export$b97b9bdd6a521298, fetchColumnUnits as $33a46f9423c8104a$export$d3d8b0fabcc76c5d} from "./column-views.5e1c216f.js";
|
|
2
|
-
import {useMacrostratStore as $774a5efa27d1c77b$export$fb98d5bae3a6800, useMacrostratBaseURL as $774a5efa27d1c77b$export$33b1392d23dde04, useMacrostratFetch as $774a5efa27d1c77b$export$3403c79cb24c043c, useMacrostratDefs as $774a5efa27d1c77b$export$89dd4e5ae4a82373, useMacrostratColumns as $774a5efa27d1c77b$export$81eaae0b474404fd, useMacrostratColumnInfo as $774a5efa27d1c77b$export$39176e4592b7b9ab, useMacrostratData as $774a5efa27d1c77b$export$b9c9fc603d74a555, MacrostratDataProvider as $774a5efa27d1c77b$export$690613f93cdc5576, MacrostratAPIProvider as $774a5efa27d1c77b$export$3098013bc6cc316d, MacrostratColumnProvider as $774a5efa27d1c77b$export$9e42f9b6e0d67c7d, LithologiesProvider as $774a5efa27d1c77b$export$8492a5cae82b6a70, useLithologies as $774a5efa27d1c77b$export$4d18a90c945d129f, useEnvironments as $774a5efa27d1c77b$export$c6b216bf4c71b61f} from "./column-views.
|
|
2
|
+
import {useMacrostratStore as $774a5efa27d1c77b$export$fb98d5bae3a6800, useMacrostratBaseURL as $774a5efa27d1c77b$export$33b1392d23dde04, useMacrostratFetch as $774a5efa27d1c77b$export$3403c79cb24c043c, useMacrostratDefs as $774a5efa27d1c77b$export$89dd4e5ae4a82373, useMacrostratColumns as $774a5efa27d1c77b$export$81eaae0b474404fd, useMacrostratColumnInfo as $774a5efa27d1c77b$export$39176e4592b7b9ab, useMacrostratData as $774a5efa27d1c77b$export$b9c9fc603d74a555, MacrostratDataProvider as $774a5efa27d1c77b$export$690613f93cdc5576, MacrostratAPIProvider as $774a5efa27d1c77b$export$3098013bc6cc316d, MacrostratColumnProvider as $774a5efa27d1c77b$export$9e42f9b6e0d67c7d, LithologiesProvider as $774a5efa27d1c77b$export$8492a5cae82b6a70, useLithologies as $774a5efa27d1c77b$export$4d18a90c945d129f, useEnvironments as $774a5efa27d1c77b$export$c6b216bf4c71b61f} from "./column-views.636d6553.js";
|
|
3
3
|
import {useColumnNav as $b8de97dfa82f4910$export$91cb5ac808759b34, ColumnNavProvider as $b8de97dfa82f4910$export$36fed9e0f93a8fde} from "./column-views.6d6b73b4.js";
|
|
4
|
-
import {MacrostratColumnStateProvider as $d5074f164411387e$export$ef5395089200109b, MacrostratColumnDataProvider as $d5074f164411387e$export$7fec7bd80ff9c10e, UnitSelectionProvider as $d5074f164411387e$export$f19d75b1d4b676a4, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d, useMacrostratUnits as $d5074f164411387e$export$6fb40844db555b2, useColumnUnitsMap as $d5074f164411387e$export$7513be0cfd10d9cc, useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76} from "./column-views.
|
|
4
|
+
import {MacrostratColumnStateProvider as $d5074f164411387e$export$ef5395089200109b, MacrostratColumnDataProvider as $d5074f164411387e$export$7fec7bd80ff9c10e, UnitSelectionProvider as $d5074f164411387e$export$f19d75b1d4b676a4, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d, useMacrostratUnits as $d5074f164411387e$export$6fb40844db555b2, useColumnUnitsMap as $d5074f164411387e$export$7513be0cfd10d9cc, useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76} from "./column-views.362aae9a.js";
|
|
5
5
|
import {useUnitSelectionDispatch as $61771df184788970$export$77a278d5ca56e309, useSelectedUnit as $61771df184788970$export$f0dd93f90aa8e5da, allowUnitSelectionAtom as $61771df184788970$export$3c12ff51b216428d, selectedUnitIDAtom as $61771df184788970$export$6d9520abc11d1c2b, useColumnRef as $61771df184788970$export$ab00b48759e36cb4, useAtomOverlayPosition as $61771df184788970$export$36e20e8024573d5c, UnitSelectionCallbackManager as $61771df184788970$export$1a7a0d00e4ba9c81, useUnitSelectionTarget as $61771df184788970$export$cbbec12b1451fe7d, UnitKeyboardNavigation as $61771df184788970$export$70f5ee19650fc7d1} from "./column-views.1cd55918.js";
|
|
6
6
|
|
|
7
7
|
|
|
@@ -12,4 +12,4 @@ import {useUnitSelectionDispatch as $61771df184788970$export$77a278d5ca56e309, u
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
export {$33a46f9423c8104a$export$45bd78cd093090fa as fetchAllColumns, $33a46f9423c8104a$export$e3270a4e30e40ff9 as useColumnFeatures, $33a46f9423c8104a$export$1aa679bd5e605f82 as fetchLithologies, $33a46f9423c8104a$export$5d2ec2e733dfe6c7 as fetchIntervals, $33a46f9423c8104a$export$780b4b253712916c as fetchEnvironments, $33a46f9423c8104a$export$cd7bfa0860f58b96 as fetchRefs, $33a46f9423c8104a$export$8ea8f45a7ffe4183 as fetchStratNames, $33a46f9423c8104a$export$b97b9bdd6a521298 as fetchUnits, $33a46f9423c8104a$export$d3d8b0fabcc76c5d as fetchColumnUnits, $774a5efa27d1c77b$export$fb98d5bae3a6800 as useMacrostratStore, $774a5efa27d1c77b$export$33b1392d23dde04 as useMacrostratBaseURL, $774a5efa27d1c77b$export$3403c79cb24c043c as useMacrostratFetch, $774a5efa27d1c77b$export$89dd4e5ae4a82373 as useMacrostratDefs, $774a5efa27d1c77b$export$81eaae0b474404fd as useMacrostratColumns, $774a5efa27d1c77b$export$39176e4592b7b9ab as useMacrostratColumnInfo, $774a5efa27d1c77b$export$b9c9fc603d74a555 as useMacrostratData, $774a5efa27d1c77b$export$690613f93cdc5576 as MacrostratDataProvider, $774a5efa27d1c77b$export$3098013bc6cc316d as MacrostratAPIProvider, $774a5efa27d1c77b$export$9e42f9b6e0d67c7d as MacrostratColumnProvider, $774a5efa27d1c77b$export$8492a5cae82b6a70 as LithologiesProvider, $774a5efa27d1c77b$export$4d18a90c945d129f as useLithologies, $774a5efa27d1c77b$export$c6b216bf4c71b61f as useEnvironments, $b8de97dfa82f4910$export$91cb5ac808759b34 as useColumnNav, $b8de97dfa82f4910$export$36fed9e0f93a8fde as ColumnNavProvider, $d5074f164411387e$export$ef5395089200109b as MacrostratColumnStateProvider, $d5074f164411387e$export$7fec7bd80ff9c10e as MacrostratColumnDataProvider, $d5074f164411387e$export$f19d75b1d4b676a4 as UnitSelectionProvider, $d5074f164411387e$export$f8509b7cce386c7d as useMacrostratColumnData, $d5074f164411387e$export$6fb40844db555b2 as useMacrostratUnits, $d5074f164411387e$export$7513be0cfd10d9cc as useColumnUnitsMap, $d5074f164411387e$export$a7fc62995ec4f76 as useCompositeScale, $61771df184788970$export$77a278d5ca56e309 as useUnitSelectionDispatch, $61771df184788970$export$f0dd93f90aa8e5da as useSelectedUnit, $61771df184788970$export$3c12ff51b216428d as allowUnitSelectionAtom, $61771df184788970$export$6d9520abc11d1c2b as selectedUnitIDAtom, $61771df184788970$export$ab00b48759e36cb4 as useColumnRef, $61771df184788970$export$36e20e8024573d5c as useAtomOverlayPosition, $61771df184788970$export$1a7a0d00e4ba9c81 as UnitSelectionCallbackManager, $61771df184788970$export$cbbec12b1451fe7d as useUnitSelectionTarget, $61771df184788970$export$70f5ee19650fc7d1 as UnitKeyboardNavigation};
|
|
15
|
-
//# sourceMappingURL=column-views.
|
|
15
|
+
//# sourceMappingURL=column-views.2a0010a3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"","sources":["packages/column-views/src/data-provider/index.ts"],"sourcesContent":["export * from \"./fetch\";\nexport * from \"./base\";\nexport * from \"./column-nav\";\nexport * from \"./store\";\nexport * from \"./unit-selection\";\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":"","sources":["packages/column-views/src/data-provider/index.ts"],"sourcesContent":["export * from \"./fetch\";\nexport * from \"./base\";\nexport * from \"./column-nav\";\nexport * from \"./store\";\nexport * from \"./unit-selection\";\n"],"names":[],"version":3,"file":"column-views.2a0010a3.js.map"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./column-views.e40b8bfb.css";
|
|
2
2
|
import $3vk6I$columnviews3465c8adjs from "./column-views.3465c8ad.js";
|
|
3
|
-
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratUnits as $d5074f164411387e$export$6fb40844db555b2} from "./column-views.
|
|
3
|
+
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratUnits as $d5074f164411387e$export$6fb40844db555b2} from "./column-views.362aae9a.js";
|
|
4
4
|
import {buildColumnSurfaces as $90d6b105908858a7$export$151c207e6887154c} from "./column-views.aa9ede4d.js";
|
|
5
5
|
import $3vk6I$macrostrathyper from "@macrostrat/hyper";
|
|
6
6
|
import {useAPIResult as $3vk6I$useAPIResult} from "@macrostrat/ui-components";
|
|
@@ -72,4 +72,4 @@ function $1a65c216af27346a$export$ddca1abd3171ec6f() {
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
export {$1a65c216af27346a$export$1d1ebe9df97e8db as BoundaryAgeModelOverlay, $1a65c216af27346a$export$ddca1abd3171ec6f as ComputedSurfacesOverlay};
|
|
75
|
-
//# sourceMappingURL=column-views.
|
|
75
|
+
//# sourceMappingURL=column-views.334c3947.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;AASH,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,uEAAK;AAoBrB,SAAS;IACd,MAAM,SAAU,CAAA,GAAA,wCAAiB,KAAmB,CAAC,EAAE,EAAE;IACzD,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,MAAM,WAAW,CAAA,GAAA,mBAAW,EAC1B,+CACA;gBAAE;IAAO,GACT,CAAC,MAAQ,IAAI,OAAO,CAAC,IAAI;IAG3B,IAAI,YAAY,MACd,OAAO;IAGT,OAAO,wBACL,0BACA,SAAS,GAAG,CAAC,CAAC;QACZ,MAAM,SAAS,MAAM,QAAQ,SAAS;QAEtC,OAAO,wBAAE,kCAAkC;YACzC,KAAK,QAAQ,WAAW;YACxB,OAAO;gBAAE,KAAK,GAAG,OAAO,EAAE,CAAC;YAAC;QAC9B;IACF;AAEJ;AAEO,SAAS;IACd;;GAEC,GACD,MAAM,QAAQ,CAAA,GAAA,wCAAiB;IAC/B,MAAM,WAAW,CAAA,GAAA,yCAAkB,EAAE;IACrC,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,OAAO,wBACL,0BACA,SAAS,GAAG,CAAC,CAAC;QACZ,MAAM,SAAS,MAAM,QAAQ,GAAG;QAChC,OAAO,wBAAE,kCAAkC;YACzC,KAAK,QAAQ,KAAK;YAClB,OAAO;gBAAE,KAAK,GAAG,OAAO,EAAE,CAAC;YAAC;QAC9B;IACF;AAEJ","sources":["packages/column-views/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":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;AASH,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,uEAAK;AAoBrB,SAAS;IACd,MAAM,SAAU,CAAA,GAAA,wCAAiB,KAAmB,CAAC,EAAE,EAAE;IACzD,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,MAAM,WAAW,CAAA,GAAA,mBAAW,EAC1B,+CACA;gBAAE;IAAO,GACT,CAAC,MAAQ,IAAI,OAAO,CAAC,IAAI;IAG3B,IAAI,YAAY,MACd,OAAO;IAGT,OAAO,wBACL,0BACA,SAAS,GAAG,CAAC,CAAC;QACZ,MAAM,SAAS,MAAM,QAAQ,SAAS;QAEtC,OAAO,wBAAE,kCAAkC;YACzC,KAAK,QAAQ,WAAW;YACxB,OAAO;gBAAE,KAAK,GAAG,OAAO,EAAE,CAAC;YAAC;QAC9B;IACF;AAEJ;AAEO,SAAS;IACd;;GAEC,GACD,MAAM,QAAQ,CAAA,GAAA,wCAAiB;IAC/B,MAAM,WAAW,CAAA,GAAA,yCAAkB,EAAE;IACrC,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,OAAO,wBACL,0BACA,SAAS,GAAG,CAAC,CAAC;QACZ,MAAM,SAAS,MAAM,QAAQ,GAAG;QAChC,OAAO,wBAAE,kCAAkC;YACzC,KAAK,QAAQ,KAAK;YAClB,OAAO;gBAAE,KAAK,GAAG,OAAO,EAAE,CAAC;YAAC;QAC9B;IACF;AAEJ","sources":["packages/column-views/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":[],"version":3,"file":"column-views.334c3947.js.map"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {useCorrelationMapStore as $74e211dc185c20b4$export$21398703d3a9bb4d} from "./column-views.
|
|
2
|
-
import {buildColumnsStyle as $1dbfddc9637b572c$export$d2995719c3a4ae17} from "./column-views.
|
|
1
|
+
import {useCorrelationMapStore as $74e211dc185c20b4$export$21398703d3a9bb4d} from "./column-views.fe42d2fc.js";
|
|
2
|
+
import {buildColumnsStyle as $1dbfddc9637b572c$export$d2995719c3a4ae17} from "./column-views.33d35a44.js";
|
|
3
3
|
import {InsetMap as $5593f90ffec284da$export$1e8149fc0d15fed0} from "./column-views.3de4dc43.js";
|
|
4
4
|
import {useMapClickHandler as $6wt91$useMapClickHandler, useMapStyleOperator as $6wt91$useMapStyleOperator, useMapEaseTo as $6wt91$useMapEaseTo} from "@macrostrat/mapbox-react";
|
|
5
5
|
import {LngLatBounds as $6wt91$LngLatBounds} from "mapbox-gl";
|
|
@@ -196,4 +196,4 @@ function $dcd183b733f66144$var$SectionLine({ padding: padding }) {
|
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
export {$dcd183b733f66144$export$8e7d97509e84cc49 as ColumnCorrelationMap};
|
|
199
|
-
//# sourceMappingURL=column-views.
|
|
199
|
+
//# sourceMappingURL=column-views.337b40a2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAsBO,SAAS,0CAAqB,KAA0B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N,UAAU;oBACV,YAAY;wBAAE,IAAI;oBAAc;gBAClC;aACD;QACH;QAEA,CAAA,GAAA,iBAAS,EAAE,KAAK,oBAAoB;QACpC,CAAA,GAAA,iBAAS,EAAE,KAAK,yBAAyB;YACvC,MAAM;YACN,UAAU,YAAY,WAAW,CAAC,GAAG,CAAC,CAAC,QAAW,CAAA;oBAChD,MAAM;oBACN,UAAU;wBAAE,MAAM;wBAAS,aAAa;oBAAM;oBAC9C,YAAY,CAAC;gBACf,CAAA;QACF;IACF,GACA;QAAC;KAAY;IAGf,MAAM,SAAS,CAAA,GAAA,cAAM,EAAE;QACrB,IAAI,eAAe,QAAQ,aAAa,YAAY,SAAS,GAC3D,OAAO;QAET,IAAI,SAAS,IAAI,CAAA,GAAA,mBAAW;QAC5B,KAAK,IAAI,SAAS,YAAY,WAAW,CACvC,OAAO,MAAM,CAAC;QAEhB,OAAO;IACT,GAAG;QAAC;KAAY;IAEhB,CAAA,GAAA,mBAAW,EAAE;gBAAE;iBAAQ;QAAS,aAAa;IAAK;IAElD,OAAO;AACT","sources":["packages/column-views/src/maps/column-correlation/core.ts"],"sourcesContent":["import {\n useMapClickHandler,\n useMapEaseTo,\n useMapStyleOperator,\n} from \"@macrostrat/mapbox-react\";\nimport { LngLatBounds, Style } from \"mapbox-gl\";\nimport h from \"@macrostrat/hyper\";\nimport { Feature, FeatureCollection } from \"geojson\";\nimport { ReactNode, useMemo } from \"react\";\nimport { setGeoJSON, buildGeoJSONSource } from \"@macrostrat/mapbox-utils\";\n\nimport { useCorrelationMapStore } from \"./state\";\nimport { buildColumnsStyle, InsetMap, InsetMapProps } from \"../_shared\";\nimport { buildCrossSectionLayers } from \"@macrostrat/map-styles\";\n\nexport interface CorrelationMapProps extends InsetMapProps {\n padding?: number;\n children?: ReactNode;\n accessToken?: string;\n columnColor?: string;\n}\n\nexport function ColumnCorrelationMap(props: CorrelationMapProps) {\n const { padding = 50, children, columnColor, projectID, ...rest } = props;\n\n const overlayStyles: Partial<Style>[] = useMemo(() => {\n return [\n buildColumnsStyle(columnColor) as Style,\n selectedColumnsStyle as Style,\n lineOfSectionStyle as Style,\n ];\n }, [columnColor]);\n\n return h(\n InsetMap,\n {\n ...rest,\n boxZoom: false,\n dragRotate: false,\n overlayStyles,\n },\n [\n h(ColumnsLayer),\n h(SelectedColumnsLayer),\n h(MapClickHandler),\n h(SectionLine, { padding }),\n children,\n ],\n );\n}\n\nfunction MapClickHandler() {\n const onClickMap = useCorrelationMapStore((state) => state.onClickMap);\n\n useMapClickHandler(\n (e) => {\n onClickMap(e, { type: \"Point\", coordinates: e.lngLat.toArray() });\n },\n [onClickMap],\n );\n\n return null;\n}\n\nfunction SelectedColumnsLayer() {\n const focusedColumns = useCorrelationMapStore(\n (state) => state.focusedColumns,\n );\n\n useMapStyleOperator(\n (map) => {\n let features = focusedColumns;\n\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features,\n };\n\n const columnCentroidLine: Feature = {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: features.map(\n (col) => col.properties.centroid.geometry.coordinates,\n ),\n },\n properties: {},\n };\n\n setGeoJSON(map, \"selected-columns\", data);\n setGeoJSON(map, \"selected-column-centroids\", {\n type: \"FeatureCollection\",\n features: [columnCentroidLine],\n });\n },\n [focusedColumns],\n );\n return null;\n}\n\nfunction ColumnsLayer({ enabled = true }) {\n const columns = useCorrelationMapStore((state) => state.columns);\n\n useMapStyleOperator(\n (map) => {\n if (columns == null) {\n return;\n }\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features: columns,\n };\n\n console.log(\" columns\", data);\n setGeoJSON(map, \"columns\", data);\n },\n [columns, enabled],\n );\n return null;\n}\n\nconst selectedColumnsStyle: Style = {\n version: 8,\n sources: {\n \"selected-columns\": buildGeoJSONSource(),\n \"selected-column-centroids\": buildGeoJSONSource(),\n },\n layers: [\n {\n id: \"selected-columns-fill\",\n type: \"fill\",\n source: \"selected-columns\",\n paint: {\n \"fill-color\": \"rgba(255, 0, 0, 0.1)\",\n },\n },\n {\n id: \"selected-column-centroids-line\",\n type: \"line\",\n source: \"selected-column-centroids\",\n paint: {\n \"line-color\": \"rgba(255, 0, 0, 0.8)\",\n \"line-width\": 2,\n \"line-dasharray\": [2, 2],\n },\n },\n {\n id: \"selected-column-centroids-points\",\n type: \"circle\",\n source: \"selected-column-centroids\",\n paint: {\n \"circle-radius\": 4,\n \"circle-color\": \"rgba(255, 0, 0, 0.8)\",\n },\n },\n ],\n};\n\nconst lineOfSectionStyle: Style = {\n version: 8,\n sources: {\n elevationMarker: buildGeoJSONSource(),\n crossSectionLine: buildGeoJSONSource(),\n crossSectionEndpoints: buildGeoJSONSource(),\n },\n layers: buildCrossSectionLayers(),\n};\n\nfunction SectionLine({ padding }: { padding: number }) {\n const focusedLine = useCorrelationMapStore((state) => state.focusedLine);\n\n // Setup focused line\n useMapStyleOperator(\n (map) => {\n if (focusedLine == null) {\n return;\n }\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features: [\n {\n type: \"Feature\",\n geometry: focusedLine,\n properties: { id: \"focusedLine\" },\n },\n ],\n };\n\n setGeoJSON(map, \"crossSectionLine\", data);\n setGeoJSON(map, \"crossSectionEndpoints\", {\n type: \"FeatureCollection\",\n features: focusedLine.coordinates.map((coord) => ({\n type: \"Feature\",\n geometry: { type: \"Point\", coordinates: coord },\n properties: {},\n })),\n });\n },\n [focusedLine],\n );\n\n const bounds = useMemo(() => {\n if (focusedLine == null || focusedLine?.coordinates.length < 2) {\n return null;\n }\n let bounds = new LngLatBounds();\n for (let coord of focusedLine.coordinates) {\n bounds.extend(coord);\n }\n return bounds;\n }, [focusedLine]);\n\n useMapEaseTo({ bounds, padding, trackResize: true });\n\n return null;\n}\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAsBO,SAAS,0CAAqB,KAA0B;IAC7D,MAAM,WAAE,UAAU,cAAI,QAAQ,eAAE,WAAW,aAAE,SAAS,EAAE,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GAAA,iBAAS,EAAE,KAAK,oBAAoB;QACpC,CAAA,GAAA,iBAAS,EAAE,KAAK,yBAAyB;YACvC,MAAM;YACN,UAAU,YAAY,WAAW,CAAC,GAAG,CAAC,CAAC,QAAW,CAAA;oBAChD,MAAM;oBACN,UAAU;wBAAE,MAAM;wBAAS,aAAa;oBAAM;oBAC9C,YAAY,CAAC;gBACf,CAAA;QACF;IACF,GACA;QAAC;KAAY;IAGf,MAAM,SAAS,CAAA,GAAA,cAAM,EAAE;QACrB,IAAI,eAAe,QAAQ,aAAa,YAAY,SAAS,GAC3D,OAAO;QAET,IAAI,SAAS,IAAI,CAAA,GAAA,mBAAW;QAC5B,KAAK,IAAI,SAAS,YAAY,WAAW,CACvC,OAAO,MAAM,CAAC;QAEhB,OAAO;IACT,GAAG;QAAC;KAAY;IAEhB,CAAA,GAAA,mBAAW,EAAE;gBAAE;iBAAQ;QAAS,aAAa;IAAK;IAElD,OAAO;AACT","sources":["packages/column-views/src/maps/column-correlation/core.ts"],"sourcesContent":["import {\n useMapClickHandler,\n useMapEaseTo,\n useMapStyleOperator,\n} from \"@macrostrat/mapbox-react\";\nimport { LngLatBounds, Style } from \"mapbox-gl\";\nimport h from \"@macrostrat/hyper\";\nimport { Feature, FeatureCollection } from \"geojson\";\nimport { ReactNode, useMemo } from \"react\";\nimport { setGeoJSON, buildGeoJSONSource } from \"@macrostrat/mapbox-utils\";\n\nimport { useCorrelationMapStore } from \"./state\";\nimport { buildColumnsStyle, InsetMap, InsetMapProps } from \"../_shared\";\nimport { buildCrossSectionLayers } from \"@macrostrat/map-styles\";\n\nexport interface CorrelationMapProps extends InsetMapProps {\n padding?: number;\n children?: ReactNode;\n accessToken?: string;\n columnColor?: string;\n}\n\nexport function ColumnCorrelationMap(props: CorrelationMapProps) {\n const { padding = 50, children, columnColor, projectID, ...rest } = props;\n\n const overlayStyles: Partial<Style>[] = useMemo(() => {\n return [\n buildColumnsStyle(columnColor) as Style,\n selectedColumnsStyle as Style,\n lineOfSectionStyle as Style,\n ];\n }, [columnColor]);\n\n return h(\n InsetMap,\n {\n ...rest,\n boxZoom: false,\n dragRotate: false,\n overlayStyles,\n },\n [\n h(ColumnsLayer),\n h(SelectedColumnsLayer),\n h(MapClickHandler),\n h(SectionLine, { padding }),\n children,\n ],\n );\n}\n\nfunction MapClickHandler() {\n const onClickMap = useCorrelationMapStore((state) => state.onClickMap);\n\n useMapClickHandler(\n (e) => {\n onClickMap(e, { type: \"Point\", coordinates: e.lngLat.toArray() });\n },\n [onClickMap],\n );\n\n return null;\n}\n\nfunction SelectedColumnsLayer() {\n const focusedColumns = useCorrelationMapStore(\n (state) => state.focusedColumns,\n );\n\n useMapStyleOperator(\n (map) => {\n let features = focusedColumns;\n\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features,\n };\n\n const columnCentroidLine: Feature = {\n type: \"Feature\",\n geometry: {\n type: \"LineString\",\n coordinates: features.map(\n (col) => col.properties.centroid.geometry.coordinates,\n ),\n },\n properties: {},\n };\n\n setGeoJSON(map, \"selected-columns\", data);\n setGeoJSON(map, \"selected-column-centroids\", {\n type: \"FeatureCollection\",\n features: [columnCentroidLine],\n });\n },\n [focusedColumns],\n );\n return null;\n}\n\nfunction ColumnsLayer({ enabled = true }) {\n const columns = useCorrelationMapStore((state) => state.columns);\n\n useMapStyleOperator(\n (map) => {\n if (columns == null) {\n return;\n }\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features: columns,\n };\n\n console.log(\" columns\", data);\n setGeoJSON(map, \"columns\", data);\n },\n [columns, enabled],\n );\n return null;\n}\n\nconst selectedColumnsStyle: Style = {\n version: 8,\n sources: {\n \"selected-columns\": buildGeoJSONSource(),\n \"selected-column-centroids\": buildGeoJSONSource(),\n },\n layers: [\n {\n id: \"selected-columns-fill\",\n type: \"fill\",\n source: \"selected-columns\",\n paint: {\n \"fill-color\": \"rgba(255, 0, 0, 0.1)\",\n },\n },\n {\n id: \"selected-column-centroids-line\",\n type: \"line\",\n source: \"selected-column-centroids\",\n paint: {\n \"line-color\": \"rgba(255, 0, 0, 0.8)\",\n \"line-width\": 2,\n \"line-dasharray\": [2, 2],\n },\n },\n {\n id: \"selected-column-centroids-points\",\n type: \"circle\",\n source: \"selected-column-centroids\",\n paint: {\n \"circle-radius\": 4,\n \"circle-color\": \"rgba(255, 0, 0, 0.8)\",\n },\n },\n ],\n};\n\nconst lineOfSectionStyle: Style = {\n version: 8,\n sources: {\n elevationMarker: buildGeoJSONSource(),\n crossSectionLine: buildGeoJSONSource(),\n crossSectionEndpoints: buildGeoJSONSource(),\n },\n layers: buildCrossSectionLayers(),\n};\n\nfunction SectionLine({ padding }: { padding: number }) {\n const focusedLine = useCorrelationMapStore((state) => state.focusedLine);\n\n // Setup focused line\n useMapStyleOperator(\n (map) => {\n if (focusedLine == null) {\n return;\n }\n const data: FeatureCollection = {\n type: \"FeatureCollection\",\n features: [\n {\n type: \"Feature\",\n geometry: focusedLine,\n properties: { id: \"focusedLine\" },\n },\n ],\n };\n\n setGeoJSON(map, \"crossSectionLine\", data);\n setGeoJSON(map, \"crossSectionEndpoints\", {\n type: \"FeatureCollection\",\n features: focusedLine.coordinates.map((coord) => ({\n type: \"Feature\",\n geometry: { type: \"Point\", coordinates: coord },\n properties: {},\n })),\n });\n },\n [focusedLine],\n );\n\n const bounds = useMemo(() => {\n if (focusedLine == null || focusedLine?.coordinates.length < 2) {\n return null;\n }\n let bounds = new LngLatBounds();\n for (let coord of focusedLine.coordinates) {\n bounds.extend(coord);\n }\n return bounds;\n }, [focusedLine]);\n\n useMapEaseTo({ bounds, padding, trackResize: true });\n\n return null;\n}\n"],"names":[],"version":3,"file":"column-views.337b40a2.js.map"}
|
|
@@ -4,7 +4,17 @@ import {buildGeoJSONSource as $8F7e5$buildGeoJSONSource} from "@macrostrat/mapbo
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
function $1dbfddc9637b572c$export$d2995719c3a4ae17(color) {
|
|
7
|
-
|
|
7
|
+
let columnColor = color ?? (0, $8F7e5$getCSSVariable)("--text-subtle-color", "black");
|
|
8
|
+
const columnSelectedColor = (0, $8F7e5$getCSSVariable)("--selection-color", "purple");
|
|
9
|
+
// If color is in the geojson properties, use that
|
|
10
|
+
columnColor = [
|
|
11
|
+
"coalesce",
|
|
12
|
+
[
|
|
13
|
+
"get",
|
|
14
|
+
"color"
|
|
15
|
+
],
|
|
16
|
+
columnColor
|
|
17
|
+
];
|
|
8
18
|
return {
|
|
9
19
|
sources: {
|
|
10
20
|
columns: (0, $8F7e5$buildGeoJSONSource)()
|
|
@@ -57,7 +67,19 @@ function $1dbfddc9637b572c$export$d2995719c3a4ae17(color) {
|
|
|
57
67
|
source: "columns",
|
|
58
68
|
paint: {
|
|
59
69
|
"circle-radius": 4,
|
|
60
|
-
"circle-color":
|
|
70
|
+
"circle-color": [
|
|
71
|
+
"case",
|
|
72
|
+
[
|
|
73
|
+
"boolean",
|
|
74
|
+
[
|
|
75
|
+
"feature-state",
|
|
76
|
+
"selected"
|
|
77
|
+
],
|
|
78
|
+
false
|
|
79
|
+
],
|
|
80
|
+
columnSelectedColor,
|
|
81
|
+
columnColor
|
|
82
|
+
],
|
|
61
83
|
"circle-opacity": [
|
|
62
84
|
"case",
|
|
63
85
|
[
|
|
@@ -93,4 +115,4 @@ function $1dbfddc9637b572c$export$d2995719c3a4ae17(color) {
|
|
|
93
115
|
|
|
94
116
|
|
|
95
117
|
export {$1dbfddc9637b572c$export$d2995719c3a4ae17 as buildColumnsStyle};
|
|
96
|
-
//# sourceMappingURL=column-views.
|
|
118
|
+
//# sourceMappingURL=column-views.33d35a44.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;AAIO,SAAS,0CAAkB,KAAa;IAC7C,IAAI,cAAc,SAAS,CAAA,GAAA,qBAAa,EAAE,uBAAuB;IACjE,MAAM,sBAAsB,CAAA,GAAA,qBAAa,EAAE,qBAAqB;IAEhE,kDAAkD;IAClD,cAAc;QAAC;QAAY;YAAC;YAAO;SAAQ;QAAE;KAAY;IAEzD,OAAO;QACL,SAAS;YACP,SAAS,CAAA,GAAA,yBAAiB;QAC5B;QACA,SAAS;QACT,QAAQ;YACN;gBACE,IAAI;gBACJ,MAAM;gBACN,QAAQ;gBACR,OAAO;oBACL,cAAc;oBACd,gBAAgB;wBACd;wBACA;4BAAC;4BAAW;gCAAC;gCAAiB;6BAAW;4BAAE;yBAAM;wBACjD;wBACA;4BAAC;4BAAW;gCAAC;gCAAiB;6BAAQ;4BAAE;yBAAM;wBAC9C;wBACA;qBACD;gBACH;YACF;YACA;gBACE,IAAI;gBACJ,MAAM;gBACN,QAAQ;gBACR,OAAO;oBACL,cAAc;oBACd,cAAc;oBACd,gBAAgB;gBAClB;YACF;YACA;gBACE,IAAI;gBACJ,MAAM;gBACN,QAAQ;gBACR,OAAO;oBACL,iBAAiB;oBACjB,gBAAgB;wBACd;wBACA;4BAAC;4BAAW;gCAAC;gCAAiB;6BAAW;4BAAE;yBAAM;wBACjD;wBACA;qBACD;oBACD,kBAAkB;wBAChB;wBACA;4BAAC;4BAAW;gCAAC;gCAAiB;6BAAW;4BAAE;yBAAM;wBACjD;wBACA;4BAAC;4BAAW;gCAAC;gCAAiB;6BAAQ;4BAAE;yBAAM;wBAC9C;wBACA;qBACD;gBACH;gBACA,QAAQ;oBAAC;oBAAM;oBAAS;iBAAQ;YAClC;SACD;IACH;AACF","sources":["packages/column-views/src/maps/_shared/styles.ts"],"sourcesContent":["import { getCSSVariable } from \"@macrostrat/color-utils\";\nimport { buildGeoJSONSource } from \"@macrostrat/mapbox-utils\";\nimport type { Style } from \"mapbox-gl\";\n\nexport function buildColumnsStyle(color: string): Style {\n let columnColor = color ?? getCSSVariable(\"--text-subtle-color\", \"black\");\n const columnSelectedColor = getCSSVariable(\"--selection-color\", \"purple\");\n\n // If color is in the geojson properties, use that\n columnColor = [\"coalesce\", [\"get\", \"color\"], columnColor];\n\n return {\n sources: {\n columns: buildGeoJSONSource(),\n },\n version: 8,\n layers: [\n {\n id: \"columns-fill\",\n type: \"fill\",\n source: \"columns\",\n paint: {\n \"fill-color\": columnColor,\n \"fill-opacity\": [\n \"case\",\n [\"boolean\", [\"feature-state\", \"selected\"], false],\n 0.5,\n [\"boolean\", [\"feature-state\", \"hover\"], false],\n 0.3,\n 0.1,\n ],\n },\n },\n {\n id: \"columns-line\",\n type: \"line\",\n source: \"columns\",\n paint: {\n \"line-color\": columnColor,\n \"line-width\": 2,\n \"line-opacity\": 0.5,\n },\n },\n {\n id: \"columns-points\",\n type: \"circle\",\n source: \"columns\",\n paint: {\n \"circle-radius\": 4,\n \"circle-color\": [\n \"case\",\n [\"boolean\", [\"feature-state\", \"selected\"], false],\n columnSelectedColor,\n columnColor,\n ],\n \"circle-opacity\": [\n \"case\",\n [\"boolean\", [\"feature-state\", \"selected\"], false],\n 1,\n [\"boolean\", [\"feature-state\", \"hover\"], false],\n 0.7,\n 0.5,\n ],\n },\n filter: [\"==\", \"$type\", \"Point\"],\n },\n ],\n };\n}\n"],"names":[],"version":3,"file":"column-views.33d35a44.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {createCompositeScale as $728f6cf6c12cd490$export$3ada7641926a616d} from "./column-views.
|
|
1
|
+
import {createCompositeScale as $728f6cf6c12cd490$export$3ada7641926a616d} from "./column-views.0b3c0d18.js";
|
|
2
2
|
import {allowUnitSelectionAtom as $61771df184788970$export$3c12ff51b216428d, selectedUnitIDAtom as $61771df184788970$export$6d9520abc11d1c2b, UnitSelectionCallbackManager as $61771df184788970$export$1a7a0d00e4ba9c81} from "./column-views.1cd55918.js";
|
|
3
3
|
import {columnUnitsAtom as $c4083056aa697244$export$533095c4f32f2edc, columnUnitsMapAtom as $c4083056aa697244$export$c798b7ff7cb2357b, scope as $c4083056aa697244$export$5cff813ca8e50db9, ScopedProvider as $c4083056aa697244$export$deff48bd299912d9} from "./column-views.67804ce5.js";
|
|
4
4
|
import {useMemo as $a90Ta$useMemo, createContext as $a90Ta$createContext, useContext as $a90Ta$useContext} from "react";
|
|
@@ -110,4 +110,4 @@ function $d5074f164411387e$export$a7fc62995ec4f76() {
|
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
export {$d5074f164411387e$export$ef5395089200109b as MacrostratColumnStateProvider, $d5074f164411387e$export$7fec7bd80ff9c10e as MacrostratColumnDataProvider, $d5074f164411387e$export$f19d75b1d4b676a4 as UnitSelectionProvider, $d5074f164411387e$export$f8509b7cce386c7d as useMacrostratColumnData, $d5074f164411387e$export$6fb40844db555b2 as useMacrostratUnits, $d5074f164411387e$export$7513be0cfd10d9cc as useColumnUnitsMap, $d5074f164411387e$export$a7fc62995ec4f76 as useCompositeScale};
|
|
113
|
-
//# sourceMappingURL=column-views.
|
|
113
|
+
//# sourceMappingURL=column-views.362aae9a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAgCO,SAAS,0CAAkD,YAChE,QAAQ,SACR,KAAK,sBACL,qBAAqB,uBACrB,cAAc,gBACd,YAAY,EACgB;IAC5B;;;GAGC,GAED;;EAEA,GACA,MAAM,kBAAkB,CAAA,GAAA,cAAM,EAAE;QAC9B,IAAI,oBACF,OAAO;QAET,OAAO,gBAAgB,QAAQ,kBAAkB;IACnD,GAAG,EAAE;IAEL,MAAM,UAAmB;QACvB;YAAC,CAAA,GAAA,yCAAc;YAAG;SAAM;QACxB;YAAC,CAAA,GAAA,yCAAqB;YAAG;SAAgB;QACzC;YAAC,CAAA,GAAA,yCAAiB;YAAG;SAAa;KACnC;IAED,IAAI,oBAA+B;IACnC,IAAI,iBACF,oBAAoB,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,yCAA2B,GAAG;wBAAE;IAAe;IAGvE,OAAO,CAAA,GAAA,sBAAA,EACL,CAAA,GAAA,yCAAa,GACb;QACE,OAAO;IACT,GACA;QAAC;QAAmB;KAAS;AAEjC;AAeA,MAAM,oDACJ,CAAA,GAAA,oBAAY,EAAoC;AAE3C,SAAS,0CAAiD,YAC/D,QAAQ,SACR,KAAK,YACL,QAAQ,eACR,WAAW,YACX,QAAQ,sBACR,kBAAkB,kBAClB,cAAc,gBACd,YAAY,EACe;IAC3B;;;;;;;;;KASG,GAEH,MAAM,QAAQ,CAAA,GAAA,cAAM,EAAE;QACpB,uDAAuD;QACvD,OAAO;mBACL;sBACA;yBACA;sBACA;QACF;IACF,GAAG;QAAC;QAAO;QAAU;QAAa;KAAS;IAE3C,OAAO,CAAA,GAAA,sBAAA,EACL,2CACA;eACE;4BACA;wBACA;sBACA;IACF,GACA,CAAA,GAAA,sBAAA,EAAE,kDAA4B,QAAQ,EAAE;eAAE;IAAM,GAAG;AAEvD;AAEO,SAAS,0CAAsB,KAAoC;IACxE;;GAEC,GACD,OAAO,CAAA,GAAA,sBAAA,EAAE,2CAA+B;QACtC,GAAG,KAAK;QACR,oBAAoB;IACtB;AACF;AAEO,SAAS;IACd,MAAM,MAAM,CAAA,GAAA,iBAAS,EAAE;IACvB,IAAI,CAAC,KACH,MAAM,IAAI,MACR;IAGJ,OAAO;AACT;AAEO,SAAS;IACd,OAAO,CAAA,GAAA,yCAAI,EAAE,YAAY,CAAC,CAAA,GAAA,yCAAc;AAC1C;AAEO,SAAS;IACd,IAAI;QACF,OAAO,CAAA,GAAA,yCAAI,EAAE,YAAY,CAAC,CAAA,GAAA,yCAAiB;IAC7C,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEO,SAAS;IACd,MAAM,MAAM;IACZ,OAAO,CAAA,GAAA,cAAM,EACX,IAAM,CAAA,GAAA,yCAAmB,EAAE,IAAI,QAAQ,EAAE,OACzC;QAAC,IAAI,QAAQ;KAAC;AAElB","sources":["packages/column-views/src/data-provider/store.ts"],"sourcesContent":["import { createContext, ReactNode, useContext, useMemo } from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport {\n CompositeColumnScale,\n createCompositeScale,\n} from \"../prepare-units/composite-scale\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport type { ExtUnit, PackageLayoutData } from \"../prepare-units\";\nimport {\n allowUnitSelectionAtom,\n selectedUnitIDAtom,\n UnitSelectionCallbacks,\n UnitSelectionCallbackManager,\n} from \"./unit-selection\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport {\n AtomMap,\n columnUnitsAtom,\n columnUnitsMapAtom,\n scope,\n ScopedProvider,\n} from \"./core\";\n\nexport interface ColumnStateProviderProps<\n T extends BaseUnit,\n> extends Partial<UnitSelectionCallbacks> {\n children: ReactNode;\n units: T[];\n selectedUnit: number | null;\n allowUnitSelection?: boolean;\n}\n\nexport function MacrostratColumnStateProvider<T extends BaseUnit>({\n children,\n units,\n allowUnitSelection = false,\n onUnitSelected,\n selectedUnit,\n}: ColumnStateProviderProps<T>) {\n /** Top-level provider for Macrostrat column data.\n * It is either provided by the Column component itself, or\n * can be hoisted higher in the tree to provide a common data context\n */\n\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */\n const _allowSelection = useMemo(() => {\n if (allowUnitSelection) {\n return true;\n }\n return selectedUnit != null || onUnitSelected != null;\n }, []);\n\n const atomMap: AtomMap = [\n [columnUnitsAtom, units],\n [allowUnitSelectionAtom, _allowSelection],\n [selectedUnitIDAtom, selectedUnit],\n ];\n\n let selectionHandlers: ReactNode = null;\n if (_allowSelection) {\n selectionHandlers = h(UnitSelectionCallbackManager, { onUnitSelected });\n }\n\n return h(\n ScopedProvider,\n {\n atoms: atomMap,\n },\n [selectionHandlers, children],\n );\n}\n\nexport interface MacrostratColumnDataContext<T extends BaseUnit> {\n units: T[];\n sections: PackageLayoutData[];\n totalHeight?: number;\n axisType?: ColumnAxisType;\n allowUnitSelection?: boolean;\n}\n\nexport interface ColumnDataProviderProps<T extends BaseUnit>\n extends MacrostratColumnDataContext<T>, ColumnStateProviderProps<T> {\n children: ReactNode;\n}\n\nconst MacrostratColumnDataContext =\n createContext<MacrostratColumnDataContext<any>>(null);\n\nexport function MacrostratColumnDataProvider<T extends BaseUnit>({\n children,\n units,\n sections,\n totalHeight,\n axisType,\n allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n}: ColumnDataProviderProps<T>) {\n /** Internal provider for Macrostrat column data.\n * As a general rule, we want to provide data and column-axis\n * height calculations through the context, since these need to\n * be accessed by any component that lays out information on the\n * column.\n *\n * Cross-axis layout and view configuration (e.g., showing and hiding\n * of different components or labels) should be handled through passing\n * props to the components themselves.\n * */\n\n const value = useMemo(() => {\n // For now, change ordinal axis types to age axis types\n return {\n units,\n sections,\n totalHeight,\n axisType,\n };\n }, [units, sections, totalHeight, axisType]);\n\n return h(\n MacrostratColumnStateProvider,\n {\n units,\n allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n },\n h(MacrostratColumnDataContext.Provider, { value }, children),\n );\n}\n\nexport function UnitSelectionProvider(props: ColumnStateProviderProps<any>) {\n /* A basic unit selection provider without column data context.\n Mostly for use with the CorrelationChart component.\n */\n return h(MacrostratColumnStateProvider, {\n ...props,\n allowUnitSelection: true,\n });\n}\n\nexport function useMacrostratColumnData() {\n const ctx = useContext(MacrostratColumnDataContext);\n if (!ctx) {\n throw new Error(\n \"useMacrostratColumnData must be used within a MacrostratColumnDataProvider\",\n );\n }\n return ctx;\n}\n\nexport function useMacrostratUnits() {\n return scope.useAtomValue(columnUnitsAtom);\n}\n\nexport function useColumnUnitsMap(): Map<number, ExtUnit> | null {\n try {\n return scope.useAtomValue(columnUnitsMapAtom) as Map<number, ExtUnit>;\n } catch {\n return null;\n }\n}\n\nexport function useCompositeScale(): CompositeColumnScale {\n const ctx = useMacrostratColumnData();\n return useMemo(\n () => createCompositeScale(ctx.sections, true),\n [ctx.sections],\n );\n}\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAgCO,SAAS,0CAAkD,YAChE,QAAQ,SACR,KAAK,sBACL,qBAAqB,uBACrB,cAAc,gBACd,YAAY,EACgB;IAC5B;;;GAGC,GAED;;EAEA,GACA,MAAM,kBAAkB,CAAA,GAAA,cAAM,EAAE;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AAC,CAAA,GAAA,yCAAc;AAC1C;AAEO,SAAS;IACd,IAAI;QACF,OAAO,CAAA,GAAA,yCAAI,EAAE,YAAY,CAAC,CAAA,GAAA,yCAAiB;IAC7C,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEO,SAAS;IACd,MAAM,MAAM;IACZ,OAAO,CAAA,GAAA,cAAM,EACX,IAAM,CAAA,GAAA,yCAAmB,EAAE,IAAI,QAAQ,EAAE,OACzC;QAAC,IAAI,QAAQ;KAAC;AAElB","sources":["packages/column-views/src/data-provider/store.ts"],"sourcesContent":["import { createContext, ReactNode, useContext, useMemo } from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport {\n CompositeColumnScale,\n createCompositeScale,\n} from \"../prepare-units/composite-scale\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport type { ExtUnit, PackageLayoutData } from \"../prepare-units\";\nimport {\n allowUnitSelectionAtom,\n selectedUnitIDAtom,\n UnitSelectionCallbacks,\n UnitSelectionCallbackManager,\n} from \"./unit-selection\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport {\n AtomMap,\n columnUnitsAtom,\n columnUnitsMapAtom,\n scope,\n ScopedProvider,\n} from \"./core\";\n\nexport interface ColumnStateProviderProps<\n T extends BaseUnit,\n> extends Partial<UnitSelectionCallbacks> {\n children: ReactNode;\n units: T[];\n selectedUnit: number | null;\n allowUnitSelection?: boolean;\n}\n\nexport function MacrostratColumnStateProvider<T extends BaseUnit>({\n children,\n units,\n allowUnitSelection = false,\n onUnitSelected,\n selectedUnit,\n}: ColumnStateProviderProps<T>) {\n /** Top-level provider for Macrostrat column data.\n * It is either provided by the Column component itself, or\n * can be hoisted higher in the tree to provide a common data context\n */\n\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */\n const _allowSelection = useMemo(() => {\n if (allowUnitSelection) {\n return true;\n }\n return selectedUnit != null || onUnitSelected != null;\n }, []);\n\n const atomMap: AtomMap = [\n [columnUnitsAtom, units],\n [allowUnitSelectionAtom, _allowSelection],\n [selectedUnitIDAtom, selectedUnit],\n ];\n\n let selectionHandlers: ReactNode = null;\n if (_allowSelection) {\n selectionHandlers = h(UnitSelectionCallbackManager, { onUnitSelected });\n }\n\n return h(\n ScopedProvider,\n {\n atoms: atomMap,\n },\n [selectionHandlers, children],\n );\n}\n\nexport interface MacrostratColumnDataContext<T extends BaseUnit> {\n units: T[];\n sections: PackageLayoutData[];\n totalHeight?: number;\n axisType?: ColumnAxisType;\n allowUnitSelection?: boolean;\n}\n\nexport interface ColumnDataProviderProps<T extends BaseUnit>\n extends MacrostratColumnDataContext<T>, ColumnStateProviderProps<T> {\n children: ReactNode;\n}\n\nconst MacrostratColumnDataContext =\n createContext<MacrostratColumnDataContext<any>>(null);\n\nexport function MacrostratColumnDataProvider<T extends BaseUnit>({\n children,\n units,\n sections,\n totalHeight,\n axisType,\n allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n}: ColumnDataProviderProps<T>) {\n /** Internal provider for Macrostrat column data.\n * As a general rule, we want to provide data and column-axis\n * height calculations through the context, since these need to\n * be accessed by any component that lays out information on the\n * column.\n *\n * Cross-axis layout and view configuration (e.g., showing and hiding\n * of different components or labels) should be handled through passing\n * props to the components themselves.\n * */\n\n const value = useMemo(() => {\n // For now, change ordinal axis types to age axis types\n return {\n units,\n sections,\n totalHeight,\n axisType,\n };\n }, [units, sections, totalHeight, axisType]);\n\n return h(\n MacrostratColumnStateProvider,\n {\n units,\n allowUnitSelection,\n onUnitSelected,\n selectedUnit,\n },\n h(MacrostratColumnDataContext.Provider, { value }, children),\n );\n}\n\nexport function UnitSelectionProvider(props: ColumnStateProviderProps<any>) {\n /* A basic unit selection provider without column data context.\n Mostly for use with the CorrelationChart component.\n */\n return h(MacrostratColumnStateProvider, {\n ...props,\n allowUnitSelection: true,\n });\n}\n\nexport function useMacrostratColumnData() {\n const ctx = useContext(MacrostratColumnDataContext);\n if (!ctx) {\n throw new Error(\n \"useMacrostratColumnData must be used within a MacrostratColumnDataProvider\",\n );\n }\n return ctx;\n}\n\nexport function useMacrostratUnits() {\n return scope.useAtomValue(columnUnitsAtom);\n}\n\nexport function useColumnUnitsMap(): Map<number, ExtUnit> | null {\n try {\n return scope.useAtomValue(columnUnitsMapAtom) as Map<number, ExtUnit>;\n } catch {\n return null;\n }\n}\n\nexport function useCompositeScale(): CompositeColumnScale {\n const ctx = useMacrostratColumnData();\n return useMemo(\n () => createCompositeScale(ctx.sections, true),\n [ctx.sections],\n );\n}\n"],"names":[],"version":3,"file":"column-views.362aae9a.js.map"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {CompositeUnitsColumn as $8c8238faa5cde49c$export$a6684360fef0406e, LabelTrackerProvider as $8c8238faa5cde49c$export$e4e89ab6c86ac513, SectionLabelsColumn as $8c8238faa5cde49c$export$13984e34afdbb040} from "./column-views.
|
|
1
|
+
import {CompositeUnitsColumn as $8c8238faa5cde49c$export$a6684360fef0406e, LabelTrackerProvider as $8c8238faa5cde49c$export$e4e89ab6c86ac513, SectionLabelsColumn as $8c8238faa5cde49c$export$13984e34afdbb040} from "./column-views.e13a0a76.js";
|
|
2
2
|
import $7zu8d$columnviewscc733361js from "./column-views.cc733361.js";
|
|
3
3
|
import "./column-views.e93478c3.css";
|
|
4
|
-
import {MacrostratColumnProvider as $774a5efa27d1c77b$export$9e42f9b6e0d67c7d, useMacrostratBaseURL as $774a5efa27d1c77b$export$33b1392d23dde04} from "./column-views.
|
|
5
|
-
import {useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d, useMacrostratUnits as $d5074f164411387e$export$6fb40844db555b2} from "./column-views.
|
|
6
|
-
import {Duration as $448b24baeef3b229$export$3b11bc38611c5941} from "./column-views.
|
|
4
|
+
import {MacrostratColumnProvider as $774a5efa27d1c77b$export$9e42f9b6e0d67c7d, useMacrostratBaseURL as $774a5efa27d1c77b$export$33b1392d23dde04} from "./column-views.636d6553.js";
|
|
5
|
+
import {useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d, useMacrostratUnits as $d5074f164411387e$export$6fb40844db555b2} from "./column-views.362aae9a.js";
|
|
6
|
+
import {Duration as $448b24baeef3b229$export$3b11bc38611c5941} from "./column-views.85df21ec.js";
|
|
7
7
|
import {useMemo as $7zu8d$useMemo} from "react";
|
|
8
8
|
import {useMacrostratIntervals as $7zu8d$useMacrostratIntervals, Timescale as $7zu8d$Timescale, TimescaleOrientation as $7zu8d$TimescaleOrientation} from "@macrostrat/timescale";
|
|
9
9
|
import {SVG as $7zu8d$SVG, ColumnAxisType as $7zu8d$ColumnAxisType} from "@macrostrat/column-components";
|
|
@@ -245,4 +245,4 @@ function $7d0f52717c0de7e1$var$Unconformity({ upperAge: upperAge, lowerAge: lowe
|
|
|
245
245
|
|
|
246
246
|
|
|
247
247
|
export {$7d0f52717c0de7e1$export$38cb0ab5af8f50d7 as SectionsColumn, $7d0f52717c0de7e1$export$e12e53eeee198b99 as UnconformityLabels, $7d0f52717c0de7e1$export$db2df5a73a6fbe10 as CompositeTimescale, $7d0f52717c0de7e1$export$463f46772c64d403 as CompositeTimescaleCore};
|
|
248
|
-
//# sourceMappingURL=column-views.
|
|
248
|
+
//# sourceMappingURL=column-views.4252a555.js.map
|