@macrostrat/column-views 2.1.2 → 2.1.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 +13 -0
- package/dist/esm/{column-views.813d5bba.js → column-views.02f3732a.js} +9 -5
- package/dist/esm/column-views.02f3732a.js.map +1 -0
- package/dist/esm/{column-views.c8e2983a.js → column-views.0a159282.js} +4 -4
- package/dist/esm/{column-views.c8e2983a.js.map → column-views.0a159282.js.map} +1 -1
- package/dist/esm/{column-views.c25e8b32.js → column-views.1f7fb650.js} +3 -3
- package/dist/esm/{column-views.c25e8b32.js.map → column-views.1f7fb650.js.map} +1 -1
- package/dist/esm/{column-views.bcffe6e5.js → column-views.243da806.js} +3 -3
- package/dist/esm/{column-views.bcffe6e5.js.map → column-views.243da806.js.map} +1 -1
- package/dist/esm/{column-views.e20f6a4b.js → column-views.2ff3dd8b.js} +2 -2
- package/dist/esm/{column-views.e20f6a4b.js.map → column-views.2ff3dd8b.js.map} +1 -1
- package/dist/esm/column-views.38a305a0.js +13 -0
- package/dist/esm/{column-views.10eba967.js.map → column-views.38a305a0.js.map} +1 -1
- package/dist/esm/{column-views.5cc09c1d.js → column-views.3f246167.js} +9 -2
- package/dist/esm/column-views.3f246167.js.map +1 -0
- package/dist/esm/{column-views.892ce22f.js → column-views.42b89c52.js} +35 -10
- package/dist/esm/column-views.42b89c52.js.map +1 -0
- package/dist/esm/{column-views.57636733.css → column-views.448c0687.css} +5 -5
- package/dist/esm/column-views.448c0687.css.map +1 -0
- package/dist/esm/{column-views.afb48e8c.js → column-views.547b2730.js} +8 -8
- package/dist/esm/{column-views.afb48e8c.js.map → column-views.547b2730.js.map} +1 -1
- package/dist/esm/{column-views.1af9761e.js → column-views.64a84c43.js} +1 -2
- package/dist/esm/column-views.64a84c43.js.map +1 -0
- package/dist/esm/{column-views.7e350ae2.js → column-views.676cb1d3.js} +3 -3
- package/dist/esm/{column-views.7e350ae2.js.map → column-views.676cb1d3.js.map} +1 -1
- package/dist/esm/{column-views.28b3eaa0.js → column-views.75ea6dbe.js} +3 -3
- package/dist/esm/{column-views.28b3eaa0.js.map → column-views.75ea6dbe.js.map} +1 -1
- package/dist/esm/{column-views.b40b2bf6.js → column-views.769fa0ee.js} +2 -2
- package/dist/esm/{column-views.b40b2bf6.js.map → column-views.769fa0ee.js.map} +1 -1
- package/dist/esm/{column-views.d2037465.js → column-views.775846c9.js} +3 -3
- package/dist/esm/{column-views.d2037465.js.map → column-views.775846c9.js.map} +1 -1
- package/dist/esm/{column-views.32a83292.js → column-views.77b49a43.js} +7 -7
- package/dist/esm/{column-views.32a83292.js.map → column-views.77b49a43.js.map} +1 -1
- package/dist/esm/{column-views.89b9e542.js → column-views.78bd3f09.js} +2 -2
- package/dist/esm/{column-views.89b9e542.js.map → column-views.78bd3f09.js.map} +1 -1
- package/dist/esm/{column-views.3ba9213d.js → column-views.7ca9e1cd.js} +34 -6
- package/dist/esm/column-views.7ca9e1cd.js.map +1 -0
- package/dist/esm/column-views.8703a35b.js +163 -0
- package/dist/esm/column-views.8703a35b.js.map +1 -0
- package/dist/esm/{column-views.217078ab.css → column-views.8d4ce558.css} +13 -1
- package/dist/esm/column-views.8d4ce558.css.map +1 -0
- package/dist/esm/{column-views.85c6a716.js → column-views.8e3dec90.js} +2 -2
- package/dist/esm/{column-views.85c6a716.js.map → column-views.8e3dec90.js.map} +1 -1
- package/dist/esm/{column-views.52a6eb47.js → column-views.935ef6f7.js} +2 -2
- package/dist/esm/{column-views.52a6eb47.js.map → column-views.935ef6f7.js.map} +1 -1
- package/dist/esm/column-views.97d542eb.js +37 -0
- package/dist/esm/column-views.97d542eb.js.map +1 -0
- package/dist/esm/{column-views.6549388a.js → column-views.9e1c82fe.js} +2 -2
- package/dist/esm/{column-views.6549388a.js.map → column-views.9e1c82fe.js.map} +1 -1
- package/dist/esm/column-views.a195109e.js +60 -0
- package/dist/esm/column-views.a195109e.js.map +1 -0
- package/dist/esm/{column-views.2ca34210.js → column-views.a6301a41.js} +5 -5
- package/dist/esm/{column-views.2ca34210.js.map → column-views.a6301a41.js.map} +1 -1
- package/dist/esm/{column-views.2d8e0e0f.js → column-views.ab0380ed.js} +3 -3
- package/dist/esm/{column-views.2d8e0e0f.js.map → column-views.ab0380ed.js.map} +1 -1
- package/dist/esm/{column-views.1c92b88f.js → column-views.b3c1eb9e.js} +4 -4
- package/dist/esm/column-views.b3c1eb9e.js.map +1 -0
- package/dist/esm/{column-views.439a26db.css → column-views.b72918ce.css} +45 -20
- package/dist/esm/column-views.b72918ce.css.map +1 -0
- package/dist/esm/{column-views.0f2121e4.js → column-views.cc5244c4.js} +75 -29
- package/dist/esm/column-views.cc5244c4.js.map +1 -0
- package/dist/esm/{column-views.4637f4ce.js → column-views.cdadc5c2.js} +4 -1
- package/dist/esm/column-views.cdadc5c2.js.map +1 -0
- package/dist/esm/{column-views.fef7389f.js → column-views.d48cb0d8.js} +10 -1
- package/dist/esm/column-views.d48cb0d8.js.map +1 -0
- package/dist/esm/{column-views.b9fe5176.js → column-views.e3b9a317.js} +2 -2
- package/dist/esm/{column-views.b9fe5176.js.map → column-views.e3b9a317.js.map} +1 -1
- package/dist/esm/{column-views.f13a1d6e.js → column-views.e7ab5af0.js} +2 -2
- package/dist/esm/{column-views.f13a1d6e.js.map → column-views.e7ab5af0.js.map} +1 -1
- package/dist/esm/{column-views.a91dde4a.js → column-views.f20eb583.js} +5 -56
- package/dist/esm/column-views.f20eb583.js.map +1 -0
- package/dist/esm/{column-views.59bb0cba.js → column-views.f7523c1d.js} +2 -2
- package/dist/esm/{column-views.59bb0cba.js.map → column-views.f7523c1d.js.map} +1 -1
- package/dist/esm/column-views.fbc7401f.js +11 -0
- package/dist/esm/{column-views.c322a5e7.js.map → column-views.fbc7401f.js.map} +1 -1
- package/dist/esm/index.d.ts +77 -13
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +10 -10
- package/dist/node/column-views.085f4a51.js +2 -0
- package/dist/node/column-views.085f4a51.js.map +1 -0
- package/dist/node/{column-views.2877f398.js → column-views.0cbd4a3f.js} +2 -2
- package/dist/node/{column-views.2877f398.js.map → column-views.0cbd4a3f.js.map} +1 -1
- package/dist/node/{column-views.45defa84.js → column-views.0dfc7ef7.js} +2 -2
- package/dist/node/{column-views.45defa84.js.map → column-views.0dfc7ef7.js.map} +1 -1
- package/dist/node/column-views.2926f656.css +2 -0
- package/dist/node/column-views.2926f656.css.map +1 -0
- package/dist/node/column-views.2a6b842d.js +2 -0
- package/dist/node/column-views.2a6b842d.js.map +1 -0
- package/dist/node/{column-views.2a70b9a2.js → column-views.2ca669bc.js} +2 -2
- package/dist/node/{column-views.2a70b9a2.js.map → column-views.2ca669bc.js.map} +1 -1
- package/dist/node/column-views.2d957a97.js +2 -0
- package/dist/node/column-views.2d957a97.js.map +1 -0
- package/dist/node/column-views.307661d1.css +2 -0
- package/dist/node/column-views.307661d1.css.map +1 -0
- package/dist/node/column-views.38357d4a.js +2 -0
- package/dist/node/column-views.38357d4a.js.map +1 -0
- package/dist/node/column-views.3eeac38d.js +2 -0
- package/dist/node/column-views.3eeac38d.js.map +1 -0
- package/dist/node/{column-views.7350ac73.js → column-views.42db0bb8.js} +2 -2
- package/dist/node/{column-views.7350ac73.js.map → column-views.42db0bb8.js.map} +1 -1
- package/dist/node/{column-views.6b6b756b.js → column-views.45fab61b.js} +2 -2
- package/dist/node/{column-views.6b6b756b.js.map → column-views.45fab61b.js.map} +1 -1
- package/dist/node/{column-views.0220026c.js → column-views.492b4917.js} +2 -2
- package/dist/node/{column-views.0220026c.js.map → column-views.492b4917.js.map} +1 -1
- package/dist/node/column-views.4ca62e5d.js +2 -0
- package/dist/node/column-views.4ca62e5d.js.map +1 -0
- package/dist/node/{column-views.3bd09ad6.js → column-views.51bc87ca.js} +2 -2
- package/dist/node/{column-views.3bd09ad6.js.map → column-views.51bc87ca.js.map} +1 -1
- package/dist/node/{column-views.cf90f63d.js → column-views.58d2f993.js} +2 -2
- package/dist/node/{column-views.cf90f63d.js.map → column-views.58d2f993.js.map} +1 -1
- package/dist/node/{column-views.5b6833f0.js → column-views.65f091ea.js} +2 -2
- package/dist/node/{column-views.5b6833f0.js.map → column-views.65f091ea.js.map} +1 -1
- package/dist/node/column-views.6ae7bb69.js +2 -0
- package/dist/node/column-views.6ae7bb69.js.map +1 -0
- package/dist/node/column-views.6f7a432f.js +2 -0
- package/dist/node/column-views.6f7a432f.js.map +1 -0
- package/dist/node/{column-views.664dc6c9.js → column-views.7010a03b.js} +2 -2
- package/dist/node/{column-views.664dc6c9.js.map → column-views.7010a03b.js.map} +1 -1
- package/dist/node/column-views.758b9bc1.js +2 -0
- package/dist/node/column-views.758b9bc1.js.map +1 -0
- package/dist/node/column-views.80fcf105.js +2 -0
- package/dist/node/column-views.80fcf105.js.map +1 -0
- package/dist/node/{column-views.ce6808fe.js → column-views.858b5cf4.js} +2 -2
- package/dist/node/{column-views.ce6808fe.js.map → column-views.858b5cf4.js.map} +1 -1
- package/dist/node/{column-views.f76ba19f.js → column-views.91043465.js} +2 -2
- package/dist/node/{column-views.f76ba19f.js.map → column-views.91043465.js.map} +1 -1
- package/dist/node/{column-views.770d2c95.js → column-views.976a829b.js} +2 -2
- package/dist/node/{column-views.770d2c95.js.map → column-views.976a829b.js.map} +1 -1
- package/dist/node/column-views.99fb74c0.js +2 -0
- package/dist/node/column-views.99fb74c0.js.map +1 -0
- package/dist/node/column-views.9b7a9ae1.js +2 -0
- package/dist/node/column-views.9b7a9ae1.js.map +1 -0
- package/dist/node/column-views.9de31cdb.js +2 -0
- package/dist/node/column-views.9de31cdb.js.map +1 -0
- package/dist/node/column-views.a2274834.js +2 -0
- package/dist/node/column-views.a2274834.js.map +1 -0
- package/dist/node/{column-views.4e2bdf9b.js → column-views.a372c943.js} +2 -2
- package/dist/node/{column-views.4e2bdf9b.js.map → column-views.a372c943.js.map} +1 -1
- package/dist/node/column-views.a4e6d4ad.js +2 -0
- package/dist/node/column-views.a4e6d4ad.js.map +1 -0
- package/dist/node/{column-views.39c07f5f.js → column-views.a7256aa7.js} +2 -2
- package/dist/node/{column-views.39c07f5f.js.map → column-views.a7256aa7.js.map} +1 -1
- package/dist/node/column-views.c4b409e1.css +2 -0
- package/dist/node/column-views.c4b409e1.css.map +1 -0
- package/dist/node/{column-views.0859f5d2.js → column-views.c7f6fc0a.js} +2 -2
- package/dist/node/{column-views.0859f5d2.js.map → column-views.c7f6fc0a.js.map} +1 -1
- package/dist/node/column-views.cef1b814.js +2 -0
- package/dist/node/column-views.cef1b814.js.map +1 -0
- package/dist/node/{column-views.12a70e9d.js → column-views.d9add589.js} +2 -2
- package/dist/node/{column-views.12a70e9d.js.map → column-views.d9add589.js.map} +1 -1
- package/dist/node/{column-views.39d3a0be.js → column-views.df97f28e.js} +2 -2
- package/dist/node/{column-views.39d3a0be.js.map → column-views.df97f28e.js.map} +1 -1
- package/dist/node/{column-views.6f0c1134.js → column-views.dfb2361a.js} +2 -2
- package/dist/node/{column-views.6f0c1134.js.map → column-views.dfb2361a.js.map} +1 -1
- package/dist/node/{column-views.6b441349.js → column-views.e3ba0594.js} +2 -2
- package/dist/node/{column-views.6b441349.js.map → column-views.e3ba0594.js.map} +1 -1
- package/dist/node/column-views.eeca917f.js +2 -0
- package/dist/node/column-views.eeca917f.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +10 -10
- package/src/age-axis.ts +11 -6
- package/src/column.module.sass +9 -0
- package/src/column.ts +23 -1
- package/src/data-provider/base.ts +50 -3
- package/src/data-provider/fetch.ts +15 -0
- package/src/facets/fossils/index.module.sass +1 -1
- package/src/facets/fossils/index.ts +104 -12
- package/src/facets/index.ts +1 -0
- package/src/facets/measurements/index.ts +39 -0
- package/src/facets/measurements/provider.ts +80 -0
- package/src/unit-details/index.ts +1 -0
- package/src/unit-details/modal-panel.ts +61 -0
- package/src/unit-details/panel.module.sass +41 -17
- package/src/unit-details/panel.ts +114 -36
- package/src/units/boxes.ts +1 -64
- package/src/units/selection.ts +0 -1
- package/dist/esm/column-views.0f2121e4.js.map +0 -1
- package/dist/esm/column-views.10eba967.js +0 -11
- package/dist/esm/column-views.1af9761e.js.map +0 -1
- package/dist/esm/column-views.1c92b88f.js.map +0 -1
- package/dist/esm/column-views.217078ab.css.map +0 -1
- package/dist/esm/column-views.3ba9213d.js.map +0 -1
- package/dist/esm/column-views.439a26db.css.map +0 -1
- package/dist/esm/column-views.4637f4ce.js.map +0 -1
- package/dist/esm/column-views.57636733.css.map +0 -1
- package/dist/esm/column-views.5cc09c1d.js.map +0 -1
- package/dist/esm/column-views.813d5bba.js.map +0 -1
- package/dist/esm/column-views.892ce22f.js.map +0 -1
- package/dist/esm/column-views.a91dde4a.js.map +0 -1
- package/dist/esm/column-views.c322a5e7.js +0 -9
- package/dist/esm/column-views.fa19cea0.js +0 -108
- package/dist/esm/column-views.fa19cea0.js.map +0 -1
- package/dist/esm/column-views.fef7389f.js.map +0 -1
- package/dist/node/column-views.04407342.js +0 -2
- package/dist/node/column-views.04407342.js.map +0 -1
- package/dist/node/column-views.059a41c1.js +0 -2
- package/dist/node/column-views.059a41c1.js.map +0 -1
- package/dist/node/column-views.10a2bad6.js +0 -2
- package/dist/node/column-views.10a2bad6.js.map +0 -1
- package/dist/node/column-views.12414005.js +0 -2
- package/dist/node/column-views.12414005.js.map +0 -1
- package/dist/node/column-views.1de87649.js +0 -2
- package/dist/node/column-views.1de87649.js.map +0 -1
- package/dist/node/column-views.3345cd7a.js +0 -2
- package/dist/node/column-views.3345cd7a.js.map +0 -1
- package/dist/node/column-views.3cb3345e.js +0 -2
- package/dist/node/column-views.3cb3345e.js.map +0 -1
- package/dist/node/column-views.6da49480.js +0 -2
- package/dist/node/column-views.6da49480.js.map +0 -1
- package/dist/node/column-views.7f951eeb.js +0 -2
- package/dist/node/column-views.7f951eeb.js.map +0 -1
- package/dist/node/column-views.9771eb09.css +0 -2
- package/dist/node/column-views.9771eb09.css.map +0 -1
- package/dist/node/column-views.9f796135.js +0 -2
- package/dist/node/column-views.9f796135.js.map +0 -1
- package/dist/node/column-views.a0aac838.js +0 -2
- package/dist/node/column-views.a0aac838.js.map +0 -1
- package/dist/node/column-views.a8ffe072.js +0 -2
- package/dist/node/column-views.a8ffe072.js.map +0 -1
- package/dist/node/column-views.aa50c532.js +0 -2
- package/dist/node/column-views.aa50c532.js.map +0 -1
- package/dist/node/column-views.b773edb8.js +0 -2
- package/dist/node/column-views.b773edb8.js.map +0 -1
- package/dist/node/column-views.cd3c430b.js +0 -2
- package/dist/node/column-views.cd3c430b.js.map +0 -1
- package/dist/node/column-views.cd468adb.css +0 -2
- package/dist/node/column-views.cd468adb.css.map +0 -1
- package/dist/node/column-views.d9bbd6fb.css +0 -2
- package/dist/node/column-views.d9bbd6fb.css.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,mB,C,C,mB,C,C,sB,C,K,+B,A,Q,iB,C,K,2B,A,Q,W,C,K,O,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,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,c,I,G,E,E,oB,I,G,E,E,qB,I,G,E,E,gB,I,G,E,E,e,I,G,E,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CACtB,KAHW,AAAA,EAJK,AAAA,EAAQ,IACjB,AAAA,CAAA,EAAA,EAAA,SAAQ,AAAR,EAAU,EAAM,QAAQ,EAC9B,CAAC,EAAM,QAAQ,EAAE,QAAQ,GAM1B,gBAAA,EACA,GAAG,CAAK,AACV,EACF,C,E,E,G,E,E,G,E,E,G,E,E,U,K,W,C,K,iB,C,K,kB,C,K,a,C,K,Y,C,K,oB,C,K,yB,C,K,+B,C,6C,iB,C,6C,oB,C,6C,kB,C,6C,sB,C,6C,oB,C,6C,oB,C,6C,mB,C,6C,c,C,4C,mB,C,6C,wB,C,6C,qB,C,6C,e,C,6C,qB,C,6C,sB,C,6C,sB","sources":["<anon>","packages/column-views/src/units/index.ts"],"sourcesContent":["import \"./column-views.2e4e357d.js\";\nimport \"./column-views.b773edb8.js\";\nimport \"./column-views.6bba8c57.js\";\nimport \"./column-views.770d2c95.js\";\nimport \"./column-views.a0aac838.js\";\nimport \"./column-views.e7e26765.js\";\nimport \"./column-views.e6720522.js\";\nimport \"./column-views.10a2bad6.js\";\nimport $6u7Ut$macrostrathyper from \"@macrostrat/hyper\";\nimport {LithologyColumn as $6u7Ut$LithologyColumn, useColumnLayout as $6u7Ut$useColumnLayout, useGeologicPattern as $6u7Ut$useGeologicPattern} from \"@macrostrat/column-components\";\nimport {useInDarkMode as $6u7Ut$useInDarkMode} from \"@macrostrat/ui-components\";\nimport {useMemo as $6u7Ut$useMemo} from \"react\";\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 $1da06db49d2262cb$exports = {};\n\n$parcel$export($1da06db49d2262cb$exports, \"UnitsColumn\", () => $1da06db49d2262cb$export$3750278673318c9a);\n$parcel$export($1da06db49d2262cb$exports, \"SimpleUnitsColumn\", () => $1da06db49d2262cb$export$2006342ddaa547c6);\n$parcel$export($1da06db49d2262cb$exports, \"BasicUnitComponent\", () => $1da06db49d2262cb$export$600691a8e9d13a7);\n$parcel$export($1da06db49d2262cb$exports, \"UnitComponent\", () => $1da06db49d2262cb$export$48a4cacf2b7a4441);\n$parcel$export($1da06db49d2262cb$exports, \"useUnitColor\", () => $1da06db49d2262cb$export$62c7735c72801c19);\n$parcel$export($1da06db49d2262cb$exports, \"ColoredUnitComponent\", () => $1da06db49d2262cb$export$6012fd1584b5d0c0);\n$parcel$export($1da06db49d2262cb$exports, \"useUnitColorByEnvironment\", () => $1da06db49d2262cb$export$4830e703a903113);\n$parcel$export($1da06db49d2262cb$exports, \"EnvironmentColoredUnitComponent\", () => $1da06db49d2262cb$export$c2fe8a14da82d570);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\n\nvar $bfmPX = parcelRequire(\"bfmPX\");\n\nvar $4Abge = parcelRequire(\"4Abge\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\n\n\nvar $5VyZI = parcelRequire(\"5VyZI\");\n\nvar $lI6Sf = parcelRequire(\"lI6Sf\");\n\nvar $a3mb1 = parcelRequire(\"a3mb1\");\nfunction $1da06db49d2262cb$export$3750278673318c9a({ width: width = 100 }) {\n /*\n A column showing units with USGS color fill\n */ return (0, $6u7Ut$macrostrathyper)((0, $6u7Ut$LithologyColumn), {\n width: width\n }, (0, $6u7Ut$macrostrathyper)((0, $1n4Pb.UnitBoxes)));\n}\nfunction $1da06db49d2262cb$export$2006342ddaa547c6(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { columnWidth: columnWidth, width: width, gutterWidth: gutterWidth = 0, labelOffset: labelOffset = 30 } = props;\n return (0, $6u7Ut$macrostrathyper)([\n (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$3750278673318c9a, {\n width: columnWidth\n }),\n (0, $6u7Ut$macrostrathyper)((0, $jiUaC.UnitNamesColumn), {\n transform: `translate(${columnWidth + gutterWidth})`,\n paddingLeft: labelOffset,\n width: width - columnWidth - gutterWidth\n })\n ]);\n}\nfunction $1da06db49d2262cb$export$600691a8e9d13a7({ division: division, ...rest }) {\n /** A unit that allows directly setting colors and patterns. */ return (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$48a4cacf2b7a4441, {\n division: division,\n ...rest,\n backgroundColor: division.color,\n patternID: division.patternID\n });\n}\nfunction $1da06db49d2262cb$export$48a4cacf2b7a4441({ division: division, nColumns: nColumns = 2, ...rest }) {\n const width = rest.width ?? (0, $6u7Ut$useColumnLayout)()?.width;\n const nOverlappingUnits = division.overlappingUnits?.length ?? 0;\n const _nColumns = nOverlappingUnits == 0 ? 1 : nColumns;\n const columnIx = (division.column ?? 0) % _nColumns;\n const reducedWidth = width / _nColumns;\n const x = columnIx * width / _nColumns;\n return (0, $6u7Ut$macrostrathyper)((0, $4Abge.TrackedLabeledUnit), {\n division: division,\n ...rest,\n width: reducedWidth,\n x: x\n });\n}\nfunction $1da06db49d2262cb$export$62c7735c72801c19(unit, opts = {}) {\n /** Get the color for a unit based on its lithology */ const lithMap = (0, $lgTAP.useLithologies)();\n const inDarkMode = (0, $6u7Ut$useInDarkMode)();\n const { asBackground: asBackground = true } = opts;\n return (0, $6u7Ut$useMemo)(()=>{\n if (unit == null || lithMap == null) return null;\n return (0, $bfmPX.getMixedUnitColor)(unit, lithMap, inDarkMode, asBackground);\n }, [\n unit?.unit_id,\n lithMap,\n inDarkMode,\n asBackground\n ]);\n}\nfunction $1da06db49d2262cb$export$6012fd1584b5d0c0(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */ const backgroundColor = $1da06db49d2262cb$export$62c7735c72801c19(props.division);\n const patternID = (0, $6u7Ut$useMemo)(()=>{\n return (0, $5VyZI.resolveID)(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [\n props.division?.unit_id\n ]);\n const fill = (0, $6u7Ut$useGeologicPattern)(patternID);\n return (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$48a4cacf2b7a4441, {\n fill: fill,\n backgroundColor: backgroundColor,\n ...props\n });\n}\nfunction $1da06db49d2262cb$export$4830e703a903113(unit, opts = {}) {\n /** Get the color for a unit based on its lithology */ const environmentMap = (0, $lgTAP.useEnvironments)();\n const lithMap = (0, $lgTAP.useLithologies)();\n const inDarkMode = (0, $6u7Ut$useInDarkMode)();\n const { asBackground: asBackground = true } = opts;\n return (0, $6u7Ut$useMemo)(()=>{\n if (unit == null || environmentMap == null) return null;\n let c = (0, $bfmPX.getMixedUnitColor)(unit, environmentMap, inDarkMode, asBackground, {\n key: \"environ\",\n id_key: \"environ_id\"\n });\n if (c != null) return c;\n // Fallback to lithology color if no environment color is found\n return (0, $bfmPX.getMixedUnitColor)(unit, lithMap, inDarkMode, asBackground);\n }, [\n unit?.unit_id,\n environmentMap,\n lithMap,\n inDarkMode,\n asBackground\n ]);\n}\nfunction $1da06db49d2262cb$export$c2fe8a14da82d570(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */ const backgroundColor = $1da06db49d2262cb$export$4830e703a903113(props.division);\n const patternID = (0, $6u7Ut$useMemo)(()=>{\n return (0, $5VyZI.resolveID)(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [\n props.division?.unit_id\n ]);\n const fill = (0, $6u7Ut$useGeologicPattern)(patternID);\n return (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$48a4cacf2b7a4441, {\n fill: fill,\n backgroundColor: backgroundColor,\n ...props\n });\n}\nfunction $1da06db49d2262cb$var$getPatternID(liths, lithMap) {\n if (lithMap == null || liths == null || liths.length == 0) return null;\n const patternIDs = new Set();\n for (const lith of liths){\n const lithData = lithMap.get(lith.lith_id);\n if (lithData) patternIDs.add(`${lithData.fill}`);\n }\n let id = patternIDs.values()[0];\n if (id == \"0\") return null;\n return id;\n}\n$parcel$exportWildcard($1da06db49d2262cb$exports, $bfmPX);\n$parcel$exportWildcard($1da06db49d2262cb$exports, $4Abge);\n$parcel$exportWildcard($1da06db49d2262cb$exports, $lI6Sf);\n$parcel$exportWildcard($1da06db49d2262cb$exports, $a3mb1);\n\n\nexport {$1da06db49d2262cb$export$3750278673318c9a as UnitsColumn, $1da06db49d2262cb$export$2006342ddaa547c6 as SimpleUnitsColumn, $1da06db49d2262cb$export$600691a8e9d13a7 as BasicUnitComponent, $1da06db49d2262cb$export$48a4cacf2b7a4441 as UnitComponent, $1da06db49d2262cb$export$62c7735c72801c19 as useUnitColor, $1da06db49d2262cb$export$6012fd1584b5d0c0 as ColoredUnitComponent, $1da06db49d2262cb$export$4830e703a903113 as useUnitColorByEnvironment, $1da06db49d2262cb$export$c2fe8a14da82d570 as EnvironmentColoredUnitComponent, $0557c7dbdd54c055$export$175d3e927f1a9860 as getMixedUnitColor, $6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$723b790ebe9cdff8 as compositeScale, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider, $f7d31510668965d8$export$77a278d5ca56e309 as useUnitSelectionDispatch, $f7d31510668965d8$export$b220b1d3591dc9e5 as useUnitSelectionStore, $f7d31510668965d8$export$f0dd93f90aa8e5da as useSelectedUnit, $f7d31510668965d8$export$f19d75b1d4b676a4 as UnitSelectionProvider, $f7d31510668965d8$export$cbbec12b1451fe7d as useUnitSelectionTarget, $f7d31510668965d8$export$70f5ee19650fc7d1 as UnitKeyboardNavigation};\n//# sourceMappingURL=column-views.f76ba19f.js.map\n","import h from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n useGeologicPattern,\n} from \"@macrostrat/column-components\";\nimport { UnitNamesColumn } from \"./names\";\nimport { ICompositeUnitProps } from \"./composite\";\nimport { UnitBoxes, UnitProps } from \"./boxes\";\nimport { useColumnLayout } from \"@macrostrat/column-components\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport { getMixedUnitColor } from \"./colors\";\nimport { TrackedLabeledUnit } from \"./composite\";\nimport { useEnvironments, useLithologies } from \"../data-provider\";\nimport { useMemo } from \"react\";\nimport { resolveID } from \"./resolvers\";\nimport { Lithology } from \"@macrostrat/api-types\";\n\nexport * from \"./composite\";\nexport * from \"./types\";\nexport * from \"./selection\";\nexport * from \"./colors\";\n\nexport function UnitsColumn({ width = 100 }) {\n /*\n A column showing units with USGS color fill\n */\n return h(LithologyColumn, { width }, h(UnitBoxes));\n}\n\nexport function SimpleUnitsColumn(props: ICompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const { columnWidth, width, gutterWidth = 0, labelOffset = 30 } = props;\n\n return h([\n h(UnitsColumn, {\n width: columnWidth,\n }),\n h(UnitNamesColumn, {\n transform: `translate(${columnWidth + gutterWidth})`,\n paddingLeft: labelOffset,\n width: width - columnWidth - gutterWidth,\n }),\n ]);\n}\n\nexport function BasicUnitComponent({ division, ...rest }) {\n /** A unit that allows directly setting colors and patterns. */\n\n return h(UnitComponent, {\n division,\n ...rest,\n backgroundColor: division.color,\n patternID: division.patternID,\n });\n}\n\nexport function UnitComponent({ division, nColumns = 2, ...rest }) {\n const width = rest.width ?? useColumnLayout()?.width;\n\n const nOverlappingUnits = division.overlappingUnits?.length ?? 0;\n const _nColumns = nOverlappingUnits == 0 ? 1 : nColumns;\n const columnIx = (division.column ?? 0) % _nColumns;\n const reducedWidth = width / _nColumns;\n const x = (columnIx * width) / _nColumns;\n\n return h(TrackedLabeledUnit, {\n division,\n ...rest,\n width: reducedWidth,\n x,\n });\n}\n\ninterface UnitColorOptions {\n asBackground?: boolean;\n}\n\nexport function useUnitColor(unit, opts: UnitColorOptions = {}): string | null {\n /** Get the color for a unit based on its lithology */\n const lithMap = useLithologies();\n const inDarkMode = useInDarkMode();\n const { asBackground = true } = opts;\n\n return useMemo(() => {\n if (unit == null || lithMap == null) return null;\n return getMixedUnitColor(unit, lithMap, inDarkMode, asBackground);\n }, [unit?.unit_id, lithMap, inDarkMode, asBackground]);\n}\n\nexport function ColoredUnitComponent(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */\n const backgroundColor = useUnitColor(props.division);\n\n const patternID = useMemo(() => {\n return resolveID(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [props.division?.unit_id]);\n\n const fill = useGeologicPattern(patternID);\n\n return h(UnitComponent, {\n fill,\n backgroundColor,\n ...props,\n });\n}\n\nexport function useUnitColorByEnvironment(\n unit,\n opts: UnitColorOptions = {},\n): string | null {\n /** Get the color for a unit based on its lithology */\n const environmentMap = useEnvironments();\n const lithMap = useLithologies();\n const inDarkMode = useInDarkMode();\n const { asBackground = true } = opts;\n\n return useMemo(() => {\n if (unit == null || environmentMap == null) return null;\n let c = getMixedUnitColor(unit, environmentMap, inDarkMode, asBackground, {\n key: \"environ\",\n id_key: \"environ_id\",\n });\n if (c != null) {\n return c;\n }\n // Fallback to lithology color if no environment color is found\n return getMixedUnitColor(unit, lithMap, inDarkMode, asBackground);\n }, [unit?.unit_id, environmentMap, lithMap, inDarkMode, asBackground]);\n}\n\nexport function EnvironmentColoredUnitComponent(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */\n const backgroundColor = useUnitColorByEnvironment(props.division);\n\n const patternID = useMemo(() => {\n return resolveID(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [props.division?.unit_id]);\n\n const fill = useGeologicPattern(patternID);\n\n return h(UnitComponent, {\n fill,\n backgroundColor,\n ...props,\n });\n}\n\nfunction getPatternID(\n liths: Array<Lithology>,\n lithMap: Map<number, Lithology>,\n): string | null {\n if (lithMap == null || liths == null || liths.length == 0) {\n return null;\n }\n const patternIDs = new Set<string>();\n for (const lith of liths) {\n const lithData = lithMap.get(lith.lith_id);\n if (lithData) {\n patternIDs.add(`${lithData.fill}`);\n }\n }\n let id = patternIDs.values()[0];\n if (id == \"0\") return null;\n return id;\n}\n"],"names":["$6u7Ut$macrostrathyper","LithologyColumn","$6u7Ut$LithologyColumn","useColumnLayout","$6u7Ut$useColumnLayout","useGeologicPattern","$6u7Ut$useGeologicPattern","useInDarkMode","$6u7Ut$useInDarkMode","useMemo","$6u7Ut$useMemo","$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$export","e","n","v","s","set","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$1da06db49d2262cb$exports","$1da06db49d2262cb$export$3750278673318c9a","$1da06db49d2262cb$export$2006342ddaa547c6","$1da06db49d2262cb$export$600691a8e9d13a7","$1da06db49d2262cb$export$48a4cacf2b7a4441","$1da06db49d2262cb$export$62c7735c72801c19","$1da06db49d2262cb$export$6012fd1584b5d0c0","$1da06db49d2262cb$export$4830e703a903113","$1da06db49d2262cb$export$c2fe8a14da82d570","$jiUaC","$1n4Pb","$bfmPX","$4Abge","$lgTAP","$5VyZI","$lI6Sf","$a3mb1","width","UnitBoxes","props","columnWidth","gutterWidth","labelOffset","UnitNamesColumn","transform","paddingLeft","division","rest","backgroundColor","color","patternID","nColumns","_nColumns","nOverlappingUnits","overlappingUnits","length","columnIx","column","TrackedLabeledUnit","x","unit","opts","lithMap","useLithologies","inDarkMode","asBackground","getMixedUnitColor","unit_id","fill","resolveID","environmentMap","useEnvironments","c","id_key","UnitsColumn","SimpleUnitsColumn","BasicUnitComponent","UnitComponent","useUnitColor","ColoredUnitComponent","useUnitColorByEnvironment","EnvironmentColoredUnitComponent","$0557c7dbdd54c055$export$175d3e927f1a9860","$6b7af672ec278734$export$e4e89ab6c86ac513","LabelTrackerProvider","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","CompositeUnitComponent","$6b7af672ec278734$export$a6684360fef0406e","CompositeUnitsColumn","$6b7af672ec278734$export$d8c3f2fdd653a082","AnnotatedUnitsColumn","$6b7af672ec278734$export$13984e34afdbb040","SectionLabelsColumn","$6b7af672ec278734$export$723b790ebe9cdff8","compositeScale","$6b7af672ec278734$export$6cc7a9df4edde18","ColumnNotesProvider","$f7d31510668965d8$export$77a278d5ca56e309","useUnitSelectionDispatch","$f7d31510668965d8$export$b220b1d3591dc9e5","useUnitSelectionStore","$f7d31510668965d8$export$f0dd93f90aa8e5da","useSelectedUnit","$f7d31510668965d8$export$f19d75b1d4b676a4","UnitSelectionProvider","$f7d31510668965d8$export$cbbec12b1451fe7d","useUnitSelectionTarget","$f7d31510668965d8$export$70f5ee19650fc7d1","UnitKeyboardNavigation"],"version":3,"file":"column-views.f76ba19f.js.map","sourceRoot":"../../../../"}
|
|
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A,EACA,GAAG,CAAK,AACV,EACF,CAEO,SAAS,EACd,CAAI,CACJ,EAAyB,CAAC,CAAC,EAG3B,IAAM,EAAiB,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,IACjB,EAAU,AAAA,CAAA,EAAA,EAAA,cAAa,AAAb,IACV,EAAa,AAAA,IACb,CAAA,aAAE,EAAe,CAAA,CAAA,CAAM,CAAG,EAEhC,OAAO,AAAA,EAAQ,KACb,GAAI,AAAQ,MAAR,GAAgB,AAAkB,MAAlB,EAAwB,OAAO,KACnD,IAAI,EAAI,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,EAAkB,EAAM,EAAgB,EAAY,EAAc,CACxE,IAAK,UACL,OAAQ,YACV,UACA,AAAI,AAAK,MAAL,EACK,EAGF,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,EAAkB,EAAM,EAAS,EAAY,EACtD,EAAG,CAAC,GAAM,QAAS,EAAgB,EAAS,EAAY,EAAa,CACvE,CAEO,SAAS,EAAgC,CAAK,EAGnD,IAAM,EAAkB,EAA0B,EAAM,QAAQ,EAQhE,OAAO,AAAA,EAAE,EAAe,CACtB,KAHW,AAAA,EAJK,AAAA,EAAQ,IACjB,AAAA,CAAA,EAAA,EAAA,SAAQ,AAAR,EAAU,EAAM,QAAQ,EAC9B,CAAC,EAAM,QAAQ,EAAE,QAAQ,GAM1B,gBAAA,EACA,GAAG,CAAK,AACV,EACF,C,E,E,G,E,E,G,E,E,G,E,E,U,K,W,C,K,iB,C,K,kB,C,K,a,C,K,Y,C,K,oB,C,K,yB,C,K,+B,C,6C,iB,C,6C,oB,C,6C,kB,C,6C,sB,C,6C,oB,C,6C,oB,C,6C,mB,C,6C,c,C,4C,mB,C,6C,wB,C,6C,qB,C,6C,e,C,6C,qB,C,6C,sB,C,6C,sB","sources":["<anon>","packages/column-views/src/units/index.ts"],"sourcesContent":["import \"./column-views.2e4e357d.js\";\nimport \"./column-views.2d957a97.js\";\nimport \"./column-views.6bba8c57.js\";\nimport \"./column-views.976a829b.js\";\nimport \"./column-views.9de31cdb.js\";\nimport \"./column-views.e7e26765.js\";\nimport \"./column-views.e6720522.js\";\nimport \"./column-views.3eeac38d.js\";\nimport $6u7Ut$macrostrathyper from \"@macrostrat/hyper\";\nimport {LithologyColumn as $6u7Ut$LithologyColumn, useColumnLayout as $6u7Ut$useColumnLayout, useGeologicPattern as $6u7Ut$useGeologicPattern} from \"@macrostrat/column-components\";\nimport {useInDarkMode as $6u7Ut$useInDarkMode} from \"@macrostrat/ui-components\";\nimport {useMemo as $6u7Ut$useMemo} from \"react\";\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 $1da06db49d2262cb$exports = {};\n\n$parcel$export($1da06db49d2262cb$exports, \"UnitsColumn\", () => $1da06db49d2262cb$export$3750278673318c9a);\n$parcel$export($1da06db49d2262cb$exports, \"SimpleUnitsColumn\", () => $1da06db49d2262cb$export$2006342ddaa547c6);\n$parcel$export($1da06db49d2262cb$exports, \"BasicUnitComponent\", () => $1da06db49d2262cb$export$600691a8e9d13a7);\n$parcel$export($1da06db49d2262cb$exports, \"UnitComponent\", () => $1da06db49d2262cb$export$48a4cacf2b7a4441);\n$parcel$export($1da06db49d2262cb$exports, \"useUnitColor\", () => $1da06db49d2262cb$export$62c7735c72801c19);\n$parcel$export($1da06db49d2262cb$exports, \"ColoredUnitComponent\", () => $1da06db49d2262cb$export$6012fd1584b5d0c0);\n$parcel$export($1da06db49d2262cb$exports, \"useUnitColorByEnvironment\", () => $1da06db49d2262cb$export$4830e703a903113);\n$parcel$export($1da06db49d2262cb$exports, \"EnvironmentColoredUnitComponent\", () => $1da06db49d2262cb$export$c2fe8a14da82d570);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\n\nvar $bfmPX = parcelRequire(\"bfmPX\");\n\nvar $4Abge = parcelRequire(\"4Abge\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\n\n\nvar $5VyZI = parcelRequire(\"5VyZI\");\n\nvar $lI6Sf = parcelRequire(\"lI6Sf\");\n\nvar $a3mb1 = parcelRequire(\"a3mb1\");\nfunction $1da06db49d2262cb$export$3750278673318c9a({ width: width = 100 }) {\n /*\n A column showing units with USGS color fill\n */ return (0, $6u7Ut$macrostrathyper)((0, $6u7Ut$LithologyColumn), {\n width: width\n }, (0, $6u7Ut$macrostrathyper)((0, $1n4Pb.UnitBoxes)));\n}\nfunction $1da06db49d2262cb$export$2006342ddaa547c6(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { columnWidth: columnWidth, width: width, gutterWidth: gutterWidth = 0, labelOffset: labelOffset = 30 } = props;\n return (0, $6u7Ut$macrostrathyper)([\n (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$3750278673318c9a, {\n width: columnWidth\n }),\n (0, $6u7Ut$macrostrathyper)((0, $jiUaC.UnitNamesColumn), {\n transform: `translate(${columnWidth + gutterWidth})`,\n paddingLeft: labelOffset,\n width: width - columnWidth - gutterWidth\n })\n ]);\n}\nfunction $1da06db49d2262cb$export$600691a8e9d13a7({ division: division, ...rest }) {\n /** A unit that allows directly setting colors and patterns. */ return (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$48a4cacf2b7a4441, {\n division: division,\n ...rest,\n backgroundColor: division.color,\n patternID: division.patternID\n });\n}\nfunction $1da06db49d2262cb$export$48a4cacf2b7a4441({ division: division, nColumns: nColumns = 2, ...rest }) {\n const width = rest.width ?? (0, $6u7Ut$useColumnLayout)()?.width;\n const nOverlappingUnits = division.overlappingUnits?.length ?? 0;\n const _nColumns = nOverlappingUnits == 0 ? 1 : nColumns;\n const columnIx = (division.column ?? 0) % _nColumns;\n const reducedWidth = width / _nColumns;\n const x = columnIx * width / _nColumns;\n return (0, $6u7Ut$macrostrathyper)((0, $4Abge.TrackedLabeledUnit), {\n division: division,\n ...rest,\n width: reducedWidth,\n x: x\n });\n}\nfunction $1da06db49d2262cb$export$62c7735c72801c19(unit, opts = {}) {\n /** Get the color for a unit based on its lithology */ const lithMap = (0, $lgTAP.useLithologies)();\n const inDarkMode = (0, $6u7Ut$useInDarkMode)();\n const { asBackground: asBackground = true } = opts;\n return (0, $6u7Ut$useMemo)(()=>{\n if (unit == null || lithMap == null) return null;\n return (0, $bfmPX.getMixedUnitColor)(unit, lithMap, inDarkMode, asBackground);\n }, [\n unit?.unit_id,\n lithMap,\n inDarkMode,\n asBackground\n ]);\n}\nfunction $1da06db49d2262cb$export$6012fd1584b5d0c0(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */ const backgroundColor = $1da06db49d2262cb$export$62c7735c72801c19(props.division);\n const patternID = (0, $6u7Ut$useMemo)(()=>{\n return (0, $5VyZI.resolveID)(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [\n props.division?.unit_id\n ]);\n const fill = (0, $6u7Ut$useGeologicPattern)(patternID);\n return (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$48a4cacf2b7a4441, {\n fill: fill,\n backgroundColor: backgroundColor,\n ...props\n });\n}\nfunction $1da06db49d2262cb$export$4830e703a903113(unit, opts = {}) {\n /** Get the color for a unit based on its lithology */ const environmentMap = (0, $lgTAP.useEnvironments)();\n const lithMap = (0, $lgTAP.useLithologies)();\n const inDarkMode = (0, $6u7Ut$useInDarkMode)();\n const { asBackground: asBackground = true } = opts;\n return (0, $6u7Ut$useMemo)(()=>{\n if (unit == null || environmentMap == null) return null;\n let c = (0, $bfmPX.getMixedUnitColor)(unit, environmentMap, inDarkMode, asBackground, {\n key: \"environ\",\n id_key: \"environ_id\"\n });\n if (c != null) return c;\n // Fallback to lithology color if no environment color is found\n return (0, $bfmPX.getMixedUnitColor)(unit, lithMap, inDarkMode, asBackground);\n }, [\n unit?.unit_id,\n environmentMap,\n lithMap,\n inDarkMode,\n asBackground\n ]);\n}\nfunction $1da06db49d2262cb$export$c2fe8a14da82d570(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */ const backgroundColor = $1da06db49d2262cb$export$4830e703a903113(props.division);\n const patternID = (0, $6u7Ut$useMemo)(()=>{\n return (0, $5VyZI.resolveID)(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [\n props.division?.unit_id\n ]);\n const fill = (0, $6u7Ut$useGeologicPattern)(patternID);\n return (0, $6u7Ut$macrostrathyper)($1da06db49d2262cb$export$48a4cacf2b7a4441, {\n fill: fill,\n backgroundColor: backgroundColor,\n ...props\n });\n}\nfunction $1da06db49d2262cb$var$getPatternID(liths, lithMap) {\n if (lithMap == null || liths == null || liths.length == 0) return null;\n const patternIDs = new Set();\n for (const lith of liths){\n const lithData = lithMap.get(lith.lith_id);\n if (lithData) patternIDs.add(`${lithData.fill}`);\n }\n let id = patternIDs.values()[0];\n if (id == \"0\") return null;\n return id;\n}\n$parcel$exportWildcard($1da06db49d2262cb$exports, $bfmPX);\n$parcel$exportWildcard($1da06db49d2262cb$exports, $4Abge);\n$parcel$exportWildcard($1da06db49d2262cb$exports, $lI6Sf);\n$parcel$exportWildcard($1da06db49d2262cb$exports, $a3mb1);\n\n\nexport {$1da06db49d2262cb$export$3750278673318c9a as UnitsColumn, $1da06db49d2262cb$export$2006342ddaa547c6 as SimpleUnitsColumn, $1da06db49d2262cb$export$600691a8e9d13a7 as BasicUnitComponent, $1da06db49d2262cb$export$48a4cacf2b7a4441 as UnitComponent, $1da06db49d2262cb$export$62c7735c72801c19 as useUnitColor, $1da06db49d2262cb$export$6012fd1584b5d0c0 as ColoredUnitComponent, $1da06db49d2262cb$export$4830e703a903113 as useUnitColorByEnvironment, $1da06db49d2262cb$export$c2fe8a14da82d570 as EnvironmentColoredUnitComponent, $0557c7dbdd54c055$export$175d3e927f1a9860 as getMixedUnitColor, $6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$723b790ebe9cdff8 as compositeScale, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider, $f7d31510668965d8$export$77a278d5ca56e309 as useUnitSelectionDispatch, $f7d31510668965d8$export$b220b1d3591dc9e5 as useUnitSelectionStore, $f7d31510668965d8$export$f0dd93f90aa8e5da as useSelectedUnit, $f7d31510668965d8$export$f19d75b1d4b676a4 as UnitSelectionProvider, $f7d31510668965d8$export$cbbec12b1451fe7d as useUnitSelectionTarget, $f7d31510668965d8$export$70f5ee19650fc7d1 as UnitKeyboardNavigation};\n//# sourceMappingURL=column-views.91043465.js.map\n","import h from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n useGeologicPattern,\n} from \"@macrostrat/column-components\";\nimport { UnitNamesColumn } from \"./names\";\nimport { ICompositeUnitProps } from \"./composite\";\nimport { UnitBoxes, UnitProps } from \"./boxes\";\nimport { useColumnLayout } from \"@macrostrat/column-components\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport { getMixedUnitColor } from \"./colors\";\nimport { TrackedLabeledUnit } from \"./composite\";\nimport { useEnvironments, useLithologies } from \"../data-provider\";\nimport { useMemo } from \"react\";\nimport { resolveID } from \"./resolvers\";\nimport { Lithology } from \"@macrostrat/api-types\";\n\nexport * from \"./composite\";\nexport * from \"./types\";\nexport * from \"./selection\";\nexport * from \"./colors\";\n\nexport function UnitsColumn({ width = 100 }) {\n /*\n A column showing units with USGS color fill\n */\n return h(LithologyColumn, { width }, h(UnitBoxes));\n}\n\nexport function SimpleUnitsColumn(props: ICompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const { columnWidth, width, gutterWidth = 0, labelOffset = 30 } = props;\n\n return h([\n h(UnitsColumn, {\n width: columnWidth,\n }),\n h(UnitNamesColumn, {\n transform: `translate(${columnWidth + gutterWidth})`,\n paddingLeft: labelOffset,\n width: width - columnWidth - gutterWidth,\n }),\n ]);\n}\n\nexport function BasicUnitComponent({ division, ...rest }) {\n /** A unit that allows directly setting colors and patterns. */\n\n return h(UnitComponent, {\n division,\n ...rest,\n backgroundColor: division.color,\n patternID: division.patternID,\n });\n}\n\nexport function UnitComponent({ division, nColumns = 2, ...rest }) {\n const width = rest.width ?? useColumnLayout()?.width;\n\n const nOverlappingUnits = division.overlappingUnits?.length ?? 0;\n const _nColumns = nOverlappingUnits == 0 ? 1 : nColumns;\n const columnIx = (division.column ?? 0) % _nColumns;\n const reducedWidth = width / _nColumns;\n const x = (columnIx * width) / _nColumns;\n\n return h(TrackedLabeledUnit, {\n division,\n ...rest,\n width: reducedWidth,\n x,\n });\n}\n\ninterface UnitColorOptions {\n asBackground?: boolean;\n}\n\nexport function useUnitColor(unit, opts: UnitColorOptions = {}): string | null {\n /** Get the color for a unit based on its lithology */\n const lithMap = useLithologies();\n const inDarkMode = useInDarkMode();\n const { asBackground = true } = opts;\n\n return useMemo(() => {\n if (unit == null || lithMap == null) return null;\n return getMixedUnitColor(unit, lithMap, inDarkMode, asBackground);\n }, [unit?.unit_id, lithMap, inDarkMode, asBackground]);\n}\n\nexport function ColoredUnitComponent(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */\n const backgroundColor = useUnitColor(props.division);\n\n const patternID = useMemo(() => {\n return resolveID(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [props.division?.unit_id]);\n\n const fill = useGeologicPattern(patternID);\n\n return h(UnitComponent, {\n fill,\n backgroundColor,\n ...props,\n });\n}\n\nexport function useUnitColorByEnvironment(\n unit,\n opts: UnitColorOptions = {},\n): string | null {\n /** Get the color for a unit based on its lithology */\n const environmentMap = useEnvironments();\n const lithMap = useLithologies();\n const inDarkMode = useInDarkMode();\n const { asBackground = true } = opts;\n\n return useMemo(() => {\n if (unit == null || environmentMap == null) return null;\n let c = getMixedUnitColor(unit, environmentMap, inDarkMode, asBackground, {\n key: \"environ\",\n id_key: \"environ_id\",\n });\n if (c != null) {\n return c;\n }\n // Fallback to lithology color if no environment color is found\n return getMixedUnitColor(unit, lithMap, inDarkMode, asBackground);\n }, [unit?.unit_id, environmentMap, lithMap, inDarkMode, asBackground]);\n}\n\nexport function EnvironmentColoredUnitComponent(props) {\n /** A unit component that is colored using a mixture of lithologies.\n * This is a separate component because it depends on more providers/contexts to determine coloring. */\n const backgroundColor = useUnitColorByEnvironment(props.division);\n\n const patternID = useMemo(() => {\n return resolveID(props.division); // ?? getPatternID(props.division.lith, lithMap);\n }, [props.division?.unit_id]);\n\n const fill = useGeologicPattern(patternID);\n\n return h(UnitComponent, {\n fill,\n backgroundColor,\n ...props,\n });\n}\n\nfunction getPatternID(\n liths: Array<Lithology>,\n lithMap: Map<number, Lithology>,\n): string | null {\n if (lithMap == null || liths == null || liths.length == 0) {\n return null;\n }\n const patternIDs = new Set<string>();\n for (const lith of liths) {\n const lithData = lithMap.get(lith.lith_id);\n if (lithData) {\n patternIDs.add(`${lithData.fill}`);\n }\n }\n let id = patternIDs.values()[0];\n if (id == \"0\") return null;\n return id;\n}\n"],"names":["$6u7Ut$macrostrathyper","LithologyColumn","$6u7Ut$LithologyColumn","useColumnLayout","$6u7Ut$useColumnLayout","useGeologicPattern","$6u7Ut$useGeologicPattern","useInDarkMode","$6u7Ut$useInDarkMode","useMemo","$6u7Ut$useMemo","$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$export","e","n","v","s","set","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$1da06db49d2262cb$exports","$1da06db49d2262cb$export$3750278673318c9a","$1da06db49d2262cb$export$2006342ddaa547c6","$1da06db49d2262cb$export$600691a8e9d13a7","$1da06db49d2262cb$export$48a4cacf2b7a4441","$1da06db49d2262cb$export$62c7735c72801c19","$1da06db49d2262cb$export$6012fd1584b5d0c0","$1da06db49d2262cb$export$4830e703a903113","$1da06db49d2262cb$export$c2fe8a14da82d570","$jiUaC","$1n4Pb","$bfmPX","$4Abge","$lgTAP","$5VyZI","$lI6Sf","$a3mb1","width","UnitBoxes","props","columnWidth","gutterWidth","labelOffset","UnitNamesColumn","transform","paddingLeft","division","rest","backgroundColor","color","patternID","nColumns","_nColumns","nOverlappingUnits","overlappingUnits","length","columnIx","column","TrackedLabeledUnit","x","unit","opts","lithMap","useLithologies","inDarkMode","asBackground","getMixedUnitColor","unit_id","fill","resolveID","environmentMap","useEnvironments","c","id_key","UnitsColumn","SimpleUnitsColumn","BasicUnitComponent","UnitComponent","useUnitColor","ColoredUnitComponent","useUnitColorByEnvironment","EnvironmentColoredUnitComponent","$0557c7dbdd54c055$export$175d3e927f1a9860","$6b7af672ec278734$export$e4e89ab6c86ac513","LabelTrackerProvider","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","CompositeUnitComponent","$6b7af672ec278734$export$a6684360fef0406e","CompositeUnitsColumn","$6b7af672ec278734$export$d8c3f2fdd653a082","AnnotatedUnitsColumn","$6b7af672ec278734$export$13984e34afdbb040","SectionLabelsColumn","$6b7af672ec278734$export$723b790ebe9cdff8","compositeScale","$6b7af672ec278734$export$6cc7a9df4edde18","ColumnNotesProvider","$f7d31510668965d8$export$77a278d5ca56e309","useUnitSelectionDispatch","$f7d31510668965d8$export$b220b1d3591dc9e5","useUnitSelectionStore","$f7d31510668965d8$export$f0dd93f90aa8e5da","useSelectedUnit","$f7d31510668965d8$export$f19d75b1d4b676a4","UnitSelectionProvider","$f7d31510668965d8$export$cbbec12b1451fe7d","useUnitSelectionTarget","$f7d31510668965d8$export$70f5ee19650fc7d1","UnitKeyboardNavigation"],"version":3,"file":"column-views.91043465.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.2e4e357d.js";import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.2e4e357d.js";import"./column-views.2d957a97.js";import"./column-views.6a0a35e7.js";import"./column-views.78d3f3c5.js";import"./column-views.3eeac38d.js";import{hyperStyled as e}from"@macrostrat/hyper";import{LithologyColumn as t,SVG as n,ColumnContext as o}from"@macrostrat/column-components";import{createContext as a,useState as i,useRef as r,useCallback as l,useContext as s,useEffect as c}from"react";function d(e,t,n,o){Object.defineProperty(e,t,{get:n,set:o,enumerable:!0,configurable:!0})}var u=globalThis,p={},m={},f=u.parcelRequirea149;null==f&&((f=function(e){if(e in p)return p[e].exports;if(e in m){var t=m[e];delete m[e];var n={id:e,exports:{}};return p[e]=n,t.call(n.exports,n,n.exports),n.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){m[e]=t},u.parcelRequirea149=f),f.register;var b={};d(b,"LabelTrackerProvider",()=>S),d(b,"TrackedLabeledUnit",()=>y),d(b,"CompositeUnitComponent",()=>w),d(b,"CompositeUnitsColumn",()=>L),d(b,"AnnotatedUnitsColumn",()=>P),d(b,"SectionLabelsColumn",()=>T),d(b,"compositeScale",()=>N),d(b,"ColumnNotesProvider",()=>F);var C=f("jiUaC"),v=f("1n4Pb"),x=f("45u6B"),h=f("wtIgl"),$=f("a3mb1");let g=e(x&&x.__esModule?x.default:x),U=a(null),H=a(null),_=e=>e.unit_id;function S(e){let{children:t,units:n,findUnitID:o=_}=e,[a,s]=i(null),c=r({}),d=l((e,t)=>{let a=o(e);c.current[a]=t,Object.keys(c.current).length==n.length&&s(n.filter(e=>{let t=o(e);return!1==c.current[t]}))},[c,n,o]);return g(U.Provider,{value:d},g(H.Provider,{value:a},t))}function y({division:e,nameForDivision:t=C.defaultNameFunction,...n}){let o=s(U);return g(v.LabeledUnit,{division:e,label:t(e),onLabelUpdated(t,n){o?.(e,n)},...n})}let w=y;function L(e){let{width:n,unitComponent:o=y,unitComponentProps:a,clipToFrame:i,...r}=e;return g(t,{width:n,clipToFrame:i},[g(v.UnitBoxes,{unitComponent:o,unitComponentProps:a,...r})])}function P(e){return c(()=>{console.warn("AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes")},[]),null}function T(e){let{width:t=300,noteMode:o="unlabeled",labelOffset:a=30,noteComponent:i,shouldRenderNote:r}=e,{sections:l,totalHeight:c,axisType:d}=(0,h.useMacrostratColumnData)(),u=s(H),p=N(l),m=(0,$.useUnitSelectionDispatch)();return g("div.section-labels-column",[g(F,{units:[],scale:p,totalHeight:c,axisType:d},g(n,{height:c,innerWidth:t-4,paddingH:1,paddingLeft:3},g(C.UnitNamesColumn,{divisions:"unlabeled"==o?u:void 0,paddingLeft:a,width:t,noteComponent:i,shouldRenderNote:r,scale:p,onClickNote(e){m(e.data,null,null)}})))])}function N(e,t={}){let{clamped:n=!0}=t,o=e.map(e=>{let{scaleInfo:t}=e;return t.scale.copy().clamp(n)}),a=e=>{let t=o.find(t=>t.domain()[0]<=e&&e<=t.domain()[1]);return t?t(e):NaN};return a.copy=()=>a,a.domain=()=>[o[0].domain()[0],o[o.length-1].domain()[1]],a}function F(e){let{children:t,scale:n,totalHeight:a,pixelScale:i}=e,{axisType:r}=(0,h.useMacrostratColumnData)();return g(o.Provider,{value:{divisions:[],scale:n,scaleClamped:n,pixelHeight:a,pixelsPerMeter:i,axisType:r,zoom:1}},t)}export{S as LabelTrackerProvider,y as TrackedLabeledUnit,w as CompositeUnitComponent,L as CompositeUnitsColumn,P as AnnotatedUnitsColumn,T as SectionLabelsColumn,N as compositeScale,F as ColumnNotesProvider};
|
|
2
|
+
//# sourceMappingURL=column-views.976a829b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,e,C,K,mB,A,Q,mB,C,C,O,C,C,iB,C,K,+B,A,Q,iB,C,C,Y,C,C,U,C,C,e,C,C,c,C,C,a,C,K,O,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,uB,I,G,E,E,qB,I,G,E,E,yB,I,G,E,E,uB,I,G,E,E,uB,I,G,E,E,sB,I,G,E,E,iB,I,G,E,E,sB,I,G,I,E,E,S,E,E,S,E,E,S,E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,CAAC,IAAI,GAAG,KAAK,CAAC,EACtC,GAEI,EAAiB,AAAC,IAEpB,IAAM,EAAQ,EAAO,IAAI,CAAC,AAAC,GAClB,EAAM,MAAM,EAAE,CAAC,EAAE,EAAI,GAAO,GAAO,EAAM,MAAM,EAAE,CAAC,EAAE,SAG7D,AAAI,EACK,EAAM,GAGN,GAEX,EAWA,OATA,EAAU,IAAI,CAAG,IACR,EAGT,EAAU,MAAM,CAAG,IAEV,CAAC,CAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAE,CAAM,CAAC,EAAO,MAAM,CAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAGhE,CACT,CAEO,SAAS,EAAoB,CAAK,EAEvC,GAAM,CAAA,SAAE,CAAQ,CAAA,MAAE,CAAK,CAAA,YAAE,CAAW,CAAA,WAAE,CAAU,CAAE,CAAG,EAE/C,CAAA,SAAE,CAAQ,CAAE,CAAG,AAAA,CAAA,EAAA,EAAA,uBAAsB,AAAtB,IAErB,OAAO,EACL,AAAA,EAAc,QAAQ,CACtB,CACE,MAAO,CACL,UAAW,EAAE,CACb,MAAA,EACA,aAAc,EACd,YAAa,EACb,eAAgB,EAChB,SAAA,EACA,KAAM,CACR,CACF,EACA,EAEJ,Q,K,oB,C,K,kB,C,K,sB,C,K,oB,C,K,oB,C,K,mB,C,K,c,C,K,mB","sources":["<anon>","packages/column-views/src/units/composite.ts"],"sourcesContent":["import \"./column-views.2e4e357d.js\";\nimport \"./column-views.b773edb8.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.78d3f3c5.js\";\nimport \"./column-views.10a2bad6.js\";\nimport {hyperStyled as $hj0lx$hyperStyled} from \"@macrostrat/hyper\";\nimport {LithologyColumn as $hj0lx$LithologyColumn, SVG as $hj0lx$SVG, ColumnContext as $hj0lx$ColumnContext} from \"@macrostrat/column-components\";\nimport {createContext as $hj0lx$createContext, useState as $hj0lx$useState, useRef as $hj0lx$useRef, useCallback as $hj0lx$useCallback, useContext as $hj0lx$useContext, useEffect as $hj0lx$useEffect} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $6b7af672ec278734$exports = {};\n\n$parcel$export($6b7af672ec278734$exports, \"LabelTrackerProvider\", () => $6b7af672ec278734$export$e4e89ab6c86ac513);\n$parcel$export($6b7af672ec278734$exports, \"TrackedLabeledUnit\", () => $6b7af672ec278734$export$f613830566442374);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitComponent\", () => $6b7af672ec278734$export$1dfa200d57964eee);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitsColumn\", () => $6b7af672ec278734$export$a6684360fef0406e);\n$parcel$export($6b7af672ec278734$exports, \"AnnotatedUnitsColumn\", () => $6b7af672ec278734$export$d8c3f2fdd653a082);\n$parcel$export($6b7af672ec278734$exports, \"SectionLabelsColumn\", () => $6b7af672ec278734$export$13984e34afdbb040);\n$parcel$export($6b7af672ec278734$exports, \"compositeScale\", () => $6b7af672ec278734$export$723b790ebe9cdff8);\n$parcel$export($6b7af672ec278734$exports, \"ColumnNotesProvider\", () => $6b7af672ec278734$export$6cc7a9df4edde18);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\nvar $45u6B = parcelRequire(\"45u6B\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $a3mb1 = parcelRequire(\"a3mb1\");\nconst $6b7af672ec278734$var$h = (0, $hj0lx$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($45u6B))));\nconst $6b7af672ec278734$var$LabelTrackerContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$UnlabeledDivisionsContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$findMacrostratUnitID = (u)=>u.unit_id;\nfunction $6b7af672ec278734$export$e4e89ab6c86ac513(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */ const { children: children, units: units, findUnitID: findUnitID = $6b7af672ec278734$var$findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = (0, $hj0lx$useState)(null);\n const labelTrackerRef = (0, $hj0lx$useRef)({});\n const trackLabelVisibility = (0, $hj0lx$useCallback)((div, visible)=>{\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) setUnlabeledDivisions(// @ts-ignore\n units.filter((d)=>{\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }));\n }, [\n labelTrackerRef,\n units,\n findUnitID\n ]);\n const value = trackLabelVisibility;\n return $6b7af672ec278734$var$h($6b7af672ec278734$var$LabelTrackerContext.Provider, {\n value: value\n }, $6b7af672ec278734$var$h($6b7af672ec278734$var$UnlabeledDivisionsContext.Provider, {\n value: unlabeledDivisions\n }, children));\n}\nfunction $6b7af672ec278734$export$f613830566442374({ division: division, nameForDivision: nameForDivision = (0, $jiUaC.defaultNameFunction), ...rest }) {\n const trackLabelVisibility = (0, $hj0lx$useContext)($6b7af672ec278734$var$LabelTrackerContext);\n return $6b7af672ec278734$var$h((0, $1n4Pb.LabeledUnit), {\n division: division,\n label: nameForDivision(division),\n onLabelUpdated (label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest\n });\n}\nconst $6b7af672ec278734$export$1dfa200d57964eee = $6b7af672ec278734$export$f613830566442374;\nfunction $6b7af672ec278734$export$a6684360fef0406e(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { width: width, unitComponent: unitComponent = $6b7af672ec278734$export$f613830566442374, unitComponentProps: unitComponentProps, clipToFrame: clipToFrame, ...rest } = props;\n return $6b7af672ec278734$var$h((0, $hj0lx$LithologyColumn), {\n width: width,\n clipToFrame: clipToFrame\n }, [\n $6b7af672ec278734$var$h((0, $1n4Pb.UnitBoxes), {\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n ...rest\n })\n ]);\n}\nfunction $6b7af672ec278734$export$d8c3f2fdd653a082(props) {\n (0, $hj0lx$useEffect)(()=>{\n console.warn(\"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\");\n }, []);\n return null;\n}\nfunction $6b7af672ec278734$export$13984e34afdbb040(props) {\n // Section with \"squishy\" time scale\n const { width: width = 300, noteMode: noteMode = \"unlabeled\", labelOffset: labelOffset = 30, noteComponent: noteComponent, shouldRenderNote: shouldRenderNote } = props;\n const { sections: sections, totalHeight: totalHeight, axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n const unlabeledUnits = (0, $hj0lx$useContext)($6b7af672ec278734$var$UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n const _compositeScale = $6b7af672ec278734$export$723b790ebe9cdff8(sections);\n const selectUnit = (0, $a3mb1.useUnitSelectionDispatch)();\n return $6b7af672ec278734$var$h(\"div.section-labels-column\", [\n $6b7af672ec278734$var$h($6b7af672ec278734$export$6cc7a9df4edde18, {\n units: [],\n scale: _compositeScale,\n totalHeight: totalHeight,\n axisType: axisType\n }, $6b7af672ec278734$var$h((0, $hj0lx$SVG), {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3\n }, $6b7af672ec278734$var$h((0, $jiUaC.UnitNamesColumn), {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width: width,\n noteComponent: noteComponent,\n shouldRenderNote: shouldRenderNote,\n scale: _compositeScale,\n onClickNote (note) {\n selectUnit(note.data, null, null);\n }\n })))\n ]);\n}\nfunction $6b7af672ec278734$export$723b790ebe9cdff8(sections, opts = {}) {\n /** A basic composite scale that works across all sections. This isn't a fully featured,\n * contiuous D3 scale, but it shares enough attributes to be useful for\n * laying out notes.\n */ const { clamped: clamped = true } = opts;\n const scales = sections.map((group)=>{\n const { scaleInfo: scaleInfo } = group;\n return scaleInfo.scale.copy().clamp(clamped);\n });\n let baseScale = (val)=>{\n // Find the scale for the section that contains the value\n const scale = scales.find((scale)=>{\n return scale.domain()[0] <= val && val <= scale.domain()[1];\n });\n if (scale) return scale(val);\n else // return nan\n return NaN;\n };\n baseScale.copy = ()=>{\n return baseScale;\n };\n baseScale.domain = ()=>{\n // Return a domain that covers all sections\n return [\n scales[0].domain()[0],\n scales[scales.length - 1].domain()[1]\n ];\n };\n return baseScale;\n}\nfunction $6b7af672ec278734$export$6cc7a9df4edde18(props) {\n // A fake column axis provider that allows scales to cross\n const { children: children, scale: scale, totalHeight: totalHeight, pixelScale: pixelScale } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n return $6b7af672ec278734$var$h((0, $hj0lx$ColumnContext).Provider, {\n value: {\n divisions: [],\n scale: scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType: axisType,\n zoom: 1\n }\n }, children);\n}\n\n\nexport {$6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$723b790ebe9cdff8 as compositeScale, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider};\n//# sourceMappingURL=column-views.770d2c95.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n SVG,\n ColumnContext,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\n} from \"react\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport { LabeledUnit, UnitBoxes } from \"./boxes\";\nimport styles from \"./composite.module.sass\";\nimport { useMacrostratColumnData } from \"../data-provider\";\nimport { useUnitSelectionDispatch } from \"../units\";\n\nconst h = hyperStyled(styles);\n\ninterface LabelTracker {\n [key: number]: boolean;\n}\n\nconst LabelTrackerContext = createContext(null);\nconst UnlabeledDivisionsContext = createContext(null);\n\nconst findMacrostratUnitID = (u) => u.unit_id;\n\nexport function LabelTrackerProvider(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */\n const { children, units, findUnitID = findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = useState<\n BaseUnit[] | null\n >(null);\n const labelTrackerRef = useRef<LabelTracker>({});\n const trackLabelVisibility = useCallback(\n (div, visible) => {\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) {\n setUnlabeledDivisions(\n // @ts-ignore\n units.filter((d) => {\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }),\n );\n }\n },\n [labelTrackerRef, units, findUnitID],\n );\n\n const value = trackLabelVisibility;\n return h(\n LabelTrackerContext.Provider,\n { value },\n h(\n UnlabeledDivisionsContext.Provider,\n { value: unlabeledDivisions },\n children,\n ),\n );\n}\n\nfunction TrackedLabeledUnit({\n division,\n nameForDivision = defaultNameFunction,\n ...rest\n}) {\n const trackLabelVisibility = useContext(LabelTrackerContext);\n return h(LabeledUnit, {\n division,\n label: nameForDivision(division),\n onLabelUpdated(label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest,\n });\n}\n\nexport const CompositeUnitComponent = TrackedLabeledUnit;\n\ntype BaseUnitProps = {\n width: number;\n showLabels?: boolean;\n columnWidth?: number;\n clipToFrame?: boolean;\n};\n\ntype ICompositeUnitProps = BaseUnitProps & {\n gutterWidth?: number;\n labelOffset?: number;\n paddingLeft?: number;\n nameForDivision?: (division: BaseUnit) => string;\n children?: React.ReactNode;\n unitComponent?: React.FC<any>;\n unitComponentProps?: any;\n noteMode?: \"labeled\" | \"unlabeled\";\n showLabelColumn?: boolean;\n noteComponent?: React.FC<any>;\n shouldRenderNote?: (d: any) => boolean;\n};\n\ninterface CompositeUnitProps {\n unitComponent: React.FC<any>;\n unitComponentProps?: any;\n width: number;\n showLabels?: boolean;\n clipToFrame?: boolean;\n}\n\nexport function CompositeUnitsColumn(props: CompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const {\n width,\n unitComponent = TrackedLabeledUnit,\n unitComponentProps,\n clipToFrame,\n ...rest\n } = props;\n\n return h(LithologyColumn, { width, clipToFrame }, [\n h(UnitBoxes, {\n unitComponent,\n unitComponentProps,\n ...rest,\n }),\n ]);\n}\n\nexport function AnnotatedUnitsColumn(props: ICompositeUnitProps) {\n useEffect(() => {\n console.warn(\n \"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\",\n );\n }, []);\n return null;\n}\n\nexport function SectionLabelsColumn(props: ICompositeUnitProps) {\n // Section with \"squishy\" time scale\n const {\n width = 300,\n noteMode = \"unlabeled\",\n labelOffset = 30,\n noteComponent,\n shouldRenderNote,\n } = props;\n\n const { sections, totalHeight, axisType } = useMacrostratColumnData();\n\n const unlabeledUnits = useContext(UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n\n const _compositeScale = compositeScale(sections);\n\n const selectUnit = useUnitSelectionDispatch();\n\n return h(\"div.section-labels-column\", [\n h(\n ColumnNotesProvider,\n {\n units: [],\n scale: _compositeScale,\n totalHeight,\n axisType,\n },\n h(\n SVG,\n {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3,\n },\n h(UnitNamesColumn, {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width,\n noteComponent,\n shouldRenderNote,\n scale: _compositeScale,\n onClickNote(note) {\n selectUnit(note.data, null, null);\n },\n }),\n ),\n ),\n ]);\n}\n\ntype CompositeScaleOpts = {\n clamped?: boolean;\n};\n\nexport interface CompositeColumnScale {\n (val: number): number;\n copy(): CompositeColumnScale;\n domain(): number[];\n}\n\nexport function compositeScale(\n sections,\n opts: CompositeScaleOpts = {},\n): CompositeColumnScale {\n /** A basic composite scale that works across all sections. This isn't a fully featured,\n * contiuous D3 scale, but it shares enough attributes to be useful for\n * laying out notes.\n */\n const { clamped = true } = opts;\n\n const scales = sections.map((group) => {\n const { scaleInfo } = group;\n return scaleInfo.scale.copy().clamp(clamped);\n });\n\n let baseScale: any = (val) => {\n // Find the scale for the section that contains the value\n const scale = scales.find((scale) => {\n return scale.domain()[0] <= val && val <= scale.domain()[1];\n });\n\n if (scale) {\n return scale(val);\n } else {\n // return nan\n return NaN;\n }\n };\n\n baseScale.copy = () => {\n return baseScale;\n };\n\n baseScale.domain = () => {\n // Return a domain that covers all sections\n return [scales[0].domain()[0], scales[scales.length - 1].domain()[1]];\n };\n\n return baseScale as CompositeColumnScale;\n}\n\nexport function ColumnNotesProvider(props) {\n // A fake column axis provider that allows scales to cross\n const { children, scale, totalHeight, pixelScale } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n return h(\n ColumnContext.Provider,\n {\n value: {\n divisions: [],\n scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType,\n zoom: 1,\n },\n },\n children,\n );\n}\n\nexport { TrackedLabeledUnit, ICompositeUnitProps };\n"],"names":["hyperStyled","$hj0lx$hyperStyled","LithologyColumn","$hj0lx$LithologyColumn","SVG","$hj0lx$SVG","ColumnContext","$hj0lx$ColumnContext","createContext","$hj0lx$createContext","useState","$hj0lx$useState","useRef","$hj0lx$useRef","useCallback","$hj0lx$useCallback","useContext","$hj0lx$useContext","useEffect","$hj0lx$useEffect","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6b7af672ec278734$exports","$6b7af672ec278734$export$e4e89ab6c86ac513","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","$6b7af672ec278734$export$a6684360fef0406e","$6b7af672ec278734$export$d8c3f2fdd653a082","$6b7af672ec278734$export$13984e34afdbb040","$6b7af672ec278734$export$723b790ebe9cdff8","$6b7af672ec278734$export$6cc7a9df4edde18","$jiUaC","$1n4Pb","$45u6B","$wtIgl","$a3mb1","$6b7af672ec278734$var$h","a","__esModule","default","$6b7af672ec278734$var$LabelTrackerContext","$6b7af672ec278734$var$UnlabeledDivisionsContext","$6b7af672ec278734$var$findMacrostratUnitID","u","unit_id","props","children","units","findUnitID","unlabeledDivisions","setUnlabeledDivisions","labelTrackerRef","trackLabelVisibility","div","visible","current","keys","length","filter","d","Provider","value","division","nameForDivision","defaultNameFunction","rest","LabeledUnit","label","onLabelUpdated","width","unitComponent","unitComponentProps","clipToFrame","UnitBoxes","console","warn","noteMode","labelOffset","noteComponent","shouldRenderNote","sections","totalHeight","axisType","useMacrostratColumnData","unlabeledUnits","_compositeScale","selectUnit","useUnitSelectionDispatch","scale","height","innerWidth","paddingH","paddingLeft","UnitNamesColumn","divisions","undefined","onClickNote","note","data","opts","clamped","scales","map","group","scaleInfo","copy","clamp","baseScale","val","find","domain","NaN","pixelScale","scaleClamped","pixelHeight","pixelsPerMeter","zoom","LabelTrackerProvider","TrackedLabeledUnit","CompositeUnitComponent","CompositeUnitsColumn","AnnotatedUnitsColumn","SectionLabelsColumn","compositeScale","ColumnNotesProvider"],"version":3,"file":"column-views.770d2c95.js.map","sourceRoot":"../../../../"}
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,e,C,K,mB,A,Q,mB,C,C,O,C,C,iB,C,K,+B,A,Q,iB,C,C,Y,C,C,U,C,C,e,C,C,c,C,C,a,C,K,O,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,uB,I,G,E,E,qB,I,G,E,E,yB,I,G,E,E,uB,I,G,E,E,uB,I,G,E,E,sB,I,G,E,E,iB,I,G,E,E,sB,I,G,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCqBA,IAAM,EAAI,AAAA,E,AAAY,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAMhB,EAAsB,AAAA,EAAc,MACpC,EAA4B,AAAA,EAAc,MAE1C,EAAuB,AAAC,GAAM,EAAE,OAAO,CAEtC,SAAS,EAAqB,CAAK,EAIxC,GAAM,CAAA,SAAE,CAAQ,CAAA,MAAE,CAAK,CAAA,WAAE,EAAa,C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AU,MAAM,CAAG,IAEV,CAAC,CAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAE,CAAM,CAAC,EAAO,MAAM,CAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAGhE,CACT,CAEO,SAAS,EAAoB,CAAK,EAEvC,GAAM,CAAA,SAAE,CAAQ,CAAA,MAAE,CAAK,CAAA,YAAE,CAAW,CAAA,WAAE,CAAU,CAAE,CAAG,EAE/C,CAAA,SAAE,CAAQ,CAAE,CAAG,AAAA,CAAA,EAAA,EAAA,uBAAsB,AAAtB,IAErB,OAAO,EACL,AAAA,EAAc,QAAQ,CACtB,CACE,MAAO,CACL,UAAW,EAAE,CACb,MAAA,EACA,aAAc,EACd,YAAa,EACb,eAAgB,EAChB,SAAA,EACA,KAAM,CACR,CACF,EACA,EAEJ,Q,K,oB,C,K,kB,C,K,sB,C,K,oB,C,K,oB,C,K,mB,C,K,c,C,K,mB","sources":["<anon>","packages/column-views/src/units/composite.ts"],"sourcesContent":["import \"./column-views.2e4e357d.js\";\nimport \"./column-views.2d957a97.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.78d3f3c5.js\";\nimport \"./column-views.3eeac38d.js\";\nimport {hyperStyled as $hj0lx$hyperStyled} from \"@macrostrat/hyper\";\nimport {LithologyColumn as $hj0lx$LithologyColumn, SVG as $hj0lx$SVG, ColumnContext as $hj0lx$ColumnContext} from \"@macrostrat/column-components\";\nimport {createContext as $hj0lx$createContext, useState as $hj0lx$useState, useRef as $hj0lx$useRef, useCallback as $hj0lx$useCallback, useContext as $hj0lx$useContext, useEffect as $hj0lx$useEffect} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $6b7af672ec278734$exports = {};\n\n$parcel$export($6b7af672ec278734$exports, \"LabelTrackerProvider\", () => $6b7af672ec278734$export$e4e89ab6c86ac513);\n$parcel$export($6b7af672ec278734$exports, \"TrackedLabeledUnit\", () => $6b7af672ec278734$export$f613830566442374);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitComponent\", () => $6b7af672ec278734$export$1dfa200d57964eee);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitsColumn\", () => $6b7af672ec278734$export$a6684360fef0406e);\n$parcel$export($6b7af672ec278734$exports, \"AnnotatedUnitsColumn\", () => $6b7af672ec278734$export$d8c3f2fdd653a082);\n$parcel$export($6b7af672ec278734$exports, \"SectionLabelsColumn\", () => $6b7af672ec278734$export$13984e34afdbb040);\n$parcel$export($6b7af672ec278734$exports, \"compositeScale\", () => $6b7af672ec278734$export$723b790ebe9cdff8);\n$parcel$export($6b7af672ec278734$exports, \"ColumnNotesProvider\", () => $6b7af672ec278734$export$6cc7a9df4edde18);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\nvar $45u6B = parcelRequire(\"45u6B\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $a3mb1 = parcelRequire(\"a3mb1\");\nconst $6b7af672ec278734$var$h = (0, $hj0lx$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($45u6B))));\nconst $6b7af672ec278734$var$LabelTrackerContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$UnlabeledDivisionsContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$findMacrostratUnitID = (u)=>u.unit_id;\nfunction $6b7af672ec278734$export$e4e89ab6c86ac513(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */ const { children: children, units: units, findUnitID: findUnitID = $6b7af672ec278734$var$findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = (0, $hj0lx$useState)(null);\n const labelTrackerRef = (0, $hj0lx$useRef)({});\n const trackLabelVisibility = (0, $hj0lx$useCallback)((div, visible)=>{\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) setUnlabeledDivisions(// @ts-ignore\n units.filter((d)=>{\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }));\n }, [\n labelTrackerRef,\n units,\n findUnitID\n ]);\n const value = trackLabelVisibility;\n return $6b7af672ec278734$var$h($6b7af672ec278734$var$LabelTrackerContext.Provider, {\n value: value\n }, $6b7af672ec278734$var$h($6b7af672ec278734$var$UnlabeledDivisionsContext.Provider, {\n value: unlabeledDivisions\n }, children));\n}\nfunction $6b7af672ec278734$export$f613830566442374({ division: division, nameForDivision: nameForDivision = (0, $jiUaC.defaultNameFunction), ...rest }) {\n const trackLabelVisibility = (0, $hj0lx$useContext)($6b7af672ec278734$var$LabelTrackerContext);\n return $6b7af672ec278734$var$h((0, $1n4Pb.LabeledUnit), {\n division: division,\n label: nameForDivision(division),\n onLabelUpdated (label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest\n });\n}\nconst $6b7af672ec278734$export$1dfa200d57964eee = $6b7af672ec278734$export$f613830566442374;\nfunction $6b7af672ec278734$export$a6684360fef0406e(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { width: width, unitComponent: unitComponent = $6b7af672ec278734$export$f613830566442374, unitComponentProps: unitComponentProps, clipToFrame: clipToFrame, ...rest } = props;\n return $6b7af672ec278734$var$h((0, $hj0lx$LithologyColumn), {\n width: width,\n clipToFrame: clipToFrame\n }, [\n $6b7af672ec278734$var$h((0, $1n4Pb.UnitBoxes), {\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n ...rest\n })\n ]);\n}\nfunction $6b7af672ec278734$export$d8c3f2fdd653a082(props) {\n (0, $hj0lx$useEffect)(()=>{\n console.warn(\"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\");\n }, []);\n return null;\n}\nfunction $6b7af672ec278734$export$13984e34afdbb040(props) {\n // Section with \"squishy\" time scale\n const { width: width = 300, noteMode: noteMode = \"unlabeled\", labelOffset: labelOffset = 30, noteComponent: noteComponent, shouldRenderNote: shouldRenderNote } = props;\n const { sections: sections, totalHeight: totalHeight, axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n const unlabeledUnits = (0, $hj0lx$useContext)($6b7af672ec278734$var$UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n const _compositeScale = $6b7af672ec278734$export$723b790ebe9cdff8(sections);\n const selectUnit = (0, $a3mb1.useUnitSelectionDispatch)();\n return $6b7af672ec278734$var$h(\"div.section-labels-column\", [\n $6b7af672ec278734$var$h($6b7af672ec278734$export$6cc7a9df4edde18, {\n units: [],\n scale: _compositeScale,\n totalHeight: totalHeight,\n axisType: axisType\n }, $6b7af672ec278734$var$h((0, $hj0lx$SVG), {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3\n }, $6b7af672ec278734$var$h((0, $jiUaC.UnitNamesColumn), {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width: width,\n noteComponent: noteComponent,\n shouldRenderNote: shouldRenderNote,\n scale: _compositeScale,\n onClickNote (note) {\n selectUnit(note.data, null, null);\n }\n })))\n ]);\n}\nfunction $6b7af672ec278734$export$723b790ebe9cdff8(sections, opts = {}) {\n /** A basic composite scale that works across all sections. This isn't a fully featured,\n * contiuous D3 scale, but it shares enough attributes to be useful for\n * laying out notes.\n */ const { clamped: clamped = true } = opts;\n const scales = sections.map((group)=>{\n const { scaleInfo: scaleInfo } = group;\n return scaleInfo.scale.copy().clamp(clamped);\n });\n let baseScale = (val)=>{\n // Find the scale for the section that contains the value\n const scale = scales.find((scale)=>{\n return scale.domain()[0] <= val && val <= scale.domain()[1];\n });\n if (scale) return scale(val);\n else // return nan\n return NaN;\n };\n baseScale.copy = ()=>{\n return baseScale;\n };\n baseScale.domain = ()=>{\n // Return a domain that covers all sections\n return [\n scales[0].domain()[0],\n scales[scales.length - 1].domain()[1]\n ];\n };\n return baseScale;\n}\nfunction $6b7af672ec278734$export$6cc7a9df4edde18(props) {\n // A fake column axis provider that allows scales to cross\n const { children: children, scale: scale, totalHeight: totalHeight, pixelScale: pixelScale } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n return $6b7af672ec278734$var$h((0, $hj0lx$ColumnContext).Provider, {\n value: {\n divisions: [],\n scale: scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType: axisType,\n zoom: 1\n }\n }, children);\n}\n\n\nexport {$6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$723b790ebe9cdff8 as compositeScale, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider};\n//# sourceMappingURL=column-views.976a829b.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n SVG,\n ColumnContext,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\n} from \"react\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport { LabeledUnit, UnitBoxes } from \"./boxes\";\nimport styles from \"./composite.module.sass\";\nimport { useMacrostratColumnData } from \"../data-provider\";\nimport { useUnitSelectionDispatch } from \"../units\";\n\nconst h = hyperStyled(styles);\n\ninterface LabelTracker {\n [key: number]: boolean;\n}\n\nconst LabelTrackerContext = createContext(null);\nconst UnlabeledDivisionsContext = createContext(null);\n\nconst findMacrostratUnitID = (u) => u.unit_id;\n\nexport function LabelTrackerProvider(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */\n const { children, units, findUnitID = findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = useState<\n BaseUnit[] | null\n >(null);\n const labelTrackerRef = useRef<LabelTracker>({});\n const trackLabelVisibility = useCallback(\n (div, visible) => {\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) {\n setUnlabeledDivisions(\n // @ts-ignore\n units.filter((d) => {\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }),\n );\n }\n },\n [labelTrackerRef, units, findUnitID],\n );\n\n const value = trackLabelVisibility;\n return h(\n LabelTrackerContext.Provider,\n { value },\n h(\n UnlabeledDivisionsContext.Provider,\n { value: unlabeledDivisions },\n children,\n ),\n );\n}\n\nfunction TrackedLabeledUnit({\n division,\n nameForDivision = defaultNameFunction,\n ...rest\n}) {\n const trackLabelVisibility = useContext(LabelTrackerContext);\n return h(LabeledUnit, {\n division,\n label: nameForDivision(division),\n onLabelUpdated(label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest,\n });\n}\n\nexport const CompositeUnitComponent = TrackedLabeledUnit;\n\ntype BaseUnitProps = {\n width: number;\n showLabels?: boolean;\n columnWidth?: number;\n clipToFrame?: boolean;\n};\n\ntype ICompositeUnitProps = BaseUnitProps & {\n gutterWidth?: number;\n labelOffset?: number;\n paddingLeft?: number;\n nameForDivision?: (division: BaseUnit) => string;\n children?: React.ReactNode;\n unitComponent?: React.FC<any>;\n unitComponentProps?: any;\n noteMode?: \"labeled\" | \"unlabeled\";\n showLabelColumn?: boolean;\n noteComponent?: React.FC<any>;\n shouldRenderNote?: (d: any) => boolean;\n};\n\ninterface CompositeUnitProps {\n unitComponent: React.FC<any>;\n unitComponentProps?: any;\n width: number;\n showLabels?: boolean;\n clipToFrame?: boolean;\n}\n\nexport function CompositeUnitsColumn(props: CompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const {\n width,\n unitComponent = TrackedLabeledUnit,\n unitComponentProps,\n clipToFrame,\n ...rest\n } = props;\n\n return h(LithologyColumn, { width, clipToFrame }, [\n h(UnitBoxes, {\n unitComponent,\n unitComponentProps,\n ...rest,\n }),\n ]);\n}\n\nexport function AnnotatedUnitsColumn(props: ICompositeUnitProps) {\n useEffect(() => {\n console.warn(\n \"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\",\n );\n }, []);\n return null;\n}\n\nexport function SectionLabelsColumn(props: ICompositeUnitProps) {\n // Section with \"squishy\" time scale\n const {\n width = 300,\n noteMode = \"unlabeled\",\n labelOffset = 30,\n noteComponent,\n shouldRenderNote,\n } = props;\n\n const { sections, totalHeight, axisType } = useMacrostratColumnData();\n\n const unlabeledUnits = useContext(UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n\n const _compositeScale = compositeScale(sections);\n\n const selectUnit = useUnitSelectionDispatch();\n\n return h(\"div.section-labels-column\", [\n h(\n ColumnNotesProvider,\n {\n units: [],\n scale: _compositeScale,\n totalHeight,\n axisType,\n },\n h(\n SVG,\n {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3,\n },\n h(UnitNamesColumn, {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width,\n noteComponent,\n shouldRenderNote,\n scale: _compositeScale,\n onClickNote(note) {\n selectUnit(note.data, null, null);\n },\n }),\n ),\n ),\n ]);\n}\n\ntype CompositeScaleOpts = {\n clamped?: boolean;\n};\n\nexport interface CompositeColumnScale {\n (val: number): number;\n copy(): CompositeColumnScale;\n domain(): number[];\n}\n\nexport function compositeScale(\n sections,\n opts: CompositeScaleOpts = {},\n): CompositeColumnScale {\n /** A basic composite scale that works across all sections. This isn't a fully featured,\n * contiuous D3 scale, but it shares enough attributes to be useful for\n * laying out notes.\n */\n const { clamped = true } = opts;\n\n const scales = sections.map((group) => {\n const { scaleInfo } = group;\n return scaleInfo.scale.copy().clamp(clamped);\n });\n\n let baseScale: any = (val) => {\n // Find the scale for the section that contains the value\n const scale = scales.find((scale) => {\n return scale.domain()[0] <= val && val <= scale.domain()[1];\n });\n\n if (scale) {\n return scale(val);\n } else {\n // return nan\n return NaN;\n }\n };\n\n baseScale.copy = () => {\n return baseScale;\n };\n\n baseScale.domain = () => {\n // Return a domain that covers all sections\n return [scales[0].domain()[0], scales[scales.length - 1].domain()[1]];\n };\n\n return baseScale as CompositeColumnScale;\n}\n\nexport function ColumnNotesProvider(props) {\n // A fake column axis provider that allows scales to cross\n const { children, scale, totalHeight, pixelScale } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n return h(\n ColumnContext.Provider,\n {\n value: {\n divisions: [],\n scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType,\n zoom: 1,\n },\n },\n children,\n );\n}\n\nexport { TrackedLabeledUnit, ICompositeUnitProps };\n"],"names":["hyperStyled","$hj0lx$hyperStyled","LithologyColumn","$hj0lx$LithologyColumn","SVG","$hj0lx$SVG","ColumnContext","$hj0lx$ColumnContext","createContext","$hj0lx$createContext","useState","$hj0lx$useState","useRef","$hj0lx$useRef","useCallback","$hj0lx$useCallback","useContext","$hj0lx$useContext","useEffect","$hj0lx$useEffect","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6b7af672ec278734$exports","$6b7af672ec278734$export$e4e89ab6c86ac513","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","$6b7af672ec278734$export$a6684360fef0406e","$6b7af672ec278734$export$d8c3f2fdd653a082","$6b7af672ec278734$export$13984e34afdbb040","$6b7af672ec278734$export$723b790ebe9cdff8","$6b7af672ec278734$export$6cc7a9df4edde18","$jiUaC","$1n4Pb","$45u6B","$wtIgl","$a3mb1","$6b7af672ec278734$var$h","a","__esModule","default","$6b7af672ec278734$var$LabelTrackerContext","$6b7af672ec278734$var$UnlabeledDivisionsContext","$6b7af672ec278734$var$findMacrostratUnitID","u","unit_id","props","children","units","findUnitID","unlabeledDivisions","setUnlabeledDivisions","labelTrackerRef","trackLabelVisibility","div","visible","current","keys","length","filter","d","Provider","value","division","nameForDivision","defaultNameFunction","rest","LabeledUnit","label","onLabelUpdated","width","unitComponent","unitComponentProps","clipToFrame","UnitBoxes","console","warn","noteMode","labelOffset","noteComponent","shouldRenderNote","sections","totalHeight","axisType","useMacrostratColumnData","unlabeledUnits","_compositeScale","selectUnit","useUnitSelectionDispatch","scale","height","innerWidth","paddingH","paddingLeft","UnitNamesColumn","divisions","undefined","onClickNote","note","data","opts","clamped","scales","map","group","scaleInfo","copy","clamp","baseScale","val","find","domain","NaN","pixelScale","scaleClamped","pixelHeight","pixelsPerMeter","zoom","LabelTrackerProvider","TrackedLabeledUnit","CompositeUnitComponent","CompositeUnitsColumn","AnnotatedUnitsColumn","SectionLabelsColumn","compositeScale","ColumnNotesProvider"],"version":3,"file":"column-views.976a829b.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function n(n,c,a,e){Object.defineProperty(n,c,{get:a,set:e,enumerable:!0,configurable:!0})}var c,a,e,o,t,i,l,m,f,r,u,s,_,g={};n(g,"column-container",()=>c,n=>c=n),n(g,"timescale-column",()=>a,n=>a=n),n(g,"section-main",()=>e,n=>e=n),n(g,"section-units-container",()=>o,n=>o=n),n(g,"main-column",()=>t,n=>t=n),n(g,"unconformity-labels",()=>i,n=>i=n),n(g,"unconformity",()=>l,n=>l=n),n(g,"giga",()=>m,n=>m=n),n(g,"mega",()=>f,n=>f=n),n(g,"large",()=>r,n=>r=n),n(g,"small",()=>u,n=>u=n),n(g,"unconformity-text",()=>s,n=>s=n),n(g,"column-title-row",()=>_,n=>_=n),c="column-container_afc440",a="timescale-column_afc440",e="section-main_afc440",o="section-units-container_afc440",t="main-column_afc440",i="unconformity-labels_afc440",l="unconformity_afc440",m="giga_afc440",f="mega_afc440",r="large_afc440",u="small_afc440",s="unconformity-text_afc440",_="column-title-row_afc440";export{g as default};
|
|
2
|
+
//# sourceMappingURL=column-views.99fb74c0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,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,ICAA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,E,E,C,E,E,E,mB,I,E,A,G,E,G,E,E,mB,I,E,A,G,E,G,E,E,e,I,E,A,G,E,G,E,E,0B,I,E,A,G,E,G,E,E,c,I,E,A,G,E,G,E,E,sB,I,E,A,G,E,G,E,E,e,I,E,A,G,E,G,E,E,O,I,E,A,G,E,G,E,E,O,I,E,A,G,E,G,E,E,Q,I,E,A,G,E,G,E,E,Q,I,E,A,G,E,G,E,E,oB,I,E,A,G,E,G,E,E,mB,I,E,A,G,E,GAZA,EAAqC,0BACrC,EAAqC,0BACrC,EAAiC,sBACjC,EAA4C,iCAC5C,EAAgC,qBAChC,EAAwC,6BACxC,EAAiC,sBACjC,EAAyB,cACzB,EAAyB,cACzB,EAA0B,eAC1B,EAA0B,eAC1B,EAAsC,2BACtC,EAAqC,iC,K,O","sources":["<anon>","packages/column-views/src/column.module.sass"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $5cefe1c5058d37da$exports = {};\n\n$parcel$export($5cefe1c5058d37da$exports, \"column-container\", () => $5cefe1c5058d37da$export$e908cef0cccb98df, (v) => $5cefe1c5058d37da$export$e908cef0cccb98df = v);\n$parcel$export($5cefe1c5058d37da$exports, \"timescale-column\", () => $5cefe1c5058d37da$export$82c2e1a892d790ab, (v) => $5cefe1c5058d37da$export$82c2e1a892d790ab = v);\n$parcel$export($5cefe1c5058d37da$exports, \"section-main\", () => $5cefe1c5058d37da$export$add6075ee40659c8, (v) => $5cefe1c5058d37da$export$add6075ee40659c8 = v);\n$parcel$export($5cefe1c5058d37da$exports, \"section-units-container\", () => $5cefe1c5058d37da$export$37c0a390e37eb2da, (v) => $5cefe1c5058d37da$export$37c0a390e37eb2da = v);\n$parcel$export($5cefe1c5058d37da$exports, \"main-column\", () => $5cefe1c5058d37da$export$9c88f9a435c40ccb, (v) => $5cefe1c5058d37da$export$9c88f9a435c40ccb = v);\n$parcel$export($5cefe1c5058d37da$exports, \"unconformity-labels\", () => $5cefe1c5058d37da$export$d726faed2da21993, (v) => $5cefe1c5058d37da$export$d726faed2da21993 = v);\n$parcel$export($5cefe1c5058d37da$exports, \"unconformity\", () => $5cefe1c5058d37da$export$7b4a6d978979c0fa, (v) => $5cefe1c5058d37da$export$7b4a6d978979c0fa = v);\n$parcel$export($5cefe1c5058d37da$exports, \"giga\", () => $5cefe1c5058d37da$export$197e40aa3a484017, (v) => $5cefe1c5058d37da$export$197e40aa3a484017 = v);\n$parcel$export($5cefe1c5058d37da$exports, \"mega\", () => $5cefe1c5058d37da$export$580f1e8cf64f2815, (v) => $5cefe1c5058d37da$export$580f1e8cf64f2815 = v);\n$parcel$export($5cefe1c5058d37da$exports, \"large\", () => $5cefe1c5058d37da$export$f09585a853dddd32, (v) => $5cefe1c5058d37da$export$f09585a853dddd32 = v);\n$parcel$export($5cefe1c5058d37da$exports, \"small\", () => $5cefe1c5058d37da$export$3c17b0e969a90510, (v) => $5cefe1c5058d37da$export$3c17b0e969a90510 = v);\n$parcel$export($5cefe1c5058d37da$exports, \"unconformity-text\", () => $5cefe1c5058d37da$export$925235908943319a, (v) => $5cefe1c5058d37da$export$925235908943319a = v);\n$parcel$export($5cefe1c5058d37da$exports, \"column-title-row\", () => $5cefe1c5058d37da$export$54e339397196c97b, (v) => $5cefe1c5058d37da$export$54e339397196c97b = v);\nvar $5cefe1c5058d37da$export$e908cef0cccb98df;\nvar $5cefe1c5058d37da$export$82c2e1a892d790ab;\nvar $5cefe1c5058d37da$export$add6075ee40659c8;\nvar $5cefe1c5058d37da$export$37c0a390e37eb2da;\nvar $5cefe1c5058d37da$export$9c88f9a435c40ccb;\nvar $5cefe1c5058d37da$export$d726faed2da21993;\nvar $5cefe1c5058d37da$export$7b4a6d978979c0fa;\nvar $5cefe1c5058d37da$export$197e40aa3a484017;\nvar $5cefe1c5058d37da$export$580f1e8cf64f2815;\nvar $5cefe1c5058d37da$export$f09585a853dddd32;\nvar $5cefe1c5058d37da$export$3c17b0e969a90510;\nvar $5cefe1c5058d37da$export$925235908943319a;\nvar $5cefe1c5058d37da$export$54e339397196c97b;\n$5cefe1c5058d37da$export$e908cef0cccb98df = \"column-container_afc440\";\n$5cefe1c5058d37da$export$82c2e1a892d790ab = \"timescale-column_afc440\";\n$5cefe1c5058d37da$export$add6075ee40659c8 = \"section-main_afc440\";\n$5cefe1c5058d37da$export$37c0a390e37eb2da = \"section-units-container_afc440\";\n$5cefe1c5058d37da$export$9c88f9a435c40ccb = \"main-column_afc440\";\n$5cefe1c5058d37da$export$d726faed2da21993 = \"unconformity-labels_afc440\";\n$5cefe1c5058d37da$export$7b4a6d978979c0fa = \"unconformity_afc440\";\n$5cefe1c5058d37da$export$197e40aa3a484017 = \"giga_afc440\";\n$5cefe1c5058d37da$export$580f1e8cf64f2815 = \"mega_afc440\";\n$5cefe1c5058d37da$export$f09585a853dddd32 = \"large_afc440\";\n$5cefe1c5058d37da$export$3c17b0e969a90510 = \"small_afc440\";\n$5cefe1c5058d37da$export$925235908943319a = \"unconformity-text_afc440\";\n$5cefe1c5058d37da$export$54e339397196c97b = \"column-title-row_afc440\";\n\n\nexport {$5cefe1c5058d37da$exports as default};\n//# sourceMappingURL=column-views.99fb74c0.js.map\n",null],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$5cefe1c5058d37da$export$e908cef0cccb98df","$5cefe1c5058d37da$export$82c2e1a892d790ab","$5cefe1c5058d37da$export$add6075ee40659c8","$5cefe1c5058d37da$export$37c0a390e37eb2da","$5cefe1c5058d37da$export$9c88f9a435c40ccb","$5cefe1c5058d37da$export$d726faed2da21993","$5cefe1c5058d37da$export$7b4a6d978979c0fa","$5cefe1c5058d37da$export$197e40aa3a484017","$5cefe1c5058d37da$export$580f1e8cf64f2815","$5cefe1c5058d37da$export$f09585a853dddd32","$5cefe1c5058d37da$export$3c17b0e969a90510","$5cefe1c5058d37da$export$925235908943319a","$5cefe1c5058d37da$export$54e339397196c97b","$5cefe1c5058d37da$exports","default"],"version":3,"file":"column-views.99fb74c0.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./column-views.38357d4a.js";import"./column-views.9de31cdb.js";import"./column-views.95411f1b.js";import"./column-views.78d3f3c5.js";function e(e,a){return Object.keys(a).forEach(function(r){"default"===r||"__esModule"===r||Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:function(){return a[r]}})}),e}var a=globalThis,r={},t={},o=a.parcelRequirea149;null==o&&((o=function(e){if(e in r)return r[e].exports;if(e in t){var a=t[e];delete t[e];var o={id:e,exports:{}};return r[e]=o,a.call(o.exports,o,o.exports),o.exports}var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}).register=function(e,a){t[e]=a},a.parcelRequirea149=o),o.register;var s={},c=o("Piirt"),$=o("lgTAP"),b=o("6W0kE"),f=o("wtIgl");e(s,c),e(s,$),e(s,b),e(s,f);export{$482a09479937d1e2$export$45bd78cd093090fa as fetchAllColumns,$482a09479937d1e2$export$e3270a4e30e40ff9 as useColumnFeatures,$482a09479937d1e2$export$1aa679bd5e605f82 as fetchLithologies,$482a09479937d1e2$export$5d2ec2e733dfe6c7 as fetchIntervals,$482a09479937d1e2$export$780b4b253712916c as fetchEnvironments,$482a09479937d1e2$export$cd7bfa0860f58b96 as fetchRefs,$482a09479937d1e2$export$8ea8f45a7ffe4183 as fetchStratNames,$482a09479937d1e2$export$b97b9bdd6a521298 as fetchUnits,$482a09479937d1e2$export$d3d8b0fabcc76c5d as fetchColumnUnits,$8750144f23b92eb9$export$fb98d5bae3a6800 as useMacrostratStore,$8750144f23b92eb9$export$89dd4e5ae4a82373 as useMacrostratDefs,$8750144f23b92eb9$export$81eaae0b474404fd as useMacrostratColumns,$8750144f23b92eb9$export$b9c9fc603d74a555 as useMacrostratData,$8750144f23b92eb9$export$690613f93cdc5576 as MacrostratDataProvider,$8750144f23b92eb9$export$3098013bc6cc316d as MacrostratAPIProvider,$8750144f23b92eb9$export$9e42f9b6e0d67c7d as MacrostratColumnProvider,$8750144f23b92eb9$export$8492a5cae82b6a70 as LithologiesProvider,$8750144f23b92eb9$export$4d18a90c945d129f as useLithologies,$8750144f23b92eb9$export$c6b216bf4c71b61f as useEnvironments,$d8324406f284950a$export$91cb5ac808759b34 as useColumnNav,$d8324406f284950a$export$36fed9e0f93a8fde as ColumnNavProvider,$91525b65c57a1e5d$export$7fec7bd80ff9c10e as MacrostratColumnDataProvider,$91525b65c57a1e5d$export$f8509b7cce386c7d as useMacrostratColumnData,$91525b65c57a1e5d$export$6fb40844db555b2 as useMacrostratUnits,$91525b65c57a1e5d$export$a7fc62995ec4f76 as useCompositeScale};
|
|
2
|
+
//# sourceMappingURL=column-views.9b7a9ae1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,S,E,E,S,E,E,S,E,E,S,E,E,G,E,E,G,E,E,G,E,E,U,6C,e,C,6C,iB,C,6C,gB,C,6C,c,C,6C,iB,C,6C,S,C,6C,e,C,6C,U,C,6C,gB,C,4C,kB,C,6C,iB,C,6C,oB,C,6C,iB,C,6C,sB,C,6C,qB,C,6C,wB,C,6C,mB,C,6C,c,C,6C,e,C,6C,Y,C,6C,iB,C,6C,4B,C,6C,uB,C,4C,kB,C,4C,iB","sources":["<anon>","packages/column-views/src/data-provider/index.ts"],"sourcesContent":["import \"./column-views.38357d4a.js\";\nimport \"./column-views.9de31cdb.js\";\nimport \"./column-views.95411f1b.js\";\nimport \"./column-views.78d3f3c5.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 $6f2fe440dde82d53$exports = {};\n\nvar $Piirt = parcelRequire(\"Piirt\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\n\nvar $6W0kE = parcelRequire(\"6W0kE\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n$parcel$exportWildcard($6f2fe440dde82d53$exports, $Piirt);\n$parcel$exportWildcard($6f2fe440dde82d53$exports, $lgTAP);\n$parcel$exportWildcard($6f2fe440dde82d53$exports, $6W0kE);\n$parcel$exportWildcard($6f2fe440dde82d53$exports, $wtIgl);\n\n\nexport {$482a09479937d1e2$export$45bd78cd093090fa as fetchAllColumns, $482a09479937d1e2$export$e3270a4e30e40ff9 as useColumnFeatures, $482a09479937d1e2$export$1aa679bd5e605f82 as fetchLithologies, $482a09479937d1e2$export$5d2ec2e733dfe6c7 as fetchIntervals, $482a09479937d1e2$export$780b4b253712916c as fetchEnvironments, $482a09479937d1e2$export$cd7bfa0860f58b96 as fetchRefs, $482a09479937d1e2$export$8ea8f45a7ffe4183 as fetchStratNames, $482a09479937d1e2$export$b97b9bdd6a521298 as fetchUnits, $482a09479937d1e2$export$d3d8b0fabcc76c5d as fetchColumnUnits, $8750144f23b92eb9$export$fb98d5bae3a6800 as useMacrostratStore, $8750144f23b92eb9$export$89dd4e5ae4a82373 as useMacrostratDefs, $8750144f23b92eb9$export$81eaae0b474404fd as useMacrostratColumns, $8750144f23b92eb9$export$b9c9fc603d74a555 as useMacrostratData, $8750144f23b92eb9$export$690613f93cdc5576 as MacrostratDataProvider, $8750144f23b92eb9$export$3098013bc6cc316d as MacrostratAPIProvider, $8750144f23b92eb9$export$9e42f9b6e0d67c7d as MacrostratColumnProvider, $8750144f23b92eb9$export$8492a5cae82b6a70 as LithologiesProvider, $8750144f23b92eb9$export$4d18a90c945d129f as useLithologies, $8750144f23b92eb9$export$c6b216bf4c71b61f as useEnvironments, $d8324406f284950a$export$91cb5ac808759b34 as useColumnNav, $d8324406f284950a$export$36fed9e0f93a8fde as ColumnNavProvider, $91525b65c57a1e5d$export$7fec7bd80ff9c10e as MacrostratColumnDataProvider, $91525b65c57a1e5d$export$f8509b7cce386c7d as useMacrostratColumnData, $91525b65c57a1e5d$export$6fb40844db555b2 as useMacrostratUnits, $91525b65c57a1e5d$export$a7fc62995ec4f76 as useCompositeScale};\n//# sourceMappingURL=column-views.9b7a9ae1.js.map\n","export * from \"./fetch\";\nexport * from \"./base\";\nexport * from \"./column-nav\";\nexport * from \"./store\";\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","$6f2fe440dde82d53$exports","$Piirt","$lgTAP","$6W0kE","$wtIgl","$482a09479937d1e2$export$45bd78cd093090fa","fetchAllColumns","$482a09479937d1e2$export$e3270a4e30e40ff9","useColumnFeatures","$482a09479937d1e2$export$1aa679bd5e605f82","fetchLithologies","$482a09479937d1e2$export$5d2ec2e733dfe6c7","fetchIntervals","$482a09479937d1e2$export$780b4b253712916c","fetchEnvironments","$482a09479937d1e2$export$cd7bfa0860f58b96","fetchRefs","$482a09479937d1e2$export$8ea8f45a7ffe4183","fetchStratNames","$482a09479937d1e2$export$b97b9bdd6a521298","fetchUnits","$482a09479937d1e2$export$d3d8b0fabcc76c5d","fetchColumnUnits","$8750144f23b92eb9$export$fb98d5bae3a6800","useMacrostratStore","$8750144f23b92eb9$export$89dd4e5ae4a82373","useMacrostratDefs","$8750144f23b92eb9$export$81eaae0b474404fd","useMacrostratColumns","$8750144f23b92eb9$export$b9c9fc603d74a555","useMacrostratData","$8750144f23b92eb9$export$690613f93cdc5576","MacrostratDataProvider","$8750144f23b92eb9$export$3098013bc6cc316d","MacrostratAPIProvider","$8750144f23b92eb9$export$9e42f9b6e0d67c7d","MacrostratColumnProvider","$8750144f23b92eb9$export$8492a5cae82b6a70","LithologiesProvider","$8750144f23b92eb9$export$4d18a90c945d129f","useLithologies","$8750144f23b92eb9$export$c6b216bf4c71b61f","useEnvironments","$d8324406f284950a$export$91cb5ac808759b34","useColumnNav","$d8324406f284950a$export$36fed9e0f93a8fde","ColumnNavProvider","$91525b65c57a1e5d$export$7fec7bd80ff9c10e","MacrostratColumnDataProvider","$91525b65c57a1e5d$export$f8509b7cce386c7d","useMacrostratColumnData","$91525b65c57a1e5d$export$6fb40844db555b2","useMacrostratUnits","$91525b65c57a1e5d$export$a7fc62995ec4f76","useCompositeScale"],"version":3,"file":"column-views.9b7a9ae1.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./column-views.38357d4a.js";import"./column-views.78d3f3c5.js";import e from"cross-fetch";import{useContext as t,useEffect as r,useMemo as a,useState as s,createContext as n}from"react";import o from"@macrostrat/hyper";import{create as l,useStore as i}from"zustand";import{APIProvider as u}from"@macrostrat/ui-components";import{ColumnProvider as c}from"@macrostrat/column-components";function f(e,t,r,a){Object.defineProperty(e,t,{get:r,set:a,enumerable:!0,configurable:!0})}var m=globalThis,p={},d={},v=m.parcelRequirea149;null==v&&((v=function(e){if(e in p)return p[e].exports;if(e in d){var t=d[e];delete d[e];var r={id:e,exports:{}};return p[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=v),v.register;var h={};f(h,"useMacrostratStore",()=>M),f(h,"useMacrostratDefs",()=>P),f(h,"useMacrostratColumns",()=>x),f(h,"useMacrostratData",()=>C),f(h,"MacrostratDataProvider",()=>L),f(h,"MacrostratAPIProvider",()=>_),f(h,"MacrostratColumnProvider",()=>y),f(h,"LithologiesProvider",()=>D),f(h,"useLithologies",()=>E),f(h,"useEnvironments",()=>S);var g=v("Piirt"),b=v("wtIgl");function $(t="https://macrostrat.org/api/v2"){return l((r,a)=>{var s,n,o,l,i,u,c,f,m,p,d,v;return{baseURL:t,inFlightRequests:new Set,async fetch(r,s){let n=t+r,{inFlightRequests:o}=a();if(o.has(n))return null;o.add(n);let l=await e(n,s);return o.delete(n),l},...(s=r,n=a,{lithologies:null,async getLithologies(e){let{lithologies:t,fetch:r}=n(),a=t;if(null==a){let e=await (0,g.fetchLithologies)(r);if(null==e)return;s({lithologies:a=new Map(e.map(e=>[e.lith_id,e]))})}return null==e?a.values():e.map(e=>a.get(e))}}),...(o=r,l=a,{intervals:null,async getIntervals(e,t){var r,a;let{intervals:s,fetch:n}=l(),i=s;if(null==s||(r=s,a=t,!(null!=r&&(null==a||Array.from(r.values()).some(e=>e.timescale_id==a))))){let e=await (0,g.fetchIntervals)(t,n);if(null==e)return[];let r=s??new Map;for(let t of e)r.set(t.int_id,t);o({intervals:i=r})}return null==e&&null==t?Array.from(i.values()):null!=t?Array.from(i.values()).filter(e=>e.timescale_id==t):e.map(e=>s.get(e))}}),...(i=r,u=a,{environments:null,async getEnvironments(e){let{environments:t,fetch:r}=u(),a=t;if(null==a){let e=await (0,g.fetchEnvironments)(r);if(null==e)return[];i({environments:a=new Map(e.map(e=>[e.environ_id,e]))})}return null==e?a.values():e.map(e=>a.get(e))}}),...(c=r,f=a,{columnFootprints:new Map,async getColumns(e,t){let{columnFootprints:r,baseURL:a,fetch:s}=f(),n=e??-1,o=t;null==e&&(o=!1);let l=r.get(n);if(null==l||l.inProcess!=o){let a=await (0,g.fetchAllColumns)({projectID:e,statusCode:null,fetch:s});if(null==a)return;if(o){let t=await (0,g.fetchAllColumns)({projectID:e,statusCode:"in process",fetch:s});if(null==t)return;a=a.concat(t)}l={project_id:e,inProcess:t,columns:a};let i=new Map(r);i.set(n,l),c({columnFootprints:i})}return l.columns}}),...(m=r,p=a,{refs:new Map,async getRefs(e){let{refs:t,fetch:r}=p(),a=e.filter(e=>!t.has(e));if(0==a.length)return e.map(e=>t.get(e));let s=await (0,g.fetchRefs)(a,r);if(null==s)return[];for(let e of s)t.set(e.ref_id,e);return m({refs:t}),e.map(e=>t.get(e))}}),...(d=r,v=a,{stratNames:null,async getStratNames(e){let{stratNames:t,fetch:r}=v(),a=t??new Map,s=[],n=[];for(let t of e)a.has(t)?s.push(a.get(t)):n.push(t);if(n.length>0){let e=await (0,g.fetchStratNames)(n,r);if(null==e)return s;for(let t of e)a.set(t.strat_name_id,t);d({stratNames:a})}return e.map(e=>a.get(e))}})}})}function M(e){let r=t(R);if(null==r)throw Error("Missing MacrostratDataProvider");return"api"===e?r:i(r,e)}let w={lithologies:e=>e.getLithologies,intervals:e=>e.getIntervals,columns:e=>e.getColumns,environments:e=>e.getEnvironments,refs:e=>e.getRefs,strat_names:e=>e.getStratNames};function P(e){if("columns"==e)throw Error("Columns are not provided as a map");let t=M(w[e]);return r(()=>{t()},[]),M(t=>t[e])}function x(e,t){let s=M(e=>e.getColumns),n=M(e=>e.columnFootprints),o=n?.get(e??-1);return r(()=>{(null==o||t&&!o.inProcess)&&s(e,t)},[o,t,s]),a(()=>{if(null==o)return null;let e=o.columns;return!t&&o.inProcess&&(e.features=e.features?.filter(e=>"in process"!=e.properties.status)),e},[o,t])}function C(e,...t){let a=M(w[e]),[n,o]=s(null);return r(()=>{try{a(...t).then(o)}catch(e){console.error(e)}},[a,...t]),n}let R=n($());function L(e){let{baseURL:t="https://dev.macrostrat.org/api/v2",children:r}=e,[a]=s(()=>$(t));return o(_,{baseURL:t},o(R.Provider,{value:a},r))}function _({children:e,useDev:t=!1,baseURL:r}){return r??(r=t?"https://dev.macrostrat.org/api/v2":"https://macrostrat.org/api/v2"),o(u,{baseURL:r,unwrapResponse:e=>e.success.data},e)}function y(e){let{axisType:t}=(0,b.useMacrostratColumnData)(),{units:r,domain:a,pixelScale:s,children:n}=e;return o(c,{axisType:t,divisions:r,range:a,pixelsPerMeter:s},n)}function D({children:e}){return r(()=>{console.warn("LithologiesProvider is deprecated. Replace with MacrostratDataProvider")},[]),e}function E(){let e=M(e=>e.getLithologies),t=M(e=>e.lithologies);return r(()=>{null==t&&e()},[t,e]),t}function S(){let e=M(e=>e.getEnvironments),t=M(e=>e.environments);return r(()=>{null==t&&e()},[t,e]),t}export{M as useMacrostratStore,P as useMacrostratDefs,x as useMacrostratColumns,C as useMacrostratData,L as MacrostratDataProvider,_ as MacrostratAPIProvider,y as MacrostratColumnProvider,D as LithologiesProvider,E as useLithologies,S as useEnvironments};
|
|
2
|
+
//# sourceMappingURL=column-views.9de31cdb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,M,6C,A,O,6C,A,Q,M,a,A,Q,c,C,C,a,C,C,W,C,C,Y,C,C,iB,C,K,O,A,Q,M,mB,A,Q,U,C,C,Y,C,K,S,A,Q,e,C,K,2B,A,Q,kB,C,K,+B,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,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AkB,EAAmB,AAAC,GAAM,EAAE,eAAe,EAC7D,EAAe,EAAmB,AAAC,GAAM,EAAE,YAAY,EAI7D,OAHA,AAAA,EAAU,KACJ,AAAgB,MAAhB,GAAsB,GAC5B,EAAG,CAAC,EAAc,EAAgB,EAC3B,CACT,Q,K,kB,C,K,iB,C,K,oB,C,K,iB,C,K,sB,C,K,qB,C,K,wB,C,K,mB,C,K,c,C,K,e","sources":["<anon>","packages/column-views/src/data-provider/base.ts"],"sourcesContent":["import \"./column-views.38357d4a.js\";\nimport \"./column-views.78d3f3c5.js\";\nimport $fUENy$crossfetch from \"cross-fetch\";\nimport {useContext as $fUENy$useContext, useEffect as $fUENy$useEffect, useMemo as $fUENy$useMemo, useState as $fUENy$useState, createContext as $fUENy$createContext} from \"react\";\nimport $fUENy$macrostrathyper from \"@macrostrat/hyper\";\nimport {create as $fUENy$create, useStore as $fUENy$useStore} from \"zustand\";\nimport {APIProvider as $fUENy$APIProvider} from \"@macrostrat/ui-components\";\nimport {ColumnProvider as $fUENy$ColumnProvider} from \"@macrostrat/column-components\";\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 $8750144f23b92eb9$exports = {};\n\n$parcel$export($8750144f23b92eb9$exports, \"useMacrostratStore\", () => $8750144f23b92eb9$export$fb98d5bae3a6800);\n$parcel$export($8750144f23b92eb9$exports, \"useMacrostratDefs\", () => $8750144f23b92eb9$export$89dd4e5ae4a82373);\n$parcel$export($8750144f23b92eb9$exports, \"useMacrostratColumns\", () => $8750144f23b92eb9$export$81eaae0b474404fd);\n$parcel$export($8750144f23b92eb9$exports, \"useMacrostratData\", () => $8750144f23b92eb9$export$b9c9fc603d74a555);\n$parcel$export($8750144f23b92eb9$exports, \"MacrostratDataProvider\", () => $8750144f23b92eb9$export$690613f93cdc5576);\n$parcel$export($8750144f23b92eb9$exports, \"MacrostratAPIProvider\", () => $8750144f23b92eb9$export$3098013bc6cc316d);\n$parcel$export($8750144f23b92eb9$exports, \"MacrostratColumnProvider\", () => $8750144f23b92eb9$export$9e42f9b6e0d67c7d);\n$parcel$export($8750144f23b92eb9$exports, \"LithologiesProvider\", () => $8750144f23b92eb9$export$8492a5cae82b6a70);\n$parcel$export($8750144f23b92eb9$exports, \"useLithologies\", () => $8750144f23b92eb9$export$4d18a90c945d129f);\n$parcel$export($8750144f23b92eb9$exports, \"useEnvironments\", () => $8750144f23b92eb9$export$c6b216bf4c71b61f);\n/** Data provider for information that needs to be loaded in bulk for frontend views */ \n\n\n\n\nvar $Piirt = parcelRequire(\"Piirt\");\n\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nfunction $8750144f23b92eb9$var$createMacrostratStore(baseURL = \"https://macrostrat.org/api/v2\") {\n return (0, $fUENy$create)((set, get)=>{\n return {\n baseURL: baseURL,\n inFlightRequests: new Set(),\n async fetch (url, options) {\n const url1 = baseURL + url;\n // Avoid duplicate requests\n const { inFlightRequests: inFlightRequests } = get();\n if (inFlightRequests.has(url1)) return null; // Return null if already in flight\n inFlightRequests.add(url1);\n //set({ inFlightRequests });\n const res = await (0, $fUENy$crossfetch)(url1, options);\n inFlightRequests.delete(url1);\n //set({in})\n return res;\n },\n ...$8750144f23b92eb9$var$createLithologiesSlice(set, get),\n ...$8750144f23b92eb9$var$createIntervalsSlice(set, get),\n ...$8750144f23b92eb9$var$createEnvironmentsSlice(set, get),\n ...$8750144f23b92eb9$var$createColumnsSlice(set, get),\n ...$8750144f23b92eb9$var$createRefsSlice(set, get),\n ...$8750144f23b92eb9$var$createStratNamesSlice(set, get)\n };\n });\n}\nfunction $8750144f23b92eb9$var$createRefsSlice(set, get) {\n return {\n refs: new Map(),\n async getRefs (ids) {\n const { refs: refs, fetch: fetch } = get();\n const missing = ids.filter((id)=>!refs.has(id));\n if (missing.length == 0) return ids.map((id)=>refs.get(id));\n const data = await (0, $Piirt.fetchRefs)(missing, fetch);\n if (data == null) return [];\n for (const d of data)refs.set(d.ref_id, d);\n set({\n refs: refs\n });\n return ids.map((id)=>refs.get(id));\n }\n };\n}\nfunction $8750144f23b92eb9$var$createColumnsSlice(set, get) {\n // Column footprints separated by project\n return {\n columnFootprints: new Map(),\n async getColumns (projectID, inProcess) {\n const { columnFootprints: columnFootprints, baseURL: baseURL, fetch: fetch } = get();\n const key = projectID ?? -1;\n let _inProcess = inProcess;\n if (projectID == null) // If no project is specified, in process columns cannot be included\n _inProcess = false;\n let footprints = columnFootprints.get(key);\n if (footprints == null || footprints.inProcess != _inProcess) {\n // Fetch the columns\n const statusCode = inProcess ? \"in process\" : null;\n let columns = await (0, $Piirt.fetchAllColumns)({\n projectID: projectID,\n statusCode: null,\n fetch: fetch\n });\n if (columns == null) return;\n if (_inProcess) {\n const inProcessColumns = await (0, $Piirt.fetchAllColumns)({\n projectID: projectID,\n statusCode: \"in process\",\n fetch: fetch\n });\n if (inProcessColumns == null) return;\n // Combine active and in-process columns\n columns = columns.concat(inProcessColumns);\n }\n footprints = {\n project_id: projectID,\n inProcess: inProcess,\n columns: columns\n };\n // We could break multi-project result sets into separate caches here...\n // Copy the original map\n const columnFootprints2 = new Map(columnFootprints);\n columnFootprints2.set(key, footprints);\n set({\n columnFootprints: columnFootprints2\n });\n }\n return footprints.columns;\n }\n };\n}\nfunction $8750144f23b92eb9$var$createLithologiesSlice(set, get) {\n return {\n lithologies: null,\n async getLithologies (ids) {\n const { lithologies: lithologies, fetch: fetch } = get();\n let lithMap = lithologies;\n if (lithMap == null) {\n const data = await (0, $Piirt.fetchLithologies)(fetch);\n if (data == null) return;\n lithMap = new Map(data.map((d)=>[\n d.lith_id,\n d\n ]));\n set({\n lithologies: lithMap\n });\n }\n // Now get the lithologies\n if (ids == null) return lithMap.values();\n return ids.map((id)=>lithMap.get(id));\n }\n };\n}\nfunction $8750144f23b92eb9$var$createEnvironmentsSlice(set, get) {\n return {\n environments: null,\n async getEnvironments (ids) {\n const { environments: environments, fetch: fetch } = get();\n let envMap = environments;\n if (envMap == null) {\n const data = await (0, $Piirt.fetchEnvironments)(fetch);\n if (data == null) return [];\n envMap = new Map(data.map((d)=>[\n d.environ_id,\n d\n ]));\n set({\n environments: envMap\n });\n }\n // Now get the environments\n if (ids == null) return envMap.values();\n return ids.map((id)=>envMap.get(id));\n }\n };\n}\nfunction $8750144f23b92eb9$var$createIntervalsSlice(set, get) {\n return {\n intervals: null,\n async getIntervals (ids, timescaleID) {\n const { intervals: intervals, fetch: fetch } = get();\n let _intervals = intervals;\n if (intervals == null || !$8750144f23b92eb9$var$includesTimescale(intervals, timescaleID)) {\n // Fetch the intervals\n const data = await (0, $Piirt.fetchIntervals)(timescaleID, fetch);\n if (data == null) return [];\n const intervalMap = intervals ?? new Map();\n for (const d of data)intervalMap.set(d.int_id, d);\n _intervals = intervalMap;\n set({\n intervals: _intervals\n });\n }\n if (ids == null && timescaleID == null) return Array.from(_intervals.values());\n if (timescaleID != null) return Array.from(_intervals.values()).filter((d)=>d.timescale_id == timescaleID);\n return ids.map((id)=>intervals.get(id));\n }\n };\n}\nfunction $8750144f23b92eb9$var$createStratNamesSlice(set, get) {\n return {\n stratNames: null,\n async getStratNames (ids) {\n const { stratNames: stratNames, fetch: fetch } = get();\n let nameMap = stratNames ?? new Map();\n let stratNamesAlreadyLoaded = [];\n let stratNamesToLoad = [];\n for (const id of ids)if (nameMap.has(id)) stratNamesAlreadyLoaded.push(nameMap.get(id));\n else stratNamesToLoad.push(id);\n if (stratNamesToLoad.length > 0) {\n const data = await (0, $Piirt.fetchStratNames)(stratNamesToLoad, fetch);\n if (data == null) return stratNamesAlreadyLoaded;\n for (const d of data)nameMap.set(d.strat_name_id, d);\n set({\n stratNames: nameMap\n });\n }\n return ids.map((id)=>nameMap.get(id));\n }\n };\n}\nfunction $8750144f23b92eb9$var$includesTimescale(intervals, timescaleID) {\n if (intervals == null) return false;\n if (timescaleID == null) return true;\n return Array.from(intervals.values()).some((d)=>d.timescale_id == timescaleID);\n}\nfunction $8750144f23b92eb9$export$fb98d5bae3a6800(selector) {\n const ctx = (0, $fUENy$useContext)($8750144f23b92eb9$var$MacrostratDataProviderContext);\n if (ctx == null) throw new Error(\"Missing MacrostratDataProvider\");\n if (selector === \"api\") return ctx;\n return (0, $fUENy$useStore)(ctx, selector);\n}\nconst $8750144f23b92eb9$var$dataTypeMapping = {\n lithologies: (store)=>store.getLithologies,\n intervals: (store)=>store.getIntervals,\n columns: (store)=>store.getColumns,\n environments: (store)=>store.getEnvironments,\n refs: (store)=>store.getRefs,\n strat_names: (store)=>store.getStratNames\n};\nfunction $8750144f23b92eb9$export$89dd4e5ae4a82373(dataType) {\n if (dataType == \"columns\") throw new Error(\"Columns are not provided as a map\");\n const operator = $8750144f23b92eb9$export$fb98d5bae3a6800($8750144f23b92eb9$var$dataTypeMapping[dataType]);\n (0, $fUENy$useEffect)(()=>{\n operator();\n }, []);\n return $8750144f23b92eb9$export$fb98d5bae3a6800((state)=>state[dataType]);\n}\nfunction $8750144f23b92eb9$export$81eaae0b474404fd(projectID, inProcess) {\n const getColumns = $8750144f23b92eb9$export$fb98d5bae3a6800((s)=>s.getColumns);\n const columnsMap = $8750144f23b92eb9$export$fb98d5bae3a6800((s)=>s.columnFootprints);\n const key = projectID ?? -1;\n const colData = columnsMap?.get(key);\n (0, $fUENy$useEffect)(()=>{\n // Refetch if the columns are not available, or if we have requested inProcess columns where we didn't before\n if (colData == null || inProcess && !colData.inProcess) getColumns(projectID, inProcess);\n // If we've already fetched the columns there's nothing to do...\n }, [\n colData,\n inProcess,\n getColumns\n ]);\n return (0, $fUENy$useMemo)(()=>{\n if (colData == null) return null;\n let columns = colData.columns;\n if (!inProcess && colData.inProcess) // Our available set of columns includes 'in process' columns, but we don't want them\n columns.features = columns.features?.filter((d)=>d.properties.status != \"in process\");\n return columns;\n }, [\n colData,\n inProcess\n ]);\n}\nfunction $8750144f23b92eb9$export$b9c9fc603d74a555(dataType, ...args) {\n const selector = $8750144f23b92eb9$var$dataTypeMapping[dataType];\n const operator = $8750144f23b92eb9$export$fb98d5bae3a6800(selector);\n const [value, setValue] = (0, $fUENy$useState)(null);\n (0, $fUENy$useEffect)(()=>{\n try {\n operator(...args).then(setValue);\n } catch (e) {\n console.error(e);\n }\n }, [\n operator,\n ...args\n ]);\n return value;\n}\n/** By default, we provide a store linked to the production API */ const $8750144f23b92eb9$var$MacrostratDataProviderContext = (0, $fUENy$createContext)($8750144f23b92eb9$var$createMacrostratStore());\nfunction $8750144f23b92eb9$export$690613f93cdc5576(props) {\n const { baseURL: baseURL = \"https://dev.macrostrat.org/api/v2\", children: children } = props;\n const [store] = (0, $fUENy$useState)(()=>$8750144f23b92eb9$var$createMacrostratStore(baseURL));\n return (0, $fUENy$macrostrathyper)($8750144f23b92eb9$export$3098013bc6cc316d, {\n baseURL: baseURL\n }, (0, $fUENy$macrostrathyper)($8750144f23b92eb9$var$MacrostratDataProviderContext.Provider, {\n value: store\n }, children));\n}\nfunction $8750144f23b92eb9$export$3098013bc6cc316d({ children: children, useDev: useDev = false, baseURL: baseURL }) {\n baseURL ?? (baseURL = useDev ? \"https://dev.macrostrat.org/api/v2\" : \"https://macrostrat.org/api/v2\");\n return (0, $fUENy$macrostrathyper)((0, $fUENy$APIProvider), {\n baseURL: baseURL,\n unwrapResponse: (res)=>res.success.data\n }, children);\n}\nfunction $8750144f23b92eb9$export$9e42f9b6e0d67c7d(props) {\n /** A column provider specialized the Macrostrat API. Maps more\n * generic concepts to Macrostrat-specific ones.\n */ const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n const { units: units, domain: domain, pixelScale: pixelScale, children: children } = props;\n return (0, $fUENy$macrostrathyper)((0, $fUENy$ColumnProvider), {\n axisType: axisType,\n divisions: units,\n range: domain,\n pixelsPerMeter: pixelScale\n }, children);\n}\nfunction $8750144f23b92eb9$export$8492a5cae82b6a70({ children: children }) {\n (0, $fUENy$useEffect)(()=>{\n console.warn(\"LithologiesProvider is deprecated. Replace with MacrostratDataProvider\");\n }, []);\n return children;\n}\nfunction $8750144f23b92eb9$export$4d18a90c945d129f() {\n const getLithologies = $8750144f23b92eb9$export$fb98d5bae3a6800((s)=>s.getLithologies);\n const lithologies = $8750144f23b92eb9$export$fb98d5bae3a6800((s)=>s.lithologies);\n (0, $fUENy$useEffect)(()=>{\n if (lithologies == null) getLithologies();\n }, [\n lithologies,\n getLithologies\n ]);\n return lithologies;\n}\nfunction $8750144f23b92eb9$export$c6b216bf4c71b61f() {\n const getEnvironments = $8750144f23b92eb9$export$fb98d5bae3a6800((s)=>s.getEnvironments);\n const environments = $8750144f23b92eb9$export$fb98d5bae3a6800((s)=>s.environments);\n (0, $fUENy$useEffect)(()=>{\n if (environments == null) getEnvironments();\n }, [\n environments,\n getEnvironments\n ]);\n return environments;\n}\n\n\nexport {$8750144f23b92eb9$export$fb98d5bae3a6800 as useMacrostratStore, $8750144f23b92eb9$export$89dd4e5ae4a82373 as useMacrostratDefs, $8750144f23b92eb9$export$81eaae0b474404fd as useMacrostratColumns, $8750144f23b92eb9$export$b9c9fc603d74a555 as useMacrostratData, $8750144f23b92eb9$export$690613f93cdc5576 as MacrostratDataProvider, $8750144f23b92eb9$export$3098013bc6cc316d as MacrostratAPIProvider, $8750144f23b92eb9$export$9e42f9b6e0d67c7d as MacrostratColumnProvider, $8750144f23b92eb9$export$8492a5cae82b6a70 as LithologiesProvider, $8750144f23b92eb9$export$4d18a90c945d129f as useLithologies, $8750144f23b92eb9$export$c6b216bf4c71b61f as useEnvironments};\n//# sourceMappingURL=column-views.9de31cdb.js.map\n","/** Data provider for information that needs to be loaded in bulk for frontend views */\nimport baseFetch from \"cross-fetch\";\nimport { createContext, useContext, useEffect, useMemo, useState } from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport { create, useStore } from \"zustand\";\nimport {\n ColumnGeoJSONRecord,\n ColumnGeoJSONRecordWithID,\n Environment,\n MacrostratRef,\n StratName,\n} from \"@macrostrat/api-types\";\nimport {\n fetchAllColumns,\n fetchEnvironments,\n fetchIntervals,\n fetchLithologies,\n fetchRefs,\n fetchStratNames,\n} from \"./fetch\";\nimport { APIProvider } from \"@macrostrat/ui-components\";\nimport { ColumnProvider } from \"@macrostrat/column-components\";\n\nimport { ReactNode } from \"react\";\nimport { useMacrostratColumnData } from \"./store\";\n\nexport interface MacrostratDataProviderProps {\n baseURL: string;\n children: React.ReactNode;\n}\n\ninterface ColumnFootprintsStorage {\n project_id: number;\n // Whether the \"in process\" flag was used\n inProcess: boolean;\n // The column footprints\n columns: ColumnGeoJSONRecordWithID[];\n}\n\ninterface RefsSlice {\n refs: Map<number, MacrostratRef>;\n inFlightRequests: Set<string>; // Track requests to avoid duplicates\n getRefs(ids: number[]): Promise<MacrostratRef[]>;\n}\n\ninterface MacrostratStore extends RefsSlice {\n baseURL: string;\n fetch: any;\n lithologies: Map<number, any> | null;\n getLithologies(ids: number[] | null): Promise<any>;\n intervals: Map<number, any> | null;\n getIntervals(ids: number[] | null, timescaleID: number | null): Promise<any>;\n environments: Map<number, Environment> | null;\n getEnvironments(ids: number[] | null): Promise<Environment[]>;\n columnFootprints: Map<number, ColumnFootprintsStorage>;\n getColumns(\n projectID: number | null,\n inProcess: boolean,\n ): Promise<ColumnGeoJSONRecord[]>;\n // Strat names unify both \"strat names\" and \"concepts\"\n stratNames: Map<number, StratName> | null;\n getStratNames(ids: number[] | null): Promise<StratName[]>;\n}\n\nfunction createMacrostratStore(\n baseURL: string = \"https://macrostrat.org/api/v2\",\n) {\n return create<MacrostratStore>((set, get): MacrostratStore => {\n return {\n baseURL,\n inFlightRequests: new Set(),\n async fetch(url: string, options?: RequestInit) {\n const url1 = baseURL + url;\n // Avoid duplicate requests\n const { inFlightRequests } = get();\n if (inFlightRequests.has(url1)) {\n return null; // Return null if already in flight\n }\n inFlightRequests.add(url1);\n //set({ inFlightRequests });\n const res = await baseFetch(url1, options);\n inFlightRequests.delete(url1);\n //set({in})\n return res;\n },\n ...createLithologiesSlice(set, get),\n ...createIntervalsSlice(set, get),\n ...createEnvironmentsSlice(set, get),\n ...createColumnsSlice(set, get),\n ...createRefsSlice(set, get),\n ...createStratNamesSlice(set, get),\n };\n });\n}\n\nfunction createRefsSlice(set, get) {\n return {\n refs: new Map(),\n async getRefs(ids: number[]): Promise<MacrostratRef[]> {\n const { refs, fetch } = get();\n const missing = ids.filter((id) => !refs.has(id));\n if (missing.length == 0) {\n return ids.map((id) => refs.get(id));\n }\n const data = await fetchRefs(missing, fetch);\n if (data == null) return [];\n for (const d of data) {\n refs.set(d.ref_id, d);\n }\n set({ refs });\n return ids.map((id) => refs.get(id));\n },\n };\n}\n\nfunction createColumnsSlice(set, get) {\n // Column footprints separated by project\n return {\n columnFootprints: new Map(),\n async getColumns(projectID: number | null, inProcess: boolean) {\n const { columnFootprints, baseURL, fetch } = get();\n const key = projectID ?? -1;\n let _inProcess = inProcess;\n if (projectID == null) {\n // If no project is specified, in process columns cannot be included\n _inProcess = false;\n }\n let footprints = columnFootprints.get(key);\n if (footprints == null || footprints.inProcess != _inProcess) {\n // Fetch the columns\n const statusCode = inProcess ? \"in process\" : null;\n let columns = await fetchAllColumns({\n projectID,\n statusCode: null,\n fetch,\n });\n if (columns == null) {\n return;\n }\n if (_inProcess) {\n const inProcessColumns = await fetchAllColumns({\n projectID,\n statusCode: \"in process\",\n fetch,\n });\n if (inProcessColumns == null) {\n return;\n }\n // Combine active and in-process columns\n columns = columns.concat(inProcessColumns);\n }\n\n footprints = {\n project_id: projectID,\n inProcess,\n columns,\n };\n // We could break multi-project result sets into separate caches here...\n // Copy the original map\n const columnFootprints2 = new Map(columnFootprints);\n columnFootprints2.set(key, footprints);\n set({ columnFootprints: columnFootprints2 });\n }\n return footprints.columns;\n },\n };\n}\n\nfunction createLithologiesSlice(set, get) {\n return {\n lithologies: null,\n async getLithologies(ids: number[] | null) {\n const { lithologies, fetch } = get();\n let lithMap = lithologies;\n if (lithMap == null) {\n const data = await fetchLithologies(fetch);\n if (data == null) return;\n lithMap = new Map(data.map((d) => [d.lith_id, d]));\n set({ lithologies: lithMap });\n }\n // Now get the lithologies\n if (ids == null) return lithMap.values();\n return ids.map((id) => lithMap.get(id));\n },\n };\n}\n\nfunction createEnvironmentsSlice(set, get) {\n return {\n environments: null,\n async getEnvironments(ids: number[] | null): Promise<Environment[]> {\n const { environments, fetch } = get();\n let envMap = environments;\n if (envMap == null) {\n const data = await fetchEnvironments(fetch);\n if (data == null) return [];\n envMap = new Map(data.map((d) => [d.environ_id, d]));\n set({ environments: envMap });\n }\n // Now get the environments\n if (ids == null) return envMap.values();\n return ids.map((id) => envMap.get(id));\n },\n };\n}\n\nfunction createIntervalsSlice(set, get) {\n return {\n intervals: null,\n async getIntervals(ids: number[] | null, timescaleID: number | null) {\n const { intervals, fetch } = get();\n let _intervals = intervals;\n if (intervals == null || !includesTimescale(intervals, timescaleID)) {\n // Fetch the intervals\n const data = await fetchIntervals(timescaleID, fetch);\n if (data == null) {\n return [];\n }\n const intervalMap = intervals ?? new Map();\n for (const d of data) {\n intervalMap.set(d.int_id, d);\n }\n _intervals = intervalMap;\n set({ intervals: _intervals });\n }\n if (ids == null && timescaleID == null)\n return Array.from(_intervals.values());\n if (timescaleID != null) {\n return Array.from(_intervals.values() as any[]).filter(\n (d) => d.timescale_id == timescaleID,\n );\n }\n return ids.map((id) => intervals.get(id));\n },\n };\n}\n\nfunction createStratNamesSlice(set, get) {\n return {\n stratNames: null,\n async getStratNames(ids: number[] | null): Promise<StratName[]> {\n const { stratNames, fetch } = get();\n let nameMap = stratNames ?? new Map();\n let stratNamesAlreadyLoaded = [];\n let stratNamesToLoad = [];\n for (const id of ids) {\n if (nameMap.has(id)) {\n stratNamesAlreadyLoaded.push(nameMap.get(id));\n } else {\n stratNamesToLoad.push(id);\n }\n }\n if (stratNamesToLoad.length > 0) {\n const data = await fetchStratNames(stratNamesToLoad, fetch);\n if (data == null) return stratNamesAlreadyLoaded;\n for (const d of data) {\n nameMap.set(d.strat_name_id, d);\n }\n set({ stratNames: nameMap });\n }\n return ids.map((id) => nameMap.get(id));\n },\n };\n}\n\nfunction includesTimescale(intervals: Map<number, any>, timescaleID: number) {\n if (intervals == null) return false;\n if (timescaleID == null) return true;\n return Array.from(intervals.values()).some(\n (d) => d.timescale_id == timescaleID,\n );\n}\n\ntype MacrostratSelector = (store: MacrostratStore) => any;\n\nexport function useMacrostratStore(selector: MacrostratSelector | \"api\") {\n const ctx = useContext(MacrostratDataProviderContext);\n if (ctx == null) {\n throw new Error(\"Missing MacrostratDataProvider\");\n }\n if (selector === \"api\") {\n return ctx;\n }\n\n return useStore(ctx, selector);\n}\n\ntype DataTypeKey =\n | \"lithologies\"\n | \"intervals\"\n | \"columns\"\n | \"environments\"\n | \"refs\"\n | \"strat_names\";\n\nconst dataTypeMapping = {\n lithologies: (store) => store.getLithologies,\n intervals: (store) => store.getIntervals,\n columns: (store) => store.getColumns,\n environments: (store) => store.getEnvironments,\n refs: (store) => store.getRefs,\n strat_names: (store) => store.getStratNames,\n};\n\nexport function useMacrostratDefs(dataType: string): Map<number, any> | null {\n if (dataType == \"columns\") {\n throw new Error(\"Columns are not provided as a map\");\n }\n const operator = useMacrostratStore(dataTypeMapping[dataType]);\n useEffect(() => {\n operator();\n }, []);\n return useMacrostratStore((state) => state[dataType]);\n}\n\nexport function useMacrostratColumns(\n projectID: number | null,\n inProcess: boolean,\n) {\n const getColumns = useMacrostratStore((s) => s.getColumns);\n const columnsMap = useMacrostratStore((s) => s.columnFootprints);\n const key = projectID ?? -1;\n const colData = columnsMap?.get(key);\n useEffect(() => {\n // Refetch if the columns are not available, or if we have requested inProcess columns where we didn't before\n if (colData == null || (inProcess && !colData.inProcess)) {\n getColumns(projectID, inProcess);\n }\n // If we've already fetched the columns there's nothing to do...\n }, [colData, inProcess, getColumns]);\n\n return useMemo(() => {\n if (colData == null) return null;\n let columns = colData.columns;\n if (!inProcess && colData.inProcess) {\n // Our available set of columns includes 'in process' columns, but we don't want them\n columns.features = columns.features?.filter(\n (d) => d.properties.status != \"in process\",\n );\n }\n return columns;\n }, [colData, inProcess]);\n}\n\nexport function useMacrostratData(dataType: DataTypeKey, ...args: any[]) {\n const selector = dataTypeMapping[dataType];\n const operator = useMacrostratStore(selector);\n\n const [value, setValue] = useState(null);\n\n useEffect(() => {\n try {\n operator(...args).then(setValue);\n } catch (e) {\n console.error(e);\n }\n }, [operator, ...args]);\n\n return value;\n}\n\n/** By default, we provide a store linked to the production API */\nconst MacrostratDataProviderContext = createContext(createMacrostratStore());\n\nexport function MacrostratDataProvider(props: MacrostratDataProviderProps) {\n const { baseURL = \"https://dev.macrostrat.org/api/v2\", children } = props;\n\n const [store] = useState(() => createMacrostratStore(baseURL));\n\n return h(\n MacrostratAPIProvider,\n { baseURL },\n h(MacrostratDataProviderContext.Provider, { value: store }, children),\n );\n}\n\n/** Legacy API provider so useAPIResult can work */\n\ntype APIProviderProps = {\n children: ReactNode;\n useDev?: boolean;\n baseURL?: string;\n};\n\nexport function MacrostratAPIProvider({\n children,\n useDev = false,\n baseURL,\n}: APIProviderProps) {\n baseURL ??= useDev\n ? \"https://dev.macrostrat.org/api/v2\"\n : \"https://macrostrat.org/api/v2\";\n\n return h(\n APIProvider,\n {\n baseURL,\n unwrapResponse: (res) => res.success.data,\n },\n children,\n );\n}\n\nexport function MacrostratColumnProvider(props) {\n /** A column provider specialized the Macrostrat API. Maps more\n * generic concepts to Macrostrat-specific ones.\n */\n\n const { axisType } = useMacrostratColumnData();\n const { units, domain, pixelScale, children } = props;\n return h(\n ColumnProvider,\n { axisType, divisions: units, range: domain, pixelsPerMeter: pixelScale },\n children,\n );\n}\n\n/** This is now a legacy provider */\nexport function LithologiesProvider({ children }) {\n useEffect(() => {\n console.warn(\n \"LithologiesProvider is deprecated. Replace with MacrostratDataProvider\",\n );\n }, []);\n return children;\n}\n\nexport function useLithologies() {\n const getLithologies = useMacrostratStore((s) => s.getLithologies);\n const lithologies = useMacrostratStore((s) => s.lithologies);\n useEffect(() => {\n if (lithologies == null) getLithologies();\n }, [lithologies, getLithologies]);\n return lithologies;\n}\n\nexport function useEnvironments() {\n const getEnvironments = useMacrostratStore((s) => s.getEnvironments);\n const environments = useMacrostratStore((s) => s.environments);\n useEffect(() => {\n if (environments == null) getEnvironments();\n }, [environments, getEnvironments]);\n return environments;\n}\n"],"names":["$fUENy$crossfetch","useContext","$fUENy$useContext","useEffect","$fUENy$useEffect","useMemo","$fUENy$useMemo","useState","$fUENy$useState","createContext","$fUENy$createContext","$fUENy$macrostrathyper","create","$fUENy$create","useStore","$fUENy$useStore","APIProvider","$fUENy$APIProvider","ColumnProvider","$fUENy$ColumnProvider","$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","$8750144f23b92eb9$exports","$8750144f23b92eb9$export$fb98d5bae3a6800","$8750144f23b92eb9$export$89dd4e5ae4a82373","$8750144f23b92eb9$export$81eaae0b474404fd","$8750144f23b92eb9$export$b9c9fc603d74a555","$8750144f23b92eb9$export$690613f93cdc5576","$8750144f23b92eb9$export$3098013bc6cc316d","$8750144f23b92eb9$export$9e42f9b6e0d67c7d","$8750144f23b92eb9$export$8492a5cae82b6a70","$8750144f23b92eb9$export$4d18a90c945d129f","$8750144f23b92eb9$export$c6b216bf4c71b61f","$Piirt","$wtIgl","$8750144f23b92eb9$var$createMacrostratStore","baseURL","inFlightRequests","Set","fetch","url","options","url1","has","add","res","delete","lithologies","getLithologies","ids","lithMap","data","fetchLithologies","Map","map","d","lith_id","values","intervals","getIntervals","timescaleID","_intervals","Array","from","some","timescale_id","fetchIntervals","intervalMap","int_id","filter","environments","getEnvironments","envMap","fetchEnvironments","environ_id","columnFootprints","getColumns","projectID","inProcess","key","_inProcess","footprints","columns","fetchAllColumns","statusCode","inProcessColumns","concat","project_id","columnFootprints2","refs","getRefs","missing","length","fetchRefs","ref_id","stratNames","getStratNames","nameMap","stratNamesAlreadyLoaded","stratNamesToLoad","push","fetchStratNames","strat_name_id","selector","ctx","$8750144f23b92eb9$var$MacrostratDataProviderContext","$8750144f23b92eb9$var$dataTypeMapping","store","strat_names","dataType","operator","state","columnsMap","colData","features","properties","status","args","value","setValue","then","console","error","props","children","Provider","useDev","unwrapResponse","success","axisType","useMacrostratColumnData","units","domain","pixelScale","divisions","range","pixelsPerMeter","warn","useMacrostratStore","useMacrostratDefs","useMacrostratColumns","useMacrostratData","MacrostratDataProvider","MacrostratAPIProvider","MacrostratColumnProvider","LithologiesProvider","useLithologies","useEnvironments"],"version":3,"file":"column-views.9de31cdb.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./column-views.78d3f3c5.js";import{line as e}from"d3-shape";import{createContext as t,useContext as r}from"react";import o from"@macrostrat/hyper";import{ColumnLayoutContext as a}from"@macrostrat/column-components";var n=globalThis,l={},c={},i=n.parcelRequirea149;null==i&&((i=function(e){if(e in l)return l[e].exports;if(e in c){var t=c[e];delete c[e];var r={id:e,exports:{}};return l[e]=r,t.call(r.exports,r,r.exports),r.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){c[e]=t},n.parcelRequirea149=i),i.register;var s=i("wtIgl");let u=function(e){let{xScale:t,scale:r,getHeight:o,...a}=e;return function(e,a=0){let n=o(e);return((e,t)=>{let r=e.domain();return r[0]<t<r[1]})(r,n)?[t(e.value),r(n)]:null}},p=t(null),d=function(t){let n=r(a)?.xScale,l=(0,s.useCompositeScale)(),{corrected:c,system:i,children:d,getHeight:m,clipY:f=!1}=t;null==m&&(m=function(e){return null==e.height&&console.log(e),e.height});let b=u({xScale:n,scale:l,corrected:c,system:i,getHeight:m}),x="avg_"+i;c&&(x+="_corr");let g=e().x(e=>n(e[x])).y(e=>l(e.height));return o(p.Provider,{value:{pointLocator:b,lineLocator:g,corrected:c,system:i,clipY:f}},o("g.data",d))},m=function(e){let{pointLocator:t}=r(p),{datum:a,strokeWidth:n,...l}=e,c=t(a);if(null==c)return null;let[i,s]=c;return o("circle",{key:a.sample_id,cx:i,cy:s,r:2,...l})},f=function(e){let{values:t,...a}=e,{lineLocator:n}=r(p);return o("path",{d:n(t),fill:"transparent",...a})},b=()=>r(p);export{d as IsotopesDataArea,m as IsotopeDataPoint,f as IsotopeDataLine,b as useDataLocator};
|
|
2
|
+
//# sourceMappingURL=column-views.a2274834.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,M,6C,A,Q,Q,C,K,U,A,Q,iB,C,C,c,C,K,O,A,Q,M,mB,A,Q,uB,C,K,+B,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,SCWA,IAAM,EAAqB,SAAU,CAAI,EACvC,GAAM,CAAA,OAAE,CAAM,CAAA,MAAE,CAAK,CAAA,UAAE,CAAS,CAAE,GAAG,EAAM,CAAG,EAC9C,OAAO,S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AE,GAAG,EAAM,CAAG,EAClC,EAAM,EAAa,GACzB,GAAI,AAAO,MAAP,EAAa,OAAO,KACxB,GAAM,CAAC,EAAI,EAAG,CAAG,EAEjB,OAAO,AAAA,EAAE,SAAU,CACjB,IAAK,EAAM,SAAS,CACpB,GAAA,EACA,GAAA,EACA,EAAG,EACH,GAAG,CAAI,AACT,EACF,EAEM,EAAkB,SAAU,CAAK,EACrC,GAAM,CAAE,OAAQ,CAAU,CAAE,GAAG,EAAM,CAAG,EAClC,CAAA,YAAE,CAAW,CAAE,CAAG,AAAA,EAAW,GACnC,OAAO,AAAA,EAAE,OAAQ,CACf,EAAG,EAAY,GACf,KAAM,cACN,GAAG,CAAI,AACT,EACF,EAEM,EAAiB,IAAM,AAAA,EAAW,U,K,gB,C,K,gB,C,K,e,C,K,c","sources":["<anon>","packages/column-views/src/facets/carbon-isotopes/data-area.ts"],"sourcesContent":["import \"./column-views.78d3f3c5.js\";\nimport {line as $5eSmp$line} from \"d3-shape\";\nimport {createContext as $5eSmp$createContext, useContext as $5eSmp$useContext} from \"react\";\nimport $5eSmp$macrostrathyper from \"@macrostrat/hyper\";\nimport {ColumnLayoutContext as $5eSmp$ColumnLayoutContext} from \"@macrostrat/column-components\";\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 $wtIgl = parcelRequire(\"wtIgl\");\nconst $561e9bb965350dc6$var$inDomain = (scale, num)=>{\n const domain = scale.domain();\n return domain[0] < num < domain[1];\n};\nconst $561e9bb965350dc6$var$createPointLocator = function(opts) {\n const { xScale: xScale, scale: scale, getHeight: getHeight, ...rest } = opts;\n return function(d, s = 0) {\n const height = getHeight(d);\n if (!$561e9bb965350dc6$var$inDomain(scale, height)) return null;\n return [\n xScale(d.value),\n scale(height)\n ];\n };\n};\nconst $561e9bb965350dc6$var$IsotopesDataContext = (0, $5eSmp$createContext)(null);\nconst $561e9bb965350dc6$export$309ef8546e07d921 = function(props) {\n const xScale = (0, $5eSmp$useContext)((0, $5eSmp$ColumnLayoutContext))?.xScale;\n const scale = (0, $wtIgl.useCompositeScale)();\n let { corrected: corrected, system: system, children: children, getHeight: getHeight, clipY: clipY = false } = props;\n if (getHeight == null) getHeight = function(d) {\n if (d.height == null) console.log(d);\n return d.height;\n };\n // Handlers for creating points and lines\n const pointLocator = $561e9bb965350dc6$var$createPointLocator({\n xScale: xScale,\n scale: scale,\n corrected: corrected,\n system: system,\n getHeight: getHeight\n });\n let column = \"avg_\" + system;\n if (corrected) column += \"_corr\";\n const lineLocator = (0, $5eSmp$line)().x((d)=>xScale(d[column]))// @ts-ignore\n .y((d)=>scale(d.height));\n const value = {\n pointLocator: pointLocator,\n lineLocator: lineLocator,\n corrected: corrected,\n system: system,\n clipY: clipY\n };\n return (0, $5eSmp$macrostrathyper)($561e9bb965350dc6$var$IsotopesDataContext.Provider, {\n value: value\n }, (0, $5eSmp$macrostrathyper)(\"g.data\", children));\n};\nconst $561e9bb965350dc6$export$4cb5d059db4e2bd = function(props) {\n const { pointLocator: pointLocator } = (0, $5eSmp$useContext)($561e9bb965350dc6$var$IsotopesDataContext);\n const { datum: datum, strokeWidth: strokeWidth, ...rest } = props;\n const loc = pointLocator(datum);\n if (loc == null) return null;\n const [cx, cy] = loc;\n return (0, $5eSmp$macrostrathyper)(\"circle\", {\n key: datum.sample_id,\n cx: cx,\n cy: cy,\n r: 2,\n ...rest\n });\n};\nconst $561e9bb965350dc6$export$628a3ef6eb9c3a89 = function(props) {\n const { values: lineValues, ...rest } = props;\n const { lineLocator: lineLocator } = (0, $5eSmp$useContext)($561e9bb965350dc6$var$IsotopesDataContext);\n return (0, $5eSmp$macrostrathyper)(\"path\", {\n d: lineLocator(lineValues),\n fill: \"transparent\",\n ...rest\n });\n};\nconst $561e9bb965350dc6$export$919dbb10b6b5b75 = ()=>(0, $5eSmp$useContext)($561e9bb965350dc6$var$IsotopesDataContext);\n\n\nexport {$561e9bb965350dc6$export$309ef8546e07d921 as IsotopesDataArea, $561e9bb965350dc6$export$4cb5d059db4e2bd as IsotopeDataPoint, $561e9bb965350dc6$export$628a3ef6eb9c3a89 as IsotopeDataLine, $561e9bb965350dc6$export$919dbb10b6b5b75 as useDataLocator};\n//# sourceMappingURL=column-views.a2274834.js.map\n","import { line } from \"d3-shape\";\nimport { createContext, useContext } from \"react\";\nimport h from \"@macrostrat/hyper\";\nimport { ColumnLayoutContext } from \"@macrostrat/column-components\";\nimport { useCompositeScale } from \"../../data-provider\";\n\nconst inDomain = (scale, num) => {\n const domain = scale.domain();\n return domain[0] < num < domain[1];\n};\n\nconst createPointLocator = function (opts) {\n const { xScale, scale, getHeight, ...rest } = opts;\n return function (d, s = 0) {\n const height = getHeight(d);\n if (!inDomain(scale, height)) return null;\n return [xScale(d.value), scale(height)];\n };\n};\n\nconst IsotopesDataContext = createContext(null);\n\nexport interface DataAreaProps {\n clipY: boolean;\n parameter: string;\n corrected: boolean;\n system: string;\n children: React.ReactNode;\n getHeight?: Function;\n}\n\nconst IsotopesDataArea = function (props: DataAreaProps) {\n const xScale = useContext(ColumnLayoutContext)?.xScale;\n\n const scale = useCompositeScale();\n\n let { corrected, system, children, getHeight, clipY = false } = props;\n if (getHeight == null) {\n getHeight = function (d) {\n if (d.height == null) {\n console.log(d);\n }\n return d.height;\n };\n }\n\n // Handlers for creating points and lines\n const pointLocator = createPointLocator({\n xScale,\n scale,\n corrected,\n system,\n getHeight,\n });\n\n let column = \"avg_\" + system;\n if (corrected) {\n column += \"_corr\";\n }\n const lineLocator = line()\n .x((d) => xScale(d[column]))\n // @ts-ignore\n .y((d) => scale(d.height));\n\n const value = { pointLocator, lineLocator, corrected, system, clipY };\n return h(IsotopesDataContext.Provider, { value }, h(\"g.data\", children));\n};\n\nconst IsotopeDataPoint = function (props) {\n const { pointLocator } = useContext(IsotopesDataContext);\n const { datum, strokeWidth, ...rest } = props;\n const loc = pointLocator(datum);\n if (loc == null) return null;\n const [cx, cy] = loc;\n\n return h(\"circle\", {\n key: datum.sample_id,\n cx,\n cy,\n r: 2,\n ...rest,\n });\n};\n\nconst IsotopeDataLine = function (props) {\n const { values: lineValues, ...rest } = props;\n const { lineLocator } = useContext(IsotopesDataContext);\n return h(\"path\", {\n d: lineLocator(lineValues),\n fill: \"transparent\",\n ...rest,\n });\n};\n\nconst useDataLocator = () => useContext(IsotopesDataContext);\n\nexport { IsotopesDataArea, IsotopeDataPoint, IsotopeDataLine, useDataLocator };\n"],"names":["line","$5eSmp$line","createContext","$5eSmp$createContext","useContext","$5eSmp$useContext","$5eSmp$macrostrathyper","ColumnLayoutContext","$5eSmp$ColumnLayoutContext","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$wtIgl","$561e9bb965350dc6$var$createPointLocator","opts","xScale","scale","getHeight","rest","d","s","height","$561e9bb965350dc6$var$inDomain","num","domain","value","$561e9bb965350dc6$var$IsotopesDataContext","$561e9bb965350dc6$export$309ef8546e07d921","props","useCompositeScale","corrected","system","children","clipY","console","log","pointLocator","column","lineLocator","x","y","Provider","$561e9bb965350dc6$export$4cb5d059db4e2bd","datum","strokeWidth","loc","cx","cy","key","sample_id","r","$561e9bb965350dc6$export$628a3ef6eb9c3a89","values","lineValues","fill","$561e9bb965350dc6$export$919dbb10b6b5b75","IsotopesDataArea","IsotopeDataPoint","IsotopeDataLine","useDataLocator"],"version":3,"file":"column-views.a2274834.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.51bc87ca.js";import"./column-views.c7f6fc0a.js";function e(e,r){return Object.keys(r).forEach(function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})}),e}var r=globalThis,a={},o={},t=r.parcelRequirea149;null==t&&((t=function(e){if(e in a)return a[e].exports;if(e in o){var r=o[e];delete o[e];var t={id:e,exports:{}};return a[e]=t,r.call(t.exports,t,t.exports),t.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){o[e]=r},r.parcelRequirea149=t),t.register;var n={},c=t("fIgv5"),f=t("c27x8");e(n,c),e(n,f);export{$44d1d5e5d8e823d1$export$821baedf611249f3 as ColumnNavigationMap,$5a7fd801cb316afa$export$c4313db718750a5a as ResizableMapFrame,$5a7fd801cb316afa$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap,$372e0c9189556f66$export$2254347cd20e6080 as MeasurementsLayer,$372e0c9189556f66$export$f177ff57c101017a as ColumnFeatures,$372e0c9189556f66$export$8c41dd563753848 as ColumnKeyboardNavigation,$372e0c9189556f66$export$f02cc02ad0e0bba3 as Columns,$372e0c9189556f66$export$4d8f6e6df85d9012 as ColumnCenters,$372e0c9189556f66$export$b9d912252344e099 as CurrentColumn};
|
|
2
|
+
//# sourceMappingURL=column-views.a372c943.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,mB,C,6C,iB,C,6C,sB,C,6C,iB,C,6C,c,C,4C,wB,C,6C,O,C,6C,a,C,6C,a","sources":["<anon>","packages/column-views/src/maps/column-navigation/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,mB,C,6C,iB,C,6C,sB,C,6C,iB,C,6C,c,C,4C,wB,C,6C,O,C,6C,a,C,6C,a","sources":["<anon>","packages/column-views/src/maps/column-navigation/index.ts"],"sourcesContent":["import \"./column-views.51bc87ca.js\";\nimport \"./column-views.c7f6fc0a.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 $7ff4e0023faa490a$exports = {};\n\nvar $fIgv5 = parcelRequire(\"fIgv5\");\n\nvar $c27x8 = parcelRequire(\"c27x8\");\n$parcel$exportWildcard($7ff4e0023faa490a$exports, $fIgv5);\n$parcel$exportWildcard($7ff4e0023faa490a$exports, $c27x8);\n\n\nexport {$44d1d5e5d8e823d1$export$821baedf611249f3 as ColumnNavigationMap, $5a7fd801cb316afa$export$c4313db718750a5a as ResizableMapFrame, $5a7fd801cb316afa$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap, $372e0c9189556f66$export$2254347cd20e6080 as MeasurementsLayer, $372e0c9189556f66$export$f177ff57c101017a as ColumnFeatures, $372e0c9189556f66$export$8c41dd563753848 as ColumnKeyboardNavigation, $372e0c9189556f66$export$f02cc02ad0e0bba3 as Columns, $372e0c9189556f66$export$4d8f6e6df85d9012 as ColumnCenters, $372e0c9189556f66$export$b9d912252344e099 as CurrentColumn};\n//# sourceMappingURL=column-views.a372c943.js.map\n","export * from \"./mapbox\";\nexport * from \"./svg\";\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","$7ff4e0023faa490a$exports","$fIgv5","$c27x8","$44d1d5e5d8e823d1$export$821baedf611249f3","ColumnNavigationMap","$5a7fd801cb316afa$export$c4313db718750a5a","ResizableMapFrame","$5a7fd801cb316afa$export$9595c40c7a4c4f7b","ColumnNavigationSVGMap","$372e0c9189556f66$export$2254347cd20e6080","MeasurementsLayer","$372e0c9189556f66$export$f177ff57c101017a","ColumnFeatures","$372e0c9189556f66$export$8c41dd563753848","ColumnKeyboardNavigation","$372e0c9189556f66$export$f02cc02ad0e0bba3","Columns","$372e0c9189556f66$export$4d8f6e6df85d9012","ColumnCenters","$372e0c9189556f66$export$b9d912252344e099","CurrentColumn"],"version":3,"file":"column-views.a372c943.js.map","sourceRoot":"../../../../"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}var t,a,n={};e(n,"too-many",()=>t,e=>t=e),e(n,"truncated-list",()=>a,e=>a=e),t="VC2fja_too-many",a="VC2fja_truncated-list";export{n as default};
|
|
2
|
+
//# sourceMappingURL=column-views.a4e6d4ad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"A,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,ICAA,EACA,E,E,C,E,E,E,W,I,E,A,G,E,G,E,E,iB,I,E,A,G,E,GADA,EAA6B,kBAC7B,EAAmC,+B,K,O","sources":["<anon>","packages/column-views/src/facets/fossils/index.module.sass"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $e4bc3df6e06d50e7$exports = {};\n\n$parcel$export($e4bc3df6e06d50e7$exports, \"too-many\", () => $e4bc3df6e06d50e7$export$76144d85d033d82a, (v) => $e4bc3df6e06d50e7$export$76144d85d033d82a = v);\n$parcel$export($e4bc3df6e06d50e7$exports, \"truncated-list\", () => $e4bc3df6e06d50e7$export$12f42f335e4f5e49, (v) => $e4bc3df6e06d50e7$export$12f42f335e4f5e49 = v);\nvar $e4bc3df6e06d50e7$export$76144d85d033d82a;\nvar $e4bc3df6e06d50e7$export$12f42f335e4f5e49;\n$e4bc3df6e06d50e7$export$76144d85d033d82a = `VC2fja_too-many`;\n$e4bc3df6e06d50e7$export$12f42f335e4f5e49 = `VC2fja_truncated-list`;\n\n\nexport {$e4bc3df6e06d50e7$exports as default};\n//# sourceMappingURL=column-views.a4e6d4ad.js.map\n",null],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$e4bc3df6e06d50e7$export$76144d85d033d82a","$e4bc3df6e06d50e7$export$12f42f335e4f5e49","$e4bc3df6e06d50e7$exports","default"],"version":3,"file":"column-views.a4e6d4ad.js.map","sourceRoot":"../../../../"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./column-views.
|
|
2
|
-
//# sourceMappingURL=column-views.
|
|
1
|
+
import"./column-views.976a829b.js";import"./column-views.99fb74c0.js";import"./column-views.9de31cdb.js";import"./column-views.78d3f3c5.js";import"./column-views.6f7a432f.js";import{useMemo as e}from"react";import{Timescale as t,TimescaleOrientation as n}from"@macrostrat/timescale";import{SVG as o}from"@macrostrat/column-components";import i from"@macrostrat/hyper";var a=globalThis,s={},l={},r=a.parcelRequirea149;null==r&&((r=function(e){if(e in s)return s[e].exports;if(e in l){var t=l[e];delete l[e];var n={id:e,exports:{}};return s[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){l[e]=t},a.parcelRequirea149=r),r.register;var c=r("4Abge"),m=r("7YHvf"),u=r("lgTAP"),p=r("wtIgl"),d=r("iYfAq");let f=i.styled(m&&m.__esModule?m.default:m);function h(e){let{unconformityLabels:t=!0,unitComponent:n,unitComponentProps:o,showLabels:i=!0,width:a=300,columnWidth:s=150,showLabelColumn:l=!0,clipUnits:r=!0,maxInternalColumns:m}=e,u=(0,p.useMacrostratUnits)(),d=u[0]?.unit_id;return f(c.LabelTrackerProvider,{units:u,key:d},[f(b,{width:s,unitComponent:n,unitComponentProps:o,showLabels:i,clipUnits:r,maxInternalColumns:m,unconformityLabels:t}),f.if(l)(c.SectionLabelsColumn,{width:a-s})])}function b(e){let{width:t,showLabels:n,unitComponent:i,unitComponentProps:a,clipUnits:s,maxInternalColumns:l,unconformityLabels:r=!0}=e,{sections:c,totalHeight:m}=(0,p.useMacrostratColumnData)(),u=c.map(e=>e.scaleInfo),d=t-2;return f("div.section-units-container",{style:{width:t}},[f(o,{className:"sections",height:m,innerWidth:d,paddingH:1},c.map(e=>{let{units:t,scaleInfo:o,section_id:r}=e;return f(g,{units:t,scaleInfo:o,key:`section-${r}`,unitComponent:i,unitComponentProps:a,showLabels:n,width:d,clipUnits:s,maxInternalColumns:l})})),f.if(r)(x,{width:t,sections:u})])}function g(t){let{units:n,scaleInfo:o,unitComponent:i,showLabels:a=!0,width:s=300,unitComponentProps:l,className:r,clipUnits:m=!0,maxInternalColumns:p}=t,{domain:d,pixelScale:h,pixelHeight:b}=o,g=e(()=>({...l,nColumns:Math.min(p??Math.floor(s/10),l?.nColumns??1/0,Math.max(...n.map(e=>e.column))+1)}),[n,l,p,s]);return f("g.section",{className:r,style:{"--section-height":`${b}px`,"--section-width":`${s}px`},transform:`translate(0 ${o.offset})`},f(u.MacrostratColumnProvider,{units:n,domain:d,pixelScale:h},f(c.CompositeUnitsColumn,{width:s,showLabels:a,unitComponent:i,unitComponentProps:g,clipToFrame:m})))}function C(e){let{sections:t}=(0,p.useMacrostratColumnData)();return f(w,{packages:t.map(e=>e.scaleInfo),...e})}function w(e){let o,{levels:i=3,packages:a,unconformityLabels:s=!1}=e,l=(o="number"==typeof i?[2,Math.max(2+Math.min(i,5)-1,1)]:i)[1]-o[0]+1;return f("div.timescale-column",[f("div.timescales",a.map(e=>{let{domain:i,pixelHeight:a,paddingTop:s,key:r}=e;return f("div.timescale-container",{style:{paddingTop:s,"--timescale-level-count":l},key:r},[f(t,{orientation:n.VERTICAL,length:a,levels:o,absoluteAgeScale:!0,showAgeAxis:!1,ageRange:i})])})),f.if(s)(x,{width:"100%",sections:a,className:"unconformity-labels"})])}function x(e){let{width:t,sections:n,className:o}=e;return f("div.unconformity-labels",{style:{width:t},className:o},n.map((e,o)=>{let i=n[o-1],a=e.offset-e.paddingTop;return f(v,{upperAge:i?.domain[0],lowerAge:e.domain[1],style:{width:t,height:e.paddingTop,top:a}})}))}function v({upperAge:e,lowerAge:t,style:n}){if(null==e||null==t)return null;let o=Math.abs(e-t),i=null;return o>1e3?i="giga":o>100?i="mega":o>10?i="large":o<1&&(i="small"),f("div.unconformity",{style:n,className:i},[f("div.unconformity-text",f(d.Duration,{value:o}))])}export{h as SectionsColumn,x as UnconformityLabels,C as CompositeTimescale,w as CompositeTimescaleCore};
|
|
2
|
+
//# sourceMappingURL=column-views.a7256aa7.js.map
|