@macrostrat/map-interface 1.4.2 → 1.5.0

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +1 -5
  2. package/dist/cjs/index.js +3 -1
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/map-interface.02835ba5.js +46 -0
  5. package/dist/cjs/map-interface.02835ba5.js.map +1 -0
  6. package/dist/cjs/map-interface.0f2392a0.css +64 -0
  7. package/dist/cjs/map-interface.0f2392a0.css.map +1 -0
  8. package/dist/cjs/map-interface.134ad930.js +129 -0
  9. package/dist/cjs/map-interface.134ad930.js.map +1 -0
  10. package/dist/cjs/map-interface.141c7329.js +58 -0
  11. package/dist/cjs/map-interface.141c7329.js.map +1 -0
  12. package/dist/cjs/map-interface.1be58b40.css +69 -0
  13. package/dist/cjs/map-interface.1be58b40.css.map +1 -0
  14. package/dist/cjs/map-interface.29e156db.js +24 -0
  15. package/dist/cjs/map-interface.29e156db.js.map +1 -0
  16. package/dist/cjs/map-interface.2a32a290.js +98 -0
  17. package/dist/cjs/map-interface.2a32a290.js.map +1 -0
  18. package/dist/cjs/map-interface.3eb3ffd1.js +122 -0
  19. package/dist/cjs/map-interface.3eb3ffd1.js.map +1 -0
  20. package/dist/cjs/map-interface.3f968b46.js +381 -0
  21. package/dist/cjs/map-interface.3f968b46.js.map +1 -0
  22. package/dist/cjs/map-interface.4264e7e1.js +73 -0
  23. package/dist/cjs/map-interface.4264e7e1.js.map +1 -0
  24. package/dist/cjs/map-interface.5737346f.js +113 -0
  25. package/dist/cjs/map-interface.5737346f.js.map +1 -0
  26. package/dist/cjs/map-interface.58c87b08.js +29 -0
  27. package/dist/cjs/map-interface.58c87b08.js.map +1 -0
  28. package/dist/cjs/map-interface.71259cf9.css +45 -0
  29. package/dist/cjs/map-interface.71259cf9.css.map +1 -0
  30. package/dist/cjs/map-interface.937c0b90.js +60 -0
  31. package/dist/cjs/map-interface.937c0b90.js.map +1 -0
  32. package/dist/cjs/map-interface.9893b047.js +38 -0
  33. package/dist/cjs/map-interface.9893b047.js.map +1 -0
  34. package/dist/cjs/map-interface.cc9ad5c6.js +194 -0
  35. package/dist/cjs/map-interface.cc9ad5c6.js.map +1 -0
  36. package/dist/cjs/map-interface.d8e62b02.js +17 -0
  37. package/dist/cjs/map-interface.d8e62b02.js.map +1 -0
  38. package/dist/cjs/map-interface.ee59fc6e.js +32 -0
  39. package/dist/cjs/map-interface.ee59fc6e.js.map +1 -0
  40. package/dist/cjs/map-interface.ff2231f5.js +37 -0
  41. package/dist/cjs/map-interface.ff2231f5.js.map +1 -0
  42. package/dist/esm/index.d.ts.map +1 -1
  43. package/dist/esm/index.js +2 -1
  44. package/dist/esm/index.js.map +1 -1
  45. package/dist/esm/map-interface.035e87bf.js +6 -0
  46. package/dist/esm/map-interface.035e87bf.js.map +1 -0
  47. package/dist/esm/map-interface.17a0e9a0.js +51 -0
  48. package/dist/esm/map-interface.17a0e9a0.js.map +1 -0
  49. package/dist/esm/map-interface.2b94a8ad.js +130 -0
  50. package/dist/esm/map-interface.2b94a8ad.js.map +1 -0
  51. package/dist/esm/map-interface.36bab86c.js +31 -0
  52. package/dist/esm/map-interface.36bab86c.js.map +1 -0
  53. package/dist/esm/map-interface.409f6268.js +34 -0
  54. package/dist/esm/map-interface.409f6268.js.map +1 -0
  55. package/dist/esm/map-interface.6c44beb8.js +49 -0
  56. package/dist/esm/map-interface.6c44beb8.js.map +1 -0
  57. package/dist/esm/map-interface.6d7e89e5.js +104 -0
  58. package/dist/esm/map-interface.6d7e89e5.js.map +1 -0
  59. package/dist/esm/map-interface.70fdf48a.js +64 -0
  60. package/dist/esm/map-interface.70fdf48a.js.map +1 -0
  61. package/dist/esm/map-interface.78cdcaeb.js +111 -0
  62. package/dist/esm/map-interface.78cdcaeb.js.map +1 -0
  63. package/dist/esm/map-interface.a0ea0c86.js +18 -0
  64. package/dist/esm/map-interface.a0ea0c86.js.map +1 -0
  65. package/dist/esm/map-interface.b965dc94.js +40 -0
  66. package/dist/esm/map-interface.b965dc94.js.map +1 -0
  67. package/dist/esm/map-interface.ba171178.js +376 -0
  68. package/dist/esm/map-interface.ba171178.js.map +1 -0
  69. package/dist/esm/map-interface.c257cac1.js +188 -0
  70. package/dist/esm/map-interface.c257cac1.js.map +1 -0
  71. package/dist/esm/map-interface.ce6edbfa.js +37 -0
  72. package/dist/esm/map-interface.ce6edbfa.js.map +1 -0
  73. package/dist/esm/map-interface.d86c2fc5.js +32 -0
  74. package/dist/esm/map-interface.d86c2fc5.js.map +1 -0
  75. package/dist/esm/map-interface.f5dccd21.js +92 -0
  76. package/dist/esm/map-interface.f5dccd21.js.map +1 -0
  77. package/dist/node/index.js +1 -1
  78. package/dist/node/index.js.map +1 -1
  79. package/dist/node/map-interface.01fee32b.js +2 -0
  80. package/dist/node/map-interface.01fee32b.js.map +1 -0
  81. package/dist/node/map-interface.0755d245.css +2 -0
  82. package/dist/node/map-interface.0755d245.css.map +1 -0
  83. package/dist/node/map-interface.2c94d421.js +2 -0
  84. package/dist/node/map-interface.2c94d421.js.map +1 -0
  85. package/dist/node/map-interface.42e8f2ba.js +2 -0
  86. package/dist/node/map-interface.42e8f2ba.js.map +1 -0
  87. package/dist/node/map-interface.43014209.js +2 -0
  88. package/dist/node/map-interface.43014209.js.map +1 -0
  89. package/dist/node/map-interface.4e422f5e.js +2 -0
  90. package/dist/node/map-interface.4e422f5e.js.map +1 -0
  91. package/dist/node/map-interface.5f10b499.js +2 -0
  92. package/dist/node/map-interface.5f10b499.js.map +1 -0
  93. package/dist/node/map-interface.791d22a7.css +2 -0
  94. package/dist/node/map-interface.791d22a7.css.map +1 -0
  95. package/dist/node/map-interface.792ebe85.js +2 -0
  96. package/dist/node/map-interface.792ebe85.js.map +1 -0
  97. package/dist/node/map-interface.7963263e.js +2 -0
  98. package/dist/node/map-interface.7963263e.js.map +1 -0
  99. package/dist/node/map-interface.8764423a.js +2 -0
  100. package/dist/node/map-interface.8764423a.js.map +1 -0
  101. package/dist/node/map-interface.bf061b97.js +2 -0
  102. package/dist/node/map-interface.bf061b97.js.map +1 -0
  103. package/dist/node/map-interface.c3275c05.js +2 -0
  104. package/dist/node/map-interface.c3275c05.js.map +1 -0
  105. package/dist/node/map-interface.ca6e8916.js +2 -0
  106. package/dist/node/map-interface.ca6e8916.js.map +1 -0
  107. package/dist/node/map-interface.d430c066.css +2 -0
  108. package/dist/node/map-interface.d430c066.css.map +1 -0
  109. package/dist/node/map-interface.dd613f56.js +2 -0
  110. package/dist/node/map-interface.dd613f56.js.map +1 -0
  111. package/dist/node/map-interface.ecfe462b.js +2 -0
  112. package/dist/node/map-interface.ecfe462b.js.map +1 -0
  113. package/dist/node/map-interface.efc5dd17.js +2 -0
  114. package/dist/node/map-interface.efc5dd17.js.map +1 -0
  115. package/dist/node/map-interface.f42969c3.js +2 -0
  116. package/dist/node/map-interface.f42969c3.js.map +1 -0
  117. package/package.json +6 -1
  118. package/src/index.ts +1 -1
