@macrostrat/column-views 2.4.2 → 2.4.4
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 +8 -0
- package/dist/esm/{column-views.af4278f0.js → column-views.0abf7e10.js} +11 -5
- package/dist/esm/column-views.0abf7e10.js.map +1 -0
- package/dist/esm/{column-views.1b5bf0c6.js → column-views.0b3c0d18.js} +5 -2
- package/dist/esm/column-views.0b3c0d18.js.map +1 -0
- package/dist/esm/{column-views.88b2418b.js → column-views.0ed9da35.js} +3 -3
- package/dist/esm/{column-views.88b2418b.js.map → column-views.0ed9da35.js.map} +1 -1
- package/dist/esm/{column-views.82eb5026.js → column-views.0faf79a9.js} +3 -3
- package/dist/esm/{column-views.82eb5026.js.map → column-views.0faf79a9.js.map} +1 -1
- package/dist/esm/{column-views.8ce33ec6.js → column-views.19539293.js} +2 -2
- package/dist/esm/{column-views.8ce33ec6.js.map → column-views.19539293.js.map} +1 -1
- package/dist/esm/{column-views.ce5251f7.js → column-views.1af3ec1f.js} +2 -2
- package/dist/esm/{column-views.ce5251f7.js.map → column-views.1af3ec1f.js.map} +1 -1
- package/dist/esm/{column-views.1ef55568.js → column-views.2a0010a3.js} +3 -3
- package/dist/esm/{column-views.1ef55568.js.map → column-views.2a0010a3.js.map} +1 -1
- package/dist/esm/{column-views.f35c4621.js → column-views.334c3947.js} +2 -2
- package/dist/esm/{column-views.f35c4621.js.map → column-views.334c3947.js.map} +1 -1
- package/dist/esm/{column-views.c93b63db.js → column-views.337b40a2.js} +3 -3
- package/dist/esm/{column-views.c93b63db.js.map → column-views.337b40a2.js.map} +1 -1
- package/dist/esm/{column-views.633c42a3.js → column-views.33d35a44.js} +25 -3
- package/dist/esm/column-views.33d35a44.js.map +1 -0
- package/dist/esm/{column-views.c1e507e6.js → column-views.362aae9a.js} +2 -2
- package/dist/esm/{column-views.c1e507e6.js.map → column-views.362aae9a.js.map} +1 -1
- package/dist/esm/{column-views.083fb787.js → column-views.4252a555.js} +5 -5
- package/dist/esm/{column-views.083fb787.js.map → column-views.4252a555.js.map} +1 -1
- package/dist/esm/{column-views.99cb1c41.js → column-views.45c70ba4.js} +3 -3
- package/dist/esm/{column-views.99cb1c41.js.map → column-views.45c70ba4.js.map} +1 -1
- package/dist/esm/{column-views.40d3688c.js → column-views.47b7d9ca.js} +2 -2
- package/dist/esm/{column-views.40d3688c.js.map → column-views.47b7d9ca.js.map} +1 -1
- package/dist/esm/{column-views.b4e1236d.js → column-views.47ca059d.js} +3 -3
- package/dist/esm/column-views.47ca059d.js.map +1 -0
- package/dist/esm/{column-views.3090f246.js → column-views.636d6553.js} +2 -2
- package/dist/esm/{column-views.3090f246.js.map → column-views.636d6553.js.map} +1 -1
- package/dist/esm/{column-views.a94e99a2.js → column-views.64f6ddd3.js} +2 -2
- package/dist/esm/{column-views.a94e99a2.js.map → column-views.64f6ddd3.js.map} +1 -1
- package/dist/esm/{column-views.88436022.js → column-views.6519a353.js} +2 -2
- package/dist/esm/{column-views.88436022.js.map → column-views.6519a353.js.map} +1 -1
- package/dist/esm/{column-views.18655508.js → column-views.6cff6659.js} +4 -4
- package/dist/esm/{column-views.18655508.js.map → column-views.6cff6659.js.map} +1 -1
- package/dist/esm/{column-views.fedccce9.js → column-views.70387120.js} +2 -2
- package/dist/esm/{column-views.fedccce9.js.map → column-views.70387120.js.map} +1 -1
- package/dist/esm/{column-views.3ae8f23d.js → column-views.74837922.js} +2 -2
- package/dist/esm/{column-views.3ae8f23d.js.map → column-views.74837922.js.map} +1 -1
- package/dist/esm/{column-views.e885211d.js → column-views.7bfb4318.js} +2 -2
- package/dist/esm/{column-views.e885211d.js.map → column-views.7bfb4318.js.map} +1 -1
- package/dist/esm/{column-views.f56e604d.js → column-views.7dc53f1b.js} +4 -4
- package/dist/esm/{column-views.f56e604d.js.map → column-views.7dc53f1b.js.map} +1 -1
- package/dist/esm/{column-views.ab2cc6cb.js → column-views.85df21ec.js} +11 -10
- package/dist/esm/column-views.85df21ec.js.map +1 -0
- package/dist/esm/{column-views.4e9b8594.js → column-views.87c589b7.js} +2 -2
- package/dist/esm/{column-views.4e9b8594.js.map → column-views.87c589b7.js.map} +1 -1
- package/dist/esm/{column-views.77322764.js → column-views.8da2b857.js} +2 -2
- package/dist/esm/{column-views.77322764.js.map → column-views.8da2b857.js.map} +1 -1
- package/dist/esm/{column-views.b957dc19.js → column-views.8fb37de7.js} +2 -2
- package/dist/esm/{column-views.b957dc19.js.map → column-views.8fb37de7.js.map} +1 -1
- package/dist/esm/{column-views.91c18fe3.js → column-views.9512c5d5.js} +10 -10
- package/dist/esm/{column-views.91c18fe3.js.map → column-views.9512c5d5.js.map} +1 -1
- package/dist/esm/{column-views.85d57d04.js → column-views.9905b91c.js} +4 -4
- package/dist/esm/{column-views.85d57d04.js.map → column-views.9905b91c.js.map} +1 -1
- package/dist/esm/{column-views.275ba52b.js → column-views.a4f394fe.js} +2 -2
- package/dist/esm/{column-views.275ba52b.js.map → column-views.a4f394fe.js.map} +1 -1
- package/dist/esm/{column-views.6f0d4f3a.js → column-views.b7cf0da2.js} +2 -2
- package/dist/esm/{column-views.6f0d4f3a.js.map → column-views.b7cf0da2.js.map} +1 -1
- package/dist/esm/{column-views.d4e50f74.js → column-views.c47dba5f.js} +3 -3
- package/dist/esm/{column-views.d4e50f74.js.map → column-views.c47dba5f.js.map} +1 -1
- package/dist/esm/{column-views.5ec7294d.js → column-views.c750a6df.js} +3 -3
- package/dist/esm/{column-views.5ec7294d.js.map → column-views.c750a6df.js.map} +1 -1
- package/dist/esm/{column-views.fc4860bd.js → column-views.cb1cc9f2.js} +4 -4
- package/dist/esm/{column-views.fc4860bd.js.map → column-views.cb1cc9f2.js.map} +1 -1
- package/dist/esm/{column-views.f904e6d7.js → column-views.ce000969.js} +3 -3
- package/dist/esm/{column-views.f904e6d7.js.map → column-views.ce000969.js.map} +1 -1
- package/dist/esm/{column-views.ee2fd38f.js → column-views.d7740949.js} +3 -3
- package/dist/esm/{column-views.ee2fd38f.js.map → column-views.d7740949.js.map} +1 -1
- package/dist/esm/{column-views.088a0274.js → column-views.d7e6bf67.js} +2 -2
- package/dist/esm/{column-views.088a0274.js.map → column-views.d7e6bf67.js.map} +1 -1
- package/dist/esm/{column-views.e6882667.js → column-views.dac0a3bb.js} +5 -5
- package/dist/esm/{column-views.e6882667.js.map → column-views.dac0a3bb.js.map} +1 -1
- package/dist/esm/{column-views.11353c2c.js → column-views.e13a0a76.js} +4 -4
- package/dist/esm/{column-views.11353c2c.js.map → column-views.e13a0a76.js.map} +1 -1
- package/dist/esm/{column-views.5e830e7c.js → column-views.ea08f667.js} +8 -8
- package/dist/esm/{column-views.5e830e7c.js.map → column-views.ea08f667.js.map} +1 -1
- package/dist/esm/{column-views.dd2d5a6d.js → column-views.ebb5f280.js} +5 -5
- package/dist/esm/{column-views.dd2d5a6d.js.map → column-views.ebb5f280.js.map} +1 -1
- package/dist/esm/{column-views.bc83a85d.js → column-views.fe42d2fc.js} +2 -2
- package/dist/esm/{column-views.bc83a85d.js.map → column-views.fe42d2fc.js.map} +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/node/column-views.048fdcaf.js +2 -0
- package/dist/node/column-views.048fdcaf.js.map +1 -0
- package/dist/node/{column-views.796fc1de.js → column-views.04a72b35.js} +2 -2
- package/dist/node/{column-views.796fc1de.js.map → column-views.04a72b35.js.map} +1 -1
- package/dist/node/{column-views.66663668.js → column-views.0af5912d.js} +2 -2
- package/dist/node/{column-views.66663668.js.map → column-views.0af5912d.js.map} +1 -1
- package/dist/node/{column-views.eecdc727.js → column-views.0d254fd3.js} +2 -2
- package/dist/node/{column-views.eecdc727.js.map → column-views.0d254fd3.js.map} +1 -1
- package/dist/node/{column-views.54f7a243.js → column-views.109cb0c8.js} +2 -2
- package/dist/node/{column-views.54f7a243.js.map → column-views.109cb0c8.js.map} +1 -1
- package/dist/node/column-views.133855e6.js +2 -0
- package/dist/node/column-views.133855e6.js.map +1 -0
- package/dist/node/{column-views.f4063bc8.js → column-views.15b5cecc.js} +2 -2
- package/dist/node/{column-views.f4063bc8.js.map → column-views.15b5cecc.js.map} +1 -1
- package/dist/node/{column-views.6f0cb059.js → column-views.183745c0.js} +2 -2
- package/dist/node/{column-views.6f0cb059.js.map → column-views.183745c0.js.map} +1 -1
- package/dist/node/{column-views.080781ca.js → column-views.2e2158f5.js} +2 -2
- package/dist/node/{column-views.080781ca.js.map → column-views.2e2158f5.js.map} +1 -1
- package/dist/node/{column-views.f93b4175.js → column-views.306acd3f.js} +2 -2
- package/dist/node/{column-views.f93b4175.js.map → column-views.306acd3f.js.map} +1 -1
- package/dist/node/{column-views.0818254f.js → column-views.31153f29.js} +2 -2
- package/dist/node/{column-views.0818254f.js.map → column-views.31153f29.js.map} +1 -1
- package/dist/node/{column-views.6051e986.js → column-views.31da008b.js} +2 -2
- package/dist/node/{column-views.6051e986.js.map → column-views.31da008b.js.map} +1 -1
- package/dist/node/column-views.40e758b3.js +2 -0
- package/dist/node/column-views.40e758b3.js.map +1 -0
- package/dist/node/{column-views.ffbffec7.js → column-views.4a28d695.js} +2 -2
- package/dist/node/{column-views.ffbffec7.js.map → column-views.4a28d695.js.map} +1 -1
- package/dist/node/{column-views.4d8fc443.js → column-views.5950c8eb.js} +2 -2
- package/dist/node/{column-views.4d8fc443.js.map → column-views.5950c8eb.js.map} +1 -1
- package/dist/node/{column-views.d30231cb.js → column-views.5987bc26.js} +2 -2
- package/dist/node/{column-views.d30231cb.js.map → column-views.5987bc26.js.map} +1 -1
- package/dist/node/{column-views.784bac2a.js → column-views.5bb858c9.js} +2 -2
- package/dist/node/{column-views.784bac2a.js.map → column-views.5bb858c9.js.map} +1 -1
- package/dist/node/{column-views.fe7a5452.js → column-views.5cbada24.js} +2 -2
- package/dist/node/{column-views.fe7a5452.js.map → column-views.5cbada24.js.map} +1 -1
- package/dist/node/{column-views.8c00beb4.js → column-views.5fcd2be6.js} +2 -2
- package/dist/node/{column-views.8c00beb4.js.map → column-views.5fcd2be6.js.map} +1 -1
- package/dist/node/{column-views.bdf05ed4.js → column-views.78b2d234.js} +2 -2
- package/dist/node/{column-views.bdf05ed4.js.map → column-views.78b2d234.js.map} +1 -1
- package/dist/node/{column-views.5908556a.js → column-views.8bee789c.js} +2 -2
- package/dist/node/{column-views.5908556a.js.map → column-views.8bee789c.js.map} +1 -1
- package/dist/node/{column-views.18e86c2d.js → column-views.90c36c0b.js} +2 -2
- package/dist/node/{column-views.18e86c2d.js.map → column-views.90c36c0b.js.map} +1 -1
- package/dist/node/{column-views.87d31e0a.js → column-views.a2476e39.js} +2 -2
- package/dist/node/{column-views.87d31e0a.js.map → column-views.a2476e39.js.map} +1 -1
- package/dist/node/{column-views.39b71a38.js → column-views.a8f5ee28.js} +2 -2
- package/dist/node/{column-views.39b71a38.js.map → column-views.a8f5ee28.js.map} +1 -1
- package/dist/node/{column-views.5f3f8ccf.js → column-views.ad60c02f.js} +2 -2
- package/dist/node/{column-views.5f3f8ccf.js.map → column-views.ad60c02f.js.map} +1 -1
- package/dist/node/{column-views.72c3c6e7.js → column-views.add5e42b.js} +2 -2
- package/dist/node/{column-views.72c3c6e7.js.map → column-views.add5e42b.js.map} +1 -1
- package/dist/node/{column-views.4d573ded.js → column-views.b2e5f823.js} +2 -2
- package/dist/node/{column-views.4d573ded.js.map → column-views.b2e5f823.js.map} +1 -1
- package/dist/node/{column-views.64fc40d6.js → column-views.b57e5e6e.js} +2 -2
- package/dist/node/{column-views.64fc40d6.js.map → column-views.b57e5e6e.js.map} +1 -1
- package/dist/node/{column-views.a596b1f5.js → column-views.ba9108fe.js} +2 -2
- package/dist/node/column-views.ba9108fe.js.map +1 -0
- package/dist/node/{column-views.b6613ab0.js → column-views.c16a19fb.js} +2 -2
- package/dist/node/{column-views.b6613ab0.js.map → column-views.c16a19fb.js.map} +1 -1
- package/dist/node/{column-views.74fcfb9c.js → column-views.c3097d9a.js} +2 -2
- package/dist/node/{column-views.74fcfb9c.js.map → column-views.c3097d9a.js.map} +1 -1
- package/dist/node/{column-views.fa5ee6de.js → column-views.c4c15e2b.js} +2 -2
- package/dist/node/{column-views.fa5ee6de.js.map → column-views.c4c15e2b.js.map} +1 -1
- package/dist/node/{column-views.58b336f1.js → column-views.c651b684.js} +2 -2
- package/dist/node/{column-views.58b336f1.js.map → column-views.c651b684.js.map} +1 -1
- package/dist/node/{column-views.447008d0.js → column-views.cf41a6d7.js} +2 -2
- package/dist/node/{column-views.447008d0.js.map → column-views.cf41a6d7.js.map} +1 -1
- package/dist/node/{column-views.5fd6e11a.js → column-views.d22bf15c.js} +2 -2
- package/dist/node/{column-views.5fd6e11a.js.map → column-views.d22bf15c.js.map} +1 -1
- package/dist/node/{column-views.5c02450b.js → column-views.d737de1e.js} +2 -2
- package/dist/node/{column-views.5c02450b.js.map → column-views.d737de1e.js.map} +1 -1
- package/dist/node/{column-views.0d48f51d.js → column-views.da902c44.js} +2 -2
- package/dist/node/{column-views.0d48f51d.js.map → column-views.da902c44.js.map} +1 -1
- package/dist/node/{column-views.003e0c17.js → column-views.e0e20136.js} +2 -2
- package/dist/node/{column-views.003e0c17.js.map → column-views.e0e20136.js.map} +1 -1
- package/dist/node/{column-views.7e895e1a.js → column-views.ec0087a2.js} +2 -2
- package/dist/node/{column-views.7e895e1a.js.map → column-views.ec0087a2.js.map} +1 -1
- package/dist/node/{column-views.d86e6c7d.js → column-views.fb3ed7cc.js} +2 -2
- package/dist/node/{column-views.d86e6c7d.js.map → column-views.fb3ed7cc.js.map} +1 -1
- package/dist/node/{column-views.94c8ce3e.js → column-views.fc4c2c61.js} +2 -2
- package/dist/node/{column-views.94c8ce3e.js.map → column-views.fc4c2c61.js.map} +1 -1
- package/dist/node/column-views.fcb243a2.js +2 -0
- package/dist/node/column-views.fcb243a2.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +4 -4
- package/src/correlation-chart/stories/correlation-chart.stories.ts +1 -24
- package/src/correlation-chart/stories/utils.ts +24 -0
- package/src/facets/measurements/sgp.ts +10 -3
- package/src/maps/_shared/styles.ts +12 -2
- package/src/maps/column-navigation/mapbox/index.ts +1 -0
- package/src/prepare-units/composite-scale.ts +9 -1
- package/src/prepare-units/helpers.ts +2 -2
- package/src/unit-details/panel.ts +15 -7
- package/dist/esm/column-views.1b5bf0c6.js.map +0 -1
- package/dist/esm/column-views.633c42a3.js.map +0 -1
- package/dist/esm/column-views.ab2cc6cb.js.map +0 -1
- package/dist/esm/column-views.af4278f0.js.map +0 -1
- package/dist/esm/column-views.b4e1236d.js.map +0 -1
- package/dist/node/column-views.021a6961.js +0 -2
- package/dist/node/column-views.021a6961.js.map +0 -1
- package/dist/node/column-views.139b0855.js +0 -2
- package/dist/node/column-views.139b0855.js.map +0 -1
- package/dist/node/column-views.375529b1.js +0 -2
- package/dist/node/column-views.375529b1.js.map +0 -1
- package/dist/node/column-views.5e73411d.js +0 -2
- package/dist/node/column-views.5e73411d.js.map +0 -1
- package/dist/node/column-views.a596b1f5.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,W,C,K,O,A,Q,0B,C,C,a,C,C,wB,C,K,uB,A,Q,O,C,C,kB,C,K,+B,A,Q,M,mB,A,Q,S,C,K,6B,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCwBA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAyBh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AG,CACjD,EAAE,yBAA0B,EAAE,wBAAyB,CAAC,EAAK,EAAO,GACrE,CACH,Q,K,c,C,K,kB,C,K,kB,C,K,sB","sources":["<anon>","packages/column-views/src/section.ts"],"sourcesContent":["import \"./column-views.d30231cb.js\";\nimport \"./column-views.1261be59.js\";\nimport \"./column-views.080781ca.js\";\nimport \"./column-views.5c02450b.js\";\nimport \"./column-views.5e73411d.js\";\nimport {useMemo as $dA1GT$useMemo} from \"react\";\nimport {useMacrostratIntervals as $dA1GT$useMacrostratIntervals, Timescale as $dA1GT$Timescale, TimescaleOrientation as $dA1GT$TimescaleOrientation} from \"@macrostrat/timescale\";\nimport {SVG as $dA1GT$SVG, ColumnAxisType as $dA1GT$ColumnAxisType} from \"@macrostrat/column-components\";\nimport $dA1GT$macrostrathyper from \"@macrostrat/hyper\";\nimport {Value as $dA1GT$Value} from \"@macrostrat/data-components\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\nvar $4Abge = parcelRequire(\"4Abge\");\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\n\nconst $69e10b1ec4ac73f6$var$h = (0, $dA1GT$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $69e10b1ec4ac73f6$export$38cb0ab5af8f50d7(props) {\n const { unconformityLabels: unconformityLabels = true, unitComponent: unitComponent, unitComponentProps: unitComponentProps, showLabels: showLabels = true, width: width = 300, columnWidth: columnWidth = 150, showLabelColumn: showLabelColumn = true, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const units = (0, $wtIgl.useMacrostratUnits)();\n // Get a unique key for the column\n const key = units[0]?.col_id;\n return $69e10b1ec4ac73f6$var$h((0, $4Abge.LabelTrackerProvider), {\n units: units,\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnitsColumn, {\n width: columnWidth,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns,\n unconformityLabels: unconformityLabels\n }),\n $69e10b1ec4ac73f6$var$h.if(showLabelColumn)((0, $4Abge.SectionLabelsColumn), {\n width: width - columnWidth\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnitsColumn(props) {\n const { width: width, showLabels: showLabels, unitComponent: unitComponent, unitComponentProps: unitComponentProps, clipUnits: clipUnits, maxInternalColumns: maxInternalColumns, axisType: axisType, unconformityLabels: unconformityLabels = true } = props;\n const { sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const scaleData = sections.map((section)=>{\n return section.scaleInfo;\n });\n const innerWidth = width - 2;\n return $69e10b1ec4ac73f6$var$h(\"div.section-units-container\", {\n style: {\n width: width\n }\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$SVG), {\n className: \"sections\",\n height: totalHeight,\n innerWidth: innerWidth,\n paddingH: 1\n }, sections.map((group)=>{\n const { units: units, scaleInfo: scaleInfo, section_id: section_id } = group;\n const key = `section-${section_id}`;\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnits, {\n units: units,\n scaleInfo: scaleInfo,\n key: key,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n width: innerWidth,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns\n });\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: width,\n sections: scaleData,\n verbose: false\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnits(props) {\n // Section with \"squishy\" timescale\n const { units: units, scaleInfo: scaleInfo, unitComponent: unitComponent, showLabels: showLabels = true, width: width = 300, unitComponentProps: unitComponentProps, className: className, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const { domain: domain, pixelScale: pixelScale, pixelHeight: pixelHeight, scale: scale } = scaleInfo;\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */ const _unitComponentProps = (0, $dA1GT$useMemo)(()=>{\n return {\n ...unitComponentProps,\n nColumns: Math.min(maxInternalColumns ?? Math.floor(width / 10), unitComponentProps?.nColumns ?? Infinity, Math.max(...units.map((d)=>d.column)) + 1)\n };\n }, [\n units,\n unitComponentProps,\n maxInternalColumns,\n width\n ]);\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`\n };\n return $69e10b1ec4ac73f6$var$h(\"g.section\", {\n className: className,\n style: style,\n transform: `translate(0 ${scaleInfo.offset})`\n }, $69e10b1ec4ac73f6$var$h((0, $lgTAP.MacrostratColumnProvider), {\n units: units,\n domain: domain,\n pixelScale: pixelScale,\n scale: scale\n }, $69e10b1ec4ac73f6$var$h((0, $4Abge.CompositeUnitsColumn), {\n width: width,\n showLabels: showLabels,\n unitComponent: unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits\n })));\n}\nfunction $69e10b1ec4ac73f6$export$db2df5a73a6fbe10(props) {\n const { sections: sections } = (0, $wtIgl.useMacrostratColumnData)();\n const sectionScales = sections.map((section)=>{\n return section.scaleInfo;\n });\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$export$463f46772c64d403, {\n packages: sectionScales,\n ...props\n });\n}\nfunction $69e10b1ec4ac73f6$export$463f46772c64d403(props) {\n const { levels: levels = 3, packages: packages, unconformityLabels: unconformityLabels = false } = props;\n // Use intervals from Macrostrat API\n const baseURL = (0, $lgTAP.useMacrostratBaseURL)();\n const intervals = (0, $dA1GT$useMacrostratIntervals)(baseURL);\n let _levels;\n if (typeof levels === \"number\") // If levels is a number, use the most common starting level\n _levels = [\n 2,\n Math.max(2 + Math.min(levels, 5) - 1, 1)\n ];\n else _levels = levels;\n const nCols = _levels[1] - _levels[0] + 1;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-column\", [\n $69e10b1ec4ac73f6$var$h(\"div.timescales\", packages.map((group)=>{\n const { pixelHeight: pixelHeight, paddingTop: paddingTop, key: key, scale: scale } = group;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-container\", {\n style: {\n paddingTop: paddingTop,\n \"--timescale-level-count\": nCols\n },\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$Timescale), {\n orientation: (0, $dA1GT$TimescaleOrientation).VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale: scale,\n intervals: intervals\n })\n ]);\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: (0, $dA1GT$ColumnAxisType).AGE\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$export$e12e53eeee198b99(props) {\n const { width: width, sections: sections, className: className, axisType: axisType, verbose: verbose } = props;\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity-labels\", {\n style: {\n width: width\n },\n className: className\n }, sections.map((scaleInfo, i)=>{\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$Unconformity, {\n axisType: axisType,\n upperAge: upperAge,\n lowerAge: lowerAge,\n style: {\n width: width,\n height: scaleInfo.paddingTop,\n top: top\n },\n verbose: verbose\n });\n }));\n}\nfunction $69e10b1ec4ac73f6$var$Unconformity({ upperAge: upperAge, lowerAge: lowerAge, style: style, axisType: axisType, verbose: verbose = false }) {\n if (upperAge == null || lowerAge == null) return null;\n const ageGap = Math.abs(upperAge - lowerAge);\n let maximumFractionDigits = 0;\n let className = null;\n if (ageGap > 1000) className = \"giga\";\n else if (ageGap > 100) className = \"mega\";\n else if (ageGap > 10) className = \"large\";\n else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else maximumFractionDigits = 1;\n let val;\n if (axisType === (0, $dA1GT$ColumnAxisType).DEPTH || axisType === (0, $dA1GT$ColumnAxisType).HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", {\n maximumFractionDigits: maximumFractionDigits\n });\n val = $69e10b1ec4ac73f6$var$h((0, $dA1GT$Value), {\n value: _txt,\n unit: \"m\"\n });\n } else val = $69e10b1ec4ac73f6$var$h((0, $iYfAq.Duration), {\n value: ageGap,\n maximumFractionDigits: maximumFractionDigits\n });\n let prefix = null;\n if (verbose) prefix = $69e10b1ec4ac73f6$var$h([\n \" \",\n $69e10b1ec4ac73f6$var$h(\"span.prefix\", \" gap\")\n ]);\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity\", {\n style: style,\n className: className\n }, [\n $69e10b1ec4ac73f6$var$h(\"div.unconformity-inner\", $69e10b1ec4ac73f6$var$h(\"div.unconformity-text\", [\n val,\n prefix\n ]))\n ]);\n}\n\n\nexport {$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7 as SectionsColumn, $69e10b1ec4ac73f6$export$e12e53eeee198b99 as UnconformityLabels, $69e10b1ec4ac73f6$export$db2df5a73a6fbe10 as CompositeTimescale, $69e10b1ec4ac73f6$export$463f46772c64d403 as CompositeTimescaleCore};\n//# sourceMappingURL=column-views.0818254f.js.map\n","import {\n CompositeUnitsColumn,\n LabelTrackerProvider,\n SectionLabelsColumn,\n} from \"./units\";\nimport { ReactNode, FunctionComponent, useMemo } from \"react\";\nimport {\n Timescale,\n TimescaleOrientation,\n useMacrostratIntervals,\n} from \"@macrostrat/timescale\";\nimport { ColumnAxisType, SVG } from \"@macrostrat/column-components\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./column.module.sass\";\nimport {\n useMacrostratColumnData,\n useMacrostratUnits,\n MacrostratColumnProvider,\n useMacrostratBaseURL,\n} from \"./data-provider\";\nimport { Duration } from \"./unit-details\";\nimport { Value } from \"@macrostrat/data-components\";\nimport type { ExtUnit, PackageScaleLayoutData } from \"./prepare-units/types\";\n\nconst h = hyper.styled(styles);\n\nexport interface SectionSharedProps {\n unitComponent?: FunctionComponent<any>;\n unitComponentProps?: any;\n showLabels?: boolean;\n width?: number;\n columnWidth?: number;\n children?: ReactNode;\n showLabelColumn?: boolean;\n axisType?: ColumnAxisType;\n className?: string;\n clipUnits?: boolean;\n maxInternalColumns?: number;\n // Space between sections\n verticalSpacing?: number;\n // Whether to render unconformity labels\n unconformityLabels?: boolean;\n}\n\nexport interface SectionProps extends SectionSharedProps {\n units: ExtUnit[];\n scaleInfo: PackageScaleLayoutData;\n}\n\nexport function SectionsColumn(props: SectionSharedProps) {\n const {\n unconformityLabels = true,\n unitComponent,\n unitComponentProps,\n showLabels = true,\n width = 300,\n columnWidth = 150,\n showLabelColumn = true,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const units = useMacrostratUnits();\n\n // Get a unique key for the column\n const key = units[0]?.col_id;\n\n return h(LabelTrackerProvider, { units, key }, [\n h(SectionUnitsColumn, {\n width: columnWidth,\n unitComponent,\n unitComponentProps,\n showLabels,\n clipUnits,\n maxInternalColumns,\n unconformityLabels,\n }),\n h.if(showLabelColumn)(SectionLabelsColumn, {\n width: width - columnWidth,\n }),\n ]);\n}\n\nfunction SectionUnitsColumn(props: SectionSharedProps) {\n const {\n width,\n showLabels,\n unitComponent,\n unitComponentProps,\n clipUnits,\n maxInternalColumns,\n axisType,\n unconformityLabels = true,\n } = props;\n\n const { sections, totalHeight } = useMacrostratColumnData();\n\n const scaleData: PackageScaleLayoutData[] = sections.map((section) => {\n return section.scaleInfo;\n });\n\n const innerWidth = width - 2;\n\n return h(\"div.section-units-container\", { style: { width } }, [\n h(\n SVG,\n {\n className: \"sections\",\n height: totalHeight,\n innerWidth,\n paddingH: 1,\n },\n sections.map((group) => {\n const { units, scaleInfo, section_id } = group;\n\n const key = `section-${section_id}`;\n return h(\n SectionUnits,\n {\n units,\n scaleInfo,\n key,\n unitComponent,\n unitComponentProps,\n showLabels,\n width: innerWidth,\n clipUnits,\n maxInternalColumns,\n }, // This unconformity is with the section _above_\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width,\n sections: scaleData,\n verbose: false,\n }),\n ]);\n}\n\nfunction SectionUnits(props: SectionProps) {\n // Section with \"squishy\" timescale\n const {\n units,\n scaleInfo,\n unitComponent,\n showLabels = true,\n width = 300,\n unitComponentProps,\n className,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const { domain, pixelScale, pixelHeight, scale } = scaleInfo;\n\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */\n const _unitComponentProps = useMemo(() => {\n return {\n ...unitComponentProps,\n nColumns: Math.min(\n maxInternalColumns ?? Math.floor(width / 10),\n unitComponentProps?.nColumns ?? Infinity,\n Math.max(...units.map((d) => d.column)) + 1,\n ),\n //axisType,\n };\n }, [units, unitComponentProps, maxInternalColumns, width]);\n\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`,\n };\n\n return h(\n \"g.section\",\n { className, style, transform: `translate(0 ${scaleInfo.offset})` },\n h(\n MacrostratColumnProvider,\n {\n units,\n domain,\n pixelScale, // Actually pixels per myr,\n scale,\n },\n h(CompositeUnitsColumn, {\n width,\n showLabels,\n unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits,\n }),\n ),\n );\n}\n\ninterface CompositeTimescaleProps {\n levels?: [number, number] | number;\n unconformityLabels?: boolean;\n}\n\nexport function CompositeTimescale(props: CompositeTimescaleProps) {\n const { sections } = useMacrostratColumnData();\n const sectionScales = sections.map((section) => {\n return section.scaleInfo;\n });\n\n return h(CompositeTimescaleCore, {\n packages: sectionScales,\n ...props,\n });\n}\n\ntype CompositeTimescaleCoreProps = CompositeTimescaleProps & {\n packages: PackageScaleLayoutData[];\n};\n\nexport function CompositeTimescaleCore(props: CompositeTimescaleCoreProps) {\n const { levels = 3, packages, unconformityLabels = false } = props;\n\n // Use intervals from Macrostrat API\n const baseURL = useMacrostratBaseURL();\n const intervals = useMacrostratIntervals(baseURL);\n\n let _levels: [number, number];\n if (typeof levels === \"number\") {\n // If levels is a number, use the most common starting level\n _levels = [2, Math.max(2 + Math.min(levels, 5) - 1, 1)];\n } else {\n _levels = levels;\n }\n\n const nCols = _levels[1] - _levels[0] + 1;\n\n return h(\"div.timescale-column\", [\n h(\n \"div.timescales\",\n packages.map((group) => {\n const { pixelHeight, paddingTop, key, scale } = group;\n return h(\n \"div.timescale-container\",\n { style: { paddingTop, \"--timescale-level-count\": nCols }, key },\n [\n h(Timescale, {\n orientation: TimescaleOrientation.VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale,\n intervals,\n }),\n ],\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: ColumnAxisType.AGE,\n }),\n ]);\n}\n\nexport function UnconformityLabels(props: {\n width: string | number;\n sections: PackageScaleLayoutData[];\n axisType?: ColumnAxisType;\n className?: string;\n verbose?: boolean;\n}) {\n const { width, sections, className, axisType, verbose } = props;\n\n return h(\n \"div.unconformity-labels\",\n {\n style: {\n width,\n },\n className,\n },\n sections.map((scaleInfo, i) => {\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return h(Unconformity, {\n axisType,\n upperAge,\n lowerAge,\n style: {\n width,\n height: scaleInfo.paddingTop,\n top,\n },\n verbose,\n });\n }),\n );\n}\n\nfunction Unconformity({\n upperAge,\n lowerAge,\n style,\n axisType,\n verbose = false,\n}) {\n if (upperAge == null || lowerAge == null) {\n return null;\n }\n\n const ageGap = Math.abs(upperAge - lowerAge);\n\n let maximumFractionDigits = 0;\n\n let className: string = null;\n if (ageGap > 1000) {\n className = \"giga\";\n } else if (ageGap > 100) {\n className = \"mega\";\n } else if (ageGap > 10) {\n className = \"large\";\n } else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else {\n maximumFractionDigits = 1;\n }\n\n let val: ReactNode;\n if (axisType === ColumnAxisType.DEPTH || axisType === ColumnAxisType.HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", { maximumFractionDigits });\n val = h(Value, { value: _txt, unit: \"m\" });\n } else {\n val = h(Duration, { value: ageGap, maximumFractionDigits });\n }\n\n let prefix: ReactNode = null;\n if (verbose) {\n prefix = h([\" \", h(\"span.prefix\", \" gap\")]);\n }\n\n return h(\"div.unconformity\", { style, className }, [\n h(\"div.unconformity-inner\", h(\"div.unconformity-text\", [val, prefix])),\n ]);\n}\n"],"names":["useMemo","$dA1GT$useMemo","useMacrostratIntervals","$dA1GT$useMacrostratIntervals","Timescale","$dA1GT$Timescale","TimescaleOrientation","$dA1GT$TimescaleOrientation","SVG","$dA1GT$SVG","ColumnAxisType","$dA1GT$ColumnAxisType","$dA1GT$macrostrathyper","Value","$dA1GT$Value","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$4Abge","$7YHvf","$lgTAP","$wtIgl","$iYfAq","$69e10b1ec4ac73f6$var$h","styled","a","__esModule","default","$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7","props","unconformityLabels","unitComponent","unitComponentProps","showLabels","width","columnWidth","showLabelColumn","clipUnits","maxInternalColumns","units","useMacrostratUnits","key","col_id","LabelTrackerProvider","$69e10b1ec4ac73f6$var$SectionUnitsColumn","if","SectionLabelsColumn","axisType","sections","totalHeight","useMacrostratColumnData","scaleData","map","section","scaleInfo","innerWidth","style","className","height","paddingH","group","section_id","$69e10b1ec4ac73f6$var$SectionUnits","$69e10b1ec4ac73f6$export$e12e53eeee198b99","verbose","domain","pixelScale","pixelHeight","scale","_unitComponentProps","nColumns","Math","min","floor","Infinity","max","d","column","transform","offset","MacrostratColumnProvider","CompositeUnitsColumn","clipToFrame","$69e10b1ec4ac73f6$export$db2df5a73a6fbe10","$69e10b1ec4ac73f6$export$463f46772c64d403","packages","_levels","levels","intervals","useMacrostratBaseURL","nCols","paddingTop","orientation","VERTICAL","length","absoluteAgeScale","showAgeAxis","AGE","i","lastGroup","top","$69e10b1ec4ac73f6$var$Unconformity","upperAge","lowerAge","val","ageGap","abs","maximumFractionDigits","DEPTH","HEIGHT","value","toLocaleString","unit","Duration","prefix","SectionsColumn","UnconformityLabels","CompositeTimescale","CompositeTimescaleCore"],"version":3,"file":"column-views.0818254f.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,W,C,K,O,A,Q,0B,C,C,a,C,C,wB,C,K,uB,A,Q,O,C,C,kB,C,K,+B,A,Q,M,mB,A,Q,S,C,K,6B,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,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AA,EAAe,MAAM,CAEnE,EAAE,EAAO,CAAE,MADJ,EAAO,cAAc,CAAC,QAAS,CAAE,sBAAA,CAAsB,GACtC,KAAM,GAAI,GAElC,EAAE,EAAA,QAAO,CAAG,CAAE,MAAO,EAAQ,sBAAA,CAAsB,GAG3D,IAAI,EAAoB,KAKxB,OAJI,GACF,CAAA,EAAS,EAAE,CAAC,IAAK,EAAE,cAAe,QAAQ,CAAA,EAGrC,EAAE,mBAAoB,CAAE,MAAA,EAAO,UAAA,CAAU,EAAG,CACjD,EAAE,yBAA0B,EAAE,wBAAyB,CAAC,EAAK,EAAO,GACrE,CACH,Q,K,c,C,K,kB,C,K,kB,C,K,sB","sources":["<anon>","packages/column-views/src/section.ts"],"sourcesContent":["import \"./column-views.5987bc26.js\";\nimport \"./column-views.1261be59.js\";\nimport \"./column-views.2e2158f5.js\";\nimport \"./column-views.d737de1e.js\";\nimport \"./column-views.048fdcaf.js\";\nimport {useMemo as $dA1GT$useMemo} from \"react\";\nimport {useMacrostratIntervals as $dA1GT$useMacrostratIntervals, Timescale as $dA1GT$Timescale, TimescaleOrientation as $dA1GT$TimescaleOrientation} from \"@macrostrat/timescale\";\nimport {SVG as $dA1GT$SVG, ColumnAxisType as $dA1GT$ColumnAxisType} from \"@macrostrat/column-components\";\nimport $dA1GT$macrostrathyper from \"@macrostrat/hyper\";\nimport {Value as $dA1GT$Value} from \"@macrostrat/data-components\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\nvar $4Abge = parcelRequire(\"4Abge\");\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\n\nconst $69e10b1ec4ac73f6$var$h = (0, $dA1GT$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $69e10b1ec4ac73f6$export$38cb0ab5af8f50d7(props) {\n const { unconformityLabels: unconformityLabels = true, unitComponent: unitComponent, unitComponentProps: unitComponentProps, showLabels: showLabels = true, width: width = 300, columnWidth: columnWidth = 150, showLabelColumn: showLabelColumn = true, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const units = (0, $wtIgl.useMacrostratUnits)();\n // Get a unique key for the column\n const key = units[0]?.col_id;\n return $69e10b1ec4ac73f6$var$h((0, $4Abge.LabelTrackerProvider), {\n units: units,\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnitsColumn, {\n width: columnWidth,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns,\n unconformityLabels: unconformityLabels\n }),\n $69e10b1ec4ac73f6$var$h.if(showLabelColumn)((0, $4Abge.SectionLabelsColumn), {\n width: width - columnWidth\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnitsColumn(props) {\n const { width: width, showLabels: showLabels, unitComponent: unitComponent, unitComponentProps: unitComponentProps, clipUnits: clipUnits, maxInternalColumns: maxInternalColumns, axisType: axisType, unconformityLabels: unconformityLabels = true } = props;\n const { sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const scaleData = sections.map((section)=>{\n return section.scaleInfo;\n });\n const innerWidth = width - 2;\n return $69e10b1ec4ac73f6$var$h(\"div.section-units-container\", {\n style: {\n width: width\n }\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$SVG), {\n className: \"sections\",\n height: totalHeight,\n innerWidth: innerWidth,\n paddingH: 1\n }, sections.map((group)=>{\n const { units: units, scaleInfo: scaleInfo, section_id: section_id } = group;\n const key = `section-${section_id}`;\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnits, {\n units: units,\n scaleInfo: scaleInfo,\n key: key,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n width: innerWidth,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns\n });\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: width,\n sections: scaleData,\n verbose: false\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnits(props) {\n // Section with \"squishy\" timescale\n const { units: units, scaleInfo: scaleInfo, unitComponent: unitComponent, showLabels: showLabels = true, width: width = 300, unitComponentProps: unitComponentProps, className: className, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const { domain: domain, pixelScale: pixelScale, pixelHeight: pixelHeight, scale: scale } = scaleInfo;\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */ const _unitComponentProps = (0, $dA1GT$useMemo)(()=>{\n return {\n ...unitComponentProps,\n nColumns: Math.min(maxInternalColumns ?? Math.floor(width / 10), unitComponentProps?.nColumns ?? Infinity, Math.max(...units.map((d)=>d.column)) + 1)\n };\n }, [\n units,\n unitComponentProps,\n maxInternalColumns,\n width\n ]);\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`\n };\n return $69e10b1ec4ac73f6$var$h(\"g.section\", {\n className: className,\n style: style,\n transform: `translate(0 ${scaleInfo.offset})`\n }, $69e10b1ec4ac73f6$var$h((0, $lgTAP.MacrostratColumnProvider), {\n units: units,\n domain: domain,\n pixelScale: pixelScale,\n scale: scale\n }, $69e10b1ec4ac73f6$var$h((0, $4Abge.CompositeUnitsColumn), {\n width: width,\n showLabels: showLabels,\n unitComponent: unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits\n })));\n}\nfunction $69e10b1ec4ac73f6$export$db2df5a73a6fbe10(props) {\n const { sections: sections } = (0, $wtIgl.useMacrostratColumnData)();\n const sectionScales = sections.map((section)=>{\n return section.scaleInfo;\n });\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$export$463f46772c64d403, {\n packages: sectionScales,\n ...props\n });\n}\nfunction $69e10b1ec4ac73f6$export$463f46772c64d403(props) {\n const { levels: levels = 3, packages: packages, unconformityLabels: unconformityLabels = false } = props;\n // Use intervals from Macrostrat API\n const baseURL = (0, $lgTAP.useMacrostratBaseURL)();\n const intervals = (0, $dA1GT$useMacrostratIntervals)(baseURL);\n let _levels;\n if (typeof levels === \"number\") // If levels is a number, use the most common starting level\n _levels = [\n 2,\n Math.max(2 + Math.min(levels, 5) - 1, 1)\n ];\n else _levels = levels;\n const nCols = _levels[1] - _levels[0] + 1;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-column\", [\n $69e10b1ec4ac73f6$var$h(\"div.timescales\", packages.map((group)=>{\n const { pixelHeight: pixelHeight, paddingTop: paddingTop, key: key, scale: scale } = group;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-container\", {\n style: {\n paddingTop: paddingTop,\n \"--timescale-level-count\": nCols\n },\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$Timescale), {\n orientation: (0, $dA1GT$TimescaleOrientation).VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale: scale,\n intervals: intervals\n })\n ]);\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: (0, $dA1GT$ColumnAxisType).AGE\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$export$e12e53eeee198b99(props) {\n const { width: width, sections: sections, className: className, axisType: axisType, verbose: verbose } = props;\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity-labels\", {\n style: {\n width: width\n },\n className: className\n }, sections.map((scaleInfo, i)=>{\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$Unconformity, {\n axisType: axisType,\n upperAge: upperAge,\n lowerAge: lowerAge,\n style: {\n width: width,\n height: scaleInfo.paddingTop,\n top: top\n },\n verbose: verbose\n });\n }));\n}\nfunction $69e10b1ec4ac73f6$var$Unconformity({ upperAge: upperAge, lowerAge: lowerAge, style: style, axisType: axisType, verbose: verbose = false }) {\n if (upperAge == null || lowerAge == null) return null;\n const ageGap = Math.abs(upperAge - lowerAge);\n let maximumFractionDigits = 0;\n let className = null;\n if (ageGap > 1000) className = \"giga\";\n else if (ageGap > 100) className = \"mega\";\n else if (ageGap > 10) className = \"large\";\n else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else maximumFractionDigits = 1;\n let val;\n if (axisType === (0, $dA1GT$ColumnAxisType).DEPTH || axisType === (0, $dA1GT$ColumnAxisType).HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", {\n maximumFractionDigits: maximumFractionDigits\n });\n val = $69e10b1ec4ac73f6$var$h((0, $dA1GT$Value), {\n value: _txt,\n unit: \"m\"\n });\n } else val = $69e10b1ec4ac73f6$var$h((0, $iYfAq.Duration), {\n value: ageGap,\n maximumFractionDigits: maximumFractionDigits\n });\n let prefix = null;\n if (verbose) prefix = $69e10b1ec4ac73f6$var$h([\n \" \",\n $69e10b1ec4ac73f6$var$h(\"span.prefix\", \" gap\")\n ]);\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity\", {\n style: style,\n className: className\n }, [\n $69e10b1ec4ac73f6$var$h(\"div.unconformity-inner\", $69e10b1ec4ac73f6$var$h(\"div.unconformity-text\", [\n val,\n prefix\n ]))\n ]);\n}\n\n\nexport {$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7 as SectionsColumn, $69e10b1ec4ac73f6$export$e12e53eeee198b99 as UnconformityLabels, $69e10b1ec4ac73f6$export$db2df5a73a6fbe10 as CompositeTimescale, $69e10b1ec4ac73f6$export$463f46772c64d403 as CompositeTimescaleCore};\n//# sourceMappingURL=column-views.31153f29.js.map\n","import {\n CompositeUnitsColumn,\n LabelTrackerProvider,\n SectionLabelsColumn,\n} from \"./units\";\nimport { ReactNode, FunctionComponent, useMemo } from \"react\";\nimport {\n Timescale,\n TimescaleOrientation,\n useMacrostratIntervals,\n} from \"@macrostrat/timescale\";\nimport { ColumnAxisType, SVG } from \"@macrostrat/column-components\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./column.module.sass\";\nimport {\n useMacrostratColumnData,\n useMacrostratUnits,\n MacrostratColumnProvider,\n useMacrostratBaseURL,\n} from \"./data-provider\";\nimport { Duration } from \"./unit-details\";\nimport { Value } from \"@macrostrat/data-components\";\nimport type { ExtUnit, PackageScaleLayoutData } from \"./prepare-units/types\";\n\nconst h = hyper.styled(styles);\n\nexport interface SectionSharedProps {\n unitComponent?: FunctionComponent<any>;\n unitComponentProps?: any;\n showLabels?: boolean;\n width?: number;\n columnWidth?: number;\n children?: ReactNode;\n showLabelColumn?: boolean;\n axisType?: ColumnAxisType;\n className?: string;\n clipUnits?: boolean;\n maxInternalColumns?: number;\n // Space between sections\n verticalSpacing?: number;\n // Whether to render unconformity labels\n unconformityLabels?: boolean;\n}\n\nexport interface SectionProps extends SectionSharedProps {\n units: ExtUnit[];\n scaleInfo: PackageScaleLayoutData;\n}\n\nexport function SectionsColumn(props: SectionSharedProps) {\n const {\n unconformityLabels = true,\n unitComponent,\n unitComponentProps,\n showLabels = true,\n width = 300,\n columnWidth = 150,\n showLabelColumn = true,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const units = useMacrostratUnits();\n\n // Get a unique key for the column\n const key = units[0]?.col_id;\n\n return h(LabelTrackerProvider, { units, key }, [\n h(SectionUnitsColumn, {\n width: columnWidth,\n unitComponent,\n unitComponentProps,\n showLabels,\n clipUnits,\n maxInternalColumns,\n unconformityLabels,\n }),\n h.if(showLabelColumn)(SectionLabelsColumn, {\n width: width - columnWidth,\n }),\n ]);\n}\n\nfunction SectionUnitsColumn(props: SectionSharedProps) {\n const {\n width,\n showLabels,\n unitComponent,\n unitComponentProps,\n clipUnits,\n maxInternalColumns,\n axisType,\n unconformityLabels = true,\n } = props;\n\n const { sections, totalHeight } = useMacrostratColumnData();\n\n const scaleData: PackageScaleLayoutData[] = sections.map((section) => {\n return section.scaleInfo;\n });\n\n const innerWidth = width - 2;\n\n return h(\"div.section-units-container\", { style: { width } }, [\n h(\n SVG,\n {\n className: \"sections\",\n height: totalHeight,\n innerWidth,\n paddingH: 1,\n },\n sections.map((group) => {\n const { units, scaleInfo, section_id } = group;\n\n const key = `section-${section_id}`;\n return h(\n SectionUnits,\n {\n units,\n scaleInfo,\n key,\n unitComponent,\n unitComponentProps,\n showLabels,\n width: innerWidth,\n clipUnits,\n maxInternalColumns,\n }, // This unconformity is with the section _above_\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width,\n sections: scaleData,\n verbose: false,\n }),\n ]);\n}\n\nfunction SectionUnits(props: SectionProps) {\n // Section with \"squishy\" timescale\n const {\n units,\n scaleInfo,\n unitComponent,\n showLabels = true,\n width = 300,\n unitComponentProps,\n className,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const { domain, pixelScale, pixelHeight, scale } = scaleInfo;\n\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */\n const _unitComponentProps = useMemo(() => {\n return {\n ...unitComponentProps,\n nColumns: Math.min(\n maxInternalColumns ?? Math.floor(width / 10),\n unitComponentProps?.nColumns ?? Infinity,\n Math.max(...units.map((d) => d.column)) + 1,\n ),\n //axisType,\n };\n }, [units, unitComponentProps, maxInternalColumns, width]);\n\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`,\n };\n\n return h(\n \"g.section\",\n { className, style, transform: `translate(0 ${scaleInfo.offset})` },\n h(\n MacrostratColumnProvider,\n {\n units,\n domain,\n pixelScale, // Actually pixels per myr,\n scale,\n },\n h(CompositeUnitsColumn, {\n width,\n showLabels,\n unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits,\n }),\n ),\n );\n}\n\ninterface CompositeTimescaleProps {\n levels?: [number, number] | number;\n unconformityLabels?: boolean;\n}\n\nexport function CompositeTimescale(props: CompositeTimescaleProps) {\n const { sections } = useMacrostratColumnData();\n const sectionScales = sections.map((section) => {\n return section.scaleInfo;\n });\n\n return h(CompositeTimescaleCore, {\n packages: sectionScales,\n ...props,\n });\n}\n\ntype CompositeTimescaleCoreProps = CompositeTimescaleProps & {\n packages: PackageScaleLayoutData[];\n};\n\nexport function CompositeTimescaleCore(props: CompositeTimescaleCoreProps) {\n const { levels = 3, packages, unconformityLabels = false } = props;\n\n // Use intervals from Macrostrat API\n const baseURL = useMacrostratBaseURL();\n const intervals = useMacrostratIntervals(baseURL);\n\n let _levels: [number, number];\n if (typeof levels === \"number\") {\n // If levels is a number, use the most common starting level\n _levels = [2, Math.max(2 + Math.min(levels, 5) - 1, 1)];\n } else {\n _levels = levels;\n }\n\n const nCols = _levels[1] - _levels[0] + 1;\n\n return h(\"div.timescale-column\", [\n h(\n \"div.timescales\",\n packages.map((group) => {\n const { pixelHeight, paddingTop, key, scale } = group;\n return h(\n \"div.timescale-container\",\n { style: { paddingTop, \"--timescale-level-count\": nCols }, key },\n [\n h(Timescale, {\n orientation: TimescaleOrientation.VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale,\n intervals,\n }),\n ],\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: ColumnAxisType.AGE,\n }),\n ]);\n}\n\nexport function UnconformityLabels(props: {\n width: string | number;\n sections: PackageScaleLayoutData[];\n axisType?: ColumnAxisType;\n className?: string;\n verbose?: boolean;\n}) {\n const { width, sections, className, axisType, verbose } = props;\n\n return h(\n \"div.unconformity-labels\",\n {\n style: {\n width,\n },\n className,\n },\n sections.map((scaleInfo, i) => {\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return h(Unconformity, {\n axisType,\n upperAge,\n lowerAge,\n style: {\n width,\n height: scaleInfo.paddingTop,\n top,\n },\n verbose,\n });\n }),\n );\n}\n\nfunction Unconformity({\n upperAge,\n lowerAge,\n style,\n axisType,\n verbose = false,\n}) {\n if (upperAge == null || lowerAge == null) {\n return null;\n }\n\n const ageGap = Math.abs(upperAge - lowerAge);\n\n let maximumFractionDigits = 0;\n\n let className: string = null;\n if (ageGap > 1000) {\n className = \"giga\";\n } else if (ageGap > 100) {\n className = \"mega\";\n } else if (ageGap > 10) {\n className = \"large\";\n } else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else {\n maximumFractionDigits = 1;\n }\n\n let val: ReactNode;\n if (axisType === ColumnAxisType.DEPTH || axisType === ColumnAxisType.HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", { maximumFractionDigits });\n val = h(Value, { value: _txt, unit: \"m\" });\n } else {\n val = h(Duration, { value: ageGap, maximumFractionDigits });\n }\n\n let prefix: ReactNode = null;\n if (verbose) {\n prefix = h([\" \", h(\"span.prefix\", \" gap\")]);\n }\n\n return h(\"div.unconformity\", { style, className }, [\n h(\"div.unconformity-inner\", h(\"div.unconformity-text\", [val, prefix])),\n ]);\n}\n"],"names":["useMemo","$dA1GT$useMemo","useMacrostratIntervals","$dA1GT$useMacrostratIntervals","Timescale","$dA1GT$Timescale","TimescaleOrientation","$dA1GT$TimescaleOrientation","SVG","$dA1GT$SVG","ColumnAxisType","$dA1GT$ColumnAxisType","$dA1GT$macrostrathyper","Value","$dA1GT$Value","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$4Abge","$7YHvf","$lgTAP","$wtIgl","$iYfAq","$69e10b1ec4ac73f6$var$h","styled","a","__esModule","default","$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7","props","unconformityLabels","unitComponent","unitComponentProps","showLabels","width","columnWidth","showLabelColumn","clipUnits","maxInternalColumns","units","useMacrostratUnits","key","col_id","LabelTrackerProvider","$69e10b1ec4ac73f6$var$SectionUnitsColumn","if","SectionLabelsColumn","axisType","sections","totalHeight","useMacrostratColumnData","scaleData","map","section","scaleInfo","innerWidth","style","className","height","paddingH","group","section_id","$69e10b1ec4ac73f6$var$SectionUnits","$69e10b1ec4ac73f6$export$e12e53eeee198b99","verbose","domain","pixelScale","pixelHeight","scale","_unitComponentProps","nColumns","Math","min","floor","Infinity","max","d","column","transform","offset","MacrostratColumnProvider","CompositeUnitsColumn","clipToFrame","$69e10b1ec4ac73f6$export$db2df5a73a6fbe10","$69e10b1ec4ac73f6$export$463f46772c64d403","packages","_levels","levels","intervals","useMacrostratBaseURL","nCols","paddingTop","orientation","VERTICAL","length","absoluteAgeScale","showAgeAxis","AGE","i","lastGroup","top","$69e10b1ec4ac73f6$var$Unconformity","upperAge","lowerAge","val","ageGap","abs","maximumFractionDigits","DEPTH","HEIGHT","value","toLocaleString","unit","Duration","prefix","SectionsColumn","UnconformityLabels","CompositeTimescale","CompositeTimescaleCore"],"version":3,"file":"column-views.31153f29.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.048fdcaf.js";import{Button as e}from"@blueprintjs/core";import{useKeyHandler as t}from"@macrostrat/ui-components";import i from"@macrostrat/hyper";var n=globalThis,r={},o={},a=n.parcelRequirea149;null==a&&((a=function(e){if(e in r)return r[e].exports;if(e in o){var t=o[e];delete o[e];var i={id:e,exports:{}};return r[e]=i,t.call(i.exports,i,i.exports),i.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,t){o[e]=t},n.parcelRequirea149=a),a.register,Object.defineProperty({},"UnitDetailsPanelWithNavigation",{get:()=>s,set:void 0,enumerable:!0,configurable:!0});var l=a("iYfAq");function s(n){let{unitData:r,className:o,selectedUnit:a,onSelectUnit:s,features:u,...c}=n,d=r?.findIndex(e=>e.unit_id===a?.unit_id),p={38:d-1,40:d+1};if(t(e=>{let t=p[e.keyCode];null==t||t<0||t>=r.length||(s(r[t].unit_id),e.stopPropagation())},[r,d]),null==a)return null;let f=i([i(e,{icon:"arrow-up",disabled:0===d,onClick(){s(r[d-1]?.unit_id)}}),i(e,{icon:"arrow-down",disabled:d===r.length-1,onClick(){s(r[d+1]?.unit_id)}})]);return i(l.UnitDetailsPanel,{unit:a,onClose(e){s(null)},className:o,actions:f,showLithologyProportions:!0,selectUnit:s,columnUnits:r,features:u,...c})}export{s as UnitDetailsPanelWithNavigation};
|
|
2
|
+
//# sourceMappingURL=column-views.31da008b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,Q,U,C,K,mB,A,Q,iB,C,K,2B,A,Q,M,mB,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,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E,EAAa,CAAQ,CAAC,EAAK,EAAE,EAAE,QACjC,CACF,GACD,EAED,OAAO,AAAA,EAAE,EAAA,gBAAe,CAAG,CACzB,KAAM,EACN,QAAQ,CAAK,EACX,EAAa,KACf,EACA,UAAA,EACA,QAAA,EACA,yBAA0B,CAAA,EAC1B,WAAY,EACZ,YAAa,EACb,SAAA,EACA,GAAG,CAAI,AACT,EACF,Q,K,8B","sources":["<anon>","packages/column-views/src/unit-details/modal-panel.ts"],"sourcesContent":["import \"./column-views.048fdcaf.js\";\nimport {Button as $cvq79$Button} from \"@blueprintjs/core\";\nimport {useKeyHandler as $cvq79$useKeyHandler} from \"@macrostrat/ui-components\";\nimport $cvq79$macrostrathyper from \"@macrostrat/hyper\";\n\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $a8b0b0b16d1f0073$exports = {};\n\n$parcel$export($a8b0b0b16d1f0073$exports, \"UnitDetailsPanelWithNavigation\", () => $a8b0b0b16d1f0073$export$cfdbe8496aa51962);\n\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\n\n\nfunction $a8b0b0b16d1f0073$export$cfdbe8496aa51962(props) {\n const { unitData: unitData, className: className, selectedUnit: selectedUnit, onSelectUnit: onSelectUnit, features: features, ...rest } = props;\n const ix = unitData?.findIndex((unit)=>unit.unit_id === selectedUnit?.unit_id);\n const keyMap = {\n 38: ix - 1,\n 40: ix + 1\n };\n (0, $cvq79$useKeyHandler)((event)=>{\n const nextIx = keyMap[event.keyCode];\n if (nextIx == null || nextIx < 0 || nextIx >= unitData.length) return;\n onSelectUnit(unitData[nextIx].unit_id);\n event.stopPropagation();\n }, [\n unitData,\n ix\n ]);\n if (selectedUnit == null) return null;\n const actions = (0, $cvq79$macrostrathyper)([\n (0, $cvq79$macrostrathyper)((0, $cvq79$Button), {\n icon: \"arrow-up\",\n disabled: ix === 0,\n onClick () {\n onSelectUnit(unitData[ix - 1]?.unit_id);\n }\n }),\n (0, $cvq79$macrostrathyper)((0, $cvq79$Button), {\n icon: \"arrow-down\",\n disabled: ix === unitData.length - 1,\n onClick () {\n onSelectUnit(unitData[ix + 1]?.unit_id);\n }\n })\n ]);\n return (0, $cvq79$macrostrathyper)((0, $iYfAq.UnitDetailsPanel), {\n unit: selectedUnit,\n onClose (event) {\n onSelectUnit(null);\n },\n className: className,\n actions: actions,\n showLithologyProportions: true,\n selectUnit: onSelectUnit,\n columnUnits: unitData,\n features: features,\n ...rest\n });\n}\n\n\nexport {$a8b0b0b16d1f0073$export$cfdbe8496aa51962 as UnitDetailsPanelWithNavigation};\n//# sourceMappingURL=column-views.31da008b.js.map\n","import { Button } from \"@blueprintjs/core\";\nimport { UnitDetailsPanel } from \"./panel\";\nimport { useKeyHandler } from \"@macrostrat/ui-components\";\nimport h from \"@macrostrat/hyper\";\n\nexport function UnitDetailsPanelWithNavigation(props) {\n const { unitData, className, selectedUnit, onSelectUnit, features, ...rest } =\n props;\n\n const ix = unitData?.findIndex(\n (unit) => unit.unit_id === selectedUnit?.unit_id,\n );\n\n const keyMap = {\n 38: ix - 1,\n 40: ix + 1,\n };\n\n useKeyHandler(\n (event) => {\n const nextIx = keyMap[event.keyCode];\n if (nextIx == null || nextIx < 0 || nextIx >= unitData.length) return;\n onSelectUnit(unitData[nextIx].unit_id);\n event.stopPropagation();\n },\n [unitData, ix],\n );\n\n if (selectedUnit == null) return null;\n\n const actions = h([\n h(Button, {\n icon: \"arrow-up\",\n disabled: ix === 0,\n onClick() {\n onSelectUnit(unitData[ix - 1]?.unit_id);\n },\n }),\n h(Button, {\n icon: \"arrow-down\",\n disabled: ix === unitData.length - 1,\n onClick() {\n onSelectUnit(unitData[ix + 1]?.unit_id);\n },\n }),\n ]);\n\n return h(UnitDetailsPanel, {\n unit: selectedUnit,\n onClose(event) {\n onSelectUnit(null);\n },\n className,\n actions,\n showLithologyProportions: true,\n selectUnit: onSelectUnit,\n columnUnits: unitData,\n features,\n ...rest,\n });\n}\n"],"names":["Button","$cvq79$Button","useKeyHandler","$cvq79$useKeyHandler","$cvq79$macrostrathyper","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","Object","defineProperty","get","$a8b0b0b16d1f0073$export$cfdbe8496aa51962","set","s","enumerable","configurable","$iYfAq","props","unitData","className","selectedUnit","onSelectUnit","features","rest","ix","findIndex","unit","unit_id","keyMap","event","nextIx","keyCode","length","stopPropagation","actions","icon","disabled","onClick","UnitDetailsPanel","onClose","showLithologyProportions","selectUnit","columnUnits","UnitDetailsPanelWithNavigation"],"version":3,"file":"column-views.31da008b.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./column-views.dbb4a46b.js";import{group as e}from"d3-array";import{ColumnAxisType as t}from"@macrostrat/column-components";import{compareAgeRanges as n,AgeRangeRelationship as a}from"@macrostrat/stratigraphy-utils";var r=globalThis,i={},o={},s=r.parcelRequirea149;null==s&&((s=function(e){if(e in i)return i[e].exports;if(e in o){var t=o[e];delete o[e];var n={id:e,exports:{}};return i[e]=n,t.call(n.exports,n,n.exports),n.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){o[e]=t},r.parcelRequirea149=s),s.register;var u=s("iWhRv");function p(e,n=t.AGE){let a=e.units.map((...e)=>(function(e,n,a,r=t.AGE){let i=.001;r!=t.AGE&&(i=.01);let o=a.filter(t=>t.unit_id!=e.unit_id&&(0,u.unitsOverlap)(e,t,r,i)),s=(0,u.getUnitHeightRange)(e,r),p=o.some(e=>(0,u.getUnitHeightRange)(e,r)[0]<s[0]+.001),c=0;return 1==o.length&&(c=1),{...e,bottomOverlap:p,column:e.column??c,overlappingUnits:o.map(e=>e.unit_id)}})(...e,0));for(let r of a){let i=a.filter(e=>r.overlappingUnits.includes(e.unit_id)).map(e=>e.column);if(i.includes(r.column)){let e=0;for(;i.includes(e);)e++;r.column??(r.column=e)}let[o,s]=(0,u.getUnitHeightRange)(r,n);n==t.AGE&&(o>e.b_age&&(r.b_clip_pos=e.b_age),s<e.t_age&&(r.t_clip_pos=e.t_age)),n==t.DEPTH&&(o>e.b_pos&&(r.b_clip_pos=e.b_pos),s<e.t_pos&&(r.t_clip_pos=e.t_pos))}return a}function c(n,a=t.AGE){let r=Array.from(e(n,e=>e.section_id)),i=(0,u.createUnitSorter)(a),o=r.map(([e,t])=>{let[n,r]=_(t),[o,s]=l(t,a);return t.sort(i),{section_id:e,t_age:r,b_age:n,b_pos:o,t_pos:s,units:t}}),s=(0,u.createUnitSorter)(a);return o.sort(s),o}function g(e,r=t.AGE){let i=[];for(let o of e){let e=(0,u.getUnitHeightRange)(o,r),s=i.find(t=>n(e,t.heightRange)!==a.Disjoint);null==s?i.push({heightRange:e,units:[o]}):(s.units.push(o),r==t.DEPTH||r==t.AGE?s.heightRange=[Math.max(s.heightRange[0],e[0]),Math.min(s.heightRange[1],e[1])]:s.heightRange=[Math.min(s.heightRange[0],e[0]),Math.max(s.heightRange[1],e[1])])}return i.map((e,t)=>{let[n,a]=_(e.units),[i,o]=l(e.units,r);return{section_id:-t,t_age:a,b_age:n,t_pos:o,b_pos:i,units:e.units}})}function l(e,n){let a=e.map(e=>{switch(n){case t.AGE:return e.t_age;case t.DEPTH:case t.HEIGHT:case t.ORDINAL:return e.t_pos;default:throw Error(`Unknown axis type: ${n}`)}}),r=e.map(e=>{switch(n){case t.AGE:return e.b_age;case t.DEPTH:case t.HEIGHT:case t.ORDINAL:return e.b_pos;default:throw Error(`Unknown axis type: ${n}`)}});return n==t.AGE||n==t.DEPTH?[Math.max(...r),Math.min(...a)]:[Math.min(...r),Math.max(...a)]}function _(e){return l(e,t.AGE)}function f(e){let[t,...n]=e,a=[t];for(let e of n){let t=a[a.length-1];if(t.b_age<e.t_age||t.t_age>e.b_age){a.push(e);continue}t.section_id=[...(0,u.ensureArray)(t.section_id),...(0,u.ensureArray)(e.section_id)],t.units.push(...e.units),t.b_age=Math.max(t.b_age,e.b_age),t.t_age=Math.min(t.t_age,e.t_age)}return a}function h(e){let t=e.b_pos,n=e.t_pos,a=e.unit_name,r=e.unit_name.match(/^(\d+(\.\d+)?)-(\d+(\.\d+)?): (.+)/);return r&&(n??(n=(0,u.ensureRealFloat)(r[1])),t??(t=(0,u.ensureRealFloat)(r[3])),a=r[5]),{...e,b_pos:(0,u.ensureRealFloat)(t),t_pos:(0,u.ensureRealFloat)(n),unit_name:a}}export{p as preprocessUnits,c as groupUnitsIntoSectionsBySectionID,_ as getSectionAgeRange,l as getSectionPosRange,g as groupUnitsIntoSectionsByOverlap,f as mergeOverlappingSections,h as preprocessSectionUnit};
|
|
2
|
+
//# sourceMappingURL=column-views.40e758b3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,M,6C,A,Q,S,C,K,U,A,Q,kB,C,K,+B,A,Q,oB,C,C,wB,C,K,gC,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,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EAAQ,KAAK,EAC7D,EAAY,KAAK,CAAG,KAAK,GAAG,CAAC,EAAY,KAAK,CAAE,EAAQ,KAAK,CAC/D,CACA,OAAO,CACT,CAEO,SAAS,EAAsB,CAAc,EAKlD,IAAI,EAAQ,EAAK,KAAK,CAClB,EAAQ,EAAK,KAAK,CAElB,EAAY,EAAK,SAAS,CAIxB,EAAQ,EAAK,SAAS,CAAC,KAAK,CAAC,sCASnC,OAPI,IAEF,GAAA,CAAA,EAAU,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,CAAK,CAAC,EAAE,CAAA,EAClC,GAAA,CAAA,EAAU,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,CAAK,CAAC,EAAE,CAAA,EAClC,EAAY,CAAK,CAAC,EAAE,EAGf,CACL,GAAG,CAAI,CACP,MAAO,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,GACvB,MAAO,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,GACvB,UAAA,CACF,CACF,Q,K,e,C,K,iC,C,K,kB,C,K,kB,C,K,+B,C,K,wB,C,K,qB","sources":["<anon>","packages/column-views/src/prepare-units/helpers.ts"],"sourcesContent":["import \"./column-views.dbb4a46b.js\";\nimport {group as $lOZ4A$group} from \"d3-array\";\nimport {ColumnAxisType as $lOZ4A$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {compareAgeRanges as $lOZ4A$compareAgeRanges, AgeRangeRelationship as $lOZ4A$AgeRangeRelationship} from \"@macrostrat/stratigraphy-utils\";\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\nconst $57278f42f24b59e5$var$dt = 0.001;\nfunction $57278f42f24b59e5$export$55543e159517d62d(section, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Preprocess units to add overlapping units and columns. */ let units = section.units;\n let divisions = units.map((...args)=>$57278f42f24b59e5$var$extendDivision(...args, axisType));\n for (let d of divisions){\n const overlappingUnits = divisions.filter((u)=>d.overlappingUnits.includes(u.unit_id));\n // Overlapping columns\n const columns = overlappingUnits.map((d)=>d.column);\n if (columns.includes(d.column)) {\n var _d;\n let col = 0;\n // Go through columns to find a better index\n while(columns.includes(col))col++;\n (_d = d).column ?? (_d.column = col);\n }\n // If unit overlaps the edges of a section, set the clip positions\n const [b_pos, t_pos] = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n if (axisType == (0, $lOZ4A$ColumnAxisType).AGE) {\n if (b_pos > section.b_age) d.b_clip_pos = section.b_age;\n if (t_pos < section.t_age) d.t_clip_pos = section.t_age;\n }\n if (axisType == (0, $lOZ4A$ColumnAxisType).DEPTH) {\n if (b_pos > section.b_pos) d.b_clip_pos = section.b_pos;\n if (t_pos < section.t_pos) d.t_clip_pos = section.t_pos;\n }\n // if (axisType == ColumnAxisType.HEIGHT) {\n // if (b_pos < section.b_pos) {\n // d.b_clip_pos = section.b_pos;\n // }\n // if (t_pos > section.t_pos) {\n // d.t_clip_pos = section.t_pos;\n // }\n // }\n }\n return divisions;\n}\nfunction $57278f42f24b59e5$var$extendDivision(unit, i, divisions, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n // TODO: make this configurable\n let tolerance = 0.001; // 1 kyr tolerance for age columns\n if (axisType != (0, $lOZ4A$ColumnAxisType).AGE) tolerance = 0.01; // 1cm tolerance for height/depth columns\n const overlappingUnits = divisions.filter((d)=>d.unit_id != unit.unit_id && (0, $iWhRv.unitsOverlap)(unit, d, axisType, tolerance));\n const u_pos = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n const bottomOverlap = overlappingUnits.some((d)=>{\n const d_pos = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n // Check if the unit is below the current unit\n return d_pos[0] < u_pos[0] + $57278f42f24b59e5$var$dt;\n });\n let column = 0;\n if (overlappingUnits.length == 1) column = 1;\n return {\n ...unit,\n bottomOverlap: bottomOverlap,\n column: unit.column ?? column,\n overlappingUnits: overlappingUnits.map((d)=>d.unit_id)\n };\n}\nfunction $57278f42f24b59e5$export$eeade20e3eee4638(units, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Group units into sections by section_id.\n * This works for large-scale Macrostrat columns, where units are grouped by section_id.\n * */ let groups = Array.from((0, $lOZ4A$group)(units, (d)=>d.section_id));\n const unitComparator = (0, $iWhRv.createUnitSorter)(axisType);\n const groups1 = groups.map(([section_id, sectionUnits])=>{\n const [b_age, t_age] = $57278f42f24b59e5$export$8093438ec3e4c6fd(sectionUnits);\n const [b_pos, t_pos] = $57278f42f24b59e5$export$483b05c497fd70c6(sectionUnits, axisType);\n // sort units by position\n sectionUnits.sort(unitComparator);\n return {\n section_id: section_id,\n t_age: t_age,\n b_age: b_age,\n b_pos: b_pos,\n t_pos: t_pos,\n units: sectionUnits\n };\n });\n // Sort sections by increasing top age, then increasing bottom age.\n // Sections have no relative ordinal position other than age...\n const compareSections = (0, $iWhRv.createUnitSorter)(axisType);\n groups1.sort(compareSections);\n return groups1;\n}\nfunction $57278f42f24b59e5$export$bb26cdbde9c8c08b(units, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Group units into sections by overlap.\n * This creates \"synthetic\" sections that correspond to packages bound by scale gaps.\n * This is most useful in the height and depth domains, where gaps (e.g., missing core) are\n * common.\n * */ // Start with each unit as its own \"section\", and progressively merge...\n const sectionList = [];\n for (const unit of units){\n // Check if the unit overlaps with any existing section\n const heightRange = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n let section = sectionList.find((s)=>(0, $lOZ4A$compareAgeRanges)(heightRange, s.heightRange) !== (0, $lOZ4A$AgeRangeRelationship).Disjoint);\n if (section == null) // No overlap, create a new section\n sectionList.push({\n heightRange: heightRange,\n units: [\n unit\n ]\n });\n else {\n // Overlap, merge the unit into the section\n section.units.push(unit);\n // Update the height range\n if (axisType == (0, $lOZ4A$ColumnAxisType).DEPTH || axisType == (0, $lOZ4A$ColumnAxisType).AGE) section.heightRange = [\n Math.max(section.heightRange[0], heightRange[0]),\n Math.min(section.heightRange[1], heightRange[1])\n ];\n else section.heightRange = [\n Math.min(section.heightRange[0], heightRange[0]),\n Math.max(section.heightRange[1], heightRange[1])\n ];\n }\n }\n // We should have a section for each unit, now we can convert to SectionInfo\n // Ages have to be really actually ages, not heights\n return sectionList.map((section, i)=>{\n const [b_age, t_age] = $57278f42f24b59e5$export$8093438ec3e4c6fd(section.units);\n const [b_pos, t_pos] = $57278f42f24b59e5$export$483b05c497fd70c6(section.units, axisType);\n return {\n // Negative section IDs are used to indicate that these are synthetic sections\n section_id: -i,\n t_age: t_age,\n b_age: b_age,\n t_pos: t_pos,\n b_pos: b_pos,\n units: section.units\n };\n });\n}\nfunction $57278f42f24b59e5$export$483b05c497fd70c6(units, axisType) {\n /** Get the overall position range of a set of units. */ const t_positions = units.map((d)=>{\n switch(axisType){\n case (0, $lOZ4A$ColumnAxisType).AGE:\n return d.t_age;\n case (0, $lOZ4A$ColumnAxisType).DEPTH:\n case (0, $lOZ4A$ColumnAxisType).HEIGHT:\n case (0, $lOZ4A$ColumnAxisType).ORDINAL:\n return d.t_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n const b_positions = units.map((d)=>{\n switch(axisType){\n case (0, $lOZ4A$ColumnAxisType).AGE:\n return d.b_age;\n case (0, $lOZ4A$ColumnAxisType).DEPTH:\n case (0, $lOZ4A$ColumnAxisType).HEIGHT:\n case (0, $lOZ4A$ColumnAxisType).ORDINAL:\n return d.b_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n if (axisType == (0, $lOZ4A$ColumnAxisType).AGE || axisType == (0, $lOZ4A$ColumnAxisType).DEPTH) return [\n Math.max(...b_positions),\n Math.min(...t_positions)\n ];\n else return [\n Math.min(...b_positions),\n Math.max(...t_positions)\n ];\n}\nfunction $57278f42f24b59e5$export$8093438ec3e4c6fd(units) {\n /** Get the overall age range of a set of units. */ return $57278f42f24b59e5$export$483b05c497fd70c6(units, (0, $lOZ4A$ColumnAxisType).AGE);\n}\nfunction $57278f42f24b59e5$export$e7bb744b9be37f3d(sections) {\n /** Columns can have sections that overlap in time. Here, we merge overlapping\n * sections into a single section to correctly render gap-bound packages.\n */ const [firstSection, ...rest] = sections;\n const newSections = [\n firstSection\n ];\n for (const section of rest){\n const lastSection = newSections[newSections.length - 1];\n if (lastSection.b_age < section.t_age || lastSection.t_age > section.b_age) {\n // No overlap, add the section as normal\n newSections.push(section);\n continue;\n }\n // Overlap, merge the sections\n lastSection.section_id = [\n ...(0, $iWhRv.ensureArray)(lastSection.section_id),\n ...(0, $iWhRv.ensureArray)(section.section_id)\n ];\n lastSection.units.push(...section.units);\n lastSection.b_age = Math.max(lastSection.b_age, section.b_age);\n lastSection.t_age = Math.min(lastSection.t_age, section.t_age);\n }\n return newSections;\n}\nfunction $57278f42f24b59e5$export$47e05aac3f0b77d4(unit) {\n /** Preprocess a single unit for a \"section\" column type.\n * This mostly handles vagaries of eODP-style columns.\n * */ let b_pos = unit.b_pos;\n let t_pos = unit.t_pos;\n let unit_name = unit.unit_name;\n // eODP columns sometimes have overlapping core sections, which are encoded in the name field\n // Match eODP section names\n const match = unit.unit_name.match(/^(\\d+(\\.\\d+)?)-(\\d+(\\.\\d+)?): (.+)/);\n if (match) {\n // These values should already be set if we've used the show_positions flag\n t_pos ?? (t_pos = (0, $iWhRv.ensureRealFloat)(match[1]));\n b_pos ?? (b_pos = (0, $iWhRv.ensureRealFloat)(match[3]));\n unit_name = match[5];\n }\n return {\n ...unit,\n b_pos: (0, $iWhRv.ensureRealFloat)(b_pos),\n t_pos: (0, $iWhRv.ensureRealFloat)(t_pos),\n unit_name: unit_name\n };\n}\n\n\nexport {$57278f42f24b59e5$export$55543e159517d62d as preprocessUnits, $57278f42f24b59e5$export$eeade20e3eee4638 as groupUnitsIntoSectionsBySectionID, $57278f42f24b59e5$export$8093438ec3e4c6fd as getSectionAgeRange, $57278f42f24b59e5$export$483b05c497fd70c6 as getSectionPosRange, $57278f42f24b59e5$export$bb26cdbde9c8c08b as groupUnitsIntoSectionsByOverlap, $57278f42f24b59e5$export$e7bb744b9be37f3d as mergeOverlappingSections, $57278f42f24b59e5$export$47e05aac3f0b77d4 as preprocessSectionUnit};\n//# sourceMappingURL=column-views.40e758b3.js.map\n","import type { BaseUnit, UnitLong } from \"@macrostrat/api-types\";\nimport { group } from \"d3-array\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n createUnitSorter,\n ensureArray,\n ensureRealFloat,\n getUnitHeightRange,\n unitsOverlap,\n} from \"./utils\";\nimport {\n AgeRangeRelationship,\n compareAgeRanges,\n} from \"@macrostrat/stratigraphy-utils\";\nimport type { ExtUnit, SectionInfo, StratigraphicPackage } from \"./types\";\n\nconst dt = 0.001;\n\nexport function preprocessUnits<T extends UnitLong = UnitLong>(\n section: SectionInfo<T>,\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): ExtUnit[] {\n /** Preprocess units to add overlapping units and columns. */\n let units = section.units;\n\n let divisions = units.map((...args) => extendDivision(...args, axisType));\n for (let d of divisions) {\n const overlappingUnits = divisions.filter((u) =>\n d.overlappingUnits.includes(u.unit_id),\n );\n\n // Overlapping columns\n const columns = overlappingUnits.map((d) => d.column);\n\n if (columns.includes(d.column)) {\n let col = 0;\n // Go through columns to find a better index\n while (columns.includes(col)) {\n col++;\n }\n d.column ??= col;\n }\n\n // If unit overlaps the edges of a section, set the clip positions\n const [b_pos, t_pos] = getUnitHeightRange(d, axisType);\n if (axisType == ColumnAxisType.AGE) {\n if (b_pos > section.b_age) {\n d.b_clip_pos = section.b_age;\n }\n if (t_pos < section.t_age) {\n d.t_clip_pos = section.t_age;\n }\n }\n if (axisType == ColumnAxisType.DEPTH) {\n if (b_pos > section.b_pos) {\n d.b_clip_pos = section.b_pos;\n }\n if (t_pos < section.t_pos) {\n d.t_clip_pos = section.t_pos;\n }\n }\n // if (axisType == ColumnAxisType.HEIGHT) {\n // if (b_pos < section.b_pos) {\n // d.b_clip_pos = section.b_pos;\n // }\n // if (t_pos > section.t_pos) {\n // d.t_clip_pos = section.t_pos;\n // }\n // }\n }\n\n return divisions;\n}\n\nfunction extendDivision(\n unit: UnitLong,\n i: number,\n divisions: UnitLong[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): ExtUnit {\n // TODO: make this configurable\n let tolerance = 0.001; // 1 kyr tolerance for age columns\n if (axisType != ColumnAxisType.AGE) {\n tolerance = 0.01; // 1cm tolerance for height/depth columns\n }\n\n const overlappingUnits = divisions.filter(\n (d) =>\n d.unit_id != unit.unit_id && unitsOverlap(unit, d, axisType, tolerance),\n );\n const u_pos = getUnitHeightRange(unit, axisType);\n const bottomOverlap = overlappingUnits.some((d) => {\n const d_pos = getUnitHeightRange(d, axisType);\n // Check if the unit is below the current unit\n return d_pos[0] < u_pos[0] + dt;\n });\n let column = 0;\n if (overlappingUnits.length == 1) {\n column = 1;\n }\n\n return {\n ...unit,\n bottomOverlap,\n column: unit.column ?? column,\n overlappingUnits: overlappingUnits.map((d) => d.unit_id),\n };\n}\n\nexport function groupUnitsIntoSectionsBySectionID<T extends UnitLong>(\n units: T[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): SectionInfo<T>[] {\n /** Group units into sections by section_id.\n * This works for large-scale Macrostrat columns, where units are grouped by section_id.\n * */\n let groups = Array.from(group(units, (d) => d.section_id));\n const unitComparator = createUnitSorter(axisType);\n\n const groups1 = groups.map(([section_id, sectionUnits]) => {\n const [b_age, t_age] = getSectionAgeRange(sectionUnits);\n const [b_pos, t_pos] = getSectionPosRange(sectionUnits, axisType);\n\n // sort units by position\n sectionUnits.sort(unitComparator);\n return { section_id, t_age, b_age, b_pos, t_pos, units: sectionUnits };\n });\n // Sort sections by increasing top age, then increasing bottom age.\n // Sections have no relative ordinal position other than age...\n const compareSections = createUnitSorter(axisType) as (\n a: StratigraphicPackage,\n b: StratigraphicPackage,\n ) => number;\n groups1.sort(compareSections);\n return groups1;\n}\n\ninterface WorkingSection {\n units: UnitLong[];\n // Position or age\n heightRange?: [number, number];\n}\n\nexport function groupUnitsIntoSectionsByOverlap<T extends UnitLong>(\n units: T[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): SectionInfo<T>[] {\n /** Group units into sections by overlap.\n * This creates \"synthetic\" sections that correspond to packages bound by scale gaps.\n * This is most useful in the height and depth domains, where gaps (e.g., missing core) are\n * common.\n * */\n // Start with each unit as its own \"section\", and progressively merge...\n const sectionList: WorkingSection[] = [];\n for (const unit of units) {\n // Check if the unit overlaps with any existing section\n const heightRange = getUnitHeightRange(unit, axisType);\n let section: WorkingSection | undefined = sectionList.find(\n (s) =>\n compareAgeRanges(heightRange, s.heightRange) !==\n AgeRangeRelationship.Disjoint,\n );\n if (section == null) {\n // No overlap, create a new section\n sectionList.push({\n heightRange,\n units: [unit],\n });\n } else {\n // Overlap, merge the unit into the section\n section.units.push(unit);\n // Update the height range\n if (axisType == ColumnAxisType.DEPTH || axisType == ColumnAxisType.AGE) {\n section.heightRange = [\n Math.max(section.heightRange[0], heightRange[0]),\n Math.min(section.heightRange[1], heightRange[1]),\n ];\n } else {\n section.heightRange = [\n Math.min(section.heightRange[0], heightRange[0]),\n Math.max(section.heightRange[1], heightRange[1]),\n ];\n }\n }\n }\n // We should have a section for each unit, now we can convert to SectionInfo\n // Ages have to be really actually ages, not heights\n\n return sectionList.map((section, i) => {\n const [b_age, t_age] = getSectionAgeRange(section.units);\n const [b_pos, t_pos] = getSectionPosRange(section.units, axisType);\n return {\n // Negative section IDs are used to indicate that these are synthetic sections\n section_id: -i,\n t_age,\n b_age,\n t_pos,\n b_pos,\n units: section.units as T[],\n };\n });\n}\n\nexport function getSectionPosRange(\n units: BaseUnit[],\n axisType: ColumnAxisType,\n): [number, number] {\n /** Get the overall position range of a set of units. */\n const t_positions = units.map((d) => {\n switch (axisType) {\n case ColumnAxisType.AGE:\n return d.t_age;\n case ColumnAxisType.DEPTH:\n case ColumnAxisType.HEIGHT:\n case ColumnAxisType.ORDINAL:\n return d.t_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n const b_positions = units.map((d) => {\n switch (axisType) {\n case ColumnAxisType.AGE:\n return d.b_age;\n case ColumnAxisType.DEPTH:\n case ColumnAxisType.HEIGHT:\n case ColumnAxisType.ORDINAL:\n return d.b_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n if (axisType == ColumnAxisType.AGE || axisType == ColumnAxisType.DEPTH) {\n return [Math.max(...b_positions), Math.min(...t_positions)];\n } else {\n return [Math.min(...b_positions), Math.max(...t_positions)];\n }\n}\n\nexport function getSectionAgeRange(units: BaseUnit[]): [number, number] {\n /** Get the overall age range of a set of units. */\n return getSectionPosRange(units, ColumnAxisType.AGE);\n}\n\nexport function mergeOverlappingSections<T extends UnitLong>(\n sections: SectionInfo<T>[],\n): SectionInfo<T>[] {\n /** Columns can have sections that overlap in time. Here, we merge overlapping\n * sections into a single section to correctly render gap-bound packages.\n */\n const [firstSection, ...rest] = sections;\n const newSections = [firstSection];\n for (const section of rest) {\n const lastSection = newSections[newSections.length - 1];\n if (\n lastSection.b_age < section.t_age ||\n lastSection.t_age > section.b_age\n ) {\n // No overlap, add the section as normal\n newSections.push(section);\n continue;\n }\n\n // Overlap, merge the sections\n lastSection.section_id = [\n ...ensureArray(lastSection.section_id),\n ...ensureArray(section.section_id),\n ];\n lastSection.units.push(...section.units);\n lastSection.b_age = Math.max(lastSection.b_age, section.b_age);\n lastSection.t_age = Math.min(lastSection.t_age, section.t_age);\n }\n return newSections;\n}\n\nexport function preprocessSectionUnit(unit: UnitLong): UnitLong {\n /** Preprocess a single unit for a \"section\" column type.\n * This mostly handles vagaries of eODP-style columns.\n * */\n\n let b_pos = unit.b_pos;\n let t_pos = unit.t_pos;\n\n let unit_name = unit.unit_name;\n\n // eODP columns sometimes have overlapping core sections, which are encoded in the name field\n // Match eODP section names\n const match = unit.unit_name.match(/^(\\d+(\\.\\d+)?)-(\\d+(\\.\\d+)?): (.+)/);\n\n if (match) {\n // These values should already be set if we've used the show_positions flag\n t_pos ??= ensureRealFloat(match[1]);\n b_pos ??= ensureRealFloat(match[3]);\n unit_name = match[5];\n }\n\n return {\n ...unit,\n b_pos: ensureRealFloat(b_pos),\n t_pos: ensureRealFloat(t_pos),\n unit_name,\n };\n}\n"],"names":["group","$lOZ4A$group","ColumnAxisType","$lOZ4A$ColumnAxisType","compareAgeRanges","$lOZ4A$compareAgeRanges","AgeRangeRelationship","$lOZ4A$AgeRangeRelationship","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$57278f42f24b59e5$export$55543e159517d62d","section","axisType","AGE","divisions","units","map","args","$57278f42f24b59e5$var$extendDivision","unit","i","tolerance","overlappingUnits","filter","d","unit_id","unitsOverlap","u_pos","getUnitHeightRange","bottomOverlap","some","d_pos","column","length","columns","u","includes","col","_d","b_pos","t_pos","b_age","b_clip_pos","t_age","t_clip_pos","DEPTH","$57278f42f24b59e5$export$eeade20e3eee4638","groups","Array","from","section_id","unitComparator","createUnitSorter","groups1","sectionUnits","$57278f42f24b59e5$export$8093438ec3e4c6fd","$57278f42f24b59e5$export$483b05c497fd70c6","sort","compareSections","$57278f42f24b59e5$export$bb26cdbde9c8c08b","sectionList","heightRange","find","s","Disjoint","push","Math","max","min","t_positions","HEIGHT","ORDINAL","b_positions","$57278f42f24b59e5$export$e7bb744b9be37f3d","sections","firstSection","rest","newSections","lastSection","ensureArray","$57278f42f24b59e5$export$47e05aac3f0b77d4","unit_name","match","ensureRealFloat","preprocessUnits","groupUnitsIntoSectionsBySectionID","getSectionAgeRange","getSectionPosRange","groupUnitsIntoSectionsByOverlap","mergeOverlappingSections","preprocessSectionUnit"],"version":3,"file":"column-views.40e758b3.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.6a9da051.js";import"./column-views.7b6e7d82.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.6a9da051.js";import"./column-views.7b6e7d82.js";import"./column-views.048fdcaf.js";import e from"@macrostrat/hyper";import{Popover as t}from"@blueprintjs/core";import o from"classnames";function i(e,t,o,i){Object.defineProperty(e,t,{get:o,set:i,enumerable:!0,configurable:!0})}var r=globalThis,n={},l={},a=r.parcelRequirea149;null==a&&((a=function(e){if(e in n)return n[e].exports;if(e in l){var t=l[e];delete l[e];var o={id:e,exports:{}};return n[e]=o,t.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){l[e]=t},r.parcelRequirea149=a),a.register;var s={};i(s,"UnitDetailsPopover",()=>f),i(s,"UnitSelectionPopover",()=>m);var c=a("bHbph"),p=a("5SO8b"),u=a("iYfAq");let d=e.styled(c&&c.__esModule?c.default:c);function f({style:e,children:o,viewportPadding:i=20}){let r=d(v,o);return d("div.popover-main",{style:e},d(t,{content:r,isOpen:!0,usePortal:!1,position:"right",modifiers:{preventOverflow:{options:{padding:i}}}},d("span.popover-target")))}function v({children:e}){return d("div",{onClick(e){e.stopPropagation()}},e)}function m(e){let t=(0,p.useSelectedUnit)(),i=(0,p.useUnitSelectionDispatch)(),r=(0,p.useAtomOverlayPosition)();return null==t?null:d("div.unit-popover-container",d(f,{style:{position:"absolute",top:r?.y??0,width:r?.width??100,left:r?.x??0,height:r?.height??100}},d(u.UnitDetailsPanel,{...e,unit:t,className:o("legend-panel",e.className),onSelectUnit:e=>{i(e,null)}})))}export{f as UnitDetailsPopover,m as UnitSelectionPopover};
|
|
2
|
+
//# sourceMappingURL=column-views.4a28d695.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,W,C,K,mB,A,Q,M,Y,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,qB,I,G,E,E,uB,I,G,I,E,E,S,E,E,S,E,E,SCiBA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAEhB,SAAS,EAAmB,CAAA,MACjC,CAAK,CAAA,SACL,CAAQ,CAAA,gBACR,EAAkB,EAAA,CAKnB,EACC,IAAM,EAAU,EAAE,EAAoB,GAEtC,OAAO,EACL,mBACA,CACE,MAAA,CACF,EACA,EACE,EAEA,CACE,QAAA,EACA,OAAQ,CAAA,EACR,UAAW,CAAA,EACX,SAAU,QACV,UAAW,CACT,gBAAiB,CAAE,QAAS,CAAE,QAAS,CAAgB,CAAE,CAC3D,CACF,EACA,EAAE,wBAGR,CAEA,SAAS,EAAmB,CAAA,SAAE,CAAQ,CAAE,EACtC,OAAO,EACL,MACA,CACE,QAAQ,CAAC,EAEP,EAAE,eAAe,EACnB,CACF,EACA,EAEJ,CAEO,SAAS,EACd,CAA2D,EAE3D,IAAM,EAAO,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,IACP,EAAa,AAAA,CAAA,EAAA,EAAA,wBAAuB,AAAvB,IACb,EAAW,AAAA,CAAA,EAAA,EAAA,sBAAqB,AAArB,WACjB,AAAI,AAAQ,MAAR,EACK,KAGF,EACL,6BACA,EACE,EACA,CACE,MAAO,CACL,SAAU,WACV,IAAK,GAAU,GAAK,EACpB,MAAO,GAAU,OAAS,IAC1B,KAAM,GAAU,GAAK,EACrB,OAAQ,GAAU,QAAU,GAC9B,CACF,EACA,EAAE,EAAA,gBAAe,CAAG,CAClB,GAAG,CAAK,CACR,KAAA,EACA,UAAW,AAAA,EAAW,eAAgB,EAAM,SAAS,EACrD,aAAc,AAAC,IACb,EAAW,EAAI,KACjB,CACF,IAGN,Q,K,kB,C,K,oB","sources":["<anon>","packages/column-views/src/unit-details/popover.ts"],"sourcesContent":["import \"./column-views.6a9da051.js\";\nimport \"./column-views.7b6e7d82.js\";\nimport \"./column-views.
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,W,C,K,mB,A,Q,M,Y,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,qB,I,G,E,E,uB,I,G,I,E,E,S,E,E,S,E,E,SCiBA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAEhB,SAAS,EAAmB,CAAA,MACjC,CAAK,CAAA,SACL,CAAQ,CAAA,gBACR,EAAkB,EAAA,CAKnB,EACC,IAAM,EAAU,EAAE,EAAoB,GAEtC,OAAO,EACL,mBACA,CACE,MAAA,CACF,EACA,EACE,EAEA,CACE,QAAA,EACA,OAAQ,CAAA,EACR,UAAW,CAAA,EACX,SAAU,QACV,UAAW,CACT,gBAAiB,CAAE,QAAS,CAAE,QAAS,CAAgB,CAAE,CAC3D,CACF,EACA,EAAE,wBAGR,CAEA,SAAS,EAAmB,CAAA,SAAE,CAAQ,CAAE,EACtC,OAAO,EACL,MACA,CACE,QAAQ,CAAC,EAEP,EAAE,eAAe,EACnB,CACF,EACA,EAEJ,CAEO,SAAS,EACd,CAA2D,EAE3D,IAAM,EAAO,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,IACP,EAAa,AAAA,CAAA,EAAA,EAAA,wBAAuB,AAAvB,IACb,EAAW,AAAA,CAAA,EAAA,EAAA,sBAAqB,AAArB,WACjB,AAAI,AAAQ,MAAR,EACK,KAGF,EACL,6BACA,EACE,EACA,CACE,MAAO,CACL,SAAU,WACV,IAAK,GAAU,GAAK,EACpB,MAAO,GAAU,OAAS,IAC1B,KAAM,GAAU,GAAK,EACrB,OAAQ,GAAU,QAAU,GAC9B,CACF,EACA,EAAE,EAAA,gBAAe,CAAG,CAClB,GAAG,CAAK,CACR,KAAA,EACA,UAAW,AAAA,EAAW,eAAgB,EAAM,SAAS,EACrD,aAAc,AAAC,IACb,EAAW,EAAI,KACjB,CACF,IAGN,Q,K,kB,C,K,oB","sources":["<anon>","packages/column-views/src/unit-details/popover.ts"],"sourcesContent":["import \"./column-views.6a9da051.js\";\nimport \"./column-views.7b6e7d82.js\";\nimport \"./column-views.048fdcaf.js\";\nimport $jhKOD$macrostrathyper from \"@macrostrat/hyper\";\nimport {Popover as $jhKOD$Popover} from \"@blueprintjs/core\";\nimport $jhKOD$classnames from \"classnames\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $1c6e0a5d10814cef$exports = {};\n\n$parcel$export($1c6e0a5d10814cef$exports, \"UnitDetailsPopover\", () => $1c6e0a5d10814cef$export$6716aecc2c9afbe2);\n$parcel$export($1c6e0a5d10814cef$exports, \"UnitSelectionPopover\", () => $1c6e0a5d10814cef$export$db1115efab13710d);\n\n\n\nvar $bHbph = parcelRequire(\"bHbph\");\n\nvar $5SO8b = parcelRequire(\"5SO8b\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\n\nconst $1c6e0a5d10814cef$var$h = (0, $jhKOD$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($bHbph))));\nfunction $1c6e0a5d10814cef$export$6716aecc2c9afbe2({ style: style, children: children, viewportPadding: viewportPadding = 20 }) {\n const content = $1c6e0a5d10814cef$var$h($1c6e0a5d10814cef$var$InteractionBarrier, children);\n return $1c6e0a5d10814cef$var$h(\"div.popover-main\", {\n style: style\n }, $1c6e0a5d10814cef$var$h((0, $jhKOD$Popover), // @ts-ignore\n {\n content: content,\n isOpen: true,\n usePortal: false,\n position: \"right\",\n modifiers: {\n preventOverflow: {\n options: {\n padding: viewportPadding\n }\n }\n }\n }, $1c6e0a5d10814cef$var$h(\"span.popover-target\")));\n}\nfunction $1c6e0a5d10814cef$var$InteractionBarrier({ children: children }) {\n return $1c6e0a5d10814cef$var$h(\"div\", {\n onClick (e) {\n // Stop events from leaking to the parent\n e.stopPropagation();\n }\n }, children);\n}\nfunction $1c6e0a5d10814cef$export$db1115efab13710d(props) {\n const unit = (0, $5SO8b.useSelectedUnit)();\n const selectUnit = (0, $5SO8b.useUnitSelectionDispatch)();\n const position = (0, $5SO8b.useAtomOverlayPosition)();\n if (unit == null) return null;\n return $1c6e0a5d10814cef$var$h(\"div.unit-popover-container\", $1c6e0a5d10814cef$var$h($1c6e0a5d10814cef$export$6716aecc2c9afbe2, {\n style: {\n position: \"absolute\",\n top: position?.y ?? 0,\n width: position?.width ?? 100,\n left: position?.x ?? 0,\n height: position?.height ?? 100\n }\n }, $1c6e0a5d10814cef$var$h((0, $iYfAq.UnitDetailsPanel), {\n ...props,\n unit: unit,\n className: (0, $jhKOD$classnames)(\"legend-panel\", props.className),\n onSelectUnit: (id)=>{\n selectUnit(id, null);\n }\n })));\n}\n\n\nexport {$1c6e0a5d10814cef$export$6716aecc2c9afbe2 as UnitDetailsPopover, $1c6e0a5d10814cef$export$db1115efab13710d as UnitSelectionPopover};\n//# sourceMappingURL=column-views.4a28d695.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport { Popover } from \"@blueprintjs/core\";\nimport styles from \"./popover.module.sass\";\nimport {\n useAtomOverlayPosition,\n useSelectedUnit,\n useUnitSelectionDispatch,\n} from \"../data-provider\";\nimport {\n UnitDetailsFeature,\n UnitDetailsPanel,\n UnitDetailsPanelProps,\n} from \"./panel\";\nimport { Lithology } from \"@macrostrat/api-types\";\nimport { LithologyTagFeature } from \"@macrostrat/data-components\";\nimport classNames from \"classnames\";\n\nconst h = hyper.styled(styles);\n\nexport function UnitDetailsPopover({\n style,\n children,\n viewportPadding = 20,\n}: {\n style: object;\n viewportPadding?: number;\n children: React.ReactNode;\n}) {\n const content = h(InteractionBarrier, children);\n\n return h(\n \"div.popover-main\",\n {\n style,\n },\n h(\n Popover,\n // @ts-ignore\n {\n content,\n isOpen: true,\n usePortal: false,\n position: \"right\",\n modifiers: {\n preventOverflow: { options: { padding: viewportPadding } },\n },\n },\n h(\"span.popover-target\"),\n ),\n );\n}\n\nfunction InteractionBarrier({ children }) {\n return h(\n \"div\",\n {\n onClick(e) {\n // Stop events from leaking to the parent\n e.stopPropagation();\n },\n },\n children,\n );\n}\n\nexport function UnitSelectionPopover(\n props: Omit<UnitDetailsPanelProps, \"onSelectUnit\" | \"unit\">,\n) {\n const unit = useSelectedUnit();\n const selectUnit = useUnitSelectionDispatch();\n const position = useAtomOverlayPosition();\n if (unit == null) {\n return null;\n }\n\n return h(\n \"div.unit-popover-container\",\n h(\n UnitDetailsPopover,\n {\n style: {\n position: \"absolute\",\n top: position?.y ?? 0,\n width: position?.width ?? 100,\n left: position?.x ?? 0,\n height: position?.height ?? 100,\n },\n },\n h(UnitDetailsPanel, {\n ...props,\n unit,\n className: classNames(\"legend-panel\", props.className),\n onSelectUnit: (id: number) => {\n selectUnit(id, null);\n },\n }),\n ),\n );\n}\n"],"names":["$jhKOD$macrostrathyper","Popover","$jhKOD$Popover","$jhKOD$classnames","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$1c6e0a5d10814cef$exports","$1c6e0a5d10814cef$export$6716aecc2c9afbe2","$1c6e0a5d10814cef$export$db1115efab13710d","$bHbph","$5SO8b","$iYfAq","$1c6e0a5d10814cef$var$h","styled","a","__esModule","default","style","children","viewportPadding","content","$1c6e0a5d10814cef$var$InteractionBarrier","isOpen","usePortal","position","modifiers","preventOverflow","options","padding","onClick","stopPropagation","props","unit","useSelectedUnit","selectUnit","useUnitSelectionDispatch","useAtomOverlayPosition","top","y","width","left","x","height","UnitDetailsPanel","className","onSelectUnit","UnitDetailsPopover","UnitSelectionPopover"],"version":3,"file":"column-views.4a28d695.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.add5e42b.js";import"./column-views.c16a19fb.js";import"./column-views.ec0087a2.js";import"./column-views.fc4c2c61.js";function e(e,a){return Object.keys(a).forEach(function(t){"default"===t||"__esModule"===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})}),e}var a=globalThis,t={},r={},o=a.parcelRequirea149;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in r){var a=r[e];delete r[e];var o={id:e,exports:{}};return t[e]=o,a.call(o.exports,o,o.exports),o.exports}var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}).register=function(e,a){r[e]=a},a.parcelRequirea149=o),o.register;var s={},c=o("3S9SB"),f=o("7kahb"),b=o("28PcI"),$=o("2koQo");e(s,c),e(s,f),e(s,b),e(s,$);export{$ea2f112131e22f14$export$554267114407ef68 as PBDBFossilsColumn,$8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType,$8e174c7ae24a4598$export$e6af757fa9780077 as useFossilData,$9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix,$68f55e74a5c97233$export$f176396e104db8d5 as DetritalColumn,$68f55e74a5c97233$export$1b3047373cd1c8c7 as DetritalGroup,$5ccf8f2b270f7458$export$c69bd0285aa5d775 as IsotopesDataset,$5ccf8f2b270f7458$export$5d8aa8022c284748 as IsotopesColumn,$5cb80f5b33baeaea$export$c644ef985ce7a4c4 as MeasurementDataContext,$5cb80f5b33baeaea$export$5f01d5b342a89841 as MeasurementDataProvider,$5cb80f5b33baeaea$export$8a0335fd9ff72150 as useMeasurementData,$7e05644cbb5d2dbb$export$9d101e1fcb2166a6 as standardizeMeasurementHeight,$7e05644cbb5d2dbb$export$8f2afa8ddee7317e as mergeHeightRanges,$7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d as BaseMeasurementsColumn,$7e05644cbb5d2dbb$export$653e47a7a0da0f0d as TruncatedList,$7e05644cbb5d2dbb$export$4e649f790614b299 as groupNotesByPixelDistance,$48680a4cd2abcbe4$export$c49cf57576706bab as SGPMeasurementsColumn};
|
|
2
|
+
//# sourceMappingURL=column-views.5950c8eb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,S,E,E,S,E,E,S,E,E,S,E,E,G,E,E,G,E,E,G,E,E,U,6C,iB,C,6C,c,C,6C,a,C,6C,qB,C,6C,c,C,6C,a,C,6C,e,C,6C,c,C,6C,sB,C,6C,uB,C,6C,kB,C,6C,4B,C,6C,iB,C,6C,sB,C,6C,a,C,6C,yB,C,6C,qB","sources":["<anon>","packages/column-views/src/facets/index.ts"],"sourcesContent":["import \"./column-views.
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,S,E,E,S,E,E,S,E,E,S,E,E,G,E,E,G,E,E,G,E,E,U,6C,iB,C,6C,c,C,6C,a,C,6C,qB,C,6C,c,C,6C,a,C,6C,e,C,6C,c,C,6C,sB,C,6C,uB,C,6C,kB,C,6C,4B,C,6C,iB,C,6C,sB,C,6C,a,C,6C,yB,C,6C,qB","sources":["<anon>","packages/column-views/src/facets/index.ts"],"sourcesContent":["import \"./column-views.add5e42b.js\";\nimport \"./column-views.c16a19fb.js\";\nimport \"./column-views.ec0087a2.js\";\nimport \"./column-views.fc4c2c61.js\";\n\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $a66a583913c03b09$exports = {};\n\nvar $3S9SB = parcelRequire(\"3S9SB\");\n\nvar $7kahb = parcelRequire(\"7kahb\");\n\nvar $28PcI = parcelRequire(\"28PcI\");\n\nvar $2koQo = parcelRequire(\"2koQo\");\n$parcel$exportWildcard($a66a583913c03b09$exports, $3S9SB);\n$parcel$exportWildcard($a66a583913c03b09$exports, $7kahb);\n$parcel$exportWildcard($a66a583913c03b09$exports, $28PcI);\n$parcel$exportWildcard($a66a583913c03b09$exports, $2koQo);\n\n\nexport {$ea2f112131e22f14$export$554267114407ef68 as PBDBFossilsColumn, $8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType, $8e174c7ae24a4598$export$e6af757fa9780077 as useFossilData, $9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix, $68f55e74a5c97233$export$f176396e104db8d5 as DetritalColumn, $68f55e74a5c97233$export$1b3047373cd1c8c7 as DetritalGroup, $5ccf8f2b270f7458$export$c69bd0285aa5d775 as IsotopesDataset, $5ccf8f2b270f7458$export$5d8aa8022c284748 as IsotopesColumn, $5cb80f5b33baeaea$export$c644ef985ce7a4c4 as MeasurementDataContext, $5cb80f5b33baeaea$export$5f01d5b342a89841 as MeasurementDataProvider, $5cb80f5b33baeaea$export$8a0335fd9ff72150 as useMeasurementData, $7e05644cbb5d2dbb$export$9d101e1fcb2166a6 as standardizeMeasurementHeight, $7e05644cbb5d2dbb$export$8f2afa8ddee7317e as mergeHeightRanges, $7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d as BaseMeasurementsColumn, $7e05644cbb5d2dbb$export$653e47a7a0da0f0d as TruncatedList, $7e05644cbb5d2dbb$export$4e649f790614b299 as groupNotesByPixelDistance, $48680a4cd2abcbe4$export$c49cf57576706bab as SGPMeasurementsColumn};\n//# sourceMappingURL=column-views.5950c8eb.js.map\n","export * from \"./fossils\";\nexport * from \"./detrital-zircon\";\nexport * from \"./carbon-isotopes\";\nexport * from \"./measurements\";\n"],"names":["$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$a66a583913c03b09$exports","$3S9SB","$7kahb","$28PcI","$2koQo","$ea2f112131e22f14$export$554267114407ef68","PBDBFossilsColumn","$8e174c7ae24a4598$export$a990c76b38782f57","FossilDataType","$8e174c7ae24a4598$export$e6af757fa9780077","useFossilData","$9cea14fa75e12a56$export$652730986cccff7a","PBDBOccurrencesMatrix","$68f55e74a5c97233$export$f176396e104db8d5","DetritalColumn","$68f55e74a5c97233$export$1b3047373cd1c8c7","DetritalGroup","$5ccf8f2b270f7458$export$c69bd0285aa5d775","IsotopesDataset","$5ccf8f2b270f7458$export$5d8aa8022c284748","IsotopesColumn","$5cb80f5b33baeaea$export$c644ef985ce7a4c4","MeasurementDataContext","$5cb80f5b33baeaea$export$5f01d5b342a89841","MeasurementDataProvider","$5cb80f5b33baeaea$export$8a0335fd9ff72150","useMeasurementData","$7e05644cbb5d2dbb$export$9d101e1fcb2166a6","standardizeMeasurementHeight","$7e05644cbb5d2dbb$export$8f2afa8ddee7317e","mergeHeightRanges","$7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d","BaseMeasurementsColumn","$7e05644cbb5d2dbb$export$653e47a7a0da0f0d","TruncatedList","$7e05644cbb5d2dbb$export$4e649f790614b299","groupNotesByPixelDistance","$48680a4cd2abcbe4$export$c49cf57576706bab","SGPMeasurementsColumn"],"version":3,"file":"column-views.5950c8eb.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.78b2d234.js";import"./column-views.b57e5e6e.js";import"./column-views.6a0a35e7.js";import"./column-views.d737de1e.js";import"./column-views.7b6e7d82.js";import{hyperStyled as e}from"@macrostrat/hyper";import{LithologyColumn as t,SVG as n,ColumnContext as o}from"@macrostrat/column-components";import{createContext as a,useState as i,useRef as r,useCallback as l,useContext as s,useEffect as u}from"react";function d(e,t,n,o){Object.defineProperty(e,t,{get:n,set:o,enumerable:!0,configurable:!0})}var c=globalThis,p={},m={},f=c.parcelRequirea149;null==f&&((f=function(e){if(e in p)return p[e].exports;if(e in m){var t=m[e];delete m[e];var n={id:e,exports:{}};return p[e]=n,t.call(n.exports,n,n.exports),n.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){m[e]=t},c.parcelRequirea149=f),f.register;var b={};d(b,"LabelTrackerProvider",()=>S),d(b,"TrackedLabeledUnit",()=>w),d(b,"CompositeUnitComponent",()=>L),d(b,"CompositeUnitsColumn",()=>P),d(b,"AnnotatedUnitsColumn",()=>T),d(b,"SectionLabelsColumn",()=>y),d(b,"ColumnNotesProvider",()=>F);var C=f("jiUaC"),v=f("1n4Pb"),x=f("45u6B"),h=f("wtIgl"),$=f("5SO8b");let U=e(x&&x.__esModule?x.default:x),g=a(null),H=a(null),_=e=>e.unit_id;function S(e){let{children:t,units:n,findUnitID:o=_}=e,[a,s]=i(null),u=r({}),d=l((e,t)=>{let a=o(e);u.current[a]=t,Object.keys(u.current).length==n.length&&s(n.filter(e=>{let t=o(e);return!1==u.current[t]}))},[u,n,o]);return U(g.Provider,{value:d},U(H.Provider,{value:a},t))}function w({division:e,nameForDivision:t=C.defaultNameFunction,...n}){let o=s(g);return U(v.LabeledUnit,{division:e,label:t(e),onLabelUpdated(t,n){o?.(e,n)},...n})}let L=w;function P(e){let{width:n,unitComponent:o=w,unitComponentProps:a,clipToFrame:i,...r}=e;return U(t,{width:n,clipToFrame:i},[U(v.UnitBoxes,{unitComponent:o,unitComponentProps:a,...r})])}function T(e){return u(()=>{console.warn("AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes")},[]),null}function y(e){let{width:t=300,noteMode:o="unlabeled",labelOffset:a=30,noteComponent:i,shouldRenderNote:r}=e,{totalHeight:l,axisType:u}=(0,h.useMacrostratColumnData)(),d=(0,h.useCompositeScale)(),c=s(H),p=(0,$.useUnitSelectionDispatch)();return U("div.section-labels-column",[U(F,{units:[],scale:d,totalHeight:l,axisType:u},U(n,{height:l,innerWidth:t-4,paddingH:1,paddingLeft:3},U(C.UnitNamesColumn,{divisions:"unlabeled"==o?c:void 0,paddingLeft:a,width:t,noteComponent:i,shouldRenderNote:r,scale:d,onClickNote(e){p(e.data,null,null)}})))])}function F(e){let{children:t,scale:n,totalHeight:a,pixelScale:i}=e,{axisType:r}=(0,h.useMacrostratColumnData)();return U(o.Provider,{value:{divisions:[],scale:n,scaleClamped:n,pixelHeight:a,pixelsPerMeter:i,axisType:r,zoom:1}},t)}export{S as LabelTrackerProvider,w as TrackedLabeledUnit,L as CompositeUnitComponent,P as CompositeUnitsColumn,T as AnnotatedUnitsColumn,y as SectionLabelsColumn,F as ColumnNotesProvider};
|
|
2
|
+
//# sourceMappingURL=column-views.5987bc26.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,e,C,K,mB,A,Q,mB,C,C,O,C,C,iB,C,K,+B,A,Q,iB,C,C,Y,C,C,U,C,C,e,C,C,c,C,C,a,C,K,O,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q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oB,CAAK,EAEvC,GAAM,CAAA,SAAE,CAAQ,CAAA,MAAE,CAAK,CAAA,YAAE,CAAW,CAAA,WAAE,CAAU,CAAE,CAAG,EAE/C,CAAA,SAAE,CAAQ,CAAE,CAAG,AAAA,CAAA,EAAA,EAAA,uBAAsB,AAAtB,IAErB,OAAO,EACL,AAAA,EAAc,QAAQ,CACtB,CACE,MAAO,CACL,UAAW,EAAE,CACb,MAAA,EACA,aAAc,EACd,YAAa,EACb,eAAgB,EAChB,SAAA,EACA,KAAM,CACR,CACF,EACA,EAEJ,Q,K,oB,C,K,kB,C,K,sB,C,K,oB,C,K,oB,C,K,mB,C,K,mB","sources":["<anon>","packages/column-views/src/units/composite.ts"],"sourcesContent":["import \"./column-views.bdf05ed4.js\";\nimport \"./column-views.64fc40d6.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.5c02450b.js\";\nimport \"./column-views.7b6e7d82.js\";\nimport {hyperStyled as $hj0lx$hyperStyled} from \"@macrostrat/hyper\";\nimport {LithologyColumn as $hj0lx$LithologyColumn, SVG as $hj0lx$SVG, ColumnContext as $hj0lx$ColumnContext} from \"@macrostrat/column-components\";\nimport {createContext as $hj0lx$createContext, useState as $hj0lx$useState, useRef as $hj0lx$useRef, useCallback as $hj0lx$useCallback, useContext as $hj0lx$useContext, useEffect as $hj0lx$useEffect} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $6b7af672ec278734$exports = {};\n\n$parcel$export($6b7af672ec278734$exports, \"LabelTrackerProvider\", () => $6b7af672ec278734$export$e4e89ab6c86ac513);\n$parcel$export($6b7af672ec278734$exports, \"TrackedLabeledUnit\", () => $6b7af672ec278734$export$f613830566442374);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitComponent\", () => $6b7af672ec278734$export$1dfa200d57964eee);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitsColumn\", () => $6b7af672ec278734$export$a6684360fef0406e);\n$parcel$export($6b7af672ec278734$exports, \"AnnotatedUnitsColumn\", () => $6b7af672ec278734$export$d8c3f2fdd653a082);\n$parcel$export($6b7af672ec278734$exports, \"SectionLabelsColumn\", () => $6b7af672ec278734$export$13984e34afdbb040);\n$parcel$export($6b7af672ec278734$exports, \"ColumnNotesProvider\", () => $6b7af672ec278734$export$6cc7a9df4edde18);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\nvar $45u6B = parcelRequire(\"45u6B\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\nconst $6b7af672ec278734$var$h = (0, $hj0lx$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($45u6B))));\nconst $6b7af672ec278734$var$LabelTrackerContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$UnlabeledDivisionsContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$findMacrostratUnitID = (u)=>u.unit_id;\nfunction $6b7af672ec278734$export$e4e89ab6c86ac513(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */ const { children: children, units: units, findUnitID: findUnitID = $6b7af672ec278734$var$findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = (0, $hj0lx$useState)(null);\n const labelTrackerRef = (0, $hj0lx$useRef)({});\n const trackLabelVisibility = (0, $hj0lx$useCallback)((div, visible)=>{\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) setUnlabeledDivisions(// @ts-ignore\n units.filter((d)=>{\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }));\n }, [\n labelTrackerRef,\n units,\n findUnitID\n ]);\n const value = trackLabelVisibility;\n return $6b7af672ec278734$var$h($6b7af672ec278734$var$LabelTrackerContext.Provider, {\n value: value\n }, $6b7af672ec278734$var$h($6b7af672ec278734$var$UnlabeledDivisionsContext.Provider, {\n value: unlabeledDivisions\n }, children));\n}\nfunction $6b7af672ec278734$export$f613830566442374({ division: division, nameForDivision: nameForDivision = (0, $jiUaC.defaultNameFunction), ...rest }) {\n const trackLabelVisibility = (0, $hj0lx$useContext)($6b7af672ec278734$var$LabelTrackerContext);\n return $6b7af672ec278734$var$h((0, $1n4Pb.LabeledUnit), {\n division: division,\n label: nameForDivision(division),\n onLabelUpdated (label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest\n });\n}\nconst $6b7af672ec278734$export$1dfa200d57964eee = $6b7af672ec278734$export$f613830566442374;\nfunction $6b7af672ec278734$export$a6684360fef0406e(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { width: width, unitComponent: unitComponent = $6b7af672ec278734$export$f613830566442374, unitComponentProps: unitComponentProps, clipToFrame: clipToFrame, ...rest } = props;\n return $6b7af672ec278734$var$h((0, $hj0lx$LithologyColumn), {\n width: width,\n clipToFrame: clipToFrame\n }, [\n $6b7af672ec278734$var$h((0, $1n4Pb.UnitBoxes), {\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n ...rest\n })\n ]);\n}\nfunction $6b7af672ec278734$export$d8c3f2fdd653a082(props) {\n (0, $hj0lx$useEffect)(()=>{\n console.warn(\"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\");\n }, []);\n return null;\n}\nfunction $6b7af672ec278734$export$13984e34afdbb040(props) {\n // Section with \"squishy\" time scale\n const { width: width = 300, noteMode: noteMode = \"unlabeled\", labelOffset: labelOffset = 30, noteComponent: noteComponent, shouldRenderNote: shouldRenderNote } = props;\n const { totalHeight: totalHeight, axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n const _compositeScale = (0, $wtIgl.useCompositeScale)();\n const unlabeledUnits = (0, $hj0lx$useContext)($6b7af672ec278734$var$UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n const selectUnit = (0, $5SO8b.useUnitSelectionDispatch)();\n return $6b7af672ec278734$var$h(\"div.section-labels-column\", [\n $6b7af672ec278734$var$h($6b7af672ec278734$export$6cc7a9df4edde18, {\n units: [],\n scale: _compositeScale,\n totalHeight: totalHeight,\n axisType: axisType\n }, $6b7af672ec278734$var$h((0, $hj0lx$SVG), {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3\n }, $6b7af672ec278734$var$h((0, $jiUaC.UnitNamesColumn), {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width: width,\n noteComponent: noteComponent,\n shouldRenderNote: shouldRenderNote,\n scale: _compositeScale,\n onClickNote (note) {\n selectUnit(note.data, null, null);\n }\n })))\n ]);\n}\nfunction $6b7af672ec278734$export$6cc7a9df4edde18(props) {\n // A fake column axis provider that allows scales to cross\n const { children: children, scale: scale, totalHeight: totalHeight, pixelScale: pixelScale } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n return $6b7af672ec278734$var$h((0, $hj0lx$ColumnContext).Provider, {\n value: {\n divisions: [],\n scale: scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType: axisType,\n zoom: 1\n }\n }, children);\n}\n\n\nexport {$6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider};\n//# sourceMappingURL=column-views.d30231cb.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n ColumnContext,\n LithologyColumn,\n SVG,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport { LabeledUnit, UnitBoxes } from \"./boxes\";\nimport styles from \"./composite.module.sass\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n useUnitSelectionDispatch,\n} from \"../data-provider\";\n\nconst h = hyperStyled(styles);\n\ninterface LabelTracker {\n [key: number]: boolean;\n}\n\nconst LabelTrackerContext = createContext(null);\nconst UnlabeledDivisionsContext = createContext(null);\n\nconst findMacrostratUnitID = (u) => u.unit_id;\n\nexport function LabelTrackerProvider(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */\n const { children, units, findUnitID = findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = useState<\n BaseUnit[] | null\n >(null);\n const labelTrackerRef = useRef<LabelTracker>({});\n const trackLabelVisibility = useCallback(\n (div, visible) => {\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) {\n setUnlabeledDivisions(\n // @ts-ignore\n units.filter((d) => {\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }),\n );\n }\n },\n [labelTrackerRef, units, findUnitID],\n );\n\n const value = trackLabelVisibility;\n return h(\n LabelTrackerContext.Provider,\n { value },\n h(\n UnlabeledDivisionsContext.Provider,\n { value: unlabeledDivisions },\n children,\n ),\n );\n}\n\nfunction TrackedLabeledUnit({\n division,\n nameForDivision = defaultNameFunction,\n ...rest\n}) {\n const trackLabelVisibility = useContext(LabelTrackerContext);\n return h(LabeledUnit, {\n division,\n label: nameForDivision(division),\n onLabelUpdated(label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest,\n });\n}\n\nexport const CompositeUnitComponent = TrackedLabeledUnit;\n\ntype BaseUnitProps = {\n width: number;\n showLabels?: boolean;\n columnWidth?: number;\n clipToFrame?: boolean;\n};\n\ntype ICompositeUnitProps = BaseUnitProps & {\n gutterWidth?: number;\n labelOffset?: number;\n paddingLeft?: number;\n nameForDivision?: (division: BaseUnit) => string;\n children?: React.ReactNode;\n unitComponent?: React.FC<any>;\n unitComponentProps?: any;\n noteMode?: \"labeled\" | \"unlabeled\";\n showLabelColumn?: boolean;\n noteComponent?: React.FC<any>;\n shouldRenderNote?: (d: any) => boolean;\n};\n\ninterface CompositeUnitProps {\n unitComponent: React.FC<any>;\n unitComponentProps?: any;\n width: number;\n showLabels?: boolean;\n clipToFrame?: boolean;\n}\n\nexport function CompositeUnitsColumn(props: CompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const {\n width,\n unitComponent = TrackedLabeledUnit,\n unitComponentProps,\n clipToFrame,\n ...rest\n } = props;\n\n return h(LithologyColumn, { width, clipToFrame }, [\n h(UnitBoxes, {\n unitComponent,\n unitComponentProps,\n ...rest,\n }),\n ]);\n}\n\nexport function AnnotatedUnitsColumn(props: ICompositeUnitProps) {\n useEffect(() => {\n console.warn(\n \"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\",\n );\n }, []);\n return null;\n}\n\nexport function SectionLabelsColumn(props: ICompositeUnitProps) {\n // Section with \"squishy\" time scale\n const {\n width = 300,\n noteMode = \"unlabeled\",\n labelOffset = 30,\n noteComponent,\n shouldRenderNote,\n } = props;\n\n const { totalHeight, axisType } = useMacrostratColumnData();\n const _compositeScale = useCompositeScale();\n\n const unlabeledUnits = useContext(UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n\n const selectUnit = useUnitSelectionDispatch();\n\n return h(\"div.section-labels-column\", [\n h(\n ColumnNotesProvider,\n {\n units: [],\n scale: _compositeScale,\n totalHeight,\n axisType,\n },\n h(\n SVG,\n {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3,\n },\n h(UnitNamesColumn, {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width,\n noteComponent,\n shouldRenderNote,\n scale: _compositeScale,\n onClickNote(note) {\n selectUnit(note.data, null, null);\n },\n }),\n ),\n ),\n ]);\n}\n\nexport function ColumnNotesProvider(props) {\n // A fake column axis provider that allows scales to cross\n const { children, scale, totalHeight, pixelScale } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n return h(\n ColumnContext.Provider,\n {\n value: {\n divisions: [],\n scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType,\n zoom: 1,\n },\n },\n children,\n );\n}\n\nexport { TrackedLabeledUnit, ICompositeUnitProps };\n"],"names":["hyperStyled","$hj0lx$hyperStyled","LithologyColumn","$hj0lx$LithologyColumn","SVG","$hj0lx$SVG","ColumnContext","$hj0lx$ColumnContext","createContext","$hj0lx$createContext","useState","$hj0lx$useState","useRef","$hj0lx$useRef","useCallback","$hj0lx$useCallback","useContext","$hj0lx$useContext","useEffect","$hj0lx$useEffect","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6b7af672ec278734$exports","$6b7af672ec278734$export$e4e89ab6c86ac513","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","$6b7af672ec278734$export$a6684360fef0406e","$6b7af672ec278734$export$d8c3f2fdd653a082","$6b7af672ec278734$export$13984e34afdbb040","$6b7af672ec278734$export$6cc7a9df4edde18","$jiUaC","$1n4Pb","$45u6B","$wtIgl","$5SO8b","$6b7af672ec278734$var$h","a","__esModule","default","$6b7af672ec278734$var$LabelTrackerContext","$6b7af672ec278734$var$UnlabeledDivisionsContext","$6b7af672ec278734$var$findMacrostratUnitID","u","unit_id","props","children","units","findUnitID","unlabeledDivisions","setUnlabeledDivisions","labelTrackerRef","trackLabelVisibility","div","visible","current","keys","length","filter","d","Provider","value","division","nameForDivision","defaultNameFunction","rest","LabeledUnit","label","onLabelUpdated","width","unitComponent","unitComponentProps","clipToFrame","UnitBoxes","console","warn","noteMode","labelOffset","noteComponent","shouldRenderNote","totalHeight","axisType","useMacrostratColumnData","_compositeScale","useCompositeScale","unlabeledUnits","selectUnit","useUnitSelectionDispatch","scale","height","innerWidth","paddingH","paddingLeft","UnitNamesColumn","divisions","undefined","onClickNote","note","data","pixelScale","scaleClamped","pixelHeight","pixelsPerMeter","zoom","LabelTrackerProvider","TrackedLabeledUnit","CompositeUnitComponent","CompositeUnitsColumn","AnnotatedUnitsColumn","SectionLabelsColumn","ColumnNotesProvider"],"version":3,"file":"column-views.d30231cb.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,e,C,K,mB,A,Q,mB,C,C,O,C,C,iB,C,K,+B,A,Q,iB,C,C,Y,C,C,U,C,C,e,C,C,c,C,C,a,C,K,O,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,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,EACV,YAAa,CACf,EACA,EAAE,EAAA,eAAc,CAAG,CACjB,UAtBa,AAAY,aAAZ,EAA0B,EAAiB,KAAA,EAuBxD,YAAa,EACb,MAAA,EACA,cAAA,EACA,iBAAA,EACA,MAAO,EACP,YAAY,CAAI,EACd,EAAW,EAAK,IAAI,CAAE,KAAM,KAC9B,CACF,KAGL,CACH,CAEO,SAAS,EAAoB,CAAK,EAEvC,GAAM,CAAA,SAAE,CAAQ,CAAA,MAAE,CAAK,CAAA,YAAE,CAAW,CAAA,WAAE,CAAU,CAAE,CAAG,EAE/C,CAAA,SAAE,CAAQ,CAAE,CAAG,AAAA,CAAA,EAAA,EAAA,uBAAsB,AAAtB,IAErB,OAAO,EACL,AAAA,EAAc,QAAQ,CACtB,CACE,MAAO,CACL,UAAW,EAAE,CACb,MAAA,EACA,aAAc,EACd,YAAa,EACb,eAAgB,EAChB,SAAA,EACA,KAAM,CACR,CACF,EACA,EAEJ,Q,K,oB,C,K,kB,C,K,sB,C,K,oB,C,K,oB,C,K,mB,C,K,mB","sources":["<anon>","packages/column-views/src/units/composite.ts"],"sourcesContent":["import \"./column-views.78b2d234.js\";\nimport \"./column-views.b57e5e6e.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.d737de1e.js\";\nimport \"./column-views.7b6e7d82.js\";\nimport {hyperStyled as $hj0lx$hyperStyled} from \"@macrostrat/hyper\";\nimport {LithologyColumn as $hj0lx$LithologyColumn, SVG as $hj0lx$SVG, ColumnContext as $hj0lx$ColumnContext} from \"@macrostrat/column-components\";\nimport {createContext as $hj0lx$createContext, useState as $hj0lx$useState, useRef as $hj0lx$useRef, useCallback as $hj0lx$useCallback, useContext as $hj0lx$useContext, useEffect as $hj0lx$useEffect} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $6b7af672ec278734$exports = {};\n\n$parcel$export($6b7af672ec278734$exports, \"LabelTrackerProvider\", () => $6b7af672ec278734$export$e4e89ab6c86ac513);\n$parcel$export($6b7af672ec278734$exports, \"TrackedLabeledUnit\", () => $6b7af672ec278734$export$f613830566442374);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitComponent\", () => $6b7af672ec278734$export$1dfa200d57964eee);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitsColumn\", () => $6b7af672ec278734$export$a6684360fef0406e);\n$parcel$export($6b7af672ec278734$exports, \"AnnotatedUnitsColumn\", () => $6b7af672ec278734$export$d8c3f2fdd653a082);\n$parcel$export($6b7af672ec278734$exports, \"SectionLabelsColumn\", () => $6b7af672ec278734$export$13984e34afdbb040);\n$parcel$export($6b7af672ec278734$exports, \"ColumnNotesProvider\", () => $6b7af672ec278734$export$6cc7a9df4edde18);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\nvar $45u6B = parcelRequire(\"45u6B\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\nconst $6b7af672ec278734$var$h = (0, $hj0lx$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($45u6B))));\nconst $6b7af672ec278734$var$LabelTrackerContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$UnlabeledDivisionsContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$findMacrostratUnitID = (u)=>u.unit_id;\nfunction $6b7af672ec278734$export$e4e89ab6c86ac513(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */ const { children: children, units: units, findUnitID: findUnitID = $6b7af672ec278734$var$findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = (0, $hj0lx$useState)(null);\n const labelTrackerRef = (0, $hj0lx$useRef)({});\n const trackLabelVisibility = (0, $hj0lx$useCallback)((div, visible)=>{\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) setUnlabeledDivisions(// @ts-ignore\n units.filter((d)=>{\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }));\n }, [\n labelTrackerRef,\n units,\n findUnitID\n ]);\n const value = trackLabelVisibility;\n return $6b7af672ec278734$var$h($6b7af672ec278734$var$LabelTrackerContext.Provider, {\n value: value\n }, $6b7af672ec278734$var$h($6b7af672ec278734$var$UnlabeledDivisionsContext.Provider, {\n value: unlabeledDivisions\n }, children));\n}\nfunction $6b7af672ec278734$export$f613830566442374({ division: division, nameForDivision: nameForDivision = (0, $jiUaC.defaultNameFunction), ...rest }) {\n const trackLabelVisibility = (0, $hj0lx$useContext)($6b7af672ec278734$var$LabelTrackerContext);\n return $6b7af672ec278734$var$h((0, $1n4Pb.LabeledUnit), {\n division: division,\n label: nameForDivision(division),\n onLabelUpdated (label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest\n });\n}\nconst $6b7af672ec278734$export$1dfa200d57964eee = $6b7af672ec278734$export$f613830566442374;\nfunction $6b7af672ec278734$export$a6684360fef0406e(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { width: width, unitComponent: unitComponent = $6b7af672ec278734$export$f613830566442374, unitComponentProps: unitComponentProps, clipToFrame: clipToFrame, ...rest } = props;\n return $6b7af672ec278734$var$h((0, $hj0lx$LithologyColumn), {\n width: width,\n clipToFrame: clipToFrame\n }, [\n $6b7af672ec278734$var$h((0, $1n4Pb.UnitBoxes), {\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n ...rest\n })\n ]);\n}\nfunction $6b7af672ec278734$export$d8c3f2fdd653a082(props) {\n (0, $hj0lx$useEffect)(()=>{\n console.warn(\"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\");\n }, []);\n return null;\n}\nfunction $6b7af672ec278734$export$13984e34afdbb040(props) {\n // Section with \"squishy\" time scale\n const { width: width = 300, noteMode: noteMode = \"unlabeled\", labelOffset: labelOffset = 30, noteComponent: noteComponent, shouldRenderNote: shouldRenderNote } = props;\n const { totalHeight: totalHeight, axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n const _compositeScale = (0, $wtIgl.useCompositeScale)();\n const unlabeledUnits = (0, $hj0lx$useContext)($6b7af672ec278734$var$UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n const selectUnit = (0, $5SO8b.useUnitSelectionDispatch)();\n return $6b7af672ec278734$var$h(\"div.section-labels-column\", [\n $6b7af672ec278734$var$h($6b7af672ec278734$export$6cc7a9df4edde18, {\n units: [],\n scale: _compositeScale,\n totalHeight: totalHeight,\n axisType: axisType\n }, $6b7af672ec278734$var$h((0, $hj0lx$SVG), {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3\n }, $6b7af672ec278734$var$h((0, $jiUaC.UnitNamesColumn), {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width: width,\n noteComponent: noteComponent,\n shouldRenderNote: shouldRenderNote,\n scale: _compositeScale,\n onClickNote (note) {\n selectUnit(note.data, null, null);\n }\n })))\n ]);\n}\nfunction $6b7af672ec278734$export$6cc7a9df4edde18(props) {\n // A fake column axis provider that allows scales to cross\n const { children: children, scale: scale, totalHeight: totalHeight, pixelScale: pixelScale } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n return $6b7af672ec278734$var$h((0, $hj0lx$ColumnContext).Provider, {\n value: {\n divisions: [],\n scale: scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType: axisType,\n zoom: 1\n }\n }, children);\n}\n\n\nexport {$6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider};\n//# sourceMappingURL=column-views.5987bc26.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n ColumnContext,\n LithologyColumn,\n SVG,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport { LabeledUnit, UnitBoxes } from \"./boxes\";\nimport styles from \"./composite.module.sass\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n useUnitSelectionDispatch,\n} from \"../data-provider\";\n\nconst h = hyperStyled(styles);\n\ninterface LabelTracker {\n [key: number]: boolean;\n}\n\nconst LabelTrackerContext = createContext(null);\nconst UnlabeledDivisionsContext = createContext(null);\n\nconst findMacrostratUnitID = (u) => u.unit_id;\n\nexport function LabelTrackerProvider(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */\n const { children, units, findUnitID = findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = useState<\n BaseUnit[] | null\n >(null);\n const labelTrackerRef = useRef<LabelTracker>({});\n const trackLabelVisibility = useCallback(\n (div, visible) => {\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) {\n setUnlabeledDivisions(\n // @ts-ignore\n units.filter((d) => {\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }),\n );\n }\n },\n [labelTrackerRef, units, findUnitID],\n );\n\n const value = trackLabelVisibility;\n return h(\n LabelTrackerContext.Provider,\n { value },\n h(\n UnlabeledDivisionsContext.Provider,\n { value: unlabeledDivisions },\n children,\n ),\n );\n}\n\nfunction TrackedLabeledUnit({\n division,\n nameForDivision = defaultNameFunction,\n ...rest\n}) {\n const trackLabelVisibility = useContext(LabelTrackerContext);\n return h(LabeledUnit, {\n division,\n label: nameForDivision(division),\n onLabelUpdated(label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest,\n });\n}\n\nexport const CompositeUnitComponent = TrackedLabeledUnit;\n\ntype BaseUnitProps = {\n width: number;\n showLabels?: boolean;\n columnWidth?: number;\n clipToFrame?: boolean;\n};\n\ntype ICompositeUnitProps = BaseUnitProps & {\n gutterWidth?: number;\n labelOffset?: number;\n paddingLeft?: number;\n nameForDivision?: (division: BaseUnit) => string;\n children?: React.ReactNode;\n unitComponent?: React.FC<any>;\n unitComponentProps?: any;\n noteMode?: \"labeled\" | \"unlabeled\";\n showLabelColumn?: boolean;\n noteComponent?: React.FC<any>;\n shouldRenderNote?: (d: any) => boolean;\n};\n\ninterface CompositeUnitProps {\n unitComponent: React.FC<any>;\n unitComponentProps?: any;\n width: number;\n showLabels?: boolean;\n clipToFrame?: boolean;\n}\n\nexport function CompositeUnitsColumn(props: CompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const {\n width,\n unitComponent = TrackedLabeledUnit,\n unitComponentProps,\n clipToFrame,\n ...rest\n } = props;\n\n return h(LithologyColumn, { width, clipToFrame }, [\n h(UnitBoxes, {\n unitComponent,\n unitComponentProps,\n ...rest,\n }),\n ]);\n}\n\nexport function AnnotatedUnitsColumn(props: ICompositeUnitProps) {\n useEffect(() => {\n console.warn(\n \"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\",\n );\n }, []);\n return null;\n}\n\nexport function SectionLabelsColumn(props: ICompositeUnitProps) {\n // Section with \"squishy\" time scale\n const {\n width = 300,\n noteMode = \"unlabeled\",\n labelOffset = 30,\n noteComponent,\n shouldRenderNote,\n } = props;\n\n const { totalHeight, axisType } = useMacrostratColumnData();\n const _compositeScale = useCompositeScale();\n\n const unlabeledUnits = useContext(UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n\n const selectUnit = useUnitSelectionDispatch();\n\n return h(\"div.section-labels-column\", [\n h(\n ColumnNotesProvider,\n {\n units: [],\n scale: _compositeScale,\n totalHeight,\n axisType,\n },\n h(\n SVG,\n {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3,\n },\n h(UnitNamesColumn, {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width,\n noteComponent,\n shouldRenderNote,\n scale: _compositeScale,\n onClickNote(note) {\n selectUnit(note.data, null, null);\n },\n }),\n ),\n ),\n ]);\n}\n\nexport function ColumnNotesProvider(props) {\n // A fake column axis provider that allows scales to cross\n const { children, scale, totalHeight, pixelScale } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n return h(\n ColumnContext.Provider,\n {\n value: {\n divisions: [],\n scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType,\n zoom: 1,\n },\n },\n children,\n );\n}\n\nexport { TrackedLabeledUnit, ICompositeUnitProps };\n"],"names":["hyperStyled","$hj0lx$hyperStyled","LithologyColumn","$hj0lx$LithologyColumn","SVG","$hj0lx$SVG","ColumnContext","$hj0lx$ColumnContext","createContext","$hj0lx$createContext","useState","$hj0lx$useState","useRef","$hj0lx$useRef","useCallback","$hj0lx$useCallback","useContext","$hj0lx$useContext","useEffect","$hj0lx$useEffect","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6b7af672ec278734$exports","$6b7af672ec278734$export$e4e89ab6c86ac513","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","$6b7af672ec278734$export$a6684360fef0406e","$6b7af672ec278734$export$d8c3f2fdd653a082","$6b7af672ec278734$export$13984e34afdbb040","$6b7af672ec278734$export$6cc7a9df4edde18","$jiUaC","$1n4Pb","$45u6B","$wtIgl","$5SO8b","$6b7af672ec278734$var$h","a","__esModule","default","$6b7af672ec278734$var$LabelTrackerContext","$6b7af672ec278734$var$UnlabeledDivisionsContext","$6b7af672ec278734$var$findMacrostratUnitID","u","unit_id","props","children","units","findUnitID","unlabeledDivisions","setUnlabeledDivisions","labelTrackerRef","trackLabelVisibility","div","visible","current","keys","length","filter","d","Provider","value","division","nameForDivision","defaultNameFunction","rest","LabeledUnit","label","onLabelUpdated","width","unitComponent","unitComponentProps","clipToFrame","UnitBoxes","console","warn","noteMode","labelOffset","noteComponent","shouldRenderNote","totalHeight","axisType","useMacrostratColumnData","_compositeScale","useCompositeScale","unlabeledUnits","selectUnit","useUnitSelectionDispatch","scale","height","innerWidth","paddingH","paddingLeft","UnitNamesColumn","divisions","undefined","onClickNote","note","data","pixelScale","scaleClamped","pixelHeight","pixelsPerMeter","zoom","LabelTrackerProvider","TrackedLabeledUnit","CompositeUnitComponent","CompositeUnitsColumn","AnnotatedUnitsColumn","SectionLabelsColumn","ColumnNotesProvider"],"version":3,"file":"column-views.5987bc26.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.82cf7c0d.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.82cf7c0d.js";import"./column-views.8bee789c.js";import"./column-views.d737de1e.js";import"./column-views.eea80478.js";import{useMemo as e}from"react";import t from"@macrostrat/hyper";import a from"classnames";import{AxisBottom as r}from"@visx/axis";import{referenceMeasuresToColumn as o}from"@macrostrat/stratigraphy-utils";import{useColumnLayout as s,SVG as l,ColumnLayoutProvider as i}from"@macrostrat/column-components";import{scaleLinear as n}from"d3-scale";function c(e,t,a,r){Object.defineProperty(e,t,{get:a,set:r,enumerable:!0,configurable:!0})}var u=globalThis,m={},p={},d=u.parcelRequirea149;null==d&&((d=function(e){if(e in m)return m[e].exports;if(e in p){var t=p[e];delete p[e];var a={id:e,exports:{}};return m[e]=a,t.call(a.exports,a,a.exports),a.exports}var r=Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,t){p[e]=t},u.parcelRequirea149=d),d.register;var f={};c(f,"IsotopesDataset",()=>_),c(f,"IsotopesColumn",()=>H);var g=d("62IHc"),h=d("l5EV6"),v=d("wtIgl"),x=d("6nrRo");let k=t.styled(x&&x.__esModule?x.default:x);function b(e){let{value:t,className:r,labelBottom:o,labelOffset:l,...i}=e,{sections:n}=(0,v.useMacrostratColumnData)(),{xScale:c}=s(),u=c(t);return k("g.tick",{transform:`translate(${u})`,className:r=a(r,{zero:0===t}),key:t},[k("g.tick-lines",n.map(t=>{let{scaleInfo:a}=t,r=a.offset,o=r+a.pixelHeight;return k("line",{y1:r,y2:o,strokeDasharray:e.strokeDasharray,strokeWidth:1})}))])}function _(t){let{parameter:a,color:r="dodgerblue"}=t,s=(0,v.useMacrostratUnits)(),l=(0,g.useMeasurementData)()??[],i=e(()=>{var e=o(s,l.filter(e=>e.measurement===a));let t=[];for(let a of e){let e=a.measure_value.map((e,t)=>({value:e,age:a.measure_age[t],position:a.measure_position[t],unit_id:a.unit_id,sample_id:a.sample_no[t],measurement:a.measurement}));Array.prototype.push.apply(t,e)}return t},[l,a,s]);return k(h.IsotopesDataArea,{getHeight:e=>e.age},k("g.data-points",i.map(e=>k(h.IsotopeDataPoint,{datum:e,fill:r}))))}function H(t){let{width:a=120,domain:r=[-14,6],parameter:o,label:s,color:c="dodgerblue",children:u=null,transform:m,getHeight:p,showAxis:d=!0,tickValues:f,nTicks:g=6,...h}=t,{totalHeight:x}=(0,v.useMacrostratColumnData)(),b=u;null==u&&null!=o&&(b=k(_,{parameter:o,color:c,getHeight:p}));let H=e(()=>n().domain(r).range([0,a]),[r,a]),S=f??H.ticks(g);return k("div.isotopes-column",[k(l,{height:x,innerWidth:a,paddingH:15},k(i,{width:a,xScale:H},k("g.isotopes-column",{className:o,transform:m},[k(w,{xScale:H,tickValues:S,width:a,...h}),b]))),k.if(d)(y,{width:a,label:s??o,xScale:H,tickValues:S,...h})])}function y(e){let{label:t,xScale:a,width:o,showAxis:s=!0,tickValues:i,...n}=e;return k("div.isotopes-scale-axis",[k(l,{innerWidth:o,height:45,paddingH:15},[k(r,{scale:a,tickLength:5,tickValues:i,stroke:"var(--column-stroke-color)",tickStroke:"var(--column-stroke-color)",...n,label:t})])])}function w(e){let{tickValues:t,xScale:a}=e;return k("g.scale-lines",t.map(e=>k(b,{value:e})))}export{_ as IsotopesDataset,H as IsotopesColumn};
|
|
2
|
+
//# sourceMappingURL=column-views.5bb858c9.js.map
|