@macrostrat/column-views 2.2.2 → 2.3.1
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 +15 -0
- package/dist/esm/{column-views.b0e6c0b3.js → column-views.04636815.js} +3 -3
- package/dist/esm/{column-views.b0e6c0b3.js.map → column-views.04636815.js.map} +1 -1
- package/dist/esm/{column-views.54f8b909.js → column-views.052498a6.js} +37 -4
- package/dist/esm/column-views.052498a6.js.map +1 -0
- package/dist/esm/{column-views.5456a1ee.js → column-views.0da4503a.js} +2 -2
- package/dist/esm/{column-views.5456a1ee.js.map → column-views.0da4503a.js.map} +1 -1
- package/dist/esm/{column-views.ee525e88.js → column-views.107b47b4.js} +8 -8
- package/dist/esm/{column-views.ee525e88.js.map → column-views.107b47b4.js.map} +1 -1
- package/dist/esm/column-views.17a70358.js +16 -0
- package/dist/esm/column-views.17a70358.js.map +1 -0
- package/dist/esm/{column-views.073c42da.js → column-views.1b5bf0c6.js} +3 -3
- package/dist/esm/{column-views.073c42da.js.map → column-views.1b5bf0c6.js.map} +1 -1
- package/dist/esm/{column-views.52ad973a.js → column-views.2708e176.js} +8 -8
- package/dist/esm/column-views.2708e176.js.map +1 -0
- package/dist/esm/{column-views.88d63dd0.js → column-views.275ba52b.js} +3 -3
- package/dist/esm/{column-views.88d63dd0.js.map → column-views.275ba52b.js.map} +1 -1
- package/dist/esm/{column-views.7c95c3d7.js → column-views.2bac03a2.js} +2 -2
- package/dist/esm/{column-views.7c95c3d7.js.map → column-views.2bac03a2.js.map} +1 -1
- package/dist/esm/column-views.2c45a7b5.js.map +1 -1
- package/dist/esm/column-views.322790f3.js +138 -0
- package/dist/esm/column-views.322790f3.js.map +1 -0
- package/dist/esm/{column-views.6698b95a.js → column-views.343fc926.js} +9 -18
- package/dist/esm/column-views.343fc926.js.map +1 -0
- package/dist/esm/{column-views.aeb61926.js → column-views.3d3e00be.js} +2 -2
- package/dist/esm/{column-views.aeb61926.js.map → column-views.3d3e00be.js.map} +1 -1
- package/dist/esm/{column-views.7d69838d.js → column-views.40094dd9.js} +3 -3
- package/dist/esm/{column-views.7d69838d.js.map → column-views.40094dd9.js.map} +1 -1
- package/dist/esm/{column-views.d2214a99.js → column-views.44373a90.js} +8 -7
- package/dist/esm/column-views.44373a90.js.map +1 -0
- package/dist/esm/column-views.479f68bd.js +152 -0
- package/dist/esm/column-views.479f68bd.js.map +1 -0
- package/dist/esm/{column-views.ad080c0e.js → column-views.488f24b6.js} +2 -2
- package/dist/esm/{column-views.ad080c0e.js.map → column-views.488f24b6.js.map} +1 -1
- package/dist/esm/{column-views.abf6aedd.js → column-views.4b259f9e.js} +2 -2
- package/dist/esm/{column-views.abf6aedd.js.map → column-views.4b259f9e.js.map} +1 -1
- package/dist/esm/{column-views.1151416d.css → column-views.54c1f382.css} +6 -5
- package/dist/esm/column-views.54c1f382.css.map +1 -0
- package/dist/esm/{column-views.729a6728.js → column-views.565b193a.js} +2 -2
- package/dist/esm/{column-views.729a6728.js.map → column-views.565b193a.js.map} +1 -1
- package/dist/esm/{column-views.058c0083.js → column-views.5ca2b219.js} +5 -5
- package/dist/esm/{column-views.058c0083.js.map → column-views.5ca2b219.js.map} +1 -1
- package/dist/esm/{column-views.218e8f5d.js → column-views.5eb4e6ff.js} +4 -4
- package/dist/esm/{column-views.218e8f5d.js.map → column-views.5eb4e6ff.js.map} +1 -1
- package/dist/esm/{column-views.11ae78f7.js → column-views.5fff0716.js} +3 -3
- package/dist/esm/{column-views.11ae78f7.js.map → column-views.5fff0716.js.map} +1 -1
- package/dist/esm/{column-views.05586d1f.js → column-views.60e97132.js} +2 -4
- package/dist/esm/column-views.60e97132.js.map +1 -0
- package/dist/esm/{column-views.75e5aebe.js → column-views.63d40878.js} +4 -4
- package/dist/esm/{column-views.75e5aebe.js.map → column-views.63d40878.js.map} +1 -1
- package/dist/esm/{column-views.d6d6df77.js → column-views.6c9e5069.js} +40 -62
- package/dist/esm/column-views.6c9e5069.js.map +1 -0
- package/dist/esm/column-views.6df65dab.js +9 -0
- package/dist/esm/column-views.6df65dab.js.map +1 -0
- package/dist/esm/{column-views.403a7b48.css → column-views.6f9511d1.css} +2 -1
- package/dist/esm/column-views.6f9511d1.css.map +1 -0
- package/dist/esm/column-views.7fa0d026.js +62 -0
- package/dist/esm/column-views.7fa0d026.js.map +1 -0
- package/dist/esm/{column-views.3a7179c4.js → column-views.82eb5026.js} +12 -7
- package/dist/esm/column-views.82eb5026.js.map +1 -0
- package/dist/esm/{column-views.9dd25b5b.js → column-views.92575b87.js} +3 -3
- package/dist/esm/column-views.92575b87.js.map +1 -0
- package/dist/esm/{column-views.833c2b74.js → column-views.9d51a5ab.js} +3 -3
- package/dist/esm/{column-views.833c2b74.js.map → column-views.9d51a5ab.js.map} +1 -1
- package/dist/esm/{column-views.817752b6.js → column-views.9ffc089b.js} +3 -3
- package/dist/esm/{column-views.817752b6.js.map → column-views.9ffc089b.js.map} +1 -1
- package/dist/esm/{column-views.70164236.js → column-views.aa9ede4d.js} +2 -2
- package/dist/esm/{column-views.70164236.js.map → column-views.aa9ede4d.js.map} +1 -1
- package/dist/esm/{column-views.6d63971b.js → column-views.ad2fe46c.js} +2 -2
- package/dist/esm/{column-views.6d63971b.js.map → column-views.ad2fe46c.js.map} +1 -1
- package/dist/esm/{column-views.7b4a1f15.js → column-views.afe0bb48.js} +5 -5
- package/dist/esm/{column-views.7b4a1f15.js.map → column-views.afe0bb48.js.map} +1 -1
- package/dist/esm/{column-views.aecf25bc.js → column-views.b4e1236d.js} +2 -2
- package/dist/esm/{column-views.aecf25bc.js.map → column-views.b4e1236d.js.map} +1 -1
- package/dist/esm/{column-views.6ce8cb61.js → column-views.c149f7a5.js} +3 -3
- package/dist/esm/{column-views.6ce8cb61.js.map → column-views.c149f7a5.js.map} +1 -1
- package/dist/esm/{column-views.b7016f82.css → column-views.cb6fc808.css} +10 -10
- package/dist/esm/column-views.cb6fc808.css.map +1 -0
- package/dist/esm/{column-views.35efe006.js → column-views.ce3a3ac8.js} +2 -2
- package/dist/esm/{column-views.35efe006.js.map → column-views.ce3a3ac8.js.map} +1 -1
- package/dist/esm/{column-views.77e22590.js → column-views.d1b49f5c.js} +2 -2
- package/dist/esm/{column-views.77e22590.js.map → column-views.d1b49f5c.js.map} +1 -1
- package/dist/esm/{column-views.faa4e06d.js → column-views.d524075b.js} +4 -4
- package/dist/esm/{column-views.faa4e06d.js.map → column-views.d524075b.js.map} +1 -1
- package/dist/esm/column-views.d5e788e8.js +31 -0
- package/dist/esm/column-views.d5e788e8.js.map +1 -0
- package/dist/esm/{column-views.30950997.js → column-views.d6c0b7bc.js} +2 -2
- package/dist/esm/{column-views.30950997.js.map → column-views.d6c0b7bc.js.map} +1 -1
- package/dist/esm/{column-views.44d3797a.js → column-views.dc195174.js} +2 -2
- package/dist/esm/{column-views.44d3797a.js.map → column-views.dc195174.js.map} +1 -1
- package/dist/esm/column-views.de433f18.js +139 -0
- package/dist/esm/column-views.de433f18.js.map +1 -0
- package/dist/esm/{column-views.ef88c46c.js → column-views.e075af15.js} +2 -2
- package/dist/esm/{column-views.ef88c46c.js.map → column-views.e075af15.js.map} +1 -1
- package/dist/esm/{column-views.7faf00ed.js → column-views.f7cdf6be.js} +3 -3
- package/dist/esm/{column-views.7faf00ed.js.map → column-views.f7cdf6be.js.map} +1 -1
- package/dist/esm/{column-views.66ccfc44.js → column-views.faa7e52e.js} +3 -3
- package/dist/esm/{column-views.66ccfc44.js.map → column-views.faa7e52e.js.map} +1 -1
- package/dist/esm/column-views.fba36cbb.js +13 -0
- package/dist/esm/{column-views.43beafa3.js.map → column-views.fba36cbb.js.map} +1 -1
- package/dist/esm/index.d.ts +40 -19
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +12 -12
- package/dist/node/column-views.012fa10c.js +2 -0
- package/dist/node/column-views.012fa10c.js.map +1 -0
- package/dist/node/{column-views.edb4ba54.js → column-views.021a6961.js} +2 -2
- package/dist/node/{column-views.edb4ba54.js.map → column-views.021a6961.js.map} +1 -1
- package/dist/node/{column-views.a19be00f.js → column-views.08bef1f6.js} +2 -2
- package/dist/node/{column-views.a19be00f.js.map → column-views.08bef1f6.js.map} +1 -1
- package/dist/node/{column-views.ae22e8b1.js → column-views.0f401891.js} +2 -2
- package/dist/node/{column-views.ae22e8b1.js.map → column-views.0f401891.js.map} +1 -1
- package/dist/node/column-views.1d064426.js +2 -0
- package/dist/node/column-views.1d064426.js.map +1 -0
- package/dist/node/{column-views.ae54d3e1.js → column-views.2577dec0.js} +2 -2
- package/dist/node/{column-views.ae54d3e1.js.map → column-views.2577dec0.js.map} +1 -1
- package/dist/node/{column-views.1ac9e2ed.js → column-views.2fe8feb9.js} +2 -2
- package/dist/node/{column-views.1ac9e2ed.js.map → column-views.2fe8feb9.js.map} +1 -1
- package/dist/node/column-views.3a079e34.css +2 -0
- package/dist/node/column-views.3a079e34.css.map +1 -0
- package/dist/node/{column-views.a281d5bb.js → column-views.42bc66a8.js} +2 -2
- package/dist/node/{column-views.a281d5bb.js.map → column-views.42bc66a8.js.map} +1 -1
- package/dist/node/{column-views.4ce5f5e4.js → column-views.465e593b.js} +2 -2
- package/dist/node/{column-views.4ce5f5e4.js.map → column-views.465e593b.js.map} +1 -1
- package/dist/node/{column-views.e1813308.js → column-views.46efb749.js} +2 -2
- package/dist/node/{column-views.e1813308.js.map → column-views.46efb749.js.map} +1 -1
- package/dist/node/{column-views.61dc64bc.js → column-views.47440961.js} +2 -2
- package/dist/node/{column-views.61dc64bc.js.map → column-views.47440961.js.map} +1 -1
- package/dist/node/{column-views.38835c99.js → column-views.5559de6a.js} +2 -2
- package/dist/node/{column-views.38835c99.js.map → column-views.5559de6a.js.map} +1 -1
- package/dist/node/{column-views.52cc4dd0.js → column-views.56f88b8c.js} +2 -2
- package/dist/node/{column-views.52cc4dd0.js.map → column-views.56f88b8c.js.map} +1 -1
- package/dist/node/{column-views.0b3a384e.js → column-views.5a9331a9.js} +2 -2
- package/dist/node/{column-views.0b3a384e.js.map → column-views.5a9331a9.js.map} +1 -1
- package/dist/node/column-views.5cb51833.js +2 -0
- package/dist/node/column-views.5cb51833.js.map +1 -0
- package/dist/node/column-views.5fd6e11a.js +2 -0
- package/dist/node/column-views.5fd6e11a.js.map +1 -0
- package/dist/node/column-views.672b683c.js +2 -0
- package/dist/node/column-views.672b683c.js.map +1 -0
- package/dist/node/{column-views.a08b0c9f.js → column-views.6c7f9245.js} +2 -2
- package/dist/node/{column-views.a08b0c9f.js.map → column-views.6c7f9245.js.map} +1 -1
- package/dist/node/{column-views.67fed1f5.js → column-views.75456275.js} +2 -2
- package/dist/node/{column-views.67fed1f5.js.map → column-views.75456275.js.map} +1 -1
- package/dist/node/column-views.75ba0464.css +2 -0
- package/dist/node/column-views.75ba0464.css.map +1 -0
- package/dist/node/{column-views.21a73236.js → column-views.7c322202.js} +2 -2
- package/dist/node/{column-views.21a73236.js.map → column-views.7c322202.js.map} +1 -1
- package/dist/node/column-views.7cc1a14f.js +2 -0
- package/dist/node/column-views.7cc1a14f.js.map +1 -0
- package/dist/node/{column-views.7faaf6c8.js → column-views.8e846c57.js} +2 -2
- package/dist/node/{column-views.7faaf6c8.js.map → column-views.8e846c57.js.map} +1 -1
- package/dist/node/{column-views.003348f6.js → column-views.8ee8469d.js} +2 -2
- package/dist/node/{column-views.003348f6.js.map → column-views.8ee8469d.js.map} +1 -1
- package/dist/node/{column-views.420b60d2.js → column-views.93bde6c1.js} +2 -2
- package/dist/node/{column-views.420b60d2.js.map → column-views.93bde6c1.js.map} +1 -1
- package/dist/node/{column-views.f2ee436e.js → column-views.a14f0134.js} +2 -2
- package/dist/node/{column-views.f2ee436e.js.map → column-views.a14f0134.js.map} +1 -1
- package/dist/node/column-views.a230263f.js +2 -0
- package/dist/node/column-views.a230263f.js.map +1 -0
- package/dist/node/{column-views.aef76eee.js → column-views.a596b1f5.js} +2 -2
- package/dist/node/{column-views.aef76eee.js.map → column-views.a596b1f5.js.map} +1 -1
- package/dist/node/column-views.af480651.js +2 -0
- package/dist/node/column-views.af480651.js.map +1 -0
- package/dist/node/column-views.b103acbc.js +2 -0
- package/dist/node/column-views.b103acbc.js.map +1 -0
- package/dist/node/{column-views.60b5663d.js → column-views.b40c1b9c.js} +2 -2
- package/dist/node/{column-views.60b5663d.js.map → column-views.b40c1b9c.js.map} +1 -1
- package/dist/node/column-views.b6e86cf0.js +2 -0
- package/dist/node/column-views.b6e86cf0.js.map +1 -0
- package/dist/node/{column-views.22c2d45b.js → column-views.c007152b.js} +2 -2
- package/dist/node/{column-views.22c2d45b.js.map → column-views.c007152b.js.map} +1 -1
- package/dist/node/{column-views.b6943236.js → column-views.c921fa1a.js} +2 -2
- package/dist/node/{column-views.b6943236.js.map → column-views.c921fa1a.js.map} +1 -1
- package/dist/node/{column-views.05cfc627.js → column-views.c9880a4d.js} +2 -2
- package/dist/node/{column-views.05cfc627.js.map → column-views.c9880a4d.js.map} +1 -1
- package/dist/node/column-views.ccfb9afb.css +2 -0
- package/dist/node/column-views.ccfb9afb.css.map +1 -0
- package/dist/node/{column-views.bde2dfa8.js → column-views.cd54f1b1.js} +2 -2
- package/dist/node/{column-views.bde2dfa8.js.map → column-views.cd54f1b1.js.map} +1 -1
- package/dist/node/{column-views.db47fe3c.js → column-views.d77d260b.js} +2 -2
- package/dist/node/{column-views.db47fe3c.js.map → column-views.d77d260b.js.map} +1 -1
- package/dist/node/{column-views.105c28fa.js → column-views.d818b387.js} +2 -2
- package/dist/node/{column-views.105c28fa.js.map → column-views.d818b387.js.map} +1 -1
- package/dist/node/{column-views.2d00d842.js → column-views.d8821a96.js} +2 -2
- package/dist/node/{column-views.2d00d842.js.map → column-views.d8821a96.js.map} +1 -1
- package/dist/node/column-views.dbb4a46b.js +2 -0
- package/dist/node/column-views.dbb4a46b.js.map +1 -0
- package/dist/node/{column-views.b12f8c81.js → column-views.e264a767.js} +2 -2
- package/dist/node/{column-views.b12f8c81.js.map → column-views.e264a767.js.map} +1 -1
- package/dist/node/column-views.e93b3bdb.js +2 -0
- package/dist/node/column-views.e93b3bdb.js.map +1 -0
- package/dist/node/{column-views.3913cd0f.js → column-views.ec691859.js} +2 -2
- package/dist/node/{column-views.3913cd0f.js.map → column-views.ec691859.js.map} +1 -1
- package/dist/node/column-views.ec7cc7cc.js +2 -0
- package/dist/node/column-views.ec7cc7cc.js.map +1 -0
- package/dist/node/{column-views.aae09aca.js → column-views.eecdc727.js} +2 -2
- package/dist/node/{column-views.aae09aca.js.map → column-views.eecdc727.js.map} +1 -1
- package/dist/node/{column-views.d08e4328.js → column-views.f577d065.js} +2 -2
- package/dist/node/{column-views.d08e4328.js.map → column-views.f577d065.js.map} +1 -1
- package/dist/node/column-views.fac4baff.js +2 -0
- package/dist/node/column-views.fac4baff.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +2 -2
- package/src/age-axis.ts +1 -1
- package/src/column.ts +4 -1
- package/src/correlation-chart/stories/correlation-chart.stories.ts +1 -1
- package/src/facets/detrital-zircon/index.module.sass +2 -3
- package/src/facets/detrital-zircon/index.ts +81 -11
- package/src/facets/detrital-zircon/provider.ts +1 -1
- package/src/facets/fossils/index.ts +145 -215
- package/src/facets/fossils/provider.ts +18 -25
- package/src/facets/fossils/taxon-ranges.ts +220 -0
- package/src/facets/index.ts +0 -1
- package/src/facets/{base-sample-column.module.sass → measurements/base.module.sass} +1 -0
- package/src/facets/measurements/base.ts +215 -0
- package/src/facets/measurements/index.ts +2 -38
- package/src/facets/measurements/sgp.ts +91 -0
- package/src/notes.ts +6 -3
- package/src/prepare-units/index.ts +8 -2
- package/src/prepare-units/utils.ts +55 -9
- package/dist/esm/column-views.05586d1f.js.map +0 -1
- package/dist/esm/column-views.1151416d.css.map +0 -1
- package/dist/esm/column-views.1e579112.js +0 -92
- package/dist/esm/column-views.1e579112.js.map +0 -1
- package/dist/esm/column-views.3a7179c4.js.map +0 -1
- package/dist/esm/column-views.403a7b48.css.map +0 -1
- package/dist/esm/column-views.43beafa3.js +0 -15
- package/dist/esm/column-views.52ad973a.js.map +0 -1
- package/dist/esm/column-views.54f8b909.js.map +0 -1
- package/dist/esm/column-views.6698b95a.js.map +0 -1
- package/dist/esm/column-views.6e7082db.js +0 -16
- package/dist/esm/column-views.6e7082db.js.map +0 -1
- package/dist/esm/column-views.7243e77d.js +0 -37
- package/dist/esm/column-views.7243e77d.js.map +0 -1
- package/dist/esm/column-views.76a220c4.js +0 -95
- package/dist/esm/column-views.76a220c4.js.map +0 -1
- package/dist/esm/column-views.9dd25b5b.js.map +0 -1
- package/dist/esm/column-views.b7016f82.css.map +0 -1
- package/dist/esm/column-views.d2214a99.js.map +0 -1
- package/dist/esm/column-views.d6d6df77.js.map +0 -1
- package/dist/esm/column-views.ea4ebbb7.js +0 -31
- package/dist/esm/column-views.ea4ebbb7.js.map +0 -1
- package/dist/node/column-views.16f336ee.js +0 -2
- package/dist/node/column-views.16f336ee.js.map +0 -1
- package/dist/node/column-views.1c567bfd.js +0 -2
- package/dist/node/column-views.1c567bfd.js.map +0 -1
- package/dist/node/column-views.28609db2.css +0 -2
- package/dist/node/column-views.28609db2.css.map +0 -1
- package/dist/node/column-views.2901b649.js +0 -2
- package/dist/node/column-views.2901b649.js.map +0 -1
- package/dist/node/column-views.29eb25bd.css +0 -2
- package/dist/node/column-views.29eb25bd.css.map +0 -1
- package/dist/node/column-views.39c21f22.js +0 -2
- package/dist/node/column-views.39c21f22.js.map +0 -1
- package/dist/node/column-views.573cb29d.js +0 -2
- package/dist/node/column-views.573cb29d.js.map +0 -1
- package/dist/node/column-views.5f3b0b04.js +0 -2
- package/dist/node/column-views.5f3b0b04.js.map +0 -1
- package/dist/node/column-views.77ace3a2.js +0 -2
- package/dist/node/column-views.77ace3a2.js.map +0 -1
- package/dist/node/column-views.8f54691f.js +0 -2
- package/dist/node/column-views.8f54691f.js.map +0 -1
- package/dist/node/column-views.a16cd1f2.js +0 -2
- package/dist/node/column-views.a16cd1f2.js.map +0 -1
- package/dist/node/column-views.a9576bac.js +0 -2
- package/dist/node/column-views.a9576bac.js.map +0 -1
- package/dist/node/column-views.c3c15cc2.js +0 -2
- package/dist/node/column-views.c3c15cc2.js.map +0 -1
- package/dist/node/column-views.cd7b223b.css +0 -2
- package/dist/node/column-views.cd7b223b.css.map +0 -1
- package/dist/node/column-views.f6ac1161.js +0 -2
- package/dist/node/column-views.f6ac1161.js.map +0 -1
- package/src/facets/base-sample-column.ts +0 -114
- package/src/facets/measurements/provider.ts +0 -80
- /package/src/facets/fossils/{index.module.sass → taxon-ranges.module.sass} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,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,G,E,E,G,E,E,U,6C,mB,C,6C,iB,C,6C,sB,C,6C,iB,C,6C,c,C,4C,wB,C,6C,O,C,6C,a,C,6C,a,C,6C,oB,C,6C,yB,C,6C,sB,C,6C,Q,C,6C,iB","sources":["<anon>","packages/column-views/src/maps/index.ts"],"sourcesContent":["import \"./column-views.
|
|
1
|
+
{"mappings":"A,M,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,G,E,E,G,E,E,U,6C,mB,C,6C,iB,C,6C,sB,C,6C,iB,C,6C,c,C,4C,wB,C,6C,O,C,6C,a,C,6C,a,C,6C,oB,C,6C,yB,C,6C,sB,C,6C,Q,C,6C,iB","sources":["<anon>","packages/column-views/src/maps/index.ts"],"sourcesContent":["import \"./column-views.2fe8feb9.js\";\nimport \"./column-views.2577dec0.js\";\nimport \"./column-views.8c00beb4.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 $4a84f205caf763c1$exports = {};\n\nvar $34Mx7 = parcelRequire(\"34Mx7\");\n\nvar $dYjy7 = parcelRequire(\"dYjy7\");\n\nvar $6Tim5 = parcelRequire(\"6Tim5\");\n$parcel$exportWildcard($4a84f205caf763c1$exports, $34Mx7);\n$parcel$exportWildcard($4a84f205caf763c1$exports, $dYjy7);\n$parcel$exportWildcard($4a84f205caf763c1$exports, $6Tim5);\n\n\nexport {$44d1d5e5d8e823d1$export$821baedf611249f3 as ColumnNavigationMap, $5a7fd801cb316afa$export$c4313db718750a5a as ResizableMapFrame, $5a7fd801cb316afa$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap, $372e0c9189556f66$export$2254347cd20e6080 as MeasurementsLayer, $372e0c9189556f66$export$f177ff57c101017a as ColumnFeatures, $372e0c9189556f66$export$8c41dd563753848 as ColumnKeyboardNavigation, $372e0c9189556f66$export$f02cc02ad0e0bba3 as Columns, $372e0c9189556f66$export$4d8f6e6df85d9012 as ColumnCenters, $372e0c9189556f66$export$b9d912252344e099 as CurrentColumn, $2e0f3abda6f981c3$export$8e7d97509e84cc49 as ColumnCorrelationMap, $c36af3ba15da093b$export$72ffe141ebf87ef1 as ColumnCorrelationProvider, $c36af3ba15da093b$export$21398703d3a9bb4d as useCorrelationMapStore, $ec03b0c93e1da04f$export$1e8149fc0d15fed0 as InsetMap, $25e107971dfb4328$export$d2995719c3a4ae17 as buildColumnsStyle};\n//# sourceMappingURL=column-views.47440961.js.map\n","export * from \"./column-navigation\";\nexport * from \"./column-correlation\";\nexport * from \"./_shared\";\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","$4a84f205caf763c1$exports","$34Mx7","$dYjy7","$6Tim5","$44d1d5e5d8e823d1$export$821baedf611249f3","ColumnNavigationMap","$5a7fd801cb316afa$export$c4313db718750a5a","ResizableMapFrame","$5a7fd801cb316afa$export$9595c40c7a4c4f7b","ColumnNavigationSVGMap","$372e0c9189556f66$export$2254347cd20e6080","MeasurementsLayer","$372e0c9189556f66$export$f177ff57c101017a","ColumnFeatures","$372e0c9189556f66$export$8c41dd563753848","ColumnKeyboardNavigation","$372e0c9189556f66$export$f02cc02ad0e0bba3","Columns","$372e0c9189556f66$export$4d8f6e6df85d9012","ColumnCenters","$372e0c9189556f66$export$b9d912252344e099","CurrentColumn","$2e0f3abda6f981c3$export$8e7d97509e84cc49","ColumnCorrelationMap","$c36af3ba15da093b$export$72ffe141ebf87ef1","ColumnCorrelationProvider","$c36af3ba15da093b$export$21398703d3a9bb4d","useCorrelationMapStore","$ec03b0c93e1da04f$export$1e8149fc0d15fed0","InsetMap","$25e107971dfb4328$export$d2995719c3a4ae17","buildColumnsStyle"],"version":3,"file":"column-views.47440961.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.93bde6c1.js";import"./column-views.c921fa1a.js";import"./column-views.6a0a35e7.js";import"./column-views.46efb749.js";import"./column-views.0beae29d.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.5559de6a.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,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,uB,I,G,E,E,qB,I,G,E,E,yB,I,G,E,E,uB,I,G,E,E,uB,I,G,E,E,sB,I,G,E,E,sB,I,G,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCwBA,IAAM,EAAI,AAAA,E,AAAY,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAMhB,EAAsB,AAAA,EAAc,MACpC,EAA4B,AAAA,EAAc,MAE1C,EAAuB,AAAC,GAAM,EAAE,OAAO,CAEtC,SAAS,EAAqB,CAAK,EAIxC,GAAM,CAAA,SAAE,CAAQ,CAAA,MAAE,CAAK,CAAA,WAAE,EAAa,CAAA,CAAsB,CAAG,EACzD,CAAC,EAAoB,EAAsB,CAAG,AAAA,EAElD,MACI,EAAkB,AAAA,EAAqB,CAAC,GACxC,EAAuB,AA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EAAc,EAAA,CAAA,cACd,CAAa,CAAA,iBACb,CAAgB,CACjB,CAAG,EAEE,CAAA,YAAE,CAAW,CAAA,SAAE,CAAQ,CAAE,CAAG,AAAA,CAAA,EAAA,EAAA,uBAAsB,AAAtB,IAC5B,EAAkB,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,IAElB,EAAiB,AAAA,EAAW,GAG5B,EAAa,AAAA,CAAA,EAAA,EAAA,wBAAuB,AAAvB,IAEnB,OAAO,EAAE,4BAA6B,CACpC,EACE,EACA,CACE,MAAO,EAAE,CACT,MAAO,EACP,YAAA,EACA,SAAA,CACF,EACA,EACE,EACA,CACE,OAAQ,EACR,WAAY,EAAQ,EACpB,SAAU,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,CAQO,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.420b60d2.js\";\nimport \"./column-views.b6943236.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.e1813308.js\";\nimport \"./column-views.0beae29d.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.38835c99.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n SVG,\n ColumnContext,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\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 interface CompositeColumnScale {\n (val: number): number;\n copy(): CompositeColumnScale;\n domain(): number[];\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.38835c99.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,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,uB,I,G,E,E,qB,I,G,E,E,yB,I,G,E,E,uB,I,G,E,E,uB,I,G,E,E,sB,I,G,E,E,sB,I,G,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCwBA,IAAM,EAAI,AAAA,E,AAAY,G,AAAA,E,U,C,AAAA,E,O,CAAA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AE,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.93bde6c1.js\";\nimport \"./column-views.c921fa1a.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.0beae29d.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.5559de6a.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n SVG,\n ColumnContext,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\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 interface CompositeColumnScale {\n (val: number): number;\n copy(): CompositeColumnScale;\n domain(): number[];\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.5559de6a.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.1261be59.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.1261be59.js";import"./column-views.8ee8469d.js";import"./column-views.46efb749.js";import"./column-views.0beae29d.js";import"./column-views.6c7f9245.js";import"./column-views.f577d065.js";import"./column-views.b40c1b9c.js";import"./column-views.d77d260b.js";import"./column-views.7f9c7448.js";import"./column-views.5fd6e11a.js";import{ColumnAxisType as e}from"@macrostrat/column-components";import{hyperStyled as o}from"@macrostrat/hyper";import{extractPadding as n,useDarkMode as t,Box as i}from"@macrostrat/ui-components";import l from"classnames";import{useRef as a,useCallback as s}from"react";import{NonIdealState as r}from"@blueprintjs/core";import{DataField as c}from"@macrostrat/data-components";function m(e,o,n,t){Object.defineProperty(e,o,{get:n,set:t,enumerable:!0,configurable:!0})}var u=globalThis,p={},d={},f=u.parcelRequirea149;null==f&&((f=function(e){if(e in p)return p[e].exports;if(e in d){var o=d[e];delete d[e];var n={id:e,exports:{}};return p[e]=n,o.call(n.exports,n,n.exports),n.exports}var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}).register=function(e,o){d[e]=o},u.parcelRequirea149=f),f.register;var b={};m(b,"Column",()=>R),m(b,"ColumnContainer",()=>E),m(b,"ColumnBasicInfo",()=>M);var g=f("7YHvf"),v=f("7tWYE"),h=f("wtIgl"),_=f("5SO8b"),x=f("iYfAq"),S=f("2KV3o"),H=f("7exMg"),C=f("4hG2H"),w=f("76iYI"),A=f("610tc");let y=o(g&&g.__esModule?g.default:g);function R(o){let{showUnitPopover:n=!1,keyboardNavigation:t=!1,mergeSections:i,onUnitSelected:l,selectedUnit:s,children:c,units:m,t_age:u,b_age:p,t_pos:d,b_pos:f,unconformityHeight:b=30,targetUnitHeight:g=20,pixelScale:v,minPixelScale:x=.2,minSectionHeight:H=50,collapseSmallUnconformities:R=!0,allowUnitSelection:E,hybridScale:M,scale:F,axisType:$,...j}=o,T=a(),N=g,L=H,O=x;null!=v&&(N=null,L=0,O=v);let I=$??e.AGE,P=C.CompositeAgeAxis;M?.type===w.HybridScaleType.ApproximateHeight&&I!=e.AGE&&(P=C.ApproximateHeightAxis,I=e.AGE);let{sections:D,units:k,totalHeight:G}=(0,A.usePreparedColumnUnits)(m,{axisType:I,t_age:u,b_age:p,t_pos:d,b_pos:f,mergeSections:i,targetUnitHeight:N,unconformityHeight:b,pixelScale:v,minPixelScale:O,minSectionHeight:L,collapseSmallUnconformities:R,scale:F,hybridScale:M});if(0===D.length)return y("div.column-container.empty",y(r,{title:"Empty column",description:"No sections found in this column.",icon:"warning-sign"}));let B=y(U,{columnRef:T,ageAxisComponent:P,...j},[c,y.if(n)(S.UnitSelectionPopover),y.if(t)(_.UnitKeyboardNavigation,{units:k})]),Y=E??!1;return(n||null!=s||null!=l)&&(Y=!0),Y&&(B=y(_.UnitSelectionProvider,{columnRef:T,onUnitSelected:l,selectedUnit:s,units:k},B)),y(h.MacrostratColumnDataProvider,{units:k,sections:D,totalHeight:G,axisType:I},B)}function U(o){let t=n(o),i={"--column-padding-top":`${t.paddingTop}px`,"--column-padding-bottom":`${t.paddingBottom}px`,"--column-padding-left":`${t.paddingLeft}px`,"--column-padding-right":`${t.paddingRight}px`},{unitComponent:l=v.UnitComponent,unconformityLabels:a="minimal",showLabels:r=!0,width:c=300,columnWidth:m=150,showLabelColumn:u=!0,className:p,columnRef:d,clipUnits:f=!1,children:b,showTimescale:g,timescaleLevels:x,maxInternalColumns:S,onMouseOver:w,ageAxisComponent:A=C.CompositeAgeAxis}=o,{axisType:R}=(0,h.useMacrostratColumnData)(),U=!1,M=!1;!0===a||"prominent"===a?M=!0:"minimal"===a&&(U=!0);let F=m;F>c&&(F=c);let $=u;F>c-10&&($=!1);let j=g??!0;return null!=x&&(j=!0),j=R==e.AGE&&j,y(E,{...function(e=null){let o=(0,_.useUnitSelectionDispatch)(),n=s(e=>{o?.(null,null,e)},[o]),t=(0,h.useCompositeScale)(),i=s(o=>{let n=t.invert(o.clientY-o.currentTarget.getBoundingClientRect().top);e?.(null,n,o)},[t,e]),l=s(()=>{e?.(null,null,null)},[e]);return null==e?{onClick:n,onMouseOver:void 0,onMouseMove:void 0,onMouseOut:void 0}:{onMouseOver:i,onMouseMove:i,onMouseOut:l,onClick:n}}(w),style:i,className:p},y("div.column",{ref:d},[y(A),y.if(j)(H.CompositeTimescale,{levels:x,unconformityLabels:U}),y(H.SectionsColumn,{unitComponent:l,showLabels:r,width:c,columnWidth:F,showLabelColumn:$,clipUnits:f,unconformityLabels:M,maxInternalColumns:S}),b]))}function E(e){let{className:o,...n}=e,a=t();return y(i,{className:l(o,{"dark-mode":a?.isEnabled??!1},"column-container"),...n})}function M({data:e,showColumnID:o=!0,showReferences:n=!0}){return null==e?null:y("div.column-info",[y("div.column-title-row",[y("h2",e.col_name),y.if(o)("h4",y(x.Identifier,{id:e.col_id}))]),y(c,{row:!0,label:"Group",value:e.col_group}),y.if(n)(x.ReferencesField,{refs:e.refs,inline:!1,row:!1,className:"column-refs"})])}export{R as Column,E as ColumnContainer,M as ColumnBasicInfo};
|
|
2
|
+
//# sourceMappingURL=column-views.56f88b8c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,e,C,K,mB,A,Q,kB,C,C,e,C,C,O,C,K,2B,A,Q,M,Y,A,Q,U,C,C,e,C,K,O,A,Q,iB,C,K,mB,A,Q,a,C,K,6B,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,S,I,G,E,E,kB,I,G,E,E,kB,I,G,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCoDA,IAAM,EAAI,AAAA,E,AAAY,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAuCf,SAAS,EAAO,CAAkB,EACvC,GAAM,CAAA,gBACJ,EAAkB,CAAA,CAAA,CAAA,mBAClB,EAAqB,CAAA,CAAA,CAA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OAAQ,EACR,mBAAoB,CACtB,GACA,EAAE,EAAA,cAAa,CAAG,CAChB,cAAA,EACA,WAAA,EACA,MAhCM,EAiCN,YAAA,EACA,gBAAA,EACA,UAAA,EACA,mBAAoB,EACpB,mBAAA,CACF,GACA,EACD,EAEL,CAwDO,SAAS,EAAgB,CAA2B,EACzD,GAAM,CAAA,UAAE,CAAS,CAAE,GAAG,EAAM,CAAG,EACzB,EAAW,AAAA,IAEjB,OAAO,EAAE,EAAK,CACZ,UAAW,AAAA,EACT,EACA,CACE,YAAa,GAAU,WAAa,CAAA,CACtC,EACA,oBAEF,GAAG,CAAI,AACT,EACF,CAEO,SAAS,EAAgB,CAAA,KAC9B,CAAI,CAAA,aACJ,EAAe,CAAA,CAAA,CAAA,eACf,EAAiB,CAAA,CAAA,CAClB,SACC,AAAI,AAAQ,MAAR,EAAqB,KAClB,EAAE,kBAAmB,CAC1B,EAAE,uBAAwB,CACxB,EAAE,KAAM,EAAK,QAAQ,EACrB,EAAE,EAAE,CAAC,GAAc,KAAM,EAAE,EAAA,UAAS,CAAG,CAAE,GAAI,EAAK,MAAM,AAAC,IAC1D,EACD,EAAE,EAAW,CAAE,IAAK,CAAA,EAAM,MAAO,QAAS,MAAO,EAAK,SAAS,AAAC,GAChE,EAAE,EAAE,CAAC,GAAgB,EAAA,eAAc,CAAG,CACpC,KAAM,EAAK,IAAI,CACf,OAAQ,CAAA,EACR,IAAK,CAAA,EACL,UAAW,aACb,GACD,CACH,Q,K,M,C,K,e,C,K,e","sources":["<anon>","packages/column-views/src/column.ts"],"sourcesContent":["import \"./column-views.1261be59.js\";\nimport \"./column-views.003348f6.js\";\nimport \"./column-views.e1813308.js\";\nimport \"./column-views.0beae29d.js\";\nimport \"./column-views.a08b0c9f.js\";\nimport \"./column-views.d08e4328.js\";\nimport \"./column-views.60b5663d.js\";\nimport \"./column-views.db47fe3c.js\";\nimport \"./column-views.7f9c7448.js\";\nimport \"./column-views.a16cd1f2.js\";\nimport {ColumnAxisType as $6sU8d$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {hyperStyled as $6sU8d$hyperStyled} from \"@macrostrat/hyper\";\nimport {extractPadding as $6sU8d$extractPadding, useDarkMode as $6sU8d$useDarkMode, Box as $6sU8d$Box} from \"@macrostrat/ui-components\";\nimport $6sU8d$classnames from \"classnames\";\nimport {useRef as $6sU8d$useRef, useCallback as $6sU8d$useCallback} from \"react\";\nimport {NonIdealState as $6sU8d$NonIdealState} from \"@blueprintjs/core\";\nimport {DataField as $6sU8d$DataField} from \"@macrostrat/data-components\";\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 $4721fb147cb3f5e1$exports = {};\n\n$parcel$export($4721fb147cb3f5e1$exports, \"Column\", () => $4721fb147cb3f5e1$export$816b5d811295e6bc);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnContainer\", () => $4721fb147cb3f5e1$export$2194471aa3d52446);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnBasicInfo\", () => $4721fb147cb3f5e1$export$fcdf79c491a4504f);\n\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $7tWYE = parcelRequire(\"7tWYE\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\nvar $2KV3o = parcelRequire(\"2KV3o\");\n\nvar $7exMg = parcelRequire(\"7exMg\");\n\nvar $4hG2H = parcelRequire(\"4hG2H\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nvar $610tc = parcelRequire(\"610tc\");\n\n\nconst $4721fb147cb3f5e1$var$h = (0, $6sU8d$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $4721fb147cb3f5e1$export$816b5d811295e6bc(props) {\n const { showUnitPopover: showUnitPopover = false, keyboardNavigation: keyboardNavigation = false, mergeSections: mergeSections, onUnitSelected: onUnitSelected, selectedUnit: selectedUnit, children: children, units: rawUnits, t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos, unconformityHeight: unconformityHeight = 30, targetUnitHeight: targetUnitHeight = 20, pixelScale: pixelScale, minPixelScale: minPixelScale = 0.2, minSectionHeight: minSectionHeight = 50, collapseSmallUnconformities: collapseSmallUnconformities = true, allowUnitSelection: allowUnitSelection, hybridScale: hybridScale, scale: scale, axisType: axisType, ...rest } = props;\n const ref = (0, $6sU8d$useRef)();\n // Selected item position\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */ let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? (0, $6sU8d$ColumnAxisType).AGE;\n let ageAxisComponent = (0, $4hG2H.CompositeAgeAxis);\n if (hybridScale?.type === (0, $76iYI.HybridScaleType).ApproximateHeight && _axisType != (0, $6sU8d$ColumnAxisType).AGE) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = (0, $4hG2H.ApproximateHeightAxis);\n _axisType = (0, $6sU8d$ColumnAxisType).AGE;\n }\n const { sections: sections, units: units, totalHeight: totalHeight } = (0, $610tc.usePreparedColumnUnits)(rawUnits, {\n axisType: _axisType,\n t_age: t_age,\n b_age: b_age,\n t_pos: t_pos,\n b_pos: b_pos,\n mergeSections: mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight: unconformityHeight,\n pixelScale: pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities: collapseSmallUnconformities,\n scale: // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale: hybridScale\n });\n if (sections.length === 0) return $4721fb147cb3f5e1$var$h(\"div.column-container.empty\", $4721fb147cb3f5e1$var$h((0, $6sU8d$NonIdealState), {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\"\n }));\n let main = $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$var$ColumnInner, {\n columnRef: ref,\n ageAxisComponent: ageAxisComponent,\n ...rest\n }, [\n children,\n $4721fb147cb3f5e1$var$h.if(showUnitPopover)((0, $2KV3o.UnitSelectionPopover)),\n $4721fb147cb3f5e1$var$h.if(keyboardNavigation)((0, $5SO8b.UnitKeyboardNavigation), {\n units: units\n })\n ]);\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */ let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) _allowUnitSelection = true;\n if (_allowUnitSelection) main = $4721fb147cb3f5e1$var$h((0, $5SO8b.UnitSelectionProvider), {\n columnRef: ref,\n onUnitSelected: onUnitSelected,\n selectedUnit: selectedUnit,\n units: units\n }, main);\n return $4721fb147cb3f5e1$var$h((0, $wtIgl.MacrostratColumnDataProvider), {\n units: units,\n sections: sections,\n totalHeight: totalHeight,\n axisType: _axisType\n }, main);\n}\nfunction $4721fb147cb3f5e1$var$ColumnInner(props) {\n const padding = (0, $6sU8d$extractPadding)(props);\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`\n };\n const { unitComponent: unitComponent = (0, $7tWYE.UnitComponent), unconformityLabels: unconformityLabels = \"minimal\", showLabels: showLabels = true, width: _width = 300, columnWidth: _columnWidth = 150, showLabelColumn: _showLabelColumn = true, className: className, columnRef: columnRef, clipUnits: clipUnits = false, children: children, showTimescale: showTimescale, timescaleLevels: timescaleLevels, maxInternalColumns: maxInternalColumns, onMouseOver: onMouseOver, ageAxisComponent: ageAxisComponent = (0, $4hG2H.CompositeAgeAxis) } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") _sectionUnconformityLabels = true;\n else if (unconformityLabels === \"minimal\") _timescaleUnconformityLabels = true;\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) columnWidth = width;\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) showLabelColumn = false;\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) _showTimescale = true;\n _showTimescale = axisType == (0, $6sU8d$ColumnAxisType).AGE && _showTimescale;\n return $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$export$2194471aa3d52446, {\n ...$4721fb147cb3f5e1$var$useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className: className\n }, $4721fb147cb3f5e1$var$h(\"div.column\", {\n ref: columnRef\n }, [\n $4721fb147cb3f5e1$var$h(ageAxisComponent),\n $4721fb147cb3f5e1$var$h.if(_showTimescale)((0, $7exMg.CompositeTimescale), {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels\n }),\n $4721fb147cb3f5e1$var$h((0, $7exMg.SectionsColumn), {\n unitComponent: unitComponent,\n showLabels: showLabels,\n width: width,\n columnWidth: columnWidth,\n showLabelColumn: showLabelColumn,\n clipUnits: clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns: maxInternalColumns\n }),\n children\n ]));\n}\nfunction $4721fb147cb3f5e1$var$useMouseEventHandlers(_onMouseOver = null) {\n /** Click event handler */ // Click handler for unit selection\n const dispatch = (0, $5SO8b.useUnitSelectionDispatch)();\n const onClick = (0, $6sU8d$useCallback)((evt)=>{\n dispatch?.(null, null, evt);\n }, [\n dispatch\n ]);\n /** Hover event handlers */ const scale = (0, $wtIgl.useCompositeScale)();\n const onMouseOver = (0, $6sU8d$useCallback)((evt)=>{\n const height = scale.invert(evt.clientY - evt.currentTarget.getBoundingClientRect().top);\n _onMouseOver?.(null, height, evt);\n }, [\n scale,\n _onMouseOver\n ]);\n const onMouseOut = (0, $6sU8d$useCallback)(()=>{\n _onMouseOver?.(null, null, null);\n }, [\n _onMouseOver\n ]);\n if (_onMouseOver == null) return {\n onClick: onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined\n };\n return {\n onMouseOver: onMouseOver,\n onMouseMove: onMouseOver,\n onMouseOut: onMouseOut,\n onClick: onClick\n };\n}\nfunction $4721fb147cb3f5e1$export$2194471aa3d52446(props) {\n const { className: className, ...rest } = props;\n const darkMode = (0, $6sU8d$useDarkMode)();\n return $4721fb147cb3f5e1$var$h((0, $6sU8d$Box), {\n className: (0, $6sU8d$classnames)(className, {\n \"dark-mode\": darkMode?.isEnabled ?? false\n }, \"column-container\"),\n ...rest\n });\n}\nfunction $4721fb147cb3f5e1$export$fcdf79c491a4504f({ data: data, showColumnID: showColumnID = true, showReferences: showReferences = true }) {\n if (data == null) return null;\n return $4721fb147cb3f5e1$var$h(\"div.column-info\", [\n $4721fb147cb3f5e1$var$h(\"div.column-title-row\", [\n $4721fb147cb3f5e1$var$h(\"h2\", data.col_name),\n $4721fb147cb3f5e1$var$h.if(showColumnID)(\"h4\", $4721fb147cb3f5e1$var$h((0, $iYfAq.Identifier), {\n id: data.col_id\n }))\n ]),\n $4721fb147cb3f5e1$var$h((0, $6sU8d$DataField), {\n row: true,\n label: \"Group\",\n value: data.col_group\n }),\n $4721fb147cb3f5e1$var$h.if(showReferences)((0, $iYfAq.ReferencesField), {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\"\n })\n ]);\n}\n\n\nexport {$4721fb147cb3f5e1$export$816b5d811295e6bc as Column, $4721fb147cb3f5e1$export$2194471aa3d52446 as ColumnContainer, $4721fb147cb3f5e1$export$fcdf79c491a4504f as ColumnBasicInfo};\n//# sourceMappingURL=column-views.52cc4dd0.js.map\n","import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n RefObject,\n useRef,\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n} from \"react\";\nimport styles from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n UnitSelectionProvider,\n UnitKeyboardNavigation,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\nconst h = hyperStyled(styles);\n\ninterface BaseColumnProps extends SectionSharedProps {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n collapseSmallUnconformities = true,\n allowUnitSelection,\n hybridScale,\n scale,\n axisType,\n ...rest\n } = props;\n const ref = useRef<HTMLElement>();\n // Selected item position\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n let main: any = h(\n ColumnInner,\n { columnRef: ref, ageAxisComponent, ...rest },\n [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ],\n );\n\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */\n let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) {\n _allowUnitSelection = true;\n }\n\n if (_allowUnitSelection) {\n main = h(\n UnitSelectionProvider,\n {\n columnRef: ref,\n onUnitSelected,\n selectedUnit,\n units,\n },\n main,\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n { units, sections, totalHeight, axisType: _axisType },\n main,\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n columnRef: RefObject<HTMLElement>;\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n columnRef,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null, evt as any);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":["ColumnAxisType","$6sU8d$ColumnAxisType","hyperStyled","$6sU8d$hyperStyled","extractPadding","$6sU8d$extractPadding","useDarkMode","$6sU8d$useDarkMode","Box","$6sU8d$Box","$6sU8d$classnames","useRef","$6sU8d$useRef","useCallback","$6sU8d$useCallback","NonIdealState","$6sU8d$NonIdealState","DataField","$6sU8d$DataField","$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","$4721fb147cb3f5e1$exports","$4721fb147cb3f5e1$export$816b5d811295e6bc","$4721fb147cb3f5e1$export$2194471aa3d52446","$4721fb147cb3f5e1$export$fcdf79c491a4504f","$7YHvf","$7tWYE","$wtIgl","$5SO8b","$iYfAq","$2KV3o","$7exMg","$4hG2H","$76iYI","$610tc","$4721fb147cb3f5e1$var$h","a","__esModule","default","props","showUnitPopover","keyboardNavigation","mergeSections","onUnitSelected","selectedUnit","children","units","rawUnits","t_age","b_age","t_pos","b_pos","unconformityHeight","targetUnitHeight","pixelScale","minPixelScale","minSectionHeight","collapseSmallUnconformities","allowUnitSelection","hybridScale","scale","axisType","rest","ref","_targetUnitHeight","_minSectionHeight","_minPixelScale","_axisType","AGE","ageAxisComponent","CompositeAgeAxis","type","HybridScaleType","ApproximateHeight","ApproximateHeightAxis","sections","totalHeight","usePreparedColumnUnits","length","title","description","icon","main","$4721fb147cb3f5e1$var$ColumnInner","columnRef","if","UnitSelectionPopover","UnitKeyboardNavigation","_allowUnitSelection","UnitSelectionProvider","MacrostratColumnDataProvider","padding","paddingVars","paddingTop","paddingBottom","paddingLeft","paddingRight","unitComponent","UnitComponent","unconformityLabels","showLabels","width","_width","columnWidth","_columnWidth","showLabelColumn","_showLabelColumn","className","clipUnits","showTimescale","timescaleLevels","maxInternalColumns","onMouseOver","useMacrostratColumnData","_timescaleUnconformityLabels","_sectionUnconformityLabels","_showTimescale","$4721fb147cb3f5e1$var$useMouseEventHandlers","_onMouseOver","dispatch","useUnitSelectionDispatch","onClick","evt","useCompositeScale","height","invert","clientY","currentTarget","getBoundingClientRect","top","onMouseOut","undefined","onMouseMove","style","CompositeTimescale","levels","SectionsColumn","darkMode","isEnabled","data","showColumnID","showReferences","col_name","Identifier","col_id","row","label","value","col_group","ReferencesField","refs","inline","Column","ColumnContainer","ColumnBasicInfo"],"version":3,"file":"column-views.52cc4dd0.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,e,C,K,mB,A,Q,kB,C,C,e,C,C,O,C,K,2B,A,Q,M,Y,A,Q,U,C,C,e,C,K,O,A,Q,iB,C,K,mB,A,Q,a,C,K,6B,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,S,I,G,E,E,kB,I,G,E,E,kB,I,G,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCoDA,IAAM,EAAI,AAAA,E,AAAY,G,AAAA,E,U,C,AAAA,E,O,CAAA,GA0Cf,SAAS,EAAO,CAAkB,EACvC,GAAM,CAAA,gBACJ,EAAkB,CAAA,CAAA,CAAA,mBAClB,EAAqB,CAAA,CAAA,CAAA,cACrB,CAAa,CAAA,eACb,CAAc,CAAA,aACd,CAAY,CAAA,SACZ,CAAQ,CACR,MAAO,CAAQ,CAAA,MACf,CAAK,CAAA,MACL,CAAK,CAAA,MACL,CAAK,CAAA,MACL,CAAK,CAAA,mBACL,EAAqB,EAAA,CAAA,iBACrB,EAAmB,EAAA,CAAA,WAC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CAAA,UAAE,CAAS,CAAE,GAAG,EAAM,CAAG,EACzB,EAAW,AAAA,IAEjB,OAAO,EAAE,EAAK,CACZ,UAAW,AAAA,EACT,EACA,CACE,YAAa,GAAU,WAAa,CAAA,CACtC,EACA,oBAEF,GAAG,CAAI,AACT,EACF,CAEO,SAAS,EAAgB,CAAA,KAC9B,CAAI,CAAA,aACJ,EAAe,CAAA,CAAA,CAAA,eACf,EAAiB,CAAA,CAAA,CAClB,SACC,AAAI,AAAQ,MAAR,EAAqB,KAClB,EAAE,kBAAmB,CAC1B,EAAE,uBAAwB,CACxB,EAAE,KAAM,EAAK,QAAQ,EACrB,EAAE,EAAE,CAAC,GAAc,KAAM,EAAE,EAAA,UAAS,CAAG,CAAE,GAAI,EAAK,MAAM,AAAC,IAC1D,EACD,EAAE,EAAW,CAAE,IAAK,CAAA,EAAM,MAAO,QAAS,MAAO,EAAK,SAAS,AAAC,GAChE,EAAE,EAAE,CAAC,GAAgB,EAAA,eAAc,CAAG,CACpC,KAAM,EAAK,IAAI,CACf,OAAQ,CAAA,EACR,IAAK,CAAA,EACL,UAAW,aACb,GACD,CACH,Q,K,M,C,K,e,C,K,e","sources":["<anon>","packages/column-views/src/column.ts"],"sourcesContent":["import \"./column-views.1261be59.js\";\nimport \"./column-views.8ee8469d.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.0beae29d.js\";\nimport \"./column-views.6c7f9245.js\";\nimport \"./column-views.f577d065.js\";\nimport \"./column-views.b40c1b9c.js\";\nimport \"./column-views.d77d260b.js\";\nimport \"./column-views.7f9c7448.js\";\nimport \"./column-views.5fd6e11a.js\";\nimport {ColumnAxisType as $6sU8d$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {hyperStyled as $6sU8d$hyperStyled} from \"@macrostrat/hyper\";\nimport {extractPadding as $6sU8d$extractPadding, useDarkMode as $6sU8d$useDarkMode, Box as $6sU8d$Box} from \"@macrostrat/ui-components\";\nimport $6sU8d$classnames from \"classnames\";\nimport {useRef as $6sU8d$useRef, useCallback as $6sU8d$useCallback} from \"react\";\nimport {NonIdealState as $6sU8d$NonIdealState} from \"@blueprintjs/core\";\nimport {DataField as $6sU8d$DataField} from \"@macrostrat/data-components\";\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 $4721fb147cb3f5e1$exports = {};\n\n$parcel$export($4721fb147cb3f5e1$exports, \"Column\", () => $4721fb147cb3f5e1$export$816b5d811295e6bc);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnContainer\", () => $4721fb147cb3f5e1$export$2194471aa3d52446);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnBasicInfo\", () => $4721fb147cb3f5e1$export$fcdf79c491a4504f);\n\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $7tWYE = parcelRequire(\"7tWYE\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\nvar $2KV3o = parcelRequire(\"2KV3o\");\n\nvar $7exMg = parcelRequire(\"7exMg\");\n\nvar $4hG2H = parcelRequire(\"4hG2H\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nvar $610tc = parcelRequire(\"610tc\");\n\n\nconst $4721fb147cb3f5e1$var$h = (0, $6sU8d$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $4721fb147cb3f5e1$export$816b5d811295e6bc(props) {\n const { showUnitPopover: showUnitPopover = false, keyboardNavigation: keyboardNavigation = false, mergeSections: mergeSections, onUnitSelected: onUnitSelected, selectedUnit: selectedUnit, children: children, units: rawUnits, t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos, unconformityHeight: unconformityHeight = 30, targetUnitHeight: targetUnitHeight = 20, pixelScale: pixelScale, minPixelScale: minPixelScale = 0.2, minSectionHeight: minSectionHeight = 50, collapseSmallUnconformities: collapseSmallUnconformities = true, allowUnitSelection: allowUnitSelection, hybridScale: hybridScale, scale: scale, axisType: axisType, ...rest } = props;\n const ref = (0, $6sU8d$useRef)();\n // Selected item position\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */ let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? (0, $6sU8d$ColumnAxisType).AGE;\n let ageAxisComponent = (0, $4hG2H.CompositeAgeAxis);\n if (hybridScale?.type === (0, $76iYI.HybridScaleType).ApproximateHeight && _axisType != (0, $6sU8d$ColumnAxisType).AGE) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = (0, $4hG2H.ApproximateHeightAxis);\n _axisType = (0, $6sU8d$ColumnAxisType).AGE;\n }\n const { sections: sections, units: units, totalHeight: totalHeight } = (0, $610tc.usePreparedColumnUnits)(rawUnits, {\n axisType: _axisType,\n t_age: t_age,\n b_age: b_age,\n t_pos: t_pos,\n b_pos: b_pos,\n mergeSections: mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight: unconformityHeight,\n pixelScale: pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities: collapseSmallUnconformities,\n scale: // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale: hybridScale\n });\n if (sections.length === 0) return $4721fb147cb3f5e1$var$h(\"div.column-container.empty\", $4721fb147cb3f5e1$var$h((0, $6sU8d$NonIdealState), {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\"\n }));\n let main = $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$var$ColumnInner, {\n columnRef: ref,\n ageAxisComponent: ageAxisComponent,\n ...rest\n }, [\n children,\n $4721fb147cb3f5e1$var$h.if(showUnitPopover)((0, $2KV3o.UnitSelectionPopover)),\n $4721fb147cb3f5e1$var$h.if(keyboardNavigation)((0, $5SO8b.UnitKeyboardNavigation), {\n units: units\n })\n ]);\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */ let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) _allowUnitSelection = true;\n if (_allowUnitSelection) main = $4721fb147cb3f5e1$var$h((0, $5SO8b.UnitSelectionProvider), {\n columnRef: ref,\n onUnitSelected: onUnitSelected,\n selectedUnit: selectedUnit,\n units: units\n }, main);\n return $4721fb147cb3f5e1$var$h((0, $wtIgl.MacrostratColumnDataProvider), {\n units: units,\n sections: sections,\n totalHeight: totalHeight,\n axisType: _axisType\n }, main);\n}\nfunction $4721fb147cb3f5e1$var$ColumnInner(props) {\n const padding = (0, $6sU8d$extractPadding)(props);\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`\n };\n const { unitComponent: unitComponent = (0, $7tWYE.UnitComponent), unconformityLabels: unconformityLabels = \"minimal\", showLabels: showLabels = true, width: _width = 300, columnWidth: _columnWidth = 150, showLabelColumn: _showLabelColumn = true, className: className, columnRef: columnRef, clipUnits: clipUnits = false, children: children, showTimescale: showTimescale, timescaleLevels: timescaleLevels, maxInternalColumns: maxInternalColumns, onMouseOver: onMouseOver, ageAxisComponent: ageAxisComponent = (0, $4hG2H.CompositeAgeAxis) } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") _sectionUnconformityLabels = true;\n else if (unconformityLabels === \"minimal\") _timescaleUnconformityLabels = true;\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) columnWidth = width;\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) showLabelColumn = false;\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) _showTimescale = true;\n _showTimescale = axisType == (0, $6sU8d$ColumnAxisType).AGE && _showTimescale;\n return $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$export$2194471aa3d52446, {\n ...$4721fb147cb3f5e1$var$useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className: className\n }, $4721fb147cb3f5e1$var$h(\"div.column\", {\n ref: columnRef\n }, [\n $4721fb147cb3f5e1$var$h(ageAxisComponent),\n $4721fb147cb3f5e1$var$h.if(_showTimescale)((0, $7exMg.CompositeTimescale), {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels\n }),\n $4721fb147cb3f5e1$var$h((0, $7exMg.SectionsColumn), {\n unitComponent: unitComponent,\n showLabels: showLabels,\n width: width,\n columnWidth: columnWidth,\n showLabelColumn: showLabelColumn,\n clipUnits: clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns: maxInternalColumns\n }),\n children\n ]));\n}\nfunction $4721fb147cb3f5e1$var$useMouseEventHandlers(_onMouseOver = null) {\n /** Click event handler */ // Click handler for unit selection\n const dispatch = (0, $5SO8b.useUnitSelectionDispatch)();\n const onClick = (0, $6sU8d$useCallback)((evt)=>{\n dispatch?.(null, null, evt);\n }, [\n dispatch\n ]);\n /** Hover event handlers */ const scale = (0, $wtIgl.useCompositeScale)();\n const onMouseOver = (0, $6sU8d$useCallback)((evt)=>{\n const height = scale.invert(evt.clientY - evt.currentTarget.getBoundingClientRect().top);\n _onMouseOver?.(null, height, evt);\n }, [\n scale,\n _onMouseOver\n ]);\n const onMouseOut = (0, $6sU8d$useCallback)(()=>{\n _onMouseOver?.(null, null, null);\n }, [\n _onMouseOver\n ]);\n if (_onMouseOver == null) return {\n onClick: onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined\n };\n return {\n onMouseOver: onMouseOver,\n onMouseMove: onMouseOver,\n onMouseOut: onMouseOut,\n onClick: onClick\n };\n}\nfunction $4721fb147cb3f5e1$export$2194471aa3d52446(props) {\n const { className: className, ...rest } = props;\n const darkMode = (0, $6sU8d$useDarkMode)();\n return $4721fb147cb3f5e1$var$h((0, $6sU8d$Box), {\n className: (0, $6sU8d$classnames)(className, {\n \"dark-mode\": darkMode?.isEnabled ?? false\n }, \"column-container\"),\n ...rest\n });\n}\nfunction $4721fb147cb3f5e1$export$fcdf79c491a4504f({ data: data, showColumnID: showColumnID = true, showReferences: showReferences = true }) {\n if (data == null) return null;\n return $4721fb147cb3f5e1$var$h(\"div.column-info\", [\n $4721fb147cb3f5e1$var$h(\"div.column-title-row\", [\n $4721fb147cb3f5e1$var$h(\"h2\", data.col_name),\n $4721fb147cb3f5e1$var$h.if(showColumnID)(\"h4\", $4721fb147cb3f5e1$var$h((0, $iYfAq.Identifier), {\n id: data.col_id\n }))\n ]),\n $4721fb147cb3f5e1$var$h((0, $6sU8d$DataField), {\n row: true,\n label: \"Group\",\n value: data.col_group\n }),\n $4721fb147cb3f5e1$var$h.if(showReferences)((0, $iYfAq.ReferencesField), {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\"\n })\n ]);\n}\n\n\nexport {$4721fb147cb3f5e1$export$816b5d811295e6bc as Column, $4721fb147cb3f5e1$export$2194471aa3d52446 as ColumnContainer, $4721fb147cb3f5e1$export$fcdf79c491a4504f as ColumnBasicInfo};\n//# sourceMappingURL=column-views.56f88b8c.js.map\n","import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n RefObject,\n useRef,\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n} from \"react\";\nimport styles from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n UnitSelectionProvider,\n UnitKeyboardNavigation,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\nconst h = hyperStyled(styles);\n\ninterface BaseColumnProps extends Omit<\n SectionSharedProps,\n \"unconformityLabels\"\n> {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n collapseSmallUnconformities = true,\n allowUnitSelection,\n hybridScale,\n scale,\n axisType,\n ...rest\n } = props;\n const ref = useRef<HTMLElement>();\n // Selected item position\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n let main: any = h(\n ColumnInner,\n { columnRef: ref, ageAxisComponent, ...rest },\n [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ],\n );\n\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */\n let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) {\n _allowUnitSelection = true;\n }\n\n if (_allowUnitSelection) {\n main = h(\n UnitSelectionProvider,\n {\n columnRef: ref,\n onUnitSelected,\n selectedUnit,\n units,\n },\n main,\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n { units, sections, totalHeight, axisType: _axisType },\n main,\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n columnRef: RefObject<HTMLElement>;\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n columnRef,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null, evt as any);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":["ColumnAxisType","$6sU8d$ColumnAxisType","hyperStyled","$6sU8d$hyperStyled","extractPadding","$6sU8d$extractPadding","useDarkMode","$6sU8d$useDarkMode","Box","$6sU8d$Box","$6sU8d$classnames","useRef","$6sU8d$useRef","useCallback","$6sU8d$useCallback","NonIdealState","$6sU8d$NonIdealState","DataField","$6sU8d$DataField","$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","$4721fb147cb3f5e1$exports","$4721fb147cb3f5e1$export$816b5d811295e6bc","$4721fb147cb3f5e1$export$2194471aa3d52446","$4721fb147cb3f5e1$export$fcdf79c491a4504f","$7YHvf","$7tWYE","$wtIgl","$5SO8b","$iYfAq","$2KV3o","$7exMg","$4hG2H","$76iYI","$610tc","$4721fb147cb3f5e1$var$h","a","__esModule","default","props","showUnitPopover","keyboardNavigation","mergeSections","onUnitSelected","selectedUnit","children","units","rawUnits","t_age","b_age","t_pos","b_pos","unconformityHeight","targetUnitHeight","pixelScale","minPixelScale","minSectionHeight","collapseSmallUnconformities","allowUnitSelection","hybridScale","scale","axisType","rest","ref","_targetUnitHeight","_minSectionHeight","_minPixelScale","_axisType","AGE","ageAxisComponent","CompositeAgeAxis","type","HybridScaleType","ApproximateHeight","ApproximateHeightAxis","sections","totalHeight","usePreparedColumnUnits","length","title","description","icon","main","$4721fb147cb3f5e1$var$ColumnInner","columnRef","if","UnitSelectionPopover","UnitKeyboardNavigation","_allowUnitSelection","UnitSelectionProvider","MacrostratColumnDataProvider","padding","paddingVars","paddingTop","paddingBottom","paddingLeft","paddingRight","unitComponent","UnitComponent","unconformityLabels","showLabels","width","_width","columnWidth","_columnWidth","showLabelColumn","_showLabelColumn","className","clipUnits","showTimescale","timescaleLevels","maxInternalColumns","onMouseOver","useMacrostratColumnData","_timescaleUnconformityLabels","_sectionUnconformityLabels","_showTimescale","$4721fb147cb3f5e1$var$useMouseEventHandlers","_onMouseOver","dispatch","useUnitSelectionDispatch","onClick","evt","useCompositeScale","height","invert","clientY","currentTarget","getBoundingClientRect","top","onMouseOut","undefined","onMouseMove","style","CompositeTimescale","levels","SectionsColumn","darkMode","isEnabled","data","showColumnID","showReferences","col_name","Identifier","col_id","row","label","value","col_group","ReferencesField","refs","inline","Column","ColumnContainer","ColumnBasicInfo"],"version":3,"file":"column-views.56f88b8c.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.dbb4a46b.js";import"./column-views.7f9c7448.js";import{scaleLinear as e}from"d3-scale";import{ColumnAxisType as t}from"@macrostrat/column-components";import{mergeAgeRanges as a,MergeMode as i}from"@macrostrat/stratigraphy-utils";var n=globalThis,l={},r={},o=n.parcelRequirea149;null==o&&((o=function(e){if(e in l)return l[e].exports;if(e in r){var t=r[e];delete r[e];var a={id:e,exports:{}};return l[e]=a,t.call(a.exports,a,a.exports),a.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){r[e]=t},n.parcelRequirea149=o),o.register;var u=o("iWhRv"),s=o("76iYI");function g(e,t=.001){let a=[];for(let t of e)a.push({age:t.t_age,units_below:[t.unit_id],units_above:[]}),a.push({age:t.b_age,units_above:[t.unit_id],units_below:[]});let i=[];for(let e of a){let a=i.find(a=>Math.abs(a.age-e.age)<t);a?(a.units_above.push(...e.units_above),a.units_below.push(...e.units_below)):i.push(e)}return i.sort((e,t)=>e.age-t.age),i.map((e,t)=>({...e,index:t}))}function h(e,t,a,i={}){let n=g(t).filter(e=>e.age<Math.max(...a)&&e.age>Math.min(...a)),l=[{index:-1,age:Math.min(...a),units_above:[],units_below:[]},...n,{index:-1,age:Math.max(...a),units_above:[],units_below:[]}],{type:r,...o}=e;return r===s.HybridScaleType.EquidistantSurfaces?p(l,i):f(l,t,{...i,...o})}function f(n,l,r={}){let{pixelScale:o=1,pixelOffset:g=0,minHeight:h=5,heightMethod:p=s.HeightMethod.Maximum,defaultHeight:c=100}=r,m=function(e,t){let a=[];for(let i=0;i<e.length-1;i++){let n=e[i],l=e[i+1],r=t.filter(e=>e.t_age<=n.age+.001&&e.b_age>=l.age-.001);a.push({t_age:n.age,b_age:l.age,units:r})}return a}(n,l),d=[],b=[],_=g;for(let e of m){_==g&&(d.push(_),b.push(e.t_age));let n=e.units,l=[];for(let r of n){let n=function(e,n,l){let r=(0,u.getUnitHeightRange)(e,t.AGE),o=a([r,[l,n]],i.Inner),s=Math.abs(r[1]-r[0]);return Math.abs(o[1]-o[0])/s}(r,e.t_age,e.b_age),o=function(e,t=s.HeightMethod.Maximum){let a=[];if(e.min_thick,t===s.HeightMethod.Minimum||t===s.HeightMethod.Average){let t=e.min_thick;null!=t&&!isNaN(t)&&t>0&&a.push(t)}if(t===s.HeightMethod.Average||t===s.HeightMethod.Maximum){let t=e.max_thick;null!=t&&!isNaN(t)&&t>0&&a.push(t)}return 0===a.length?null:t===s.HeightMethod.Average?a.reduce((e,t)=>e+t,0)/a.length:a[0]}(r,p);null!=o&&l.push({unit:r,height:o*n})}let r=0;if(0===l.length)r=c;else{let e=l.reduce((e,t)=>e+t.height,0)/l.length;r=0==e?c:e<h?h:e}_+=r,d.push(_),b.push(e.b_age)}let x=d.map(e=>e*o),M=e().domain(b).range(x),H=d.map(e=>_-e),v=e().domain(H).range(x);return{scale:M,pixelScale:null,domain:[b[b.length-1],b[0]],pixelHeight:Math.abs(x[x.length-1]-x[0]),heightScale:v}}function p(t,a={}){let{pixelScale:i=30}=a,n=[t[t.length-1].age,t[0].age],l=t.map((e,t)=>t*i),r=t.map(e=>e.age);return{scale:e().domain(r).range(l),pixelScale:null,domain:n,pixelHeight:Math.abs(l[l.length-1]-l[0])}}export{g as buildColumnSurfaces,h as buildHybridScale,p as buildScaleFromSurfacesSimple,f as buildApproximateHeightScale};
|
|
2
|
+
//# sourceMappingURL=column-views.5a9331a9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,Q,e,C,K,U,A,Q,kB,C,K,+B,A,Q,kB,C,C,a,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,O,A,C,I,E,A,M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AM,CAAG,EAAE,CAAG,AARzC,CAQmD,CAAC,EAAE,CACzE,CACF,Q,K,mB,C,K,gB,C,K,4B,C,K,2B","sources":["<anon>","packages/column-views/src/prepare-units/dynamic-scales.ts"],"sourcesContent":["import \"./column-views.5f3b0b04.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {scaleLinear as $gr21k$scaleLinear} from \"d3-scale\";\nimport {ColumnAxisType as $gr21k$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {mergeAgeRanges as $gr21k$mergeAgeRanges, MergeMode as $gr21k$MergeMode} 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\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $b83252c9fe80810e$export$151c207e6887154c(units, tolerance = 0.001) {\n /** Compute age surfaces for a column based on unit tops and bottoms */ const surfaces = [];\n for (const unit of units){\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [\n unit.unit_id\n ],\n units_above: []\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [\n unit.unit_id\n ],\n units_below: []\n });\n }\n // Merge duplicate surfaces (same age)\n const mergedSurfaces = [];\n for (const surface of surfaces){\n const existingSurface = mergedSurfaces.find((s)=>Math.abs(s.age - surface.age) < tolerance);\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else mergedSurfaces.push(surface);\n }\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b)=>a.age - b.age);\n return mergedSurfaces.map((s, i)=>({\n ...s,\n index: i\n }));\n}\nfunction $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units) {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo = [];\n for(let i = 0; i < surfaces.length - 1; i++){\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit)=>{\n return unit.t_age <= topSurface.age + 0.001 && unit.b_age >= bottomSurface.age - 0.001;\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain\n });\n }\n return domainUnitInfo;\n}\nfunction $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, t_age, b_age) {\n // Compute the proportion of a unit's height that lies within the given age domain\n const rng = (0, $iWhRv.getUnitHeightRange)(unit, (0, $gr21k$ColumnAxisType).AGE);\n const rng1 = [\n b_age,\n t_age\n ];\n // Compute overlap\n const mergedRange = (0, $gr21k$mergeAgeRanges)([\n rng,\n rng1\n ], (0, $gr21k$MergeMode).Inner);\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n return mergedHeight / unitHeight;\n}\nfunction $b83252c9fe80810e$export$6b39f1b6356d94b6(def, units, domain, options = {}) {\n const surfaces = $b83252c9fe80810e$export$151c207e6887154c(units);\n const filteredSurfaces = surfaces.filter((s)=>s.age < Math.max(...domain) && s.age > Math.min(...domain));\n const s1 = [\n {\n index: -1,\n age: Math.min(...domain),\n units_above: [],\n units_below: []\n },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: []\n }\n ];\n const { type: type, ...rest } = def;\n if (type === (0, $76iYI.HybridScaleType).EquidistantSurfaces) return $b83252c9fe80810e$export$d02d2d708a7b495f(s1, options);\n return $b83252c9fe80810e$export$be7a6f1f0a23d12c(s1, units, {\n ...options,\n ...rest\n });\n}\nfunction $b83252c9fe80810e$var$getApproximateHeight(unit, method = (0, $76iYI.HeightMethod).Maximum) {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === (0, $76iYI.HeightMethod).Minimum || method === (0, $76iYI.HeightMethod).Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === (0, $76iYI.HeightMethod).Average || method === (0, $76iYI.HeightMethod).Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (heights.length === 0) return null;\n if (method === (0, $76iYI.HeightMethod).Average) return heights.reduce((sum, h)=>sum + h, 0) / heights.length;\n else return heights[0];\n}\nfunction $b83252c9fe80810e$export$be7a6f1f0a23d12c(surfaces, units, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 1, pixelOffset: pixelOffset = 0, minHeight: minHeight = 5, heightMethod: heightMethod = (0, $76iYI.HeightMethod).Maximum, defaultHeight: // Default height for when height is unknown\n defaultHeight = 100 } = options;\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units);\n // Compute the height in pixels for each surface\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n for (const domain of domainInfo){\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo = [];\n for (const unit of units){\n const proportion = $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, domain.t_age, domain.b_age);\n const height = $b83252c9fe80810e$var$getApproximateHeight(unit, heightMethod);\n if (height != null) unitHeightInfo.push({\n unit: unit,\n height: height * proportion\n });\n }\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) thisHeight = defaultHeight; // Default height if no units with height info\n else {\n // Normalize weights (take the mean)\n const meanHeight = unitHeightInfo.reduce((sum, d)=>sum + d.height, 0) / unitHeightInfo.length;\n if (meanHeight == 0) thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n else if (meanHeight < minHeight) thisHeight = minHeight; // Minimum height\n else thisHeight = meanHeight;\n }\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h)=>h * pixelScale);\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n const heightDomain = surfaceHeights.map((h)=>lastHeight - h);\n const heightScale = (0, $gr21k$scaleLinear)().domain(heightDomain).range(pixelRange);\n const domain = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0]\n ];\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale: heightScale\n };\n}\nfunction $b83252c9fe80810e$export$d02d2d708a7b495f(surfaces, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 30 } = options;\n const domain = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age\n ];\n // Compute the height in pixels for each surface\n const surfaceHeights = surfaces.map((surface, i)=>{\n return i * pixelScale;\n });\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s)=>s.age);\n const pixelRange = surfaceHeights;\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0])\n };\n}\n\n\nexport {$b83252c9fe80810e$export$151c207e6887154c as buildColumnSurfaces, $b83252c9fe80810e$export$6b39f1b6356d94b6 as buildHybridScale, $b83252c9fe80810e$export$d02d2d708a7b495f as buildScaleFromSurfacesSimple, $b83252c9fe80810e$export$be7a6f1f0a23d12c as buildApproximateHeightScale};\n//# sourceMappingURL=column-views.0b3a384e.js.map\n","import type { UnitLong } from \"@macrostrat/api-types\";\nimport { scaleLinear } from \"d3-scale\";\nimport { getUnitHeightRange } from \"./utils\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { mergeAgeRanges, MergeMode } from \"@macrostrat/stratigraphy-utils\";\nimport type {\n ApproxHeightScaleOptions,\n ExtUnit,\n HybridScaleDefinition,\n HybridScaleOptions,\n PackageScaleInfo,\n} from \"./types\";\nimport { HybridScaleType, HeightMethod } from \"./types\";\n\ninterface BaseSurface {\n index: number;\n age: number;\n units_below: number[];\n units_above: number[];\n}\n\nexport function buildColumnSurfaces<T extends UnitLong>(\n units: T[],\n tolerance: number = 0.001,\n): BaseSurface[] {\n /** Compute age surfaces for a column based on unit tops and bottoms */\n const surfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const unit of units) {\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [unit.unit_id],\n units_above: [],\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [unit.unit_id],\n units_below: [],\n });\n }\n\n // Merge duplicate surfaces (same age)\n const mergedSurfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const surface of surfaces) {\n const existingSurface = mergedSurfaces.find(\n (s) => Math.abs(s.age - surface.age) < tolerance,\n );\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else {\n mergedSurfaces.push(surface);\n }\n }\n\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b) => a.age - b.age);\n\n return mergedSurfaces.map((s, i) => ({ ...s, index: i }));\n}\n\ninterface AgeDomainUnitInfo {\n t_age: number;\n b_age: number;\n units: ExtUnit[];\n}\n\nfunction getUnitsInAgeDomains(\n surfaces: BaseSurface[],\n units: ExtUnit[],\n): AgeDomainUnitInfo[] {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo: AgeDomainUnitInfo[] = [];\n for (let i = 0; i < surfaces.length - 1; i++) {\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit) => {\n return (\n unit.t_age <= topSurface.age + 0.001 &&\n unit.b_age >= bottomSurface.age - 0.001\n );\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain,\n });\n }\n return domainUnitInfo;\n}\n\nfunction proportionOfUnitInDomain(\n unit: ExtUnit,\n t_age: number,\n b_age: number,\n): number {\n // Compute the proportion of a unit's height that lies within the given age domain\n\n const rng = getUnitHeightRange(unit, ColumnAxisType.AGE);\n const rng1: [number, number] = [b_age, t_age];\n // Compute overlap\n\n const mergedRange = mergeAgeRanges([rng, rng1], MergeMode.Inner);\n\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n\n return mergedHeight / unitHeight;\n}\n\nexport function buildHybridScale<T extends UnitLong>(\n def: HybridScaleDefinition,\n units: T[],\n domain: [number, number],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n const surfaces = buildColumnSurfaces(units);\n\n const filteredSurfaces = surfaces.filter(\n (s) => s.age < Math.max(...domain) && s.age > Math.min(...domain),\n );\n\n const s1 = [\n { index: -1, age: Math.min(...domain), units_above: [], units_below: [] },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: [],\n },\n ];\n\n const { type, ...rest } = def;\n\n if (type === HybridScaleType.EquidistantSurfaces) {\n return buildScaleFromSurfacesSimple(s1, options);\n }\n\n return buildApproximateHeightScale(s1, units, { ...options, ...rest });\n}\n\nfunction getApproximateHeight(\n unit: ExtUnit,\n method: HeightMethod = HeightMethod.Maximum,\n): number | null {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === HeightMethod.Minimum || method === HeightMethod.Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === HeightMethod.Average || method === HeightMethod.Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n\n if (heights.length === 0) return null;\n\n if (method === HeightMethod.Average) {\n return heights.reduce((sum, h) => sum + h, 0) / heights.length;\n } else {\n return heights[0];\n }\n}\n\nexport function buildApproximateHeightScale(\n surfaces: BaseSurface[],\n units: UnitLong[],\n options: HybridScaleOptions & ApproxHeightScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const {\n pixelScale = 1, // pixels per meter\n pixelOffset = 0,\n minHeight = 5,\n heightMethod = HeightMethod.Maximum,\n // Default height for when height is unknown\n defaultHeight = 100,\n } = options;\n\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = getUnitsInAgeDomains(surfaces, units as ExtUnit[]);\n\n // Compute the height in pixels for each surface\n\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n\n for (const domain of domainInfo) {\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo: { unit: ExtUnit; height: number }[] = [];\n\n for (const unit of units) {\n const proportion = proportionOfUnitInDomain(\n unit,\n domain.t_age,\n domain.b_age,\n );\n const height = getApproximateHeight(unit, heightMethod);\n if (height != null) {\n unitHeightInfo.push({ unit, height: height * proportion });\n }\n }\n\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) {\n thisHeight = defaultHeight; // Default height if no units with height info\n } else {\n // Normalize weights (take the mean)\n\n const meanHeight =\n unitHeightInfo.reduce((sum, d) => sum + d.height, 0) /\n unitHeightInfo.length;\n\n if (meanHeight == 0) {\n thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n } else if (meanHeight < minHeight) {\n thisHeight = minHeight; // Minimum height\n } else {\n thisHeight = meanHeight;\n }\n }\n\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h) => h * pixelScale);\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n const heightDomain = surfaceHeights.map((h) => lastHeight - h);\n\n const heightScale = scaleLinear().domain(heightDomain).range(pixelRange);\n\n const domain: [number, number] = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0],\n ];\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale,\n };\n}\n\nexport function buildScaleFromSurfacesSimple(\n surfaces: BaseSurface[],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const { pixelScale = 30 } = options;\n\n const domain: [number, number] = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age,\n ];\n // Compute the height in pixels for each surface\n\n const surfaceHeights = surfaces.map((surface, i) => {\n return i * pixelScale;\n });\n\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s) => s.age);\n const pixelRange = surfaceHeights;\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n };\n}\n"],"names":["scaleLinear","$gr21k$scaleLinear","ColumnAxisType","$gr21k$ColumnAxisType","mergeAgeRanges","$gr21k$mergeAgeRanges","MergeMode","$gr21k$MergeMode","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$76iYI","$b83252c9fe80810e$export$151c207e6887154c","units","tolerance","surfaces","unit","push","age","t_age","units_below","unit_id","units_above","b_age","mergedSurfaces","surface","existingSurface","find","s","Math","abs","sort","a","b","map","i","index","$b83252c9fe80810e$export$6b39f1b6356d94b6","def","domain","options","filteredSurfaces","filter","max","min","s1","type","rest","HybridScaleType","EquidistantSurfaces","$b83252c9fe80810e$export$d02d2d708a7b495f","$b83252c9fe80810e$export$be7a6f1f0a23d12c","pixelScale","pixelOffset","minHeight","heightMethod","HeightMethod","Maximum","defaultHeight","domainInfo","$b83252c9fe80810e$var$getUnitsInAgeDomains","domainUnitInfo","length","topSurface","bottomSurface","unitsInDomain","surfaceHeights","ageDomain","lastHeight","unitHeightInfo","proportion","$b83252c9fe80810e$var$proportionOfUnitInDomain","rng","getUnitHeightRange","AGE","mergedRange","Inner","unitHeight","mergedHeight","height","$b83252c9fe80810e$var$getApproximateHeight","method","heights","min_thick","Minimum","Average","h","isNaN","max_thick","reduce","sum","thisHeight","meanHeight","d","pixelRange","scale","range","heightDomain","heightScale","pixelHeight","buildColumnSurfaces","buildHybridScale","buildScaleFromSurfacesSimple","buildApproximateHeightScale"],"version":3,"file":"column-views.0b3a384e.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,Q,e,C,K,U,A,Q,kB,C,K,+B,A,Q,kB,C,C,a,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,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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mB,C,K,gB,C,K,4B,C,K,2B","sources":["<anon>","packages/column-views/src/prepare-units/dynamic-scales.ts"],"sourcesContent":["import \"./column-views.dbb4a46b.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {scaleLinear as $gr21k$scaleLinear} from \"d3-scale\";\nimport {ColumnAxisType as $gr21k$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {mergeAgeRanges as $gr21k$mergeAgeRanges, MergeMode as $gr21k$MergeMode} 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\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $b83252c9fe80810e$export$151c207e6887154c(units, tolerance = 0.001) {\n /** Compute age surfaces for a column based on unit tops and bottoms */ const surfaces = [];\n for (const unit of units){\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [\n unit.unit_id\n ],\n units_above: []\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [\n unit.unit_id\n ],\n units_below: []\n });\n }\n // Merge duplicate surfaces (same age)\n const mergedSurfaces = [];\n for (const surface of surfaces){\n const existingSurface = mergedSurfaces.find((s)=>Math.abs(s.age - surface.age) < tolerance);\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else mergedSurfaces.push(surface);\n }\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b)=>a.age - b.age);\n return mergedSurfaces.map((s, i)=>({\n ...s,\n index: i\n }));\n}\nfunction $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units) {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo = [];\n for(let i = 0; i < surfaces.length - 1; i++){\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit)=>{\n return unit.t_age <= topSurface.age + 0.001 && unit.b_age >= bottomSurface.age - 0.001;\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain\n });\n }\n return domainUnitInfo;\n}\nfunction $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, t_age, b_age) {\n // Compute the proportion of a unit's height that lies within the given age domain\n const rng = (0, $iWhRv.getUnitHeightRange)(unit, (0, $gr21k$ColumnAxisType).AGE);\n const rng1 = [\n b_age,\n t_age\n ];\n // Compute overlap\n const mergedRange = (0, $gr21k$mergeAgeRanges)([\n rng,\n rng1\n ], (0, $gr21k$MergeMode).Inner);\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n return mergedHeight / unitHeight;\n}\nfunction $b83252c9fe80810e$export$6b39f1b6356d94b6(def, units, domain, options = {}) {\n const surfaces = $b83252c9fe80810e$export$151c207e6887154c(units);\n const filteredSurfaces = surfaces.filter((s)=>s.age < Math.max(...domain) && s.age > Math.min(...domain));\n const s1 = [\n {\n index: -1,\n age: Math.min(...domain),\n units_above: [],\n units_below: []\n },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: []\n }\n ];\n const { type: type, ...rest } = def;\n if (type === (0, $76iYI.HybridScaleType).EquidistantSurfaces) return $b83252c9fe80810e$export$d02d2d708a7b495f(s1, options);\n return $b83252c9fe80810e$export$be7a6f1f0a23d12c(s1, units, {\n ...options,\n ...rest\n });\n}\nfunction $b83252c9fe80810e$var$getApproximateHeight(unit, method = (0, $76iYI.HeightMethod).Maximum) {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === (0, $76iYI.HeightMethod).Minimum || method === (0, $76iYI.HeightMethod).Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === (0, $76iYI.HeightMethod).Average || method === (0, $76iYI.HeightMethod).Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (heights.length === 0) return null;\n if (method === (0, $76iYI.HeightMethod).Average) return heights.reduce((sum, h)=>sum + h, 0) / heights.length;\n else return heights[0];\n}\nfunction $b83252c9fe80810e$export$be7a6f1f0a23d12c(surfaces, units, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 1, pixelOffset: pixelOffset = 0, minHeight: minHeight = 5, heightMethod: heightMethod = (0, $76iYI.HeightMethod).Maximum, defaultHeight: // Default height for when height is unknown\n defaultHeight = 100 } = options;\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units);\n // Compute the height in pixels for each surface\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n for (const domain of domainInfo){\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo = [];\n for (const unit of units){\n const proportion = $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, domain.t_age, domain.b_age);\n const height = $b83252c9fe80810e$var$getApproximateHeight(unit, heightMethod);\n if (height != null) unitHeightInfo.push({\n unit: unit,\n height: height * proportion\n });\n }\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) thisHeight = defaultHeight; // Default height if no units with height info\n else {\n // Normalize weights (take the mean)\n const meanHeight = unitHeightInfo.reduce((sum, d)=>sum + d.height, 0) / unitHeightInfo.length;\n if (meanHeight == 0) thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n else if (meanHeight < minHeight) thisHeight = minHeight; // Minimum height\n else thisHeight = meanHeight;\n }\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h)=>h * pixelScale);\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n const heightDomain = surfaceHeights.map((h)=>lastHeight - h);\n const heightScale = (0, $gr21k$scaleLinear)().domain(heightDomain).range(pixelRange);\n const domain = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0]\n ];\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale: heightScale\n };\n}\nfunction $b83252c9fe80810e$export$d02d2d708a7b495f(surfaces, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 30 } = options;\n const domain = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age\n ];\n // Compute the height in pixels for each surface\n const surfaceHeights = surfaces.map((surface, i)=>{\n return i * pixelScale;\n });\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s)=>s.age);\n const pixelRange = surfaceHeights;\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0])\n };\n}\n\n\nexport {$b83252c9fe80810e$export$151c207e6887154c as buildColumnSurfaces, $b83252c9fe80810e$export$6b39f1b6356d94b6 as buildHybridScale, $b83252c9fe80810e$export$d02d2d708a7b495f as buildScaleFromSurfacesSimple, $b83252c9fe80810e$export$be7a6f1f0a23d12c as buildApproximateHeightScale};\n//# sourceMappingURL=column-views.5a9331a9.js.map\n","import type { UnitLong } from \"@macrostrat/api-types\";\nimport { scaleLinear } from \"d3-scale\";\nimport { getUnitHeightRange } from \"./utils\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { mergeAgeRanges, MergeMode } from \"@macrostrat/stratigraphy-utils\";\nimport type {\n ApproxHeightScaleOptions,\n ExtUnit,\n HybridScaleDefinition,\n HybridScaleOptions,\n PackageScaleInfo,\n} from \"./types\";\nimport { HybridScaleType, HeightMethod } from \"./types\";\n\ninterface BaseSurface {\n index: number;\n age: number;\n units_below: number[];\n units_above: number[];\n}\n\nexport function buildColumnSurfaces<T extends UnitLong>(\n units: T[],\n tolerance: number = 0.001,\n): BaseSurface[] {\n /** Compute age surfaces for a column based on unit tops and bottoms */\n const surfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const unit of units) {\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [unit.unit_id],\n units_above: [],\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [unit.unit_id],\n units_below: [],\n });\n }\n\n // Merge duplicate surfaces (same age)\n const mergedSurfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const surface of surfaces) {\n const existingSurface = mergedSurfaces.find(\n (s) => Math.abs(s.age - surface.age) < tolerance,\n );\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else {\n mergedSurfaces.push(surface);\n }\n }\n\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b) => a.age - b.age);\n\n return mergedSurfaces.map((s, i) => ({ ...s, index: i }));\n}\n\ninterface AgeDomainUnitInfo {\n t_age: number;\n b_age: number;\n units: ExtUnit[];\n}\n\nfunction getUnitsInAgeDomains(\n surfaces: BaseSurface[],\n units: ExtUnit[],\n): AgeDomainUnitInfo[] {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo: AgeDomainUnitInfo[] = [];\n for (let i = 0; i < surfaces.length - 1; i++) {\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit) => {\n return (\n unit.t_age <= topSurface.age + 0.001 &&\n unit.b_age >= bottomSurface.age - 0.001\n );\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain,\n });\n }\n return domainUnitInfo;\n}\n\nfunction proportionOfUnitInDomain(\n unit: ExtUnit,\n t_age: number,\n b_age: number,\n): number {\n // Compute the proportion of a unit's height that lies within the given age domain\n\n const rng = getUnitHeightRange(unit, ColumnAxisType.AGE);\n const rng1: [number, number] = [b_age, t_age];\n // Compute overlap\n\n const mergedRange = mergeAgeRanges([rng, rng1], MergeMode.Inner);\n\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n\n return mergedHeight / unitHeight;\n}\n\nexport function buildHybridScale<T extends UnitLong>(\n def: HybridScaleDefinition,\n units: T[],\n domain: [number, number],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n const surfaces = buildColumnSurfaces(units);\n\n const filteredSurfaces = surfaces.filter(\n (s) => s.age < Math.max(...domain) && s.age > Math.min(...domain),\n );\n\n const s1 = [\n { index: -1, age: Math.min(...domain), units_above: [], units_below: [] },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: [],\n },\n ];\n\n const { type, ...rest } = def;\n\n if (type === HybridScaleType.EquidistantSurfaces) {\n return buildScaleFromSurfacesSimple(s1, options);\n }\n\n return buildApproximateHeightScale(s1, units, { ...options, ...rest });\n}\n\nfunction getApproximateHeight(\n unit: ExtUnit,\n method: HeightMethod = HeightMethod.Maximum,\n): number | null {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === HeightMethod.Minimum || method === HeightMethod.Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === HeightMethod.Average || method === HeightMethod.Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n\n if (heights.length === 0) return null;\n\n if (method === HeightMethod.Average) {\n return heights.reduce((sum, h) => sum + h, 0) / heights.length;\n } else {\n return heights[0];\n }\n}\n\nexport function buildApproximateHeightScale(\n surfaces: BaseSurface[],\n units: UnitLong[],\n options: HybridScaleOptions & ApproxHeightScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const {\n pixelScale = 1, // pixels per meter\n pixelOffset = 0,\n minHeight = 5,\n heightMethod = HeightMethod.Maximum,\n // Default height for when height is unknown\n defaultHeight = 100,\n } = options;\n\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = getUnitsInAgeDomains(surfaces, units as ExtUnit[]);\n\n // Compute the height in pixels for each surface\n\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n\n for (const domain of domainInfo) {\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo: { unit: ExtUnit; height: number }[] = [];\n\n for (const unit of units) {\n const proportion = proportionOfUnitInDomain(\n unit,\n domain.t_age,\n domain.b_age,\n );\n const height = getApproximateHeight(unit, heightMethod);\n if (height != null) {\n unitHeightInfo.push({ unit, height: height * proportion });\n }\n }\n\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) {\n thisHeight = defaultHeight; // Default height if no units with height info\n } else {\n // Normalize weights (take the mean)\n\n const meanHeight =\n unitHeightInfo.reduce((sum, d) => sum + d.height, 0) /\n unitHeightInfo.length;\n\n if (meanHeight == 0) {\n thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n } else if (meanHeight < minHeight) {\n thisHeight = minHeight; // Minimum height\n } else {\n thisHeight = meanHeight;\n }\n }\n\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h) => h * pixelScale);\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n const heightDomain = surfaceHeights.map((h) => lastHeight - h);\n\n const heightScale = scaleLinear().domain(heightDomain).range(pixelRange);\n\n const domain: [number, number] = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0],\n ];\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale,\n };\n}\n\nexport function buildScaleFromSurfacesSimple(\n surfaces: BaseSurface[],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const { pixelScale = 30 } = options;\n\n const domain: [number, number] = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age,\n ];\n // Compute the height in pixels for each surface\n\n const surfaceHeights = surfaces.map((surface, i) => {\n return i * pixelScale;\n });\n\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s) => s.age);\n const pixelRange = surfaceHeights;\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n };\n}\n"],"names":["scaleLinear","$gr21k$scaleLinear","ColumnAxisType","$gr21k$ColumnAxisType","mergeAgeRanges","$gr21k$mergeAgeRanges","MergeMode","$gr21k$MergeMode","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$76iYI","$b83252c9fe80810e$export$151c207e6887154c","units","tolerance","surfaces","unit","push","age","t_age","units_below","unit_id","units_above","b_age","mergedSurfaces","surface","existingSurface","find","s","Math","abs","sort","a","b","map","i","index","$b83252c9fe80810e$export$6b39f1b6356d94b6","def","domain","options","filteredSurfaces","filter","max","min","s1","type","rest","HybridScaleType","EquidistantSurfaces","$b83252c9fe80810e$export$d02d2d708a7b495f","$b83252c9fe80810e$export$be7a6f1f0a23d12c","pixelScale","pixelOffset","minHeight","heightMethod","HeightMethod","Maximum","defaultHeight","domainInfo","$b83252c9fe80810e$var$getUnitsInAgeDomains","domainUnitInfo","length","topSurface","bottomSurface","unitsInDomain","surfaceHeights","ageDomain","lastHeight","unitHeightInfo","proportion","$b83252c9fe80810e$var$proportionOfUnitInDomain","rng","getUnitHeightRange","AGE","mergedRange","Inner","unitHeight","mergedHeight","height","$b83252c9fe80810e$var$getApproximateHeight","method","heights","min_thick","Minimum","Average","h","isNaN","max_thick","reduce","sum","thisHeight","meanHeight","d","pixelRange","scale","range","heightDomain","heightScale","pixelHeight","buildColumnSurfaces","buildHybridScale","buildScaleFromSurfacesSimple","buildApproximateHeightScale"],"version":3,"file":"column-views.5a9331a9.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./column-views.af480651.js";import"./column-views.a230263f.js";import"./column-views.7c322202.js";import"./column-views.b103acbc.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 c=Error("Cannot find module '"+e+"'");throw c.code="MODULE_NOT_FOUND",c}).register=function(e,a){r[e]=a},a.parcelRequirea149=o),o.register;var c={},s=o("3S9SB"),f=o("7kahb"),b=o("28PcI"),$=o("2koQo");e(c,s),e(c,f),e(c,b),e(c,$);export{$ea2f112131e22f14$export$554267114407ef68 as PBDBFossilsColumn,$8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType,$8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType,$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.5cb51833.js.map
|
|
@@ -0,0 +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,c,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.af480651.js\";\nimport \"./column-views.a230263f.js\";\nimport \"./column-views.7c322202.js\";\nimport \"./column-views.b103acbc.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$a990c76b38782f57 as FossilDataType, $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.5cb51833.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","$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.5cb51833.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./column-views.021a6961.js";import"./column-views.a596b1f5.js";import"./column-views.dbb4a46b.js";import"./column-views.7f9c7448.js";import{ColumnAxisType as e}from"@macrostrat/column-components";import{useMemo as t}from"react";function o(e,t){return Object.keys(t).forEach(function(o){"default"===o||"__esModule"===o||Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[o]}})}),e}function a(e,t,o,a){Object.defineProperty(e,t,{get:o,set:a,enumerable:!0,configurable:!0})}var r=globalThis,n={},s={},i=r.parcelRequirea149;null==i&&((i=function(e){if(e in n)return n[e].exports;if(e in s){var t=s[e];delete s[e];var o={id:e,exports:{}};return n[e]=o,t.call(o.exports,o,o.exports),o.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){s[e]=t},r.parcelRequirea149=i),i.register;var c={};a(c,"usePreparedColumnUnits",()=>b),a(c,"prepareColumnUnits",()=>m),a(c,"preprocessUnits",()=>i("ickj2").preprocessUnits);var p=i("ickj2"),l=i("bBAza"),f=i("iWhRv"),u=i("76iYI");function b(e,o){return t(()=>m(e,o),[e,...Object.values(o)])}function m(t,o){let a,{t_age:r,b_age:n,t_pos:s,b_pos:i}=o,{mergeSections:c=f.MergeSectionsMode.OVERLAPPING,axisType:u,unconformityHeight:b,collapseSmallUnconformities:m=!1,hybridScale:g,scale:$}=o,d=null;if(null!=$){let t=$.domain();u==e.AGE?(null==r&&(r=Math.min(...t)),null==n&&(n=Math.max(...t)),d=Math.abs($(n)-$(r))):(null==s&&(s=Math.min(...t)),null==i&&(i=Math.max(...t)),d=Math.abs($(i)-$(s)))}let _=t.map(p.preprocessSectionUnit);if(_=_.filter(t=>u==e.AGE?(0,f.agesOverlap)(t,{t_age:r,b_age:n}):(0,f.unitsOverlap)(t,{t_pos:s,b_pos:i},u)),c==f.MergeSectionsMode.ALL){let[e,t]=(0,p.getSectionPosRange)(_,u),[o,r]=(0,p.getSectionAgeRange)(_);a=[{section_id:0,t_pos:t,b_pos:e,t_age:r,b_age:o,units:_}]}else a=u==e.AGE?(0,p.groupUnitsIntoSectionsBySectionID)(_,u):(0,p.groupUnitsIntoSectionsByOverlap)(_,u);for(let t of a)u==e.AGE?(t.t_age=Math.max(t.t_age,r??-1/0),t.b_age=Math.min(t.b_age,n??1/0)):u==e.DEPTH?(t.t_pos=Math.max(t.t_pos,s??-1/0),t.b_pos=Math.min(t.b_pos,i??1/0)):u==e.HEIGHT&&(t.t_pos=Math.max(t.t_pos,s??-1/0),t.b_pos=Math.min(t.b_pos,i??1/0));let h=a;c==f.MergeSectionsMode.OVERLAPPING&&u==e.AGE&&(h=(0,p.mergeOverlappingSections)(h)),h=h.filter(e=>null!=e);let x=(0,l.computeSectionHeights)(h,o);if(m&&null==g){let e=b??30;"number"==typeof m&&(e=m),x=(0,l.collapseUnconformitiesByPixelHeight)(x,e,o)}let{totalHeight:M,sections:S}=(0,l.finalizeSectionHeights)(x,b),H=S.map(e=>({...e,units:(0,p.preprocessUnits)(e,u)}));return{units:H.reduce((e,t)=>{let{units:o}=t;for(let t of o)e.push(t);return e},[]),totalHeight:d??M,sections:H}}o(c,f),o(c,u);export{b as usePreparedColumnUnits,m as prepareColumnUnits,$57278f42f24b59e5$export$55543e159517d62d as preprocessUnits,$f811753598b339f3$export$e1644389ce074058 as MergeSectionsMode,$f811753598b339f3$export$f1a15f539858307 as unitsOverlap,$f811753598b339f3$export$70e712e2ac0237a as getUnitHeightRange,$f811753598b339f3$export$d92a67740c050efb as agesOverlap,$f811753598b339f3$export$441710fb21b4ae09 as getPositionWithinUnit,$f811753598b339f3$export$ab14c04795685c55 as createUnitSorter,$f811753598b339f3$export$d0c8ecbd4ed8940c as ensureArray,$f811753598b339f3$export$97de5b0a6b4e4dac as ensureRealFloat,$6a8fb6360a4f5dac$export$45e8e2d7a1794c23 as HybridScaleType,$6a8fb6360a4f5dac$export$e40aae6f0de9bb95 as HeightMethod};
|
|
2
|
+
//# sourceMappingURL=column-views.5fd6e11a.js.map
|