@@ -0,0 +1,122 @@
1
+ var $8569970142f4fcfc$exports = require("./map-interface.3f968b46.js");
2
+ var $f71abc758f4a75a8$exports = require("./map-interface.02835ba5.js");
3
+ require("./map-interface.1be58b40.css");
4
+ var $f2e0b9e87d965c31$exports = require("./map-interface.9893b047.js");
5
+ var $cfd1234d8b0afe66$exports = require("./map-interface.ff2231f5.js");
6
+ var $b951c9e8f692a209$exports = require("./map-interface.5737346f.js");
7
+ var $d3d9e7b5fce766d0$exports = require("./map-interface.937c0b90.js");
8
+ var $kNr5S$macrostrathyper = require("@macrostrat/hyper");
9
+ var $kNr5S$macrostratmapinterface = require("@macrostrat/map-interface");
10
+ var $kNr5S$macrostratuicomponents = require("@macrostrat/ui-components");
11
+
12
+
13
+ function $parcel$interopDefault(a) {
14
+ return a && a.__esModule ? a.default : a;
15
+ }
16
+
17
+ function $parcel$defineInteropFlag(a) {
18
+ Object.defineProperty(a, '__esModule', {value: true, configurable: true});
19
+ }
20
+
21
+ function $parcel$export(e, n, v, s) {
22
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
23
+ }
24
+
25
+ $parcel$defineInteropFlag(module.exports);
26
+
27
+ $parcel$export(module.exports, "default", () => $31b5775c3898b308$export$2e2bcd8739ae039);
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ // import { apiV2Prefix, gddDomain } from "@macrostrat-web/settings";
38
+ const $31b5775c3898b308$var$apiV2Prefix = `https://dev.macrostrat.org/api/v2`;
39
+ const $31b5775c3898b308$var$gddDomain = `https://xdd.wisc.edu`;
40
+ const $31b5775c3898b308$var$h = (0, ($parcel$interopDefault($kNr5S$macrostrathyper))).styled((0, ($parcel$interopDefault($f2e0b9e87d965c31$exports))));
41
+ function $31b5775c3898b308$var$InfoDrawer(props) {
42
+ const { className: className, position: position, zoom: zoom, setSelectedLocation: setSelectedLocation, children: children = null } = props;
43
+ const { lat: lat, lng: lng } = position;
44
+ const mapInfo = $31b5775c3898b308$var$fetchMapInfo(lng, lat, zoom);
45
+ const columnInfo = $31b5775c3898b308$var$fetchColumnInfo(lng, lat);
46
+ const xddInfo = $31b5775c3898b308$var$fetchXddInfo(mapInfo?.mapData?.[0]?.macrostrat?.strat_names);
47
+ const fetchingMapInfo = mapInfo == null;
48
+ return $31b5775c3898b308$var$h((0, $kNr5S$macrostratmapinterface.LocationPanel), {
49
+ className: className,
50
+ position: position,
51
+ elevation: mapInfo?.elevation,
52
+ zoom: zoom,
53
+ onClose: ()=>setSelectedLocation(null),
54
+ loading: mapInfo == null,
55
+ showCopyPositionButton: true,
56
+ contentContainer: "div.infodrawer-content-holder"
57
+ }, [
58
+ $31b5775c3898b308$var$h((0, $cfd1234d8b0afe66$exports.LoadingArea), {
59
+ loaded: !fetchingMapInfo,
60
+ className: "infodrawer-content"
61
+ }, $31b5775c3898b308$var$h.if(!fetchingMapInfo)($31b5775c3898b308$var$InfoDrawerMainPanel, {
62
+ mapInfo: mapInfo,
63
+ columnInfo: columnInfo,
64
+ xddInfo: xddInfo
65
+ })),
66
+ children
67
+ ]);
68
+ }
69
+ function $31b5775c3898b308$var$InfoDrawerMainPanel({ mapInfo: mapInfo, columnInfo: columnInfo, xddInfo: xddInfo }) {
70
+ if (!mapInfo || !mapInfo.mapData) return null;
71
+ let source = mapInfo && mapInfo.mapData && mapInfo.mapData.length ? mapInfo.mapData[0] : {
72
+ name: null,
73
+ descrip: null,
74
+ comments: null,
75
+ liths: [],
76
+ b_int: {},
77
+ t_int: {},
78
+ ref: {}
79
+ };
80
+ return $31b5775c3898b308$var$h([
81
+ $31b5775c3898b308$var$h((0, $b951c9e8f692a209$exports.RegionalStratigraphy), {
82
+ mapInfo: mapInfo,
83
+ columnInfo: columnInfo
84
+ }),
85
+ // h(FossilCollections, { data: pbdbData, expanded: true }),
86
+ $31b5775c3898b308$var$h((0, $8569970142f4fcfc$exports.MacrostratLinkedData), {
87
+ mapInfo: mapInfo,
88
+ bedrockMatchExpanded: true,
89
+ source: source
90
+ }),
91
+ $31b5775c3898b308$var$h.if(xddInfo)((0, $d3d9e7b5fce766d0$exports.XddExpansion), {
92
+ xddInfo: xddInfo
93
+ }),
94
+ $31b5775c3898b308$var$h((0, $f71abc758f4a75a8$exports.Physiography), {
95
+ mapInfo: mapInfo
96
+ })
97
+ ]);
98
+ }
99
+ var $31b5775c3898b308$export$2e2bcd8739ae039 = $31b5775c3898b308$var$InfoDrawer;
100
+ function $31b5775c3898b308$var$fetchMapInfo(lng, lat, z) {
101
+ return (0, $kNr5S$macrostratuicomponents.useAPIResult)(`${$31b5775c3898b308$var$apiV2Prefix}/mobile/map_query_v2`, {
102
+ lng: lng,
103
+ lat: lat,
104
+ z: z
105
+ })?.success?.data;
106
+ }
107
+ function $31b5775c3898b308$var$fetchColumnInfo(lng, lat) {
108
+ return (0, $kNr5S$macrostratuicomponents.useAPIResult)(`${$31b5775c3898b308$var$apiV2Prefix}/columns`, {
109
+ lat: lat,
110
+ lng: lng,
111
+ response: "long"
112
+ })?.success?.data?.[0];
113
+ }
114
+ function $31b5775c3898b308$var$fetchXddInfo(stratNames) {
115
+ return (0, $kNr5S$macrostratuicomponents.useAPIResult)(`${$31b5775c3898b308$var$gddDomain}/api/v1/snippets`, {
116
+ article_limit: 20,
117
+ term: stratNames?.map((d)=>d.rank_name).join(",")
118
+ })?.success?.data;
119
+ }
120
+
121
+
122
+ //# sourceMappingURL=map-interface.3eb3ffd1.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,qEAAqE;AACrE,MAAM,oCAAc,CAAC,iCAAiC,CAAC;AACvD,MAAM,kCAAY,CAAC,oBAAoB,CAAC;AAExC,MAAM,0BAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,mDAAK;AAE5B,SAAS,iCAAW,KAAK;IACvB,MAAM,aACJ,SAAS,YACT,QAAQ,QACR,IAAI,uBACJ,mBAAmB,YACnB,WAAW,MACZ,GAAG;IAEJ,MAAM,OAAE,GAAG,OAAE,GAAG,EAAE,GAAG;IAErB,MAAM,UAAU,mCAAa,KAAK,KAAK;IACvC,MAAM,aAAa,sCAAgB,KAAK;IACxC,MAAM,UAAU,mCAAa,SAAS,SAAS,CAAC,EAAE,EAAE,YAAY;IAEhE,MAAM,kBAAkB,WAAW;IAEnC,OAAO,wBACL,CAAA,GAAA,2CAAY,GACZ;mBACE;kBACA;QACA,WAAW,SAAS;cACpB;QACA,SAAS,IAAM,oBAAoB;QACnC,SAAS,WAAW;QACpB,wBAAwB;QACxB,kBAAkB;IACpB,GACA;QACE,wBACE,CAAA,GAAA,qCAAU,GACV;YAAE,QAAQ,CAAC;YAAiB,WAAW;QAAqB,GAC5D,wBAAE,EAAE,CAAC,CAAC,iBAAiB,2CAAqB;qBAC1C;wBACA;qBACA;QACF;QAEF;KACD;AAEL;AAEA,SAAS,0CAAoB,WAAE,OAAO,cAAE,UAAU,WAAE,OAAO,EAAE;IAC3D,IAAI,CAAC,WAAW,CAAC,QAAQ,OAAO,EAC9B,OAAO;IAGT,IAAI,SACF,WAAW,QAAQ,OAAO,IAAI,QAAQ,OAAO,CAAC,MAAM,GAChD,QAAQ,OAAO,CAAC,EAAE,GAClB;QACE,MAAM;QACN,SAAS;QACT,UAAU;QACV,OAAO,EAAE;QACT,OAAO,CAAC;QACR,OAAO,CAAC;QACR,KAAK,CAAC;IACR;IAEN,OAAO,wBAAE;QACP,wBAAE,CAAA,GAAA,8CAAmB,GAAG;qBACtB;wBACA;QACF;QACA,4DAA4D;QAC5D,wBAAE,CAAA,GAAA,8CAAmB,GAAG;qBACtB;YACA,sBAAsB;oBACtB;QACF;QACA,wBAAE,EAAE,CAAC,SAAS,CAAA,GAAA,sCAAW,GAAG;qBAAE;QAAQ;QACtC,wBAAE,CAAA,GAAA,sCAAW,GAAG;qBAAE;QAAQ;KAC3B;AACH;IAEA,2CAAe;AAEf,SAAS,mCAAa,GAAG,EAAE,GAAG,EAAE,CAAC;IAC/B,OAAO,CAAA,GAAA,0CAAW,EAAE,GAAG,kCAAY,oBAAoB,CAAC,EAAE;aACxD;aACA;WACA;IACF,IAAI,SAAS;AACf;AAEA,SAAS,sCAAgB,GAAG,EAAE,GAAG;IAC/B,OAAO,CAAA,GAAA,0CAAW,EAAE,GAAG,kCAAY,QAAQ,CAAC,EAAE;aAC5C;aACA;QACA,UAAU;IACZ,IAAI,SAAS,MAAM,CAAC,EAAE;AACxB;AAEA,SAAS,mCAAa,UAAU;IAC9B,OAAO,CAAA,GAAA,0CAAW,EAAE,GAAG,gCAAU,gBAAgB,CAAC,EAAE;QAClD,eAAe;QACf,MAAM,YAAY,IAAI,CAAC,IAAM,EAAE,SAAS,EAAE,KAAK;IACjD,IAAI,SAAS;AACf","sources":["packages/map-interface/src/map-panel/components/info-drawer/index.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport { LocationPanel } from \"@macrostrat/map-interface\";\nimport { MacrostratLinkedData } from \"./macrostrat-linked\";\nimport { Physiography } from \"./physiography\";\nimport styles from \"./main.module.styl\";\nimport { LoadingArea } from \"../transitions\";\nimport { RegionalStratigraphy } from \"./reg-strat\";\nimport { XddExpansion } from \"./xdd-panel\";\nimport { useAPIResult } from \"@macrostrat/ui-components\";\n// import { apiV2Prefix, gddDomain } from \"@macrostrat-web/settings\";\nconst apiV2Prefix = `https://dev.macrostrat.org/api/v2`;\nconst gddDomain = `https://xdd.wisc.edu`;\n\nconst h = hyper.styled(styles);\n\nfunction InfoDrawer(props) {\n const {\n className,\n position,\n zoom,\n setSelectedLocation,\n children = null,\n } = props;\n\n const { lat, lng } = position;\n\n const mapInfo = fetchMapInfo(lng, lat, zoom);\n const columnInfo = fetchColumnInfo(lng, lat);\n const xddInfo = fetchXddInfo(mapInfo?.mapData?.[0]?.macrostrat?.strat_names);\n\n const fetchingMapInfo = mapInfo == null;\n\n return h(\n LocationPanel,\n {\n className,\n position,\n elevation: mapInfo?.elevation,\n zoom,\n onClose: () => setSelectedLocation(null),\n loading: mapInfo == null,\n showCopyPositionButton: true,\n contentContainer: \"div.infodrawer-content-holder\",\n },\n [\n h(\n LoadingArea,\n { loaded: !fetchingMapInfo, className: \"infodrawer-content\" },\n h.if(!fetchingMapInfo)(InfoDrawerMainPanel, {\n mapInfo,\n columnInfo,\n xddInfo,\n }),\n ),\n children,\n ],\n );\n}\n\nfunction InfoDrawerMainPanel({ mapInfo, columnInfo, xddInfo }) {\n if (!mapInfo || !mapInfo.mapData) {\n return null;\n }\n\n let source =\n mapInfo && mapInfo.mapData && mapInfo.mapData.length\n ? mapInfo.mapData[0]\n : {\n name: null,\n descrip: null,\n comments: null,\n liths: [],\n b_int: {},\n t_int: {},\n ref: {},\n };\n\n return h([\n h(RegionalStratigraphy, {\n mapInfo,\n columnInfo,\n }),\n // h(FossilCollections, { data: pbdbData, expanded: true }),\n h(MacrostratLinkedData, {\n mapInfo,\n bedrockMatchExpanded: true,\n source,\n }),\n h.if(xddInfo)(XddExpansion, { xddInfo }),\n h(Physiography, { mapInfo }),\n ]);\n}\n\nexport default InfoDrawer;\n\nfunction fetchMapInfo(lng, lat, z) {\n return useAPIResult(`${apiV2Prefix}/mobile/map_query_v2`, {\n lng,\n lat,\n z,\n })?.success?.data;\n}\n\nfunction fetchColumnInfo(lng, lat) {\n return useAPIResult(`${apiV2Prefix}/columns`, {\n lat,\n lng,\n response: \"long\",\n })?.success?.data?.[0];\n}\n\nfunction fetchXddInfo(stratNames) {\n return useAPIResult(`${gddDomain}/api/v1/snippets`, {\n article_limit: 20,\n term: stratNames?.map((d) => d.rank_name).join(\",\"),\n })?.success?.data;\n}\n"],"names":[],"version":3,"file":"map-interface.3eb3ffd1.js.map"}
@@ -0,0 +1,381 @@
1
+ var $dd32e7ae54443412$exports = require("./map-interface.2a32a290.js");
2
+ require("./map-interface.1be58b40.css");
3
+ var $f2e0b9e87d965c31$exports = require("./map-interface.9893b047.js");
4
+ var $7j411$macrostrathyper = require("@macrostrat/hyper");
5
+ var $7j411$macrostratmapinterface = require("@macrostrat/map-interface");
6
+ var $7j411$visxscale = require("@visx/scale");
7
+ var $7j411$visxaxis = require("@visx/axis");
8
+ var $7j411$chromajs = require("chroma-js");
9
+ var $7j411$macrostratdatacomponents = require("@macrostrat/data-components");
10
+
11
+
12
+ function $parcel$interopDefault(a) {
13
+ return a && a.__esModule ? a.default : a;
14
+ }
15
+
16
+ function $parcel$export(e, n, v, s) {
17
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
18
+ }
19
+
20
+ $parcel$export(module.exports, "MacrostratLinkedData", () => $8569970142f4fcfc$export$fa9d8c2f420ac2bd);
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+ const $8569970142f4fcfc$var$h = (0, ($parcel$interopDefault($7j411$macrostrathyper))).styled((0, ($parcel$interopDefault($f2e0b9e87d965c31$exports))));
30
+ function $8569970142f4fcfc$export$fa9d8c2f420ac2bd(props) {
31
+ const { mapInfo: mapInfo, bedrockMatchExpanded: bedrockMatchExpanded, source: source } = props;
32
+ if (!mapInfo.mapData[0]) return $8569970142f4fcfc$var$h("div");
33
+ return $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpansionPanel), {
34
+ className: "regional-panel",
35
+ title: "Macrostrat-linked data",
36
+ helpText: "via Macrostrat",
37
+ expanded: bedrockMatchExpanded
38
+ }, [
39
+ $8569970142f4fcfc$var$h("div", {
40
+ classes: $8569970142f4fcfc$var$expansionPanelDetailClasses
41
+ }, [
42
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$MatchBasis, {
43
+ source: source
44
+ }),
45
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$AgeInformation, {
46
+ mapInfo: mapInfo,
47
+ source: source
48
+ }),
49
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$Thickness, {
50
+ source: source
51
+ }),
52
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$MinorFossilCollections, {
53
+ source: source
54
+ }),
55
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$FossilOccs, {
56
+ source: source
57
+ }),
58
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$LithsAndClasses, {
59
+ source: source
60
+ }),
61
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$Environments, {
62
+ source: source
63
+ }),
64
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$Economy, {
65
+ source: source
66
+ })
67
+ ])
68
+ ]);
69
+ }
70
+ const $8569970142f4fcfc$var$expansionPanelDetailClasses = {
71
+ root: "expansion-panel-detail"
72
+ };
73
+ function $8569970142f4fcfc$var$AgeInformation(props) {
74
+ const { source: source, mapInfo: mapInfo } = props;
75
+ const { macrostrat: macrostrat } = source;
76
+ if (!macrostrat?.b_age) return $8569970142f4fcfc$var$h($8569970142f4fcfc$var$MapAgeRenderer, {
77
+ mapInfo: mapInfo
78
+ });
79
+ return $8569970142f4fcfc$var$h($8569970142f4fcfc$var$MacrostratAgeInfo, {
80
+ macrostrat: macrostrat,
81
+ mapInfo: mapInfo
82
+ });
83
+ }
84
+ function $8569970142f4fcfc$var$MapAgeRenderer(props) {
85
+ const { mapInfo: mapInfo, ...rest } = props;
86
+ return $8569970142f4fcfc$var$h($8569970142f4fcfc$var$DescribedAgeInfo, {
87
+ ageElement: $8569970142f4fcfc$var$h((0, $dd32e7ae54443412$exports.AgeChip), {
88
+ b_int: mapInfo.mapData[0].b_int,
89
+ t_int: mapInfo.mapData[0].t_int
90
+ })
91
+ }, "Based on geologic map description.");
92
+ }
93
+ function $8569970142f4fcfc$var$DescribedAgeInfo(props) {
94
+ const { ageElement: ageElement, children: children, className: className } = props;
95
+ return $8569970142f4fcfc$var$h("div.described-age.macrostrast-detail", [
96
+ $8569970142f4fcfc$var$h("div.expansion-summary-title", "Age"),
97
+ $8569970142f4fcfc$var$h("div.age-chips", null, ageElement),
98
+ $8569970142f4fcfc$var$h("div.description", children)
99
+ ]);
100
+ }
101
+ function $8569970142f4fcfc$var$AgeRefinementBar({ scale: scale, data: data, color: color, label: label = null }) {
102
+ const { b_int: b_int, t_int: t_int } = data;
103
+ const b_age = data.b_age ?? b_int.b_age;
104
+ const t_age = data.t_age ?? t_int.t_age;
105
+ const backgroundColor = color ?? b_int.color;
106
+ const accentColor = (0, ($parcel$interopDefault($7j411$chromajs)))(backgroundColor).darken(0.5).hex();
107
+ const labelColor = (0, ($parcel$interopDefault($7j411$chromajs)))(backgroundColor).darken(2).hex();
108
+ const left = scale(b_age);
109
+ const width = scale(t_age) - scale(b_age);
110
+ let labelTranslate = 5;
111
+ let textAlign = "start";
112
+ // Adjust label placement
113
+ if (width < 100) {
114
+ if (left < 100) labelTranslate = width + 5;
115
+ else {
116
+ labelTranslate = -305;
117
+ textAlign = "end";
118
+ }
119
+ }
120
+ return $8569970142f4fcfc$var$h("div.age-refinement-bar", {
121
+ style: {
122
+ marginLeft: `${left}px`,
123
+ width: `${width}px`,
124
+ height: "18px",
125
+ backgroundColor: backgroundColor,
126
+ border: `2px solid ${accentColor}`,
127
+ position: "relative"
128
+ }
129
+ }, $8569970142f4fcfc$var$h("div.age-refinement-bar-label", {
130
+ style: {
131
+ transform: `translateX(${labelTranslate}px)`,
132
+ color: labelColor,
133
+ fontSize: "10px",
134
+ width: 300,
135
+ textAlign: textAlign
136
+ }
137
+ }, label));
138
+ }
139
+ function $8569970142f4fcfc$var$AgeRefinementPlot({ macrostrat: macrostrat, mapInfo: mapInfo }) {
140
+ // Plot the amount by which the age was refined
141
+ const mapData = mapInfo.mapData[0];
142
+ const b_age = Math.max(mapData.b_int.b_age, macrostrat.b_age);
143
+ const t_age = Math.min(mapData.t_int.t_age, macrostrat.t_age);
144
+ const scale = (0, $7j411$visxscale.scaleLinear)({
145
+ domain: [
146
+ 1.02 * b_age,
147
+ t_age * 0.98
148
+ ],
149
+ range: [
150
+ 20,
151
+ 360
152
+ ]
153
+ });
154
+ // use visx to plot the age refinement
155
+ return $8569970142f4fcfc$var$h("div.age-refinement-plot", [
156
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$AgeRefinementBar, {
157
+ scale: scale,
158
+ data: macrostrat,
159
+ label: "Macrostrat age model"
160
+ }),
161
+ $8569970142f4fcfc$var$h($8569970142f4fcfc$var$AgeRefinementBar, {
162
+ scale: scale,
163
+ data: mapData,
164
+ label: "Map legend"
165
+ }),
166
+ // Age axis
167
+ $8569970142f4fcfc$var$h("svg", {
168
+ width: "100%",
169
+ height: "40px"
170
+ }, [
171
+ $8569970142f4fcfc$var$h((0, $7j411$visxaxis.AxisBottom), {
172
+ scale: scale,
173
+ numTicks: 5,
174
+ top: 1,
175
+ left: 0,
176
+ label: "Age (Ma)"
177
+ })
178
+ ])
179
+ ]);
180
+ }
181
+ function $8569970142f4fcfc$var$MacrostratAgeInfoCore({ macrostrat: macrostrat }) {
182
+ const { b_age: b_age, t_age: t_age, b_int: b_int, t_int: t_int } = macrostrat;
183
+ if (!b_age) return null;
184
+ let age = b_int.int_name;
185
+ if (b_int.int_id !== t_int.int_id) age += ` - ${t_int.int_name}`;
186
+ return $8569970142f4fcfc$var$h($8569970142f4fcfc$var$DescribedAgeInfo, {
187
+ ageElement: $8569970142f4fcfc$var$h((0, $dd32e7ae54443412$exports.AgeChip), {
188
+ b_int: {
189
+ ...b_int,
190
+ int_name: age,
191
+ b_age: b_age,
192
+ t_age: t_age
193
+ },
194
+ t_int: {
195
+ ...b_int,
196
+ int_name: age,
197
+ b_age: b_age,
198
+ t_age: t_age
199
+ }
200
+ })
201
+ }, "Refined using the Macrostrat age model.");
202
+ }
203
+ function $8569970142f4fcfc$var$MacrostratAgeInfo(props) {
204
+ return $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpandableDetailsPanel), {
205
+ headerElement: $8569970142f4fcfc$var$h($8569970142f4fcfc$var$MacrostratAgeInfoCore, props)
206
+ }, $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpansionBody), {
207
+ title: "Age refinement"
208
+ }, $8569970142f4fcfc$var$h($8569970142f4fcfc$var$AgeRefinementPlot, props)));
209
+ }
210
+ function $8569970142f4fcfc$var$MatchBasis(props) {
211
+ const { source: source } = props;
212
+ if (!source.macrostrat?.strat_names) return null;
213
+ return $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpandableDetailsPanel), {
214
+ className: "macrostrat-unit",
215
+ headerElement: $8569970142f4fcfc$var$h([
216
+ $8569970142f4fcfc$var$h("h3", source.macrostrat.strat_names[0].rank_name),
217
+ $8569970142f4fcfc$var$h("div.description", "Matched stratigraphic unit")
218
+ ])
219
+ }, $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpansionBody), {
220
+ title: "All matched names"
221
+ }, [
222
+ source.macrostrat.strat_names.map((name, i)=>{
223
+ let lastElement = i == source.macrostrat.strat_names.length - 1;
224
+ return $8569970142f4fcfc$var$h("span", {
225
+ key: i
226
+ }, [
227
+ $8569970142f4fcfc$var$h("a.externalLink", {
228
+ href: "/lex/strat-names/" + name.strat_name_id,
229
+ key: i
230
+ }, [
231
+ name.rank_name
232
+ ]),
233
+ $8569970142f4fcfc$var$h.if(!lastElement)([
234
+ ", "
235
+ ])
236
+ ]);
237
+ })
238
+ ]));
239
+ }
240
+ function $8569970142f4fcfc$var$Thickness(props) {
241
+ const { source: source } = props;
242
+ if (!source.macrostrat.max_thick) return $8569970142f4fcfc$var$h("div");
243
+ return $8569970142f4fcfc$var$h.if(source.macrostrat && source.macrostrat.max_thick)("div.macrostrat-detail", [
244
+ $8569970142f4fcfc$var$h("div.expansion-summary-title", "Thickness"),
245
+ $8569970142f4fcfc$var$h("div", [
246
+ source.macrostrat.min_min_thick,
247
+ " - ",
248
+ source.macrostrat.max_thick,
249
+ "m"
250
+ ])
251
+ ]);
252
+ }
253
+ function $8569970142f4fcfc$var$MinorFossilCollections(props) {
254
+ const { source: source } = props;
255
+ const { macrostrat: macrostrat } = source;
256
+ if (!macrostrat.pbdb_collections) return $8569970142f4fcfc$var$h("div");
257
+ return $8569970142f4fcfc$var$h.if(macrostrat && macrostrat.pbdb_collections)("div.macrostrat-detail", [
258
+ $8569970142f4fcfc$var$h("div.expansion-summary-title", "Fossil collections"),
259
+ $8569970142f4fcfc$var$h("div", [
260
+ macrostrat.pbdb_collections
261
+ ])
262
+ ]);
263
+ }
264
+ function $8569970142f4fcfc$var$FossilOccs(props) {
265
+ const { source: source } = props;
266
+ const { macrostrat: macrostrat } = source;
267
+ if (!macrostrat?.pbdb_occs) return null;
268
+ return $8569970142f4fcfc$var$h("div.macrostrat-detail", [
269
+ $8569970142f4fcfc$var$h("div.expansion-summary-title", "Fossil occurrences"),
270
+ $8569970142f4fcfc$var$h("div", [
271
+ macrostrat.pbdb_occs
272
+ ])
273
+ ]);
274
+ }
275
+ function $8569970142f4fcfc$var$LithTypes(props) {
276
+ const { lith_types: lith_types } = props;
277
+ return $8569970142f4fcfc$var$h.if(lith_types && lith_types.length > 0)("div.lithologies.lithology-types", [
278
+ $8569970142f4fcfc$var$h((0, $7j411$macrostratdatacomponents.LithologyList), {
279
+ lithologies: lith_types
280
+ })
281
+ ]);
282
+ }
283
+ function $8569970142f4fcfc$var$LithsAndClasses(props) {
284
+ const { source: source } = props;
285
+ const { macrostrat: macrostrat } = source;
286
+ const { liths: liths = null, lith_types: lith_types = null } = macrostrat;
287
+ if (!liths || liths.length == 0) return null;
288
+ const lithologies = liths.map((lith)=>{
289
+ return {
290
+ ...lith,
291
+ name: lith.lith,
292
+ color: lith.color || "#000000"
293
+ };
294
+ });
295
+ return $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpandableDetailsPanel), {
296
+ title: "Lithology",
297
+ value: $8569970142f4fcfc$var$h($8569970142f4fcfc$var$LithTypes, {
298
+ lith_types: lith_types
299
+ })
300
+ }, $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpansionBody), {
301
+ title: "Matched lithologies"
302
+ }, [
303
+ $8569970142f4fcfc$var$h((0, $7j411$macrostratdatacomponents.LithologyList), {
304
+ lithologies: lithologies,
305
+ onClickItem: (e, lith)=>{
306
+ window.open("/lex/lithology/" + lith.lith_id, "_self");
307
+ }
308
+ })
309
+ ]));
310
+ }
311
+ function $8569970142f4fcfc$var$EnvironTypes(props) {
312
+ const { environ_types: environ_types } = props;
313
+ return $8569970142f4fcfc$var$h.if(environ_types && environ_types.length > 0)((0, $7j411$macrostratdatacomponents.LithologyList), {
314
+ lithologies: environ_types?.filter((e)=>e.name != "")
315
+ });
316
+ }
317
+ function $8569970142f4fcfc$var$Environments(props) {
318
+ const { source: source } = props;
319
+ const { macrostrat: macrostrat } = source;
320
+ const { environs: environs = null, environ_types: environ_types = null } = macrostrat;
321
+ if (!environs || environs.length == 0) return null;
322
+ const lithologies = environs.map((environ)=>{
323
+ return {
324
+ ...environ,
325
+ name: environ.environ,
326
+ color: environ.color || "#000000"
327
+ };
328
+ });
329
+ return $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpandableDetailsPanel), {
330
+ title: "Environment",
331
+ value: $8569970142f4fcfc$var$h($8569970142f4fcfc$var$EnvironTypes, {
332
+ environ_types: environ_types
333
+ })
334
+ }, $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpansionBody), {
335
+ title: "Matched environments"
336
+ }, [
337
+ $8569970142f4fcfc$var$h((0, $7j411$macrostratdatacomponents.LithologyList), {
338
+ lithologies: lithologies,
339
+ onClickItem: (e, environ)=>{
340
+ window.open("/lex/environments/" + environ.environ_id, "_self");
341
+ }
342
+ })
343
+ ]));
344
+ }
345
+ function $8569970142f4fcfc$var$EconType(props) {
346
+ const { econ_types: econ_types } = props;
347
+ return $8569970142f4fcfc$var$h.if(econ_types && econ_types.length > 0)("div", [
348
+ econ_types.map((econClass, i)=>{
349
+ return $8569970142f4fcfc$var$h((0, $dd32e7ae54443412$exports.AttrChip), {
350
+ key: i,
351
+ name: econClass.name,
352
+ color: econClass.color
353
+ });
354
+ })
355
+ ]);
356
+ }
357
+ function $8569970142f4fcfc$var$Economy(props) {
358
+ const { source: source } = props;
359
+ const { macrostrat: macrostrat } = source;
360
+ const { econs: econs = null, econ_types: econ_types = null } = macrostrat;
361
+ if (!econs) return $8569970142f4fcfc$var$h("div");
362
+ return $8569970142f4fcfc$var$h.if(econs && econs.length > 0)((0, $7j411$macrostratmapinterface.ExpandableDetailsPanel), {
363
+ title: "Economy ",
364
+ value: $8569970142f4fcfc$var$h($8569970142f4fcfc$var$EconType, {
365
+ econ_types: econ_types
366
+ })
367
+ }, $8569970142f4fcfc$var$h((0, $7j411$macrostratmapinterface.ExpansionBody), {
368
+ title: "Matched economic attributes"
369
+ }, [
370
+ econs.map((econ, i)=>{
371
+ return $8569970142f4fcfc$var$h((0, $dd32e7ae54443412$exports.AttrChip), {
372
+ key: i,
373
+ name: econ.econ,
374
+ color: econ.color
375
+ });
376
+ })
377
+ ]));
378
+ }
379
+
380
+
381
+ //# sourceMappingURL=map-interface.3f968b46.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;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E,MAAM,EAAE,GAAG;IACnB,MAAM,cAAE,UAAU,EAAE,GAAG;IACvB,MAAM,SAAE,QAAQ,kBAAM,aAAa,MAAM,GAAG;IAC5C,IAAI,CAAC,OAAO,OAAO,wBAAE;IAErB,OAAO,wBAAE,EAAE,CAAC,SAAS,MAAM,MAAM,GAAG,GAClC,CAAA,GAAA,oDAAqB,GACrB;QACE,OAAO;QACP,OAAO,wBAAE,gCAAU;wBAAE;QAAW;IAClC,GACA,wBAAE,CAAA,GAAA,2CAAY,GAAG;QAAE,OAAO;IAA8B,GAAG;QACzD,MAAM,GAAG,CAAC,CAAC,MAAM;YACf,OAAO,wBAAE,CAAA,GAAA,kCAAO,GAAG;gBACjB,KAAK;gBACL,MAAM,KAAK,IAAI;gBACf,OAAO,KAAK,KAAK;YACnB;QACF;KACD;AAEL","sources":["packages/map-interface/src/map-panel/components/info-drawer/macrostrat-linked.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport { AgeChip, AttrChip } from \"../info-blocks\";\nimport {\n ExpansionPanel,\n ExpandableDetailsPanel,\n ExpansionBody,\n} from \"@macrostrat/map-interface\";\nimport styles from \"./main.module.styl\";\nimport { scaleLinear } from \"@visx/scale\";\nimport { AxisBottom } from \"@visx/axis\";\nimport chroma from \"chroma-js\";\nimport { LithologyList } from \"@macrostrat/data-components\";\n\nconst h = hyper.styled(styles);\n\nfunction MacrostratLinkedData(props) {\n const { mapInfo, bedrockMatchExpanded, source } = props;\n\n if (!mapInfo.mapData[0]) return h(\"div\");\n\n return h(\n ExpansionPanel,\n {\n className: \"regional-panel\",\n title: \"Macrostrat-linked data\",\n helpText: \"via Macrostrat\",\n expanded: bedrockMatchExpanded,\n },\n [\n h(\"div\", { classes: expansionPanelDetailClasses }, [\n h(MatchBasis, { source }),\n h(AgeInformation, { mapInfo, source }),\n h(Thickness, { source }),\n h(MinorFossilCollections, { source }),\n h(FossilOccs, { source }),\n h(LithsAndClasses, { source }),\n h(Environments, { source }),\n h(Economy, { source }),\n ]),\n ],\n );\n}\n\nconst expansionPanelDetailClasses = {\n root: \"expansion-panel-detail\",\n};\n\nfunction AgeInformation(props) {\n const { source, mapInfo } = props;\n const { macrostrat } = source;\n\n if (!macrostrat?.b_age) return h(MapAgeRenderer, { mapInfo });\n\n return h(MacrostratAgeInfo, { macrostrat, mapInfo });\n}\n\nfunction MapAgeRenderer(props) {\n const { mapInfo, ...rest } = props;\n return h(\n DescribedAgeInfo,\n {\n ageElement: h(AgeChip, {\n b_int: mapInfo.mapData[0].b_int,\n t_int: mapInfo.mapData[0].t_int,\n }),\n },\n \"Based on geologic map description.\",\n );\n}\n\nfunction DescribedAgeInfo(props) {\n const { ageElement, children, className } = props;\n\n return h(\"div.described-age.macrostrast-detail\", [\n h(\"div.expansion-summary-title\", \"Age\"),\n h(\"div.age-chips\", null, ageElement),\n h(\"div.description\", children),\n ]);\n}\n\nfunction AgeRefinementBar({ scale, data, color, label = null }) {\n const { b_int, t_int } = data;\n const b_age = data.b_age ?? b_int.b_age;\n const t_age = data.t_age ?? t_int.t_age;\n const backgroundColor = color ?? b_int.color;\n const accentColor = chroma(backgroundColor).darken(0.5).hex();\n const labelColor = chroma(backgroundColor).darken(2).hex();\n\n const left = scale(b_age);\n const width = scale(t_age) - scale(b_age);\n\n let labelTranslate = 5;\n let textAlign = \"start\";\n\n // Adjust label placement\n\n if (width < 100) {\n if (left < 100) {\n labelTranslate = width + 5;\n } else {\n labelTranslate = -305;\n textAlign = \"end\";\n }\n }\n\n return h(\n \"div.age-refinement-bar\",\n {\n style: {\n marginLeft: `${left}px`,\n width: `${width}px`,\n height: \"18px\",\n backgroundColor,\n border: `2px solid ${accentColor}`,\n position: \"relative\",\n },\n },\n h(\n \"div.age-refinement-bar-label\",\n {\n style: {\n transform: `translateX(${labelTranslate}px)`,\n color: labelColor,\n fontSize: \"10px\",\n width: 300,\n textAlign,\n },\n },\n label,\n ),\n );\n}\n\nfunction AgeRefinementPlot({ macrostrat, mapInfo }) {\n // Plot the amount by which the age was refined\n\n const mapData = mapInfo.mapData[0];\n const b_age = Math.max(mapData.b_int.b_age, macrostrat.b_age);\n const t_age = Math.min(mapData.t_int.t_age, macrostrat.t_age);\n\n const scale = scaleLinear({\n domain: [1.02 * b_age, t_age * 0.98],\n range: [20, 360],\n });\n\n // use visx to plot the age refinement\n return h(\"div.age-refinement-plot\", [\n h(AgeRefinementBar, {\n scale,\n data: macrostrat,\n label: \"Macrostrat age model\",\n }),\n h(AgeRefinementBar, {\n scale,\n data: mapData,\n label: \"Map legend\",\n }),\n // Age axis\n h(\"svg\", { width: \"100%\", height: \"40px\" }, [\n h(AxisBottom, {\n scale,\n numTicks: 5,\n top: 1,\n left: 0,\n label: \"Age (Ma)\",\n }),\n ]),\n ]);\n}\n\nfunction MacrostratAgeInfoCore({ macrostrat }) {\n const { b_age, t_age, b_int, t_int } = macrostrat;\n\n if (!b_age) return null;\n\n let age = b_int.int_name;\n if (b_int.int_id !== t_int.int_id) {\n age += ` - ${t_int.int_name}`;\n }\n return h(\n DescribedAgeInfo,\n {\n ageElement: h(AgeChip, {\n b_int: { ...b_int, int_name: age, b_age, t_age },\n t_int: { ...b_int, int_name: age, b_age, t_age },\n }),\n },\n \"Refined using the Macrostrat age model.\",\n );\n}\n\nfunction MacrostratAgeInfo(props) {\n return h(\n ExpandableDetailsPanel,\n { headerElement: h(MacrostratAgeInfoCore, props) },\n h(ExpansionBody, { title: \"Age refinement\" }, h(AgeRefinementPlot, props)),\n );\n}\n\nfunction MatchBasis(props) {\n const { source } = props;\n if (!source.macrostrat?.strat_names) return null;\n\n return h(\n ExpandableDetailsPanel,\n {\n className: \"macrostrat-unit\",\n headerElement: h([\n h(\"h3\", source.macrostrat.strat_names[0].rank_name),\n h(\"div.description\", \"Matched stratigraphic unit\"),\n ]),\n },\n h(ExpansionBody, { title: \"All matched names\" }, [\n source.macrostrat.strat_names.map((name, i) => {\n let lastElement: boolean =\n i == source.macrostrat.strat_names.length - 1;\n return h(\"span\", { key: i }, [\n h(\n \"a.externalLink\",\n {\n href: \"/lex/strat-names/\" + name.strat_name_id,\n key: i,\n },\n [name.rank_name],\n ),\n h.if(!lastElement)([\", \"]),\n ]);\n }),\n ]),\n );\n}\n\nfunction Thickness(props) {\n const { source } = props;\n if (!source.macrostrat.max_thick) return h(\"div\");\n\n return h.if(source.macrostrat && source.macrostrat.max_thick)(\n \"div.macrostrat-detail\",\n [\n h(\"div.expansion-summary-title\", \"Thickness\"),\n h(\"div\", [\n source.macrostrat.min_min_thick,\n \" - \",\n source.macrostrat.max_thick,\n \"m\",\n ]),\n ],\n );\n}\n\nfunction MinorFossilCollections(props) {\n const { source } = props;\n const { macrostrat } = source;\n if (!macrostrat.pbdb_collections) return h(\"div\");\n\n return h.if(macrostrat && macrostrat.pbdb_collections)(\n \"div.macrostrat-detail\",\n [\n h(\"div.expansion-summary-title\", \"Fossil collections\"),\n h(\"div\", [macrostrat.pbdb_collections]),\n ],\n );\n}\n\nfunction FossilOccs(props) {\n const { source } = props;\n const { macrostrat } = source;\n\n if (!macrostrat?.pbdb_occs) return null;\n\n return h(\"div.macrostrat-detail\", [\n h(\"div.expansion-summary-title\", \"Fossil occurrences\"),\n h(\"div\", [macrostrat.pbdb_occs]),\n ]);\n}\n\nfunction LithTypes(props) {\n const { lith_types } = props;\n\n return h.if(lith_types && lith_types.length > 0)(\n \"div.lithologies.lithology-types\",\n [\n h(LithologyList, {\n lithologies: lith_types,\n }),\n ],\n );\n}\n\nfunction LithsAndClasses(props) {\n const { source } = props;\n const { macrostrat } = source;\n const { liths = null, lith_types = null } = macrostrat;\n\n if (!liths || liths.length == 0) return null;\n\n const lithologies = liths.map((lith) => {\n return {\n ...lith,\n name: lith.lith,\n color: lith.color || \"#000000\",\n };\n });\n\n return h(\n ExpandableDetailsPanel,\n {\n title: \"Lithology\",\n value: h(LithTypes, { lith_types }),\n },\n h(ExpansionBody, { title: \"Matched lithologies\" }, [\n h(LithologyList, {\n lithologies,\n onClickItem: (e, lith) => {\n window.open(\"/lex/lithology/\" + lith.lith_id, \"_self\");\n },\n }),\n ]),\n );\n}\n\nfunction EnvironTypes(props) {\n const { environ_types } = props;\n return h.if(environ_types && environ_types.length > 0)(LithologyList, {\n lithologies: environ_types?.filter((e) => e.name != \"\"),\n });\n}\n\nfunction Environments(props) {\n const { source } = props;\n const { macrostrat } = source;\n const { environs = null, environ_types = null } = macrostrat;\n\n if (!environs || environs.length == 0) return null;\n\n const lithologies = environs.map((environ) => {\n return {\n ...environ,\n name: environ.environ,\n color: environ.color || \"#000000\",\n };\n });\n\n return h(\n ExpandableDetailsPanel,\n {\n title: \"Environment\",\n value: h(EnvironTypes, { environ_types }),\n },\n h(ExpansionBody, { title: \"Matched environments\" }, [\n h(LithologyList, {\n lithologies,\n onClickItem: (e, environ) => {\n window.open(\"/lex/environments/\" + environ.environ_id, \"_self\");\n },\n }),\n ]),\n );\n}\n\nfunction EconType(props) {\n const { econ_types } = props;\n\n return h.if(econ_types && econ_types.length > 0)(\"div\", [\n econ_types.map((econClass, i) => {\n return h(AttrChip, {\n key: i,\n name: econClass.name,\n color: econClass.color,\n });\n }),\n ]);\n}\n\nfunction Economy(props) {\n const { source } = props;\n const { macrostrat } = source;\n const { econs = null, econ_types = null } = macrostrat;\n if (!econs) return h(\"div\");\n\n return h.if(econs && econs.length > 0)(\n ExpandableDetailsPanel,\n {\n title: \"Economy \",\n value: h(EconType, { econ_types }),\n },\n h(ExpansionBody, { title: \"Matched economic attributes\" }, [\n econs.map((econ, i) => {\n return h(AttrChip, {\n key: i,\n name: econ.econ,\n color: econ.color,\n });\n }),\n ]),\n );\n}\n\nexport { MacrostratLinkedData };\n"],"names":[],"version":3,"file":"map-interface.3f968b46.js.map"}
@@ -0,0 +1,73 @@
1
+ var $2Gjg0$react = require("react");
2
+ var $2Gjg0$blueprintjscore = require("@blueprintjs/core");
3
+ var $2Gjg0$macrostratuicomponents = require("@macrostrat/ui-components");
4
+ var $2Gjg0$macrostrathyper = require("@macrostrat/hyper");
5
+
6
+
7
+ function $parcel$interopDefault(a) {
8
+ return a && a.__esModule ? a.default : a;
9
+ }
10
+
11
+ function $parcel$export(e, n, v, s) {
12
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
+ }
14
+
15
+ $parcel$export(module.exports, "default", () => $a77d4cb2e8e0bae6$export$2e2bcd8739ae039);
16
+
17
+
18
+
19
+
20
+ function $a77d4cb2e8e0bae6$var$Article(props) {
21
+ const [expanded, setExpanded] = (0, $2Gjg0$react.useState)(false);
22
+ const { data: data } = props;
23
+ const toggleExpand = ()=>{
24
+ setExpanded(!expanded);
25
+ };
26
+ // Attempt to pull out only the year and not the whole date
27
+ let year;
28
+ try {
29
+ year = data.coverDate ? data.coverDate.match(/\d{4}/)[0] : "";
30
+ } catch (e) {
31
+ year = "";
32
+ }
33
+ const authors = data?.authors?.split("; ") ?? [];
34
+ const authorList = authors.length > 0 ? (0, ($parcel$interopDefault($2Gjg0$macrostrathyper)))((0, $2Gjg0$macrostratuicomponents.AuthorList), {
35
+ names: authors
36
+ }) : "Unknown";
37
+ const iconName = expanded ? "chevron-up" : "chevron-down";
38
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("div", {
39
+ className: "article"
40
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("div", {
41
+ className: "article-title"
42
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("p", {
43
+ className: "article-author"
44
+ }, authorList, ", ", year.length ? " " + year + ". " : ""), /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("a", {
45
+ href: data.URL,
46
+ target: "_blank",
47
+ className: "title-link"
48
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("strong", null, data.title, ".")), /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("span", null, /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement((0, $2Gjg0$blueprintjscore.Button), {
49
+ onClick: toggleExpand,
50
+ minimal: true,
51
+ rightIcon: iconName,
52
+ className: "flat-btn"
53
+ }))), /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement((0, $2Gjg0$blueprintjscore.Collapse), {
54
+ isOpen: expanded
55
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("span", {
56
+ className: expanded ? "" : "hidden"
57
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("div", {
58
+ className: "quotes"
59
+ }, data.highlight.map((snippet, si)=>{
60
+ let text = snippet;
61
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($2Gjg0$react))).createElement("p", {
62
+ className: "gdd-snippet",
63
+ key: si,
64
+ dangerouslySetInnerHTML: {
65
+ __html: `...${snippet}...`
66
+ }
67
+ });
68
+ })))));
69
+ }
70
+ var $a77d4cb2e8e0bae6$export$2e2bcd8739ae039 = $a77d4cb2e8e0bae6$var$Article;
71
+
72
+
73
+ //# sourceMappingURL=map-interface.4264e7e1.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAKA,SAAS,8BAAQ,KAAK;IACpB,MAAM,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,MAAM,QAAE,IAAI,EAAE,GAAG;IAEjB,MAAM,eAAe;QACnB,YAAY,CAAC;IACf;IAEA,2DAA2D;IAC3D,IAAI;IACJ,IAAI;QACF,OAAO,KAAK,SAAS,GAAG,KAAK,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG;IAC7D,EAAE,OAAO,GAAG;QACV,OAAO;IACT;IAEA,MAAM,UAAU,MAAM,SAAS,MAAM,SAAS,EAAE;IAEhD,MAAM,aACJ,QAAQ,MAAM,GAAG,IAAI,CAAA,GAAA,gDAAA,EAAE,CAAA,GAAA,wCAAS,GAAG;QAAE,OAAO;IAAQ,KAAK;IAE3D,MAAM,WAAW,WAAW,eAAe;IAE3C,qBACE,0DAAC;QAAI,WAAU;qBACb,0DAAC;QAAI,WAAU;qBACb,0DAAC;QAAE,WAAU;OACV,YAAW,MAAG,KAAK,MAAM,GAAG,MAAM,OAAO,OAAO,mBAEnD,0DAAC;QAAE,MAAM,KAAK,GAAG;QAAE,QAAO;QAAS,WAAU;qBAC3C,0DAAC,gBAAQ,KAAK,KAAK,EAAC,qBAGtB,0DAAC,4BACC,0DAAC,CAAA,GAAA,6BAAK;QACJ,SAAS;QACT,SAAS;QACT,WAAW;QACX,WAAU;wBAIhB,0DAAC,CAAA,GAAA,+BAAO;QAAE,QAAQ;qBAChB,0DAAC;QAAK,WAAW,WAAW,KAAK;qBAC/B,0DAAC;QAAI,WAAU;OACZ,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS;QAC5B,IAAI,OAAO;QAEX,qBACE,0DAAC;YACC,WAAU;YACV,KAAK;YACL,yBAAyB;gBAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,CAAC;YAAC;;IAG5D;AAMZ;IAEA,2CAAe","sources":["packages/map-interface/src/map-panel/components/info-drawer/xdd-panel/Article.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Collapse, Button } from \"@blueprintjs/core\";\nimport { AuthorList } from \"@macrostrat/ui-components\";\nimport h from \"@macrostrat/hyper\";\n\nfunction Article(props) {\n const [expanded, setExpanded] = useState(false);\n const { data } = props;\n\n const toggleExpand = () => {\n setExpanded(!expanded);\n };\n\n // Attempt to pull out only the year and not the whole date\n let year;\n try {\n year = data.coverDate ? data.coverDate.match(/\\d{4}/)[0] : \"\";\n } catch (e) {\n year = \"\";\n }\n\n const authors = data?.authors?.split(\"; \") ?? [];\n\n const authorList =\n authors.length > 0 ? h(AuthorList, { names: authors }) : \"Unknown\";\n\n const iconName = expanded ? \"chevron-up\" : \"chevron-down\";\n\n return (\n <div className=\"article\">\n <div className=\"article-title\">\n <p className=\"article-author\">\n {authorList}, {year.length ? \" \" + year + \". \" : \"\"}\n </p>\n <a href={data.URL} target=\"_blank\" className=\"title-link\">\n <strong>{data.title}.</strong>\n </a>\n\n <span>\n <Button\n onClick={toggleExpand}\n minimal={true}\n rightIcon={iconName}\n className=\"flat-btn\"\n ></Button>\n </span>\n </div>\n <Collapse isOpen={expanded}>\n <span className={expanded ? \"\" : \"hidden\"}>\n <div className=\"quotes\">\n {data.highlight.map((snippet, si) => {\n let text = snippet;\n\n return (\n <p\n className=\"gdd-snippet\"\n key={si}\n dangerouslySetInnerHTML={{ __html: `...${snippet}...` }}\n ></p>\n );\n })}\n </div>\n </span>\n </Collapse>\n </div>\n );\n}\n\nexport default Article;\n"],"names":[],"version":3,"file":"map-interface.4264e7e1.js.map"}