@macrostrat/column-views 2.4.2 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/esm/{column-views.af4278f0.js → column-views.0abf7e10.js} +11 -5
- package/dist/esm/column-views.0abf7e10.js.map +1 -0
- package/dist/esm/{column-views.1b5bf0c6.js → column-views.0b3c0d18.js} +5 -2
- package/dist/esm/column-views.0b3c0d18.js.map +1 -0
- package/dist/esm/{column-views.88b2418b.js → column-views.0ed9da35.js} +3 -3
- package/dist/esm/{column-views.88b2418b.js.map → column-views.0ed9da35.js.map} +1 -1
- package/dist/esm/{column-views.82eb5026.js → column-views.0faf79a9.js} +3 -3
- package/dist/esm/{column-views.82eb5026.js.map → column-views.0faf79a9.js.map} +1 -1
- package/dist/esm/{column-views.8ce33ec6.js → column-views.19539293.js} +2 -2
- package/dist/esm/{column-views.8ce33ec6.js.map → column-views.19539293.js.map} +1 -1
- package/dist/esm/{column-views.ce5251f7.js → column-views.1af3ec1f.js} +2 -2
- package/dist/esm/{column-views.ce5251f7.js.map → column-views.1af3ec1f.js.map} +1 -1
- package/dist/esm/{column-views.1ef55568.js → column-views.2a0010a3.js} +3 -3
- package/dist/esm/{column-views.1ef55568.js.map → column-views.2a0010a3.js.map} +1 -1
- package/dist/esm/{column-views.f35c4621.js → column-views.334c3947.js} +2 -2
- package/dist/esm/{column-views.f35c4621.js.map → column-views.334c3947.js.map} +1 -1
- package/dist/esm/{column-views.c93b63db.js → column-views.337b40a2.js} +3 -3
- package/dist/esm/{column-views.c93b63db.js.map → column-views.337b40a2.js.map} +1 -1
- package/dist/esm/{column-views.633c42a3.js → column-views.33d35a44.js} +25 -3
- package/dist/esm/column-views.33d35a44.js.map +1 -0
- package/dist/esm/{column-views.c1e507e6.js → column-views.362aae9a.js} +2 -2
- package/dist/esm/{column-views.c1e507e6.js.map → column-views.362aae9a.js.map} +1 -1
- package/dist/esm/{column-views.083fb787.js → column-views.4252a555.js} +5 -5
- package/dist/esm/{column-views.083fb787.js.map → column-views.4252a555.js.map} +1 -1
- package/dist/esm/{column-views.99cb1c41.js → column-views.45c70ba4.js} +3 -3
- package/dist/esm/{column-views.99cb1c41.js.map → column-views.45c70ba4.js.map} +1 -1
- package/dist/esm/{column-views.40d3688c.js → column-views.47b7d9ca.js} +2 -2
- package/dist/esm/{column-views.40d3688c.js.map → column-views.47b7d9ca.js.map} +1 -1
- package/dist/esm/{column-views.b4e1236d.js → column-views.47ca059d.js} +3 -3
- package/dist/esm/column-views.47ca059d.js.map +1 -0
- package/dist/esm/{column-views.3090f246.js → column-views.636d6553.js} +2 -2
- package/dist/esm/{column-views.3090f246.js.map → column-views.636d6553.js.map} +1 -1
- package/dist/esm/{column-views.a94e99a2.js → column-views.64f6ddd3.js} +2 -2
- package/dist/esm/{column-views.a94e99a2.js.map → column-views.64f6ddd3.js.map} +1 -1
- package/dist/esm/{column-views.88436022.js → column-views.6519a353.js} +2 -2
- package/dist/esm/{column-views.88436022.js.map → column-views.6519a353.js.map} +1 -1
- package/dist/esm/{column-views.18655508.js → column-views.6cff6659.js} +4 -4
- package/dist/esm/{column-views.18655508.js.map → column-views.6cff6659.js.map} +1 -1
- package/dist/esm/{column-views.fedccce9.js → column-views.70387120.js} +2 -2
- package/dist/esm/{column-views.fedccce9.js.map → column-views.70387120.js.map} +1 -1
- package/dist/esm/{column-views.3ae8f23d.js → column-views.74837922.js} +2 -2
- package/dist/esm/{column-views.3ae8f23d.js.map → column-views.74837922.js.map} +1 -1
- package/dist/esm/{column-views.e885211d.js → column-views.7bfb4318.js} +2 -2
- package/dist/esm/{column-views.e885211d.js.map → column-views.7bfb4318.js.map} +1 -1
- package/dist/esm/{column-views.f56e604d.js → column-views.7dc53f1b.js} +4 -4
- package/dist/esm/{column-views.f56e604d.js.map → column-views.7dc53f1b.js.map} +1 -1
- package/dist/esm/{column-views.ab2cc6cb.js → column-views.85df21ec.js} +11 -10
- package/dist/esm/column-views.85df21ec.js.map +1 -0
- package/dist/esm/{column-views.4e9b8594.js → column-views.87c589b7.js} +2 -2
- package/dist/esm/{column-views.4e9b8594.js.map → column-views.87c589b7.js.map} +1 -1
- package/dist/esm/{column-views.77322764.js → column-views.8da2b857.js} +2 -2
- package/dist/esm/{column-views.77322764.js.map → column-views.8da2b857.js.map} +1 -1
- package/dist/esm/{column-views.b957dc19.js → column-views.8fb37de7.js} +2 -2
- package/dist/esm/{column-views.b957dc19.js.map → column-views.8fb37de7.js.map} +1 -1
- package/dist/esm/{column-views.91c18fe3.js → column-views.9512c5d5.js} +10 -10
- package/dist/esm/{column-views.91c18fe3.js.map → column-views.9512c5d5.js.map} +1 -1
- package/dist/esm/{column-views.85d57d04.js → column-views.9905b91c.js} +4 -4
- package/dist/esm/{column-views.85d57d04.js.map → column-views.9905b91c.js.map} +1 -1
- package/dist/esm/{column-views.275ba52b.js → column-views.a4f394fe.js} +2 -2
- package/dist/esm/{column-views.275ba52b.js.map → column-views.a4f394fe.js.map} +1 -1
- package/dist/esm/{column-views.6f0d4f3a.js → column-views.b7cf0da2.js} +2 -2
- package/dist/esm/{column-views.6f0d4f3a.js.map → column-views.b7cf0da2.js.map} +1 -1
- package/dist/esm/{column-views.d4e50f74.js → column-views.c47dba5f.js} +3 -3
- package/dist/esm/{column-views.d4e50f74.js.map → column-views.c47dba5f.js.map} +1 -1
- package/dist/esm/{column-views.5ec7294d.js → column-views.c750a6df.js} +3 -3
- package/dist/esm/{column-views.5ec7294d.js.map → column-views.c750a6df.js.map} +1 -1
- package/dist/esm/{column-views.fc4860bd.js → column-views.cb1cc9f2.js} +4 -4
- package/dist/esm/{column-views.fc4860bd.js.map → column-views.cb1cc9f2.js.map} +1 -1
- package/dist/esm/{column-views.f904e6d7.js → column-views.ce000969.js} +3 -3
- package/dist/esm/{column-views.f904e6d7.js.map → column-views.ce000969.js.map} +1 -1
- package/dist/esm/{column-views.ee2fd38f.js → column-views.d7740949.js} +3 -3
- package/dist/esm/{column-views.ee2fd38f.js.map → column-views.d7740949.js.map} +1 -1
- package/dist/esm/{column-views.088a0274.js → column-views.d7e6bf67.js} +2 -2
- package/dist/esm/{column-views.088a0274.js.map → column-views.d7e6bf67.js.map} +1 -1
- package/dist/esm/{column-views.e6882667.js → column-views.dac0a3bb.js} +5 -5
- package/dist/esm/{column-views.e6882667.js.map → column-views.dac0a3bb.js.map} +1 -1
- package/dist/esm/{column-views.11353c2c.js → column-views.e13a0a76.js} +4 -4
- package/dist/esm/{column-views.11353c2c.js.map → column-views.e13a0a76.js.map} +1 -1
- package/dist/esm/{column-views.5e830e7c.js → column-views.ea08f667.js} +8 -8
- package/dist/esm/{column-views.5e830e7c.js.map → column-views.ea08f667.js.map} +1 -1
- package/dist/esm/{column-views.dd2d5a6d.js → column-views.ebb5f280.js} +5 -5
- package/dist/esm/{column-views.dd2d5a6d.js.map → column-views.ebb5f280.js.map} +1 -1
- package/dist/esm/{column-views.bc83a85d.js → column-views.fe42d2fc.js} +2 -2
- package/dist/esm/{column-views.bc83a85d.js.map → column-views.fe42d2fc.js.map} +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/node/column-views.048fdcaf.js +2 -0
- package/dist/node/column-views.048fdcaf.js.map +1 -0
- package/dist/node/{column-views.796fc1de.js → column-views.04a72b35.js} +2 -2
- package/dist/node/{column-views.796fc1de.js.map → column-views.04a72b35.js.map} +1 -1
- package/dist/node/{column-views.66663668.js → column-views.0af5912d.js} +2 -2
- package/dist/node/{column-views.66663668.js.map → column-views.0af5912d.js.map} +1 -1
- package/dist/node/{column-views.eecdc727.js → column-views.0d254fd3.js} +2 -2
- package/dist/node/{column-views.eecdc727.js.map → column-views.0d254fd3.js.map} +1 -1
- package/dist/node/{column-views.54f7a243.js → column-views.109cb0c8.js} +2 -2
- package/dist/node/{column-views.54f7a243.js.map → column-views.109cb0c8.js.map} +1 -1
- package/dist/node/column-views.133855e6.js +2 -0
- package/dist/node/column-views.133855e6.js.map +1 -0
- package/dist/node/{column-views.f4063bc8.js → column-views.15b5cecc.js} +2 -2
- package/dist/node/{column-views.f4063bc8.js.map → column-views.15b5cecc.js.map} +1 -1
- package/dist/node/{column-views.6f0cb059.js → column-views.183745c0.js} +2 -2
- package/dist/node/{column-views.6f0cb059.js.map → column-views.183745c0.js.map} +1 -1
- package/dist/node/{column-views.080781ca.js → column-views.2e2158f5.js} +2 -2
- package/dist/node/{column-views.080781ca.js.map → column-views.2e2158f5.js.map} +1 -1
- package/dist/node/{column-views.f93b4175.js → column-views.306acd3f.js} +2 -2
- package/dist/node/{column-views.f93b4175.js.map → column-views.306acd3f.js.map} +1 -1
- package/dist/node/{column-views.0818254f.js → column-views.31153f29.js} +2 -2
- package/dist/node/{column-views.0818254f.js.map → column-views.31153f29.js.map} +1 -1
- package/dist/node/{column-views.6051e986.js → column-views.31da008b.js} +2 -2
- package/dist/node/{column-views.6051e986.js.map → column-views.31da008b.js.map} +1 -1
- package/dist/node/column-views.40e758b3.js +2 -0
- package/dist/node/column-views.40e758b3.js.map +1 -0
- package/dist/node/{column-views.ffbffec7.js → column-views.4a28d695.js} +2 -2
- package/dist/node/{column-views.ffbffec7.js.map → column-views.4a28d695.js.map} +1 -1
- package/dist/node/{column-views.4d8fc443.js → column-views.5950c8eb.js} +2 -2
- package/dist/node/{column-views.4d8fc443.js.map → column-views.5950c8eb.js.map} +1 -1
- package/dist/node/{column-views.d30231cb.js → column-views.5987bc26.js} +2 -2
- package/dist/node/{column-views.d30231cb.js.map → column-views.5987bc26.js.map} +1 -1
- package/dist/node/{column-views.784bac2a.js → column-views.5bb858c9.js} +2 -2
- package/dist/node/{column-views.784bac2a.js.map → column-views.5bb858c9.js.map} +1 -1
- package/dist/node/{column-views.fe7a5452.js → column-views.5cbada24.js} +2 -2
- package/dist/node/{column-views.fe7a5452.js.map → column-views.5cbada24.js.map} +1 -1
- package/dist/node/{column-views.8c00beb4.js → column-views.5fcd2be6.js} +2 -2
- package/dist/node/{column-views.8c00beb4.js.map → column-views.5fcd2be6.js.map} +1 -1
- package/dist/node/{column-views.bdf05ed4.js → column-views.78b2d234.js} +2 -2
- package/dist/node/{column-views.bdf05ed4.js.map → column-views.78b2d234.js.map} +1 -1
- package/dist/node/{column-views.5908556a.js → column-views.8bee789c.js} +2 -2
- package/dist/node/{column-views.5908556a.js.map → column-views.8bee789c.js.map} +1 -1
- package/dist/node/{column-views.18e86c2d.js → column-views.90c36c0b.js} +2 -2
- package/dist/node/{column-views.18e86c2d.js.map → column-views.90c36c0b.js.map} +1 -1
- package/dist/node/{column-views.87d31e0a.js → column-views.a2476e39.js} +2 -2
- package/dist/node/{column-views.87d31e0a.js.map → column-views.a2476e39.js.map} +1 -1
- package/dist/node/{column-views.39b71a38.js → column-views.a8f5ee28.js} +2 -2
- package/dist/node/{column-views.39b71a38.js.map → column-views.a8f5ee28.js.map} +1 -1
- package/dist/node/{column-views.5f3f8ccf.js → column-views.ad60c02f.js} +2 -2
- package/dist/node/{column-views.5f3f8ccf.js.map → column-views.ad60c02f.js.map} +1 -1
- package/dist/node/{column-views.72c3c6e7.js → column-views.add5e42b.js} +2 -2
- package/dist/node/{column-views.72c3c6e7.js.map → column-views.add5e42b.js.map} +1 -1
- package/dist/node/{column-views.4d573ded.js → column-views.b2e5f823.js} +2 -2
- package/dist/node/{column-views.4d573ded.js.map → column-views.b2e5f823.js.map} +1 -1
- package/dist/node/{column-views.64fc40d6.js → column-views.b57e5e6e.js} +2 -2
- package/dist/node/{column-views.64fc40d6.js.map → column-views.b57e5e6e.js.map} +1 -1
- package/dist/node/{column-views.a596b1f5.js → column-views.ba9108fe.js} +2 -2
- package/dist/node/column-views.ba9108fe.js.map +1 -0
- package/dist/node/{column-views.b6613ab0.js → column-views.c16a19fb.js} +2 -2
- package/dist/node/{column-views.b6613ab0.js.map → column-views.c16a19fb.js.map} +1 -1
- package/dist/node/{column-views.74fcfb9c.js → column-views.c3097d9a.js} +2 -2
- package/dist/node/{column-views.74fcfb9c.js.map → column-views.c3097d9a.js.map} +1 -1
- package/dist/node/{column-views.fa5ee6de.js → column-views.c4c15e2b.js} +2 -2
- package/dist/node/{column-views.fa5ee6de.js.map → column-views.c4c15e2b.js.map} +1 -1
- package/dist/node/{column-views.58b336f1.js → column-views.c651b684.js} +2 -2
- package/dist/node/{column-views.58b336f1.js.map → column-views.c651b684.js.map} +1 -1
- package/dist/node/{column-views.447008d0.js → column-views.cf41a6d7.js} +2 -2
- package/dist/node/{column-views.447008d0.js.map → column-views.cf41a6d7.js.map} +1 -1
- package/dist/node/{column-views.5fd6e11a.js → column-views.d22bf15c.js} +2 -2
- package/dist/node/{column-views.5fd6e11a.js.map → column-views.d22bf15c.js.map} +1 -1
- package/dist/node/{column-views.5c02450b.js → column-views.d737de1e.js} +2 -2
- package/dist/node/{column-views.5c02450b.js.map → column-views.d737de1e.js.map} +1 -1
- package/dist/node/{column-views.0d48f51d.js → column-views.da902c44.js} +2 -2
- package/dist/node/{column-views.0d48f51d.js.map → column-views.da902c44.js.map} +1 -1
- package/dist/node/{column-views.003e0c17.js → column-views.e0e20136.js} +2 -2
- package/dist/node/{column-views.003e0c17.js.map → column-views.e0e20136.js.map} +1 -1
- package/dist/node/{column-views.7e895e1a.js → column-views.ec0087a2.js} +2 -2
- package/dist/node/{column-views.7e895e1a.js.map → column-views.ec0087a2.js.map} +1 -1
- package/dist/node/{column-views.d86e6c7d.js → column-views.fb3ed7cc.js} +2 -2
- package/dist/node/{column-views.d86e6c7d.js.map → column-views.fb3ed7cc.js.map} +1 -1
- package/dist/node/{column-views.94c8ce3e.js → column-views.fc4c2c61.js} +2 -2
- package/dist/node/{column-views.94c8ce3e.js.map → column-views.fc4c2c61.js.map} +1 -1
- package/dist/node/column-views.fcb243a2.js +2 -0
- package/dist/node/column-views.fcb243a2.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +4 -4
- package/src/correlation-chart/stories/correlation-chart.stories.ts +1 -24
- package/src/correlation-chart/stories/utils.ts +24 -0
- package/src/facets/measurements/sgp.ts +10 -3
- package/src/maps/_shared/styles.ts +12 -2
- package/src/maps/column-navigation/mapbox/index.ts +1 -0
- package/src/prepare-units/composite-scale.ts +9 -1
- package/src/prepare-units/helpers.ts +2 -2
- package/src/unit-details/panel.ts +15 -7
- package/dist/esm/column-views.1b5bf0c6.js.map +0 -1
- package/dist/esm/column-views.633c42a3.js.map +0 -1
- package/dist/esm/column-views.ab2cc6cb.js.map +0 -1
- package/dist/esm/column-views.af4278f0.js.map +0 -1
- package/dist/esm/column-views.b4e1236d.js.map +0 -1
- package/dist/node/column-views.021a6961.js +0 -2
- package/dist/node/column-views.021a6961.js.map +0 -1
- package/dist/node/column-views.139b0855.js +0 -2
- package/dist/node/column-views.139b0855.js.map +0 -1
- package/dist/node/column-views.375529b1.js +0 -2
- package/dist/node/column-views.375529b1.js.map +0 -1
- package/dist/node/column-views.5e73411d.js +0 -2
- package/dist/node/column-views.5e73411d.js.map +0 -1
- package/dist/node/column-views.a596b1f5.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.0bd15ee4.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.0bd15ee4.js";import"./column-views.d737de1e.js";import"./column-views.048fdcaf.js";import e from"@macrostrat/hyper";import{ColumnAxisType as a,SVG as t,AgeAxis as i}from"@macrostrat/column-components";import"react";import{Parenthetical as s}from"@macrostrat/data-components";function o(e,a,t,i){Object.defineProperty(e,a,{get:t,set:i,enumerable:!0,configurable:!0})}var r=globalThis,l={},c={},n=r.parcelRequirea149;null==n&&((n=function(e){if(e in l)return l[e].exports;if(e in c){var a=c[e];delete c[e];var t={id:e,exports:{}};return l[e]=t,a.call(t.exports,t,t.exports),t.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,a){c[e]=a},r.parcelRequirea149=n),n.register;var p={};o(p,"VerticalAxisLabel",()=>d),o(p,"CompositeAgeAxis",()=>f),o(p,"CompositeAgeAxisCore",()=>A),o(p,"ApproximateHeightAxis",()=>h),o(p,"AgeCursor",()=>b);var u=n("6kMGl"),m=n("wtIgl"),g=n("iYfAq");let x=e.styled(u&&u.__esModule?u.default:u);function d(e){let{label:a="Age",unit:t="Ma",className:i,height:o}=e;return x("div.column-axis-label.age-axis-label",{className:i,style:{height:o}},[a," ",x.if(t)(s,{className:"age-axis-unit"},t)])}function f(e){let{axisType:a,sections:t,totalHeight:i}=(0,m.useMacrostratColumnData)();return x(A,{axisType:a,packages:t.map(e=>({key:`section-${e.section_id}`,...e.scaleInfo})),totalHeight:i,...e})}function h(e){let{axisType:a,sections:t,totalHeight:i}=(0,m.useMacrostratColumnData)();return x(A,{axisType:a,axisLabel:"Approx. height",axisUnit:"m",packages:t.map(e=>{let{scaleInfo:a}=e;if(null==a.heightScale)throw Error("No height scale available for section");return{key:`section-${e.section_id}`,...a,scale:a.heightScale}}),totalHeight:i,...e})}function A(e){let{axisType:s,axisLabel:o,axisUnit:r,totalHeight:l,packages:c,...n}=e;if(s==a.ORDINAL)return null;let p=o??"Age",u=r??"Ma";return s==a.DEPTH?(p="Depth",u="m"):s==a.HEIGHT&&(p="Height",u="m"),x("div.composite-age-axis",n,[x(d,{label:p,unit:u,height:l}),x(t,{className:"age-axis-column",style:{width:"22px",height:`${l}px`},width:22,height:l},c.map((e,a)=>{let{key:t,scale:s}=e;return x(i,{key:t,className:"age-axis",scale:s,tickSizeOuter:3})}))])}function b({age:e}){let a=(0,m.useCompositeScale)()(e);return null==e||null==a?null:x("div.age-cursor",{style:{top:a}},[x("div.line"),x(g.AgeLabel,{age:e,className:"label"})])}export{d as VerticalAxisLabel,f as CompositeAgeAxis,A as CompositeAgeAxisCore,h as ApproximateHeightAxis,b as AgeCursor};
|
|
2
|
+
//# sourceMappingURL=column-views.ad60c02f.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O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AChB,IAAA,EACA,UAAW,WACX,MAAA,EACA,cAAe,CACjB,EACF,IAEH,CACH,CAEO,SAAS,EAAU,CAAA,IAAE,CAAG,CAAE,EAG/B,IAAM,EAAW,AADH,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,IACS,UAEvB,AAAI,AAAO,MAAP,GAAe,AAAY,MAAZ,EACV,KAGF,EACL,iBACA,CACE,MAAO,CACL,IAAK,CACP,CACF,EACA,CAAC,EAAE,YAAa,EAAE,EAAA,QAAO,CAAG,CAAE,IAAA,EAAK,UAAW,OAAQ,GAAG,CAE7D,Q,K,iB,C,K,gB,C,K,oB,C,K,qB,C,K,S","sources":["<anon>","packages/column-views/src/age-axis.ts"],"sourcesContent":["import \"./column-views.0bd15ee4.js\";\nimport \"./column-views.5c02450b.js\";\nimport \"./column-views.5e73411d.js\";\nimport $fXMLu$macrostrathyper from \"@macrostrat/hyper\";\nimport {ColumnContext as $fXMLu$ColumnContext, ColumnAxis as $fXMLu$ColumnAxis, ColumnAxisType as $fXMLu$ColumnAxisType, SVG as $fXMLu$SVG, AgeAxis as $fXMLu$AgeAxis} from \"@macrostrat/column-components\";\nimport {useContext as $fXMLu$useContext} from \"react\";\nimport {Parenthetical as $fXMLu$Parenthetical} 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 $1aa4ef695e55d51d$exports = {};\n\n$parcel$export($1aa4ef695e55d51d$exports, \"VerticalAxisLabel\", () => $1aa4ef695e55d51d$export$64204d5cbb3e8227);\n$parcel$export($1aa4ef695e55d51d$exports, \"CompositeAgeAxis\", () => $1aa4ef695e55d51d$export$40b6b0e4520eeb34);\n$parcel$export($1aa4ef695e55d51d$exports, \"CompositeAgeAxisCore\", () => $1aa4ef695e55d51d$export$ac30ca3cf5df959d);\n$parcel$export($1aa4ef695e55d51d$exports, \"ApproximateHeightAxis\", () => $1aa4ef695e55d51d$export$82731b9607850ca6);\n$parcel$export($1aa4ef695e55d51d$exports, \"AgeCursor\", () => $1aa4ef695e55d51d$export$20d84abfcfa68dfa);\n\n\n\n\nvar $6kMGl = parcelRequire(\"6kMGl\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\nconst $1aa4ef695e55d51d$var$h = (0, $fXMLu$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($6kMGl))));\nconst $1aa4ef695e55d51d$var$AgeAxisCore = ({ ticks: ticks, tickSpacing: tickSpacing = 40, showDomain: showDomain = false })=>{\n const { pixelHeight: pixelHeight } = (0, $fXMLu$useContext)((0, $fXMLu$ColumnContext));\n // A tick roughly every 40 pixels\n let v = Math.max(Math.round(pixelHeight / tickSpacing), 1);\n return $1aa4ef695e55d51d$var$h(\"g.axis\", {\n transform: \"translate(20 0)\"\n }, [\n $1aa4ef695e55d51d$var$h((0, $fXMLu$ColumnAxis), {\n ticks: v,\n showDomain: showDomain\n })\n ]);\n};\nfunction $1aa4ef695e55d51d$export$64204d5cbb3e8227(props) {\n const { label: label = \"Age\", unit: unit = \"Ma\", className: className, height: height } = props;\n return $1aa4ef695e55d51d$var$h(\"div.column-axis-label.age-axis-label\", {\n className: className,\n style: {\n height: height\n }\n }, [\n label,\n \" \",\n $1aa4ef695e55d51d$var$h.if(unit)((0, $fXMLu$Parenthetical), {\n className: \"age-axis-unit\"\n }, unit)\n ]);\n}\nfunction $1aa4ef695e55d51d$export$40b6b0e4520eeb34(rest) {\n const { axisType: axisType, sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const packages = sections.map((section)=>{\n return {\n key: `section-${section.section_id}`,\n ...section.scaleInfo\n };\n });\n return $1aa4ef695e55d51d$var$h($1aa4ef695e55d51d$export$ac30ca3cf5df959d, {\n axisType: axisType,\n packages: packages,\n totalHeight: totalHeight,\n ...rest\n });\n}\nfunction $1aa4ef695e55d51d$export$82731b9607850ca6(rest) {\n /** Axis to show approximate height based on dynamic column scales */ const { axisType: axisType, sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const packages = sections.map((section)=>{\n const { scaleInfo: scaleInfo } = section;\n if (scaleInfo.heightScale == null) throw new Error(\"No height scale available for section\");\n return {\n key: `section-${section.section_id}`,\n ...scaleInfo,\n scale: scaleInfo.heightScale\n };\n });\n return $1aa4ef695e55d51d$var$h($1aa4ef695e55d51d$export$ac30ca3cf5df959d, {\n axisType: axisType,\n axisLabel: \"Approx. height\",\n axisUnit: \"m\",\n packages: packages,\n totalHeight: totalHeight,\n ...rest\n });\n}\nfunction $1aa4ef695e55d51d$export$ac30ca3cf5df959d(props) {\n const { axisType: axisType, axisLabel: axisLabel, axisUnit: axisUnit, totalHeight: totalHeight, packages: packages, ...rest } = props;\n if (axisType == (0, $fXMLu$ColumnAxisType).ORDINAL) return null;\n let _axisLabel = axisLabel ?? \"Age\";\n let _axisUnit = axisUnit ?? \"Ma\";\n if (axisType == (0, $fXMLu$ColumnAxisType).DEPTH) {\n _axisLabel = \"Depth\";\n _axisUnit = \"m\";\n } else if (axisType == (0, $fXMLu$ColumnAxisType).HEIGHT) {\n _axisLabel = \"Height\";\n _axisUnit = \"m\";\n }\n return $1aa4ef695e55d51d$var$h(\"div.composite-age-axis\", rest, [\n $1aa4ef695e55d51d$var$h($1aa4ef695e55d51d$export$64204d5cbb3e8227, {\n label: _axisLabel,\n unit: _axisUnit,\n height: totalHeight\n }),\n $1aa4ef695e55d51d$var$h((0, $fXMLu$SVG), {\n className: \"age-axis-column\",\n style: {\n width: `22px`,\n height: `${totalHeight}px`\n },\n width: 22,\n height: totalHeight\n }, packages.map((group, i)=>{\n const { key: key, scale: scale } = group;\n return $1aa4ef695e55d51d$var$h((0, $fXMLu$AgeAxis), {\n key: key,\n className: \"age-axis\",\n scale: scale,\n tickSizeOuter: 3\n });\n }))\n ]);\n}\nfunction $1aa4ef695e55d51d$export$20d84abfcfa68dfa({ age: age }) {\n /** A cursor that shows the age at a specific point on the age axis. */ const scale = (0, $wtIgl.useCompositeScale)();\n const heightPx = scale(age);\n if (age == null || heightPx == null) return null;\n return $1aa4ef695e55d51d$var$h(\"div.age-cursor\", {\n style: {\n top: heightPx\n }\n }, [\n $1aa4ef695e55d51d$var$h(\"div.line\"),\n $1aa4ef695e55d51d$var$h((0, $iYfAq.AgeLabel), {\n age: age,\n className: \"label\"\n })\n ]);\n}\n\n\nexport {$1aa4ef695e55d51d$export$64204d5cbb3e8227 as VerticalAxisLabel, $1aa4ef695e55d51d$export$40b6b0e4520eeb34 as CompositeAgeAxis, $1aa4ef695e55d51d$export$ac30ca3cf5df959d as CompositeAgeAxisCore, $1aa4ef695e55d51d$export$82731b9607850ca6 as ApproximateHeightAxis, $1aa4ef695e55d51d$export$20d84abfcfa68dfa as AgeCursor};\n//# sourceMappingURL=column-views.5f3f8ccf.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport {\n SVG,\n ColumnAxis,\n ColumnContext,\n ColumnAxisType,\n AgeAxis,\n} from \"@macrostrat/column-components\";\nimport { useContext } from \"react\";\nimport styles from \"./age-axis.module.sass\";\nimport { useCompositeScale, useMacrostratColumnData } from \"./data-provider\";\nimport { Parenthetical } from \"@macrostrat/data-components\";\nimport { AgeLabel } from \"./unit-details\";\nimport { PackageScaleLayoutData } from \"./prepare-units\";\n\nconst h = hyper.styled(styles);\n\nconst AgeAxisCore = ({ ticks, tickSpacing = 40, showDomain = false }) => {\n const { pixelHeight } = useContext(ColumnContext);\n // A tick roughly every 40 pixels\n let v = Math.max(Math.round(pixelHeight / tickSpacing), 1);\n\n return h(\"g.axis\", { transform: \"translate(20 0)\" }, [\n h(ColumnAxis, {\n ticks: v,\n showDomain,\n }),\n ]);\n};\n\nexport function VerticalAxisLabel(props) {\n const { label = \"Age\", unit = \"Ma\", className, height } = props;\n return h(\n \"div.column-axis-label.age-axis-label\",\n { className, style: { height } },\n [\n label,\n \" \",\n h.if(unit)(Parenthetical, { className: \"age-axis-unit\" }, unit),\n ],\n );\n}\n\ninterface CompositeAgeAxisProps {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function CompositeAgeAxis(rest: CompositeAgeAxisProps) {\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n return {\n key: `section-${section.section_id}`,\n ...section.scaleInfo,\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport function ApproximateHeightAxis(rest: CompositeAgeAxisProps) {\n /** Axis to show approximate height based on dynamic column scales */\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n const { scaleInfo } = section;\n if (scaleInfo.heightScale == null) {\n throw new Error(\"No height scale available for section\");\n }\n return {\n key: `section-${section.section_id}`,\n ...scaleInfo,\n scale: scaleInfo.heightScale, // Use height scale instead of age scale\n // This only works with dynamic columns\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n axisLabel: \"Approx. height\",\n axisUnit: \"m\",\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport interface CompositeStratigraphicScaleInfo extends CompositeAgeAxisProps {\n axisType: ColumnAxisType;\n axisLabel?: string;\n axisUnit?: string;\n totalHeight: number;\n packages: PackageScaleLayoutData[];\n}\n\nexport function CompositeAgeAxisCore(props: CompositeStratigraphicScaleInfo) {\n const { axisType, axisLabel, axisUnit, totalHeight, packages, ...rest } =\n props;\n\n if (axisType == ColumnAxisType.ORDINAL) {\n return null;\n }\n\n let _axisLabel: string = axisLabel ?? \"Age\";\n let _axisUnit = axisUnit ?? \"Ma\";\n if (axisType == ColumnAxisType.DEPTH) {\n _axisLabel = \"Depth\";\n _axisUnit = \"m\";\n } else if (axisType == ColumnAxisType.HEIGHT) {\n _axisLabel = \"Height\";\n _axisUnit = \"m\";\n }\n\n return h(\"div.composite-age-axis\", rest, [\n h(VerticalAxisLabel, {\n label: _axisLabel,\n unit: _axisUnit,\n height: totalHeight,\n }),\n h(\n SVG,\n {\n className: \"age-axis-column\",\n style: { width: `22px`, height: `${totalHeight}px` },\n width: 22,\n height: totalHeight,\n },\n packages.map((group, i) => {\n const { key, scale } = group;\n\n return h(AgeAxis, {\n key,\n className: \"age-axis\",\n scale,\n tickSizeOuter: 3,\n });\n }),\n ),\n ]);\n}\n\nexport function AgeCursor({ age }) {\n /** A cursor that shows the age at a specific point on the age axis. */\n const scale = useCompositeScale();\n const heightPx = scale(age);\n\n if (age == null || heightPx == null) {\n return null;\n }\n\n return h(\n \"div.age-cursor\",\n {\n style: {\n top: heightPx,\n },\n },\n [h(\"div.line\"), h(AgeLabel, { age, className: \"label\" })],\n );\n}\n"],"names":["$fXMLu$macrostrathyper","ColumnAxisType","$fXMLu$ColumnAxisType","SVG","$fXMLu$SVG","AgeAxis","$fXMLu$AgeAxis","Parenthetical","$fXMLu$Parenthetical","$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","$1aa4ef695e55d51d$exports","$1aa4ef695e55d51d$export$64204d5cbb3e8227","$1aa4ef695e55d51d$export$40b6b0e4520eeb34","$1aa4ef695e55d51d$export$ac30ca3cf5df959d","$1aa4ef695e55d51d$export$82731b9607850ca6","$1aa4ef695e55d51d$export$20d84abfcfa68dfa","$6kMGl","$wtIgl","$iYfAq","$1aa4ef695e55d51d$var$h","styled","a","__esModule","default","props","label","unit","className","height","style","if","rest","axisType","sections","totalHeight","useMacrostratColumnData","packages","map","section","key","section_id","scaleInfo","axisLabel","axisUnit","heightScale","scale","ORDINAL","_axisLabel","_axisUnit","DEPTH","HEIGHT","width","group","i","tickSizeOuter","age","heightPx","useCompositeScale","top","AgeLabel","VerticalAxisLabel","CompositeAgeAxis","CompositeAgeAxisCore","ApproximateHeightAxis","AgeCursor"],"version":3,"file":"column-views.5f3f8ccf.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,kB,C,C,O,C,C,W,C,K,+B,A,O,O,A,Q,iB,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,oB,I,G,E,E,mB,I,G,E,E,uB,I,G,E,E,wB,I,G,E,E,Y,I,G,I,E,E,S,E,E,S,E,E,SCeA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAehB,SAAS,EAAkB,CAAK,EACrC,GAAM,CAAA,MAAE,EAAQ,KAAA,CAAA,KAAO,EAAO,IA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AAG,EAAM,CACrE,EAEF,GAAI,GAAY,AAAA,EAAe,OAAO,CACpC,OAAO,KAGT,IAAI,EAAqB,GAAa,MAClC,EAAY,GAAY,KAS5B,OARI,GAAY,AAAA,EAAe,KAAK,EAClC,EAAa,QACb,EAAY,KACH,GAAY,AAAA,EAAe,MAAM,GAC1C,EAAa,SACb,EAAY,KAGP,EAAE,yBAA0B,EAAM,CACvC,EAAE,EAAmB,CACnB,MAAO,EACP,KAAM,EACN,OAAQ,CACV,GACA,EACE,EACA,CACE,UAAW,kBACX,MAAO,CAAE,MAAO,OAAQ,OAAQ,CAAA,EAAG,EAAY,EAAE,CAAC,AAAC,EACnD,MAAO,GACP,OAAQ,CACV,EACA,EAAS,GAAG,CAAC,CAAC,EAAO,KACnB,GAAM,CAAA,IAAE,CAAG,CAAA,MAAE,CAAK,CAAE,CAAG,EAEvB,OAAO,EAAE,EAAS,CAChB,IAAA,EACA,UAAW,WACX,MAAA,EACA,cAAe,CACjB,EACF,IAEH,CACH,CAEO,SAAS,EAAU,CAAA,IAAE,CAAG,CAAE,EAG/B,IAAM,EAAW,AADH,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,IACS,UAEvB,AAAI,AAAO,MAAP,GAAe,AAAY,MAAZ,EACV,KAGF,EACL,iBACA,CACE,MAAO,CACL,IAAK,CACP,CACF,EACA,CAAC,EAAE,YAAa,EAAE,EAAA,QAAO,CAAG,CAAE,IAAA,EAAK,UAAW,OAAQ,GAAG,CAE7D,Q,K,iB,C,K,gB,C,K,oB,C,K,qB,C,K,S","sources":["<anon>","packages/column-views/src/age-axis.ts"],"sourcesContent":["import \"./column-views.0bd15ee4.js\";\nimport \"./column-views.d737de1e.js\";\nimport \"./column-views.048fdcaf.js\";\nimport $fXMLu$macrostrathyper from \"@macrostrat/hyper\";\nimport {ColumnContext as $fXMLu$ColumnContext, ColumnAxis as $fXMLu$ColumnAxis, ColumnAxisType as $fXMLu$ColumnAxisType, SVG as $fXMLu$SVG, AgeAxis as $fXMLu$AgeAxis} from \"@macrostrat/column-components\";\nimport {useContext as $fXMLu$useContext} from \"react\";\nimport {Parenthetical as $fXMLu$Parenthetical} 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 $1aa4ef695e55d51d$exports = {};\n\n$parcel$export($1aa4ef695e55d51d$exports, \"VerticalAxisLabel\", () => $1aa4ef695e55d51d$export$64204d5cbb3e8227);\n$parcel$export($1aa4ef695e55d51d$exports, \"CompositeAgeAxis\", () => $1aa4ef695e55d51d$export$40b6b0e4520eeb34);\n$parcel$export($1aa4ef695e55d51d$exports, \"CompositeAgeAxisCore\", () => $1aa4ef695e55d51d$export$ac30ca3cf5df959d);\n$parcel$export($1aa4ef695e55d51d$exports, \"ApproximateHeightAxis\", () => $1aa4ef695e55d51d$export$82731b9607850ca6);\n$parcel$export($1aa4ef695e55d51d$exports, \"AgeCursor\", () => $1aa4ef695e55d51d$export$20d84abfcfa68dfa);\n\n\n\n\nvar $6kMGl = parcelRequire(\"6kMGl\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\nconst $1aa4ef695e55d51d$var$h = (0, $fXMLu$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($6kMGl))));\nconst $1aa4ef695e55d51d$var$AgeAxisCore = ({ ticks: ticks, tickSpacing: tickSpacing = 40, showDomain: showDomain = false })=>{\n const { pixelHeight: pixelHeight } = (0, $fXMLu$useContext)((0, $fXMLu$ColumnContext));\n // A tick roughly every 40 pixels\n let v = Math.max(Math.round(pixelHeight / tickSpacing), 1);\n return $1aa4ef695e55d51d$var$h(\"g.axis\", {\n transform: \"translate(20 0)\"\n }, [\n $1aa4ef695e55d51d$var$h((0, $fXMLu$ColumnAxis), {\n ticks: v,\n showDomain: showDomain\n })\n ]);\n};\nfunction $1aa4ef695e55d51d$export$64204d5cbb3e8227(props) {\n const { label: label = \"Age\", unit: unit = \"Ma\", className: className, height: height } = props;\n return $1aa4ef695e55d51d$var$h(\"div.column-axis-label.age-axis-label\", {\n className: className,\n style: {\n height: height\n }\n }, [\n label,\n \" \",\n $1aa4ef695e55d51d$var$h.if(unit)((0, $fXMLu$Parenthetical), {\n className: \"age-axis-unit\"\n }, unit)\n ]);\n}\nfunction $1aa4ef695e55d51d$export$40b6b0e4520eeb34(rest) {\n const { axisType: axisType, sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const packages = sections.map((section)=>{\n return {\n key: `section-${section.section_id}`,\n ...section.scaleInfo\n };\n });\n return $1aa4ef695e55d51d$var$h($1aa4ef695e55d51d$export$ac30ca3cf5df959d, {\n axisType: axisType,\n packages: packages,\n totalHeight: totalHeight,\n ...rest\n });\n}\nfunction $1aa4ef695e55d51d$export$82731b9607850ca6(rest) {\n /** Axis to show approximate height based on dynamic column scales */ const { axisType: axisType, sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const packages = sections.map((section)=>{\n const { scaleInfo: scaleInfo } = section;\n if (scaleInfo.heightScale == null) throw new Error(\"No height scale available for section\");\n return {\n key: `section-${section.section_id}`,\n ...scaleInfo,\n scale: scaleInfo.heightScale\n };\n });\n return $1aa4ef695e55d51d$var$h($1aa4ef695e55d51d$export$ac30ca3cf5df959d, {\n axisType: axisType,\n axisLabel: \"Approx. height\",\n axisUnit: \"m\",\n packages: packages,\n totalHeight: totalHeight,\n ...rest\n });\n}\nfunction $1aa4ef695e55d51d$export$ac30ca3cf5df959d(props) {\n const { axisType: axisType, axisLabel: axisLabel, axisUnit: axisUnit, totalHeight: totalHeight, packages: packages, ...rest } = props;\n if (axisType == (0, $fXMLu$ColumnAxisType).ORDINAL) return null;\n let _axisLabel = axisLabel ?? \"Age\";\n let _axisUnit = axisUnit ?? \"Ma\";\n if (axisType == (0, $fXMLu$ColumnAxisType).DEPTH) {\n _axisLabel = \"Depth\";\n _axisUnit = \"m\";\n } else if (axisType == (0, $fXMLu$ColumnAxisType).HEIGHT) {\n _axisLabel = \"Height\";\n _axisUnit = \"m\";\n }\n return $1aa4ef695e55d51d$var$h(\"div.composite-age-axis\", rest, [\n $1aa4ef695e55d51d$var$h($1aa4ef695e55d51d$export$64204d5cbb3e8227, {\n label: _axisLabel,\n unit: _axisUnit,\n height: totalHeight\n }),\n $1aa4ef695e55d51d$var$h((0, $fXMLu$SVG), {\n className: \"age-axis-column\",\n style: {\n width: `22px`,\n height: `${totalHeight}px`\n },\n width: 22,\n height: totalHeight\n }, packages.map((group, i)=>{\n const { key: key, scale: scale } = group;\n return $1aa4ef695e55d51d$var$h((0, $fXMLu$AgeAxis), {\n key: key,\n className: \"age-axis\",\n scale: scale,\n tickSizeOuter: 3\n });\n }))\n ]);\n}\nfunction $1aa4ef695e55d51d$export$20d84abfcfa68dfa({ age: age }) {\n /** A cursor that shows the age at a specific point on the age axis. */ const scale = (0, $wtIgl.useCompositeScale)();\n const heightPx = scale(age);\n if (age == null || heightPx == null) return null;\n return $1aa4ef695e55d51d$var$h(\"div.age-cursor\", {\n style: {\n top: heightPx\n }\n }, [\n $1aa4ef695e55d51d$var$h(\"div.line\"),\n $1aa4ef695e55d51d$var$h((0, $iYfAq.AgeLabel), {\n age: age,\n className: \"label\"\n })\n ]);\n}\n\n\nexport {$1aa4ef695e55d51d$export$64204d5cbb3e8227 as VerticalAxisLabel, $1aa4ef695e55d51d$export$40b6b0e4520eeb34 as CompositeAgeAxis, $1aa4ef695e55d51d$export$ac30ca3cf5df959d as CompositeAgeAxisCore, $1aa4ef695e55d51d$export$82731b9607850ca6 as ApproximateHeightAxis, $1aa4ef695e55d51d$export$20d84abfcfa68dfa as AgeCursor};\n//# sourceMappingURL=column-views.ad60c02f.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport {\n SVG,\n ColumnAxis,\n ColumnContext,\n ColumnAxisType,\n AgeAxis,\n} from \"@macrostrat/column-components\";\nimport { useContext } from \"react\";\nimport styles from \"./age-axis.module.sass\";\nimport { useCompositeScale, useMacrostratColumnData } from \"./data-provider\";\nimport { Parenthetical } from \"@macrostrat/data-components\";\nimport { AgeLabel } from \"./unit-details\";\nimport { PackageScaleLayoutData } from \"./prepare-units\";\n\nconst h = hyper.styled(styles);\n\nconst AgeAxisCore = ({ ticks, tickSpacing = 40, showDomain = false }) => {\n const { pixelHeight } = useContext(ColumnContext);\n // A tick roughly every 40 pixels\n let v = Math.max(Math.round(pixelHeight / tickSpacing), 1);\n\n return h(\"g.axis\", { transform: \"translate(20 0)\" }, [\n h(ColumnAxis, {\n ticks: v,\n showDomain,\n }),\n ]);\n};\n\nexport function VerticalAxisLabel(props) {\n const { label = \"Age\", unit = \"Ma\", className, height } = props;\n return h(\n \"div.column-axis-label.age-axis-label\",\n { className, style: { height } },\n [\n label,\n \" \",\n h.if(unit)(Parenthetical, { className: \"age-axis-unit\" }, unit),\n ],\n );\n}\n\ninterface CompositeAgeAxisProps {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function CompositeAgeAxis(rest: CompositeAgeAxisProps) {\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n return {\n key: `section-${section.section_id}`,\n ...section.scaleInfo,\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport function ApproximateHeightAxis(rest: CompositeAgeAxisProps) {\n /** Axis to show approximate height based on dynamic column scales */\n const { axisType, sections, totalHeight } = useMacrostratColumnData();\n\n const packages = sections.map((section) => {\n const { scaleInfo } = section;\n if (scaleInfo.heightScale == null) {\n throw new Error(\"No height scale available for section\");\n }\n return {\n key: `section-${section.section_id}`,\n ...scaleInfo,\n scale: scaleInfo.heightScale, // Use height scale instead of age scale\n // This only works with dynamic columns\n };\n });\n\n return h(CompositeAgeAxisCore, {\n axisType,\n axisLabel: \"Approx. height\",\n axisUnit: \"m\",\n packages,\n totalHeight,\n ...rest,\n });\n}\n\nexport interface CompositeStratigraphicScaleInfo extends CompositeAgeAxisProps {\n axisType: ColumnAxisType;\n axisLabel?: string;\n axisUnit?: string;\n totalHeight: number;\n packages: PackageScaleLayoutData[];\n}\n\nexport function CompositeAgeAxisCore(props: CompositeStratigraphicScaleInfo) {\n const { axisType, axisLabel, axisUnit, totalHeight, packages, ...rest } =\n props;\n\n if (axisType == ColumnAxisType.ORDINAL) {\n return null;\n }\n\n let _axisLabel: string = axisLabel ?? \"Age\";\n let _axisUnit = axisUnit ?? \"Ma\";\n if (axisType == ColumnAxisType.DEPTH) {\n _axisLabel = \"Depth\";\n _axisUnit = \"m\";\n } else if (axisType == ColumnAxisType.HEIGHT) {\n _axisLabel = \"Height\";\n _axisUnit = \"m\";\n }\n\n return h(\"div.composite-age-axis\", rest, [\n h(VerticalAxisLabel, {\n label: _axisLabel,\n unit: _axisUnit,\n height: totalHeight,\n }),\n h(\n SVG,\n {\n className: \"age-axis-column\",\n style: { width: `22px`, height: `${totalHeight}px` },\n width: 22,\n height: totalHeight,\n },\n packages.map((group, i) => {\n const { key, scale } = group;\n\n return h(AgeAxis, {\n key,\n className: \"age-axis\",\n scale,\n tickSizeOuter: 3,\n });\n }),\n ),\n ]);\n}\n\nexport function AgeCursor({ age }) {\n /** A cursor that shows the age at a specific point on the age axis. */\n const scale = useCompositeScale();\n const heightPx = scale(age);\n\n if (age == null || heightPx == null) {\n return null;\n }\n\n return h(\n \"div.age-cursor\",\n {\n style: {\n top: heightPx,\n },\n },\n [h(\"div.line\"), h(AgeLabel, { age, className: \"label\" })],\n );\n}\n"],"names":["$fXMLu$macrostrathyper","ColumnAxisType","$fXMLu$ColumnAxisType","SVG","$fXMLu$SVG","AgeAxis","$fXMLu$AgeAxis","Parenthetical","$fXMLu$Parenthetical","$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","$1aa4ef695e55d51d$exports","$1aa4ef695e55d51d$export$64204d5cbb3e8227","$1aa4ef695e55d51d$export$40b6b0e4520eeb34","$1aa4ef695e55d51d$export$ac30ca3cf5df959d","$1aa4ef695e55d51d$export$82731b9607850ca6","$1aa4ef695e55d51d$export$20d84abfcfa68dfa","$6kMGl","$wtIgl","$iYfAq","$1aa4ef695e55d51d$var$h","styled","a","__esModule","default","props","label","unit","className","height","style","if","rest","axisType","sections","totalHeight","useMacrostratColumnData","packages","map","section","key","section_id","scaleInfo","axisLabel","axisUnit","heightScale","scale","ORDINAL","_axisLabel","_axisUnit","DEPTH","HEIGHT","width","group","i","tickSizeOuter","age","heightPx","useCompositeScale","top","AgeLabel","VerticalAxisLabel","CompositeAgeAxis","CompositeAgeAxisCore","ApproximateHeightAxis","AgeCursor"],"version":3,"file":"column-views.ad60c02f.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.4ec769a6.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.4ec769a6.js";import"./column-views.109cb0c8.js";import"./column-views.d737de1e.js";import"./column-views.672b683c.js";import"./column-views.dbb4a46b.js";import"./column-views.0af5912d.js";import e from"@macrostrat/hyper";import{ColumnAxisType as t}from"@macrostrat/column-components";import{scaleLinear as n}from"d3-scale";function o(e,t,n,o){Object.defineProperty(e,t,{get:n,set:o,enumerable:!0,configurable:!0})}var l=globalThis,a={},r={},s=l.parcelRequirea149;null==s&&((s=function(e){if(e in a)return a[e].exports;if(e in r){var t=r[e];delete r[e];var n={id:e,exports:{}};return a[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){r[e]=t},l.parcelRequirea149=s),s.register;var i={};o(i,"PBDBFossilsColumn",()=>b),o(i,"FossilDataType",()=>s("dx7no").FossilDataType),o(i,"useFossilData",()=>s("dx7no").useFossilData);var u=s("dx7no"),c=s("kIQUG"),f=s("wtIgl"),m=s("f7qDU"),p=s("iWhRv"),d=s("6dOaS");let _=e.styled(m&&m.__esModule?m.default:m);function b({columnID:e,type:o=u.FossilDataType.Collections}){let l=(0,u.useFossilData)(e,o),{axisType:a,units:r}=(0,f.useMacrostratColumnData)(),s=(0,f.useCompositeScale)();if(null==l||null==r||null==s)return null;let i=function(e,o,l,a,r){let{groupCloseNotes:s=!0}=(void 0)??{},i=new Map;for(let l of e){let e=function(e,o,l){let a=null;if(null!=e.slb&&"mbsf"==e.slu&&(a=Number(e.slb),l===t.DEPTH))return{height:a};if(null==e.unit_id)return null;if(null!=a){let r=o.find(t=>t.unit_id===e.unit_id);if(null==r)return null;let s=function(e,t,o){let l=n((0,p.getUnitHeightRange)(t,o,!1)).domain([0,1]).invert(e);return l<0||l>1?null:l}(a,r,t.DEPTH);return null==s?null:{height:a=(0,p.getPositionWithinUnit)(s,r,l)}}return(0,c.standardizeMeasurementHeight)({unit_id:e.unit_id},o,l)}(l,o,a);if(null==e)continue;let{height:r,top_height:s}=e,u=`${r}`;null!=s&&(u+=`-${s}`),i.has(u)||i.set(u,{height:r,top_height:s??r,data:[],id:u}),i.get(u).data.push(l)}return(0,c.groupNotesByPixelDistance)(Array.from(i.values()),l,a,"number"==typeof s?s:10)}(l,r,s,a);return _(c.BaseMeasurementsColumn,{data:i,noteComponent:h,focusedNoteComponent:h,className:"fossil-collections"})}function h(e){let{note:t,maxItems:n,focused:o=!1}=e,{data:l}=t;return l.sort((e,t)=>{let n=e.best_name??e.cltn_name??"",o=t.best_name??t.cltn_name??"";return n.localeCompare(o)}),_(c.TruncatedList,{data:l,className:"fossil-collections",itemRenderer:g,maxItems:o?1/0:n??5})}function g({data:e}){return _("a.link-id",{href:`https://paleobiodb.org/app/collections#display=col:${e.cltn_id}`,target:"_blank",onClick(e){e.stopPropagation()}},e.best_name??e.cltn_name)}Object.keys(d).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:function(){return d[e]}})});export{b as PBDBFossilsColumn,$8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType,$8e174c7ae24a4598$export$e6af757fa9780077 as useFossilData,$9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix};
|
|
2
|
+
//# sourceMappingURL=column-views.add5e42b.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,Q,M,mB,A,Q,kB,C,K,+B,A,Q,e,C,K,U,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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AAW,oBACb,EACF,CAkBA,SAAS,EAAW,CAAsB,EACxC,GAAM,CAAA,KAAE,CAAI,CAAA,SAAE,CAAQ,CAAA,QAAE,EAAU,CAAA,CAAA,CAAO,CAAG,EACtC,CAAA,KAAE,CAAI,CAAE,CAAG,EAQjB,OANA,EAAK,IAAI,CAAC,CAAC,EAAG,KACZ,IAAM,EAAQ,EAAE,SAAS,EAAI,EAAE,SAAS,EAAI,GACtC,EAAQ,EAAE,SAAS,EAAI,EAAE,SAAS,EAAI,GAC5C,OAAO,EAAM,aAAa,CAAC,EAC7B,GAEO,EAAE,EAAA,aAAY,CAAG,CACtB,KAAA,EACA,UAAW,qBACX,aAAc,EACd,SAAU,EAAU,IAAY,GAAY,CAC9C,EACF,CAEA,SAAS,EAAmB,CAAA,KAC1B,CAAI,CAGL,EAEC,OAAO,EACL,YACA,CACE,KAAM,CAAC,mDAAmD,EAAE,EAAK,OAAO,CAAA,CAAE,CAC1E,OAAQ,SACR,QAAQ,CAAC,EACP,EAAE,eAAe,EACnB,CACF,EACA,EAAK,SAAS,EAAI,EAAK,SAAS,CAEpC,C,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,A,C,C,E,A,C,E,U,K,iB,C,6C,c,C,6C,a,C,6C,qB","sources":["<anon>","packages/column-views/src/facets/fossils/index.ts"],"sourcesContent":["import \"./column-views.4ec769a6.js\";\nimport \"./column-views.54f7a243.js\";\nimport \"./column-views.5c02450b.js\";\nimport \"./column-views.672b683c.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport \"./column-views.66663668.js\";\nimport $2jHE4$macrostrathyper from \"@macrostrat/hyper\";\nimport {ColumnAxisType as $2jHE4$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {scaleLinear as $2jHE4$scaleLinear} from \"d3-scale\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\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\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 $ea2f112131e22f14$exports = {};\n\n$parcel$export($ea2f112131e22f14$exports, \"PBDBFossilsColumn\", () => $ea2f112131e22f14$export$554267114407ef68);\n$parcel$export($ea2f112131e22f14$exports, \"FossilDataType\", () => (parcelRequire(\"dx7no\")).FossilDataType);\n$parcel$export($ea2f112131e22f14$exports, \"useFossilData\", () => (parcelRequire(\"dx7no\")).useFossilData);\n\n\nvar $dx7no = parcelRequire(\"dx7no\");\n\nvar $kIQUG = parcelRequire(\"kIQUG\");\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $f7qDU = parcelRequire(\"f7qDU\");\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\nvar $6dOaS = parcelRequire(\"6dOaS\");\nconst $ea2f112131e22f14$var$h = (0, $2jHE4$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($f7qDU))));\nfunction $ea2f112131e22f14$export$554267114407ef68({ columnID: columnID, type: type = (0, $dx7no.FossilDataType).Collections }) {\n const data = (0, $dx7no.useFossilData)(columnID, type);\n const { axisType: axisType, units: units } = (0, $wtIgl.useMacrostratColumnData)();\n const scale = (0, $wtIgl.useCompositeScale)();\n if (data == null || units == null || scale == null) return null;\n const data1 = $ea2f112131e22f14$var$preparePBDBData(data, units, scale, axisType);\n return $ea2f112131e22f14$var$h((0, $kIQUG.BaseMeasurementsColumn), {\n data: data1,\n noteComponent: $ea2f112131e22f14$var$FossilInfo,\n focusedNoteComponent: $ea2f112131e22f14$var$FossilInfo,\n className: \"fossil-collections\"\n });\n}\nfunction $ea2f112131e22f14$var$FossilInfo(props) {\n const { note: note, maxItems: maxItems, focused: focused = false } = props;\n const { data: data } = note;\n // Sort collections by name\n data.sort((a, b)=>{\n const nameA = a.best_name ?? a.cltn_name ?? \"\";\n const nameB = b.best_name ?? b.cltn_name ?? \"\";\n return nameA.localeCompare(nameB);\n });\n return $ea2f112131e22f14$var$h((0, $kIQUG.TruncatedList), {\n data: data,\n className: \"fossil-collections\",\n itemRenderer: $ea2f112131e22f14$var$PBDBCollectionLink,\n maxItems: focused ? Infinity : maxItems ?? 5\n });\n}\nfunction $ea2f112131e22f14$var$PBDBCollectionLink({ data: data }) {\n /** A link to a PBDB collection that handles either an occurrence or collection object */ return $ea2f112131e22f14$var$h(\"a.link-id\", {\n href: `https://paleobiodb.org/app/collections#display=col:${data.cltn_id}`,\n target: \"_blank\",\n onClick (e) {\n e.stopPropagation();\n }\n }, data.best_name ?? data.cltn_name);\n}\nfunction $ea2f112131e22f14$var$preparePBDBData(data, units, scale, axisType, options) {\n /** Prepare PBDB fossil data for display in a measurements column */ const { groupCloseNotes: groupCloseNotes = true } = options ?? {};\n const groupDistance = typeof groupCloseNotes === \"number\" ? groupCloseNotes : 10;\n // Map of data to its defined height ranges\n const dataMap = new Map();\n // Todo: if we wanted, we could add a step where we group notes that are too close together here...\n for (const d of data){\n const range = $ea2f112131e22f14$var$getHeightRangeForPBDBEntity(d, units, axisType);\n if (range == null) continue;\n const { height: height, top_height: top_height } = range;\n // compose the key based on height info\n let key = `${height}`;\n if (top_height != null) key += `-${top_height}`;\n // Group by height key\n if (!dataMap.has(key)) dataMap.set(key, {\n height: height,\n top_height: top_height ?? height,\n data: [],\n id: key\n });\n dataMap.get(key).data.push(d);\n }\n return (0, $kIQUG.groupNotesByPixelDistance)(Array.from(dataMap.values()), scale, axisType, groupDistance);\n}\nfunction $ea2f112131e22f14$var$getHeightRangeForPBDBEntity(d, units, axisType) {\n let height = null;\n if (d.slb != null && d.slu == \"mbsf\") {\n // Meters below sea floor - special case for eODP where we have\n // specific depth data referenced\n height = Number(d.slb);\n if (axisType === (0, $2jHE4$ColumnAxisType).DEPTH) // Data is already in depth units\n return {\n height: height\n };\n }\n if (d.unit_id == null) return null;\n if (height != null) {\n // If we have both height and unit info, we need to adjust the height\n // to fit whatever scale type we're using.\n // TODO: we could improve how this works by having concurrent age and\n // height scales, which would allow us to do this without having to\n // reference to a specific unit.\n const unit = units.find((u)=>u.unit_id === d.unit_id);\n if (unit == null) return null;\n const relHeight = $ea2f112131e22f14$var$getRelativePositionInUnit(height, unit, (0, $2jHE4$ColumnAxisType).DEPTH);\n if (relHeight == null) return null;\n height = (0, $iWhRv.getPositionWithinUnit)(relHeight, unit, axisType);\n return {\n height: height\n };\n }\n // We can just get the height within the unit, clipped to the unit boundaries\n return (0, $kIQUG.standardizeMeasurementHeight)({\n unit_id: d.unit_id\n }, units, axisType);\n}\nfunction $ea2f112131e22f14$var$getRelativePositionInUnit(pos, unit, axisType) {\n // This is the inverse of getPositionWithinUnit\n const heights = (0, $iWhRv.getUnitHeightRange)(unit, axisType, false);\n const scale = (0, $2jHE4$scaleLinear)(heights).domain([\n 0,\n 1\n ]);\n const relPos = scale.invert(pos);\n if (relPos < 0 || relPos > 1) return null;\n return relPos;\n}\n$parcel$exportWildcard($ea2f112131e22f14$exports, $6dOaS);\n\n\nexport {$ea2f112131e22f14$export$554267114407ef68 as PBDBFossilsColumn, $8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType, $8e174c7ae24a4598$export$e6af757fa9780077 as useFossilData, $9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix};\n//# sourceMappingURL=column-views.72c3c6e7.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport {\n FossilDataType,\n type PBDBCollection,\n type PBDBEntity,\n type PBDBOccurrence,\n useFossilData,\n} from \"./provider\";\nimport type { IUnit } from \"../../units\";\nimport {\n BaseMeasurementsColumn,\n ColumnMeasurementData,\n MeasurementHeightData,\n standardizeMeasurementHeight,\n groupNotesByPixelDistance,\n TruncatedList,\n} from \"../measurements\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n} from \"../../data-provider\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport styles from \"./taxon-ranges.module.sass\";\nimport {\n CompositeColumnScale,\n getPositionWithinUnit,\n getUnitHeightRange,\n} from \"../../prepare-units\";\nimport { scaleLinear } from \"d3-scale\";\n\nexport {\n FossilDataType,\n type PBDBCollection,\n type PBDBEntity,\n type PBDBOccurrence,\n useFossilData,\n};\nexport * from \"./taxon-ranges\";\n\nconst h = hyper.styled(styles);\n\nexport function PBDBFossilsColumn({\n columnID,\n type = FossilDataType.Collections,\n}: {\n columnID: number;\n type: FossilDataType;\n}) {\n const data = useFossilData(columnID, type);\n const { axisType, units } = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n if (data == null || units == null || scale == null) return null;\n\n const data1 = preparePBDBData(data, units, scale, axisType);\n\n return h(BaseMeasurementsColumn, {\n data: data1,\n noteComponent: FossilInfo,\n focusedNoteComponent: FossilInfo,\n className: \"fossil-collections\",\n });\n}\n\ninterface FossilItemProps {\n note: {\n data: PBDBCollection[];\n unit?: IUnit;\n };\n spacing?: {\n below?: number;\n above?: number;\n };\n width?: number;\n height?: number;\n color?: string;\n focused?: boolean;\n maxItems?: number;\n}\n\nfunction FossilInfo(props: FossilItemProps) {\n const { note, maxItems, focused = false } = props;\n const { data } = note;\n // Sort collections by name\n data.sort((a, b) => {\n const nameA = a.best_name ?? a.cltn_name ?? \"\";\n const nameB = b.best_name ?? b.cltn_name ?? \"\";\n return nameA.localeCompare(nameB);\n });\n\n return h(TruncatedList, {\n data,\n className: \"fossil-collections\",\n itemRenderer: PBDBCollectionLink,\n maxItems: focused ? Infinity : (maxItems ?? 5),\n });\n}\n\nfunction PBDBCollectionLink({\n data,\n}: {\n data: PBDBCollection | PBDBOccurrence;\n}) {\n /** A link to a PBDB collection that handles either an occurrence or collection object */\n return h(\n \"a.link-id\",\n {\n href: `https://paleobiodb.org/app/collections#display=col:${data.cltn_id}`,\n target: \"_blank\",\n onClick(e) {\n e.stopPropagation();\n },\n },\n data.best_name ?? data.cltn_name,\n );\n}\n\ninterface PreparePBDBDataOptions {\n /** If set, group close notes within this distance (in pixels in display space)\n * into a single note. If a number is provided, that number is used as the distance,\n * otherwise a default of 5 pixels is used.\n */\n groupCloseNotes?: boolean | number;\n}\n\nfunction preparePBDBData<T extends PBDBEntity>(\n data: T[],\n units: UnitLong[],\n scale: CompositeColumnScale,\n axisType: ColumnAxisType,\n options?: PreparePBDBDataOptions,\n) {\n /** Prepare PBDB fossil data for display in a measurements column */\n const { groupCloseNotes = true } = options ?? {};\n const groupDistance =\n typeof groupCloseNotes === \"number\" ? groupCloseNotes : 10;\n\n // Map of data to its defined height ranges\n const dataMap = new Map<string, ColumnMeasurementData<T[]>>();\n\n // Todo: if we wanted, we could add a step where we group notes that are too close together here...\n\n for (const d of data) {\n const range = getHeightRangeForPBDBEntity(d, units, axisType);\n\n if (range == null) continue;\n const { height, top_height } = range;\n // compose the key based on height info\n let key = `${height}`;\n if (top_height != null) {\n key += `-${top_height}`;\n }\n\n // Group by height key\n if (!dataMap.has(key)) {\n dataMap.set(key, {\n height,\n top_height: top_height ?? height,\n data: [],\n id: key,\n });\n }\n dataMap.get(key)!.data.push(d);\n }\n\n return groupNotesByPixelDistance(\n Array.from(dataMap.values()),\n scale,\n axisType,\n groupDistance,\n );\n}\n\nfunction getHeightRangeForPBDBEntity<T extends PBDBEntity>(\n d: T,\n units: UnitLong[],\n axisType: ColumnAxisType,\n): MeasurementHeightData | null {\n let height: number | null = null;\n if (d.slb != null && d.slu == \"mbsf\") {\n // Meters below sea floor - special case for eODP where we have\n // specific depth data referenced\n height = Number(d.slb);\n if (axisType === ColumnAxisType.DEPTH) {\n // Data is already in depth units\n return { height };\n }\n }\n if (d.unit_id == null) return null;\n if (height != null) {\n // If we have both height and unit info, we need to adjust the height\n // to fit whatever scale type we're using.\n // TODO: we could improve how this works by having concurrent age and\n // height scales, which would allow us to do this without having to\n // reference to a specific unit.\n const unit = units.find((u) => u.unit_id === d.unit_id);\n if (unit == null) return null;\n const relHeight = getRelativePositionInUnit(\n height,\n unit,\n ColumnAxisType.DEPTH,\n );\n if (relHeight == null) return null;\n height = getPositionWithinUnit(relHeight, unit, axisType);\n return { height };\n }\n // We can just get the height within the unit, clipped to the unit boundaries\n return standardizeMeasurementHeight({ unit_id: d.unit_id }, units, axisType);\n}\n\nfunction getRelativePositionInUnit(\n pos: number,\n unit: UnitLong,\n axisType: ColumnAxisType,\n): number | null {\n // This is the inverse of getPositionWithinUnit\n const heights = getUnitHeightRange(unit, axisType, false);\n const scale = scaleLinear(heights).domain([0, 1]);\n const relPos = scale.invert(pos);\n if (relPos < 0 || relPos > 1) return null;\n return relPos;\n}\n"],"names":["$2jHE4$macrostrathyper","ColumnAxisType","$2jHE4$ColumnAxisType","scaleLinear","$2jHE4$scaleLinear","$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","$ea2f112131e22f14$exports","$ea2f112131e22f14$export$554267114407ef68","FossilDataType","useFossilData","$dx7no","$kIQUG","$wtIgl","$f7qDU","$iWhRv","$6dOaS","$ea2f112131e22f14$var$h","styled","a","__esModule","default","columnID","type","Collections","data","axisType","units","useMacrostratColumnData","scale","useCompositeScale","data1","$ea2f112131e22f14$var$preparePBDBData","options","groupCloseNotes","dataMap","Map","d","range","$ea2f112131e22f14$var$getHeightRangeForPBDBEntity","height","slb","slu","Number","DEPTH","unit_id","unit","find","u","relHeight","$ea2f112131e22f14$var$getRelativePositionInUnit","pos","relPos","getUnitHeightRange","domain","invert","getPositionWithinUnit","standardizeMeasurementHeight","top_height","key","has","push","groupNotesByPixelDistance","Array","from","values","BaseMeasurementsColumn","noteComponent","$ea2f112131e22f14$var$FossilInfo","focusedNoteComponent","className","props","note","maxItems","focused","sort","b","nameA","best_name","cltn_name","nameB","localeCompare","TruncatedList","itemRenderer","$ea2f112131e22f14$var$PBDBCollectionLink","Infinity","href","cltn_id","target","onClick","stopPropagation","keys","forEach","prototype","hasOwnProperty","source","PBDBFossilsColumn","$8e174c7ae24a4598$export$a990c76b38782f57","$8e174c7ae24a4598$export$e6af757fa9780077","$9cea14fa75e12a56$export$652730986cccff7a","PBDBOccurrencesMatrix"],"version":3,"file":"column-views.72c3c6e7.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,kB,C,K,+B,A,Q,e,C,K,U,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,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UAAW,oBACb,EACF,CAkBA,SAAS,EAAW,CAAsB,EACxC,GAAM,CAAA,KAAE,CAAI,CAAA,SAAE,CAAQ,CAAA,QAAE,EAAU,CAAA,CAAA,CAAO,CAAG,EACtC,CAAA,KAAE,CAAI,CAAE,CAAG,EAQjB,OANA,EAAK,IAAI,CAAC,CAAC,EAAG,KACZ,IAAM,EAAQ,EAAE,SAAS,EAAI,EAAE,SAAS,EAAI,GACtC,EAAQ,EAAE,SAAS,EAAI,EAAE,SAAS,EAAI,GAC5C,OAAO,EAAM,aAAa,CAAC,EAC7B,GAEO,EAAE,EAAA,aAAY,CAAG,CACtB,KAAA,EACA,UAAW,qBACX,aAAc,EACd,SAAU,EAAU,IAAY,GAAY,CAC9C,EACF,CAEA,SAAS,EAAmB,CAAA,KAC1B,CAAI,CAGL,EAEC,OAAO,EACL,YACA,CACE,KAAM,CAAC,mDAAmD,EAAE,EAAK,OAAO,CAAA,CAAE,CAC1E,OAAQ,SACR,QAAQ,CAAC,EACP,EAAE,eAAe,EACnB,CACF,EACA,EAAK,SAAS,EAAI,EAAK,SAAS,CAEpC,C,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,A,C,C,E,A,C,E,U,K,iB,C,6C,c,C,6C,a,C,6C,qB","sources":["<anon>","packages/column-views/src/facets/fossils/index.ts"],"sourcesContent":["import \"./column-views.4ec769a6.js\";\nimport \"./column-views.109cb0c8.js\";\nimport \"./column-views.d737de1e.js\";\nimport \"./column-views.672b683c.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport \"./column-views.0af5912d.js\";\nimport $2jHE4$macrostrathyper from \"@macrostrat/hyper\";\nimport {ColumnAxisType as $2jHE4$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {scaleLinear as $2jHE4$scaleLinear} from \"d3-scale\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\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\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 $ea2f112131e22f14$exports = {};\n\n$parcel$export($ea2f112131e22f14$exports, \"PBDBFossilsColumn\", () => $ea2f112131e22f14$export$554267114407ef68);\n$parcel$export($ea2f112131e22f14$exports, \"FossilDataType\", () => (parcelRequire(\"dx7no\")).FossilDataType);\n$parcel$export($ea2f112131e22f14$exports, \"useFossilData\", () => (parcelRequire(\"dx7no\")).useFossilData);\n\n\nvar $dx7no = parcelRequire(\"dx7no\");\n\nvar $kIQUG = parcelRequire(\"kIQUG\");\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $f7qDU = parcelRequire(\"f7qDU\");\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\nvar $6dOaS = parcelRequire(\"6dOaS\");\nconst $ea2f112131e22f14$var$h = (0, $2jHE4$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($f7qDU))));\nfunction $ea2f112131e22f14$export$554267114407ef68({ columnID: columnID, type: type = (0, $dx7no.FossilDataType).Collections }) {\n const data = (0, $dx7no.useFossilData)(columnID, type);\n const { axisType: axisType, units: units } = (0, $wtIgl.useMacrostratColumnData)();\n const scale = (0, $wtIgl.useCompositeScale)();\n if (data == null || units == null || scale == null) return null;\n const data1 = $ea2f112131e22f14$var$preparePBDBData(data, units, scale, axisType);\n return $ea2f112131e22f14$var$h((0, $kIQUG.BaseMeasurementsColumn), {\n data: data1,\n noteComponent: $ea2f112131e22f14$var$FossilInfo,\n focusedNoteComponent: $ea2f112131e22f14$var$FossilInfo,\n className: \"fossil-collections\"\n });\n}\nfunction $ea2f112131e22f14$var$FossilInfo(props) {\n const { note: note, maxItems: maxItems, focused: focused = false } = props;\n const { data: data } = note;\n // Sort collections by name\n data.sort((a, b)=>{\n const nameA = a.best_name ?? a.cltn_name ?? \"\";\n const nameB = b.best_name ?? b.cltn_name ?? \"\";\n return nameA.localeCompare(nameB);\n });\n return $ea2f112131e22f14$var$h((0, $kIQUG.TruncatedList), {\n data: data,\n className: \"fossil-collections\",\n itemRenderer: $ea2f112131e22f14$var$PBDBCollectionLink,\n maxItems: focused ? Infinity : maxItems ?? 5\n });\n}\nfunction $ea2f112131e22f14$var$PBDBCollectionLink({ data: data }) {\n /** A link to a PBDB collection that handles either an occurrence or collection object */ return $ea2f112131e22f14$var$h(\"a.link-id\", {\n href: `https://paleobiodb.org/app/collections#display=col:${data.cltn_id}`,\n target: \"_blank\",\n onClick (e) {\n e.stopPropagation();\n }\n }, data.best_name ?? data.cltn_name);\n}\nfunction $ea2f112131e22f14$var$preparePBDBData(data, units, scale, axisType, options) {\n /** Prepare PBDB fossil data for display in a measurements column */ const { groupCloseNotes: groupCloseNotes = true } = options ?? {};\n const groupDistance = typeof groupCloseNotes === \"number\" ? groupCloseNotes : 10;\n // Map of data to its defined height ranges\n const dataMap = new Map();\n // Todo: if we wanted, we could add a step where we group notes that are too close together here...\n for (const d of data){\n const range = $ea2f112131e22f14$var$getHeightRangeForPBDBEntity(d, units, axisType);\n if (range == null) continue;\n const { height: height, top_height: top_height } = range;\n // compose the key based on height info\n let key = `${height}`;\n if (top_height != null) key += `-${top_height}`;\n // Group by height key\n if (!dataMap.has(key)) dataMap.set(key, {\n height: height,\n top_height: top_height ?? height,\n data: [],\n id: key\n });\n dataMap.get(key).data.push(d);\n }\n return (0, $kIQUG.groupNotesByPixelDistance)(Array.from(dataMap.values()), scale, axisType, groupDistance);\n}\nfunction $ea2f112131e22f14$var$getHeightRangeForPBDBEntity(d, units, axisType) {\n let height = null;\n if (d.slb != null && d.slu == \"mbsf\") {\n // Meters below sea floor - special case for eODP where we have\n // specific depth data referenced\n height = Number(d.slb);\n if (axisType === (0, $2jHE4$ColumnAxisType).DEPTH) // Data is already in depth units\n return {\n height: height\n };\n }\n if (d.unit_id == null) return null;\n if (height != null) {\n // If we have both height and unit info, we need to adjust the height\n // to fit whatever scale type we're using.\n // TODO: we could improve how this works by having concurrent age and\n // height scales, which would allow us to do this without having to\n // reference to a specific unit.\n const unit = units.find((u)=>u.unit_id === d.unit_id);\n if (unit == null) return null;\n const relHeight = $ea2f112131e22f14$var$getRelativePositionInUnit(height, unit, (0, $2jHE4$ColumnAxisType).DEPTH);\n if (relHeight == null) return null;\n height = (0, $iWhRv.getPositionWithinUnit)(relHeight, unit, axisType);\n return {\n height: height\n };\n }\n // We can just get the height within the unit, clipped to the unit boundaries\n return (0, $kIQUG.standardizeMeasurementHeight)({\n unit_id: d.unit_id\n }, units, axisType);\n}\nfunction $ea2f112131e22f14$var$getRelativePositionInUnit(pos, unit, axisType) {\n // This is the inverse of getPositionWithinUnit\n const heights = (0, $iWhRv.getUnitHeightRange)(unit, axisType, false);\n const scale = (0, $2jHE4$scaleLinear)(heights).domain([\n 0,\n 1\n ]);\n const relPos = scale.invert(pos);\n if (relPos < 0 || relPos > 1) return null;\n return relPos;\n}\n$parcel$exportWildcard($ea2f112131e22f14$exports, $6dOaS);\n\n\nexport {$ea2f112131e22f14$export$554267114407ef68 as PBDBFossilsColumn, $8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType, $8e174c7ae24a4598$export$e6af757fa9780077 as useFossilData, $9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix};\n//# sourceMappingURL=column-views.add5e42b.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport {\n FossilDataType,\n type PBDBCollection,\n type PBDBEntity,\n type PBDBOccurrence,\n useFossilData,\n} from \"./provider\";\nimport type { IUnit } from \"../../units\";\nimport {\n BaseMeasurementsColumn,\n ColumnMeasurementData,\n MeasurementHeightData,\n standardizeMeasurementHeight,\n groupNotesByPixelDistance,\n TruncatedList,\n} from \"../measurements\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n} from \"../../data-provider\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport styles from \"./taxon-ranges.module.sass\";\nimport {\n CompositeColumnScale,\n getPositionWithinUnit,\n getUnitHeightRange,\n} from \"../../prepare-units\";\nimport { scaleLinear } from \"d3-scale\";\n\nexport {\n FossilDataType,\n type PBDBCollection,\n type PBDBEntity,\n type PBDBOccurrence,\n useFossilData,\n};\nexport * from \"./taxon-ranges\";\n\nconst h = hyper.styled(styles);\n\nexport function PBDBFossilsColumn({\n columnID,\n type = FossilDataType.Collections,\n}: {\n columnID: number;\n type: FossilDataType;\n}) {\n const data = useFossilData(columnID, type);\n const { axisType, units } = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n if (data == null || units == null || scale == null) return null;\n\n const data1 = preparePBDBData(data, units, scale, axisType);\n\n return h(BaseMeasurementsColumn, {\n data: data1,\n noteComponent: FossilInfo,\n focusedNoteComponent: FossilInfo,\n className: \"fossil-collections\",\n });\n}\n\ninterface FossilItemProps {\n note: {\n data: PBDBCollection[];\n unit?: IUnit;\n };\n spacing?: {\n below?: number;\n above?: number;\n };\n width?: number;\n height?: number;\n color?: string;\n focused?: boolean;\n maxItems?: number;\n}\n\nfunction FossilInfo(props: FossilItemProps) {\n const { note, maxItems, focused = false } = props;\n const { data } = note;\n // Sort collections by name\n data.sort((a, b) => {\n const nameA = a.best_name ?? a.cltn_name ?? \"\";\n const nameB = b.best_name ?? b.cltn_name ?? \"\";\n return nameA.localeCompare(nameB);\n });\n\n return h(TruncatedList, {\n data,\n className: \"fossil-collections\",\n itemRenderer: PBDBCollectionLink,\n maxItems: focused ? Infinity : (maxItems ?? 5),\n });\n}\n\nfunction PBDBCollectionLink({\n data,\n}: {\n data: PBDBCollection | PBDBOccurrence;\n}) {\n /** A link to a PBDB collection that handles either an occurrence or collection object */\n return h(\n \"a.link-id\",\n {\n href: `https://paleobiodb.org/app/collections#display=col:${data.cltn_id}`,\n target: \"_blank\",\n onClick(e) {\n e.stopPropagation();\n },\n },\n data.best_name ?? data.cltn_name,\n );\n}\n\ninterface PreparePBDBDataOptions {\n /** If set, group close notes within this distance (in pixels in display space)\n * into a single note. If a number is provided, that number is used as the distance,\n * otherwise a default of 5 pixels is used.\n */\n groupCloseNotes?: boolean | number;\n}\n\nfunction preparePBDBData<T extends PBDBEntity>(\n data: T[],\n units: UnitLong[],\n scale: CompositeColumnScale,\n axisType: ColumnAxisType,\n options?: PreparePBDBDataOptions,\n) {\n /** Prepare PBDB fossil data for display in a measurements column */\n const { groupCloseNotes = true } = options ?? {};\n const groupDistance =\n typeof groupCloseNotes === \"number\" ? groupCloseNotes : 10;\n\n // Map of data to its defined height ranges\n const dataMap = new Map<string, ColumnMeasurementData<T[]>>();\n\n // Todo: if we wanted, we could add a step where we group notes that are too close together here...\n\n for (const d of data) {\n const range = getHeightRangeForPBDBEntity(d, units, axisType);\n\n if (range == null) continue;\n const { height, top_height } = range;\n // compose the key based on height info\n let key = `${height}`;\n if (top_height != null) {\n key += `-${top_height}`;\n }\n\n // Group by height key\n if (!dataMap.has(key)) {\n dataMap.set(key, {\n height,\n top_height: top_height ?? height,\n data: [],\n id: key,\n });\n }\n dataMap.get(key)!.data.push(d);\n }\n\n return groupNotesByPixelDistance(\n Array.from(dataMap.values()),\n scale,\n axisType,\n groupDistance,\n );\n}\n\nfunction getHeightRangeForPBDBEntity<T extends PBDBEntity>(\n d: T,\n units: UnitLong[],\n axisType: ColumnAxisType,\n): MeasurementHeightData | null {\n let height: number | null = null;\n if (d.slb != null && d.slu == \"mbsf\") {\n // Meters below sea floor - special case for eODP where we have\n // specific depth data referenced\n height = Number(d.slb);\n if (axisType === ColumnAxisType.DEPTH) {\n // Data is already in depth units\n return { height };\n }\n }\n if (d.unit_id == null) return null;\n if (height != null) {\n // If we have both height and unit info, we need to adjust the height\n // to fit whatever scale type we're using.\n // TODO: we could improve how this works by having concurrent age and\n // height scales, which would allow us to do this without having to\n // reference to a specific unit.\n const unit = units.find((u) => u.unit_id === d.unit_id);\n if (unit == null) return null;\n const relHeight = getRelativePositionInUnit(\n height,\n unit,\n ColumnAxisType.DEPTH,\n );\n if (relHeight == null) return null;\n height = getPositionWithinUnit(relHeight, unit, axisType);\n return { height };\n }\n // We can just get the height within the unit, clipped to the unit boundaries\n return standardizeMeasurementHeight({ unit_id: d.unit_id }, units, axisType);\n}\n\nfunction getRelativePositionInUnit(\n pos: number,\n unit: UnitLong,\n axisType: ColumnAxisType,\n): number | null {\n // This is the inverse of getPositionWithinUnit\n const heights = getUnitHeightRange(unit, axisType, false);\n const scale = scaleLinear(heights).domain([0, 1]);\n const relPos = scale.invert(pos);\n if (relPos < 0 || relPos > 1) return null;\n return relPos;\n}\n"],"names":["$2jHE4$macrostrathyper","ColumnAxisType","$2jHE4$ColumnAxisType","scaleLinear","$2jHE4$scaleLinear","$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","$ea2f112131e22f14$exports","$ea2f112131e22f14$export$554267114407ef68","FossilDataType","useFossilData","$dx7no","$kIQUG","$wtIgl","$f7qDU","$iWhRv","$6dOaS","$ea2f112131e22f14$var$h","styled","a","__esModule","default","columnID","type","Collections","data","axisType","units","useMacrostratColumnData","scale","useCompositeScale","data1","$ea2f112131e22f14$var$preparePBDBData","options","groupCloseNotes","dataMap","Map","d","range","$ea2f112131e22f14$var$getHeightRangeForPBDBEntity","height","slb","slu","Number","DEPTH","unit_id","unit","find","u","relHeight","$ea2f112131e22f14$var$getRelativePositionInUnit","pos","relPos","getUnitHeightRange","domain","invert","getPositionWithinUnit","standardizeMeasurementHeight","top_height","key","has","push","groupNotesByPixelDistance","Array","from","values","BaseMeasurementsColumn","noteComponent","$ea2f112131e22f14$var$FossilInfo","focusedNoteComponent","className","props","note","maxItems","focused","sort","b","nameA","best_name","cltn_name","nameB","localeCompare","TruncatedList","itemRenderer","$ea2f112131e22f14$var$PBDBCollectionLink","Infinity","href","cltn_id","target","onClick","stopPropagation","keys","forEach","prototype","hasOwnProperty","source","PBDBFossilsColumn","$8e174c7ae24a4598$export$a990c76b38782f57","$8e174c7ae24a4598$export$e6af757fa9780077","$9cea14fa75e12a56$export$652730986cccff7a","PBDBOccurrencesMatrix"],"version":3,"file":"column-views.add5e42b.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.c651b684.js";import"./column-views.ebb44b7d.js";function e(e,r){return Object.keys(r).forEach(function(t){"default"===t||"__esModule"===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})}),e}var r=globalThis,t={},o={},n=r.parcelRequirea149;null==n&&((n=function(e){if(e in t)return t[e].exports;if(e in o){var r=o[e];delete o[e];var n={id:e,exports:{}};return t[e]=n,r.call(n.exports,n,n.exports),n.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,r){o[e]=r},r.parcelRequirea149=n),n.register;var a={},c=n("ccQ40"),i=n("dd0Et");e(a,c),e(a,i);export{$25f1fcddbe40b91f$export$9ebf875c09445bec as CorrelationChart,$7e37f2a9ef0a1013$export$77c3cc7a57c6db5f as parseLineFromString,$7e37f2a9ef0a1013$export$8c53992169ff5301 as stringifyLine};
|
|
2
|
+
//# sourceMappingURL=column-views.b2e5f823.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,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,G,E,E,U,6C,gB,C,6C,mB,C,6C,a","sources":["<anon>","packages/column-views/src/correlation-chart/index.ts"],"sourcesContent":["import \"./column-views.
|
|
1
|
+
{"mappings":"A,M,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,G,E,E,U,6C,gB,C,6C,mB,C,6C,a","sources":["<anon>","packages/column-views/src/correlation-chart/index.ts"],"sourcesContent":["import \"./column-views.c651b684.js\";\nimport \"./column-views.ebb44b7d.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 $53af365ed50b7b69$exports = {};\n\nvar $ccQ40 = parcelRequire(\"ccQ40\");\n\nvar $dd0Et = parcelRequire(\"dd0Et\");\n$parcel$exportWildcard($53af365ed50b7b69$exports, $ccQ40);\n$parcel$exportWildcard($53af365ed50b7b69$exports, $dd0Et);\n\n\nexport {$25f1fcddbe40b91f$export$9ebf875c09445bec as CorrelationChart, $7e37f2a9ef0a1013$export$77c3cc7a57c6db5f as parseLineFromString, $7e37f2a9ef0a1013$export$8c53992169ff5301 as stringifyLine};\n//# sourceMappingURL=column-views.b2e5f823.js.map\n","export * from \"./main\";\nexport * from \"./hash-string\";\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","$53af365ed50b7b69$exports","$ccQ40","$dd0Et","$25f1fcddbe40b91f$export$9ebf875c09445bec","CorrelationChart","$7e37f2a9ef0a1013$export$77c3cc7a57c6db5f","parseLineFromString","$7e37f2a9ef0a1013$export$8c53992169ff5301","stringifyLine"],"version":3,"file":"column-views.b2e5f823.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.e7e26765.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.e7e26765.js";import"./column-views.2e2158f5.js";import"./column-views.7b6e7d82.js";import"./column-views.cdcce702.js";import"./column-views.dbb4a46b.js";import"./column-views.6bba8c57.js";import{ColumnAxisType as e,ColumnContext as t,ColumnLayoutContext as o,useColumn as i,useGeologicPattern as a,zigZagBoxPath as n,ForeignObject as r,PatternDefsProvider as l}from"@macrostrat/column-components";import{SizeAwareLabel as s}from"@macrostrat/ui-components";import c from"@macrostrat/hyper";import{useContext as u,forwardRef as d,useMemo as m}from"react";import p from"classnames";var f=globalThis,b={},h={},g=f.parcelRequirea149;null==g&&((g=function(e){if(e in b)return b[e].exports;if(e in h){var t=h[e];delete h[e];var o={id:e,exports:{}};return b[e]=o,t.call(o.exports,o,o.exports),o.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){h[e]=t},f.parcelRequirea149=g),g.register;var v=g("5VyZI"),x=g("lgTAP"),w=g("5SO8b"),y=g("klU0I"),C=g("iWhRv"),_=g("bfmPX");let T=c.styled(y&&y.__esModule?y.default:y);function F(i,a={}){let{widthFraction:n=1,axisType:r=e.AGE,padding:l=0}=a,{scale:s}=u(t),{width:c}=u(o),[d,m]=(0,C.getUnitHeightRange)(i,r),p=s(m),f=Math.abs(s(d)-p);return{x:c*(1-n)-l,y:p-l,height:f+2*l,width:n*c+2*l}}function k(e){let{division:t,children:o,className:a,widthFraction:n=1,axisType:r,nColumns:l,...s}=e,{axisType:c}=i(),u=(0,x.useLithologies)(),d={...F(t,{widthFraction:n,axisType:c}),...s},m=(0,_.getMixedUnitColor)(t,u,null,!1),[p,f,b]=(0,w.useUnitSelectionTarget)(t);return T("g.unit",{className:a,style:{"--column-unit-background-color":m,"--column-stroke-color":m}},[T("rect.unit.background",{ref:p,...d,fill:m,fillOpacity:.8,stroke:m,onClick:b}),T.if(f)("rect.selection-overlay",d)])}function N(e){let{division:t,children:o,fill:n,defaultFill:r="transparent",className:l,widthFraction:s=1,backgroundColor:c,patternColor:u,patternID:d,axisType:m,...f}=e,{axisType:b}=i(),h=null!=t.t_clip_pos,g=null!=t.b_clip_pos,x={...F(t,{widthFraction:s,axisType:b}),...f,overflowTop:h,overflowBottom:g},y=d??(0,v.resolveID)(t),C=n??a(y,r),_=p(l,{colored:null!=c}),[k,N,U]=(0,w.useUnitSelectionTarget)(t);return T("g.unit",{className:_,style:{"--column-unit-background-color":c}},[T(H,{...x,fill:c,onClick:U,className:"background"}),T(H,{ref:k,...x,fill:C,onClick:U,className:"unit"}),T.if(N)(H,{...x,className:"selection-overlay"}),o])}let H=d((e,t)=>{let{x:o,y:i,width:a,height:r,overflowTop:l=!1,overflowBottom:s=!1,...c}=e;return l||s?T("path",{d:n(o,i,a,r,l,s),ref:t,...c}):T("rect",{x:o,y:i,width:a,height:r,ref:t,...c})});function U(e){let{division:t,label:o,onLabelUpdated:a,widthFraction:n,showLabel:l=!0,backgroundColor:c,patternID:u,axisType:d,...m}=e,{axisType:p}=i(),f={...F(t,{widthFraction:n,axisType:p}),...m},{width:b,height:h}=f;return T(N,{className:"labeled-unit",division:t,backgroundColor:c,patternID:u,...f},[T.if(l)(r,{...f,className:"unit-label-container"},T(s,{className:"unit-overlay",labelClassName:"unit-label",style:{width:b,height:h},label:o,onVisibilityChanged(e){a(o,e)}}))])}function $(e){let{unitComponent:o=N,unitComponentProps:i={}}=e,{divisions:a}=u(t);if(0==a.length)return console.warn("No divisions found in column context"),null;let n=m(()=>a.map((e,t)=>T(o,{division:e,key:e.unit_id,...i})),[a,o,i]);return T(l,{resolveID:v.resolveID,scalePattern:v.scalePattern},T("g.divisions",n))}export{k as MinimalUnit,N as Unit,U as LabeledUnit,$ as UnitBoxes};
|
|
2
|
+
//# sourceMappingURL=column-views.b57e5e6e.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,Q,kB,C,C,iB,C,C,uB,C,C,a,C,C,sB,C,C,iB,C,C,iB,C,C,uB,C,K,+B,A,Q,kB,C,K,2B,A,Q,M,mB,A,Q,c,C,C,c,C,C,W,C,K,O,A,Q,M,Y,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCsBA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAkCvB,SAAS,EACP,CAAe,CACf,EAA2B,CAAC,CAAC,EAE7B,GAAM,CAAA,cACJ,EAAgB,CAAA,CAAA,SAChB,EAAW,AAAA,EAAe,GAAG,CAAA,QAC7B,EAAU,CAAA,CACX,CAAG,EACE,CAAA,MAAE,CAAK,CAAE,CAAG,AAAA,EAAW,GACvB,CAAA,MAAE,CAAK,CAAE,CAAG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EAAe,EAAmB,EAEjD,OAAO,EACL,EACA,CAAE,UAAA,EAAA,SAAA,CAAW,aAAA,EAAA,YAAA,AAAa,EAC1B,EAAE,cAAe,GAErB,Q,K,W,C,K,I,C,K,W,C,K,S","sources":["<anon>","packages/column-views/src/units/boxes.ts"],"sourcesContent":["import \"./column-views.e7e26765.js\";\nimport \"./column-views.080781ca.js\";\nimport \"./column-views.7b6e7d82.js\";\nimport \"./column-views.cdcce702.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport \"./column-views.6bba8c57.js\";\nimport {ColumnAxisType as $jfrfr$ColumnAxisType, ColumnContext as $jfrfr$ColumnContext, ColumnLayoutContext as $jfrfr$ColumnLayoutContext, useColumn as $jfrfr$useColumn, useGeologicPattern as $jfrfr$useGeologicPattern, zigZagBoxPath as $jfrfr$zigZagBoxPath, ForeignObject as $jfrfr$ForeignObject, PatternDefsProvider as $jfrfr$PatternDefsProvider} from \"@macrostrat/column-components\";\nimport {SizeAwareLabel as $jfrfr$SizeAwareLabel} from \"@macrostrat/ui-components\";\nimport $jfrfr$macrostrathyper from \"@macrostrat/hyper\";\nimport {useContext as $jfrfr$useContext, forwardRef as $jfrfr$forwardRef, useMemo as $jfrfr$useMemo} from \"react\";\nimport $jfrfr$classnames from \"classnames\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\n\nvar $5VyZI = parcelRequire(\"5VyZI\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\n\nvar $klU0I = parcelRequire(\"klU0I\");\n\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\nvar $bfmPX = parcelRequire(\"bfmPX\");\nconst $82e068a44c11e855$var$h = (0, $jfrfr$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($klU0I))));\nfunction $82e068a44c11e855$var$useUnitRect(division, options = {}) {\n const { widthFraction: widthFraction = 1, axisType: axisType = (0, $jfrfr$ColumnAxisType).AGE, padding: padding = 0 } = options;\n const { scale: scale } = (0, $jfrfr$useContext)((0, $jfrfr$ColumnContext));\n const { width: width } = (0, $jfrfr$useContext)((0, $jfrfr$ColumnLayoutContext));\n const [bottomHeight, topHeight] = (0, $iWhRv.getUnitHeightRange)(division, axisType);\n const y = scale(topHeight);\n const height = Math.abs(scale(bottomHeight) - y);\n return {\n x: width * (1 - widthFraction) - padding,\n y: y - padding,\n height: height + padding * 2,\n width: widthFraction * width + padding * 2\n };\n}\nfunction $82e068a44c11e855$export$d54fdbabca27e53(props) {\n const { division: d, children: children, className: className, widthFraction: widthFraction = 1, axisType: _, nColumns: __, ...baseBounds } = props;\n const { axisType: axisType } = (0, $jfrfr$useColumn)();\n const lithMap = (0, $lgTAP.useLithologies)();\n const bounds = {\n ...$82e068a44c11e855$var$useUnitRect(d, {\n widthFraction: widthFraction,\n axisType: axisType\n }),\n ...baseBounds\n };\n const backgroundColor = (0, $bfmPX.getMixedUnitColor)(d, lithMap, null, false);\n const [ref, selected, onClick] = (0, $5SO8b.useUnitSelectionTarget)(d);\n return $82e068a44c11e855$var$h(\"g.unit\", {\n className: className,\n style: {\n \"--column-unit-background-color\": backgroundColor,\n \"--column-stroke-color\": backgroundColor\n }\n }, [\n $82e068a44c11e855$var$h(\"rect.unit.background\", {\n ref: ref,\n ...bounds,\n fill: backgroundColor,\n fillOpacity: 0.8,\n stroke: backgroundColor,\n onClick: onClick\n }),\n $82e068a44c11e855$var$h.if(selected)(\"rect.selection-overlay\", bounds)\n ]);\n}\nfunction $82e068a44c11e855$export$1d8b9ae22d404866(props) {\n const { division: d, children: children, fill: fill, defaultFill: defaultFill = \"transparent\", className: className, widthFraction: widthFraction = 1, backgroundColor: backgroundColor, patternColor: patternColor, patternID: patternID, axisType: _, ...baseBounds } = props;\n const { axisType: axisType } = (0, $jfrfr$useColumn)();\n const hasOverflowTop = d.t_clip_pos != null;\n const hasOverflowBottom = d.b_clip_pos != null;\n const bounds = {\n ...$82e068a44c11e855$var$useUnitRect(d, {\n widthFraction: widthFraction,\n axisType: axisType\n }),\n ...baseBounds,\n overflowTop: hasOverflowTop,\n overflowBottom: hasOverflowBottom\n };\n const _patternID = patternID ?? (0, $5VyZI.resolveID)(d);\n let _fill = fill ?? (0, $jfrfr$useGeologicPattern)(_patternID, defaultFill);\n const hasBackgroundColor = backgroundColor != null;\n const _className = (0, $jfrfr$classnames)(className, {\n colored: hasBackgroundColor\n });\n const [ref, selected, onClick] = (0, $5SO8b.useUnitSelectionTarget)(d);\n return $82e068a44c11e855$var$h(\"g.unit\", {\n className: _className,\n style: {\n \"--column-unit-background-color\": backgroundColor\n }\n }, [\n $82e068a44c11e855$var$h($82e068a44c11e855$var$UnitRect, {\n ...bounds,\n fill: backgroundColor,\n onClick: onClick,\n className: \"background\"\n }),\n $82e068a44c11e855$var$h($82e068a44c11e855$var$UnitRect, {\n ref: ref,\n ...bounds,\n fill: _fill,\n onClick: //mask,\n onClick,\n className: \"unit\"\n }),\n $82e068a44c11e855$var$h.if(selected)($82e068a44c11e855$var$UnitRect, {\n ...bounds,\n className: \"selection-overlay\"\n }),\n //defs,\n children\n ]);\n}\nconst $82e068a44c11e855$var$UnitRect = (0, $jfrfr$forwardRef)((props, ref)=>{\n const { x: x, y: y, width: width, height: height, overflowTop: overflowTop = false, overflowBottom: overflowBottom = false, ...rest } = props;\n if (!overflowTop && !overflowBottom) return $82e068a44c11e855$var$h(\"rect\", {\n x: x,\n y: y,\n width: width,\n height: height,\n ref: ref,\n ...rest\n });\n else {\n const d = (0, $jfrfr$zigZagBoxPath)(x, y, width, height, overflowTop, overflowBottom);\n return $82e068a44c11e855$var$h(\"path\", {\n d: d,\n ref: ref,\n ...rest\n });\n }\n});\nfunction $82e068a44c11e855$export$b4f0ca233b98f9af(props) {\n const { division: division, label: label, onLabelUpdated: onLabelUpdated, widthFraction: widthFraction, showLabel: showLabel = true, backgroundColor: backgroundColor, patternID: patternID, axisType: _, ...baseBounds } = props;\n const { axisType: axisType } = (0, $jfrfr$useColumn)();\n const bounds = {\n ...$82e068a44c11e855$var$useUnitRect(division, {\n widthFraction: widthFraction,\n axisType: axisType\n }),\n ...baseBounds\n };\n const { width: width, height: height } = bounds;\n return $82e068a44c11e855$var$h($82e068a44c11e855$export$1d8b9ae22d404866, {\n className: \"labeled-unit\",\n division: division,\n backgroundColor: backgroundColor,\n patternID: patternID,\n ...bounds\n }, [\n $82e068a44c11e855$var$h.if(showLabel)((0, $jfrfr$ForeignObject), {\n ...bounds,\n className: \"unit-label-container\"\n }, $82e068a44c11e855$var$h((0, $jfrfr$SizeAwareLabel), {\n className: \"unit-overlay\",\n labelClassName: \"unit-label\",\n style: {\n width: width,\n height: height\n },\n label: label,\n onVisibilityChanged (viz) {\n onLabelUpdated(label, viz);\n }\n }))\n ]);\n}\nfunction $82e068a44c11e855$export$5d1cdfabe8dc8085(props) {\n const { unitComponent: unitComponent = $82e068a44c11e855$export$1d8b9ae22d404866, unitComponentProps: unitComponentProps = {} } = props;\n const { divisions: divisions } = (0, $jfrfr$useContext)((0, $jfrfr$ColumnContext));\n if (divisions.length == 0) {\n console.warn(\"No divisions found in column context\");\n return null;\n }\n const children = (0, $jfrfr$useMemo)(()=>{\n return divisions.map((division, i)=>{\n // @ts-ignore\n return $82e068a44c11e855$var$h(unitComponent, {\n division: division,\n key: division.unit_id,\n ...unitComponentProps\n });\n });\n }, [\n divisions,\n unitComponent,\n unitComponentProps\n ]);\n return $82e068a44c11e855$var$h((0, $jfrfr$PatternDefsProvider), {\n resolveID: $5VyZI.resolveID,\n scalePattern: $5VyZI.scalePattern\n }, $82e068a44c11e855$var$h(\"g.divisions\", children));\n}\n\n\nexport {$82e068a44c11e855$export$d54fdbabca27e53 as MinimalUnit, $82e068a44c11e855$export$1d8b9ae22d404866 as Unit, $82e068a44c11e855$export$b4f0ca233b98f9af as LabeledUnit, $82e068a44c11e855$export$5d1cdfabe8dc8085 as UnitBoxes};\n//# sourceMappingURL=column-views.64fc40d6.js.map\n","import {\n ColumnAxisType,\n ColumnContext,\n ColumnLayoutContext,\n ForeignObject,\n PatternDefsProvider,\n useColumn,\n useGeologicPattern,\n zigZagBoxPath,\n} from \"@macrostrat/column-components\";\nimport { SizeAwareLabel, Clickable } from \"@macrostrat/ui-components\";\nimport hyper from \"@macrostrat/hyper\";\nimport { forwardRef, ReactNode, useContext, useMemo } from \"react\";\nimport { resolveID, scalePattern } from \"./resolvers\";\nimport { useUnitSelectionTarget, useLithologies } from \"../data-provider\";\nimport { IUnit } from \"./types\";\nimport styles from \"./boxes.module.sass\";\nimport classNames from \"classnames\";\nimport { getUnitHeightRange } from \"../prepare-units/utils\";\nimport { getMixedUnitColor } from \"./colors\";\nimport type { RectBounds } from \"./types\";\n\nconst h = hyper.styled(styles);\n\ninterface UnitRectOptions {\n widthFraction?: number;\n axisType?: ColumnAxisType;\n // Padding to create overflow for zig-zags or other ornamented edges\n padding?: number;\n}\n\ninterface UnitProps extends Clickable, Partial<RectBounds>, UnitRectOptions {\n division: IUnit;\n resolveID?(IUnit): string;\n UUID?: string;\n defaultFill?: string;\n widthFraction?: number;\n children?: ReactNode;\n className?: string;\n fill?: string;\n backgroundColor?: string;\n patternColor?: string;\n patternID?: string | number;\n}\n\nexport interface LabeledUnitProps\n extends UnitRectOptions, Clickable, Partial<RectBounds> {\n division: IUnit;\n patternID?: string | number;\n label: string;\n onLabelUpdated?(label: string, shown: boolean);\n halfWidth?: boolean;\n showLabel?: boolean;\n backgroundColor?: string;\n}\n\nfunction useUnitRect(\n division: IUnit,\n options: UnitRectOptions = {},\n): RectBounds {\n const {\n widthFraction = 1,\n axisType = ColumnAxisType.AGE,\n padding = 0,\n } = options;\n const { scale } = useContext(ColumnContext);\n const { width } = useContext(ColumnLayoutContext);\n\n const [bottomHeight, topHeight] = getUnitHeightRange(division, axisType);\n\n const y = scale(topHeight);\n const height = Math.abs(scale(bottomHeight) - y);\n\n return {\n x: width * (1 - widthFraction) - padding,\n y: y - padding,\n height: height + padding * 2,\n width: widthFraction * width + padding * 2,\n };\n}\n\nexport function MinimalUnit(props) {\n const {\n division: d,\n children,\n className,\n widthFraction = 1,\n axisType: _, // not sure why this is brought in...\n nColumns: __,\n ...baseBounds\n } = props;\n\n const { axisType } = useColumn();\n const lithMap = useLithologies();\n const bounds = {\n ...useUnitRect(d, { widthFraction, axisType }),\n ...baseBounds,\n };\n\n const backgroundColor = getMixedUnitColor(d, lithMap, null, false);\n\n const [ref, selected, onClick] = useUnitSelectionTarget(d);\n\n return h(\n \"g.unit\",\n {\n className,\n style: {\n \"--column-unit-background-color\": backgroundColor,\n \"--column-stroke-color\": backgroundColor,\n },\n },\n [\n h(\"rect.unit.background\", {\n ref,\n ...bounds,\n fill: backgroundColor,\n fillOpacity: 0.8,\n stroke: backgroundColor,\n onClick,\n }),\n h.if(selected)(\"rect.selection-overlay\", bounds),\n ],\n );\n}\n\nfunction Unit(props: UnitProps) {\n const {\n division: d,\n children,\n fill,\n defaultFill = \"transparent\",\n className,\n widthFraction = 1,\n backgroundColor,\n patternColor,\n patternID,\n axisType: _, // not sure why this is brought in...\n ...baseBounds\n } = props;\n\n const { axisType } = useColumn();\n\n const hasOverflowTop = d.t_clip_pos != null;\n const hasOverflowBottom = d.b_clip_pos != null;\n\n const bounds = {\n ...useUnitRect(d, { widthFraction, axisType }),\n ...baseBounds,\n overflowTop: hasOverflowTop,\n overflowBottom: hasOverflowBottom,\n };\n const _patternID = patternID ?? resolveID(d);\n let _fill = fill ?? useGeologicPattern(_patternID, defaultFill);\n\n const hasBackgroundColor = backgroundColor != null;\n\n const _className = classNames(className, { colored: hasBackgroundColor });\n\n const [ref, selected, onClick] = useUnitSelectionTarget(d);\n\n return h(\n \"g.unit\",\n {\n className: _className,\n style: {\n \"--column-unit-background-color\": backgroundColor,\n },\n },\n [\n h(UnitRect, {\n ...bounds,\n fill: backgroundColor,\n onClick,\n className: \"background\",\n }),\n h(UnitRect, {\n ref,\n ...bounds,\n fill: _fill,\n //mask,\n onClick,\n className: \"unit\",\n }),\n h.if(selected)(UnitRect, { ...bounds, className: \"selection-overlay\" }),\n //defs,\n children,\n ],\n );\n}\n\ninterface UnitRectProps {\n x: number;\n y: number;\n width: number;\n height: number;\n className: string;\n // Used to determine if the rect should have a zig-zag edge on the top or bottom\n overflowTop?: boolean;\n overflowBottom?: boolean;\n [key: string]: any;\n}\n\nconst UnitRect = forwardRef((props: UnitRectProps, ref) => {\n const {\n x,\n y,\n width,\n height,\n overflowTop = false,\n overflowBottom = false,\n ...rest\n } = props;\n\n if (!overflowTop && !overflowBottom) {\n return h(\"rect\", {\n x,\n y,\n width,\n height,\n ref,\n ...rest,\n });\n } else {\n const d = zigZagBoxPath(x, y, width, height, overflowTop, overflowBottom);\n return h(\"path\", {\n d,\n ref,\n ...rest,\n });\n }\n});\n\nfunction LabeledUnit(props: LabeledUnitProps) {\n const {\n division,\n label,\n onLabelUpdated,\n widthFraction,\n showLabel = true,\n backgroundColor,\n patternID,\n axisType: _, // not sure why this is brought in...\n ...baseBounds\n } = props;\n\n const { axisType } = useColumn();\n const bounds = {\n ...useUnitRect(division, { widthFraction, axisType }),\n ...baseBounds,\n };\n const { width, height } = bounds;\n return h(\n Unit,\n {\n className: \"labeled-unit\",\n division,\n backgroundColor,\n patternID,\n ...bounds,\n },\n [\n h.if(showLabel)(\n ForeignObject,\n { ...bounds, className: \"unit-label-container\" },\n h(SizeAwareLabel, {\n className: \"unit-overlay\",\n labelClassName: \"unit-label\",\n style: { width, height },\n label,\n onVisibilityChanged(viz) {\n onLabelUpdated(label, viz);\n },\n }),\n ),\n ],\n );\n}\n\nfunction UnitBoxes<T>(props: {\n unitComponent: React.FunctionComponent<{ division: T }>;\n unitComponentProps?: any;\n transformDivisions?(divisions: T[]): T[];\n transformDivision?: (\n division: any,\n index: number,\n divisions: any[],\n ) => T | null;\n}) {\n const { unitComponent = Unit, unitComponentProps = {} } = props;\n const { divisions } = useContext(ColumnContext);\n\n if (divisions.length == 0) {\n console.warn(\"No divisions found in column context\");\n return null;\n }\n\n const children = useMemo(() => {\n return divisions.map((division: any, i) => {\n // @ts-ignore\n return h(unitComponent, {\n division,\n key: division.unit_id,\n ...unitComponentProps,\n });\n });\n }, [divisions, unitComponent, unitComponentProps]);\n\n return h(\n PatternDefsProvider,\n { resolveID, scalePattern },\n h(\"g.divisions\", children),\n );\n}\n\nexport { LabeledUnit, Unit, UnitBoxes, UnitProps };\n"],"names":["ColumnAxisType","$jfrfr$ColumnAxisType","ColumnContext","$jfrfr$ColumnContext","ColumnLayoutContext","$jfrfr$ColumnLayoutContext","useColumn","$jfrfr$useColumn","useGeologicPattern","$jfrfr$useGeologicPattern","zigZagBoxPath","$jfrfr$zigZagBoxPath","ForeignObject","$jfrfr$ForeignObject","PatternDefsProvider","$jfrfr$PatternDefsProvider","SizeAwareLabel","$jfrfr$SizeAwareLabel","$jfrfr$macrostrathyper","useContext","$jfrfr$useContext","forwardRef","$jfrfr$forwardRef","useMemo","$jfrfr$useMemo","$jfrfr$classnames","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$5VyZI","$lgTAP","$5SO8b","$klU0I","$iWhRv","$bfmPX","$82e068a44c11e855$var$h","styled","a","__esModule","default","$82e068a44c11e855$var$useUnitRect","division","options","widthFraction","axisType","AGE","padding","scale","width","bottomHeight","topHeight","getUnitHeightRange","y","height","Math","abs","x","$82e068a44c11e855$export$d54fdbabca27e53","props","d","children","className","_","nColumns","__","baseBounds","lithMap","useLithologies","bounds","backgroundColor","getMixedUnitColor","ref","selected","onClick","useUnitSelectionTarget","style","fill","fillOpacity","stroke","if","$82e068a44c11e855$export$1d8b9ae22d404866","defaultFill","patternColor","patternID","hasOverflowTop","t_clip_pos","hasOverflowBottom","b_clip_pos","overflowTop","overflowBottom","_patternID","resolveID","_fill","_className","colored","$82e068a44c11e855$var$UnitRect","rest","$82e068a44c11e855$export$b4f0ca233b98f9af","label","onLabelUpdated","showLabel","labelClassName","onVisibilityChanged","viz","$82e068a44c11e855$export$5d1cdfabe8dc8085","unitComponent","unitComponentProps","divisions","length","console","warn","map","i","key","unit_id","scalePattern","MinimalUnit","Unit","LabeledUnit","UnitBoxes"],"version":3,"file":"column-views.64fc40d6.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,kB,C,C,iB,C,C,uB,C,C,a,C,C,sB,C,C,iB,C,C,iB,C,C,uB,C,K,+B,A,Q,kB,C,K,2B,A,Q,M,mB,A,Q,c,C,C,c,C,C,W,C,K,O,A,Q,M,Y,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCsBA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AA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,CAAS,CAAE,CAAG,AAAA,EAAW,GAEjC,GAAI,AAAoB,GAApB,EAAU,MAAM,CAElB,OADA,QAAQ,IAAI,CAAC,wCACN,KAGT,IAAM,EAAW,AAAA,EAAQ,IAChB,EAAU,GAAG,CAAC,CAAC,EAAe,IAE5B,EAAE,EAAe,CACtB,SAAA,EACA,IAAK,EAAS,OAAO,CACrB,GAAG,CAAkB,AACvB,IAED,CAAC,EAAW,EAAe,EAAmB,EAEjD,OAAO,EACL,EACA,CAAE,UAAA,EAAA,SAAA,CAAW,aAAA,EAAA,YAAA,AAAa,EAC1B,EAAE,cAAe,GAErB,Q,K,W,C,K,I,C,K,W,C,K,S","sources":["<anon>","packages/column-views/src/units/boxes.ts"],"sourcesContent":["import \"./column-views.e7e26765.js\";\nimport \"./column-views.2e2158f5.js\";\nimport \"./column-views.7b6e7d82.js\";\nimport \"./column-views.cdcce702.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport \"./column-views.6bba8c57.js\";\nimport {ColumnAxisType as $jfrfr$ColumnAxisType, ColumnContext as $jfrfr$ColumnContext, ColumnLayoutContext as $jfrfr$ColumnLayoutContext, useColumn as $jfrfr$useColumn, useGeologicPattern as $jfrfr$useGeologicPattern, zigZagBoxPath as $jfrfr$zigZagBoxPath, ForeignObject as $jfrfr$ForeignObject, PatternDefsProvider as $jfrfr$PatternDefsProvider} from \"@macrostrat/column-components\";\nimport {SizeAwareLabel as $jfrfr$SizeAwareLabel} from \"@macrostrat/ui-components\";\nimport $jfrfr$macrostrathyper from \"@macrostrat/hyper\";\nimport {useContext as $jfrfr$useContext, forwardRef as $jfrfr$forwardRef, useMemo as $jfrfr$useMemo} from \"react\";\nimport $jfrfr$classnames from \"classnames\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\n\nvar $5VyZI = parcelRequire(\"5VyZI\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\n\nvar $klU0I = parcelRequire(\"klU0I\");\n\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\nvar $bfmPX = parcelRequire(\"bfmPX\");\nconst $82e068a44c11e855$var$h = (0, $jfrfr$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($klU0I))));\nfunction $82e068a44c11e855$var$useUnitRect(division, options = {}) {\n const { widthFraction: widthFraction = 1, axisType: axisType = (0, $jfrfr$ColumnAxisType).AGE, padding: padding = 0 } = options;\n const { scale: scale } = (0, $jfrfr$useContext)((0, $jfrfr$ColumnContext));\n const { width: width } = (0, $jfrfr$useContext)((0, $jfrfr$ColumnLayoutContext));\n const [bottomHeight, topHeight] = (0, $iWhRv.getUnitHeightRange)(division, axisType);\n const y = scale(topHeight);\n const height = Math.abs(scale(bottomHeight) - y);\n return {\n x: width * (1 - widthFraction) - padding,\n y: y - padding,\n height: height + padding * 2,\n width: widthFraction * width + padding * 2\n };\n}\nfunction $82e068a44c11e855$export$d54fdbabca27e53(props) {\n const { division: d, children: children, className: className, widthFraction: widthFraction = 1, axisType: _, nColumns: __, ...baseBounds } = props;\n const { axisType: axisType } = (0, $jfrfr$useColumn)();\n const lithMap = (0, $lgTAP.useLithologies)();\n const bounds = {\n ...$82e068a44c11e855$var$useUnitRect(d, {\n widthFraction: widthFraction,\n axisType: axisType\n }),\n ...baseBounds\n };\n const backgroundColor = (0, $bfmPX.getMixedUnitColor)(d, lithMap, null, false);\n const [ref, selected, onClick] = (0, $5SO8b.useUnitSelectionTarget)(d);\n return $82e068a44c11e855$var$h(\"g.unit\", {\n className: className,\n style: {\n \"--column-unit-background-color\": backgroundColor,\n \"--column-stroke-color\": backgroundColor\n }\n }, [\n $82e068a44c11e855$var$h(\"rect.unit.background\", {\n ref: ref,\n ...bounds,\n fill: backgroundColor,\n fillOpacity: 0.8,\n stroke: backgroundColor,\n onClick: onClick\n }),\n $82e068a44c11e855$var$h.if(selected)(\"rect.selection-overlay\", bounds)\n ]);\n}\nfunction $82e068a44c11e855$export$1d8b9ae22d404866(props) {\n const { division: d, children: children, fill: fill, defaultFill: defaultFill = \"transparent\", className: className, widthFraction: widthFraction = 1, backgroundColor: backgroundColor, patternColor: patternColor, patternID: patternID, axisType: _, ...baseBounds } = props;\n const { axisType: axisType } = (0, $jfrfr$useColumn)();\n const hasOverflowTop = d.t_clip_pos != null;\n const hasOverflowBottom = d.b_clip_pos != null;\n const bounds = {\n ...$82e068a44c11e855$var$useUnitRect(d, {\n widthFraction: widthFraction,\n axisType: axisType\n }),\n ...baseBounds,\n overflowTop: hasOverflowTop,\n overflowBottom: hasOverflowBottom\n };\n const _patternID = patternID ?? (0, $5VyZI.resolveID)(d);\n let _fill = fill ?? (0, $jfrfr$useGeologicPattern)(_patternID, defaultFill);\n const hasBackgroundColor = backgroundColor != null;\n const _className = (0, $jfrfr$classnames)(className, {\n colored: hasBackgroundColor\n });\n const [ref, selected, onClick] = (0, $5SO8b.useUnitSelectionTarget)(d);\n return $82e068a44c11e855$var$h(\"g.unit\", {\n className: _className,\n style: {\n \"--column-unit-background-color\": backgroundColor\n }\n }, [\n $82e068a44c11e855$var$h($82e068a44c11e855$var$UnitRect, {\n ...bounds,\n fill: backgroundColor,\n onClick: onClick,\n className: \"background\"\n }),\n $82e068a44c11e855$var$h($82e068a44c11e855$var$UnitRect, {\n ref: ref,\n ...bounds,\n fill: _fill,\n onClick: //mask,\n onClick,\n className: \"unit\"\n }),\n $82e068a44c11e855$var$h.if(selected)($82e068a44c11e855$var$UnitRect, {\n ...bounds,\n className: \"selection-overlay\"\n }),\n //defs,\n children\n ]);\n}\nconst $82e068a44c11e855$var$UnitRect = (0, $jfrfr$forwardRef)((props, ref)=>{\n const { x: x, y: y, width: width, height: height, overflowTop: overflowTop = false, overflowBottom: overflowBottom = false, ...rest } = props;\n if (!overflowTop && !overflowBottom) return $82e068a44c11e855$var$h(\"rect\", {\n x: x,\n y: y,\n width: width,\n height: height,\n ref: ref,\n ...rest\n });\n else {\n const d = (0, $jfrfr$zigZagBoxPath)(x, y, width, height, overflowTop, overflowBottom);\n return $82e068a44c11e855$var$h(\"path\", {\n d: d,\n ref: ref,\n ...rest\n });\n }\n});\nfunction $82e068a44c11e855$export$b4f0ca233b98f9af(props) {\n const { division: division, label: label, onLabelUpdated: onLabelUpdated, widthFraction: widthFraction, showLabel: showLabel = true, backgroundColor: backgroundColor, patternID: patternID, axisType: _, ...baseBounds } = props;\n const { axisType: axisType } = (0, $jfrfr$useColumn)();\n const bounds = {\n ...$82e068a44c11e855$var$useUnitRect(division, {\n widthFraction: widthFraction,\n axisType: axisType\n }),\n ...baseBounds\n };\n const { width: width, height: height } = bounds;\n return $82e068a44c11e855$var$h($82e068a44c11e855$export$1d8b9ae22d404866, {\n className: \"labeled-unit\",\n division: division,\n backgroundColor: backgroundColor,\n patternID: patternID,\n ...bounds\n }, [\n $82e068a44c11e855$var$h.if(showLabel)((0, $jfrfr$ForeignObject), {\n ...bounds,\n className: \"unit-label-container\"\n }, $82e068a44c11e855$var$h((0, $jfrfr$SizeAwareLabel), {\n className: \"unit-overlay\",\n labelClassName: \"unit-label\",\n style: {\n width: width,\n height: height\n },\n label: label,\n onVisibilityChanged (viz) {\n onLabelUpdated(label, viz);\n }\n }))\n ]);\n}\nfunction $82e068a44c11e855$export$5d1cdfabe8dc8085(props) {\n const { unitComponent: unitComponent = $82e068a44c11e855$export$1d8b9ae22d404866, unitComponentProps: unitComponentProps = {} } = props;\n const { divisions: divisions } = (0, $jfrfr$useContext)((0, $jfrfr$ColumnContext));\n if (divisions.length == 0) {\n console.warn(\"No divisions found in column context\");\n return null;\n }\n const children = (0, $jfrfr$useMemo)(()=>{\n return divisions.map((division, i)=>{\n // @ts-ignore\n return $82e068a44c11e855$var$h(unitComponent, {\n division: division,\n key: division.unit_id,\n ...unitComponentProps\n });\n });\n }, [\n divisions,\n unitComponent,\n unitComponentProps\n ]);\n return $82e068a44c11e855$var$h((0, $jfrfr$PatternDefsProvider), {\n resolveID: $5VyZI.resolveID,\n scalePattern: $5VyZI.scalePattern\n }, $82e068a44c11e855$var$h(\"g.divisions\", children));\n}\n\n\nexport {$82e068a44c11e855$export$d54fdbabca27e53 as MinimalUnit, $82e068a44c11e855$export$1d8b9ae22d404866 as Unit, $82e068a44c11e855$export$b4f0ca233b98f9af as LabeledUnit, $82e068a44c11e855$export$5d1cdfabe8dc8085 as UnitBoxes};\n//# sourceMappingURL=column-views.b57e5e6e.js.map\n","import {\n ColumnAxisType,\n ColumnContext,\n ColumnLayoutContext,\n ForeignObject,\n PatternDefsProvider,\n useColumn,\n useGeologicPattern,\n zigZagBoxPath,\n} from \"@macrostrat/column-components\";\nimport { SizeAwareLabel, Clickable } from \"@macrostrat/ui-components\";\nimport hyper from \"@macrostrat/hyper\";\nimport { forwardRef, ReactNode, useContext, useMemo } from \"react\";\nimport { resolveID, scalePattern } from \"./resolvers\";\nimport { useUnitSelectionTarget, useLithologies } from \"../data-provider\";\nimport { IUnit } from \"./types\";\nimport styles from \"./boxes.module.sass\";\nimport classNames from \"classnames\";\nimport { getUnitHeightRange } from \"../prepare-units/utils\";\nimport { getMixedUnitColor } from \"./colors\";\nimport type { RectBounds } from \"./types\";\n\nconst h = hyper.styled(styles);\n\ninterface UnitRectOptions {\n widthFraction?: number;\n axisType?: ColumnAxisType;\n // Padding to create overflow for zig-zags or other ornamented edges\n padding?: number;\n}\n\ninterface UnitProps extends Clickable, Partial<RectBounds>, UnitRectOptions {\n division: IUnit;\n resolveID?(IUnit): string;\n UUID?: string;\n defaultFill?: string;\n widthFraction?: number;\n children?: ReactNode;\n className?: string;\n fill?: string;\n backgroundColor?: string;\n patternColor?: string;\n patternID?: string | number;\n}\n\nexport interface LabeledUnitProps\n extends UnitRectOptions, Clickable, Partial<RectBounds> {\n division: IUnit;\n patternID?: string | number;\n label: string;\n onLabelUpdated?(label: string, shown: boolean);\n halfWidth?: boolean;\n showLabel?: boolean;\n backgroundColor?: string;\n}\n\nfunction useUnitRect(\n division: IUnit,\n options: UnitRectOptions = {},\n): RectBounds {\n const {\n widthFraction = 1,\n axisType = ColumnAxisType.AGE,\n padding = 0,\n } = options;\n const { scale } = useContext(ColumnContext);\n const { width } = useContext(ColumnLayoutContext);\n\n const [bottomHeight, topHeight] = getUnitHeightRange(division, axisType);\n\n const y = scale(topHeight);\n const height = Math.abs(scale(bottomHeight) - y);\n\n return {\n x: width * (1 - widthFraction) - padding,\n y: y - padding,\n height: height + padding * 2,\n width: widthFraction * width + padding * 2,\n };\n}\n\nexport function MinimalUnit(props) {\n const {\n division: d,\n children,\n className,\n widthFraction = 1,\n axisType: _, // not sure why this is brought in...\n nColumns: __,\n ...baseBounds\n } = props;\n\n const { axisType } = useColumn();\n const lithMap = useLithologies();\n const bounds = {\n ...useUnitRect(d, { widthFraction, axisType }),\n ...baseBounds,\n };\n\n const backgroundColor = getMixedUnitColor(d, lithMap, null, false);\n\n const [ref, selected, onClick] = useUnitSelectionTarget(d);\n\n return h(\n \"g.unit\",\n {\n className,\n style: {\n \"--column-unit-background-color\": backgroundColor,\n \"--column-stroke-color\": backgroundColor,\n },\n },\n [\n h(\"rect.unit.background\", {\n ref,\n ...bounds,\n fill: backgroundColor,\n fillOpacity: 0.8,\n stroke: backgroundColor,\n onClick,\n }),\n h.if(selected)(\"rect.selection-overlay\", bounds),\n ],\n );\n}\n\nfunction Unit(props: UnitProps) {\n const {\n division: d,\n children,\n fill,\n defaultFill = \"transparent\",\n className,\n widthFraction = 1,\n backgroundColor,\n patternColor,\n patternID,\n axisType: _, // not sure why this is brought in...\n ...baseBounds\n } = props;\n\n const { axisType } = useColumn();\n\n const hasOverflowTop = d.t_clip_pos != null;\n const hasOverflowBottom = d.b_clip_pos != null;\n\n const bounds = {\n ...useUnitRect(d, { widthFraction, axisType }),\n ...baseBounds,\n overflowTop: hasOverflowTop,\n overflowBottom: hasOverflowBottom,\n };\n const _patternID = patternID ?? resolveID(d);\n let _fill = fill ?? useGeologicPattern(_patternID, defaultFill);\n\n const hasBackgroundColor = backgroundColor != null;\n\n const _className = classNames(className, { colored: hasBackgroundColor });\n\n const [ref, selected, onClick] = useUnitSelectionTarget(d);\n\n return h(\n \"g.unit\",\n {\n className: _className,\n style: {\n \"--column-unit-background-color\": backgroundColor,\n },\n },\n [\n h(UnitRect, {\n ...bounds,\n fill: backgroundColor,\n onClick,\n className: \"background\",\n }),\n h(UnitRect, {\n ref,\n ...bounds,\n fill: _fill,\n //mask,\n onClick,\n className: \"unit\",\n }),\n h.if(selected)(UnitRect, { ...bounds, className: \"selection-overlay\" }),\n //defs,\n children,\n ],\n );\n}\n\ninterface UnitRectProps {\n x: number;\n y: number;\n width: number;\n height: number;\n className: string;\n // Used to determine if the rect should have a zig-zag edge on the top or bottom\n overflowTop?: boolean;\n overflowBottom?: boolean;\n [key: string]: any;\n}\n\nconst UnitRect = forwardRef((props: UnitRectProps, ref) => {\n const {\n x,\n y,\n width,\n height,\n overflowTop = false,\n overflowBottom = false,\n ...rest\n } = props;\n\n if (!overflowTop && !overflowBottom) {\n return h(\"rect\", {\n x,\n y,\n width,\n height,\n ref,\n ...rest,\n });\n } else {\n const d = zigZagBoxPath(x, y, width, height, overflowTop, overflowBottom);\n return h(\"path\", {\n d,\n ref,\n ...rest,\n });\n }\n});\n\nfunction LabeledUnit(props: LabeledUnitProps) {\n const {\n division,\n label,\n onLabelUpdated,\n widthFraction,\n showLabel = true,\n backgroundColor,\n patternID,\n axisType: _, // not sure why this is brought in...\n ...baseBounds\n } = props;\n\n const { axisType } = useColumn();\n const bounds = {\n ...useUnitRect(division, { widthFraction, axisType }),\n ...baseBounds,\n };\n const { width, height } = bounds;\n return h(\n Unit,\n {\n className: \"labeled-unit\",\n division,\n backgroundColor,\n patternID,\n ...bounds,\n },\n [\n h.if(showLabel)(\n ForeignObject,\n { ...bounds, className: \"unit-label-container\" },\n h(SizeAwareLabel, {\n className: \"unit-overlay\",\n labelClassName: \"unit-label\",\n style: { width, height },\n label,\n onVisibilityChanged(viz) {\n onLabelUpdated(label, viz);\n },\n }),\n ),\n ],\n );\n}\n\nfunction UnitBoxes<T>(props: {\n unitComponent: React.FunctionComponent<{ division: T }>;\n unitComponentProps?: any;\n transformDivisions?(divisions: T[]): T[];\n transformDivision?: (\n division: any,\n index: number,\n divisions: any[],\n ) => T | null;\n}) {\n const { unitComponent = Unit, unitComponentProps = {} } = props;\n const { divisions } = useContext(ColumnContext);\n\n if (divisions.length == 0) {\n console.warn(\"No divisions found in column context\");\n return null;\n }\n\n const children = useMemo(() => {\n return divisions.map((division: any, i) => {\n // @ts-ignore\n return h(unitComponent, {\n division,\n key: division.unit_id,\n ...unitComponentProps,\n });\n });\n }, [divisions, unitComponent, unitComponentProps]);\n\n return h(\n PatternDefsProvider,\n { resolveID, scalePattern },\n h(\"g.divisions\", children),\n );\n}\n\nexport { LabeledUnit, Unit, UnitBoxes, UnitProps };\n"],"names":["ColumnAxisType","$jfrfr$ColumnAxisType","ColumnContext","$jfrfr$ColumnContext","ColumnLayoutContext","$jfrfr$ColumnLayoutContext","useColumn","$jfrfr$useColumn","useGeologicPattern","$jfrfr$useGeologicPattern","zigZagBoxPath","$jfrfr$zigZagBoxPath","ForeignObject","$jfrfr$ForeignObject","PatternDefsProvider","$jfrfr$PatternDefsProvider","SizeAwareLabel","$jfrfr$SizeAwareLabel","$jfrfr$macrostrathyper","useContext","$jfrfr$useContext","forwardRef","$jfrfr$forwardRef","useMemo","$jfrfr$useMemo","$jfrfr$classnames","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$5VyZI","$lgTAP","$5SO8b","$klU0I","$iWhRv","$bfmPX","$82e068a44c11e855$var$h","styled","a","__esModule","default","$82e068a44c11e855$var$useUnitRect","division","options","widthFraction","axisType","AGE","padding","scale","width","bottomHeight","topHeight","getUnitHeightRange","y","height","Math","abs","x","$82e068a44c11e855$export$d54fdbabca27e53","props","d","children","className","_","nColumns","__","baseBounds","lithMap","useLithologies","bounds","backgroundColor","getMixedUnitColor","ref","selected","onClick","useUnitSelectionTarget","style","fill","fillOpacity","stroke","if","$82e068a44c11e855$export$1d8b9ae22d404866","defaultFill","patternColor","patternID","hasOverflowTop","t_clip_pos","hasOverflowBottom","b_clip_pos","overflowTop","overflowBottom","_patternID","resolveID","_fill","_className","colored","$82e068a44c11e855$var$UnitRect","rest","$82e068a44c11e855$export$b4f0ca233b98f9af","label","onLabelUpdated","showLabel","labelClassName","onVisibilityChanged","viz","$82e068a44c11e855$export$5d1cdfabe8dc8085","unitComponent","unitComponentProps","divisions","length","console","warn","map","i","key","unit_id","scalePattern","MinimalUnit","Unit","LabeledUnit","UnitBoxes"],"version":3,"file":"column-views.b57e5e6e.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.dbb4a46b.js";import"./column-views.5a9331a9.js";import"./column-views.7f9c7448.js";import{ColumnAxisType as e}from"@macrostrat/column-components";import{scaleLinear as t}from"d3-scale";var a=globalThis,n={},l={},i=a.parcelRequirea149;null==i&&((i=function(e){if(e in n)return n[e].exports;if(e in l){var t=l[e];delete l[e];var a={id:e,exports:{}};return n[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){l[e]=t},a.parcelRequirea149=i),i.register;var o=i("iWhRv"),r=i("dcPBY"),s=i("76iYI");function c(e,t){let a=t/2,n=0,l=[];for(let i of e){let{domain:e,scale:o}=i,[r,s]=e,c=`package-${r}-${s}`;l.push({...f(i,a),key:c,offset:a,paddingTop:a-n}),a=(n=a+Math.abs(o(r)-o(s)))+t}return{totalHeight:a+=t/2,sections:l}}function p(e,t){let{totalHeight:a,sections:n}=c(e.map(e=>e.scaleInfo),t),l=[];for(let t in e){let a=e[t],i=n[t];l.push({...a,key:i.key,scaleInfo:i})}return{totalHeight:a,sections:l}}function u(e,t){return e.map(e=>m(e,t))}function m(t,a){let{t_age:n,b_age:l,t_pos:i,b_pos:c,units:p}=t,u=null;u=a.axisType==e.AGE?[l,n]:[c,i];let m=function(t,a){let n,{targetUnitHeight:l=20,minPixelScale:i=.2,axisType:c,minSectionHeight:p,scale:u,hybridScale:m}=a,h=a.domain??function(t,a){if(null==a)throw Error("Axis type is not set");if(a===e.AGE){let e=Math.min(...t.map(e=>e.t_age));return[Math.max(...t.map(e=>e.b_age)),e]}if(a==e.DEPTH||a==e.ORDINAL){let e=Math.min(...t.map(e=>e.t_pos));return[Math.max(...t.map(e=>e.b_pos)),e]}if(a==e.HEIGHT){let e=Math.max(...t.map(e=>e.t_pos));return[Math.min(...t.map(e=>e.b_pos)),e]}}(t,c),g=Math.abs(h[0]-h[1]),b=a.pixelScale;return null!=m?(m.type===s.HybridScaleType.EquidistantSurfaces&&(b??(b=l)),(0,r.buildHybridScale)(m,t,h,{pixelOffset:0,pixelScale:b})):(null==u?(null==b&&(b=Math.max(l/function(e,t){let a=e.map(e=>{let[a,n]=(0,o.getUnitHeightRange)(e,t);return Math.abs(a-n)});return a.reduce((e,t)=>e+t,0)/a.length}(t,c),i)),b=(n=Math.max(g*b,p??l??0))/g):n=Math.abs(u(h[0])-u(h[1])),f({scale:u,domain:h,pixelHeight:n,pixelScale:b},0))}(p,{...a,domain:u});return{...t,scaleInfo:m}}function f(e,a=0){let n,{domain:l,pixelScale:i,pixelHeight:o,scale:r,heightScale:s}=e;if(null==r&&null==i)throw Error("Either scale or pixelScale must be provided");if(null==r)n=t().domain([l[1],l[0]]).range([a,o+a]);else{let e=r.domain(),t=r.range();n=r.copy().domain(e).range(t.map(e=>e+a))}n.clamp();let c=null;if(null!=s){let e=r.range();(c=s.copy().range(e.map(e=>e+a))).clamp()}return{domain:l,pixelScale:i,pixelHeight:o,scale:n,heightScale:c}}function h(e,a=!1){let n=[],l=null;for(let i of e){let e=i.scaleInfo.scale.copy().clamp(!0);if(n.push(e),null!=l&&a){let a=l.domain(),i=l.range(),o=e.domain(),r=e.range(),s=t().domain([a[a.length-1],o[0]]).range([i[i.length-1],r[0]]).clamp(!0);n.push(s)}l=e}let i=e=>{for(let t of n){let a=t.domain();if(e>=a[0]&&e<=a[a.length-1])return t(e)}return null};return i.copy=()=>h(e,a),i.domain=()=>{let t=e.flatMap(e=>e.scaleInfo.domain);return t[0]<t[t.length-1]?[Math.min(...t),Math.max(...t)]:[Math.max(...t),Math.min(...t)]},i.invert=e=>{for(let t of n){let a=t.range();if(e>Math.min(...a)&&e<=Math.max(...a))return console.log("Inverting scale at pixel height",e),t.invert(e)}return null},i.clamp=e=>{for(let t of n)t.clamp(e)},i}function g(t,a,n){let l=[],i=null;for(let r of t){let t;if(null==i){i=r;continue}t=n.axisType!==e.AGE?[r.t_pos,i.b_pos]:[r.t_age,i.b_age];let s=e=>Math.abs(e[0]-e[1]);if(Math.min(s(t.map(r.scaleInfo.scale)),s(t.map(i.scaleInfo.scale)))<a){let t,a;n.axisType==e.AGE||n.axisType==e.DEPTH?(t=Math.min(i.t_pos,r.t_pos),a=Math.max(i.b_pos,r.b_pos)):(t=Math.max(i.t_pos,r.t_pos),a=Math.min(i.b_pos,r.b_pos)),i=m({units:[...i.units,...r.units],section_id:[...(0,o.ensureArray)(i.section_id),...(0,o.ensureArray)(r.section_id)],t_age:Math.min(i.t_age,r.t_age),b_age:Math.max(i.b_age,r.b_age),t_pos:t,b_pos:a},n)}else l.push(i),i=r}return null!=i&&l.push(i),l}export{c as buildCompositeScaleInfo,f as createPackageScale,p as finalizeSectionHeights,u as computeSectionHeights,h as createCompositeScale,g as collapseUnconformitiesByPixelHeight};
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.dbb4a46b.js";import"./column-views.5a9331a9.js";import"./column-views.7f9c7448.js";import{ColumnAxisType as e}from"@macrostrat/column-components";import{scaleLinear as t}from"d3-scale";var a=globalThis,n={},l={},i=a.parcelRequirea149;null==i&&((i=function(e){if(e in n)return n[e].exports;if(e in l){var t=l[e];delete l[e];var a={id:e,exports:{}};return n[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){l[e]=t},a.parcelRequirea149=i),i.register;var o=i("iWhRv"),r=i("dcPBY"),s=i("76iYI");function c(e,t){let a=t/2,n=0,l=[];for(let i of e){let{domain:e,scale:o}=i,[r,s]=e,c=`package-${r}-${s}`;l.push({...f(i,a),key:c,offset:a,paddingTop:a-n}),a=(n=a+Math.abs(o(r)-o(s)))+t}return{totalHeight:a+=t/2,sections:l}}function p(e,t){let{totalHeight:a,sections:n}=c(e.map(e=>e.scaleInfo),t),l=[];for(let t in e){let a=e[t],i=n[t];l.push({...a,key:i.key,scaleInfo:i})}return{totalHeight:a,sections:l}}function u(e,t){return e.map(e=>m(e,t))}function m(t,a){let{t_age:n,b_age:l,t_pos:i,b_pos:c,units:p}=t,u=null;u=a.axisType==e.AGE?[l,n]:[c,i];let m=function(t,a){let n,{targetUnitHeight:l=20,minPixelScale:i=.2,axisType:c,minSectionHeight:p,scale:u,hybridScale:m}=a,h=a.domain??function(t,a){if(null==a)throw Error("Axis type is not set");if(a===e.AGE){let e=Math.min(...t.map(e=>e.t_age));return[Math.max(...t.map(e=>e.b_age)),e]}if(a==e.DEPTH||a==e.ORDINAL){let e=Math.min(...t.map(e=>e.t_pos));return[Math.max(...t.map(e=>e.b_pos)),e]}if(a==e.HEIGHT){let e=Math.max(...t.map(e=>e.t_pos));return[Math.min(...t.map(e=>e.b_pos)),e]}}(t,c),g=Math.abs(h[0]-h[1]),b=a.pixelScale;return null!=m?(m.type===s.HybridScaleType.EquidistantSurfaces&&(b??(b=l)),(0,r.buildHybridScale)(m,t,h,{pixelOffset:0,pixelScale:b})):(null==u?(null==b&&(b=Math.max(l/function(e,t){let a=e.map(e=>{let[a,n]=(0,o.getUnitHeightRange)(e,t);return Math.abs(a-n)});return a.reduce((e,t)=>e+t,0)/a.length}(t,c),i)),b=(n=Math.max(g*b,p??l??0))/g):n=Math.abs(u(h[0])-u(h[1])),f({scale:u,domain:h,pixelHeight:n,pixelScale:b},0))}(p,{...a,domain:u});return{...t,scaleInfo:m}}function f(e,a=0){let n,{domain:l,pixelScale:i,pixelHeight:o,scale:r,heightScale:s}=e;if(null==r&&null==i)throw Error("Either scale or pixelScale must be provided");if(null==r)n=t().domain([l[1],l[0]]).range([a,o+a]);else{let e=r.domain(),t=r.range();n=r.copy().domain(e).range(t.map(e=>e+a))}n.clamp();let c=null;if(null!=s){let e=r.range();(c=s.copy().range(e.map(e=>e+a))).clamp()}return{domain:l,pixelScale:i,pixelHeight:o,scale:n,heightScale:c}}function h(e,a=!1){let n=[],l=null;for(let i of e){let e=i.scaleInfo.scale.copy().clamp(!0);if(n.push(e),null!=l&&a){let a=l.domain(),i=l.range(),o=e.domain(),r=e.range(),s=t().domain([a[a.length-1],o[0]]).range([i[i.length-1],r[0]]).clamp(!0);n.push(s)}l=e}let i=e=>{for(let t of n){let a=t.domain();if(a[0]<a[a.length-1]&&e>=a[0]&&e<=a[a.length-1]||e<=a[0]&&e>=a[a.length-1])return t(e)}return null};return i.copy=()=>h(e,a),i.domain=()=>{let t=e.flatMap(e=>e.scaleInfo.domain);return t[0]<t[t.length-1]?[Math.min(...t),Math.max(...t)]:[Math.max(...t),Math.min(...t)]},i.invert=e=>{for(let t of n){let a=t.range();if(e>Math.min(...a)&&e<=Math.max(...a))return console.log("Inverting scale at pixel height",e),t.invert(e)}return null},i.clamp=e=>{for(let t of n)t.clamp(e)},i}function g(t,a,n){let l=[],i=null;for(let r of t){let t;if(null==i){i=r;continue}t=n.axisType!==e.AGE?[r.t_pos,i.b_pos]:[r.t_age,i.b_age];let s=e=>Math.abs(e[0]-e[1]);if(Math.min(s(t.map(r.scaleInfo.scale)),s(t.map(i.scaleInfo.scale)))<a){let t,a;n.axisType==e.AGE||n.axisType==e.DEPTH?(t=Math.min(i.t_pos,r.t_pos),a=Math.max(i.b_pos,r.b_pos)):(t=Math.max(i.t_pos,r.t_pos),a=Math.min(i.b_pos,r.b_pos)),i=m({units:[...i.units,...r.units],section_id:[...(0,o.ensureArray)(i.section_id),...(0,o.ensureArray)(r.section_id)],t_age:Math.min(i.t_age,r.t_age),b_age:Math.max(i.b_age,r.b_age),t_pos:t,b_pos:a},n)}else l.push(i),i=r}return null!=i&&l.push(i),l}export{c as buildCompositeScaleInfo,f as createPackageScale,p as finalizeSectionHeights,u as computeSectionHeights,h as createCompositeScale,g as collapseUnconformitiesByPixelHeight};
|
|
2
|
+
//# sourceMappingURL=column-views.ba9108fe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,e,C,K,U,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,S,E,E,S,E,E,SCkBO,SAAS,EACd,CAA+B,CAC/B,CAA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ts"],"sourcesContent":["import \"./column-views.dbb4a46b.js\";\nimport \"./column-views.5a9331a9.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {ColumnAxisType as $d6XP3$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {scaleLinear as $d6XP3$scaleLinear} from \"d3-scale\";\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\nvar $dcPBY = parcelRequire(\"dcPBY\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $8054a162cb094378$export$e7184dd8bb3302ed(inputScales, unconformityHeight) {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */ let totalHeight = unconformityHeight / 2;\n let lastSectionTopHeight = 0;\n const packages2 = [];\n for (const group of inputScales){\n const { domain: domain, scale: scale } = group;\n const [b_age, t_age] = domain;\n const key = `package-${b_age}-${t_age}`;\n packages2.push({\n ...$8054a162cb094378$export$d6235b492bceb8c5(group, totalHeight),\n key: key,\n offset: totalHeight,\n // Unconformity height above this particular section\n paddingTop: totalHeight - lastSectionTopHeight\n });\n const pixelHeight = Math.abs(scale(b_age) - scale(t_age));\n lastSectionTopHeight = totalHeight + pixelHeight;\n totalHeight = lastSectionTopHeight + unconformityHeight;\n }\n totalHeight += unconformityHeight / 2;\n return {\n totalHeight: totalHeight,\n sections: packages2\n };\n}\nfunction $8054a162cb094378$export$67442a0f5bef147b(sections, unconformityHeight) {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */ const sectionScales = sections.map((d)=>d.scaleInfo);\n const { totalHeight: totalHeight, sections: packages } = $8054a162cb094378$export$e7184dd8bb3302ed(sectionScales, unconformityHeight);\n // This could perhaps be simplified.\n const sections1 = [];\n for(const i in sections){\n const group = sections[i];\n const scaleInfo = packages[i];\n sections1.push({\n ...group,\n key: scaleInfo.key,\n scaleInfo: scaleInfo\n });\n }\n return {\n totalHeight: totalHeight,\n sections: sections1\n };\n}\nfunction $8054a162cb094378$export$7d3f3129a1a4b84e(sections, opts) {\n return sections.map((group)=>{\n return $8054a162cb094378$var$addScaleToSection(group, opts);\n });\n}\nfunction $8054a162cb094378$var$addScaleToSection(group, opts) {\n const { t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos, units: units } = group;\n let _range = null;\n // if t_age and b_age are set for a group, use them to define the range...\n if (opts.axisType == (0, $d6XP3$ColumnAxisType).AGE) _range = [\n b_age,\n t_age\n ];\n else _range = [\n b_pos,\n t_pos\n ];\n const scaleInfo = $8054a162cb094378$var$buildSectionScale(units, {\n ...opts,\n domain: _range\n });\n return {\n ...group,\n scaleInfo: scaleInfo\n };\n}\nfunction $8054a162cb094378$var$buildSectionScale(data, opts) {\n const { targetUnitHeight: targetUnitHeight = 20, minPixelScale: minPixelScale = 0.2, axisType: axisType, minSectionHeight: minSectionHeight, scale: scale, hybridScale: hybridScale } = opts;\n const domain = opts.domain ?? $8054a162cb094378$var$findSectionHeightRange(data, axisType);\n const dAge = Math.abs(domain[0] - domain[1]);\n let _pixelScale = opts.pixelScale;\n let pixelHeight;\n if (hybridScale != null) {\n /** In an equidistant surfaces scale, we want to determine the heights of surfaces\n * and then distribute units evenly between them.\n * This is somewhat like an ordinal scale\n */ if (hybridScale.type === (0, $76iYI.HybridScaleType).EquidistantSurfaces) _pixelScale ?? (_pixelScale = targetUnitHeight);\n return (0, $dcPBY.buildHybridScale)(hybridScale, data, domain, {\n pixelOffset: 0,\n pixelScale: _pixelScale\n });\n }\n if (scale == null) {\n if (_pixelScale == null) {\n const avgAgeRange = $8054a162cb094378$var$findAverageUnitHeight(data, axisType);\n // Get pixel height necessary to render average unit at target height\n _pixelScale = Math.max(targetUnitHeight / avgAgeRange, minPixelScale);\n // OLD METHOD that cares about overall section height vs. individual unit height\n // 0.2 pixel per myr is the floor scale\n //const targetHeight = targetUnitHeight * data.length;\n // 1 pixel per myr is the floor scale\n //_pixelScale = Math.max(targetHeight / dAge, minPixelScale);\n }\n let height = dAge * _pixelScale;\n // If height is less than minSectionHeight, set it to minSectionHeight\n const _minSectionHeight = minSectionHeight ?? targetUnitHeight ?? 0;\n pixelHeight = Math.max(height, _minSectionHeight);\n _pixelScale = pixelHeight / dAge;\n } else // If a scale is provided, use it to compute pixel height\n pixelHeight = Math.abs(scale(domain[0]) - scale(domain[1]));\n return $8054a162cb094378$export$d6235b492bceb8c5({\n scale: scale,\n domain: domain,\n pixelHeight: pixelHeight,\n pixelScale: _pixelScale\n }, 0);\n}\nfunction $8054a162cb094378$export$d6235b492bceb8c5(def, offset = 0) {\n /** Build a section scale */ // Domain should be oriented from bottom to top, but scale is oriented from top to bottom\n const { domain: domain, pixelScale: pixelScale, pixelHeight: pixelHeight, scale: scale, heightScale: heightScale } = def;\n if (scale == null && pixelScale == null) throw new Error(\"Either scale or pixelScale must be provided\");\n let _scale;\n if (scale == null) _scale = (0, $d6XP3$scaleLinear)().domain([\n domain[1],\n domain[0]\n ]).range([\n offset,\n pixelHeight + offset\n ]);\n else {\n const domain0 = scale.domain();\n const range0 = scale.range();\n _scale = scale.copy().domain(domain0).range(range0.map((d)=>d + offset));\n }\n _scale.clamp();\n let _heightScale = null;\n if (heightScale != null) {\n // Adjust height scale as well\n const range0 = scale.range();\n _heightScale = heightScale.copy().range(range0.map((d)=>d + offset));\n _heightScale.clamp();\n }\n return {\n domain: domain,\n pixelScale: pixelScale,\n pixelHeight: pixelHeight,\n scale: _scale,\n // Internal details for hybrid scales. TODO: improve this\n heightScale: _heightScale\n };\n}\nfunction $8054a162cb094378$var$findSectionHeightRange(data, axisType) {\n if (axisType == null) throw new Error(\"Axis type is not set\");\n if (axisType === (0, $d6XP3$ColumnAxisType).AGE) {\n const t_age = Math.min(...data.map((d)=>d.t_age));\n const b_age = Math.max(...data.map((d)=>d.b_age));\n return [\n b_age,\n t_age\n ];\n } else if (axisType == (0, $d6XP3$ColumnAxisType).DEPTH || axisType == (0, $d6XP3$ColumnAxisType).ORDINAL) {\n const t_pos = Math.min(...data.map((d)=>d.t_pos));\n const b_pos = Math.max(...data.map((d)=>d.b_pos));\n return [\n b_pos,\n t_pos\n ];\n } else if (axisType == (0, $d6XP3$ColumnAxisType).HEIGHT) {\n const t_pos = Math.max(...data.map((d)=>d.t_pos));\n const b_pos = Math.min(...data.map((d)=>d.b_pos));\n return [\n b_pos,\n t_pos\n ];\n }\n}\nfunction $8054a162cb094378$var$findAverageUnitHeight(data, axisType) {\n const unitHeights = data.map((d)=>{\n const [b_pos, t_pos] = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n return Math.abs(b_pos - t_pos);\n });\n return unitHeights.reduce((a, b)=>a + b, 0) / unitHeights.length;\n}\nfunction $8054a162cb094378$export$3ada7641926a616d(sections, interpolateUnconformities = false) {\n /** Create a scale that works across multiple packages */ const scales = [];\n let lastScale = null;\n for (const section of sections){\n const _scale = section.scaleInfo.scale.copy().clamp(true);\n scales.push(_scale);\n if (lastScale != null && interpolateUnconformities) {\n // Add a new scale that interpolates between lastScale and _scale\n const lastDomain = lastScale.domain();\n const lastRange = lastScale.range();\n const currentDomain = _scale.domain();\n const currentRange = _scale.range();\n const interpScale = (0, $d6XP3$scaleLinear)().domain([\n lastDomain[lastDomain.length - 1],\n currentDomain[0]\n ]).range([\n lastRange[lastRange.length - 1],\n currentRange[0]\n ]).clamp(true);\n scales.push(interpScale);\n }\n lastScale = _scale;\n }\n const scale = (age)=>{\n for (const s of scales){\n const domain = s.domain();\n if (domain[0] < domain[domain.length - 1] && age >= domain[0] && age <= domain[domain.length - 1]) // Age axes\n return s(age);\n else if (age <= domain[0] && age >= domain[domain.length - 1]) // Normal axes like height\n return s(age);\n }\n return null;\n };\n scale.copy = ()=>{\n return $8054a162cb094378$export$3ada7641926a616d(sections, interpolateUnconformities);\n };\n scale.domain = ()=>{\n /** Return the domain of the scale */ const vals = sections.flatMap((d)=>d.scaleInfo.domain);\n if (vals[0] < vals[vals.length - 1]) // age axes\n return [\n Math.min(...vals),\n Math.max(...vals)\n ];\n // Normal axes like height\n return [\n Math.max(...vals),\n Math.min(...vals)\n ];\n };\n scale.invert = (pixelHeight)=>{\n /** Invert the scale to get the age at a given pixel height */ // Iterate through the sections to find the correct one\n for (const scale of scales){\n const range = scale.range();\n if (pixelHeight > Math.min(...range) && pixelHeight <= Math.max(...range)) {\n console.log(\"Inverting scale at pixel height\", pixelHeight);\n return scale.invert(pixelHeight);\n }\n }\n return null;\n };\n scale.clamp = (clamp)=>{\n /** Clamp all constituent scales */ for (const s of scales)s.clamp(clamp);\n };\n return scale;\n}\nfunction $8054a162cb094378$export$edbf01b435c75274(sections, threshold, opts) {\n const newSections = [];\n let currentSection = null;\n for (const nextSection of sections){\n if (currentSection == null) {\n currentSection = nextSection;\n continue;\n }\n let heights;\n let pxHeights;\n if (opts.axisType !== (0, $d6XP3$ColumnAxisType).AGE) heights = [\n nextSection.t_pos,\n currentSection.b_pos\n ];\n else heights = [\n nextSection.t_age,\n currentSection.b_age\n ];\n const _diff = (vals)=>{\n return Math.abs(vals[0] - vals[1]);\n };\n pxHeights = [\n _diff(heights.map(nextSection.scaleInfo.scale)),\n _diff(heights.map(currentSection.scaleInfo.scale))\n ];\n const pxHeight = Math.min(...pxHeights);\n if (pxHeight < threshold) {\n let t_pos;\n let b_pos;\n if (opts.axisType == (0, $d6XP3$ColumnAxisType).AGE || opts.axisType == (0, $d6XP3$ColumnAxisType).DEPTH) {\n t_pos = Math.min(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.max(currentSection.b_pos, nextSection.b_pos);\n } else {\n t_pos = Math.max(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.min(currentSection.b_pos, nextSection.b_pos);\n }\n // We need to merge the sections\n const compositeSection0 = {\n units: [\n ...currentSection.units,\n ...nextSection.units\n ],\n section_id: [\n ...(0, $iWhRv.ensureArray)(currentSection.section_id),\n ...(0, $iWhRv.ensureArray)(nextSection.section_id)\n ],\n t_age: Math.min(currentSection.t_age, nextSection.t_age),\n b_age: Math.max(currentSection.b_age, nextSection.b_age),\n t_pos: t_pos,\n b_pos: b_pos\n };\n currentSection = $8054a162cb094378$var$addScaleToSection(compositeSection0, opts);\n } else {\n // We need to keep the section\n newSections.push(currentSection);\n currentSection = nextSection;\n }\n }\n if (currentSection != null) newSections.push(currentSection);\n return newSections;\n}\n\n\nexport {$8054a162cb094378$export$e7184dd8bb3302ed as buildCompositeScaleInfo, $8054a162cb094378$export$d6235b492bceb8c5 as createPackageScale, $8054a162cb094378$export$67442a0f5bef147b as finalizeSectionHeights, $8054a162cb094378$export$7d3f3129a1a4b84e as computeSectionHeights, $8054a162cb094378$export$3ada7641926a616d as createCompositeScale, $8054a162cb094378$export$edbf01b435c75274 as collapseUnconformitiesByPixelHeight};\n//# sourceMappingURL=column-views.ba9108fe.js.map\n","import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { ensureArray, getUnitHeightRange } from \"./utils\";\nimport { ScaleContinuousNumeric, scaleLinear } from \"d3-scale\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { buildHybridScale } from \"./dynamic-scales\";\nimport { ExtUnit, HybridScaleType, SectionInfo } from \"./types\";\nimport type {\n ColumnScaleOptions,\n CompositeColumnData,\n CompositeScaleData,\n PackageLayoutData,\n PackageScaleInfo,\n PackageScaleLayoutData,\n SectionScaleOptions,\n} from \"./types\";\n\n// Composite scale information augmented with units in each package\n\nexport function buildCompositeScaleInfo(\n inputScales: PackageScaleInfo[],\n unconformityHeight: number,\n): CompositeScaleData {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n let totalHeight = unconformityHeight / 2;\n let lastSectionTopHeight = 0;\n\n const packages2: PackageScaleLayoutData[] = [];\n for (const group of inputScales) {\n const { domain, scale } = group;\n const [b_age, t_age] = domain;\n const key = `package-${b_age}-${t_age}`;\n\n packages2.push({\n ...createPackageScale(group, totalHeight),\n key,\n offset: totalHeight,\n // Unconformity height above this particular section\n paddingTop: totalHeight - lastSectionTopHeight,\n });\n\n const pixelHeight = Math.abs(scale(b_age) - scale(t_age));\n lastSectionTopHeight = totalHeight + pixelHeight;\n totalHeight = lastSectionTopHeight + unconformityHeight;\n }\n totalHeight += unconformityHeight / 2;\n return {\n totalHeight,\n sections: packages2,\n };\n}\n\nexport function finalizeSectionHeights<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n unconformityHeight: number,\n): CompositeColumnData<T> {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n const sectionScales = sections.map((d) => d.scaleInfo);\n\n const { totalHeight, sections: packages } = buildCompositeScaleInfo(\n sectionScales,\n unconformityHeight,\n );\n\n // This could perhaps be simplified.\n const sections1: PackageLayoutData<T>[] = [];\n for (const i in sections) {\n const group = sections[i];\n const scaleInfo = packages[i];\n sections1.push({\n ...group,\n key: scaleInfo.key,\n scaleInfo,\n });\n }\n return {\n totalHeight,\n sections: sections1,\n };\n}\n\nexport interface SectionInfoWithScale<\n T extends UnitLong = ExtUnit,\n> extends SectionInfo<T> {\n scaleInfo: PackageScaleInfo;\n}\n\nexport function computeSectionHeights<T extends UnitLong>(\n sections: SectionInfo<T>[],\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n return sections.map((group) => {\n return addScaleToSection<T>(group, opts);\n });\n}\n\nfunction addScaleToSection<T extends UnitLong = ExtUnit>(\n group: SectionInfo<T>,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T> {\n const { t_age, b_age, t_pos, b_pos, units } = group;\n let _range = null;\n // if t_age and b_age are set for a group, use them to define the range...\n if (opts.axisType == ColumnAxisType.AGE) {\n _range = [b_age, t_age];\n } else {\n _range = [b_pos, t_pos];\n }\n\n const scaleInfo = buildSectionScale<T>(units, {\n ...opts,\n domain: _range,\n });\n\n return {\n ...group,\n scaleInfo,\n };\n}\n\nfunction buildSectionScale<T extends UnitLong>(\n data: T[],\n opts: SectionScaleOptions,\n): PackageScaleInfo {\n const {\n targetUnitHeight = 20,\n minPixelScale = 0.2,\n axisType,\n minSectionHeight,\n scale,\n hybridScale,\n } = opts;\n const domain = opts.domain ?? findSectionHeightRange(data, axisType);\n\n const dAge = Math.abs(domain[0] - domain[1]);\n\n let _pixelScale = opts.pixelScale;\n let pixelHeight: number;\n\n if (hybridScale != null) {\n /** In an equidistant surfaces scale, we want to determine the heights of surfaces\n * and then distribute units evenly between them.\n * This is somewhat like an ordinal scale\n */\n if (hybridScale.type === HybridScaleType.EquidistantSurfaces) {\n _pixelScale ??= targetUnitHeight;\n }\n\n return buildHybridScale(hybridScale, data, domain, {\n pixelOffset: 0,\n pixelScale: _pixelScale,\n });\n }\n\n if (scale == null) {\n if (_pixelScale == null) {\n const avgAgeRange = findAverageUnitHeight(data, axisType);\n // Get pixel height necessary to render average unit at target height\n _pixelScale = Math.max(targetUnitHeight / avgAgeRange, minPixelScale);\n\n // OLD METHOD that cares about overall section height vs. individual unit height\n // 0.2 pixel per myr is the floor scale\n //const targetHeight = targetUnitHeight * data.length;\n // 1 pixel per myr is the floor scale\n //_pixelScale = Math.max(targetHeight / dAge, minPixelScale);\n }\n\n let height = dAge * _pixelScale;\n // If height is less than minSectionHeight, set it to minSectionHeight\n const _minSectionHeight = minSectionHeight ?? targetUnitHeight ?? 0;\n pixelHeight = Math.max(height, _minSectionHeight);\n _pixelScale = pixelHeight / dAge;\n } else {\n // If a scale is provided, use it to compute pixel height\n pixelHeight = Math.abs(scale(domain[0]) - scale(domain[1]));\n }\n\n return createPackageScale(\n { scale, domain, pixelHeight, pixelScale: _pixelScale },\n 0,\n );\n}\n\nexport function createPackageScale(\n def: PackageScaleInfo,\n offset: number = 0,\n): PackageScaleInfo {\n /** Build a section scale */\n // Domain should be oriented from bottom to top, but scale is oriented from top to bottom\n const { domain, pixelScale, pixelHeight, scale, heightScale } = def;\n\n if (scale == null && pixelScale == null) {\n throw new Error(\"Either scale or pixelScale must be provided\");\n }\n\n let _scale: ScaleContinuousNumeric<number, number>;\n if (scale == null) {\n _scale = scaleLinear()\n .domain([domain[1], domain[0]])\n .range([offset, pixelHeight + offset]);\n } else {\n const domain0 = scale.domain();\n const range0 = scale.range();\n _scale = scale\n .copy()\n .domain(domain0)\n .range(range0.map((d) => d + offset));\n }\n\n _scale.clamp();\n\n let _heightScale = null;\n if (heightScale != null) {\n // Adjust height scale as well\n const range0 = scale.range();\n _heightScale = heightScale.copy().range(range0.map((d) => d + offset));\n _heightScale.clamp();\n }\n\n return {\n domain,\n pixelScale,\n pixelHeight,\n scale: _scale,\n // Internal details for hybrid scales. TODO: improve this\n heightScale: _heightScale,\n };\n}\n\nfunction findSectionHeightRange(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): [number, number] {\n if (axisType == null) {\n throw new Error(\"Axis type is not set\");\n }\n if (axisType === ColumnAxisType.AGE) {\n const t_age = Math.min(...data.map((d) => d.t_age));\n const b_age = Math.max(...data.map((d) => d.b_age));\n return [b_age, t_age];\n } else if (\n axisType == ColumnAxisType.DEPTH ||\n axisType == ColumnAxisType.ORDINAL\n ) {\n const t_pos = Math.min(...data.map((d) => d.t_pos));\n const b_pos = Math.max(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n } else if (axisType == ColumnAxisType.HEIGHT) {\n const t_pos = Math.max(...data.map((d) => d.t_pos));\n const b_pos = Math.min(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n }\n}\n\nfunction findAverageUnitHeight(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): number {\n const unitHeights = data.map((d) => {\n const [b_pos, t_pos] = getUnitHeightRange(d, axisType);\n return Math.abs(b_pos - t_pos);\n });\n return unitHeights.reduce((a, b) => a + b, 0) / unitHeights.length;\n}\n\nexport interface CompositeColumnScale {\n (age: number): number | null;\n copy(): CompositeColumnScale;\n domain(): [number, number];\n invert(pixelHeight: number): number | null;\n clamp(clamp: boolean): void;\n}\n\nexport function createCompositeScale(\n sections: PackageLayoutData[],\n interpolateUnconformities: boolean = false,\n): CompositeColumnScale {\n /** Create a scale that works across multiple packages */\n\n const scales: ScaleContinuousNumeric<number, number>[] = [];\n\n let lastScale: ScaleContinuousNumeric<number, number> | null = null;\n for (const section of sections) {\n const _scale = section.scaleInfo.scale.copy().clamp(true);\n scales.push(_scale);\n if (lastScale != null && interpolateUnconformities) {\n // Add a new scale that interpolates between lastScale and _scale\n const lastDomain = lastScale.domain();\n const lastRange = lastScale.range();\n const currentDomain = _scale.domain();\n const currentRange = _scale.range();\n\n const interpScale = scaleLinear()\n .domain([lastDomain[lastDomain.length - 1], currentDomain[0]])\n .range([lastRange[lastRange.length - 1], currentRange[0]])\n .clamp(true);\n scales.push(interpScale);\n }\n lastScale = _scale;\n }\n\n const scale: CompositeColumnScale = (age) => {\n for (const s of scales) {\n const domain = s.domain();\n if (\n domain[0] < domain[domain.length - 1] &&\n age >= domain[0] &&\n age <= domain[domain.length - 1]\n ) {\n // Age axes\n return s(age);\n } else if (age <= domain[0] && age >= domain[domain.length - 1]) {\n // Normal axes like height\n return s(age);\n }\n }\n return null;\n };\n\n scale.copy = () => {\n return createCompositeScale(sections, interpolateUnconformities);\n };\n\n scale.domain = () => {\n /** Return the domain of the scale */\n const vals = sections.flatMap((d) => d.scaleInfo.domain);\n if (vals[0] < vals[vals.length - 1]) {\n // age axes\n return [Math.min(...vals), Math.max(...vals)];\n }\n // Normal axes like height\n return [Math.max(...vals), Math.min(...vals)];\n };\n\n scale.invert = (pixelHeight) => {\n /** Invert the scale to get the age at a given pixel height */\n // Iterate through the sections to find the correct one\n for (const scale of scales) {\n const range = scale.range();\n if (\n pixelHeight > Math.min(...range) &&\n pixelHeight <= Math.max(...range)\n ) {\n console.log(\"Inverting scale at pixel height\", pixelHeight);\n return scale.invert(pixelHeight);\n }\n }\n return null;\n };\n\n scale.clamp = (clamp: boolean) => {\n /** Clamp all constituent scales */\n for (const s of scales) {\n s.clamp(clamp);\n }\n };\n\n return scale;\n}\n\n/** Collapse sections separated by unconformities that are smaller than a given pixel height. */\nexport function collapseUnconformitiesByPixelHeight<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n threshold: number,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n const newSections = [];\n let currentSection: SectionInfoWithScale<T> | null = null;\n for (const nextSection of sections) {\n if (currentSection == null) {\n currentSection = nextSection;\n continue;\n }\n let heights: [number, number];\n let pxHeights: [number, number];\n if (opts.axisType !== ColumnAxisType.AGE) {\n heights = [nextSection.t_pos, currentSection.b_pos];\n } else {\n heights = [nextSection.t_age, currentSection.b_age];\n }\n\n const _diff = (vals: number[]) => {\n return Math.abs(vals[0] - vals[1]);\n };\n\n pxHeights = [\n _diff(heights.map(nextSection.scaleInfo.scale)),\n _diff(heights.map(currentSection.scaleInfo.scale)),\n ];\n\n const pxHeight = Math.min(...pxHeights);\n\n if (pxHeight < threshold) {\n let t_pos: number;\n let b_pos: number;\n if (\n opts.axisType == ColumnAxisType.AGE ||\n opts.axisType == ColumnAxisType.DEPTH\n ) {\n t_pos = Math.min(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.max(currentSection.b_pos, nextSection.b_pos);\n } else {\n t_pos = Math.max(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.min(currentSection.b_pos, nextSection.b_pos);\n }\n\n // We need to merge the sections\n const compositeSection0: SectionInfo<T> = {\n units: [...currentSection.units, ...nextSection.units],\n section_id: [\n ...ensureArray(currentSection.section_id),\n ...ensureArray(nextSection.section_id),\n ],\n t_age: Math.min(currentSection.t_age, nextSection.t_age),\n b_age: Math.max(currentSection.b_age, nextSection.b_age),\n t_pos,\n b_pos,\n };\n\n currentSection = addScaleToSection(compositeSection0, opts);\n } else {\n // We need to keep the section\n newSections.push(currentSection);\n currentSection = nextSection;\n }\n }\n if (currentSection != null) {\n newSections.push(currentSection);\n }\n\n return newSections;\n}\n"],"names":["ColumnAxisType","$d6XP3$ColumnAxisType","scaleLinear","$d6XP3$scaleLinear","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$dcPBY","$76iYI","$8054a162cb094378$export$e7184dd8bb3302ed","inputScales","unconformityHeight","totalHeight","lastSectionTopHeight","packages2","group","domain","scale","b_age","t_age","key","push","$8054a162cb094378$export$d6235b492bceb8c5","offset","paddingTop","Math","abs","sections","$8054a162cb094378$export$67442a0f5bef147b","packages","map","d","scaleInfo","sections1","i","$8054a162cb094378$export$7d3f3129a1a4b84e","opts","$8054a162cb094378$var$addScaleToSection","t_pos","b_pos","units","_range","axisType","AGE","$8054a162cb094378$var$buildSectionScale","data","pixelHeight","targetUnitHeight","minPixelScale","minSectionHeight","hybridScale","$8054a162cb094378$var$findSectionHeightRange","min","max","DEPTH","ORDINAL","HEIGHT","dAge","_pixelScale","pixelScale","type","HybridScaleType","EquidistantSurfaces","buildHybridScale","pixelOffset","$8054a162cb094378$var$findAverageUnitHeight","unitHeights","getUnitHeightRange","reduce","a","b","length","def","_scale","heightScale","range","domain0","range0","copy","clamp","_heightScale","$8054a162cb094378$export$3ada7641926a616d","interpolateUnconformities","scales","lastScale","section","lastDomain","lastRange","currentDomain","currentRange","interpScale","age","s","vals","flatMap","invert","console","log","$8054a162cb094378$export$edbf01b435c75274","threshold","newSections","currentSection","nextSection","heights","_diff","pxHeight","section_id","ensureArray","buildCompositeScaleInfo","createPackageScale","finalizeSectionHeights","computeSectionHeights","createCompositeScale","collapseUnconformitiesByPixelHeight"],"version":3,"file":"column-views.ba9108fe.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.e93b3bdb.js";import"./column-views.869c7199.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.e93b3bdb.js";import"./column-views.869c7199.js";import"./column-views.109cb0c8.js";import"./column-views.d737de1e.js";import"./column-views.dbb4a46b.js";import{usePlotArea as e,DetritalSpectrumPlot as t,DetritalSeries as r}from"@macrostrat/data-components";import a from"@macrostrat/hyper";import{useMemo as o}from"react";import i from"classnames";import{group as n}from"d3-array";import{NonIdealState as l,Spinner as s}from"@blueprintjs/core";function u(e,t,r,a){Object.defineProperty(e,t,{get:r,set:a,enumerable:!0,configurable:!0})}var m=globalThis,c={},d={},p=m.parcelRequirea149;null==p&&((p=function(e){if(e in c)return c[e].exports;if(e in d){var t=d[e];delete d[e];var r={id:e,exports:{}};return c[e]=r,t.call(r.exports,r,r.exports),r.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){d[e]=t},m.parcelRequirea149=p),p.register;var f={};u(f,"DetritalColumn",()=>H),u(f,"DetritalGroup",()=>A);var h=p("ehHhC"),g=p("jtfAP"),_=p("kIQUG"),v=p("wtIgl"),w=p("iWhRv");let b=a.styled(g&&g.__esModule?g.default:g);function H({columnID:e,color:t="magenta"}){let r=(0,h.useDetritalMeasurements)({col_id:e}),a=o(()=>e=>b(A,{width:360,height:40,color:t,...e}),[400,t]),{axisType:i,units:u}=(0,v.useMacrostratColumnData)(),m=o(()=>null==r||null==u?null:function(e,t,r){let a=n(e,e=>e.measuremeta_id),o=new Map;for(let e of a.values()){let a=Array.from(new Set(e.map(e=>e.unit_id)));a.sort();let i=a.join("-");if(!o.has(i)){let e=a.map(e=>t.find(t=>t.unit_id===e)).filter(Boolean),n=e.map(e=>{let[t,a]=(0,w.getUnitHeightRange)(e,r);return{height:t,top_height:a}}),l=(0,_.mergeHeightRanges)(n,r);o.set(i,{id:i,data:[],units:e,...l})}o.get(i).data.push(e[0])}return Array.from(o.values())}(r,u,i),[r,u,i]);return null==m?b(l,b(s)):b(_.BaseMeasurementsColumn,{data:m,noteComponent:a,deltaConnectorAttachment:20})}function x({unit:t}){let{xScale:r,height:a}=e(),{t_age:o,b_age:i}=t,n=r(o);return b("rect.depositional-age",{x:n,width:r(i)-n,y:0,height:a})}function A(e){let{note:a,width:o,height:n,color:l,spacing:s}=e,{data:u,units:m}=a;return b("div.detrital-group",{className:i({"hide-axis":(s?.below??100)<60})},[b(t,{width:o,innerHeight:n,showAxisLabels:!0,paddingBottom:40},[m.map(e=>b(x,{unit:e})),u.map(e=>b(r,{bandwidth:20,data:e.measure_value,color:l}))])])}export{H as DetritalColumn,A as DetritalGroup};
|
|
2
|
+
//# sourceMappingURL=column-views.c16a19fb.js.map
|