@macrostrat/column-views 2.4.0 → 2.4.2
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 +11 -0
- package/dist/esm/{column-views.848349c0.js → column-views.083fb787.js} +5 -5
- package/dist/esm/{column-views.848349c0.js.map → column-views.083fb787.js.map} +1 -1
- package/dist/esm/{column-views.9d0d78aa.js → column-views.088a0274.js} +2 -2
- package/dist/esm/{column-views.9d0d78aa.js.map → column-views.088a0274.js.map} +1 -1
- package/dist/esm/{column-views.f046b170.js → column-views.11353c2c.js} +5 -5
- package/dist/esm/{column-views.f046b170.js.map → column-views.11353c2c.js.map} +1 -1
- package/dist/esm/{column-views.55bce35c.js → column-views.18655508.js} +3 -3
- package/dist/esm/{column-views.55bce35c.js.map → column-views.18655508.js.map} +1 -1
- package/dist/esm/{column-views.2e517e39.js → column-views.1cd55918.js} +91 -11
- package/dist/esm/column-views.1cd55918.js.map +1 -0
- package/dist/esm/column-views.1ef55568.js +15 -0
- package/dist/esm/{column-views.33daabd5.js.map → column-views.1ef55568.js.map} +1 -1
- package/dist/esm/{column-views.3c1cde51.js → column-views.3090f246.js} +22 -4
- package/dist/esm/column-views.3090f246.js.map +1 -0
- package/dist/esm/{column-views.c92a359e.js → column-views.33796541.js} +2 -2
- package/dist/esm/{column-views.c92a359e.js.map → column-views.33796541.js.map} +1 -1
- package/dist/esm/{column-views.e21f4e50.js → column-views.3ae8f23d.js} +2 -2
- package/dist/esm/{column-views.e21f4e50.js.map → column-views.3ae8f23d.js.map} +1 -1
- package/dist/esm/{column-views.fdb3799c.js → column-views.40d3688c.js} +3 -3
- package/dist/esm/{column-views.fdb3799c.js.map → column-views.40d3688c.js.map} +1 -1
- package/dist/esm/{column-views.45acb682.js → column-views.4e9b8594.js} +8 -7
- package/dist/esm/column-views.4e9b8594.js.map +1 -0
- package/dist/esm/{column-views.8c296309.js → column-views.5e1c216f.js} +27 -6
- package/dist/esm/column-views.5e1c216f.js.map +1 -0
- package/dist/esm/{column-views.af89f2b1.js → column-views.5e830e7c.js} +8 -8
- package/dist/esm/{column-views.af89f2b1.js.map → column-views.5e830e7c.js.map} +1 -1
- package/dist/esm/{column-views.3d33ef0f.js → column-views.5ec7294d.js} +3 -3
- package/dist/esm/{column-views.3d33ef0f.js.map → column-views.5ec7294d.js.map} +1 -1
- package/dist/esm/{column-views.9b210fb2.js → column-views.6f0d4f3a.js} +2 -2
- package/dist/esm/{column-views.9b210fb2.js.map → column-views.6f0d4f3a.js.map} +1 -1
- package/dist/esm/{column-views.58b891df.js → column-views.76fb9948.js} +2 -2
- package/dist/esm/{column-views.58b891df.js.map → column-views.76fb9948.js.map} +1 -1
- package/dist/esm/{column-views.1ef0f7e8.js → column-views.77322764.js} +2 -2
- package/dist/esm/{column-views.1ef0f7e8.js.map → column-views.77322764.js.map} +1 -1
- package/dist/esm/{column-views.fc4d28d8.js → column-views.85d57d04.js} +4 -4
- package/dist/esm/{column-views.fc4d28d8.js.map → column-views.85d57d04.js.map} +1 -1
- package/dist/esm/{column-views.1cd57b96.js → column-views.88436022.js} +2 -2
- package/dist/esm/{column-views.1cd57b96.js.map → column-views.88436022.js.map} +1 -1
- package/dist/esm/{column-views.b7b0be88.js → column-views.88b2418b.js} +3 -3
- package/dist/esm/{column-views.b7b0be88.js.map → column-views.88b2418b.js.map} +1 -1
- package/dist/esm/{column-views.8c8f3fe0.js → column-views.8ce33ec6.js} +2 -2
- package/dist/esm/{column-views.8c8f3fe0.js.map → column-views.8ce33ec6.js.map} +1 -1
- package/dist/esm/{column-views.31152763.js → column-views.91c18fe3.js} +20 -11
- package/dist/esm/column-views.91c18fe3.js.map +1 -0
- package/dist/esm/{column-views.3067c5e3.js → column-views.99cb1c41.js} +3 -3
- package/dist/esm/{column-views.3067c5e3.js.map → column-views.99cb1c41.js.map} +1 -1
- package/dist/esm/{column-views.b9c4d94c.js → column-views.ab2cc6cb.js} +27 -14
- package/dist/esm/column-views.ab2cc6cb.js.map +1 -0
- package/dist/esm/{column-views.dda76243.js → column-views.af4278f0.js} +3 -3
- package/dist/esm/{column-views.dda76243.js.map → column-views.af4278f0.js.map} +1 -1
- package/dist/esm/{column-views.b8933ea2.js → column-views.b957dc19.js} +3 -3
- package/dist/esm/{column-views.b8933ea2.js.map → column-views.b957dc19.js.map} +1 -1
- package/dist/esm/{column-views.1f954206.js → column-views.bc83a85d.js} +19 -3
- package/dist/esm/column-views.bc83a85d.js.map +1 -0
- package/dist/esm/{column-views.8168c37d.js → column-views.c1e507e6.js} +2 -2
- package/dist/esm/{column-views.8168c37d.js.map → column-views.c1e507e6.js.map} +1 -1
- package/dist/esm/{column-views.0f910df6.js → column-views.c93b63db.js} +3 -3
- package/dist/esm/column-views.c93b63db.js.map +1 -0
- package/dist/esm/{column-views.4e5746da.js → column-views.ce5251f7.js} +2 -2
- package/dist/esm/{column-views.4e5746da.js.map → column-views.ce5251f7.js.map} +1 -1
- package/dist/esm/{column-views.4099a246.js → column-views.d4e50f74.js} +3 -3
- package/dist/esm/{column-views.4099a246.js.map → column-views.d4e50f74.js.map} +1 -1
- package/dist/esm/{column-views.b3398cca.js → column-views.dd2d5a6d.js} +5 -5
- package/dist/esm/{column-views.b3398cca.js.map → column-views.dd2d5a6d.js.map} +1 -1
- package/dist/esm/{column-views.86b879ba.js → column-views.e6882667.js} +5 -5
- package/dist/esm/{column-views.86b879ba.js.map → column-views.e6882667.js.map} +1 -1
- package/dist/esm/{column-views.1d356b7e.js → column-views.e885211d.js} +2 -2
- package/dist/esm/{column-views.1d356b7e.js.map → column-views.e885211d.js.map} +1 -1
- package/dist/esm/{column-views.631f55d4.js → column-views.ee2fd38f.js} +3 -3
- package/dist/esm/{column-views.631f55d4.js.map → column-views.ee2fd38f.js.map} +1 -1
- package/dist/esm/{column-views.df872a2c.js → column-views.f35c4621.js} +2 -2
- package/dist/esm/{column-views.df872a2c.js.map → column-views.f35c4621.js.map} +1 -1
- package/dist/esm/{column-views.d3a4596e.js → column-views.f56e604d.js} +3 -3
- package/dist/esm/{column-views.d3a4596e.js.map → column-views.f56e604d.js.map} +1 -1
- package/dist/esm/{column-views.28cab78c.js → column-views.f904e6d7.js} +3 -3
- package/dist/esm/{column-views.28cab78c.js.map → column-views.f904e6d7.js.map} +1 -1
- package/dist/esm/{column-views.25713aad.js → column-views.fc4860bd.js} +4 -4
- package/dist/esm/{column-views.25713aad.js.map → column-views.fc4860bd.js.map} +1 -1
- package/dist/esm/{column-views.3c9f5ba9.js → column-views.fedccce9.js} +2 -2
- package/dist/esm/{column-views.3c9f5ba9.js.map → column-views.fedccce9.js.map} +1 -1
- package/dist/esm/index.d.ts +21 -32
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/node/{column-views.a0e23210.js → column-views.003e0c17.js} +2 -2
- package/dist/node/{column-views.a0e23210.js.map → column-views.003e0c17.js.map} +1 -1
- package/dist/node/column-views.080781ca.js +2 -0
- package/dist/node/column-views.080781ca.js.map +1 -0
- package/dist/node/{column-views.dedafcae.js → column-views.0818254f.js} +2 -2
- package/dist/node/{column-views.dedafcae.js.map → column-views.0818254f.js.map} +1 -1
- package/dist/node/{column-views.f749dbd6.js → column-views.0d48f51d.js} +2 -2
- package/dist/node/{column-views.f749dbd6.js.map → column-views.0d48f51d.js.map} +1 -1
- package/dist/node/column-views.18e86c2d.js +2 -0
- package/dist/node/column-views.18e86c2d.js.map +1 -0
- package/dist/node/{column-views.8f5532b0.js → column-views.375529b1.js} +2 -2
- package/dist/node/{column-views.8f5532b0.js.map → column-views.375529b1.js.map} +1 -1
- package/dist/node/{column-views.bd1481f0.js → column-views.39b71a38.js} +2 -2
- package/dist/node/{column-views.bd1481f0.js.map → column-views.39b71a38.js.map} +1 -1
- package/dist/node/{column-views.190241c4.js → column-views.447008d0.js} +2 -2
- package/dist/node/{column-views.190241c4.js.map → column-views.447008d0.js.map} +1 -1
- package/dist/node/{column-views.e4e014cd.js → column-views.4d573ded.js} +2 -2
- package/dist/node/{column-views.e4e014cd.js.map → column-views.4d573ded.js.map} +1 -1
- package/dist/node/{column-views.a54c0820.js → column-views.4d8fc443.js} +2 -2
- package/dist/node/{column-views.a54c0820.js.map → column-views.4d8fc443.js.map} +1 -1
- package/dist/node/{column-views.69ddf14d.js → column-views.54f7a243.js} +2 -2
- package/dist/node/{column-views.69ddf14d.js.map → column-views.54f7a243.js.map} +1 -1
- package/dist/node/column-views.58b336f1.js +2 -0
- package/dist/node/column-views.58b336f1.js.map +1 -0
- package/dist/node/{column-views.ed7b4c16.js → column-views.5908556a.js} +2 -2
- package/dist/node/{column-views.ed7b4c16.js.map → column-views.5908556a.js.map} +1 -1
- package/dist/node/{column-views.0980c2a0.js → column-views.5c02450b.js} +2 -2
- package/dist/node/{column-views.0980c2a0.js.map → column-views.5c02450b.js.map} +1 -1
- package/dist/node/column-views.5e73411d.js +2 -0
- package/dist/node/column-views.5e73411d.js.map +1 -0
- package/dist/node/{column-views.fcf2be3c.js → column-views.5f3f8ccf.js} +2 -2
- package/dist/node/{column-views.fcf2be3c.js.map → column-views.5f3f8ccf.js.map} +1 -1
- package/dist/node/{column-views.b7f69f19.js → column-views.6051e986.js} +2 -2
- package/dist/node/{column-views.b7f69f19.js.map → column-views.6051e986.js.map} +1 -1
- package/dist/node/{column-views.89afd6b3.js → column-views.64fc40d6.js} +2 -2
- package/dist/node/{column-views.89afd6b3.js.map → column-views.64fc40d6.js.map} +1 -1
- package/dist/node/{column-views.3ce34544.js → column-views.66663668.js} +2 -2
- package/dist/node/{column-views.3ce34544.js.map → column-views.66663668.js.map} +1 -1
- package/dist/node/{column-views.7ee01d2b.js → column-views.6f0cb059.js} +2 -2
- package/dist/node/{column-views.7ee01d2b.js.map → column-views.6f0cb059.js.map} +1 -1
- package/dist/node/{column-views.07680def.js → column-views.72c3c6e7.js} +2 -2
- package/dist/node/{column-views.07680def.js.map → column-views.72c3c6e7.js.map} +1 -1
- package/dist/node/{column-views.6d6a8fde.js → column-views.74fcfb9c.js} +2 -2
- package/dist/node/{column-views.6d6a8fde.js.map → column-views.74fcfb9c.js.map} +1 -1
- package/dist/node/{column-views.00c19fe8.js → column-views.784bac2a.js} +2 -2
- package/dist/node/{column-views.00c19fe8.js.map → column-views.784bac2a.js.map} +1 -1
- package/dist/node/{column-views.b3aa406d.js → column-views.796fc1de.js} +2 -2
- package/dist/node/{column-views.b3aa406d.js.map → column-views.796fc1de.js.map} +1 -1
- package/dist/node/column-views.7b6e7d82.js +2 -0
- package/dist/node/column-views.7b6e7d82.js.map +1 -0
- package/dist/node/{column-views.00caa49a.js → column-views.7e895e1a.js} +2 -2
- package/dist/node/{column-views.00caa49a.js.map → column-views.7e895e1a.js.map} +1 -1
- package/dist/node/column-views.87d31e0a.js +2 -0
- package/dist/node/column-views.87d31e0a.js.map +1 -0
- package/dist/node/{column-views.4e677bc4.js → column-views.94c8ce3e.js} +2 -2
- package/dist/node/{column-views.4e677bc4.js.map → column-views.94c8ce3e.js.map} +1 -1
- package/dist/node/{column-views.48a3cfa3.js → column-views.951e3e9a.js} +2 -2
- package/dist/node/{column-views.48a3cfa3.js.map → column-views.951e3e9a.js.map} +1 -1
- package/dist/node/{column-views.97f7f353.js → column-views.b6613ab0.js} +2 -2
- package/dist/node/{column-views.97f7f353.js.map → column-views.b6613ab0.js.map} +1 -1
- package/dist/node/{column-views.d529d3aa.js → column-views.b762c9a8.js} +2 -2
- package/dist/node/{column-views.d529d3aa.js.map → column-views.b762c9a8.js.map} +1 -1
- package/dist/node/{column-views.e1481ea6.js → column-views.bdf05ed4.js} +2 -2
- package/dist/node/{column-views.e1481ea6.js.map → column-views.bdf05ed4.js.map} +1 -1
- package/dist/node/{column-views.1d1d6117.js → column-views.d30231cb.js} +2 -2
- package/dist/node/{column-views.1d1d6117.js.map → column-views.d30231cb.js.map} +1 -1
- package/dist/node/column-views.d86e6c7d.js +2 -0
- package/dist/node/column-views.d86e6c7d.js.map +1 -0
- package/dist/node/column-views.db3377d8.js +2 -0
- package/dist/node/column-views.db3377d8.js.map +1 -0
- package/dist/node/{column-views.60dc38f3.js → column-views.f4063bc8.js} +2 -2
- package/dist/node/{column-views.60dc38f3.js.map → column-views.f4063bc8.js.map} +1 -1
- package/dist/node/{column-views.9a408bbf.js → column-views.f93b4175.js} +2 -2
- package/dist/node/{column-views.9a408bbf.js.map → column-views.f93b4175.js.map} +1 -1
- package/dist/node/{column-views.b9900855.js → column-views.fa5ee6de.js} +2 -2
- package/dist/node/{column-views.b9900855.js.map → column-views.fa5ee6de.js.map} +1 -1
- package/dist/node/{column-views.705f66b1.js → column-views.fe7a5452.js} +2 -2
- package/dist/node/{column-views.705f66b1.js.map → column-views.fe7a5452.js.map} +1 -1
- package/dist/node/column-views.ffbffec7.js +2 -0
- package/dist/node/column-views.ffbffec7.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +6 -5
- package/src/correlation-chart/main.ts +13 -4
- package/src/correlation-chart/stories/correlation-chart.stories.ts +38 -17
- package/src/data-provider/base.ts +22 -0
- package/src/data-provider/fetch.ts +35 -10
- package/src/data-provider/unit-selection.ts +147 -14
- package/src/maps/column-correlation/core.ts +1 -1
- package/src/maps/column-correlation/state.ts +16 -1
- package/src/unit-details/panel.ts +44 -26
- package/src/unit-details/popover.ts +13 -5
- package/dist/esm/column-views.0f910df6.js.map +0 -1
- package/dist/esm/column-views.1f954206.js.map +0 -1
- package/dist/esm/column-views.2e517e39.js.map +0 -1
- package/dist/esm/column-views.31152763.js.map +0 -1
- package/dist/esm/column-views.33daabd5.js +0 -15
- package/dist/esm/column-views.3c1cde51.js.map +0 -1
- package/dist/esm/column-views.45acb682.js.map +0 -1
- package/dist/esm/column-views.8c296309.js.map +0 -1
- package/dist/esm/column-views.b9c4d94c.js.map +0 -1
- package/dist/node/column-views.1495397b.js +0 -2
- package/dist/node/column-views.1495397b.js.map +0 -1
- package/dist/node/column-views.26306041.js +0 -2
- package/dist/node/column-views.26306041.js.map +0 -1
- package/dist/node/column-views.41d72280.js +0 -2
- package/dist/node/column-views.41d72280.js.map +0 -1
- package/dist/node/column-views.68fe4814.js +0 -2
- package/dist/node/column-views.68fe4814.js.map +0 -1
- package/dist/node/column-views.7425d37b.js +0 -2
- package/dist/node/column-views.7425d37b.js.map +0 -1
- package/dist/node/column-views.7714173b.js +0 -2
- package/dist/node/column-views.7714173b.js.map +0 -1
- package/dist/node/column-views.861b8e3e.js +0 -2
- package/dist/node/column-views.861b8e3e.js.map +0 -1
- package/dist/node/column-views.bf90c8a3.js +0 -2
- package/dist/node/column-views.bf90c8a3.js.map +0 -1
- package/dist/node/column-views.bfaf5ddb.js +0 -2
- package/dist/node/column-views.bfaf5ddb.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76} from "./column-views.
|
|
1
|
+
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76} from "./column-views.c1e507e6.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.8ce33ec6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAMA,MAAM,iCAAW,CAAC,OAAO;IACvB,MAAM,SAAS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CAAmB,SAAU,KAAK;IACtC,MAAM,gBAAE,YAAY,EAAE,GAAG,CAAA,GAAA,iBAAS,EAAE;IACpC,MAAM,SAAE,KAAK,eAAE,WAAW,EAAE,GAAG,MAAM,GAAG;IACxC,MAAM,MAAM,aAAa;IACzB,IAAI,OAAO,MAAM,OAAO;IACxB,MAAM,CAAC,IAAI,GAAG,GAAG;IAEjB,OAAO,CAAA,GAAA,sBAAA,EAAE,UAAU;QACjB,KAAK,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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H,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.8ce33ec6.js.map"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {UnitKeyboardNavigation as $61771df184788970$export$70f5ee19650fc7d1, useColumnRef as $61771df184788970$export$ab00b48759e36cb4, useUnitSelectionDispatch as $61771df184788970$export$77a278d5ca56e309} from "./column-views.
|
|
2
|
-
import {UnitSelectionProvider as $d5074f164411387e$export$f19d75b1d4b676a4} from "./column-views.
|
|
3
|
-
import {
|
|
1
|
+
import {UnitKeyboardNavigation as $61771df184788970$export$70f5ee19650fc7d1, useColumnRef as $61771df184788970$export$ab00b48759e36cb4, useUnitSelectionDispatch as $61771df184788970$export$77a278d5ca56e309} from "./column-views.1cd55918.js";
|
|
2
|
+
import {UnitSelectionProvider as $d5074f164411387e$export$f19d75b1d4b676a4} from "./column-views.c1e507e6.js";
|
|
3
|
+
import {UnitDetailsFeature as $448b24baeef3b229$export$ec297f6f9a6ccad0} from "./column-views.ab2cc6cb.js";
|
|
4
|
+
import {UnitSelectionPopover as $a9bcb536274d1bf9$export$db1115efab13710d} from "./column-views.4e9b8594.js";
|
|
4
5
|
import "./column-views.338a7a83.css";
|
|
5
6
|
import $2d5zd$columnviews6a954628js from "./column-views.6a954628.js";
|
|
6
|
-
import {CompositeTimescaleCore as $7d0f52717c0de7e1$export$463f46772c64d403} from "./column-views.
|
|
7
|
+
import {CompositeTimescaleCore as $7d0f52717c0de7e1$export$463f46772c64d403} from "./column-views.083fb787.js";
|
|
7
8
|
import {buildCorrelationChartData as $2c6a8e6a98a077ae$export$7f21dc14b8199dc0, findLaterallyExtensiveUnits as $2c6a8e6a98a077ae$export$cc5d9b95e199a6de, splitStratIntoBoxes as $2c6a8e6a98a077ae$export$3e71a3125322d04b} from "./column-views.275ba52b.js";
|
|
8
|
-
import {CompositeAgeAxisCore as $43794af7643cdf40$export$ac30ca3cf5df959d} from "./column-views.
|
|
9
|
-
import {ColoredUnitComponent as $4c8184c4a7317749$export$6012fd1584b5d0c0} from "./column-views.
|
|
10
|
-
import {UnitBoxes as $d254716a820e9c85$export$5d1cdfabe8dc8085} from "./column-views.
|
|
11
|
-
import {ColumnContainer as $2118f0266dc7e955$export$2194471aa3d52446} from "./column-views.
|
|
9
|
+
import {CompositeAgeAxisCore as $43794af7643cdf40$export$ac30ca3cf5df959d} from "./column-views.88b2418b.js";
|
|
10
|
+
import {ColoredUnitComponent as $4c8184c4a7317749$export$6012fd1584b5d0c0} from "./column-views.e6882667.js";
|
|
11
|
+
import {UnitBoxes as $d254716a820e9c85$export$5d1cdfabe8dc8085} from "./column-views.40d3688c.js";
|
|
12
|
+
import {ColumnContainer as $2118f0266dc7e955$export$2194471aa3d52446} from "./column-views.5e830e7c.js";
|
|
12
13
|
import $2d5zd$macrostrathyper from "@macrostrat/hyper";
|
|
13
14
|
import {useMemo as $2d5zd$useMemo} from "react";
|
|
14
15
|
import {useInDarkMode as $2d5zd$useInDarkMode} from "@macrostrat/ui-components";
|
|
@@ -40,6 +41,12 @@ function $ed7dc56184962590$var$MainChartArea({ children: children }) {
|
|
|
40
41
|
ref: columnRef
|
|
41
42
|
}, children);
|
|
42
43
|
}
|
|
44
|
+
const $ed7dc56184962590$var$unitPopoverFeatures = new Set([
|
|
45
|
+
(0, $448b24baeef3b229$export$ec297f6f9a6ccad0).AdjacentUnits,
|
|
46
|
+
(0, $448b24baeef3b229$export$ec297f6f9a6ccad0).OutcropType,
|
|
47
|
+
(0, $448b24baeef3b229$export$ec297f6f9a6ccad0).DepthRange,
|
|
48
|
+
(0, $448b24baeef3b229$export$ec297f6f9a6ccad0).ColumnName
|
|
49
|
+
]);
|
|
43
50
|
function $ed7dc56184962590$export$9ebf875c09445bec({ data: data, columnSpacing: columnSpacing = 0, columnWidth: columnWidth = 130, unconformityLabels: unconformityLabels = true, showUnitPopover: showUnitPopover = true, selectedUnit: selectedUnit, onUnitSelected: onUnitSelected, unitComponent: unitComponent, ...scaleProps }) {
|
|
44
51
|
const defaultScaleProps = {
|
|
45
52
|
targetUnitHeight: 10,
|
|
@@ -102,10 +109,12 @@ function $ed7dc56184962590$export$9ebf875c09445bec({ data: data, columnSpacing:
|
|
|
102
109
|
unitComponent: unitComponent
|
|
103
110
|
});
|
|
104
111
|
})),
|
|
105
|
-
$ed7dc56184962590$var$h.if(showUnitPopover)((0, $a9bcb536274d1bf9$export$db1115efab13710d)
|
|
112
|
+
$ed7dc56184962590$var$h.if(showUnitPopover)((0, $a9bcb536274d1bf9$export$db1115efab13710d), {
|
|
113
|
+
features: $ed7dc56184962590$var$unitPopoverFeatures
|
|
114
|
+
}),
|
|
106
115
|
// Navigation only works within a column for now...
|
|
107
116
|
$ed7dc56184962590$var$h((0, $61771df184788970$export$70f5ee19650fc7d1), {
|
|
108
|
-
|
|
117
|
+
columnData: data
|
|
109
118
|
})
|
|
110
119
|
])
|
|
111
120
|
])));
|
|
@@ -228,4 +237,4 @@ function $ed7dc56184962590$var$TimescaleColumn(props) {
|
|
|
228
237
|
|
|
229
238
|
|
|
230
239
|
export {$ed7dc56184962590$export$9ebf875c09445bec as CorrelationChart};
|
|
231
|
-
//# sourceMappingURL=column-views.
|
|
240
|
+
//# sourceMappingURL=column-views.91c18fe3.js.map
|
|
@@ -0,0 +1 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AE,aAAa,EAAE;IACxE,MAAM,SAAE,KAAK,SAAE,KAAK,mBAAE,eAAe,SAAE,KAAK,EAAE,GAAG;IACjD,+BAA+B;IAC/B,MAAM,QAAwB,CAAA,GAAA,yCAAkB,EAAE;IAElD,OAAO,wBACL,gCACA,MAAM,GAAG,CAAC,CAAC,GAAG;QACZ,OAAO,wBAAE,oCAAc;mBACrB;YACA,MAAM;wBACN;YACA,KAAK;2BACL;QACF;IACF;AAEJ;AAEA,SAAS,mCAAa,QACpB,IAAI,SACJ,KAAK,eACL,cAAc,oBACd,gBAAgB,eAChB,aAAa,GACd;IACC,MAAM,YAAE,QAAQ,UAAE,MAAM,mBAAE,eAAe,SAAE,KAAK,SAAE,KAAK,EAAE,GAAG;IAC5D,MAAM,MAAM,MAAM;IAClB,MAAM,OAAO,WAAY,CAAA,cAAc,aAAY;IACnD,MAAM,QAAQ,AAAC,CAAA,SAAS,WAAW,CAAA,IAAM,CAAA,cAAc,aAAY;IACnE,MAAM,SAAS,AAAC,CAAA,QAAQ,KAAI,IAAK;IACjC,OAAO,wBACL,sBACA;QAAE,OAAO;iBAAE;oBAAK;mBAAQ;kBAAO;QAAK;IAAE,GACtC;AAEJ;AAEA,SAAS,gCAAU,YAAE,QAAQ,EAAE;IAC7B,MAAM,kBAAkB,CAAA,GAAA,yCAAuB;IAE/C,OAAO,wBACL,+BACA;QACE;YACE,gBAAgB,MAAM;QACxB;IACF,GACA;AAEJ;AAQA,SAAS,sCAAgB,KAA2B;IAClD,MAAM,aAAE,SAAS,sBAAE,qBAAqB,MAAM,GAAG;IACjD,OAAO,wBAAE,2CAA2C;QAClD,wBAAE,CAAA,GAAA,yCAAmB,GAAG;YAAE,GAAG,SAAS;QAAC;QACvC,wBAAE,CAAA,GAAA,yCAAqB,GAAG;YAAE,GAAG,SAAS;gCAAE;QAAmB;KAC9D;AACH","sources":["packages/column-views/src/correlation-chart/main.ts"],"sourcesContent":["/** Correlation chart */\nimport {\n UnitSelectionProvider,\n UnitKeyboardNavigation,\n useUnitSelectionDispatch,\n useColumnRef,\n} from \"../data-provider\";\nimport { UnitDetailsFeature, UnitSelectionPopover } from \"../unit-details\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useMemo } from \"react\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport { CompositeTimescaleCore } from \"../section\";\nimport classNames from \"classnames\";\nimport {\n findLaterallyExtensiveUnits,\n splitStratIntoBoxes,\n UnitGroupBox,\n CorrelationChartSettings,\n buildCorrelationChartData,\n} from \"./prepare-data\";\nimport {\n CompositeAgeAxisCore,\n CompositeStratigraphicScaleInfo,\n} from \"../age-axis\";\nimport {\n ColumnAxisType,\n ColumnProvider,\n SVG,\n} from \"@macrostrat/column-components\";\nimport { ColoredUnitComponent } from \"../units\";\nimport { UnitBoxes } from \"../units/boxes\";\nimport { ColumnContainer } from \"../column\";\nimport { ColumnData } from \"../data-provider\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\nimport { ExtUnit } from \"../prepare-units/types\";\n\nconst h = hyper.styled(styles);\n\nexport interface CorrelationChartProps extends CorrelationChartSettings {\n data: ColumnData[];\n columnWidth?: number;\n columnSpacing?: number;\n targetUnitHeight?: number;\n unconformityLabels?: boolean;\n selectedUnit?: number | null;\n showUnitPopover?: boolean;\n unitComponent?: any;\n onUnitSelected?: (unitID: number | null, unit: BaseUnit | null) => void;\n}\n\nfunction MainChartArea({ children }) {\n const columnRef = useColumnRef();\n return h(\"div.main-chart\", { ref: columnRef }, children);\n}\n\nconst unitPopoverFeatures = new Set([\n UnitDetailsFeature.AdjacentUnits,\n UnitDetailsFeature.OutcropType,\n UnitDetailsFeature.DepthRange,\n UnitDetailsFeature.ColumnName,\n]);\n\nexport function CorrelationChart({\n data,\n columnSpacing = 0,\n columnWidth = 130,\n unconformityLabels = true,\n showUnitPopover = true,\n selectedUnit,\n onUnitSelected,\n unitComponent,\n ...scaleProps\n}: CorrelationChartProps) {\n const defaultScaleProps = {\n targetUnitHeight: 10,\n unconformityHeight: 60,\n minSectionHeight: 60,\n collapseSmallUnconformities: true,\n };\n\n const chartData = useMemo(() => {\n if (!data) return null;\n return buildCorrelationChartData(data, {\n ...defaultScaleProps,\n ...scaleProps,\n });\n }, [data, ...Object.values(scaleProps)]);\n\n // A flattened units array is used to support keyboard navigation\n const units = useMemo(() => {\n return data?.map((d0) => d0.units).flat() ?? [];\n }, [data]);\n\n const inDarkMode = useInDarkMode();\n\n const className = classNames({\n \"dark-mode\": inDarkMode,\n });\n\n if (chartData == null) {\n return null;\n }\n\n const { packages, scaleInfo, nColumns } = chartData;\n\n const mainWidth = (columnWidth + columnSpacing) * nColumns;\n\n return h(\n ColumnContainer,\n { className: \"correlation-diagram\" },\n h(\n UnitSelectionProvider,\n { selectedUnit, onUnitSelected, units },\n h(ChartArea, [\n h(TimescaleColumn, {\n key: \"timescale\",\n scaleInfo,\n unconformityLabels,\n }),\n h(MainChartArea, [\n h(\n SVG,\n {\n className,\n innerWidth: mainWidth,\n height: scaleInfo.totalHeight,\n paddingH: 4,\n },\n packages.map((pkg, i) => {\n const { offset, domain, pixelScale, scale, key } =\n scaleInfo.packages[i];\n return h(Package, {\n columnData: pkg.columnData,\n key,\n columnWidth,\n columnSpacing,\n offset,\n domain,\n pixelScale,\n scale,\n unitComponent,\n });\n }),\n ),\n h.if(showUnitPopover)(UnitSelectionPopover, {\n features: unitPopoverFeatures,\n }),\n // Navigation only works within a column for now...\n h(UnitKeyboardNavigation, { columnData: data }),\n ]),\n ]),\n ),\n );\n}\n\nfunction Package({\n columnData,\n columnSpacing,\n columnWidth,\n unitComponent,\n offset,\n domain,\n pixelScale,\n scale,\n}) {\n return h(\"g.package\", { transform: `translate(0 ${offset})` }, [\n // Disable the SVG overlay for now\n //h(PackageSVGOverlay, { data, columnSpacing }),\n h(\"g.column-units\", [\n columnData.map((data, i) => {\n return h(Column, {\n units: data.units,\n unitComponent,\n width: columnWidth,\n key: i,\n domain,\n pixelScale,\n scale,\n offsetLeft: i * (columnWidth + columnSpacing),\n });\n }),\n ]),\n ]);\n}\n\ninterface ColumnProps {\n units: ExtUnit[];\n unitComponent?: React.FunctionComponent<any>;\n unitComponentProps?: any;\n showLabels?: boolean;\n width?: number;\n columnWidth?: number;\n columnSpacing?: number;\n targetUnitHeight?: number;\n offsetLeft?: number;\n domain: [number, number];\n pixelScale: number;\n scale?: ScaleContinuousNumeric<number, number>;\n}\n\nfunction Column(props: ColumnProps) {\n const {\n units,\n width = 150,\n offsetLeft,\n domain,\n pixelScale,\n scale,\n unitComponent = ColoredUnitComponent,\n } = props;\n\n const columnWidth = width;\n\n if (units.length == 0) {\n return null;\n }\n\n return h(\n \"g.section\",\n {\n transform: `translate(${offsetLeft} 0)`,\n },\n h(\n ColumnProvider,\n {\n // Need to tighten up types here...\n divisions: units as any[],\n range: domain,\n scale,\n pixelsPerMeter: pixelScale, // Actually pixels per myr\n axisType: ColumnAxisType.AGE,\n },\n h(UnitBoxes, {\n unitComponent,\n unitComponentProps: {\n nColumns: 2,\n width: columnWidth,\n showLabel: false,\n },\n }),\n ),\n );\n}\n\nfunction PackageSVGOverlay({ data, columnWidth = 100, columnSpacing = 0 }) {\n const { b_age, t_age, bestPixelScale, columnData } = data;\n\n const width = (columnWidth + columnSpacing) * columnData.length;\n const height = Math.ceil((b_age - t_age) * bestPixelScale) + 2;\n\n const extensiveUnits = findLaterallyExtensiveUnits(data);\n\n const scale = (val: number) => {\n return (val - t_age) * bestPixelScale;\n };\n\n return h(\n \"div.package-overlay\",\n { style: { width, height } },\n extensiveUnits.map((d) => {\n return h(LaterallyExtensiveUnit, {\n data: d,\n scale,\n pixelScale: bestPixelScale,\n columnSpacing,\n });\n }),\n );\n}\n\nfunction LaterallyExtensiveUnit({ data, scale, pixelScale, columnSpacing }) {\n const { b_age, t_age, strat_name_long, units } = data;\n // Build boxes by column groups\n const boxes: UnitGroupBox[] = splitStratIntoBoxes(data);\n\n return h(\n \"div.laterally-extensive-unit\",\n boxes.map((d, i) => {\n return h(StratColSpan, {\n scale,\n data: d,\n pixelScale,\n key: i,\n columnSpacing,\n });\n }),\n );\n}\n\nfunction StratColSpan({\n data,\n scale,\n columnWidth = 100,\n columnSpacing = 0,\n pixelScale = 1,\n}) {\n const { startCol, endCol, strat_name_long, t_age, b_age } = data;\n const top = scale(t_age);\n const left = startCol * (columnWidth + columnSpacing);\n const width = (endCol - startCol + 1) * (columnWidth + columnSpacing);\n const height = (b_age - t_age) * pixelScale;\n return h(\n \"div.strat-col-span\",\n { style: { top, height, width, left } },\n strat_name_long,\n );\n}\n\nfunction ChartArea({ children }) {\n const setSelectedUnit = useUnitSelectionDispatch();\n\n return h(\n \"div.correlation-chart-inner\",\n {\n onClick() {\n setSelectedUnit(null, null);\n },\n },\n children,\n );\n}\n\ninterface TimescaleColumnProps {\n scaleInfo: CompositeStratigraphicScaleInfo;\n showLabels?: boolean;\n unconformityLabels?: boolean;\n}\n\nfunction TimescaleColumn(props: TimescaleColumnProps) {\n const { scaleInfo, unconformityLabels = true } = props;\n return h(\"div.column-container.age-axis-container\", [\n h(CompositeAgeAxisCore, { ...scaleInfo }),\n h(CompositeTimescaleCore, { ...scaleInfo, unconformityLabels }),\n ]);\n}\n"],"names":[],"version":3,"file":"column-views.91c18fe3.js.map"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {ColumnNotesProvider as $8c8238faa5cde49c$export$6cc7a9df4edde18} from "./column-views.
|
|
2
|
-
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d} from "./column-views.
|
|
1
|
+
import {ColumnNotesProvider as $8c8238faa5cde49c$export$6cc7a9df4edde18} from "./column-views.11353c2c.js";
|
|
2
|
+
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d} from "./column-views.c1e507e6.js";
|
|
3
3
|
import $aB7pQ$macrostrathyper from "@macrostrat/hyper";
|
|
4
4
|
import {SVG as $aB7pQ$SVG, NotesColumn as $aB7pQ$NotesColumn} from "@macrostrat/column-components";
|
|
5
5
|
|
|
@@ -35,4 +35,4 @@ function $9e52fe4012c88296$export$fc5babae10f3f77d({ notes: notes, width: width
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
export {$9e52fe4012c88296$export$fc5babae10f3f77d as ColumnNotes};
|
|
38
|
-
//# sourceMappingURL=column-views.
|
|
38
|
+
//# sourceMappingURL=column-views.99cb1c41.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAkBO,SAAS,0CAAY,SAC1B,KAAK,SACL,QAAQ,oBACR,aAAa,eACb,cAAc,8BACd,wBAAwB,wBACxB,oBAAoB,YACpB,QAAQ,EACS;IACjB,MAAM,eAAE,WAAW,EAAE,GAAG,CAAA,GAAA,yCAAsB;IAC9C,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,OAAO,CAAA,GAAA,sBAAA,EACL,CAAA,GAAA,wCAAkB,GAClB;eACE;qBACA;QACA,YAAY;IACd,GACA;QACE,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,UAAE,GAAG;mBAAE;YAAO,QAAQ;YAAa,UAAU;QAAE,GAAG;YAClD,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,kBAAU,GAAG;uBACb;uBACA;+BACA;6BACA;0CACA;sCACA;YACF;SACD;QACD;KACD;AAEL","sources":["packages/column-views/src/notes.ts"],"sourcesContent":["import h from \"@macrostrat/hyper\";\n\nimport { ColumnNotesProvider } from \"./units\";\n\nimport { NotesColumn, SVG } from \"@macrostrat/column-components\";\nimport { useCompositeScale, useMacrostratColumnData } from \"./data-provider\";\nimport type { ComponentType, ReactNode } from \"react\";\n\ninterface ColumnNotesProps {\n notes: any[];\n width?: number;\n noteComponent?: any;\n paddingLeft?: number;\n deltaConnectorAttachment?: number;\n children?: ReactNode;\n focusedNoteComponent?: ComponentType<any> | null;\n}\n\nexport function ColumnNotes({\n notes,\n width = 200,\n noteComponent,\n paddingLeft = 60,\n deltaConnectorAttachment,\n focusedNoteComponent,\n children,\n}: ColumnNotesProps) {\n const { totalHeight } = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n return h(\n ColumnNotesProvider,\n {\n scale,\n totalHeight,\n pixelScale: -1,\n },\n [\n h(SVG, { width, height: totalHeight, paddingH: 4 }, [\n h(NotesColumn, {\n width,\n notes,\n noteComponent,\n paddingLeft,\n deltaConnectorAttachment,\n focusedNoteComponent,\n }),\n ]),\n children,\n ],\n );\n}\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;AAkBO,SAAS,0CAAY,SAC1B,KAAK,SACL,QAAQ,oBACR,aAAa,eACb,cAAc,8BACd,wBAAwB,wBACxB,oBAAoB,YACpB,QAAQ,EACS;IACjB,MAAM,eAAE,WAAW,EAAE,GAAG,CAAA,GAAA,yCAAsB;IAC9C,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,OAAO,CAAA,GAAA,sBAAA,EACL,CAAA,GAAA,wCAAkB,GAClB;eACE;qBACA;QACA,YAAY;IACd,GACA;QACE,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,UAAE,GAAG;mBAAE;YAAO,QAAQ;YAAa,UAAU;QAAE,GAAG;YAClD,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,kBAAU,GAAG;uBACb;uBACA;+BACA;6BACA;0CACA;sCACA;YACF;SACD;QACD;KACD;AAEL","sources":["packages/column-views/src/notes.ts"],"sourcesContent":["import h from \"@macrostrat/hyper\";\n\nimport { ColumnNotesProvider } from \"./units\";\n\nimport { NotesColumn, SVG } from \"@macrostrat/column-components\";\nimport { useCompositeScale, useMacrostratColumnData } from \"./data-provider\";\nimport type { ComponentType, ReactNode } from \"react\";\n\ninterface ColumnNotesProps {\n notes: any[];\n width?: number;\n noteComponent?: any;\n paddingLeft?: number;\n deltaConnectorAttachment?: number;\n children?: ReactNode;\n focusedNoteComponent?: ComponentType<any> | null;\n}\n\nexport function ColumnNotes({\n notes,\n width = 200,\n noteComponent,\n paddingLeft = 60,\n deltaConnectorAttachment,\n focusedNoteComponent,\n children,\n}: ColumnNotesProps) {\n const { totalHeight } = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n return h(\n ColumnNotesProvider,\n {\n scale,\n totalHeight,\n pixelScale: -1,\n },\n [\n h(SVG, { width, height: totalHeight, paddingH: 4 }, [\n h(NotesColumn, {\n width,\n notes,\n noteComponent,\n paddingLeft,\n deltaConnectorAttachment,\n focusedNoteComponent,\n }),\n ]),\n children,\n ],\n );\n}\n"],"names":[],"version":3,"file":"column-views.99cb1c41.js.map"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./column-views.562db43a.css";
|
|
2
2
|
import $01tAX$columnviewsfcf25ec6js from "./column-views.fcf25ec6.js";
|
|
3
|
-
import {useColumnUnitsMap as $d5074f164411387e$export$7513be0cfd10d9cc} from "./column-views.
|
|
4
|
-
import {useMacrostratData as $774a5efa27d1c77b$export$b9c9fc603d74a555, useMacrostratDefs as $774a5efa27d1c77b$export$89dd4e5ae4a82373} from "./column-views.
|
|
5
|
-
import {defaultNameFunction as $bc17276da4abb183$export$c9757aeb43a67df0} from "./column-views.
|
|
3
|
+
import {useColumnUnitsMap as $d5074f164411387e$export$7513be0cfd10d9cc} from "./column-views.c1e507e6.js";
|
|
4
|
+
import {useMacrostratColumnInfo as $774a5efa27d1c77b$export$39176e4592b7b9ab, useMacrostratData as $774a5efa27d1c77b$export$b9c9fc603d74a555, useMacrostratDefs as $774a5efa27d1c77b$export$89dd4e5ae4a82373} from "./column-views.3090f246.js";
|
|
5
|
+
import {defaultNameFunction as $bc17276da4abb183$export$c9757aeb43a67df0} from "./column-views.088a0274.js";
|
|
6
6
|
import $01tAX$macrostrathyper from "@macrostrat/hyper";
|
|
7
7
|
import {JSONView as $01tAX$JSONView} from "@macrostrat/ui-components";
|
|
8
8
|
import {Button as $01tAX$Button, ButtonGroup as $01tAX$ButtonGroup} from "@blueprintjs/core";
|
|
@@ -29,7 +29,7 @@ function $448b24baeef3b229$export$fbd245232df17557({ unit: unit, onClose: onClos
|
|
|
29
29
|
"outcrop-type",
|
|
30
30
|
"json-toggle",
|
|
31
31
|
"depth-range"
|
|
32
|
-
]), lithologyFeatures: lithologyFeatures, actions: actions, hiddenActions: hiddenActions = null, onSelectUnit: onSelectUnit,
|
|
32
|
+
]), lithologyFeatures: lithologyFeatures, actions: actions, hiddenActions: hiddenActions = null, onSelectUnit: onSelectUnit, onClickItem: onClickItem }) {
|
|
33
33
|
const [showJSON, setShowJSON] = (0, $01tAX$useState)(false);
|
|
34
34
|
let content = null;
|
|
35
35
|
if (showJSON) content = $448b24baeef3b229$var$h((0, $01tAX$JSONView), {
|
|
@@ -100,9 +100,10 @@ var $448b24baeef3b229$export$ec297f6f9a6ccad0 = /*#__PURE__*/ function(UnitDetai
|
|
|
100
100
|
UnitDetailsFeature["OutcropType"] = "outcrop-type";
|
|
101
101
|
UnitDetailsFeature["JSONToggle"] = "json-toggle";
|
|
102
102
|
UnitDetailsFeature["DepthRange"] = "depth-range";
|
|
103
|
+
UnitDetailsFeature["ColumnName"] = "column-name";
|
|
103
104
|
return UnitDetailsFeature;
|
|
104
105
|
}({});
|
|
105
|
-
function $448b24baeef3b229$var$UnitDetailsContent({ unit: unit, onSelectUnit: onSelectUnit,
|
|
106
|
+
function $448b24baeef3b229$var$UnitDetailsContent({ unit: unit, onSelectUnit: onSelectUnit, lithologyFeatures: lithologyFeatures = new Set([
|
|
106
107
|
(0, $01tAX$LithologyTagFeature).Proportion,
|
|
107
108
|
(0, $01tAX$LithologyTagFeature).Attributes
|
|
108
109
|
]), features: features = new Set([
|
|
@@ -113,14 +114,6 @@ function $448b24baeef3b229$var$UnitDetailsContent({ unit: unit, onSelectUnit: on
|
|
|
113
114
|
const envMap = (0, $774a5efa27d1c77b$export$89dd4e5ae4a82373)("environments");
|
|
114
115
|
const environments = $448b24baeef3b229$var$enhanceEnvironments(unit.environ, envMap);
|
|
115
116
|
const lithologies = $448b24baeef3b229$var$enhanceLithologies(unit.lith ?? [], lithMap);
|
|
116
|
-
// Create a lookup table of units if provided
|
|
117
|
-
const columnUnitsMap = (0, $01tAX$useMemo)(()=>{
|
|
118
|
-
const map = new Map();
|
|
119
|
-
for (const colUnit of columnUnits ?? [])map.set(colUnit.unit_id, colUnit);
|
|
120
|
-
return map;
|
|
121
|
-
}, [
|
|
122
|
-
columnUnits
|
|
123
|
-
]);
|
|
124
117
|
let outcropField = null;
|
|
125
118
|
if (features.has("outcrop-type")) {
|
|
126
119
|
// Determine outcrop type
|
|
@@ -164,6 +157,9 @@ function $448b24baeef3b229$var$UnitDetailsContent({ unit: unit, onSelectUnit: on
|
|
|
164
157
|
});
|
|
165
158
|
}
|
|
166
159
|
return $448b24baeef3b229$var$h("div.unit-details-content", [
|
|
160
|
+
$448b24baeef3b229$var$h.if(features.has("column-name"))($448b24baeef3b229$var$ColumnNameField, {
|
|
161
|
+
col_id: unit.col_id
|
|
162
|
+
}),
|
|
167
163
|
thicknessOrHeightRange,
|
|
168
164
|
$448b24baeef3b229$var$h((0, $01tAX$LithologyList), {
|
|
169
165
|
label: "Lithology",
|
|
@@ -215,6 +211,23 @@ function $448b24baeef3b229$var$UnitDetailsContent({ unit: unit, onSelectUnit: on
|
|
|
215
211
|
})
|
|
216
212
|
]);
|
|
217
213
|
}
|
|
214
|
+
function $448b24baeef3b229$var$ColumnNameField({ col_id: col_id, showIdentifier: showIdentifier = false }) {
|
|
215
|
+
const colData = (0, $774a5efa27d1c77b$export$39176e4592b7b9ab)(col_id);
|
|
216
|
+
let inner = $448b24baeef3b229$var$h($448b24baeef3b229$export$989167234458594d, {
|
|
217
|
+
id: col_id
|
|
218
|
+
});
|
|
219
|
+
const name = colData?.col_name;
|
|
220
|
+
if (name != null) inner = $448b24baeef3b229$var$h("span.value", [
|
|
221
|
+
$448b24baeef3b229$var$h("span.col-name", name),
|
|
222
|
+
$448b24baeef3b229$var$h.if(showIdentifier)([
|
|
223
|
+
" ",
|
|
224
|
+
$448b24baeef3b229$var$h((0, $01tAX$Parenthetical), inner)
|
|
225
|
+
])
|
|
226
|
+
]);
|
|
227
|
+
return $448b24baeef3b229$var$h((0, $01tAX$DataField), {
|
|
228
|
+
label: "Column"
|
|
229
|
+
}, inner);
|
|
230
|
+
}
|
|
218
231
|
function $448b24baeef3b229$export$895d4931dd696e25({ refs: refs, className: className = null, ...rest }) {
|
|
219
232
|
if (refs == null || refs.length === 0) return null;
|
|
220
233
|
return $448b24baeef3b229$var$h((0, $01tAX$DataField), {
|
|
@@ -550,4 +563,4 @@ function $448b24baeef3b229$var$formatSignificance(value, precision = null) {
|
|
|
550
563
|
|
|
551
564
|
|
|
552
565
|
export {$448b24baeef3b229$export$fbd245232df17557 as UnitDetailsPanel, $448b24baeef3b229$export$fc503c39cc5cff43 as LegendPanelHeader, $448b24baeef3b229$export$ec297f6f9a6ccad0 as UnitDetailsFeature, $448b24baeef3b229$export$3b11bc38611c5941 as Duration, $448b24baeef3b229$export$895d4931dd696e25 as ReferencesField, $448b24baeef3b229$export$989167234458594d as Identifier, $448b24baeef3b229$export$37ebfd237811b1eb as AgeLabel, $448b24baeef3b229$export$b6867fc5221f9f65 as ClickableText};
|
|
553
|
-
//# sourceMappingURL=column-views.
|
|
566
|
+
//# sourceMappingURL=column-views.ab2cc6cb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,uEAAK;AAcrB,SAAS,0CAAiB,QAC/B,IAAI,WACJ,OAAO,aACP,SAAS,YACT,WAAW,IAAI,IAAwB;;;;;CAKtC,sBACD,iBAAiB,WACjB,OAAO,iBACP,gBAAgB,oBAChB,YAAY,eACZ,WAAW,EACW;IAC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AAC,EAAE,yCAC9C,KACA,YACC;AACL;AAEA,SAAS,yCAAmB,KAAK,EAAE,YAAY,IAAI;IACjD,gEAAgE;IAChE,yDAAyD;IAEzD,IAAI,aAAa,MACf,OAAO,MAAM,cAAc;IAE7B,IAAI,aAAa,GACf,OAAO,MAAM,OAAO,CAAC;IAEvB,IAAI,YAAY,GACd,OACE,AAAC,CAAA,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC,UAAS,EAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC;AAGlE","sources":["packages/column-views/src/unit-details/panel.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport styles from \"./panel.module.sass\";\nimport { JSONView } from \"@macrostrat/ui-components\";\nimport { Button, ButtonGroup } from \"@blueprintjs/core\";\nimport { ReactNode, useMemo, useState } from \"react\";\nimport {\n DataField,\n EnvironmentsList,\n IntervalShort,\n IntervalTag,\n ItemList,\n LithologyList,\n LithologyTagFeature,\n Parenthetical,\n Value,\n} from \"@macrostrat/data-components\";\nimport {\n useColumnUnitsMap,\n useMacrostratColumnInfo,\n useMacrostratData,\n useMacrostratDefs,\n} from \"../data-provider\";\nimport type {\n Environment,\n UnitLong,\n UnitLongFull,\n Lithology,\n Interval,\n} from \"@macrostrat/api-types\";\nimport { defaultNameFunction } from \"../units/names\";\nimport classNames from \"classnames\";\n\nconst h = hyper.styled(styles);\n\nexport interface UnitDetailsPanelProps {\n unit: any;\n onClose?: any;\n className?: string;\n actions?: ReactNode;\n hiddenActions?: ReactNode;\n features?: Set<UnitDetailsFeature>;\n lithologyFeatures?: Set<LithologyTagFeature>;\n onSelectUnit?: (unitID: number) => void;\n onClickItem?: MacrostratItemClickHandler;\n}\n\nexport function UnitDetailsPanel({\n unit,\n onClose,\n className,\n features = new Set<UnitDetailsFeature>([\n UnitDetailsFeature.AdjacentUnits,\n UnitDetailsFeature.OutcropType,\n UnitDetailsFeature.JSONToggle,\n UnitDetailsFeature.DepthRange,\n ]),\n lithologyFeatures,\n actions,\n hiddenActions = null,\n onSelectUnit,\n onClickItem,\n}: UnitDetailsPanelProps) {\n const [showJSON, setShowJSON] = useState(false);\n\n let content = null;\n if (showJSON) {\n content = h(JSONView, { data: unit, showRoot: false });\n } else {\n content = h(UnitDetailsContent, {\n unit,\n features,\n lithologyFeatures,\n onClickItem,\n onSelectUnit,\n });\n }\n\n let title = defaultNameFunction(unit);\n\n if (features.has(UnitDetailsFeature.JSONToggle)) {\n hiddenActions = h([\n h(Button, {\n icon: \"code\",\n small: true,\n minimal: true,\n key: \"json-view-toggle\",\n className: classNames(\"json-view-toggle\", { enabled: setShowJSON }),\n onClick(evt) {\n setShowJSON(!showJSON);\n evt.stopPropagation();\n },\n }),\n hiddenActions,\n ]);\n }\n\n return h(\"div.unit-details-panel\", { className }, [\n h(LegendPanelHeader, {\n onClose,\n title,\n id: unit.unit_id,\n actions,\n hiddenActions,\n }),\n h(\"div.unit-details-content-holder\", content),\n ]);\n}\n\nexport function LegendPanelHeader({\n title,\n id,\n onClose,\n actions = null,\n hiddenActions,\n}: {\n title?: string | null;\n id?: number | null;\n onClose?: () => void;\n actions?: ReactNode | null;\n hiddenActions?: ReactNode | null;\n}) {\n return h(\"header.legend-panel-header\", [\n h(\"div.title-container\", [\n h.if(title != null)(\"h3\", title),\n h.if(hiddenActions != null)(\n \"span.hidden-actions-container\",\n h(\"div.hidden-actions\", hiddenActions),\n ),\n ]),\n h(\"div.spacer\"),\n h.if(id != null)(\"code.unit-id\", id),\n h.if(actions != null)(ButtonGroup, { minimal: true }, actions),\n h.if(onClose != null)(Button, {\n icon: \"cross\",\n minimal: true,\n small: true,\n onClick() {\n onClose();\n },\n }),\n ]);\n}\n\nexport enum UnitDetailsFeature {\n AdjacentUnits = \"adjacent-units\",\n Color = \"color\",\n OutcropType = \"outcrop-type\",\n JSONToggle = \"json-toggle\",\n DepthRange = \"depth-range\",\n ColumnName = \"column-name\",\n}\n\nexport type MacrostratItemClickHandler = (\n event: MouseEvent,\n item:\n | Lithology\n | Environment\n | UnitLong\n | Interval\n | { strat_name_id: number },\n) => void;\n\nfunction UnitDetailsContent({\n unit,\n onSelectUnit,\n lithologyFeatures = new Set([\n LithologyTagFeature.Proportion,\n LithologyTagFeature.Attributes,\n ]),\n features = new Set<UnitDetailsFeature>([\n UnitDetailsFeature.AdjacentUnits,\n UnitDetailsFeature.OutcropType,\n ]),\n onClickItem,\n getItemHref,\n}: {\n unit: UnitLong;\n onSelectUnit?: (unitID: number) => void;\n lithologyFeatures?: Set<LithologyTagFeature>;\n features?: Set<UnitDetailsFeature>;\n onClickItem?: MacrostratItemClickHandler;\n getItemHref?: (item: Lithology | Environment | UnitLong) => string | null;\n}) {\n const lithMap = useMacrostratDefs(\"lithologies\");\n const envMap = useMacrostratDefs(\"environments\");\n\n const environments = enhanceEnvironments(unit.environ, envMap);\n const lithologies = enhanceLithologies(unit.lith ?? [], lithMap);\n\n let outcropField = null;\n if (features.has(UnitDetailsFeature.OutcropType)) {\n // Determine outcrop type\n let outcrop = unit.outcrop;\n if (outcrop == \"both\") {\n outcrop = \"surface and subsurface\";\n }\n outcropField = h(DataField, {\n label: \"Outcrop\",\n value: outcrop,\n });\n }\n\n let thicknessOrHeightRange = null;\n const [thickness, thicknessUnit] = getThickness(unit);\n // Proxy for actual heights in t_pos and b_pos\n if (\n features.has(UnitDetailsFeature.DepthRange) &&\n unit.t_pos != null &&\n unit.b_pos != null &&\n unit.min_thick == unit.max_thick && // We have an actual fixed height\n unit.min_thick != 0 // Not a zero thickness\n ) {\n const label = unit.t_pos < unit.b_pos ? \"Depth\" : \"Height\";\n const u1 = \"m\";\n\n thicknessOrHeightRange = h(DataField, {\n unit: u1,\n label,\n value: formatRange(unit.b_pos, unit.t_pos),\n children: h(\n Parenthetical,\n h(Value, { value: thickness, unit: thicknessUnit }),\n ),\n });\n }\n thicknessOrHeightRange ??= h(DataField, {\n label: \"Thickness\",\n value: thickness,\n unit: thicknessUnit,\n });\n\n /** We are trying to move away from passing the \"color\" parameter in the API */\n let colorSwatch: ReactNode = null;\n if (\"color\" in unit && features.has(UnitDetailsFeature.Color)) {\n const unit1 = unit as UnitLongFull;\n colorSwatch = h(\"div.color-swatch\", {\n style: { backgroundColor: unit1.color },\n });\n }\n\n return h(\"div.unit-details-content\", [\n h.if(features.has(UnitDetailsFeature.ColumnName))(ColumnNameField, {\n col_id: unit.col_id,\n }),\n thicknessOrHeightRange,\n h(LithologyList, {\n label: \"Lithology\",\n lithologies,\n features: lithologyFeatures,\n getItemHref,\n onClickItem,\n }),\n h(AgeField, { unit }, [\n h(Parenthetical, h(Duration, { value: unit.b_age - unit.t_age })),\n h(IntervalProportions, {\n unit,\n onClickItem,\n }),\n ]),\n h(EnvironmentsList, {\n environments,\n onClickItem,\n getItemHref,\n }),\n h.if(unit.strat_name_id != null)(StratNameField, {\n strat_name_id: unit.strat_name_id,\n }),\n outcropField,\n h.if(features.has(UnitDetailsFeature.AdjacentUnits))([\n h(\n DataField,\n { label: \"Above\" },\n h(UnitIDList, {\n units: unit.units_above,\n onSelectUnit,\n showNames: true,\n }),\n ),\n h(\n DataField,\n { label: \"Below\" },\n h(UnitIDList, {\n units: unit.units_below,\n onSelectUnit,\n showNames: true,\n }),\n ),\n ]),\n colorSwatch,\n h(ReferencesField, { refs: unit.refs, inline: true }),\n ]);\n}\n\nfunction ColumnNameField({\n col_id,\n showIdentifier = false,\n}: {\n col_id: number;\n showIdentifier?: boolean;\n}) {\n const colData = useMacrostratColumnInfo(col_id);\n let inner: any = h(Identifier, { id: col_id });\n const name = colData?.col_name;\n if (name != null) {\n inner = h(\"span.value\", [\n h(\"span.col-name\", name),\n h.if(showIdentifier)([\" \", h(Parenthetical, inner)]),\n ]);\n }\n\n return h(\n DataField,\n {\n label: \"Column\",\n },\n inner,\n );\n}\n\nexport function ReferencesField({ refs, className = null, ...rest }) {\n if (refs == null || refs.length === 0) {\n return null;\n }\n\n return h(\n DataField,\n {\n label: \"References\",\n className: classNames(\"refs-field\", className),\n ...rest,\n },\n h(BibInfo, { refs }),\n );\n}\n\nfunction StratNameField({\n strat_name_id,\n onClickItem,\n}: {\n strat_name_id: number;\n onClickItem?: (event: MouseEvent, item: { strat_name_id: number }) => void;\n}) {\n const stratNames = useMemo(() => [strat_name_id], [strat_name_id]);\n const data = useMacrostratData(\"strat_names\", stratNames);\n const stratNameData = data?.[0];\n let inner: any = h(Identifier, { id: strat_name_id });\n const name = stratNameData?.strat_name_long;\n if (name != null) {\n inner = h(\"span.strat-name\", name);\n }\n\n const clickable = onClickItem != null;\n\n const className = classNames({\n clickable,\n });\n\n return h(\n DataField,\n {\n label: \"Stratigraphic name\",\n },\n h(\n clickable ? \"a\" : \"span\",\n {\n className,\n onClick: (e) => onClickItem(e, { strat_name_id }),\n },\n inner,\n ),\n );\n}\n\nfunction getThickness(unit): [string, string] {\n let minThickness = unit.min_thick ?? 0;\n let maxThickness = unit.max_thick ?? unit.min_thick ?? 0;\n let _unit = \"m\";\n\n if (minThickness == 0 && maxThickness == 0) {\n return [\"Unknown\", null];\n }\n\n if (minThickness < 0.8 && maxThickness < 1.2) {\n // Convert to cm\n minThickness = minThickness * 100;\n maxThickness = maxThickness * 100;\n _unit = \"cm\";\n } else if (minThickness > 800 && maxThickness > 1200) {\n // Convert to km\n minThickness = minThickness / 1000;\n maxThickness = maxThickness / 1000;\n _unit = \"km\";\n }\n\n if (minThickness == maxThickness) {\n return [formatSignificance(minThickness), _unit];\n }\n\n return [formatRange(minThickness, maxThickness), _unit];\n}\n\nfunction ThicknessField({ unit, label = \"Thickness\" }) {\n const [value, thicknessUnit] = getThickness(unit);\n return h(DataField, {\n label,\n value,\n unit: thicknessUnit,\n });\n}\n\nfunction BibInfo({ refs }) {\n const refData = useMacrostratData(\"refs\", refs);\n\n if (refData == null || refData.length === 0) {\n return null;\n }\n\n if (refData.length == 1) {\n return h(Citation, {\n data: refData[0],\n tag: \"span\",\n key: refData[0].ref_id,\n });\n }\n\n return h(\n \"ul.refs\",\n refData.map((data, i) =>\n h(Citation, { data, tag: \"li\", key: data.ref_id }),\n ),\n );\n}\n\nfunction Citation({ data, tag = \"p\" }) {\n return h(tag, { className: \"citation\" }, [\n h(\"span.authors\", data.author),\n \", \",\n h(\"span.year\", data.pub_year),\n \", \",\n h(\"span.title\", data.ref),\n ]);\n}\n\nfunction AgeField({ unit, children }) {\n const [b_age, t_age, _unit] = getAgeRange(unit);\n\n return h(\n DataField,\n {\n label: \"Age\",\n value: formatRange(b_age, t_age),\n unit: _unit,\n },\n children,\n );\n}\n\nfunction getAgeRange(_unit) {\n let b_age = _unit.b_age;\n let t_age = _unit.t_age;\n let unit = \"Ma\";\n\n if (b_age < 0.8 && t_age < 1.2) {\n b_age *= 1000;\n t_age *= 1000;\n unit = \"ka\";\n } else if (b_age > 800 && t_age > 1200) {\n b_age /= 1000;\n t_age /= 1000;\n unit = \"Ga\";\n }\n\n return [b_age, t_age, unit];\n}\n\nfunction getAge(value) {\n /** Get the age value in Ma, ka, or Ga as appropriate */\n let unit = \"Ma\";\n if (value < 0.8) {\n unit = \"ka\";\n value *= 1000;\n if (value < 5) {\n unit = \"yr\";\n value *= 1000;\n }\n } else if (value > 1000) {\n unit = \"Ga\";\n value /= 1000;\n }\n\n return [value, unit];\n}\n\nexport function AgeLabel({\n age,\n maximumFractionDigits = 2,\n minimumFractionDigits = 0,\n className,\n}: {\n age: number;\n className?: string;\n maximumFractionDigits?: number;\n minimumFractionDigits?: number;\n}) {\n /** Component to display a single age value with unit conversion from\n * Ma to ka or Ga as appropriate.\n */\n const [value, unit] = getAge(age);\n\n const _value = value.toLocaleString(\"en-US\", {\n maximumFractionDigits,\n minimumFractionDigits,\n });\n\n return h(Value, { value: _value, unit, className });\n}\n\nexport function Duration({\n value,\n maximumFractionDigits = 2,\n minimumFractionDigits = 0,\n}) {\n let unit = \"Myr\";\n if (value < 0.8) {\n unit = \"kyr\";\n value *= 1000;\n if (value < 5) {\n unit = \"yr\";\n value *= 1000;\n }\n } else if (value > 1000) {\n unit = \"Gyr\";\n value /= 1000;\n }\n\n let _value = value.toLocaleString(\"en-US\", {\n maximumFractionDigits,\n minimumFractionDigits,\n });\n\n return h(Value, { value: _value, unit });\n}\n\nfunction enhanceEnvironments(\n environments: Partial<Environment>[],\n envMap: Map<number, Environment>,\n) {\n return environments.map((env) => {\n return {\n ...(envMap?.get(env.environ_id) ?? {}),\n ...env,\n };\n });\n}\n\nfunction enhanceLithologies(\n lithologies: Partial<UnitLong[\"lith\"]>,\n lithMap: Map<number, any>,\n) {\n return lithologies.map((lith) => {\n return {\n ...(lithMap?.get(lith.lith_id) ?? {}), // get lithology details\n ...lith, // override with the unit's specific lithology data\n };\n });\n}\n\nexport function ClickableText({\n onClick,\n className,\n children,\n}: {\n onClick: () => void;\n className?: string;\n children: ReactNode;\n}) {\n /** An optionally clickable text element */\n const tag = onClick != null ? \"a\" : \"span\";\n return h(tag, { onClick, className }, children);\n}\n\nexport function Identifier({\n id,\n onClick,\n className,\n}: {\n id: number | string;\n onClick?: (id: number | string) => void;\n className?: string;\n}) {\n /** An item that displays a numeric identifier, optionally clickable */\n const _onClick = onClick != null ? () => onClick(id) : null;\n\n return h(\n ClickableText,\n {\n onClick: _onClick,\n className: classNames(\"identifier\", className),\n },\n id,\n );\n}\n\ntype UnitInfo = {\n unitID: number;\n colID?: number;\n name?: string;\n};\n\nfunction UnitIDList({ units, onSelectUnit, showNames = false }) {\n const unitsMap = useColumnUnitsMap();\n\n const extUnits: UnitInfo[] = useMemo(() => {\n const u1 = units.filter((d) => d != 0);\n if (showNames) {\n return u1.map((unitID) => {\n const unitData = unitsMap?.get(unitID);\n let name: string = undefined;\n if (unitData != null) {\n name = defaultNameFunction(unitData);\n }\n return {\n unitID,\n colID: unitData?.col_id,\n name,\n };\n });\n } else {\n return u1.map((unitID) => ({ unitID }));\n }\n }, [units, unitsMap]);\n\n if (extUnits.length === 0) {\n return h(\"span.no-units\", \"None\");\n }\n\n return h(\n ItemList,\n { className: \"units-list\" },\n extUnits.map((info) =>\n h(\"span.item\", h(UnitIdentifier, { ...info, onSelectUnit })),\n ),\n );\n}\n\nfunction UnitIdentifier({\n unitID,\n colID,\n name,\n onSelectUnit,\n}: UnitInfo & { onSelectUnit?: (unitID: number) => void }) {\n const onClick = useMemo(() => {\n if (onSelectUnit == null) return null;\n return () => {\n onSelectUnit(unitID);\n };\n }, [onSelectUnit]);\n\n if (name != null) {\n return h(\n ClickableText,\n {\n className: \"unit-name\",\n onClick,\n },\n name,\n );\n }\n\n return h(Identifier, {\n className: \"unit-id\",\n onClick,\n key: unitID,\n id: unitID,\n });\n}\n\nfunction IntervalProportions({ unit, onClickItem }) {\n const i0 = unit.b_int_id;\n const i1 = unit.t_int_id;\n let b_prop = unit.b_prop ?? 0;\n let t_prop = unit.t_prop ?? 1;\n\n const intervalMap = useMacrostratDefs(\"intervals\");\n const int0 = intervalMap?.get(i0) ?? {};\n\n const interval0: IntervalShort = {\n ...int0,\n id: i0,\n name: unit.b_int_name,\n };\n\n let p0: ReactNode = null;\n const int1 = intervalMap?.get(i1) ?? {};\n const p1: ReactNode = h(Proportion, { value: t_prop });\n\n if (i0 !== i1 || b_prop !== 0 || t_prop !== 1) {\n // We have a single interval with undefined proportions\n p0 = h(Proportion, { value: b_prop });\n }\n\n if (i0 === i1 && (b_prop !== 0 || t_prop !== 1)) {\n p0 = h(\"span.joint-proportion\", [p0, h(\"span.sep\", \"to\"), p1]);\n }\n\n const clickable = onClickItem != null;\n\n const handleClick = (event: MouseEvent) => {\n if (onClickItem) {\n onClickItem(event, interval0);\n }\n };\n\n return h(\"div.interval-proportions\", [\n h(IntervalTag, {\n className: clickable ? \"clickable\" : \"\",\n onClick: clickable ? handleClick : undefined,\n interval: interval0,\n prefix: p0,\n }),\n h.if(i0 != i1)(\"span.discourage-break\", [\n h(\"span.sep\", \"to\"),\n h(IntervalTag, {\n className: clickable ? \"clickable\" : \"\",\n onClick: clickable ? handleClick : undefined,\n interval: {\n ...int1,\n id: i1,\n name: unit.t_int_name,\n },\n prefix: p1,\n }),\n ]),\n ]);\n}\n\nconst formatProportion = (d) => {\n if (d == null) return null;\n return d.toFixed(1);\n};\n\nfunction Proportion({ value }) {\n let content = null;\n if (value == 0) {\n content = \"base\";\n } else if (value == 1) {\n content = \"top\";\n } else {\n content = formatProportion(value * 100) + \"%\";\n }\n\n return h(\"span.proportion\", content);\n}\n\nfunction formatRange(min, max, precision = null) {\n if (min == null || max == null) return null;\n if (min === max) {\n return min.toFixed(precision);\n }\n\n return `${formatSignificance(min, precision)}–${formatSignificance(\n max,\n precision,\n )}`;\n}\n\nfunction formatSignificance(value, precision = null) {\n // Format to preserve a reasonable number of significant figures\n // this could be done with an easier algorithm, probably:\n\n if (precision == null) {\n return value.toLocaleString();\n }\n if (precision >= 0) {\n return value.toFixed(precision);\n }\n if (precision < 0) {\n return (\n (value / Math.pow(10, -precision)).toFixed(0) + \"0\".repeat(-precision)\n );\n }\n}\n"],"names":[],"version":3,"file":"column-views.ab2cc6cb.js.map"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {BaseMeasurementsColumn as $50d219504625a431$export$ce5c4f2fdf4e644d, groupNotesByPixelDistance as $50d219504625a431$export$4e649f790614b299, standardizeMeasurementHeight as $50d219504625a431$export$9d101e1fcb2166a6, TruncatedList as $50d219504625a431$export$653e47a7a0da0f0d} from "./column-views.
|
|
2
|
-
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d} from "./column-views.
|
|
1
|
+
import {BaseMeasurementsColumn as $50d219504625a431$export$ce5c4f2fdf4e644d, groupNotesByPixelDistance as $50d219504625a431$export$4e649f790614b299, standardizeMeasurementHeight as $50d219504625a431$export$9d101e1fcb2166a6, TruncatedList as $50d219504625a431$export$653e47a7a0da0f0d} from "./column-views.ce5251f7.js";
|
|
2
|
+
import {useCompositeScale as $d5074f164411387e$export$a7fc62995ec4f76, useMacrostratColumnData as $d5074f164411387e$export$f8509b7cce386c7d} from "./column-views.c1e507e6.js";
|
|
3
3
|
import $8DpYT$macrostrathyper from "@macrostrat/hyper";
|
|
4
4
|
import {useAPIResult as $8DpYT$useAPIResult} from "@macrostrat/ui-components";
|
|
5
5
|
|
|
@@ -58,4 +58,4 @@ function $c8e156b0b9c785ec$var$prepareSGPData(data, scale, units, axisType) {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
export {$c8e156b0b9c785ec$export$c49cf57576706bab as SGPMeasurementsColumn};
|
|
61
|
-
//# sourceMappingURL=column-views.
|
|
61
|
+
//# sourceMappingURL=column-views.af4278f0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAgBA,SAAS,iCAAW,UAAE,MAAM,EAAE;IAC5B,OAAO,CAAA,GAAA,mBAAW,EAChB,sDACA;QACE,QAAQ,CAAC,GAAG,EAAE,QAAQ;IACxB,GACA,CAAC,IAAM;AAEX;AAQO,SAAS,0CAAsB,YAAE,QAAQ,EAAE;IAChD,MAAM,OAA+B,iCAAW;QAAE,QAAQ;IAAS;IACnE,MAAM,YAAE,QAAQ,SAAE,KAAK,EAAE,GAAG,CAAA,GAAA,yCAAsB;IAClD,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,IAAI,QAAQ,QAAQ,SAAS,QAAQ,SAAS,MAAM,OAAO;IAE3D,MAAM,QAAQ,qCAAe,MAAM,OAAO,OAAO;IAEjD,OAAO,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,yCAAqB,GAAG;QAC/B,MAAM;QACN,eAAe;QACf,sBAAsB;IACxB;AACF;AAEA,SAAS,qCAAe,KAAsC;IAC5D,MAAM,QAAE,IAAI,WAAE,OAAO,EAAE,GAAG;IAC1B,MAAM,cAAc,MAAM;IAE1B,IAAI,eAAe,QAAQ,YAAY,MAAM,KAAK,GAAG,OAAO;IAE5D,OAAO,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,yCAAY,GAAG;QACtB,WAAW;QACX,MAAM;QACN,cAAc,CAAC,IAAM,CAAA,GAAA,sBAAA,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI;QAC1C,UAAU,UAAU,WAAW;IACjC;AACF;AAEA,SAAS,qCACP,IAAqB,EACrB,KAA2B,EAC3B,KAAiB,EACjB,QAAwB;IAExB,kCAAkC;IAClC,MAAM,KAAK,KACR,GAAG,CAAC,CAAC;QACJ,MAAM,OAAO,OAAO,WAAW;QAC/B,IAAI,QAAQ,QAAQ,KAAK,MAAM,KAAK,GAAG,OAAO;QAC9C,MAAM,aAAa,CAAA,GAAA,yCAA2B,EAC5C;YAAE,SAAS,OAAO,OAAO;QAAC,GAC1B,OACA;QAEF,IAAI,cAAc,MAAM,OAAO;QAC/B,KAAK,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,EAAE,GAAG,EAAE,EAAE;QAC/B,OAAO;YACL,GAAG,UAAU;kBACb;YACA,IAAI,OAAO,OAAO;QACpB;IACF,GACC,MAAM,CAAC;IAEV,OAAO,CAAA,GAAA,yCAAwB,EAAE,IAAI,OAAO,UAAU;AACxD","sources":["packages/column-views/src/facets/measurements/sgp.ts"],"sourcesContent":["import h from \"@macrostrat/hyper\";\nimport { useAPIResult } from \"@macrostrat/ui-components\";\nimport {\n BaseMeasurementsColumn,\n groupNotesByPixelDistance,\n standardizeMeasurementHeight,\n TruncatedList,\n} from \"./base\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n} from \"../../data-provider\";\nimport type { CompositeColumnScale } from \"../../prepare-units\";\n\nfunction useSGPData({ col_id }) {\n return useAPIResult(\n \"https://dev.macrostrat.org/api/pg/sgp_unit_matches\",\n {\n col_id: `eq.${col_id}`,\n },\n (d) => d,\n );\n}\n\ninterface SGPSampleData {\n col_id: number;\n unit_id: number;\n sgp_samples: { name: string; id: number }[];\n}\n\nexport function SGPMeasurementsColumn({ columnID }) {\n const data: SGPSampleData[] | null = useSGPData({ col_id: columnID });\n const { axisType, units } = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n if (data == null || units == null || scale == null) return null;\n\n const data1 = prepareSGPData(data, scale, units, axisType);\n\n return h(BaseMeasurementsColumn, {\n data: data1,\n noteComponent: SGPSamplesNote,\n focusedNoteComponent: SGPSamplesNote,\n });\n}\n\nfunction SGPSamplesNote(props: { note: any; focused: boolean }) {\n const { note, focused } = props;\n const sgp_samples = note?.data;\n\n if (sgp_samples == null || sgp_samples.length === 0) return null;\n\n return h(TruncatedList, {\n className: \"sgp-samples\",\n data: sgp_samples,\n itemRenderer: (p) => h(\"span\", p.data.name),\n maxItems: focused ? Infinity : 5,\n });\n}\n\nfunction prepareSGPData(\n data: SGPSampleData[],\n scale: CompositeColumnScale,\n units: UnitLong[],\n axisType: ColumnAxisType,\n) {\n // Find matching units for samples\n const d1 = data\n .map((sample) => {\n const data = sample.sgp_samples;\n if (data == null || data.length === 0) return null;\n const heightData = standardizeMeasurementHeight(\n { unit_id: sample.unit_id },\n units,\n axisType,\n );\n if (heightData == null) return null;\n data.sort((a, b) => a.id - b.id);\n return {\n ...heightData,\n data,\n id: sample.unit_id,\n };\n })\n .filter(Boolean);\n\n return groupNotesByPixelDistance(d1, scale, axisType, 5);\n}\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":";;;;;;;;;AAgBA,SAAS,iCAAW,UAAE,MAAM,EAAE;IAC5B,OAAO,CAAA,GAAA,mBAAW,EAChB,sDACA;QACE,QAAQ,CAAC,GAAG,EAAE,QAAQ;IACxB,GACA,CAAC,IAAM;AAEX;AAQO,SAAS,0CAAsB,YAAE,QAAQ,EAAE;IAChD,MAAM,OAA+B,iCAAW;QAAE,QAAQ;IAAS;IACnE,MAAM,YAAE,QAAQ,SAAE,KAAK,EAAE,GAAG,CAAA,GAAA,yCAAsB;IAClD,MAAM,QAAQ,CAAA,GAAA,wCAAgB;IAE9B,IAAI,QAAQ,QAAQ,SAAS,QAAQ,SAAS,MAAM,OAAO;IAE3D,MAAM,QAAQ,qCAAe,MAAM,OAAO,OAAO;IAEjD,OAAO,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,yCAAqB,GAAG;QAC/B,MAAM;QACN,eAAe;QACf,sBAAsB;IACxB;AACF;AAEA,SAAS,qCAAe,KAAsC;IAC5D,MAAM,QAAE,IAAI,WAAE,OAAO,EAAE,GAAG;IAC1B,MAAM,cAAc,MAAM;IAE1B,IAAI,eAAe,QAAQ,YAAY,MAAM,KAAK,GAAG,OAAO;IAE5D,OAAO,CAAA,GAAA,sBAAA,EAAE,CAAA,GAAA,yCAAY,GAAG;QACtB,WAAW;QACX,MAAM;QACN,cAAc,CAAC,IAAM,CAAA,GAAA,sBAAA,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI;QAC1C,UAAU,UAAU,WAAW;IACjC;AACF;AAEA,SAAS,qCACP,IAAqB,EACrB,KAA2B,EAC3B,KAAiB,EACjB,QAAwB;IAExB,kCAAkC;IAClC,MAAM,KAAK,KACR,GAAG,CAAC,CAAC;QACJ,MAAM,OAAO,OAAO,WAAW;QAC/B,IAAI,QAAQ,QAAQ,KAAK,MAAM,KAAK,GAAG,OAAO;QAC9C,MAAM,aAAa,CAAA,GAAA,yCAA2B,EAC5C;YAAE,SAAS,OAAO,OAAO;QAAC,GAC1B,OACA;QAEF,IAAI,cAAc,MAAM,OAAO;QAC/B,KAAK,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,EAAE,GAAG,EAAE,EAAE;QAC/B,OAAO;YACL,GAAG,UAAU;kBACb;YACA,IAAI,OAAO,OAAO;QACpB;IACF,GACC,MAAM,CAAC;IAEV,OAAO,CAAA,GAAA,yCAAwB,EAAE,IAAI,OAAO,UAAU;AACxD","sources":["packages/column-views/src/facets/measurements/sgp.ts"],"sourcesContent":["import h from \"@macrostrat/hyper\";\nimport { useAPIResult } from \"@macrostrat/ui-components\";\nimport {\n BaseMeasurementsColumn,\n groupNotesByPixelDistance,\n standardizeMeasurementHeight,\n TruncatedList,\n} from \"./base\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n} from \"../../data-provider\";\nimport type { CompositeColumnScale } from \"../../prepare-units\";\n\nfunction useSGPData({ col_id }) {\n return useAPIResult(\n \"https://dev.macrostrat.org/api/pg/sgp_unit_matches\",\n {\n col_id: `eq.${col_id}`,\n },\n (d) => d,\n );\n}\n\ninterface SGPSampleData {\n col_id: number;\n unit_id: number;\n sgp_samples: { name: string; id: number }[];\n}\n\nexport function SGPMeasurementsColumn({ columnID }) {\n const data: SGPSampleData[] | null = useSGPData({ col_id: columnID });\n const { axisType, units } = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n if (data == null || units == null || scale == null) return null;\n\n const data1 = prepareSGPData(data, scale, units, axisType);\n\n return h(BaseMeasurementsColumn, {\n data: data1,\n noteComponent: SGPSamplesNote,\n focusedNoteComponent: SGPSamplesNote,\n });\n}\n\nfunction SGPSamplesNote(props: { note: any; focused: boolean }) {\n const { note, focused } = props;\n const sgp_samples = note?.data;\n\n if (sgp_samples == null || sgp_samples.length === 0) return null;\n\n return h(TruncatedList, {\n className: \"sgp-samples\",\n data: sgp_samples,\n itemRenderer: (p) => h(\"span\", p.data.name),\n maxItems: focused ? Infinity : 5,\n });\n}\n\nfunction prepareSGPData(\n data: SGPSampleData[],\n scale: CompositeColumnScale,\n units: UnitLong[],\n axisType: ColumnAxisType,\n) {\n // Find matching units for samples\n const d1 = data\n .map((sample) => {\n const data = sample.sgp_samples;\n if (data == null || data.length === 0) return null;\n const heightData = standardizeMeasurementHeight(\n { unit_id: sample.unit_id },\n units,\n axisType,\n );\n if (heightData == null) return null;\n data.sort((a, b) => a.id - b.id);\n return {\n ...heightData,\n data,\n id: sample.unit_id,\n };\n })\n .filter(Boolean);\n\n return groupNotesByPixelDistance(d1, scale, axisType, 5);\n}\n"],"names":[],"version":3,"file":"column-views.af4278f0.js.map"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {ColumnNavigationMap as $9d5d216fa2057b5b$export$821baedf611249f3} from "./column-views.
|
|
2
|
-
import {ResizableMapFrame as $e6046e00d2c8a163$export$c4313db718750a5a, ColumnNavigationSVGMap as $e6046e00d2c8a163$export$9595c40c7a4c4f7b, MeasurementsLayer as $93f116a6493b17c3$export$2254347cd20e6080, ColumnFeatures as $93f116a6493b17c3$export$f177ff57c101017a, ColumnKeyboardNavigation as $93f116a6493b17c3$export$8c41dd563753848, Columns as $93f116a6493b17c3$export$f02cc02ad0e0bba3, ColumnCenters as $93f116a6493b17c3$export$4d8f6e6df85d9012, CurrentColumn as $93f116a6493b17c3$export$b9d912252344e099} from "./column-views.
|
|
1
|
+
import {ColumnNavigationMap as $9d5d216fa2057b5b$export$821baedf611249f3} from "./column-views.f56e604d.js";
|
|
2
|
+
import {ResizableMapFrame as $e6046e00d2c8a163$export$c4313db718750a5a, ColumnNavigationSVGMap as $e6046e00d2c8a163$export$9595c40c7a4c4f7b, MeasurementsLayer as $93f116a6493b17c3$export$2254347cd20e6080, ColumnFeatures as $93f116a6493b17c3$export$f177ff57c101017a, ColumnKeyboardNavigation as $93f116a6493b17c3$export$8c41dd563753848, Columns as $93f116a6493b17c3$export$f02cc02ad0e0bba3, ColumnCenters as $93f116a6493b17c3$export$4d8f6e6df85d9012, CurrentColumn as $93f116a6493b17c3$export$b9d912252344e099} from "./column-views.33796541.js";
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export {$9d5d216fa2057b5b$export$821baedf611249f3 as ColumnNavigationMap, $e6046e00d2c8a163$export$c4313db718750a5a as ResizableMapFrame, $e6046e00d2c8a163$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap, $93f116a6493b17c3$export$2254347cd20e6080 as MeasurementsLayer, $93f116a6493b17c3$export$f177ff57c101017a as ColumnFeatures, $93f116a6493b17c3$export$8c41dd563753848 as ColumnKeyboardNavigation, $93f116a6493b17c3$export$f02cc02ad0e0bba3 as Columns, $93f116a6493b17c3$export$4d8f6e6df85d9012 as ColumnCenters, $93f116a6493b17c3$export$b9d912252344e099 as CurrentColumn};
|
|
9
|
-
//# sourceMappingURL=column-views.
|
|
9
|
+
//# sourceMappingURL=column-views.b957dc19.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"","sources":["packages/column-views/src/maps/column-navigation/index.ts"],"sourcesContent":["export * from \"./mapbox\";\nexport * from \"./svg\";\n"],"names":[],"version":3,"file":"column-views.
|
|
1
|
+
{"mappings":"","sources":["packages/column-views/src/maps/column-navigation/index.ts"],"sourcesContent":["export * from \"./mapbox\";\nexport * from \"./svg\";\n"],"names":[],"version":3,"file":"column-views.b957dc19.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useMacrostratColumns as $774a5efa27d1c77b$export$81eaae0b474404fd} from "./column-views.
|
|
1
|
+
import {useMacrostratColumns as $774a5efa27d1c77b$export$81eaae0b474404fd} from "./column-views.3090f246.js";
|
|
2
2
|
import {create as $i7Wch$create, useStore as $i7Wch$useStore} from "zustand";
|
|
3
3
|
import {lineIntersect as $i7Wch$lineIntersect} from "@turf/line-intersect";
|
|
4
4
|
import $i7Wch$turfdistance from "@turf/distance";
|
|
@@ -7,6 +7,10 @@ import {centroid as $i7Wch$centroid} from "@turf/centroid";
|
|
|
7
7
|
import {createContext as $i7Wch$createContext, useState as $i7Wch$useState, useEffect as $i7Wch$useEffect, useContext as $i7Wch$useContext} from "react";
|
|
8
8
|
import $i7Wch$macrostrathyper from "@macrostrat/hyper";
|
|
9
9
|
import {createComputed as $i7Wch$createComputed} from "zustand-computed";
|
|
10
|
+
import {buffer as $i7Wch$buffer} from "@turf/buffer";
|
|
11
|
+
import {booleanPointInPolygon as $i7Wch$booleanPointInPolygon} from "@turf/boolean-point-in-polygon";
|
|
12
|
+
|
|
13
|
+
|
|
10
14
|
|
|
11
15
|
|
|
12
16
|
|
|
@@ -29,6 +33,7 @@ function $74e211dc185c20b4$export$72ffe141ebf87ef1({ children: children, columns
|
|
|
29
33
|
return (0, $i7Wch$create)($74e211dc185c20b4$var$computed((set, get)=>{
|
|
30
34
|
return {
|
|
31
35
|
focusedLine: focusedLine,
|
|
36
|
+
projectID: projectID,
|
|
32
37
|
columns: null,
|
|
33
38
|
onClickMap (event, point) {
|
|
34
39
|
const state = get();
|
|
@@ -83,7 +88,14 @@ function $74e211dc185c20b4$var$buildCorrelationColumns(columns, line) {
|
|
|
83
88
|
}
|
|
84
89
|
function $74e211dc185c20b4$var$computeIntersectingColumns(columns, line) {
|
|
85
90
|
if (columns == null || line == null) return [];
|
|
86
|
-
|
|
91
|
+
/** eODP-focused process. Find buffers around line and then find columns intersecting that buffer */ const bufferedLine = (0, $i7Wch$buffer)(line, 1, {
|
|
92
|
+
units: "degrees"
|
|
93
|
+
});
|
|
94
|
+
const nearbyPoints = columns.filter((col)=>{
|
|
95
|
+
if (col.geometry?.type != "Point") return false;
|
|
96
|
+
return (0, $i7Wch$booleanPointInPolygon)(col.geometry, bufferedLine);
|
|
97
|
+
});
|
|
98
|
+
const intersectingPolygons = columns.filter((col)=>{
|
|
87
99
|
const poly = col.geometry;
|
|
88
100
|
// Some in-process datasets seem to have null geometries
|
|
89
101
|
if (poly == null) return false;
|
|
@@ -91,6 +103,10 @@ function $74e211dc185c20b4$var$computeIntersectingColumns(columns, line) {
|
|
|
91
103
|
const intersection = (0, $i7Wch$lineIntersect)(line, poly);
|
|
92
104
|
return intersection.features.length > 0;
|
|
93
105
|
});
|
|
106
|
+
return [
|
|
107
|
+
...intersectingPolygons,
|
|
108
|
+
...nearbyPoints
|
|
109
|
+
];
|
|
94
110
|
}
|
|
95
111
|
function $74e211dc185c20b4$var$orderColumnsByDistance(columns, line) {
|
|
96
112
|
const centroids = columns.map((col)=>(0, $i7Wch$centroid)(col.geometry));
|
|
@@ -115,4 +131,4 @@ function $74e211dc185c20b4$var$sorted(data, accessor) {
|
|
|
115
131
|
|
|
116
132
|
|
|
117
133
|
export {$74e211dc185c20b4$export$72ffe141ebf87ef1 as ColumnCorrelationProvider, $74e211dc185c20b4$export$21398703d3a9bb4d as useCorrelationMapStore};
|
|
118
|
-
//# sourceMappingURL=column-views.
|
|
134
|
+
//# sourceMappingURL=column-views.bc83a85d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,gDACJ,CAAA,GAAA,oBAAY,EAAwC;AAMtD,2EAA2E,GAC3E,MAAM,iCAAW,CAAA,GAAA,qBAAa,EAAE,CAAC;IAC/B,OAAO;QACL,kEAAkE;QAClE,gBAAgB,8CAAwB,MAAM,OAAO,EAAE,MAAM,WAAW;IAC1E;AACF;AAEO,SAAS,0CAA0B,YACxC,QAAQ,WACR,OAAO,aACP,SAAS,aACT,SAAS,eACT,WAAW,mBACX,eAAe,EACU;IACzB,MAAM,CAAC,MAAM,GAAG,CAAA,GAAA,eAAO,EAAE;QACvB,OAAO,CAAA,GAAA,aAAK,EACV,+BAAS,CAAC,KAAK;YACb,OAAO;6BACL;2BACA;gBACA,SAAS;gBACT,YAAW,KAA6B,EAAE,KAAY;oBACpD,MAAM,QAAQ;oBACd,gCAAgC;oBAChC,MAAM,kBAAkB,MAAM,aAAa,CAAC,QAAQ;oBACpD,IAAI,iBAAiB,MAAM,WAAW,EAAE,eAAe,EAAE;oBAEzD,IAAI,eAAe,MAAM,IAAI,KAAK,CAAC,iBACjC,gCAAgC;oBAChC,iBAAiB,EAAE;oBAErB,IAAI;wBACF,aAAa;4BACX,MAAM;4BACN,aAAa;mCAAI;gCAAgB,MAAM,WAAW;6BAAC;wBACrD;oBACF;gBACF;YACF;QACF;IAEJ;IAEA,mBAAmB;IACnB,6DAA6D,GAC7D,MAAM,WAAW,CAAA,GAAA,yCAAmB,EAAE,WAAW;IACjD,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,Y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AI,IAAI,aAAa,KAAK,IAAI,IAAI,gBAAgB,OAAO;QAElE,MAAM,eAAe,CAAA,GAAA,oBAAY,EAAE,MAAM;QACzC,OAAO,aAAa,QAAQ,CAAC,MAAM,GAAG;IACxC;IAEA,OAAO;WAAI;WAAyB;KAAa;AACnD;AAUA,SAAS,6CACP,OAA8B,EAC9B,IAAgB;IAEhB,MAAM,YAAY,QAAQ,GAAG,CAAC,CAAC,MAAQ,CAAA,GAAA,eAAO,EAAE,IAAI,QAAQ;IAC5D,MAAM,kBAAkB,UAAU,GAAG,CAAC,CAAC,QACrC,CAAA,GAAA,yBAAiB,EAAE,MAAM;IAE3B,MAAM,YAAY,gBAAgB,GAAG,CAAC,CAAC,QACrC,CAAA,GAAA,mBAAO,EAAE,MAAM,QAAQ,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,EAAE;IAG1D,IAAI,aAAa,QAAQ,GAAG,CAAC,CAAC,KAAK;QACjC,OAAO;YACL,GAAG,GAAG;YACN,YAAY;gBACV,GAAG,IAAI,UAAU;gBACjB,UAAU,SAAS,CAAC,EAAE;gBACtB,oBAAoB,eAAe,CAAC,EAAE;gBACtC,mBAAmB,SAAS,CAAC,EAAE;YACjC;QACF;IACF;IAEA,OAAO,6BAAO,YAAY,CAAC,IAAM,EAAE,UAAU,CAAC,iBAAiB;AACjE;AAEA,SAAS,6BAAO,IAAI,EAAE,QAAuB;IAC3C,OAAO,KAAK,IAAI,CAAC,CAAC,GAAG,IAAM,SAAS,KAAK,SAAS;AACpD","sources":["packages/column-views/src/maps/column-correlation/state.ts"],"sourcesContent":["import { LineString, Point } from \"geojson\";\nimport { create, StoreApi, useStore } from \"zustand\";\nimport type { ColumnGeoJSONRecord } from \"@macrostrat/api-types\";\n// Turf intersection\nimport { lineIntersect } from \"@turf/line-intersect\";\nimport distance from \"@turf/distance\";\nimport { nearestPointOnLine } from \"@turf/nearest-point-on-line\";\nimport { centroid } from \"@turf/centroid\";\nimport {\n createContext,\n useState,\n useContext,\n ReactNode,\n useEffect,\n} from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport { createComputed } from \"zustand-computed\";\nimport { useMacrostratColumns } from \"../../data-provider/base\";\nimport { buffer } from \"@turf/buffer\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\n\nexport interface CorrelationMapInput {\n columns: ColumnGeoJSONRecord[];\n focusedLine: LineString | null;\n}\n\nexport interface CorrelationMapStore extends CorrelationMapInput {\n onClickMap: (event: mapboxgl.MapMouseEvent, point: Point) => void;\n}\n\nexport interface CorrelationProviderProps extends CorrelationMapInput {\n projectID?: number;\n inProcess?: boolean;\n columns: ColumnGeoJSONRecord[] | null;\n children: ReactNode;\n onSelectColumns?: (\n columns: FocusedColumnGeoJSONRecord[],\n line: LineString | null,\n ) => void;\n}\n\nconst CorrelationStoreContext =\n createContext<StoreApi<CorrelationMapStore> | null>(null);\n\ntype ComputedStore = {\n focusedColumns: FocusedColumnGeoJSONRecord[];\n};\n\n/** A computed store that will automatically update when the state changes */\nconst computed = createComputed((state: CorrelationMapStore): ComputedStore => {\n return {\n // We compute the focused columns based on columns and focusedLine\n focusedColumns: buildCorrelationColumns(state.columns, state.focusedLine),\n };\n}) as any;\n\nexport function ColumnCorrelationProvider({\n children,\n columns,\n projectID,\n inProcess,\n focusedLine,\n onSelectColumns,\n}: CorrelationProviderProps) {\n const [store] = useState(() => {\n return create<CorrelationMapStore & ComputedStore>(\n computed((set, get): CorrelationMapStore => {\n return {\n focusedLine,\n projectID,\n columns: null,\n onClickMap(event: mapboxgl.MapMouseEvent, point: Point) {\n const state = get();\n // Check if shift key is pressed\n const shiftKeyPressed = event.originalEvent.shiftKey;\n let existingCoords = state.focusedLine?.coordinates ?? [];\n\n if (existingCoords.length >= 2 && !shiftKeyPressed) {\n // Reset the line to zero length\n existingCoords = [];\n }\n set({\n focusedLine: {\n type: \"LineString\",\n coordinates: [...existingCoords, point.coordinates],\n },\n });\n },\n };\n }),\n );\n });\n\n // Set up the store\n /** TODO: move the fetching of all columns to within the map */\n const _columns = useMacrostratColumns(projectID, inProcess);\n useEffect(() => {\n if (_columns != null) {\n store.setState({ columns: _columns });\n }\n }, [_columns]);\n\n // Kind of an awkward way to do this but we need to allow the selector to run\n const focusedColumns = useStore(store, (state) => state.focusedColumns);\n const _focusedLine = useStore(store, (state) => state.focusedLine);\n\n useEffect(() => {\n onSelectColumns?.(focusedColumns, _focusedLine);\n }, [focusedColumns, _focusedLine]);\n\n return h(CorrelationStoreContext.Provider, { value: store }, children);\n}\n\nexport function useCorrelationMapStore(\n selector: (state: CorrelationMapStore & ComputedStore) => any,\n) {\n const storeApi = useContext(CorrelationStoreContext);\n if (storeApi == null) {\n throw new Error(\"Missing CorrelationMapProvider\");\n }\n return useStore(storeApi, selector);\n}\n\nfunction buildCorrelationColumns(\n columns: ColumnGeoJSONRecord[],\n line: LineString,\n): FocusedColumnGeoJSONRecord[] {\n if (columns == null || line == null || line.coordinates.length < 2) {\n return [];\n }\n return orderColumnsByDistance(\n computeIntersectingColumns(columns, line),\n line,\n );\n}\n\nfunction computeIntersectingColumns(\n columns: ColumnGeoJSONRecord[],\n line: LineString,\n): ColumnGeoJSONRecord[] {\n if (columns == null || line == null) {\n return [];\n }\n\n /** eODP-focused process. Find buffers around line and then find columns intersecting that buffer */\n const bufferedLine = buffer(line, 1, { units: \"degrees\" });\n\n const nearbyPoints = columns.filter((col) => {\n if (col.geometry?.type != \"Point\") {\n return false;\n }\n return booleanPointInPolygon(col.geometry, bufferedLine);\n });\n\n const intersectingPolygons = columns.filter((col) => {\n const poly = col.geometry;\n\n // Some in-process datasets seem to have null geometries\n if (poly == null) return false;\n if (poly.type != \"Polygon\" && poly.type != \"MultiPolygon\") return false;\n\n const intersection = lineIntersect(line, poly);\n return intersection.features.length > 0;\n });\n\n return [...intersectingPolygons, ...nearbyPoints];\n}\n\ninterface FocusedColumnGeoJSONRecord extends ColumnGeoJSONRecord {\n properties: {\n centroid: Point;\n nearestPointOnLine: Point;\n distanceAlongLine: number;\n } & ColumnGeoJSONRecord[\"properties\"];\n}\n\nfunction orderColumnsByDistance(\n columns: ColumnGeoJSONRecord[],\n line: LineString,\n): FocusedColumnGeoJSONRecord[] {\n const centroids = columns.map((col) => centroid(col.geometry));\n const projectedPoints = centroids.map((point) =>\n nearestPointOnLine(line, point),\n );\n const distances = projectedPoints.map((point) =>\n distance(point.geometry.coordinates, line.coordinates[0]),\n );\n\n let newColumns = columns.map((col, i) => {\n return {\n ...col,\n properties: {\n ...col.properties,\n centroid: centroids[i],\n nearestPointOnLine: projectedPoints[i],\n distanceAlongLine: distances[i],\n },\n };\n });\n\n return sorted(newColumns, (d) => d.properties.distanceAlongLine);\n}\n\nfunction sorted(data, accessor: (d) => number) {\n return data.sort((a, b) => accessor(a) - accessor(b));\n}\n"],"names":[],"version":3,"file":"column-views.bc83a85d.js.map"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {createCompositeScale as $728f6cf6c12cd490$export$3ada7641926a616d} from "./column-views.1b5bf0c6.js";
|
|
2
|
-
import {allowUnitSelectionAtom as $61771df184788970$export$3c12ff51b216428d, selectedUnitIDAtom as $61771df184788970$export$6d9520abc11d1c2b, UnitSelectionCallbackManager as $61771df184788970$export$1a7a0d00e4ba9c81} from "./column-views.
|
|
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";
|
|
5
5
|
import $a90Ta$macrostrathyper from "@macrostrat/hyper";
|
|
@@ -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.c1e507e6.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,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AAE,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.c1e507e6.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useCorrelationMapStore as $74e211dc185c20b4$export$21398703d3a9bb4d} from "./column-views.
|
|
1
|
+
import {useCorrelationMapStore as $74e211dc185c20b4$export$21398703d3a9bb4d} from "./column-views.bc83a85d.js";
|
|
2
2
|
import {buildColumnsStyle as $1dbfddc9637b572c$export$d2995719c3a4ae17} from "./column-views.633c42a3.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";
|
|
@@ -17,7 +17,7 @@ import {buildCrossSectionLayers as $6wt91$buildCrossSectionLayers} from "@macros
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
function $dcd183b733f66144$export$8e7d97509e84cc49(props) {
|
|
20
|
-
const { padding: padding = 50, children: children, columnColor: columnColor, ...rest } = props;
|
|
20
|
+
const { padding: padding = 50, children: children, columnColor: columnColor, projectID: projectID, ...rest } = props;
|
|
21
21
|
const overlayStyles = (0, $6wt91$useMemo)(()=>{
|
|
22
22
|
return [
|
|
23
23
|
(0, $1dbfddc9637b572c$export$d2995719c3a4ae17)(columnColor),
|
|
@@ -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.c93b63db.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAsBO,SAAS,0CAAqB,KAA0B;IAC7D,MAAM,WAAE,UAAU,cAAI,QAAQ,eAAE,WAAW,aAAE,SAAS,EAAE,GAAG,MAAM,GAAG;IAEpE,MAAM,gBAAkC,CAAA,GAAA,cAAM,EAAE;QAC9C,OAAO;YACL,CAAA,GAAA,yCAAgB,EAAE;YAClB;YACA;SACD;IACH,GAAG;QAAC;KAAY;IAEhB,OAAO,CAAA,GAAA,sBAAA,EACL,CAAA,GAAA,yCAAO,GACP;QACE,GAAG,IAAI;QACP,SAAS;QACT,YAAY;uBACZ;IACF,GACA;QACE,CAAA,GAAA,sBAAA,EAAE;QACF,CAAA,GAAA,sBAAA,EAAE;QACF,CAAA,GAAA,sBAAA,EAAE;QACF,CAAA,GAAA,sBAAA,EAAE,mCAAa;qBAAE;QAAQ;QACzB;KACD;AAEL;AAEA,SAAS;IACP,MAAM,aAAa,CAAA,GAAA,yCAAqB,EAAE,CAAC,QAAU,MAAM,UAAU;IAErE,CAAA,GAAA,yBAAiB,EACf,CAAC;QACC,WAAW,GAAG;YAAE,MAAM;YAAS,aAAa,EAAE,MAAM,CAAC,OAAO;QAAG;IACjE,GACA;QAAC;KAAW;IAGd,OAAO;AACT;AAEA,SAAS;IACP,MAAM,iBAAiB,CAAA,GAAA,yCAAqB,EAC1C,CAAC,QAAU,MAAM,cAAc;IAGjC,CAAA,GAAA,0BAAkB,EAChB,CAAC;QACC,IAAI,WAAW;QAEf,MAAM,OAA0B;YAC9B,MAAM;sBACN;QACF;QAEA,MAAM,qBAA8B;YAClC,MAAM;YACN,UAAU;gBACR,MAAM;gBACN,aA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A,8BAAsB;AAChC;AAEA,SAAS,kCAAY,WAAE,OAAO,EAAuB;IACnD,MAAM,cAAc,CAAA,GAAA,yCAAqB,EAAE,CAAC,QAAU,MAAM,WAAW;IAEvE,qBAAqB;IACrB,CAAA,GAAA,0BAAkB,EAChB,CAAC;QACC,IAAI,eAAe,MACjB;QAEF,MAAM,OAA0B;YAC9B,MAAM;YACN,UAAU;gBACR;oBACE,MAAM;oBACN,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.c93b63db.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.99cb1c41.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.ce5251f7.js.map
|