@macrostrat/column-views 2.2.2 → 2.3.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 (267) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/esm/{column-views.b0e6c0b3.js → column-views.04636815.js} +3 -3
  3. package/dist/esm/{column-views.b0e6c0b3.js.map → column-views.04636815.js.map} +1 -1
  4. package/dist/esm/{column-views.54f8b909.js → column-views.052498a6.js} +37 -4
  5. package/dist/esm/column-views.052498a6.js.map +1 -0
  6. package/dist/esm/{column-views.5456a1ee.js → column-views.0da4503a.js} +2 -2
  7. package/dist/esm/{column-views.5456a1ee.js.map → column-views.0da4503a.js.map} +1 -1
  8. package/dist/esm/{column-views.ee525e88.js → column-views.107b47b4.js} +8 -8
  9. package/dist/esm/{column-views.ee525e88.js.map → column-views.107b47b4.js.map} +1 -1
  10. package/dist/esm/column-views.17a70358.js +16 -0
  11. package/dist/esm/column-views.17a70358.js.map +1 -0
  12. package/dist/esm/{column-views.073c42da.js → column-views.1b5bf0c6.js} +3 -3
  13. package/dist/esm/{column-views.073c42da.js.map → column-views.1b5bf0c6.js.map} +1 -1
  14. package/dist/esm/{column-views.52ad973a.js → column-views.2708e176.js} +8 -8
  15. package/dist/esm/column-views.2708e176.js.map +1 -0
  16. package/dist/esm/{column-views.88d63dd0.js → column-views.275ba52b.js} +3 -3
  17. package/dist/esm/{column-views.88d63dd0.js.map → column-views.275ba52b.js.map} +1 -1
  18. package/dist/esm/{column-views.7c95c3d7.js → column-views.2bac03a2.js} +2 -2
  19. package/dist/esm/{column-views.7c95c3d7.js.map → column-views.2bac03a2.js.map} +1 -1
  20. package/dist/esm/column-views.322790f3.js +138 -0
  21. package/dist/esm/column-views.322790f3.js.map +1 -0
  22. package/dist/esm/{column-views.6698b95a.js → column-views.343fc926.js} +9 -18
  23. package/dist/esm/column-views.343fc926.js.map +1 -0
  24. package/dist/esm/column-views.3c9cba65.js +13 -0
  25. package/dist/esm/{column-views.43beafa3.js.map → column-views.3c9cba65.js.map} +1 -1
  26. package/dist/esm/{column-views.aeb61926.js → column-views.3d3e00be.js} +2 -2
  27. package/dist/esm/{column-views.aeb61926.js.map → column-views.3d3e00be.js.map} +1 -1
  28. package/dist/esm/{column-views.7d69838d.js → column-views.40094dd9.js} +3 -3
  29. package/dist/esm/{column-views.7d69838d.js.map → column-views.40094dd9.js.map} +1 -1
  30. package/dist/esm/{column-views.d2214a99.js → column-views.44373a90.js} +8 -7
  31. package/dist/esm/column-views.44373a90.js.map +1 -0
  32. package/dist/esm/{column-views.ad080c0e.js → column-views.488f24b6.js} +2 -2
  33. package/dist/esm/{column-views.ad080c0e.js.map → column-views.488f24b6.js.map} +1 -1
  34. package/dist/esm/{column-views.abf6aedd.js → column-views.4b259f9e.js} +2 -2
  35. package/dist/esm/{column-views.abf6aedd.js.map → column-views.4b259f9e.js.map} +1 -1
  36. package/dist/esm/{column-views.1151416d.css → column-views.54c1f382.css} +6 -5
  37. package/dist/esm/column-views.54c1f382.css.map +1 -0
  38. package/dist/esm/{column-views.729a6728.js → column-views.565b193a.js} +2 -2
  39. package/dist/esm/{column-views.729a6728.js.map → column-views.565b193a.js.map} +1 -1
  40. package/dist/esm/{column-views.058c0083.js → column-views.5ca2b219.js} +5 -5
  41. package/dist/esm/{column-views.058c0083.js.map → column-views.5ca2b219.js.map} +1 -1
  42. package/dist/esm/{column-views.218e8f5d.js → column-views.5eb4e6ff.js} +4 -4
  43. package/dist/esm/{column-views.218e8f5d.js.map → column-views.5eb4e6ff.js.map} +1 -1
  44. package/dist/esm/{column-views.11ae78f7.js → column-views.5fff0716.js} +3 -3
  45. package/dist/esm/{column-views.11ae78f7.js.map → column-views.5fff0716.js.map} +1 -1
  46. package/dist/esm/{column-views.05586d1f.js → column-views.60e97132.js} +2 -4
  47. package/dist/esm/column-views.60e97132.js.map +1 -0
  48. package/dist/esm/{column-views.75e5aebe.js → column-views.63d40878.js} +4 -4
  49. package/dist/esm/{column-views.75e5aebe.js.map → column-views.63d40878.js.map} +1 -1
  50. package/dist/esm/{column-views.d6d6df77.js → column-views.6c9e5069.js} +40 -62
  51. package/dist/esm/column-views.6c9e5069.js.map +1 -0
  52. package/dist/esm/column-views.6df65dab.js +9 -0
  53. package/dist/esm/column-views.6df65dab.js.map +1 -0
  54. package/dist/esm/column-views.7fa0d026.js +62 -0
  55. package/dist/esm/column-views.7fa0d026.js.map +1 -0
  56. package/dist/esm/{column-views.3a7179c4.js → column-views.82eb5026.js} +12 -7
  57. package/dist/esm/column-views.82eb5026.js.map +1 -0
  58. package/dist/esm/{column-views.9dd25b5b.js → column-views.92575b87.js} +3 -3
  59. package/dist/esm/column-views.92575b87.js.map +1 -0
  60. package/dist/esm/{column-views.833c2b74.js → column-views.9d51a5ab.js} +3 -3
  61. package/dist/esm/{column-views.833c2b74.js.map → column-views.9d51a5ab.js.map} +1 -1
  62. package/dist/esm/{column-views.817752b6.js → column-views.9ffc089b.js} +3 -3
  63. package/dist/esm/{column-views.817752b6.js.map → column-views.9ffc089b.js.map} +1 -1
  64. package/dist/esm/{column-views.70164236.js → column-views.aa9ede4d.js} +2 -2
  65. package/dist/esm/{column-views.70164236.js.map → column-views.aa9ede4d.js.map} +1 -1
  66. package/dist/esm/{column-views.6d63971b.js → column-views.ad2fe46c.js} +2 -2
  67. package/dist/esm/{column-views.6d63971b.js.map → column-views.ad2fe46c.js.map} +1 -1
  68. package/dist/esm/{column-views.7b4a1f15.js → column-views.afe0bb48.js} +5 -5
  69. package/dist/esm/{column-views.7b4a1f15.js.map → column-views.afe0bb48.js.map} +1 -1
  70. package/dist/esm/{column-views.aecf25bc.js → column-views.b4e1236d.js} +2 -2
  71. package/dist/esm/{column-views.aecf25bc.js.map → column-views.b4e1236d.js.map} +1 -1
  72. package/dist/esm/{column-views.6ce8cb61.js → column-views.c149f7a5.js} +3 -3
  73. package/dist/esm/{column-views.6ce8cb61.js.map → column-views.c149f7a5.js.map} +1 -1
  74. package/dist/esm/column-views.c3c7901a.js +149 -0
  75. package/dist/esm/column-views.c3c7901a.js.map +1 -0
  76. package/dist/esm/{column-views.b7016f82.css → column-views.cb6fc808.css} +10 -10
  77. package/dist/esm/column-views.cb6fc808.css.map +1 -0
  78. package/dist/esm/{column-views.35efe006.js → column-views.ce3a3ac8.js} +2 -2
  79. package/dist/esm/{column-views.35efe006.js.map → column-views.ce3a3ac8.js.map} +1 -1
  80. package/dist/esm/{column-views.77e22590.js → column-views.d1b49f5c.js} +2 -2
  81. package/dist/esm/{column-views.77e22590.js.map → column-views.d1b49f5c.js.map} +1 -1
  82. package/dist/esm/{column-views.faa4e06d.js → column-views.d524075b.js} +4 -4
  83. package/dist/esm/{column-views.faa4e06d.js.map → column-views.d524075b.js.map} +1 -1
  84. package/dist/esm/column-views.d5e788e8.js +31 -0
  85. package/dist/esm/column-views.d5e788e8.js.map +1 -0
  86. package/dist/esm/{column-views.30950997.js → column-views.d6c0b7bc.js} +2 -2
  87. package/dist/esm/{column-views.30950997.js.map → column-views.d6c0b7bc.js.map} +1 -1
  88. package/dist/esm/{column-views.44d3797a.js → column-views.dc195174.js} +2 -2
  89. package/dist/esm/{column-views.44d3797a.js.map → column-views.dc195174.js.map} +1 -1
  90. package/dist/esm/column-views.de433f18.js +139 -0
  91. package/dist/esm/column-views.de433f18.js.map +1 -0
  92. package/dist/esm/{column-views.ef88c46c.js → column-views.e075af15.js} +2 -2
  93. package/dist/esm/{column-views.ef88c46c.js.map → column-views.e075af15.js.map} +1 -1
  94. package/dist/esm/{column-views.7faf00ed.js → column-views.f7cdf6be.js} +3 -3
  95. package/dist/esm/{column-views.7faf00ed.js.map → column-views.f7cdf6be.js.map} +1 -1
  96. package/dist/esm/{column-views.66ccfc44.js → column-views.faa7e52e.js} +3 -3
  97. package/dist/esm/{column-views.66ccfc44.js.map → column-views.faa7e52e.js.map} +1 -1
  98. package/dist/esm/index.d.ts +39 -19
  99. package/dist/esm/index.d.ts.map +1 -1
  100. package/dist/esm/index.js +12 -12
  101. package/dist/node/column-views.012fa10c.js +2 -0
  102. package/dist/node/column-views.012fa10c.js.map +1 -0
  103. package/dist/node/{column-views.edb4ba54.js → column-views.021a6961.js} +2 -2
  104. package/dist/node/{column-views.edb4ba54.js.map → column-views.021a6961.js.map} +1 -1
  105. package/dist/node/{column-views.a19be00f.js → column-views.08bef1f6.js} +2 -2
  106. package/dist/node/{column-views.a19be00f.js.map → column-views.08bef1f6.js.map} +1 -1
  107. package/dist/node/{column-views.ae22e8b1.js → column-views.0f401891.js} +2 -2
  108. package/dist/node/{column-views.ae22e8b1.js.map → column-views.0f401891.js.map} +1 -1
  109. package/dist/node/column-views.1d064426.js +2 -0
  110. package/dist/node/column-views.1d064426.js.map +1 -0
  111. package/dist/node/{column-views.ae54d3e1.js → column-views.2577dec0.js} +2 -2
  112. package/dist/node/{column-views.ae54d3e1.js.map → column-views.2577dec0.js.map} +1 -1
  113. package/dist/node/{column-views.1ac9e2ed.js → column-views.2fe8feb9.js} +2 -2
  114. package/dist/node/{column-views.1ac9e2ed.js.map → column-views.2fe8feb9.js.map} +1 -1
  115. package/dist/node/{column-views.a281d5bb.js → column-views.42bc66a8.js} +2 -2
  116. package/dist/node/{column-views.a281d5bb.js.map → column-views.42bc66a8.js.map} +1 -1
  117. package/dist/node/{column-views.4ce5f5e4.js → column-views.465e593b.js} +2 -2
  118. package/dist/node/{column-views.4ce5f5e4.js.map → column-views.465e593b.js.map} +1 -1
  119. package/dist/node/{column-views.e1813308.js → column-views.46efb749.js} +2 -2
  120. package/dist/node/{column-views.e1813308.js.map → column-views.46efb749.js.map} +1 -1
  121. package/dist/node/{column-views.61dc64bc.js → column-views.47440961.js} +2 -2
  122. package/dist/node/{column-views.61dc64bc.js.map → column-views.47440961.js.map} +1 -1
  123. package/dist/node/column-views.5361f0e2.js +2 -0
  124. package/dist/node/column-views.5361f0e2.js.map +1 -0
  125. package/dist/node/{column-views.38835c99.js → column-views.5559de6a.js} +2 -2
  126. package/dist/node/{column-views.38835c99.js.map → column-views.5559de6a.js.map} +1 -1
  127. package/dist/node/{column-views.52cc4dd0.js → column-views.56f88b8c.js} +2 -2
  128. package/dist/node/{column-views.52cc4dd0.js.map → column-views.56f88b8c.js.map} +1 -1
  129. package/dist/node/{column-views.0b3a384e.js → column-views.5a9331a9.js} +2 -2
  130. package/dist/node/{column-views.0b3a384e.js.map → column-views.5a9331a9.js.map} +1 -1
  131. package/dist/node/column-views.5fd6e11a.js +2 -0
  132. package/dist/node/column-views.5fd6e11a.js.map +1 -0
  133. package/dist/node/column-views.672b683c.js +2 -0
  134. package/dist/node/column-views.672b683c.js.map +1 -0
  135. package/dist/node/{column-views.a08b0c9f.js → column-views.6c7f9245.js} +2 -2
  136. package/dist/node/{column-views.a08b0c9f.js.map → column-views.6c7f9245.js.map} +1 -1
  137. package/dist/node/{column-views.67fed1f5.js → column-views.75456275.js} +2 -2
  138. package/dist/node/{column-views.67fed1f5.js.map → column-views.75456275.js.map} +1 -1
  139. package/dist/node/column-views.75ba0464.css +2 -0
  140. package/dist/node/column-views.75ba0464.css.map +1 -0
  141. package/dist/node/column-views.777b9bb6.js +2 -0
  142. package/dist/node/column-views.777b9bb6.js.map +1 -0
  143. package/dist/node/{column-views.21a73236.js → column-views.7c322202.js} +2 -2
  144. package/dist/node/{column-views.21a73236.js.map → column-views.7c322202.js.map} +1 -1
  145. package/dist/node/column-views.7cc1a14f.js +2 -0
  146. package/dist/node/column-views.7cc1a14f.js.map +1 -0
  147. package/dist/node/{column-views.7faaf6c8.js → column-views.8e846c57.js} +2 -2
  148. package/dist/node/{column-views.7faaf6c8.js.map → column-views.8e846c57.js.map} +1 -1
  149. package/dist/node/{column-views.003348f6.js → column-views.8ee8469d.js} +2 -2
  150. package/dist/node/{column-views.003348f6.js.map → column-views.8ee8469d.js.map} +1 -1
  151. package/dist/node/{column-views.420b60d2.js → column-views.93bde6c1.js} +2 -2
  152. package/dist/node/{column-views.420b60d2.js.map → column-views.93bde6c1.js.map} +1 -1
  153. package/dist/node/{column-views.f2ee436e.js → column-views.a14f0134.js} +2 -2
  154. package/dist/node/{column-views.f2ee436e.js.map → column-views.a14f0134.js.map} +1 -1
  155. package/dist/node/{column-views.aef76eee.js → column-views.a596b1f5.js} +2 -2
  156. package/dist/node/{column-views.aef76eee.js.map → column-views.a596b1f5.js.map} +1 -1
  157. package/dist/node/column-views.af480651.js +2 -0
  158. package/dist/node/column-views.af480651.js.map +1 -0
  159. package/dist/node/column-views.b103acbc.js +2 -0
  160. package/dist/node/column-views.b103acbc.js.map +1 -0
  161. package/dist/node/{column-views.60b5663d.js → column-views.b40c1b9c.js} +2 -2
  162. package/dist/node/{column-views.60b5663d.js.map → column-views.b40c1b9c.js.map} +1 -1
  163. package/dist/node/column-views.b6e86cf0.js +2 -0
  164. package/dist/node/column-views.b6e86cf0.js.map +1 -0
  165. package/dist/node/{column-views.22c2d45b.js → column-views.c007152b.js} +2 -2
  166. package/dist/node/{column-views.22c2d45b.js.map → column-views.c007152b.js.map} +1 -1
  167. package/dist/node/{column-views.b6943236.js → column-views.c921fa1a.js} +2 -2
  168. package/dist/node/{column-views.b6943236.js.map → column-views.c921fa1a.js.map} +1 -1
  169. package/dist/node/{column-views.05cfc627.js → column-views.c9880a4d.js} +2 -2
  170. package/dist/node/{column-views.05cfc627.js.map → column-views.c9880a4d.js.map} +1 -1
  171. package/dist/node/column-views.ccfb9afb.css +2 -0
  172. package/dist/node/column-views.ccfb9afb.css.map +1 -0
  173. package/dist/node/{column-views.bde2dfa8.js → column-views.cd54f1b1.js} +2 -2
  174. package/dist/node/{column-views.bde2dfa8.js.map → column-views.cd54f1b1.js.map} +1 -1
  175. package/dist/node/{column-views.db47fe3c.js → column-views.d77d260b.js} +2 -2
  176. package/dist/node/{column-views.db47fe3c.js.map → column-views.d77d260b.js.map} +1 -1
  177. package/dist/node/{column-views.105c28fa.js → column-views.d818b387.js} +2 -2
  178. package/dist/node/{column-views.105c28fa.js.map → column-views.d818b387.js.map} +1 -1
  179. package/dist/node/{column-views.2d00d842.js → column-views.d8821a96.js} +2 -2
  180. package/dist/node/{column-views.2d00d842.js.map → column-views.d8821a96.js.map} +1 -1
  181. package/dist/node/column-views.dbb4a46b.js +2 -0
  182. package/dist/node/column-views.dbb4a46b.js.map +1 -0
  183. package/dist/node/{column-views.b12f8c81.js → column-views.e264a767.js} +2 -2
  184. package/dist/node/{column-views.b12f8c81.js.map → column-views.e264a767.js.map} +1 -1
  185. package/dist/node/column-views.e93b3bdb.js +2 -0
  186. package/dist/node/column-views.e93b3bdb.js.map +1 -0
  187. package/dist/node/{column-views.3913cd0f.js → column-views.ec691859.js} +2 -2
  188. package/dist/node/{column-views.3913cd0f.js.map → column-views.ec691859.js.map} +1 -1
  189. package/dist/node/column-views.ec7cc7cc.js +2 -0
  190. package/dist/node/column-views.ec7cc7cc.js.map +1 -0
  191. package/dist/node/{column-views.aae09aca.js → column-views.eecdc727.js} +2 -2
  192. package/dist/node/{column-views.aae09aca.js.map → column-views.eecdc727.js.map} +1 -1
  193. package/dist/node/{column-views.d08e4328.js → column-views.f577d065.js} +2 -2
  194. package/dist/node/{column-views.d08e4328.js.map → column-views.f577d065.js.map} +1 -1
  195. package/dist/node/column-views.fac4baff.js +2 -0
  196. package/dist/node/column-views.fac4baff.js.map +1 -0
  197. package/dist/node/index.js +1 -1
  198. package/dist/node/index.js.map +1 -1
  199. package/package.json +2 -2
  200. package/src/age-axis.ts +1 -1
  201. package/src/column.ts +4 -1
  202. package/src/correlation-chart/stories/correlation-chart.stories.ts +1 -1
  203. package/src/facets/detrital-zircon/index.ts +78 -11
  204. package/src/facets/detrital-zircon/provider.ts +1 -1
  205. package/src/facets/fossils/index.ts +145 -215
  206. package/src/facets/fossils/provider.ts +18 -25
  207. package/src/facets/fossils/taxon-ranges.ts +220 -0
  208. package/src/facets/index.ts +0 -1
  209. package/src/facets/{base-sample-column.module.sass → measurements/base.module.sass} +1 -0
  210. package/src/facets/measurements/base.ts +215 -0
  211. package/src/facets/measurements/index.ts +2 -38
  212. package/src/facets/measurements/sgp.ts +91 -0
  213. package/src/notes.ts +6 -3
  214. package/src/prepare-units/index.ts +8 -2
  215. package/src/prepare-units/utils.ts +55 -9
  216. package/dist/esm/column-views.05586d1f.js.map +0 -1
  217. package/dist/esm/column-views.1151416d.css.map +0 -1
  218. package/dist/esm/column-views.1e579112.js +0 -92
  219. package/dist/esm/column-views.1e579112.js.map +0 -1
  220. package/dist/esm/column-views.3a7179c4.js.map +0 -1
  221. package/dist/esm/column-views.43beafa3.js +0 -15
  222. package/dist/esm/column-views.52ad973a.js.map +0 -1
  223. package/dist/esm/column-views.54f8b909.js.map +0 -1
  224. package/dist/esm/column-views.6698b95a.js.map +0 -1
  225. package/dist/esm/column-views.6e7082db.js +0 -16
  226. package/dist/esm/column-views.6e7082db.js.map +0 -1
  227. package/dist/esm/column-views.7243e77d.js +0 -37
  228. package/dist/esm/column-views.7243e77d.js.map +0 -1
  229. package/dist/esm/column-views.76a220c4.js +0 -95
  230. package/dist/esm/column-views.76a220c4.js.map +0 -1
  231. package/dist/esm/column-views.9dd25b5b.js.map +0 -1
  232. package/dist/esm/column-views.b7016f82.css.map +0 -1
  233. package/dist/esm/column-views.d2214a99.js.map +0 -1
  234. package/dist/esm/column-views.d6d6df77.js.map +0 -1
  235. package/dist/esm/column-views.ea4ebbb7.js +0 -31
  236. package/dist/esm/column-views.ea4ebbb7.js.map +0 -1
  237. package/dist/node/column-views.16f336ee.js +0 -2
  238. package/dist/node/column-views.16f336ee.js.map +0 -1
  239. package/dist/node/column-views.1c567bfd.js +0 -2
  240. package/dist/node/column-views.1c567bfd.js.map +0 -1
  241. package/dist/node/column-views.2901b649.js +0 -2
  242. package/dist/node/column-views.2901b649.js.map +0 -1
  243. package/dist/node/column-views.29eb25bd.css +0 -2
  244. package/dist/node/column-views.29eb25bd.css.map +0 -1
  245. package/dist/node/column-views.39c21f22.js +0 -2
  246. package/dist/node/column-views.39c21f22.js.map +0 -1
  247. package/dist/node/column-views.573cb29d.js +0 -2
  248. package/dist/node/column-views.573cb29d.js.map +0 -1
  249. package/dist/node/column-views.5f3b0b04.js +0 -2
  250. package/dist/node/column-views.5f3b0b04.js.map +0 -1
  251. package/dist/node/column-views.77ace3a2.js +0 -2
  252. package/dist/node/column-views.77ace3a2.js.map +0 -1
  253. package/dist/node/column-views.8f54691f.js +0 -2
  254. package/dist/node/column-views.8f54691f.js.map +0 -1
  255. package/dist/node/column-views.a16cd1f2.js +0 -2
  256. package/dist/node/column-views.a16cd1f2.js.map +0 -1
  257. package/dist/node/column-views.a9576bac.js +0 -2
  258. package/dist/node/column-views.a9576bac.js.map +0 -1
  259. package/dist/node/column-views.c3c15cc2.js +0 -2
  260. package/dist/node/column-views.c3c15cc2.js.map +0 -1
  261. package/dist/node/column-views.cd7b223b.css +0 -2
  262. package/dist/node/column-views.cd7b223b.css.map +0 -1
  263. package/dist/node/column-views.f6ac1161.js +0 -2
  264. package/dist/node/column-views.f6ac1161.js.map +0 -1
  265. package/src/facets/base-sample-column.ts +0 -114
  266. package/src/facets/measurements/provider.ts +0 -80
  267. /package/src/facets/fossils/{index.module.sass → taxon-ranges.module.sass} +0 -0
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,e,C,K,U,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,S,E,E,S,E,E,SCkBO,SAAS,EACd,CAA+B,CAC/B,CAA0B,EAM1B,IAAI,EAAc,EAAqB,EACnC,EAAuB,EAErB,EAAsC,EAAE,CAC9C,IAAK,IAAM,KAAS,EAAa,CAC/B,G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EAAM,EAAQ,GAAG,CAAC,EAAe,SAAS,CAAC,KAAK,IAKnC,EAAW,CACxB,IAAI,EACA,CAEF,CAAA,EAAK,QAAQ,EAAI,AAAA,EAAe,GAAG,EACnC,EAAK,QAAQ,EAAI,AAAA,EAAe,KAAK,EAErC,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACxD,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,IAExD,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACxD,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,GAgB1D,EAAiB,EAZyB,CACxC,MAAO,IAAI,EAAe,KAAK,IAAK,EAAY,KAAK,CAAC,CACtD,WAAY,IACP,AAAA,CAAA,EAAA,EAAA,WAAU,AAAV,EAAY,EAAe,UAAU,KACrC,AAAA,CAAA,EAAA,EAAA,WAAU,AAAV,EAAY,EAAY,UAAU,EACtC,CACD,MAAO,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACvD,MAAO,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACvD,MAAA,EACA,MAAA,CACF,EAEsD,EACxD,MAEE,EAAY,IAAI,CAAC,GACjB,EAAiB,CAErB,CAKA,OAJI,AAAkB,MAAlB,GACF,EAAY,IAAI,CAAC,GAGZ,CACT,Q,K,uB,C,K,kB,C,K,sB,C,K,qB,C,K,oB,C,K,mC","sources":["<anon>","packages/column-views/src/prepare-units/composite-scale.ts"],"sourcesContent":["import \"./column-views.5f3b0b04.js\";\nimport \"./column-views.0b3a384e.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {ColumnAxisType as $d6XP3$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {scaleLinear as $d6XP3$scaleLinear} from \"d3-scale\";\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\nvar $dcPBY = parcelRequire(\"dcPBY\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $8054a162cb094378$export$e7184dd8bb3302ed(inputScales, unconformityHeight) {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */ let totalHeight = unconformityHeight / 2;\n let lastSectionTopHeight = 0;\n const packages2 = [];\n for (const group of inputScales){\n const { domain: domain, scale: scale } = group;\n const [b_age, t_age] = domain;\n const key = `package-${b_age}-${t_age}`;\n packages2.push({\n ...$8054a162cb094378$export$d6235b492bceb8c5(group, totalHeight),\n key: key,\n offset: totalHeight,\n // Unconformity height above this particular section\n paddingTop: totalHeight - lastSectionTopHeight\n });\n const pixelHeight = Math.abs(scale(b_age) - scale(t_age));\n lastSectionTopHeight = totalHeight + pixelHeight;\n totalHeight = lastSectionTopHeight + unconformityHeight;\n }\n totalHeight += unconformityHeight / 2;\n return {\n totalHeight: totalHeight,\n sections: packages2\n };\n}\nfunction $8054a162cb094378$export$67442a0f5bef147b(sections, unconformityHeight) {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */ const sectionScales = sections.map((d)=>d.scaleInfo);\n const { totalHeight: totalHeight, sections: packages } = $8054a162cb094378$export$e7184dd8bb3302ed(sectionScales, unconformityHeight);\n // This could perhaps be simplified.\n const sections1 = [];\n for(const i in sections){\n const group = sections[i];\n const scaleInfo = packages[i];\n sections1.push({\n ...group,\n key: scaleInfo.key,\n scaleInfo: scaleInfo\n });\n }\n return {\n totalHeight: totalHeight,\n sections: sections1\n };\n}\nfunction $8054a162cb094378$export$7d3f3129a1a4b84e(sections, opts) {\n return sections.map((group)=>{\n return $8054a162cb094378$var$addScaleToSection(group, opts);\n });\n}\nfunction $8054a162cb094378$var$addScaleToSection(group, opts) {\n const { t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos, units: units } = group;\n let _range = null;\n // if t_age and b_age are set for a group, use them to define the range...\n if (opts.axisType == (0, $d6XP3$ColumnAxisType).AGE) _range = [\n b_age,\n t_age\n ];\n else _range = [\n b_pos,\n t_pos\n ];\n const scaleInfo = $8054a162cb094378$var$buildSectionScale(units, {\n ...opts,\n domain: _range\n });\n return {\n ...group,\n scaleInfo: scaleInfo\n };\n}\nfunction $8054a162cb094378$var$buildSectionScale(data, opts) {\n const { targetUnitHeight: targetUnitHeight = 20, minPixelScale: minPixelScale = 0.2, axisType: axisType, minSectionHeight: minSectionHeight, scale: scale, hybridScale: hybridScale } = opts;\n const domain = opts.domain ?? $8054a162cb094378$var$findSectionHeightRange(data, axisType);\n const dAge = Math.abs(domain[0] - domain[1]);\n let _pixelScale = opts.pixelScale;\n let pixelHeight;\n if (hybridScale != null) {\n /** In an equidistant surfaces scale, we want to determine the heights of surfaces\n * and then distribute units evenly between them.\n * This is somewhat like an ordinal scale\n */ if (hybridScale.type === (0, $76iYI.HybridScaleType).EquidistantSurfaces) _pixelScale ?? (_pixelScale = targetUnitHeight);\n return (0, $dcPBY.buildHybridScale)(hybridScale, data, domain, {\n pixelOffset: 0,\n pixelScale: _pixelScale\n });\n }\n if (scale == null) {\n if (_pixelScale == null) {\n const avgAgeRange = $8054a162cb094378$var$findAverageUnitHeight(data, axisType);\n // Get pixel height necessary to render average unit at target height\n _pixelScale = Math.max(targetUnitHeight / avgAgeRange, minPixelScale);\n // OLD METHOD that cares about overall section height vs. individual unit height\n // 0.2 pixel per myr is the floor scale\n //const targetHeight = targetUnitHeight * data.length;\n // 1 pixel per myr is the floor scale\n //_pixelScale = Math.max(targetHeight / dAge, minPixelScale);\n }\n let height = dAge * _pixelScale;\n // If height is less than minSectionHeight, set it to minSectionHeight\n const _minSectionHeight = minSectionHeight ?? targetUnitHeight ?? 0;\n pixelHeight = Math.max(height, _minSectionHeight);\n _pixelScale = pixelHeight / dAge;\n } else // If a scale is provided, use it to compute pixel height\n pixelHeight = Math.abs(scale(domain[0]) - scale(domain[1]));\n return $8054a162cb094378$export$d6235b492bceb8c5({\n scale: scale,\n domain: domain,\n pixelHeight: pixelHeight,\n pixelScale: _pixelScale\n }, 0);\n}\nfunction $8054a162cb094378$export$d6235b492bceb8c5(def, offset = 0) {\n /** Build a section scale */ // Domain should be oriented from bottom to top, but scale is oriented from top to bottom\n const { domain: domain, pixelScale: pixelScale, pixelHeight: pixelHeight, scale: scale, heightScale: heightScale } = def;\n if (scale == null && pixelScale == null) throw new Error(\"Either scale or pixelScale must be provided\");\n let _scale;\n if (scale == null) _scale = (0, $d6XP3$scaleLinear)().domain([\n domain[1],\n domain[0]\n ]).range([\n offset,\n pixelHeight + offset\n ]);\n else {\n const domain0 = scale.domain();\n const range0 = scale.range();\n _scale = scale.copy().domain(domain0).range(range0.map((d)=>d + offset));\n }\n _scale.clamp();\n let _heightScale = null;\n if (heightScale != null) {\n // Adjust height scale as well\n const range0 = scale.range();\n _heightScale = heightScale.copy().range(range0.map((d)=>d + offset));\n _heightScale.clamp();\n }\n return {\n domain: domain,\n pixelScale: pixelScale,\n pixelHeight: pixelHeight,\n scale: _scale,\n // Internal details for hybrid scales. TODO: improve this\n heightScale: _heightScale\n };\n}\nfunction $8054a162cb094378$var$findSectionHeightRange(data, axisType) {\n if (axisType == null) throw new Error(\"Axis type is not set\");\n if (axisType === (0, $d6XP3$ColumnAxisType).AGE) {\n const t_age = Math.min(...data.map((d)=>d.t_age));\n const b_age = Math.max(...data.map((d)=>d.b_age));\n return [\n b_age,\n t_age\n ];\n } else if (axisType == (0, $d6XP3$ColumnAxisType).DEPTH || axisType == (0, $d6XP3$ColumnAxisType).ORDINAL) {\n const t_pos = Math.min(...data.map((d)=>d.t_pos));\n const b_pos = Math.max(...data.map((d)=>d.b_pos));\n return [\n b_pos,\n t_pos\n ];\n } else if (axisType == (0, $d6XP3$ColumnAxisType).HEIGHT) {\n const t_pos = Math.max(...data.map((d)=>d.t_pos));\n const b_pos = Math.min(...data.map((d)=>d.b_pos));\n return [\n b_pos,\n t_pos\n ];\n }\n}\nfunction $8054a162cb094378$var$findAverageUnitHeight(data, axisType) {\n const unitHeights = data.map((d)=>{\n const [b_pos, t_pos] = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n return Math.abs(b_pos - t_pos);\n });\n return unitHeights.reduce((a, b)=>a + b, 0) / unitHeights.length;\n}\nfunction $8054a162cb094378$export$3ada7641926a616d(sections, interpolateUnconformities = false) {\n /** Create a scale that works across multiple packages */ const scales = [];\n let lastScale = null;\n for (const section of sections){\n const _scale = section.scaleInfo.scale.copy().clamp(true);\n scales.push(_scale);\n if (lastScale != null && interpolateUnconformities) {\n // Add a new scale that interpolates between lastScale and _scale\n const lastDomain = lastScale.domain();\n const lastRange = lastScale.range();\n const currentDomain = _scale.domain();\n const currentRange = _scale.range();\n const interpScale = (0, $d6XP3$scaleLinear)().domain([\n lastDomain[lastDomain.length - 1],\n currentDomain[0]\n ]).range([\n lastRange[lastRange.length - 1],\n currentRange[0]\n ]).clamp(true);\n scales.push(interpScale);\n }\n lastScale = _scale;\n }\n const scale = (age)=>{\n for (const s of scales){\n const domain = s.domain();\n if (age >= domain[0] && age <= domain[domain.length - 1]) return s(age);\n }\n return null;\n };\n scale.copy = ()=>{\n return $8054a162cb094378$export$3ada7641926a616d(sections, interpolateUnconformities);\n };\n scale.domain = ()=>{\n /** Return the domain of the scale */ const vals = sections.flatMap((d)=>d.scaleInfo.domain);\n if (vals[0] < vals[vals.length - 1]) // age axes\n return [\n Math.min(...vals),\n Math.max(...vals)\n ];\n // Normal axes like height\n return [\n Math.max(...vals),\n Math.min(...vals)\n ];\n };\n scale.invert = (pixelHeight)=>{\n /** Invert the scale to get the age at a given pixel height */ // Iterate through the sections to find the correct one\n for (const scale of scales){\n const range = scale.range();\n if (pixelHeight > Math.min(...range) && pixelHeight <= Math.max(...range)) {\n console.log(\"Inverting scale at pixel height\", pixelHeight);\n return scale.invert(pixelHeight);\n }\n }\n return null;\n };\n scale.clamp = (clamp)=>{\n /** Clamp all constituent scales */ for (const s of scales)s.clamp(clamp);\n };\n return scale;\n}\nfunction $8054a162cb094378$export$edbf01b435c75274(sections, threshold, opts) {\n const newSections = [];\n let currentSection = null;\n for (const nextSection of sections){\n if (currentSection == null) {\n currentSection = nextSection;\n continue;\n }\n let heights;\n let pxHeights;\n if (opts.axisType !== (0, $d6XP3$ColumnAxisType).AGE) heights = [\n nextSection.t_pos,\n currentSection.b_pos\n ];\n else heights = [\n nextSection.t_age,\n currentSection.b_age\n ];\n const _diff = (vals)=>{\n return Math.abs(vals[0] - vals[1]);\n };\n pxHeights = [\n _diff(heights.map(nextSection.scaleInfo.scale)),\n _diff(heights.map(currentSection.scaleInfo.scale))\n ];\n const pxHeight = Math.min(...pxHeights);\n if (pxHeight < threshold) {\n let t_pos;\n let b_pos;\n if (opts.axisType == (0, $d6XP3$ColumnAxisType).AGE || opts.axisType == (0, $d6XP3$ColumnAxisType).DEPTH) {\n t_pos = Math.min(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.max(currentSection.b_pos, nextSection.b_pos);\n } else {\n t_pos = Math.max(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.min(currentSection.b_pos, nextSection.b_pos);\n }\n // We need to merge the sections\n const compositeSection0 = {\n units: [\n ...currentSection.units,\n ...nextSection.units\n ],\n section_id: [\n ...(0, $iWhRv.ensureArray)(currentSection.section_id),\n ...(0, $iWhRv.ensureArray)(nextSection.section_id)\n ],\n t_age: Math.min(currentSection.t_age, nextSection.t_age),\n b_age: Math.max(currentSection.b_age, nextSection.b_age),\n t_pos: t_pos,\n b_pos: b_pos\n };\n currentSection = $8054a162cb094378$var$addScaleToSection(compositeSection0, opts);\n } else {\n // We need to keep the section\n newSections.push(currentSection);\n currentSection = nextSection;\n }\n }\n if (currentSection != null) newSections.push(currentSection);\n return newSections;\n}\n\n\nexport {$8054a162cb094378$export$e7184dd8bb3302ed as buildCompositeScaleInfo, $8054a162cb094378$export$d6235b492bceb8c5 as createPackageScale, $8054a162cb094378$export$67442a0f5bef147b as finalizeSectionHeights, $8054a162cb094378$export$7d3f3129a1a4b84e as computeSectionHeights, $8054a162cb094378$export$3ada7641926a616d as createCompositeScale, $8054a162cb094378$export$edbf01b435c75274 as collapseUnconformitiesByPixelHeight};\n//# sourceMappingURL=column-views.aef76eee.js.map\n","import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { ensureArray, getUnitHeightRange } from \"./utils\";\nimport { ScaleContinuousNumeric, scaleLinear } from \"d3-scale\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { buildHybridScale } from \"./dynamic-scales\";\nimport { ExtUnit, HybridScaleType, SectionInfo } from \"./types\";\nimport type {\n ColumnScaleOptions,\n CompositeColumnData,\n CompositeScaleData,\n PackageLayoutData,\n PackageScaleInfo,\n PackageScaleLayoutData,\n SectionScaleOptions,\n} from \"./types\";\n\n// Composite scale information augmented with units in each package\n\nexport function buildCompositeScaleInfo(\n inputScales: PackageScaleInfo[],\n unconformityHeight: number,\n): CompositeScaleData {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n let totalHeight = unconformityHeight / 2;\n let lastSectionTopHeight = 0;\n\n const packages2: PackageScaleLayoutData[] = [];\n for (const group of inputScales) {\n const { domain, scale } = group;\n const [b_age, t_age] = domain;\n const key = `package-${b_age}-${t_age}`;\n\n packages2.push({\n ...createPackageScale(group, totalHeight),\n key,\n offset: totalHeight,\n // Unconformity height above this particular section\n paddingTop: totalHeight - lastSectionTopHeight,\n });\n\n const pixelHeight = Math.abs(scale(b_age) - scale(t_age));\n lastSectionTopHeight = totalHeight + pixelHeight;\n totalHeight = lastSectionTopHeight + unconformityHeight;\n }\n totalHeight += unconformityHeight / 2;\n return {\n totalHeight,\n sections: packages2,\n };\n}\n\nexport function finalizeSectionHeights<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n unconformityHeight: number,\n): CompositeColumnData<T> {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n const sectionScales = sections.map((d) => d.scaleInfo);\n\n const { totalHeight, sections: packages } = buildCompositeScaleInfo(\n sectionScales,\n unconformityHeight,\n );\n\n // This could perhaps be simplified.\n const sections1: PackageLayoutData<T>[] = [];\n for (const i in sections) {\n const group = sections[i];\n const scaleInfo = packages[i];\n sections1.push({\n ...group,\n key: scaleInfo.key,\n scaleInfo,\n });\n }\n return {\n totalHeight,\n sections: sections1,\n };\n}\n\nexport interface SectionInfoWithScale<\n T extends UnitLong = ExtUnit,\n> extends SectionInfo<T> {\n scaleInfo: PackageScaleInfo;\n}\n\nexport function computeSectionHeights<T extends UnitLong>(\n sections: SectionInfo<T>[],\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n return sections.map((group) => {\n return addScaleToSection<T>(group, opts);\n });\n}\n\nfunction addScaleToSection<T extends UnitLong = ExtUnit>(\n group: SectionInfo<T>,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T> {\n const { t_age, b_age, t_pos, b_pos, units } = group;\n let _range = null;\n // if t_age and b_age are set for a group, use them to define the range...\n if (opts.axisType == ColumnAxisType.AGE) {\n _range = [b_age, t_age];\n } else {\n _range = [b_pos, t_pos];\n }\n\n const scaleInfo = buildSectionScale<T>(units, {\n ...opts,\n domain: _range,\n });\n\n return {\n ...group,\n scaleInfo,\n };\n}\n\nfunction buildSectionScale<T extends UnitLong>(\n data: T[],\n opts: SectionScaleOptions,\n): PackageScaleInfo {\n const {\n targetUnitHeight = 20,\n minPixelScale = 0.2,\n axisType,\n minSectionHeight,\n scale,\n hybridScale,\n } = opts;\n const domain = opts.domain ?? findSectionHeightRange(data, axisType);\n\n const dAge = Math.abs(domain[0] - domain[1]);\n\n let _pixelScale = opts.pixelScale;\n let pixelHeight: number;\n\n if (hybridScale != null) {\n /** In an equidistant surfaces scale, we want to determine the heights of surfaces\n * and then distribute units evenly between them.\n * This is somewhat like an ordinal scale\n */\n if (hybridScale.type === HybridScaleType.EquidistantSurfaces) {\n _pixelScale ??= targetUnitHeight;\n }\n\n return buildHybridScale(hybridScale, data, domain, {\n pixelOffset: 0,\n pixelScale: _pixelScale,\n });\n }\n\n if (scale == null) {\n if (_pixelScale == null) {\n const avgAgeRange = findAverageUnitHeight(data, axisType);\n // Get pixel height necessary to render average unit at target height\n _pixelScale = Math.max(targetUnitHeight / avgAgeRange, minPixelScale);\n\n // OLD METHOD that cares about overall section height vs. individual unit height\n // 0.2 pixel per myr is the floor scale\n //const targetHeight = targetUnitHeight * data.length;\n // 1 pixel per myr is the floor scale\n //_pixelScale = Math.max(targetHeight / dAge, minPixelScale);\n }\n\n let height = dAge * _pixelScale;\n // If height is less than minSectionHeight, set it to minSectionHeight\n const _minSectionHeight = minSectionHeight ?? targetUnitHeight ?? 0;\n pixelHeight = Math.max(height, _minSectionHeight);\n _pixelScale = pixelHeight / dAge;\n } else {\n // If a scale is provided, use it to compute pixel height\n pixelHeight = Math.abs(scale(domain[0]) - scale(domain[1]));\n }\n\n return createPackageScale(\n { scale, domain, pixelHeight, pixelScale: _pixelScale },\n 0,\n );\n}\n\nexport function createPackageScale(\n def: PackageScaleInfo,\n offset: number = 0,\n): PackageScaleInfo {\n /** Build a section scale */\n // Domain should be oriented from bottom to top, but scale is oriented from top to bottom\n const { domain, pixelScale, pixelHeight, scale, heightScale } = def;\n\n if (scale == null && pixelScale == null) {\n throw new Error(\"Either scale or pixelScale must be provided\");\n }\n\n let _scale: ScaleContinuousNumeric<number, number>;\n if (scale == null) {\n _scale = scaleLinear()\n .domain([domain[1], domain[0]])\n .range([offset, pixelHeight + offset]);\n } else {\n const domain0 = scale.domain();\n const range0 = scale.range();\n _scale = scale\n .copy()\n .domain(domain0)\n .range(range0.map((d) => d + offset));\n }\n\n _scale.clamp();\n\n let _heightScale = null;\n if (heightScale != null) {\n // Adjust height scale as well\n const range0 = scale.range();\n _heightScale = heightScale.copy().range(range0.map((d) => d + offset));\n _heightScale.clamp();\n }\n\n return {\n domain,\n pixelScale,\n pixelHeight,\n scale: _scale,\n // Internal details for hybrid scales. TODO: improve this\n heightScale: _heightScale,\n };\n}\n\nfunction findSectionHeightRange(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): [number, number] {\n if (axisType == null) {\n throw new Error(\"Axis type is not set\");\n }\n if (axisType === ColumnAxisType.AGE) {\n const t_age = Math.min(...data.map((d) => d.t_age));\n const b_age = Math.max(...data.map((d) => d.b_age));\n return [b_age, t_age];\n } else if (\n axisType == ColumnAxisType.DEPTH ||\n axisType == ColumnAxisType.ORDINAL\n ) {\n const t_pos = Math.min(...data.map((d) => d.t_pos));\n const b_pos = Math.max(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n } else if (axisType == ColumnAxisType.HEIGHT) {\n const t_pos = Math.max(...data.map((d) => d.t_pos));\n const b_pos = Math.min(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n }\n}\n\nfunction findAverageUnitHeight(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): number {\n const unitHeights = data.map((d) => {\n const [b_pos, t_pos] = getUnitHeightRange(d, axisType);\n return Math.abs(b_pos - t_pos);\n });\n return unitHeights.reduce((a, b) => a + b, 0) / unitHeights.length;\n}\n\nexport interface CompositeColumnScale {\n (age: number): number | null;\n copy(): CompositeColumnScale;\n domain(): [number, number];\n invert(pixelHeight: number): number | null;\n clamp(clamp: boolean): void;\n}\n\nexport function createCompositeScale(\n sections: PackageLayoutData[],\n interpolateUnconformities: boolean = false,\n): CompositeColumnScale {\n /** Create a scale that works across multiple packages */\n\n const scales: ScaleContinuousNumeric<number, number>[] = [];\n\n let lastScale: ScaleContinuousNumeric<number, number> | null = null;\n for (const section of sections) {\n const _scale = section.scaleInfo.scale.copy().clamp(true);\n scales.push(_scale);\n if (lastScale != null && interpolateUnconformities) {\n // Add a new scale that interpolates between lastScale and _scale\n const lastDomain = lastScale.domain();\n const lastRange = lastScale.range();\n const currentDomain = _scale.domain();\n const currentRange = _scale.range();\n\n const interpScale = scaleLinear()\n .domain([lastDomain[lastDomain.length - 1], currentDomain[0]])\n .range([lastRange[lastRange.length - 1], currentRange[0]])\n .clamp(true);\n scales.push(interpScale);\n }\n lastScale = _scale;\n }\n\n const scale: CompositeColumnScale = (age) => {\n for (const s of scales) {\n const domain = s.domain();\n if (age >= domain[0] && age <= domain[domain.length - 1]) {\n return s(age);\n }\n }\n return null;\n };\n\n scale.copy = () => {\n return createCompositeScale(sections, interpolateUnconformities);\n };\n\n scale.domain = () => {\n /** Return the domain of the scale */\n const vals = sections.flatMap((d) => d.scaleInfo.domain);\n if (vals[0] < vals[vals.length - 1]) {\n // age axes\n return [Math.min(...vals), Math.max(...vals)];\n }\n // Normal axes like height\n return [Math.max(...vals), Math.min(...vals)];\n };\n\n scale.invert = (pixelHeight) => {\n /** Invert the scale to get the age at a given pixel height */\n // Iterate through the sections to find the correct one\n for (const scale of scales) {\n const range = scale.range();\n if (\n pixelHeight > Math.min(...range) &&\n pixelHeight <= Math.max(...range)\n ) {\n console.log(\"Inverting scale at pixel height\", pixelHeight);\n return scale.invert(pixelHeight);\n }\n }\n return null;\n };\n\n scale.clamp = (clamp: boolean) => {\n /** Clamp all constituent scales */\n for (const s of scales) {\n s.clamp(clamp);\n }\n };\n\n return scale;\n}\n\n/** Collapse sections separated by unconformities that are smaller than a given pixel height. */\nexport function collapseUnconformitiesByPixelHeight<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n threshold: number,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n const newSections = [];\n let currentSection: SectionInfoWithScale<T> | null = null;\n for (const nextSection of sections) {\n if (currentSection == null) {\n currentSection = nextSection;\n continue;\n }\n let heights: [number, number];\n let pxHeights: [number, number];\n if (opts.axisType !== ColumnAxisType.AGE) {\n heights = [nextSection.t_pos, currentSection.b_pos];\n } else {\n heights = [nextSection.t_age, currentSection.b_age];\n }\n\n const _diff = (vals: number[]) => {\n return Math.abs(vals[0] - vals[1]);\n };\n\n pxHeights = [\n _diff(heights.map(nextSection.scaleInfo.scale)),\n _diff(heights.map(currentSection.scaleInfo.scale)),\n ];\n\n const pxHeight = Math.min(...pxHeights);\n\n if (pxHeight < threshold) {\n let t_pos: number;\n let b_pos: number;\n if (\n opts.axisType == ColumnAxisType.AGE ||\n opts.axisType == ColumnAxisType.DEPTH\n ) {\n t_pos = Math.min(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.max(currentSection.b_pos, nextSection.b_pos);\n } else {\n t_pos = Math.max(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.min(currentSection.b_pos, nextSection.b_pos);\n }\n\n // We need to merge the sections\n const compositeSection0: SectionInfo<T> = {\n units: [...currentSection.units, ...nextSection.units],\n section_id: [\n ...ensureArray(currentSection.section_id),\n ...ensureArray(nextSection.section_id),\n ],\n t_age: Math.min(currentSection.t_age, nextSection.t_age),\n b_age: Math.max(currentSection.b_age, nextSection.b_age),\n t_pos,\n b_pos,\n };\n\n currentSection = addScaleToSection(compositeSection0, opts);\n } else {\n // We need to keep the section\n newSections.push(currentSection);\n currentSection = nextSection;\n }\n }\n if (currentSection != null) {\n newSections.push(currentSection);\n }\n\n return newSections;\n}\n"],"names":["ColumnAxisType","$d6XP3$ColumnAxisType","scaleLinear","$d6XP3$scaleLinear","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$dcPBY","$76iYI","$8054a162cb094378$export$e7184dd8bb3302ed","inputScales","unconformityHeight","totalHeight","lastSectionTopHeight","packages2","group","domain","scale","b_age","t_age","key","push","$8054a162cb094378$export$d6235b492bceb8c5","offset","paddingTop","Math","abs","sections","$8054a162cb094378$export$67442a0f5bef147b","packages","map","d","scaleInfo","sections1","i","$8054a162cb094378$export$7d3f3129a1a4b84e","opts","$8054a162cb094378$var$addScaleToSection","t_pos","b_pos","units","_range","axisType","AGE","$8054a162cb094378$var$buildSectionScale","data","pixelHeight","targetUnitHeight","minPixelScale","minSectionHeight","hybridScale","$8054a162cb094378$var$findSectionHeightRange","min","max","DEPTH","ORDINAL","HEIGHT","dAge","_pixelScale","pixelScale","type","HybridScaleType","EquidistantSurfaces","buildHybridScale","pixelOffset","$8054a162cb094378$var$findAverageUnitHeight","unitHeights","getUnitHeightRange","reduce","a","b","length","def","_scale","heightScale","range","domain0","range0","copy","clamp","_heightScale","$8054a162cb094378$export$3ada7641926a616d","interpolateUnconformities","scales","lastScale","section","lastDomain","lastRange","currentDomain","currentRange","interpScale","age","s","vals","flatMap","invert","console","log","$8054a162cb094378$export$edbf01b435c75274","threshold","newSections","currentSection","nextSection","heights","_diff","pxHeight","section_id","ensureArray","buildCompositeScaleInfo","createPackageScale","finalizeSectionHeights","computeSectionHeights","createCompositeScale","collapseUnconformitiesByPixelHeight"],"version":3,"file":"column-views.aef76eee.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,e,C,K,U,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,S,E,E,S,E,E,SC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AAI,CAAC,EAAE,CAAG,CAAI,CAAC,EAAE,EAUnC,GAAI,AAFa,KAAK,GAAG,CAJvB,EAAM,EAAQ,GAAG,CAAC,EAAY,SAAS,CAAC,KAAK,GAC7C,EAAM,EAAQ,GAAG,CAAC,EAAe,SAAS,CAAC,KAAK,IAKnC,EAAW,CACxB,IAAI,EACA,CAEF,CAAA,EAAK,QAAQ,EAAI,AAAA,EAAe,GAAG,EACnC,EAAK,QAAQ,EAAI,AAAA,EAAe,KAAK,EAErC,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACxD,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,IAExD,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACxD,EAAQ,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,GAgB1D,EAAiB,EAZyB,CACxC,MAAO,IAAI,EAAe,KAAK,IAAK,EAAY,KAAK,CAAC,CACtD,WAAY,IACP,AAAA,CAAA,EAAA,EAAA,WAAU,AAAV,EAAY,EAAe,UAAU,KACrC,AAAA,CAAA,EAAA,EAAA,WAAU,AAAV,EAAY,EAAY,UAAU,EACtC,CACD,MAAO,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACvD,MAAO,KAAK,GAAG,CAAC,EAAe,KAAK,CAAE,EAAY,KAAK,EACvD,MAAA,EACA,MAAA,CACF,EAEsD,EACxD,MAEE,EAAY,IAAI,CAAC,GACjB,EAAiB,CAErB,CAKA,OAJI,AAAkB,MAAlB,GACF,EAAY,IAAI,CAAC,GAGZ,CACT,Q,K,uB,C,K,kB,C,K,sB,C,K,qB,C,K,oB,C,K,mC","sources":["<anon>","packages/column-views/src/prepare-units/composite-scale.ts"],"sourcesContent":["import \"./column-views.dbb4a46b.js\";\nimport \"./column-views.5a9331a9.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {ColumnAxisType as $d6XP3$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {scaleLinear as $d6XP3$scaleLinear} from \"d3-scale\";\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\nvar $dcPBY = parcelRequire(\"dcPBY\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $8054a162cb094378$export$e7184dd8bb3302ed(inputScales, unconformityHeight) {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */ let totalHeight = unconformityHeight / 2;\n let lastSectionTopHeight = 0;\n const packages2 = [];\n for (const group of inputScales){\n const { domain: domain, scale: scale } = group;\n const [b_age, t_age] = domain;\n const key = `package-${b_age}-${t_age}`;\n packages2.push({\n ...$8054a162cb094378$export$d6235b492bceb8c5(group, totalHeight),\n key: key,\n offset: totalHeight,\n // Unconformity height above this particular section\n paddingTop: totalHeight - lastSectionTopHeight\n });\n const pixelHeight = Math.abs(scale(b_age) - scale(t_age));\n lastSectionTopHeight = totalHeight + pixelHeight;\n totalHeight = lastSectionTopHeight + unconformityHeight;\n }\n totalHeight += unconformityHeight / 2;\n return {\n totalHeight: totalHeight,\n sections: packages2\n };\n}\nfunction $8054a162cb094378$export$67442a0f5bef147b(sections, unconformityHeight) {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */ const sectionScales = sections.map((d)=>d.scaleInfo);\n const { totalHeight: totalHeight, sections: packages } = $8054a162cb094378$export$e7184dd8bb3302ed(sectionScales, unconformityHeight);\n // This could perhaps be simplified.\n const sections1 = [];\n for(const i in sections){\n const group = sections[i];\n const scaleInfo = packages[i];\n sections1.push({\n ...group,\n key: scaleInfo.key,\n scaleInfo: scaleInfo\n });\n }\n return {\n totalHeight: totalHeight,\n sections: sections1\n };\n}\nfunction $8054a162cb094378$export$7d3f3129a1a4b84e(sections, opts) {\n return sections.map((group)=>{\n return $8054a162cb094378$var$addScaleToSection(group, opts);\n });\n}\nfunction $8054a162cb094378$var$addScaleToSection(group, opts) {\n const { t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos, units: units } = group;\n let _range = null;\n // if t_age and b_age are set for a group, use them to define the range...\n if (opts.axisType == (0, $d6XP3$ColumnAxisType).AGE) _range = [\n b_age,\n t_age\n ];\n else _range = [\n b_pos,\n t_pos\n ];\n const scaleInfo = $8054a162cb094378$var$buildSectionScale(units, {\n ...opts,\n domain: _range\n });\n return {\n ...group,\n scaleInfo: scaleInfo\n };\n}\nfunction $8054a162cb094378$var$buildSectionScale(data, opts) {\n const { targetUnitHeight: targetUnitHeight = 20, minPixelScale: minPixelScale = 0.2, axisType: axisType, minSectionHeight: minSectionHeight, scale: scale, hybridScale: hybridScale } = opts;\n const domain = opts.domain ?? $8054a162cb094378$var$findSectionHeightRange(data, axisType);\n const dAge = Math.abs(domain[0] - domain[1]);\n let _pixelScale = opts.pixelScale;\n let pixelHeight;\n if (hybridScale != null) {\n /** In an equidistant surfaces scale, we want to determine the heights of surfaces\n * and then distribute units evenly between them.\n * This is somewhat like an ordinal scale\n */ if (hybridScale.type === (0, $76iYI.HybridScaleType).EquidistantSurfaces) _pixelScale ?? (_pixelScale = targetUnitHeight);\n return (0, $dcPBY.buildHybridScale)(hybridScale, data, domain, {\n pixelOffset: 0,\n pixelScale: _pixelScale\n });\n }\n if (scale == null) {\n if (_pixelScale == null) {\n const avgAgeRange = $8054a162cb094378$var$findAverageUnitHeight(data, axisType);\n // Get pixel height necessary to render average unit at target height\n _pixelScale = Math.max(targetUnitHeight / avgAgeRange, minPixelScale);\n // OLD METHOD that cares about overall section height vs. individual unit height\n // 0.2 pixel per myr is the floor scale\n //const targetHeight = targetUnitHeight * data.length;\n // 1 pixel per myr is the floor scale\n //_pixelScale = Math.max(targetHeight / dAge, minPixelScale);\n }\n let height = dAge * _pixelScale;\n // If height is less than minSectionHeight, set it to minSectionHeight\n const _minSectionHeight = minSectionHeight ?? targetUnitHeight ?? 0;\n pixelHeight = Math.max(height, _minSectionHeight);\n _pixelScale = pixelHeight / dAge;\n } else // If a scale is provided, use it to compute pixel height\n pixelHeight = Math.abs(scale(domain[0]) - scale(domain[1]));\n return $8054a162cb094378$export$d6235b492bceb8c5({\n scale: scale,\n domain: domain,\n pixelHeight: pixelHeight,\n pixelScale: _pixelScale\n }, 0);\n}\nfunction $8054a162cb094378$export$d6235b492bceb8c5(def, offset = 0) {\n /** Build a section scale */ // Domain should be oriented from bottom to top, but scale is oriented from top to bottom\n const { domain: domain, pixelScale: pixelScale, pixelHeight: pixelHeight, scale: scale, heightScale: heightScale } = def;\n if (scale == null && pixelScale == null) throw new Error(\"Either scale or pixelScale must be provided\");\n let _scale;\n if (scale == null) _scale = (0, $d6XP3$scaleLinear)().domain([\n domain[1],\n domain[0]\n ]).range([\n offset,\n pixelHeight + offset\n ]);\n else {\n const domain0 = scale.domain();\n const range0 = scale.range();\n _scale = scale.copy().domain(domain0).range(range0.map((d)=>d + offset));\n }\n _scale.clamp();\n let _heightScale = null;\n if (heightScale != null) {\n // Adjust height scale as well\n const range0 = scale.range();\n _heightScale = heightScale.copy().range(range0.map((d)=>d + offset));\n _heightScale.clamp();\n }\n return {\n domain: domain,\n pixelScale: pixelScale,\n pixelHeight: pixelHeight,\n scale: _scale,\n // Internal details for hybrid scales. TODO: improve this\n heightScale: _heightScale\n };\n}\nfunction $8054a162cb094378$var$findSectionHeightRange(data, axisType) {\n if (axisType == null) throw new Error(\"Axis type is not set\");\n if (axisType === (0, $d6XP3$ColumnAxisType).AGE) {\n const t_age = Math.min(...data.map((d)=>d.t_age));\n const b_age = Math.max(...data.map((d)=>d.b_age));\n return [\n b_age,\n t_age\n ];\n } else if (axisType == (0, $d6XP3$ColumnAxisType).DEPTH || axisType == (0, $d6XP3$ColumnAxisType).ORDINAL) {\n const t_pos = Math.min(...data.map((d)=>d.t_pos));\n const b_pos = Math.max(...data.map((d)=>d.b_pos));\n return [\n b_pos,\n t_pos\n ];\n } else if (axisType == (0, $d6XP3$ColumnAxisType).HEIGHT) {\n const t_pos = Math.max(...data.map((d)=>d.t_pos));\n const b_pos = Math.min(...data.map((d)=>d.b_pos));\n return [\n b_pos,\n t_pos\n ];\n }\n}\nfunction $8054a162cb094378$var$findAverageUnitHeight(data, axisType) {\n const unitHeights = data.map((d)=>{\n const [b_pos, t_pos] = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n return Math.abs(b_pos - t_pos);\n });\n return unitHeights.reduce((a, b)=>a + b, 0) / unitHeights.length;\n}\nfunction $8054a162cb094378$export$3ada7641926a616d(sections, interpolateUnconformities = false) {\n /** Create a scale that works across multiple packages */ const scales = [];\n let lastScale = null;\n for (const section of sections){\n const _scale = section.scaleInfo.scale.copy().clamp(true);\n scales.push(_scale);\n if (lastScale != null && interpolateUnconformities) {\n // Add a new scale that interpolates between lastScale and _scale\n const lastDomain = lastScale.domain();\n const lastRange = lastScale.range();\n const currentDomain = _scale.domain();\n const currentRange = _scale.range();\n const interpScale = (0, $d6XP3$scaleLinear)().domain([\n lastDomain[lastDomain.length - 1],\n currentDomain[0]\n ]).range([\n lastRange[lastRange.length - 1],\n currentRange[0]\n ]).clamp(true);\n scales.push(interpScale);\n }\n lastScale = _scale;\n }\n const scale = (age)=>{\n for (const s of scales){\n const domain = s.domain();\n if (age >= domain[0] && age <= domain[domain.length - 1]) return s(age);\n }\n return null;\n };\n scale.copy = ()=>{\n return $8054a162cb094378$export$3ada7641926a616d(sections, interpolateUnconformities);\n };\n scale.domain = ()=>{\n /** Return the domain of the scale */ const vals = sections.flatMap((d)=>d.scaleInfo.domain);\n if (vals[0] < vals[vals.length - 1]) // age axes\n return [\n Math.min(...vals),\n Math.max(...vals)\n ];\n // Normal axes like height\n return [\n Math.max(...vals),\n Math.min(...vals)\n ];\n };\n scale.invert = (pixelHeight)=>{\n /** Invert the scale to get the age at a given pixel height */ // Iterate through the sections to find the correct one\n for (const scale of scales){\n const range = scale.range();\n if (pixelHeight > Math.min(...range) && pixelHeight <= Math.max(...range)) {\n console.log(\"Inverting scale at pixel height\", pixelHeight);\n return scale.invert(pixelHeight);\n }\n }\n return null;\n };\n scale.clamp = (clamp)=>{\n /** Clamp all constituent scales */ for (const s of scales)s.clamp(clamp);\n };\n return scale;\n}\nfunction $8054a162cb094378$export$edbf01b435c75274(sections, threshold, opts) {\n const newSections = [];\n let currentSection = null;\n for (const nextSection of sections){\n if (currentSection == null) {\n currentSection = nextSection;\n continue;\n }\n let heights;\n let pxHeights;\n if (opts.axisType !== (0, $d6XP3$ColumnAxisType).AGE) heights = [\n nextSection.t_pos,\n currentSection.b_pos\n ];\n else heights = [\n nextSection.t_age,\n currentSection.b_age\n ];\n const _diff = (vals)=>{\n return Math.abs(vals[0] - vals[1]);\n };\n pxHeights = [\n _diff(heights.map(nextSection.scaleInfo.scale)),\n _diff(heights.map(currentSection.scaleInfo.scale))\n ];\n const pxHeight = Math.min(...pxHeights);\n if (pxHeight < threshold) {\n let t_pos;\n let b_pos;\n if (opts.axisType == (0, $d6XP3$ColumnAxisType).AGE || opts.axisType == (0, $d6XP3$ColumnAxisType).DEPTH) {\n t_pos = Math.min(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.max(currentSection.b_pos, nextSection.b_pos);\n } else {\n t_pos = Math.max(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.min(currentSection.b_pos, nextSection.b_pos);\n }\n // We need to merge the sections\n const compositeSection0 = {\n units: [\n ...currentSection.units,\n ...nextSection.units\n ],\n section_id: [\n ...(0, $iWhRv.ensureArray)(currentSection.section_id),\n ...(0, $iWhRv.ensureArray)(nextSection.section_id)\n ],\n t_age: Math.min(currentSection.t_age, nextSection.t_age),\n b_age: Math.max(currentSection.b_age, nextSection.b_age),\n t_pos: t_pos,\n b_pos: b_pos\n };\n currentSection = $8054a162cb094378$var$addScaleToSection(compositeSection0, opts);\n } else {\n // We need to keep the section\n newSections.push(currentSection);\n currentSection = nextSection;\n }\n }\n if (currentSection != null) newSections.push(currentSection);\n return newSections;\n}\n\n\nexport {$8054a162cb094378$export$e7184dd8bb3302ed as buildCompositeScaleInfo, $8054a162cb094378$export$d6235b492bceb8c5 as createPackageScale, $8054a162cb094378$export$67442a0f5bef147b as finalizeSectionHeights, $8054a162cb094378$export$7d3f3129a1a4b84e as computeSectionHeights, $8054a162cb094378$export$3ada7641926a616d as createCompositeScale, $8054a162cb094378$export$edbf01b435c75274 as collapseUnconformitiesByPixelHeight};\n//# sourceMappingURL=column-views.a596b1f5.js.map\n","import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { ensureArray, getUnitHeightRange } from \"./utils\";\nimport { ScaleContinuousNumeric, scaleLinear } from \"d3-scale\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { buildHybridScale } from \"./dynamic-scales\";\nimport { ExtUnit, HybridScaleType, SectionInfo } from \"./types\";\nimport type {\n ColumnScaleOptions,\n CompositeColumnData,\n CompositeScaleData,\n PackageLayoutData,\n PackageScaleInfo,\n PackageScaleLayoutData,\n SectionScaleOptions,\n} from \"./types\";\n\n// Composite scale information augmented with units in each package\n\nexport function buildCompositeScaleInfo(\n inputScales: PackageScaleInfo[],\n unconformityHeight: number,\n): CompositeScaleData {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n let totalHeight = unconformityHeight / 2;\n let lastSectionTopHeight = 0;\n\n const packages2: PackageScaleLayoutData[] = [];\n for (const group of inputScales) {\n const { domain, scale } = group;\n const [b_age, t_age] = domain;\n const key = `package-${b_age}-${t_age}`;\n\n packages2.push({\n ...createPackageScale(group, totalHeight),\n key,\n offset: totalHeight,\n // Unconformity height above this particular section\n paddingTop: totalHeight - lastSectionTopHeight,\n });\n\n const pixelHeight = Math.abs(scale(b_age) - scale(t_age));\n lastSectionTopHeight = totalHeight + pixelHeight;\n totalHeight = lastSectionTopHeight + unconformityHeight;\n }\n totalHeight += unconformityHeight / 2;\n return {\n totalHeight,\n sections: packages2,\n };\n}\n\nexport function finalizeSectionHeights<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n unconformityHeight: number,\n): CompositeColumnData<T> {\n /** Finalize the heights of sections, including the heights of unconformities\n * between them.\n */\n\n const sectionScales = sections.map((d) => d.scaleInfo);\n\n const { totalHeight, sections: packages } = buildCompositeScaleInfo(\n sectionScales,\n unconformityHeight,\n );\n\n // This could perhaps be simplified.\n const sections1: PackageLayoutData<T>[] = [];\n for (const i in sections) {\n const group = sections[i];\n const scaleInfo = packages[i];\n sections1.push({\n ...group,\n key: scaleInfo.key,\n scaleInfo,\n });\n }\n return {\n totalHeight,\n sections: sections1,\n };\n}\n\nexport interface SectionInfoWithScale<\n T extends UnitLong = ExtUnit,\n> extends SectionInfo<T> {\n scaleInfo: PackageScaleInfo;\n}\n\nexport function computeSectionHeights<T extends UnitLong>(\n sections: SectionInfo<T>[],\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n return sections.map((group) => {\n return addScaleToSection<T>(group, opts);\n });\n}\n\nfunction addScaleToSection<T extends UnitLong = ExtUnit>(\n group: SectionInfo<T>,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T> {\n const { t_age, b_age, t_pos, b_pos, units } = group;\n let _range = null;\n // if t_age and b_age are set for a group, use them to define the range...\n if (opts.axisType == ColumnAxisType.AGE) {\n _range = [b_age, t_age];\n } else {\n _range = [b_pos, t_pos];\n }\n\n const scaleInfo = buildSectionScale<T>(units, {\n ...opts,\n domain: _range,\n });\n\n return {\n ...group,\n scaleInfo,\n };\n}\n\nfunction buildSectionScale<T extends UnitLong>(\n data: T[],\n opts: SectionScaleOptions,\n): PackageScaleInfo {\n const {\n targetUnitHeight = 20,\n minPixelScale = 0.2,\n axisType,\n minSectionHeight,\n scale,\n hybridScale,\n } = opts;\n const domain = opts.domain ?? findSectionHeightRange(data, axisType);\n\n const dAge = Math.abs(domain[0] - domain[1]);\n\n let _pixelScale = opts.pixelScale;\n let pixelHeight: number;\n\n if (hybridScale != null) {\n /** In an equidistant surfaces scale, we want to determine the heights of surfaces\n * and then distribute units evenly between them.\n * This is somewhat like an ordinal scale\n */\n if (hybridScale.type === HybridScaleType.EquidistantSurfaces) {\n _pixelScale ??= targetUnitHeight;\n }\n\n return buildHybridScale(hybridScale, data, domain, {\n pixelOffset: 0,\n pixelScale: _pixelScale,\n });\n }\n\n if (scale == null) {\n if (_pixelScale == null) {\n const avgAgeRange = findAverageUnitHeight(data, axisType);\n // Get pixel height necessary to render average unit at target height\n _pixelScale = Math.max(targetUnitHeight / avgAgeRange, minPixelScale);\n\n // OLD METHOD that cares about overall section height vs. individual unit height\n // 0.2 pixel per myr is the floor scale\n //const targetHeight = targetUnitHeight * data.length;\n // 1 pixel per myr is the floor scale\n //_pixelScale = Math.max(targetHeight / dAge, minPixelScale);\n }\n\n let height = dAge * _pixelScale;\n // If height is less than minSectionHeight, set it to minSectionHeight\n const _minSectionHeight = minSectionHeight ?? targetUnitHeight ?? 0;\n pixelHeight = Math.max(height, _minSectionHeight);\n _pixelScale = pixelHeight / dAge;\n } else {\n // If a scale is provided, use it to compute pixel height\n pixelHeight = Math.abs(scale(domain[0]) - scale(domain[1]));\n }\n\n return createPackageScale(\n { scale, domain, pixelHeight, pixelScale: _pixelScale },\n 0,\n );\n}\n\nexport function createPackageScale(\n def: PackageScaleInfo,\n offset: number = 0,\n): PackageScaleInfo {\n /** Build a section scale */\n // Domain should be oriented from bottom to top, but scale is oriented from top to bottom\n const { domain, pixelScale, pixelHeight, scale, heightScale } = def;\n\n if (scale == null && pixelScale == null) {\n throw new Error(\"Either scale or pixelScale must be provided\");\n }\n\n let _scale: ScaleContinuousNumeric<number, number>;\n if (scale == null) {\n _scale = scaleLinear()\n .domain([domain[1], domain[0]])\n .range([offset, pixelHeight + offset]);\n } else {\n const domain0 = scale.domain();\n const range0 = scale.range();\n _scale = scale\n .copy()\n .domain(domain0)\n .range(range0.map((d) => d + offset));\n }\n\n _scale.clamp();\n\n let _heightScale = null;\n if (heightScale != null) {\n // Adjust height scale as well\n const range0 = scale.range();\n _heightScale = heightScale.copy().range(range0.map((d) => d + offset));\n _heightScale.clamp();\n }\n\n return {\n domain,\n pixelScale,\n pixelHeight,\n scale: _scale,\n // Internal details for hybrid scales. TODO: improve this\n heightScale: _heightScale,\n };\n}\n\nfunction findSectionHeightRange(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): [number, number] {\n if (axisType == null) {\n throw new Error(\"Axis type is not set\");\n }\n if (axisType === ColumnAxisType.AGE) {\n const t_age = Math.min(...data.map((d) => d.t_age));\n const b_age = Math.max(...data.map((d) => d.b_age));\n return [b_age, t_age];\n } else if (\n axisType == ColumnAxisType.DEPTH ||\n axisType == ColumnAxisType.ORDINAL\n ) {\n const t_pos = Math.min(...data.map((d) => d.t_pos));\n const b_pos = Math.max(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n } else if (axisType == ColumnAxisType.HEIGHT) {\n const t_pos = Math.max(...data.map((d) => d.t_pos));\n const b_pos = Math.min(...data.map((d) => d.b_pos));\n return [b_pos, t_pos];\n }\n}\n\nfunction findAverageUnitHeight(\n data: UnitLong[],\n axisType: ColumnAxisType,\n): number {\n const unitHeights = data.map((d) => {\n const [b_pos, t_pos] = getUnitHeightRange(d, axisType);\n return Math.abs(b_pos - t_pos);\n });\n return unitHeights.reduce((a, b) => a + b, 0) / unitHeights.length;\n}\n\nexport interface CompositeColumnScale {\n (age: number): number | null;\n copy(): CompositeColumnScale;\n domain(): [number, number];\n invert(pixelHeight: number): number | null;\n clamp(clamp: boolean): void;\n}\n\nexport function createCompositeScale(\n sections: PackageLayoutData[],\n interpolateUnconformities: boolean = false,\n): CompositeColumnScale {\n /** Create a scale that works across multiple packages */\n\n const scales: ScaleContinuousNumeric<number, number>[] = [];\n\n let lastScale: ScaleContinuousNumeric<number, number> | null = null;\n for (const section of sections) {\n const _scale = section.scaleInfo.scale.copy().clamp(true);\n scales.push(_scale);\n if (lastScale != null && interpolateUnconformities) {\n // Add a new scale that interpolates between lastScale and _scale\n const lastDomain = lastScale.domain();\n const lastRange = lastScale.range();\n const currentDomain = _scale.domain();\n const currentRange = _scale.range();\n\n const interpScale = scaleLinear()\n .domain([lastDomain[lastDomain.length - 1], currentDomain[0]])\n .range([lastRange[lastRange.length - 1], currentRange[0]])\n .clamp(true);\n scales.push(interpScale);\n }\n lastScale = _scale;\n }\n\n const scale: CompositeColumnScale = (age) => {\n for (const s of scales) {\n const domain = s.domain();\n if (age >= domain[0] && age <= domain[domain.length - 1]) {\n return s(age);\n }\n }\n return null;\n };\n\n scale.copy = () => {\n return createCompositeScale(sections, interpolateUnconformities);\n };\n\n scale.domain = () => {\n /** Return the domain of the scale */\n const vals = sections.flatMap((d) => d.scaleInfo.domain);\n if (vals[0] < vals[vals.length - 1]) {\n // age axes\n return [Math.min(...vals), Math.max(...vals)];\n }\n // Normal axes like height\n return [Math.max(...vals), Math.min(...vals)];\n };\n\n scale.invert = (pixelHeight) => {\n /** Invert the scale to get the age at a given pixel height */\n // Iterate through the sections to find the correct one\n for (const scale of scales) {\n const range = scale.range();\n if (\n pixelHeight > Math.min(...range) &&\n pixelHeight <= Math.max(...range)\n ) {\n console.log(\"Inverting scale at pixel height\", pixelHeight);\n return scale.invert(pixelHeight);\n }\n }\n return null;\n };\n\n scale.clamp = (clamp: boolean) => {\n /** Clamp all constituent scales */\n for (const s of scales) {\n s.clamp(clamp);\n }\n };\n\n return scale;\n}\n\n/** Collapse sections separated by unconformities that are smaller than a given pixel height. */\nexport function collapseUnconformitiesByPixelHeight<T extends UnitLong>(\n sections: SectionInfoWithScale<T>[],\n threshold: number,\n opts: ColumnScaleOptions,\n): SectionInfoWithScale<T>[] {\n const newSections = [];\n let currentSection: SectionInfoWithScale<T> | null = null;\n for (const nextSection of sections) {\n if (currentSection == null) {\n currentSection = nextSection;\n continue;\n }\n let heights: [number, number];\n let pxHeights: [number, number];\n if (opts.axisType !== ColumnAxisType.AGE) {\n heights = [nextSection.t_pos, currentSection.b_pos];\n } else {\n heights = [nextSection.t_age, currentSection.b_age];\n }\n\n const _diff = (vals: number[]) => {\n return Math.abs(vals[0] - vals[1]);\n };\n\n pxHeights = [\n _diff(heights.map(nextSection.scaleInfo.scale)),\n _diff(heights.map(currentSection.scaleInfo.scale)),\n ];\n\n const pxHeight = Math.min(...pxHeights);\n\n if (pxHeight < threshold) {\n let t_pos: number;\n let b_pos: number;\n if (\n opts.axisType == ColumnAxisType.AGE ||\n opts.axisType == ColumnAxisType.DEPTH\n ) {\n t_pos = Math.min(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.max(currentSection.b_pos, nextSection.b_pos);\n } else {\n t_pos = Math.max(currentSection.t_pos, nextSection.t_pos);\n b_pos = Math.min(currentSection.b_pos, nextSection.b_pos);\n }\n\n // We need to merge the sections\n const compositeSection0: SectionInfo<T> = {\n units: [...currentSection.units, ...nextSection.units],\n section_id: [\n ...ensureArray(currentSection.section_id),\n ...ensureArray(nextSection.section_id),\n ],\n t_age: Math.min(currentSection.t_age, nextSection.t_age),\n b_age: Math.max(currentSection.b_age, nextSection.b_age),\n t_pos,\n b_pos,\n };\n\n currentSection = addScaleToSection(compositeSection0, opts);\n } else {\n // We need to keep the section\n newSections.push(currentSection);\n currentSection = nextSection;\n }\n }\n if (currentSection != null) {\n newSections.push(currentSection);\n }\n\n return newSections;\n}\n"],"names":["ColumnAxisType","$d6XP3$ColumnAxisType","scaleLinear","$d6XP3$scaleLinear","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$dcPBY","$76iYI","$8054a162cb094378$export$e7184dd8bb3302ed","inputScales","unconformityHeight","totalHeight","lastSectionTopHeight","packages2","group","domain","scale","b_age","t_age","key","push","$8054a162cb094378$export$d6235b492bceb8c5","offset","paddingTop","Math","abs","sections","$8054a162cb094378$export$67442a0f5bef147b","packages","map","d","scaleInfo","sections1","i","$8054a162cb094378$export$7d3f3129a1a4b84e","opts","$8054a162cb094378$var$addScaleToSection","t_pos","b_pos","units","_range","axisType","AGE","$8054a162cb094378$var$buildSectionScale","data","pixelHeight","targetUnitHeight","minPixelScale","minSectionHeight","hybridScale","$8054a162cb094378$var$findSectionHeightRange","min","max","DEPTH","ORDINAL","HEIGHT","dAge","_pixelScale","pixelScale","type","HybridScaleType","EquidistantSurfaces","buildHybridScale","pixelOffset","$8054a162cb094378$var$findAverageUnitHeight","unitHeights","getUnitHeightRange","reduce","a","b","length","def","_scale","heightScale","range","domain0","range0","copy","clamp","_heightScale","$8054a162cb094378$export$3ada7641926a616d","interpolateUnconformities","scales","lastScale","section","lastDomain","lastRange","currentDomain","currentRange","interpScale","age","s","vals","flatMap","invert","console","log","$8054a162cb094378$export$edbf01b435c75274","threshold","newSections","currentSection","nextSection","heights","_diff","pxHeight","section_id","ensureArray","buildCompositeScaleInfo","createPackageScale","finalizeSectionHeights","computeSectionHeights","createCompositeScale","collapseUnconformitiesByPixelHeight"],"version":3,"file":"column-views.a596b1f5.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ import"./column-views.fac4baff.js";import"./column-views.1d064426.js";import"./column-views.46efb749.js";import"./column-views.672b683c.js";import"./column-views.dbb4a46b.js";import"./column-views.b6e86cf0.js";import e from"@macrostrat/hyper";import{ColumnAxisType as t}from"@macrostrat/column-components";import{scaleLinear as n}from"d3-scale";function o(e,t,n,o){Object.defineProperty(e,t,{get:n,set:o,enumerable:!0,configurable:!0})}var l=globalThis,a={},r={},i=l.parcelRequirea149;null==i&&((i=function(e){if(e in a)return a[e].exports;if(e in r){var t=r[e];delete r[e];var n={id:e,exports:{}};return a[e]=n,t.call(n.exports,n,n.exports),n.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){r[e]=t},l.parcelRequirea149=i),i.register;var s={};o(s,"PBDBFossilsColumn",()=>b),o(s,"FossilDataType",()=>i("dx7no").FossilDataType);var u=i("dx7no"),c=i("kIQUG"),f=i("wtIgl"),m=i("f7qDU"),p=i("iWhRv"),d=i("6dOaS");let _=e.styled(m&&m.__esModule?m.default:m);function b({columnID:e,type:o=u.FossilDataType.Collections}){let l=(0,u.useFossilData)(e,o),{axisType:a,units:r}=(0,f.useMacrostratColumnData)(),i=(0,f.useCompositeScale)();if(null==l||null==r||null==i)return null;let s=function(e,o,l,a,r){let{groupCloseNotes:i=!0}=(void 0)??{},s=new Map;for(let l of e){let e=function(e,o,l){let a=null;if(null!=e.slb&&"mbsf"==e.slu&&(a=Number(e.slb),l===t.DEPTH))return{height:a};if(null==e.unit_id)return null;if(null!=a){let r=o.find(t=>t.unit_id===e.unit_id);if(null==r)return null;let i=function(e,t,o){let l=n((0,p.getUnitHeightRange)(t,o,!1)).domain([0,1]).invert(e);return l<0||l>1?null:l}(a,r,t.DEPTH);return null==i?null:{height:a=(0,p.getPositionWithinUnit)(i,r,l)}}return(0,c.standardizeMeasurementHeight)({unit_id:e.unit_id},o,l)}(l,o,a);if(null==e)continue;let{height:r,top_height:i}=e,u=`${r}`;null!=i&&(u+=`-${i}`),s.has(u)||s.set(u,{height:r,top_height:i??r,data:[],id:u}),s.get(u).data.push(l)}return(0,c.groupNotesByPixelDistance)(Array.from(s.values()),l,a,"number"==typeof i?i:10)}(l,r,i,a);return _(c.BaseMeasurementsColumn,{data:s,noteComponent:h,focusedNoteComponent:h,className:"fossil-collections"})}function h(e){let{note:t,maxItems:n,focused:o=!1}=e,{data:l}=t;return l.sort((e,t)=>{let n=e.best_name??e.cltn_name??"",o=t.best_name??t.cltn_name??"";return n.localeCompare(o)}),_(c.TruncatedList,{data:l,className:"fossil-collections",itemRenderer:g,maxItems:o?1/0:n??5})}function g({data:e}){return _("a.link-id",{href:`https://paleobiodb.org/app/collections#display=col:${e.cltn_id}`,target:"_blank",onClick(e){e.stopPropagation()}},e.best_name??e.cltn_name)}Object.keys(d).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(s,e)||Object.defineProperty(s,e,{enumerable:!0,get:function(){return d[e]}})});export{b as PBDBFossilsColumn,$8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType,$8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType,$9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix};
2
+ //# sourceMappingURL=column-views.af480651.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,kB,C,K,+B,A,Q,e,C,K,U,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,oB,I,G,E,E,iB,I,A,E,S,c,E,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SC6BA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAIhB,SAAS,EAAkB,CAAA,SAChC,CA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AE,SAAS,EAAI,EAAE,SAAS,EAAI,GACtC,EAAQ,EAAE,SAAS,EAAI,EAAE,SAAS,EAAI,GAC5C,OAAO,EAAM,aAAa,CAAC,EAC7B,GAEO,EAAE,EAAA,aAAY,CAAG,CACtB,KAAA,EACA,UAAW,qBACX,aAAc,EACd,SAAU,EAAU,IAAY,GAAY,CAC9C,EACF,CAKA,SAAS,EAAmB,CAAA,KAC1B,CAAI,CAGL,EAEC,OAAO,EACL,YACA,CACE,KAAM,CAAC,mDAAmD,EAAE,EAAK,OAAO,CAAA,CAAE,CAC1E,OAAQ,SACR,QAAQ,CAAC,EACP,EAAE,eAAe,EACnB,CACF,EACA,EAAK,SAAS,EAAI,EAAK,SAAS,CAEpC,C,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,A,C,C,E,A,C,E,U,K,iB,C,6C,c,C,6C,c,C,6C,qB","sources":["<anon>","packages/column-views/src/facets/fossils/index.ts"],"sourcesContent":["import \"./column-views.fac4baff.js\";\nimport \"./column-views.1d064426.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.672b683c.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport \"./column-views.b6e86cf0.js\";\nimport $2jHE4$macrostrathyper from \"@macrostrat/hyper\";\nimport {ColumnAxisType as $2jHE4$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {scaleLinear as $2jHE4$scaleLinear} from \"d3-scale\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $ea2f112131e22f14$exports = {};\n\n$parcel$export($ea2f112131e22f14$exports, \"PBDBFossilsColumn\", () => $ea2f112131e22f14$export$554267114407ef68);\n$parcel$export($ea2f112131e22f14$exports, \"FossilDataType\", () => (parcelRequire(\"dx7no\")).FossilDataType);\n\n\nvar $dx7no = parcelRequire(\"dx7no\");\n\nvar $kIQUG = parcelRequire(\"kIQUG\");\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $f7qDU = parcelRequire(\"f7qDU\");\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\nvar $6dOaS = parcelRequire(\"6dOaS\");\nconst $ea2f112131e22f14$var$h = (0, $2jHE4$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($f7qDU))));\nfunction $ea2f112131e22f14$export$554267114407ef68({ columnID: columnID, type: type = (0, $dx7no.FossilDataType).Collections }) {\n const data = (0, $dx7no.useFossilData)(columnID, type);\n const { axisType: axisType, units: units } = (0, $wtIgl.useMacrostratColumnData)();\n const scale = (0, $wtIgl.useCompositeScale)();\n if (data == null || units == null || scale == null) return null;\n const data1 = $ea2f112131e22f14$var$preparePBDBData(data, units, scale, axisType);\n return $ea2f112131e22f14$var$h((0, $kIQUG.BaseMeasurementsColumn), {\n data: data1,\n noteComponent: $ea2f112131e22f14$var$FossilInfo,\n focusedNoteComponent: $ea2f112131e22f14$var$FossilInfo,\n className: \"fossil-collections\"\n });\n}\nfunction $ea2f112131e22f14$var$FossilInfo(props) {\n const { note: note, maxItems: maxItems, focused: focused = false } = props;\n const { data: data } = note;\n // Sort collections by name\n data.sort((a, b)=>{\n const nameA = a.best_name ?? a.cltn_name ?? \"\";\n const nameB = b.best_name ?? b.cltn_name ?? \"\";\n return nameA.localeCompare(nameB);\n });\n return $ea2f112131e22f14$var$h((0, $kIQUG.TruncatedList), {\n data: data,\n className: \"fossil-collections\",\n itemRenderer: $ea2f112131e22f14$var$PBDBCollectionLink,\n maxItems: focused ? Infinity : maxItems ?? 5\n });\n}\nconst $ea2f112131e22f14$var$FocusedFossilInfo = (props)=>$ea2f112131e22f14$var$h($ea2f112131e22f14$var$FossilInfo, {\n ...props,\n maxItems: Infinity\n });\nfunction $ea2f112131e22f14$var$PBDBCollectionLink({ data: data }) {\n /** A link to a PBDB collection that handles either an occurrence or collection object */ return $ea2f112131e22f14$var$h(\"a.link-id\", {\n href: `https://paleobiodb.org/app/collections#display=col:${data.cltn_id}`,\n target: \"_blank\",\n onClick (e) {\n e.stopPropagation();\n }\n }, data.best_name ?? data.cltn_name);\n}\nfunction $ea2f112131e22f14$var$preparePBDBData(data, units, scale, axisType, options) {\n /** Prepare PBDB fossil data for display in a measurements column */ const { groupCloseNotes: groupCloseNotes = true } = options ?? {};\n const groupDistance = typeof groupCloseNotes === \"number\" ? groupCloseNotes : 10;\n // Map of data to its defined height ranges\n const dataMap = new Map();\n // Todo: if we wanted, we could add a step where we group notes that are too close together here...\n for (const d of data){\n const range = $ea2f112131e22f14$var$getHeightRangeForPBDBEntity(d, units, axisType);\n if (range == null) continue;\n const { height: height, top_height: top_height } = range;\n // compose the key based on height info\n let key = `${height}`;\n if (top_height != null) key += `-${top_height}`;\n // Group by height key\n if (!dataMap.has(key)) dataMap.set(key, {\n height: height,\n top_height: top_height ?? height,\n data: [],\n id: key\n });\n dataMap.get(key).data.push(d);\n }\n return (0, $kIQUG.groupNotesByPixelDistance)(Array.from(dataMap.values()), scale, axisType, groupDistance);\n}\nfunction $ea2f112131e22f14$var$getHeightRangeForPBDBEntity(d, units, axisType) {\n let height = null;\n if (d.slb != null && d.slu == \"mbsf\") {\n // Meters below sea floor - special case for eODP where we have\n // specific depth data referenced\n height = Number(d.slb);\n if (axisType === (0, $2jHE4$ColumnAxisType).DEPTH) // Data is already in depth units\n return {\n height: height\n };\n }\n if (d.unit_id == null) return null;\n if (height != null) {\n // If we have both height and unit info, we need to adjust the height\n // to fit whatever scale type we're using.\n // TODO: we could improve how this works by having concurrent age and\n // height scales, which would allow us to do this without having to\n // reference to a specific unit.\n const unit = units.find((u)=>u.unit_id === d.unit_id);\n if (unit == null) return null;\n const relHeight = $ea2f112131e22f14$var$getRelativePositionInUnit(height, unit, (0, $2jHE4$ColumnAxisType).DEPTH);\n if (relHeight == null) return null;\n height = (0, $iWhRv.getPositionWithinUnit)(relHeight, unit, axisType);\n return {\n height: height\n };\n }\n // We can just get the height within the unit, clipped to the unit boundaries\n return (0, $kIQUG.standardizeMeasurementHeight)({\n unit_id: d.unit_id\n }, units, axisType);\n}\nfunction $ea2f112131e22f14$var$getRelativePositionInUnit(pos, unit, axisType) {\n // This is the inverse of getPositionWithinUnit\n const heights = (0, $iWhRv.getUnitHeightRange)(unit, axisType, false);\n const scale = (0, $2jHE4$scaleLinear)(heights).domain([\n 0,\n 1\n ]);\n const relPos = scale.invert(pos);\n if (relPos < 0 || relPos > 1) return null;\n return relPos;\n}\n$parcel$exportWildcard($ea2f112131e22f14$exports, $6dOaS);\n\n\nexport {$ea2f112131e22f14$export$554267114407ef68 as PBDBFossilsColumn, $8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType, $8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType, $9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix};\n//# sourceMappingURL=column-views.af480651.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport {\n FossilDataType,\n PBDBCollection,\n PBDBEntity,\n PBDBOccurrence,\n useFossilData,\n} from \"./provider\";\nimport type { CompositeColumnScale, IUnit } from \"../../units\";\nimport {\n BaseMeasurementsColumn,\n ColumnMeasurementData,\n MeasurementHeightData,\n standardizeMeasurementHeight,\n groupNotesByPixelDistance,\n TruncatedList,\n} from \"../measurements\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n} from \"../../data-provider\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport styles from \"./taxon-ranges.module.sass\";\nimport { getPositionWithinUnit, getUnitHeightRange } from \"../../prepare-units\";\nimport { scaleLinear } from \"d3-scale\";\n\nexport * from \"./taxon-ranges\";\n\nconst h = hyper.styled(styles);\n\nexport { FossilDataType };\n\nexport function PBDBFossilsColumn({\n columnID,\n type = FossilDataType.Collections,\n}: {\n columnID: number;\n type: FossilDataType;\n}) {\n const data = useFossilData(columnID, type);\n const { axisType, units } = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n if (data == null || units == null || scale == null) return null;\n\n const data1 = preparePBDBData(data, units, scale, axisType);\n\n return h(BaseMeasurementsColumn, {\n data: data1,\n noteComponent: FossilInfo,\n focusedNoteComponent: FossilInfo,\n className: \"fossil-collections\",\n });\n}\n\ninterface FossilItemProps {\n note: {\n data: PBDBCollection[];\n unit?: IUnit;\n };\n spacing?: {\n below?: number;\n above?: number;\n };\n width?: number;\n height?: number;\n color?: string;\n focused?: boolean;\n}\n\nfunction FossilInfo(props: FossilItemProps) {\n const { note, maxItems, focused = false } = props;\n const { data } = note;\n // Sort collections by name\n data.sort((a, b) => {\n const nameA = a.best_name ?? a.cltn_name ?? \"\";\n const nameB = b.best_name ?? b.cltn_name ?? \"\";\n return nameA.localeCompare(nameB);\n });\n\n return h(TruncatedList, {\n data,\n className: \"fossil-collections\",\n itemRenderer: PBDBCollectionLink,\n maxItems: focused ? Infinity : (maxItems ?? 5),\n });\n}\n\nconst FocusedFossilInfo = (props: FossilItemProps) =>\n h(FossilInfo, { ...props, maxItems: Infinity });\n\nfunction PBDBCollectionLink({\n data,\n}: {\n data: PBDBCollection | PBDBOccurrence;\n}) {\n /** A link to a PBDB collection that handles either an occurrence or collection object */\n return h(\n \"a.link-id\",\n {\n href: `https://paleobiodb.org/app/collections#display=col:${data.cltn_id}`,\n target: \"_blank\",\n onClick(e) {\n e.stopPropagation();\n },\n },\n data.best_name ?? data.cltn_name,\n );\n}\n\ninterface PreparePBDBDataOptions {\n /** If set, group close notes within this distance (in pixels in display space)\n * into a single note. If a number is provided, that number is used as the distance,\n * otherwise a default of 5 pixels is used.\n */\n groupCloseNotes?: boolean | number;\n}\n\nfunction preparePBDBData<T extends PBDBEntity>(\n data: T[],\n units: UnitLong[],\n scale: CompositeColumnScale,\n axisType: ColumnAxisType,\n options?: { groupCloseNotes?: boolean | number },\n) {\n /** Prepare PBDB fossil data for display in a measurements column */\n const { groupCloseNotes = true } = options ?? {};\n const groupDistance =\n typeof groupCloseNotes === \"number\" ? groupCloseNotes : 10;\n\n // Map of data to its defined height ranges\n const dataMap = new Map<string, ColumnMeasurementData<T[]>>();\n\n // Todo: if we wanted, we could add a step where we group notes that are too close together here...\n\n for (const d of data) {\n const range = getHeightRangeForPBDBEntity(d, units, axisType);\n\n if (range == null) continue;\n const { height, top_height } = range;\n // compose the key based on height info\n let key = `${height}`;\n if (top_height != null) {\n key += `-${top_height}`;\n }\n\n // Group by height key\n if (!dataMap.has(key)) {\n dataMap.set(key, {\n height,\n top_height: top_height ?? height,\n data: [],\n id: key,\n });\n }\n dataMap.get(key)!.data.push(d);\n }\n\n return groupNotesByPixelDistance(\n Array.from(dataMap.values()),\n scale,\n axisType,\n groupDistance,\n );\n}\n\nfunction getHeightRangeForPBDBEntity<T extends PBDBEntity>(\n d: T,\n units: UnitLong[],\n axisType: ColumnAxisType,\n): MeasurementHeightData | null {\n let height: number | null = null;\n if (d.slb != null && d.slu == \"mbsf\") {\n // Meters below sea floor - special case for eODP where we have\n // specific depth data referenced\n height = Number(d.slb);\n if (axisType === ColumnAxisType.DEPTH) {\n // Data is already in depth units\n return { height };\n }\n }\n if (d.unit_id == null) return null;\n if (height != null) {\n // If we have both height and unit info, we need to adjust the height\n // to fit whatever scale type we're using.\n // TODO: we could improve how this works by having concurrent age and\n // height scales, which would allow us to do this without having to\n // reference to a specific unit.\n const unit = units.find((u) => u.unit_id === d.unit_id);\n if (unit == null) return null;\n const relHeight = getRelativePositionInUnit(\n height,\n unit,\n ColumnAxisType.DEPTH,\n );\n if (relHeight == null) return null;\n height = getPositionWithinUnit(relHeight, unit, axisType);\n return { height };\n }\n // We can just get the height within the unit, clipped to the unit boundaries\n return standardizeMeasurementHeight({ unit_id: d.unit_id }, units, axisType);\n}\n\nfunction getRelativePositionInUnit<T extends PBDBEntity>(\n pos: number,\n unit: UnitLong,\n axisType: ColumnAxisType,\n): number | null {\n // This is the inverse of getPositionWithinUnit\n const heights = getUnitHeightRange(unit, axisType, false);\n const scale = scaleLinear(heights).domain([0, 1]);\n const relPos = scale.invert(pos);\n if (relPos < 0 || relPos > 1) return null;\n return relPos;\n}\n"],"names":["$2jHE4$macrostrathyper","ColumnAxisType","$2jHE4$ColumnAxisType","scaleLinear","$2jHE4$scaleLinear","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$ea2f112131e22f14$exports","$ea2f112131e22f14$export$554267114407ef68","FossilDataType","$dx7no","$kIQUG","$wtIgl","$f7qDU","$iWhRv","$6dOaS","$ea2f112131e22f14$var$h","styled","a","__esModule","default","columnID","type","Collections","data","useFossilData","axisType","units","useMacrostratColumnData","scale","useCompositeScale","data1","$ea2f112131e22f14$var$preparePBDBData","options","groupCloseNotes","dataMap","Map","d","range","$ea2f112131e22f14$var$getHeightRangeForPBDBEntity","height","slb","slu","Number","DEPTH","unit_id","unit","find","u","relHeight","$ea2f112131e22f14$var$getRelativePositionInUnit","pos","relPos","getUnitHeightRange","domain","invert","getPositionWithinUnit","standardizeMeasurementHeight","top_height","key","has","push","groupNotesByPixelDistance","Array","from","values","BaseMeasurementsColumn","noteComponent","$ea2f112131e22f14$var$FossilInfo","focusedNoteComponent","className","props","note","maxItems","focused","sort","b","nameA","best_name","cltn_name","nameB","localeCompare","TruncatedList","itemRenderer","$ea2f112131e22f14$var$PBDBCollectionLink","Infinity","href","cltn_id","target","onClick","stopPropagation","keys","forEach","prototype","hasOwnProperty","source","PBDBFossilsColumn","$8e174c7ae24a4598$export$a990c76b38782f57","$9cea14fa75e12a56$export$652730986cccff7a","PBDBOccurrencesMatrix"],"version":3,"file":"column-views.af480651.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ import"./column-views.1d064426.js";import"./column-views.ec7cc7cc.js";function e(e,r){return Object.keys(r).forEach(function(t){"default"===t||"__esModule"===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})}),e}var r=globalThis,t={},a={},o=r.parcelRequirea149;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in a){var r=a[e];delete a[e];var o={id:e,exports:{}};return t[e]=o,r.call(o.exports,o,o.exports),o.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){a[e]=r},r.parcelRequirea149=o),o.register;var n={},c=o("kIQUG"),d=o("grgdF");e(n,c),e(n,d);export{$7e05644cbb5d2dbb$export$9d101e1fcb2166a6 as standardizeMeasurementHeight,$7e05644cbb5d2dbb$export$8f2afa8ddee7317e as mergeHeightRanges,$7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d as BaseMeasurementsColumn,$7e05644cbb5d2dbb$export$653e47a7a0da0f0d as TruncatedList,$7e05644cbb5d2dbb$export$4e649f790614b299 as groupNotesByPixelDistance,$48680a4cd2abcbe4$export$c49cf57576706bab as SGPMeasurementsColumn};
2
+ //# sourceMappingURL=column-views.b103acbc.js.map
@@ -0,0 +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,4B,C,6C,iB,C,6C,sB,C,6C,a,C,6C,yB,C,6C,qB","sources":["<anon>","packages/column-views/src/facets/measurements/index.ts"],"sourcesContent":["import \"./column-views.1d064426.js\";\nimport \"./column-views.ec7cc7cc.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 $30f674067bcc490b$exports = {};\n\nvar $kIQUG = parcelRequire(\"kIQUG\");\n\nvar $grgdF = parcelRequire(\"grgdF\");\n$parcel$exportWildcard($30f674067bcc490b$exports, $kIQUG);\n$parcel$exportWildcard($30f674067bcc490b$exports, $grgdF);\n\n\nexport {$7e05644cbb5d2dbb$export$9d101e1fcb2166a6 as standardizeMeasurementHeight, $7e05644cbb5d2dbb$export$8f2afa8ddee7317e as mergeHeightRanges, $7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d as BaseMeasurementsColumn, $7e05644cbb5d2dbb$export$653e47a7a0da0f0d as TruncatedList, $7e05644cbb5d2dbb$export$4e649f790614b299 as groupNotesByPixelDistance, $48680a4cd2abcbe4$export$c49cf57576706bab as SGPMeasurementsColumn};\n//# sourceMappingURL=column-views.b103acbc.js.map\n","export * from \"./base\";\nexport * from \"./sgp\";\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","$30f674067bcc490b$exports","$kIQUG","$grgdF","$7e05644cbb5d2dbb$export$9d101e1fcb2166a6","standardizeMeasurementHeight","$7e05644cbb5d2dbb$export$8f2afa8ddee7317e","mergeHeightRanges","$7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d","BaseMeasurementsColumn","$7e05644cbb5d2dbb$export$653e47a7a0da0f0d","TruncatedList","$7e05644cbb5d2dbb$export$4e649f790614b299","groupNotesByPixelDistance","$48680a4cd2abcbe4$export$c49cf57576706bab","SGPMeasurementsColumn"],"version":3,"file":"column-views.b103acbc.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.38835c99.js";import"./column-views.1261be59.js";import"./column-views.22c2d45b.js";import"./column-views.e1813308.js";import"./column-views.a08b0c9f.js";import{useMemo as e}from"react";import{useMacrostratIntervals as t,Timescale as n,TimescaleOrientation as o}from"@macrostrat/timescale";import{SVG as a,ColumnAxisType as s}from"@macrostrat/column-components";import i from"@macrostrat/hyper";import{Value as l}from"@macrostrat/data-components";var r=globalThis,c={},m={},u=r.parcelRequirea149;null==u&&((u=function(e){if(e in c)return c[e].exports;if(e in m){var t=m[e];delete m[e];var n={id:e,exports:{}};return c[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},r.parcelRequirea149=u),u.register;var p=u("4Abge"),d=u("7YHvf"),f=u("lgTAP"),b=u("wtIgl"),h=u("iYfAq");let g=i.styled(d&&d.__esModule?d.default:d);function x(e){let{unconformityLabels:t=!0,unitComponent:n,unitComponentProps:o,showLabels:a=!0,width:s=300,columnWidth:i=150,showLabelColumn:l=!0,clipUnits:r=!0,maxInternalColumns:c}=e,m=(0,b.useMacrostratUnits)(),u=m[0]?.col_id;return g(p.LabelTrackerProvider,{units:m,key:u},[g(C,{width:i,unitComponent:n,unitComponentProps:o,showLabels:a,clipUnits:r,maxInternalColumns:c,unconformityLabels:t}),g.if(l)(p.SectionLabelsColumn,{width:s-i})])}function C(e){let{width:t,showLabels:n,unitComponent:o,unitComponentProps:s,clipUnits:i,maxInternalColumns:l,axisType:r,unconformityLabels:c=!0}=e,{sections:m,totalHeight:u}=(0,b.useMacrostratColumnData)(),p=m.map(e=>e.scaleInfo),d=t-2;return g("div.section-units-container",{style:{width:t}},[g(a,{className:"sections",height:u,innerWidth:d,paddingH:1},m.map(e=>{let{units:t,scaleInfo:a,section_id:r}=e;return g(v,{units:t,scaleInfo:a,key:`section-${r}`,unitComponent:o,unitComponentProps:s,showLabels:n,width:d,clipUnits:i,maxInternalColumns:l})})),g.if(c)(T,{width:t,sections:p,verbose:!1})])}function v(t){let{units:n,scaleInfo:o,unitComponent:a,showLabels:s=!0,width:i=300,unitComponentProps:l,className:r,clipUnits:c=!0,maxInternalColumns:m}=t,{domain:u,pixelScale:d,pixelHeight:b,scale:h}=o,x=e(()=>({...l,nColumns:Math.min(m??Math.floor(i/10),l?.nColumns??1/0,Math.max(...n.map(e=>e.column))+1)}),[n,l,m,i]);return g("g.section",{className:r,style:{"--section-height":`${b}px`,"--section-width":`${i}px`},transform:`translate(0 ${o.offset})`},g(f.MacrostratColumnProvider,{units:n,domain:u,pixelScale:d,scale:h},g(p.CompositeUnitsColumn,{width:i,showLabels:s,unitComponent:a,unitComponentProps:x,clipToFrame:c})))}function w(e){let{sections:t}=(0,b.useMacrostratColumnData)();return g(y,{packages:t.map(e=>e.scaleInfo),...e})}function y(e){let a,{levels:i=3,packages:l,unconformityLabels:r=!1}=e,c=t((0,f.useMacrostratBaseURL)()),m=(a="number"==typeof i?[2,Math.max(2+Math.min(i,5)-1,1)]:i)[1]-a[0]+1;return g("div.timescale-column",[g("div.timescales",l.map(e=>{let{pixelHeight:t,paddingTop:s,key:i,scale:l}=e;return g("div.timescale-container",{style:{paddingTop:s,"--timescale-level-count":m},key:i},[g(n,{orientation:o.VERTICAL,length:t,levels:a,absoluteAgeScale:!0,showAgeAxis:!1,scale:l,intervals:c})])})),g.if(r)(T,{width:"100%",sections:l,className:"unconformity-labels",axisType:s.AGE})])}function T(e){let{width:t,sections:n,className:o,axisType:a,verbose:s}=e;return g("div.unconformity-labels",{style:{width:t},className:o},n.map((e,o)=>{let i=n[o-1],l=e.offset-e.paddingTop;return g(A,{axisType:a,upperAge:i?.domain[0],lowerAge:e.domain[1],style:{width:t,height:e.paddingTop,top:l},verbose:s})}))}function A({upperAge:e,lowerAge:t,style:n,axisType:o,verbose:a=!1}){let i;if(null==e||null==t)return null;let r=Math.abs(e-t),c=0,m=null;r>1e3?m="giga":r>100?m="mega":r>10?m="large":r<1?(m="small",c=2):c=1,i=o===s.DEPTH||o===s.HEIGHT?g(l,{value:r.toLocaleString("en-US",{maximumFractionDigits:c}),unit:"m"}):g(h.Duration,{value:r,maximumFractionDigits:c});let u=null;return a&&(u=g([" ",g("span.prefix"," gap")])),g("div.unconformity",{style:n,className:m},[g("div.unconformity-inner",g("div.unconformity-text",[i,u]))])}export{x as SectionsColumn,T as UnconformityLabels,w as CompositeTimescale,y as CompositeTimescaleCore};
2
- //# sourceMappingURL=column-views.60b5663d.js.map
1
+ import"./column-views.5559de6a.js";import"./column-views.1261be59.js";import"./column-views.c007152b.js";import"./column-views.46efb749.js";import"./column-views.6c7f9245.js";import{useMemo as e}from"react";import{useMacrostratIntervals as t,Timescale as n,TimescaleOrientation as o}from"@macrostrat/timescale";import{SVG as a,ColumnAxisType as s}from"@macrostrat/column-components";import i from"@macrostrat/hyper";import{Value as l}from"@macrostrat/data-components";var r=globalThis,c={},m={},u=r.parcelRequirea149;null==u&&((u=function(e){if(e in c)return c[e].exports;if(e in m){var t=m[e];delete m[e];var n={id:e,exports:{}};return c[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},r.parcelRequirea149=u),u.register;var p=u("4Abge"),d=u("7YHvf"),f=u("lgTAP"),b=u("wtIgl"),h=u("iYfAq");let g=i.styled(d&&d.__esModule?d.default:d);function x(e){let{unconformityLabels:t=!0,unitComponent:n,unitComponentProps:o,showLabels:a=!0,width:s=300,columnWidth:i=150,showLabelColumn:l=!0,clipUnits:r=!0,maxInternalColumns:c}=e,m=(0,b.useMacrostratUnits)(),u=m[0]?.col_id;return g(p.LabelTrackerProvider,{units:m,key:u},[g(C,{width:i,unitComponent:n,unitComponentProps:o,showLabels:a,clipUnits:r,maxInternalColumns:c,unconformityLabels:t}),g.if(l)(p.SectionLabelsColumn,{width:s-i})])}function C(e){let{width:t,showLabels:n,unitComponent:o,unitComponentProps:s,clipUnits:i,maxInternalColumns:l,axisType:r,unconformityLabels:c=!0}=e,{sections:m,totalHeight:u}=(0,b.useMacrostratColumnData)(),p=m.map(e=>e.scaleInfo),d=t-2;return g("div.section-units-container",{style:{width:t}},[g(a,{className:"sections",height:u,innerWidth:d,paddingH:1},m.map(e=>{let{units:t,scaleInfo:a,section_id:r}=e;return g(v,{units:t,scaleInfo:a,key:`section-${r}`,unitComponent:o,unitComponentProps:s,showLabels:n,width:d,clipUnits:i,maxInternalColumns:l})})),g.if(c)(T,{width:t,sections:p,verbose:!1})])}function v(t){let{units:n,scaleInfo:o,unitComponent:a,showLabels:s=!0,width:i=300,unitComponentProps:l,className:r,clipUnits:c=!0,maxInternalColumns:m}=t,{domain:u,pixelScale:d,pixelHeight:b,scale:h}=o,x=e(()=>({...l,nColumns:Math.min(m??Math.floor(i/10),l?.nColumns??1/0,Math.max(...n.map(e=>e.column))+1)}),[n,l,m,i]);return g("g.section",{className:r,style:{"--section-height":`${b}px`,"--section-width":`${i}px`},transform:`translate(0 ${o.offset})`},g(f.MacrostratColumnProvider,{units:n,domain:u,pixelScale:d,scale:h},g(p.CompositeUnitsColumn,{width:i,showLabels:s,unitComponent:a,unitComponentProps:x,clipToFrame:c})))}function w(e){let{sections:t}=(0,b.useMacrostratColumnData)();return g(y,{packages:t.map(e=>e.scaleInfo),...e})}function y(e){let a,{levels:i=3,packages:l,unconformityLabels:r=!1}=e,c=t((0,f.useMacrostratBaseURL)()),m=(a="number"==typeof i?[2,Math.max(2+Math.min(i,5)-1,1)]:i)[1]-a[0]+1;return g("div.timescale-column",[g("div.timescales",l.map(e=>{let{pixelHeight:t,paddingTop:s,key:i,scale:l}=e;return g("div.timescale-container",{style:{paddingTop:s,"--timescale-level-count":m},key:i},[g(n,{orientation:o.VERTICAL,length:t,levels:a,absoluteAgeScale:!0,showAgeAxis:!1,scale:l,intervals:c})])})),g.if(r)(T,{width:"100%",sections:l,className:"unconformity-labels",axisType:s.AGE})])}function T(e){let{width:t,sections:n,className:o,axisType:a,verbose:s}=e;return g("div.unconformity-labels",{style:{width:t},className:o},n.map((e,o)=>{let i=n[o-1],l=e.offset-e.paddingTop;return g(A,{axisType:a,upperAge:i?.domain[0],lowerAge:e.domain[1],style:{width:t,height:e.paddingTop,top:l},verbose:s})}))}function A({upperAge:e,lowerAge:t,style:n,axisType:o,verbose:a=!1}){let i;if(null==e||null==t)return null;let r=Math.abs(e-t),c=0,m=null;r>1e3?m="giga":r>100?m="mega":r>10?m="large":r<1?(m="small",c=2):c=1,i=o===s.DEPTH||o===s.HEIGHT?g(l,{value:r.toLocaleString("en-US",{maximumFractionDigits:c}),unit:"m"}):g(h.Duration,{value:r,maximumFractionDigits:c});let u=null;return a&&(u=g([" ",g("span.prefix"," gap")])),g("div.unconformity",{style:n,className:m},[g("div.unconformity-inner",g("div.unconformity-text",[i,u]))])}export{x as SectionsColumn,T as UnconformityLabels,w as CompositeTimescale,y as CompositeTimescaleCore};
2
+ //# sourceMappingURL=column-views.b40c1b9c.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,W,C,K,O,A,Q,0B,C,C,a,C,C,wB,C,K,uB,A,Q,O,C,C,kB,C,K,+B,A,Q,M,mB,A,Q,S,C,K,6B,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCwBA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAyBhB,SAAS,EAA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AE,yBAA0B,EAAE,wBAAyB,CAAC,EAAK,EAAO,GACrE,CACH,Q,K,c,C,K,kB,C,K,kB,C,K,sB","sources":["<anon>","packages/column-views/src/section.ts"],"sourcesContent":["import \"./column-views.38835c99.js\";\nimport \"./column-views.1261be59.js\";\nimport \"./column-views.22c2d45b.js\";\nimport \"./column-views.e1813308.js\";\nimport \"./column-views.a08b0c9f.js\";\nimport {useMemo as $dA1GT$useMemo} from \"react\";\nimport {useMacrostratIntervals as $dA1GT$useMacrostratIntervals, Timescale as $dA1GT$Timescale, TimescaleOrientation as $dA1GT$TimescaleOrientation} from \"@macrostrat/timescale\";\nimport {SVG as $dA1GT$SVG, ColumnAxisType as $dA1GT$ColumnAxisType} from \"@macrostrat/column-components\";\nimport $dA1GT$macrostrathyper from \"@macrostrat/hyper\";\nimport {Value as $dA1GT$Value} from \"@macrostrat/data-components\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\nvar $4Abge = parcelRequire(\"4Abge\");\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\n\nconst $69e10b1ec4ac73f6$var$h = (0, $dA1GT$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $69e10b1ec4ac73f6$export$38cb0ab5af8f50d7(props) {\n const { unconformityLabels: unconformityLabels = true, unitComponent: unitComponent, unitComponentProps: unitComponentProps, showLabels: showLabels = true, width: width = 300, columnWidth: columnWidth = 150, showLabelColumn: showLabelColumn = true, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const units = (0, $wtIgl.useMacrostratUnits)();\n // Get a unique key for the column\n const key = units[0]?.col_id;\n return $69e10b1ec4ac73f6$var$h((0, $4Abge.LabelTrackerProvider), {\n units: units,\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnitsColumn, {\n width: columnWidth,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns,\n unconformityLabels: unconformityLabels\n }),\n $69e10b1ec4ac73f6$var$h.if(showLabelColumn)((0, $4Abge.SectionLabelsColumn), {\n width: width - columnWidth\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnitsColumn(props) {\n const { width: width, showLabels: showLabels, unitComponent: unitComponent, unitComponentProps: unitComponentProps, clipUnits: clipUnits, maxInternalColumns: maxInternalColumns, axisType: axisType, unconformityLabels: unconformityLabels = true } = props;\n const { sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const scaleData = sections.map((section)=>{\n return section.scaleInfo;\n });\n const innerWidth = width - 2;\n return $69e10b1ec4ac73f6$var$h(\"div.section-units-container\", {\n style: {\n width: width\n }\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$SVG), {\n className: \"sections\",\n height: totalHeight,\n innerWidth: innerWidth,\n paddingH: 1\n }, sections.map((group)=>{\n const { units: units, scaleInfo: scaleInfo, section_id: section_id } = group;\n const key = `section-${section_id}`;\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnits, {\n units: units,\n scaleInfo: scaleInfo,\n key: key,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n width: innerWidth,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns\n });\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: width,\n sections: scaleData,\n verbose: false\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnits(props) {\n // Section with \"squishy\" timescale\n const { units: units, scaleInfo: scaleInfo, unitComponent: unitComponent, showLabels: showLabels = true, width: width = 300, unitComponentProps: unitComponentProps, className: className, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const { domain: domain, pixelScale: pixelScale, pixelHeight: pixelHeight, scale: scale } = scaleInfo;\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */ const _unitComponentProps = (0, $dA1GT$useMemo)(()=>{\n return {\n ...unitComponentProps,\n nColumns: Math.min(maxInternalColumns ?? Math.floor(width / 10), unitComponentProps?.nColumns ?? Infinity, Math.max(...units.map((d)=>d.column)) + 1)\n };\n }, [\n units,\n unitComponentProps,\n maxInternalColumns,\n width\n ]);\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`\n };\n return $69e10b1ec4ac73f6$var$h(\"g.section\", {\n className: className,\n style: style,\n transform: `translate(0 ${scaleInfo.offset})`\n }, $69e10b1ec4ac73f6$var$h((0, $lgTAP.MacrostratColumnProvider), {\n units: units,\n domain: domain,\n pixelScale: pixelScale,\n scale: scale\n }, $69e10b1ec4ac73f6$var$h((0, $4Abge.CompositeUnitsColumn), {\n width: width,\n showLabels: showLabels,\n unitComponent: unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits\n })));\n}\nfunction $69e10b1ec4ac73f6$export$db2df5a73a6fbe10(props) {\n const { sections: sections } = (0, $wtIgl.useMacrostratColumnData)();\n const sectionScales = sections.map((section)=>{\n return section.scaleInfo;\n });\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$export$463f46772c64d403, {\n packages: sectionScales,\n ...props\n });\n}\nfunction $69e10b1ec4ac73f6$export$463f46772c64d403(props) {\n const { levels: levels = 3, packages: packages, unconformityLabels: unconformityLabels = false } = props;\n // Use intervals from Macrostrat API\n const baseURL = (0, $lgTAP.useMacrostratBaseURL)();\n const intervals = (0, $dA1GT$useMacrostratIntervals)(baseURL);\n let _levels;\n if (typeof levels === \"number\") // If levels is a number, use the most common starting level\n _levels = [\n 2,\n Math.max(2 + Math.min(levels, 5) - 1, 1)\n ];\n else _levels = levels;\n const nCols = _levels[1] - _levels[0] + 1;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-column\", [\n $69e10b1ec4ac73f6$var$h(\"div.timescales\", packages.map((group)=>{\n const { pixelHeight: pixelHeight, paddingTop: paddingTop, key: key, scale: scale } = group;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-container\", {\n style: {\n paddingTop: paddingTop,\n \"--timescale-level-count\": nCols\n },\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$Timescale), {\n orientation: (0, $dA1GT$TimescaleOrientation).VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale: scale,\n intervals: intervals\n })\n ]);\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: (0, $dA1GT$ColumnAxisType).AGE\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$export$e12e53eeee198b99(props) {\n const { width: width, sections: sections, className: className, axisType: axisType, verbose: verbose } = props;\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity-labels\", {\n style: {\n width: width\n },\n className: className\n }, sections.map((scaleInfo, i)=>{\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$Unconformity, {\n axisType: axisType,\n upperAge: upperAge,\n lowerAge: lowerAge,\n style: {\n width: width,\n height: scaleInfo.paddingTop,\n top: top\n },\n verbose: verbose\n });\n }));\n}\nfunction $69e10b1ec4ac73f6$var$Unconformity({ upperAge: upperAge, lowerAge: lowerAge, style: style, axisType: axisType, verbose: verbose = false }) {\n if (upperAge == null || lowerAge == null) return null;\n const ageGap = Math.abs(upperAge - lowerAge);\n let maximumFractionDigits = 0;\n let className = null;\n if (ageGap > 1000) className = \"giga\";\n else if (ageGap > 100) className = \"mega\";\n else if (ageGap > 10) className = \"large\";\n else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else maximumFractionDigits = 1;\n let val;\n if (axisType === (0, $dA1GT$ColumnAxisType).DEPTH || axisType === (0, $dA1GT$ColumnAxisType).HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", {\n maximumFractionDigits: maximumFractionDigits\n });\n val = $69e10b1ec4ac73f6$var$h((0, $dA1GT$Value), {\n value: _txt,\n unit: \"m\"\n });\n } else val = $69e10b1ec4ac73f6$var$h((0, $iYfAq.Duration), {\n value: ageGap,\n maximumFractionDigits: maximumFractionDigits\n });\n let prefix = null;\n if (verbose) prefix = $69e10b1ec4ac73f6$var$h([\n \" \",\n $69e10b1ec4ac73f6$var$h(\"span.prefix\", \" gap\")\n ]);\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity\", {\n style: style,\n className: className\n }, [\n $69e10b1ec4ac73f6$var$h(\"div.unconformity-inner\", $69e10b1ec4ac73f6$var$h(\"div.unconformity-text\", [\n val,\n prefix\n ]))\n ]);\n}\n\n\nexport {$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7 as SectionsColumn, $69e10b1ec4ac73f6$export$e12e53eeee198b99 as UnconformityLabels, $69e10b1ec4ac73f6$export$db2df5a73a6fbe10 as CompositeTimescale, $69e10b1ec4ac73f6$export$463f46772c64d403 as CompositeTimescaleCore};\n//# sourceMappingURL=column-views.60b5663d.js.map\n","import {\n CompositeUnitsColumn,\n LabelTrackerProvider,\n SectionLabelsColumn,\n} from \"./units\";\nimport { ReactNode, FunctionComponent, useMemo } from \"react\";\nimport {\n Timescale,\n TimescaleOrientation,\n useMacrostratIntervals,\n} from \"@macrostrat/timescale\";\nimport { ColumnAxisType, SVG } from \"@macrostrat/column-components\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./column.module.sass\";\nimport {\n useMacrostratColumnData,\n useMacrostratUnits,\n MacrostratColumnProvider,\n useMacrostratBaseURL,\n} from \"./data-provider\";\nimport { Duration } from \"./unit-details\";\nimport { Value } from \"@macrostrat/data-components\";\nimport type { ExtUnit, PackageScaleLayoutData } from \"./prepare-units/types\";\n\nconst h = hyper.styled(styles);\n\nexport interface SectionSharedProps {\n unitComponent?: FunctionComponent<any>;\n unitComponentProps?: any;\n showLabels?: boolean;\n width?: number;\n columnWidth?: number;\n children?: ReactNode;\n showLabelColumn?: boolean;\n axisType?: ColumnAxisType;\n className?: string;\n clipUnits?: boolean;\n maxInternalColumns?: number;\n // Space between sections\n verticalSpacing?: number;\n // Whether to render unconformity labels\n unconformityLabels?: boolean;\n}\n\nexport interface SectionProps extends SectionSharedProps {\n units: ExtUnit[];\n scaleInfo: PackageScaleLayoutData;\n}\n\nexport function SectionsColumn(props: SectionSharedProps) {\n const {\n unconformityLabels = true,\n unitComponent,\n unitComponentProps,\n showLabels = true,\n width = 300,\n columnWidth = 150,\n showLabelColumn = true,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const units = useMacrostratUnits();\n\n // Get a unique key for the column\n const key = units[0]?.col_id;\n\n return h(LabelTrackerProvider, { units, key }, [\n h(SectionUnitsColumn, {\n width: columnWidth,\n unitComponent,\n unitComponentProps,\n showLabels,\n clipUnits,\n maxInternalColumns,\n unconformityLabels,\n }),\n h.if(showLabelColumn)(SectionLabelsColumn, {\n width: width - columnWidth,\n }),\n ]);\n}\n\nfunction SectionUnitsColumn(props: SectionSharedProps) {\n const {\n width,\n showLabels,\n unitComponent,\n unitComponentProps,\n clipUnits,\n maxInternalColumns,\n axisType,\n unconformityLabels = true,\n } = props;\n\n const { sections, totalHeight } = useMacrostratColumnData();\n\n const scaleData: PackageScaleLayoutData[] = sections.map((section) => {\n return section.scaleInfo;\n });\n\n const innerWidth = width - 2;\n\n return h(\"div.section-units-container\", { style: { width } }, [\n h(\n SVG,\n {\n className: \"sections\",\n height: totalHeight,\n innerWidth,\n paddingH: 1,\n },\n sections.map((group) => {\n const { units, scaleInfo, section_id } = group;\n\n const key = `section-${section_id}`;\n return h(\n SectionUnits,\n {\n units,\n scaleInfo,\n key,\n unitComponent,\n unitComponentProps,\n showLabels,\n width: innerWidth,\n clipUnits,\n maxInternalColumns,\n }, // This unconformity is with the section _above_\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width,\n sections: scaleData,\n verbose: false,\n }),\n ]);\n}\n\nfunction SectionUnits(props: SectionProps) {\n // Section with \"squishy\" timescale\n const {\n units,\n scaleInfo,\n unitComponent,\n showLabels = true,\n width = 300,\n unitComponentProps,\n className,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const { domain, pixelScale, pixelHeight, scale } = scaleInfo;\n\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */\n const _unitComponentProps = useMemo(() => {\n return {\n ...unitComponentProps,\n nColumns: Math.min(\n maxInternalColumns ?? Math.floor(width / 10),\n unitComponentProps?.nColumns ?? Infinity,\n Math.max(...units.map((d) => d.column)) + 1,\n ),\n //axisType,\n };\n }, [units, unitComponentProps, maxInternalColumns, width]);\n\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`,\n };\n\n return h(\n \"g.section\",\n { className, style, transform: `translate(0 ${scaleInfo.offset})` },\n h(\n MacrostratColumnProvider,\n {\n units,\n domain,\n pixelScale, // Actually pixels per myr,\n scale,\n },\n h(CompositeUnitsColumn, {\n width,\n showLabels,\n unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits,\n }),\n ),\n );\n}\n\ninterface CompositeTimescaleProps {\n levels?: [number, number] | number;\n unconformityLabels?: boolean;\n}\n\nexport function CompositeTimescale(props: CompositeTimescaleProps) {\n const { sections } = useMacrostratColumnData();\n const sectionScales = sections.map((section) => {\n return section.scaleInfo;\n });\n\n return h(CompositeTimescaleCore, {\n packages: sectionScales,\n ...props,\n });\n}\n\ntype CompositeTimescaleCoreProps = CompositeTimescaleProps & {\n packages: PackageScaleLayoutData[];\n};\n\nexport function CompositeTimescaleCore(props: CompositeTimescaleCoreProps) {\n const { levels = 3, packages, unconformityLabels = false } = props;\n\n // Use intervals from Macrostrat API\n const baseURL = useMacrostratBaseURL();\n const intervals = useMacrostratIntervals(baseURL);\n\n let _levels: [number, number];\n if (typeof levels === \"number\") {\n // If levels is a number, use the most common starting level\n _levels = [2, Math.max(2 + Math.min(levels, 5) - 1, 1)];\n } else {\n _levels = levels;\n }\n\n const nCols = _levels[1] - _levels[0] + 1;\n\n return h(\"div.timescale-column\", [\n h(\n \"div.timescales\",\n packages.map((group) => {\n const { pixelHeight, paddingTop, key, scale } = group;\n return h(\n \"div.timescale-container\",\n { style: { paddingTop, \"--timescale-level-count\": nCols }, key },\n [\n h(Timescale, {\n orientation: TimescaleOrientation.VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale,\n intervals,\n }),\n ],\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: ColumnAxisType.AGE,\n }),\n ]);\n}\n\nexport function UnconformityLabels(props: {\n width: string | number;\n sections: PackageScaleLayoutData[];\n axisType?: ColumnAxisType;\n className?: string;\n verbose?: boolean;\n}) {\n const { width, sections, className, axisType, verbose } = props;\n\n return h(\n \"div.unconformity-labels\",\n {\n style: {\n width,\n },\n className,\n },\n sections.map((scaleInfo, i) => {\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return h(Unconformity, {\n axisType,\n upperAge,\n lowerAge,\n style: {\n width,\n height: scaleInfo.paddingTop,\n top,\n },\n verbose,\n });\n }),\n );\n}\n\nfunction Unconformity({\n upperAge,\n lowerAge,\n style,\n axisType,\n verbose = false,\n}) {\n if (upperAge == null || lowerAge == null) {\n return null;\n }\n\n const ageGap = Math.abs(upperAge - lowerAge);\n\n let maximumFractionDigits = 0;\n\n let className: string = null;\n if (ageGap > 1000) {\n className = \"giga\";\n } else if (ageGap > 100) {\n className = \"mega\";\n } else if (ageGap > 10) {\n className = \"large\";\n } else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else {\n maximumFractionDigits = 1;\n }\n\n let val: ReactNode;\n if (axisType === ColumnAxisType.DEPTH || axisType === ColumnAxisType.HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", { maximumFractionDigits });\n val = h(Value, { value: _txt, unit: \"m\" });\n } else {\n val = h(Duration, { value: ageGap, maximumFractionDigits });\n }\n\n let prefix: ReactNode = null;\n if (verbose) {\n prefix = h([\" \", h(\"span.prefix\", \" gap\")]);\n }\n\n return h(\"div.unconformity\", { style, className }, [\n h(\"div.unconformity-inner\", h(\"div.unconformity-text\", [val, prefix])),\n ]);\n}\n"],"names":["useMemo","$dA1GT$useMemo","useMacrostratIntervals","$dA1GT$useMacrostratIntervals","Timescale","$dA1GT$Timescale","TimescaleOrientation","$dA1GT$TimescaleOrientation","SVG","$dA1GT$SVG","ColumnAxisType","$dA1GT$ColumnAxisType","$dA1GT$macrostrathyper","Value","$dA1GT$Value","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$4Abge","$7YHvf","$lgTAP","$wtIgl","$iYfAq","$69e10b1ec4ac73f6$var$h","styled","a","__esModule","default","$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7","props","unconformityLabels","unitComponent","unitComponentProps","showLabels","width","columnWidth","showLabelColumn","clipUnits","maxInternalColumns","units","useMacrostratUnits","key","col_id","LabelTrackerProvider","$69e10b1ec4ac73f6$var$SectionUnitsColumn","if","SectionLabelsColumn","axisType","sections","totalHeight","useMacrostratColumnData","scaleData","map","section","scaleInfo","innerWidth","style","className","height","paddingH","group","section_id","$69e10b1ec4ac73f6$var$SectionUnits","$69e10b1ec4ac73f6$export$e12e53eeee198b99","verbose","domain","pixelScale","pixelHeight","scale","_unitComponentProps","nColumns","Math","min","floor","Infinity","max","d","column","transform","offset","MacrostratColumnProvider","CompositeUnitsColumn","clipToFrame","$69e10b1ec4ac73f6$export$db2df5a73a6fbe10","$69e10b1ec4ac73f6$export$463f46772c64d403","packages","_levels","levels","intervals","useMacrostratBaseURL","nCols","paddingTop","orientation","VERTICAL","length","absoluteAgeScale","showAgeAxis","AGE","i","lastGroup","top","$69e10b1ec4ac73f6$var$Unconformity","upperAge","lowerAge","val","ageGap","abs","maximumFractionDigits","DEPTH","HEIGHT","value","toLocaleString","unit","Duration","prefix","SectionsColumn","UnconformityLabels","CompositeTimescale","CompositeTimescaleCore"],"version":3,"file":"column-views.60b5663d.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,W,C,K,O,A,Q,0B,C,C,a,C,C,wB,C,K,uB,A,Q,O,C,C,kB,C,K,+B,A,Q,M,mB,A,Q,S,C,K,6B,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,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,CAEnE,EAAE,EAAO,CAAE,MADJ,EAAO,cAAc,CAAC,QAAS,CAAE,sBAAA,CAAsB,GACtC,KAAM,GAAI,GAElC,EAAE,EAAA,QAAO,CAAG,CAAE,MAAO,EAAQ,sBAAA,CAAsB,GAG3D,IAAI,EAAoB,KAKxB,OAJI,GACF,CAAA,EAAS,EAAE,CAAC,IAAK,EAAE,cAAe,QAAQ,CAAA,EAGrC,EAAE,mBAAoB,CAAE,MAAA,EAAO,UAAA,CAAU,EAAG,CACjD,EAAE,yBAA0B,EAAE,wBAAyB,CAAC,EAAK,EAAO,GACrE,CACH,Q,K,c,C,K,kB,C,K,kB,C,K,sB","sources":["<anon>","packages/column-views/src/section.ts"],"sourcesContent":["import \"./column-views.5559de6a.js\";\nimport \"./column-views.1261be59.js\";\nimport \"./column-views.c007152b.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.6c7f9245.js\";\nimport {useMemo as $dA1GT$useMemo} from \"react\";\nimport {useMacrostratIntervals as $dA1GT$useMacrostratIntervals, Timescale as $dA1GT$Timescale, TimescaleOrientation as $dA1GT$TimescaleOrientation} from \"@macrostrat/timescale\";\nimport {SVG as $dA1GT$SVG, ColumnAxisType as $dA1GT$ColumnAxisType} from \"@macrostrat/column-components\";\nimport $dA1GT$macrostrathyper from \"@macrostrat/hyper\";\nimport {Value as $dA1GT$Value} from \"@macrostrat/data-components\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\nvar $4Abge = parcelRequire(\"4Abge\");\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $lgTAP = parcelRequire(\"lgTAP\");\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\n\nconst $69e10b1ec4ac73f6$var$h = (0, $dA1GT$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $69e10b1ec4ac73f6$export$38cb0ab5af8f50d7(props) {\n const { unconformityLabels: unconformityLabels = true, unitComponent: unitComponent, unitComponentProps: unitComponentProps, showLabels: showLabels = true, width: width = 300, columnWidth: columnWidth = 150, showLabelColumn: showLabelColumn = true, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const units = (0, $wtIgl.useMacrostratUnits)();\n // Get a unique key for the column\n const key = units[0]?.col_id;\n return $69e10b1ec4ac73f6$var$h((0, $4Abge.LabelTrackerProvider), {\n units: units,\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnitsColumn, {\n width: columnWidth,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns,\n unconformityLabels: unconformityLabels\n }),\n $69e10b1ec4ac73f6$var$h.if(showLabelColumn)((0, $4Abge.SectionLabelsColumn), {\n width: width - columnWidth\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnitsColumn(props) {\n const { width: width, showLabels: showLabels, unitComponent: unitComponent, unitComponentProps: unitComponentProps, clipUnits: clipUnits, maxInternalColumns: maxInternalColumns, axisType: axisType, unconformityLabels: unconformityLabels = true } = props;\n const { sections: sections, totalHeight: totalHeight } = (0, $wtIgl.useMacrostratColumnData)();\n const scaleData = sections.map((section)=>{\n return section.scaleInfo;\n });\n const innerWidth = width - 2;\n return $69e10b1ec4ac73f6$var$h(\"div.section-units-container\", {\n style: {\n width: width\n }\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$SVG), {\n className: \"sections\",\n height: totalHeight,\n innerWidth: innerWidth,\n paddingH: 1\n }, sections.map((group)=>{\n const { units: units, scaleInfo: scaleInfo, section_id: section_id } = group;\n const key = `section-${section_id}`;\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$SectionUnits, {\n units: units,\n scaleInfo: scaleInfo,\n key: key,\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n showLabels: showLabels,\n width: innerWidth,\n clipUnits: clipUnits,\n maxInternalColumns: maxInternalColumns\n });\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: width,\n sections: scaleData,\n verbose: false\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$var$SectionUnits(props) {\n // Section with \"squishy\" timescale\n const { units: units, scaleInfo: scaleInfo, unitComponent: unitComponent, showLabels: showLabels = true, width: width = 300, unitComponentProps: unitComponentProps, className: className, clipUnits: clipUnits = true, maxInternalColumns: maxInternalColumns } = props;\n const { domain: domain, pixelScale: pixelScale, pixelHeight: pixelHeight, scale: scale } = scaleInfo;\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */ const _unitComponentProps = (0, $dA1GT$useMemo)(()=>{\n return {\n ...unitComponentProps,\n nColumns: Math.min(maxInternalColumns ?? Math.floor(width / 10), unitComponentProps?.nColumns ?? Infinity, Math.max(...units.map((d)=>d.column)) + 1)\n };\n }, [\n units,\n unitComponentProps,\n maxInternalColumns,\n width\n ]);\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`\n };\n return $69e10b1ec4ac73f6$var$h(\"g.section\", {\n className: className,\n style: style,\n transform: `translate(0 ${scaleInfo.offset})`\n }, $69e10b1ec4ac73f6$var$h((0, $lgTAP.MacrostratColumnProvider), {\n units: units,\n domain: domain,\n pixelScale: pixelScale,\n scale: scale\n }, $69e10b1ec4ac73f6$var$h((0, $4Abge.CompositeUnitsColumn), {\n width: width,\n showLabels: showLabels,\n unitComponent: unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits\n })));\n}\nfunction $69e10b1ec4ac73f6$export$db2df5a73a6fbe10(props) {\n const { sections: sections } = (0, $wtIgl.useMacrostratColumnData)();\n const sectionScales = sections.map((section)=>{\n return section.scaleInfo;\n });\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$export$463f46772c64d403, {\n packages: sectionScales,\n ...props\n });\n}\nfunction $69e10b1ec4ac73f6$export$463f46772c64d403(props) {\n const { levels: levels = 3, packages: packages, unconformityLabels: unconformityLabels = false } = props;\n // Use intervals from Macrostrat API\n const baseURL = (0, $lgTAP.useMacrostratBaseURL)();\n const intervals = (0, $dA1GT$useMacrostratIntervals)(baseURL);\n let _levels;\n if (typeof levels === \"number\") // If levels is a number, use the most common starting level\n _levels = [\n 2,\n Math.max(2 + Math.min(levels, 5) - 1, 1)\n ];\n else _levels = levels;\n const nCols = _levels[1] - _levels[0] + 1;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-column\", [\n $69e10b1ec4ac73f6$var$h(\"div.timescales\", packages.map((group)=>{\n const { pixelHeight: pixelHeight, paddingTop: paddingTop, key: key, scale: scale } = group;\n return $69e10b1ec4ac73f6$var$h(\"div.timescale-container\", {\n style: {\n paddingTop: paddingTop,\n \"--timescale-level-count\": nCols\n },\n key: key\n }, [\n $69e10b1ec4ac73f6$var$h((0, $dA1GT$Timescale), {\n orientation: (0, $dA1GT$TimescaleOrientation).VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale: scale,\n intervals: intervals\n })\n ]);\n })),\n $69e10b1ec4ac73f6$var$h.if(unconformityLabels)($69e10b1ec4ac73f6$export$e12e53eeee198b99, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: (0, $dA1GT$ColumnAxisType).AGE\n })\n ]);\n}\nfunction $69e10b1ec4ac73f6$export$e12e53eeee198b99(props) {\n const { width: width, sections: sections, className: className, axisType: axisType, verbose: verbose } = props;\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity-labels\", {\n style: {\n width: width\n },\n className: className\n }, sections.map((scaleInfo, i)=>{\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return $69e10b1ec4ac73f6$var$h($69e10b1ec4ac73f6$var$Unconformity, {\n axisType: axisType,\n upperAge: upperAge,\n lowerAge: lowerAge,\n style: {\n width: width,\n height: scaleInfo.paddingTop,\n top: top\n },\n verbose: verbose\n });\n }));\n}\nfunction $69e10b1ec4ac73f6$var$Unconformity({ upperAge: upperAge, lowerAge: lowerAge, style: style, axisType: axisType, verbose: verbose = false }) {\n if (upperAge == null || lowerAge == null) return null;\n const ageGap = Math.abs(upperAge - lowerAge);\n let maximumFractionDigits = 0;\n let className = null;\n if (ageGap > 1000) className = \"giga\";\n else if (ageGap > 100) className = \"mega\";\n else if (ageGap > 10) className = \"large\";\n else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else maximumFractionDigits = 1;\n let val;\n if (axisType === (0, $dA1GT$ColumnAxisType).DEPTH || axisType === (0, $dA1GT$ColumnAxisType).HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", {\n maximumFractionDigits: maximumFractionDigits\n });\n val = $69e10b1ec4ac73f6$var$h((0, $dA1GT$Value), {\n value: _txt,\n unit: \"m\"\n });\n } else val = $69e10b1ec4ac73f6$var$h((0, $iYfAq.Duration), {\n value: ageGap,\n maximumFractionDigits: maximumFractionDigits\n });\n let prefix = null;\n if (verbose) prefix = $69e10b1ec4ac73f6$var$h([\n \" \",\n $69e10b1ec4ac73f6$var$h(\"span.prefix\", \" gap\")\n ]);\n return $69e10b1ec4ac73f6$var$h(\"div.unconformity\", {\n style: style,\n className: className\n }, [\n $69e10b1ec4ac73f6$var$h(\"div.unconformity-inner\", $69e10b1ec4ac73f6$var$h(\"div.unconformity-text\", [\n val,\n prefix\n ]))\n ]);\n}\n\n\nexport {$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7 as SectionsColumn, $69e10b1ec4ac73f6$export$e12e53eeee198b99 as UnconformityLabels, $69e10b1ec4ac73f6$export$db2df5a73a6fbe10 as CompositeTimescale, $69e10b1ec4ac73f6$export$463f46772c64d403 as CompositeTimescaleCore};\n//# sourceMappingURL=column-views.b40c1b9c.js.map\n","import {\n CompositeUnitsColumn,\n LabelTrackerProvider,\n SectionLabelsColumn,\n} from \"./units\";\nimport { ReactNode, FunctionComponent, useMemo } from \"react\";\nimport {\n Timescale,\n TimescaleOrientation,\n useMacrostratIntervals,\n} from \"@macrostrat/timescale\";\nimport { ColumnAxisType, SVG } from \"@macrostrat/column-components\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./column.module.sass\";\nimport {\n useMacrostratColumnData,\n useMacrostratUnits,\n MacrostratColumnProvider,\n useMacrostratBaseURL,\n} from \"./data-provider\";\nimport { Duration } from \"./unit-details\";\nimport { Value } from \"@macrostrat/data-components\";\nimport type { ExtUnit, PackageScaleLayoutData } from \"./prepare-units/types\";\n\nconst h = hyper.styled(styles);\n\nexport interface SectionSharedProps {\n unitComponent?: FunctionComponent<any>;\n unitComponentProps?: any;\n showLabels?: boolean;\n width?: number;\n columnWidth?: number;\n children?: ReactNode;\n showLabelColumn?: boolean;\n axisType?: ColumnAxisType;\n className?: string;\n clipUnits?: boolean;\n maxInternalColumns?: number;\n // Space between sections\n verticalSpacing?: number;\n // Whether to render unconformity labels\n unconformityLabels?: boolean;\n}\n\nexport interface SectionProps extends SectionSharedProps {\n units: ExtUnit[];\n scaleInfo: PackageScaleLayoutData;\n}\n\nexport function SectionsColumn(props: SectionSharedProps) {\n const {\n unconformityLabels = true,\n unitComponent,\n unitComponentProps,\n showLabels = true,\n width = 300,\n columnWidth = 150,\n showLabelColumn = true,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const units = useMacrostratUnits();\n\n // Get a unique key for the column\n const key = units[0]?.col_id;\n\n return h(LabelTrackerProvider, { units, key }, [\n h(SectionUnitsColumn, {\n width: columnWidth,\n unitComponent,\n unitComponentProps,\n showLabels,\n clipUnits,\n maxInternalColumns,\n unconformityLabels,\n }),\n h.if(showLabelColumn)(SectionLabelsColumn, {\n width: width - columnWidth,\n }),\n ]);\n}\n\nfunction SectionUnitsColumn(props: SectionSharedProps) {\n const {\n width,\n showLabels,\n unitComponent,\n unitComponentProps,\n clipUnits,\n maxInternalColumns,\n axisType,\n unconformityLabels = true,\n } = props;\n\n const { sections, totalHeight } = useMacrostratColumnData();\n\n const scaleData: PackageScaleLayoutData[] = sections.map((section) => {\n return section.scaleInfo;\n });\n\n const innerWidth = width - 2;\n\n return h(\"div.section-units-container\", { style: { width } }, [\n h(\n SVG,\n {\n className: \"sections\",\n height: totalHeight,\n innerWidth,\n paddingH: 1,\n },\n sections.map((group) => {\n const { units, scaleInfo, section_id } = group;\n\n const key = `section-${section_id}`;\n return h(\n SectionUnits,\n {\n units,\n scaleInfo,\n key,\n unitComponent,\n unitComponentProps,\n showLabels,\n width: innerWidth,\n clipUnits,\n maxInternalColumns,\n }, // This unconformity is with the section _above_\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width,\n sections: scaleData,\n verbose: false,\n }),\n ]);\n}\n\nfunction SectionUnits(props: SectionProps) {\n // Section with \"squishy\" timescale\n const {\n units,\n scaleInfo,\n unitComponent,\n showLabels = true,\n width = 300,\n unitComponentProps,\n className,\n clipUnits = true,\n maxInternalColumns,\n } = props;\n\n const { domain, pixelScale, pixelHeight, scale } = scaleInfo;\n\n /** Ensure that we can arrange units into the maximum number\n * of columns defined by unitComponentProps, but that we don't\n * use more than necessary.\n */\n const _unitComponentProps = useMemo(() => {\n return {\n ...unitComponentProps,\n nColumns: Math.min(\n maxInternalColumns ?? Math.floor(width / 10),\n unitComponentProps?.nColumns ?? Infinity,\n Math.max(...units.map((d) => d.column)) + 1,\n ),\n //axisType,\n };\n }, [units, unitComponentProps, maxInternalColumns, width]);\n\n const style = {\n \"--section-height\": `${pixelHeight}px`,\n \"--section-width\": `${width}px`,\n };\n\n return h(\n \"g.section\",\n { className, style, transform: `translate(0 ${scaleInfo.offset})` },\n h(\n MacrostratColumnProvider,\n {\n units,\n domain,\n pixelScale, // Actually pixels per myr,\n scale,\n },\n h(CompositeUnitsColumn, {\n width,\n showLabels,\n unitComponent,\n unitComponentProps: _unitComponentProps,\n clipToFrame: clipUnits,\n }),\n ),\n );\n}\n\ninterface CompositeTimescaleProps {\n levels?: [number, number] | number;\n unconformityLabels?: boolean;\n}\n\nexport function CompositeTimescale(props: CompositeTimescaleProps) {\n const { sections } = useMacrostratColumnData();\n const sectionScales = sections.map((section) => {\n return section.scaleInfo;\n });\n\n return h(CompositeTimescaleCore, {\n packages: sectionScales,\n ...props,\n });\n}\n\ntype CompositeTimescaleCoreProps = CompositeTimescaleProps & {\n packages: PackageScaleLayoutData[];\n};\n\nexport function CompositeTimescaleCore(props: CompositeTimescaleCoreProps) {\n const { levels = 3, packages, unconformityLabels = false } = props;\n\n // Use intervals from Macrostrat API\n const baseURL = useMacrostratBaseURL();\n const intervals = useMacrostratIntervals(baseURL);\n\n let _levels: [number, number];\n if (typeof levels === \"number\") {\n // If levels is a number, use the most common starting level\n _levels = [2, Math.max(2 + Math.min(levels, 5) - 1, 1)];\n } else {\n _levels = levels;\n }\n\n const nCols = _levels[1] - _levels[0] + 1;\n\n return h(\"div.timescale-column\", [\n h(\n \"div.timescales\",\n packages.map((group) => {\n const { pixelHeight, paddingTop, key, scale } = group;\n return h(\n \"div.timescale-container\",\n { style: { paddingTop, \"--timescale-level-count\": nCols }, key },\n [\n h(Timescale, {\n orientation: TimescaleOrientation.VERTICAL,\n length: pixelHeight,\n levels: _levels,\n absoluteAgeScale: true,\n showAgeAxis: false,\n scale,\n intervals,\n }),\n ],\n );\n }),\n ),\n h.if(unconformityLabels)(UnconformityLabels, {\n width: \"100%\",\n sections: packages,\n className: \"unconformity-labels\",\n axisType: ColumnAxisType.AGE,\n }),\n ]);\n}\n\nexport function UnconformityLabels(props: {\n width: string | number;\n sections: PackageScaleLayoutData[];\n axisType?: ColumnAxisType;\n className?: string;\n verbose?: boolean;\n}) {\n const { width, sections, className, axisType, verbose } = props;\n\n return h(\n \"div.unconformity-labels\",\n {\n style: {\n width,\n },\n className,\n },\n sections.map((scaleInfo, i) => {\n const lastGroup = sections[i - 1];\n const top = scaleInfo.offset - scaleInfo.paddingTop;\n const upperAge = lastGroup?.domain[0];\n const lowerAge = scaleInfo.domain[1];\n return h(Unconformity, {\n axisType,\n upperAge,\n lowerAge,\n style: {\n width,\n height: scaleInfo.paddingTop,\n top,\n },\n verbose,\n });\n }),\n );\n}\n\nfunction Unconformity({\n upperAge,\n lowerAge,\n style,\n axisType,\n verbose = false,\n}) {\n if (upperAge == null || lowerAge == null) {\n return null;\n }\n\n const ageGap = Math.abs(upperAge - lowerAge);\n\n let maximumFractionDigits = 0;\n\n let className: string = null;\n if (ageGap > 1000) {\n className = \"giga\";\n } else if (ageGap > 100) {\n className = \"mega\";\n } else if (ageGap > 10) {\n className = \"large\";\n } else if (ageGap < 1) {\n className = \"small\";\n maximumFractionDigits = 2;\n } else {\n maximumFractionDigits = 1;\n }\n\n let val: ReactNode;\n if (axisType === ColumnAxisType.DEPTH || axisType === ColumnAxisType.HEIGHT) {\n const _txt = ageGap.toLocaleString(\"en-US\", { maximumFractionDigits });\n val = h(Value, { value: _txt, unit: \"m\" });\n } else {\n val = h(Duration, { value: ageGap, maximumFractionDigits });\n }\n\n let prefix: ReactNode = null;\n if (verbose) {\n prefix = h([\" \", h(\"span.prefix\", \" gap\")]);\n }\n\n return h(\"div.unconformity\", { style, className }, [\n h(\"div.unconformity-inner\", h(\"div.unconformity-text\", [val, prefix])),\n ]);\n}\n"],"names":["useMemo","$dA1GT$useMemo","useMacrostratIntervals","$dA1GT$useMacrostratIntervals","Timescale","$dA1GT$Timescale","TimescaleOrientation","$dA1GT$TimescaleOrientation","SVG","$dA1GT$SVG","ColumnAxisType","$dA1GT$ColumnAxisType","$dA1GT$macrostrathyper","Value","$dA1GT$Value","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$4Abge","$7YHvf","$lgTAP","$wtIgl","$iYfAq","$69e10b1ec4ac73f6$var$h","styled","a","__esModule","default","$69e10b1ec4ac73f6$export$38cb0ab5af8f50d7","props","unconformityLabels","unitComponent","unitComponentProps","showLabels","width","columnWidth","showLabelColumn","clipUnits","maxInternalColumns","units","useMacrostratUnits","key","col_id","LabelTrackerProvider","$69e10b1ec4ac73f6$var$SectionUnitsColumn","if","SectionLabelsColumn","axisType","sections","totalHeight","useMacrostratColumnData","scaleData","map","section","scaleInfo","innerWidth","style","className","height","paddingH","group","section_id","$69e10b1ec4ac73f6$var$SectionUnits","$69e10b1ec4ac73f6$export$e12e53eeee198b99","verbose","domain","pixelScale","pixelHeight","scale","_unitComponentProps","nColumns","Math","min","floor","Infinity","max","d","column","transform","offset","MacrostratColumnProvider","CompositeUnitsColumn","clipToFrame","$69e10b1ec4ac73f6$export$db2df5a73a6fbe10","$69e10b1ec4ac73f6$export$463f46772c64d403","packages","_levels","levels","intervals","useMacrostratBaseURL","nCols","paddingTop","orientation","VERTICAL","length","absoluteAgeScale","showAgeAxis","AGE","i","lastGroup","top","$69e10b1ec4ac73f6$var$Unconformity","upperAge","lowerAge","val","ageGap","abs","maximumFractionDigits","DEPTH","HEIGHT","value","toLocaleString","unit","Duration","prefix","SectionsColumn","UnconformityLabels","CompositeTimescale","CompositeTimescaleCore"],"version":3,"file":"column-views.b40c1b9c.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ import"./column-views.fac4baff.js";import"./column-views.46efb749.js";import"./column-views.672b683c.js";import e from"@macrostrat/hyper";import{Box as t,useElementSize as a}from"@macrostrat/ui-components";import{group as r}from"d3-array";import{ColumnSVG as n,ColumnAxisType as o}from"@macrostrat/column-components";import{useRef as s}from"react";function l(e,t,a,r){Object.defineProperty(e,t,{get:a,set:r,enumerable:!0,configurable:!0})}var i=globalThis,c={},u={},p=i.parcelRequirea149;null==p&&((p=function(e){if(e in c)return c[e].exports;if(e in u){var t=u[e];delete u[e];var a={id:e,exports:{}};return c[e]=a,t.call(a.exports,a,a.exports),a.exports}var r=Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,t){u[e]=t},i.parcelRequirea149=p),p.register;var f={};l(f,"PBDBOccurrencesMatrix",()=>_),l(f,"FossilDataType",()=>p("dx7no").FossilDataType);var m=p("dx7no"),x=p("wtIgl"),d=p("f7qDU");let g=e.styled(d&&d.__esModule?d.default:d);function _({columnID:e}){let a=(0,m.useFossilData)(e,m.FossilDataType.Occurrences),s=(0,x.useMacrostratColumnData)(),l=(0,x.useCompositeScale)();if(null==a)return null;let i=new Map(r(a,e=>e.unit_id)),{taxonRanges:c}=function(e,t,a=o.AGE){let r=new Map,n=new Map;for(let[e,a]of t.entries())for(let t of a){let a=t.best_name??t.taxon_name;r.has(a)||(r.set(a,new Set),n.set(a,[])),r.get(a).add(e),n.get(a).push(t)}let s=Array.from(r.entries()).sort((e,t)=>t[0].localeCompare(e[0])),l=new Map;for(let[t,n]of r.entries())l.set(t,function(e,t,a){let r=[],n=null;for(let s of e)t.has(s.unit_id)?null==n?n=a==o.DEPTH||a==o.HEIGHT?[s.t_pos,s.b_pos]:[s.t_age,s.b_age]:a==o.DEPTH||a==o.HEIGHT?n[1]=s.b_pos:n[1]=s.b_age:null!=n&&(r.push(n),n=null);return null!=n&&r.push(n),r}(e,n,a));return{occurrenceMap:t,taxonUnitMap:new Map(s),taxonOccurrenceMap:n,taxonRanges:l}}(s.units,i,s.axisType),u=Array.from(c.entries());return g(t,{className:"taxon-ranges",width:32+16*u.length,height:s.totalHeight},[g(b,{taxonEntries:u,padding:16,spacing:16,scale:l}),g(n,{width:32+16*u.length},g("g.taxa-occurrences-matrix",u.map(([e,t],a)=>g("g",{transform:`translate(${16+16*a})`},[t.map(([e,t])=>g("line",{y1:l(e),y2:l(t)}))]))))])}function b({taxonEntries:e,padding:t,spacing:a,scale:r}){return g("div.taxon-labels",[e.map(([e,n],o)=>{let s=r(n[0]?.[0]??0)-20;return s<200&&(s=0),g(h,{top:s,left:t+o*a,taxonName:e})})])}function h({top:e,left:t,taxonName:r}){let n=s(),o=a(n),l=o?.height??200;return g("div.taxon-label",{style:{top:`${e}px`,marginLeft:`${t}px`,"--label-width":`${l}px`}},g("div.taxon-label-inner",g("div.taxon-label-text",{ref:n},r)))}export{_ as PBDBOccurrencesMatrix,$8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType};
2
+ //# sourceMappingURL=column-views.b6e86cf0.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,O,C,C,kB,C,K,2B,A,Q,S,C,K,U,A,Q,a,C,C,kB,C,K,+B,A,Q,U,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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,EAAO,GAChB,EAAE,OAAQ,CACf,GAAI,EAAM,GACV,GAAI,EAAM,EACZ,IAEH,KAIR,CACH,CAEA,SAAS,EAAsB,CAAA,aAAE,CAAY,CAAA,QAAE,CAAO,CAAA,QAAE,CAAO,CAAA,MAAE,CAAK,CAAE,EACtE,OAAO,EAAE,mBAAoB,CAC3B,EAAa,GAAG,CAAC,CAAC,CAAC,EAAW,EAAO,CAAE,KAErC,IAAI,EAAQ,EADA,CAAM,CAAC,EAAE,EAAE,CAAC,EAAE,EAAI,GACL,GAGzB,OAFI,EAAQ,KAAK,CAAA,EAAQ,CAAA,EAElB,EAAE,EAAY,CACnB,IAAK,EACL,KAAM,EAAU,EAAW,EAC3B,UAAA,CACF,EACF,GACD,CACH,CAEA,SAAS,EAAW,CAAA,IAAE,CAAG,CAAA,KAAE,CAAI,CAAA,UAAE,CAAS,CAAE,EAC1C,IAAM,EAAM,AAAA,IACN,EAAW,AAAA,EAAe,GAC1B,EAAa,GAAU,QAAU,IACvC,OAAO,EACL,kBACA,CACE,MAAO,CACL,IAAK,CAAA,EAAG,EAAI,EAAE,CAAC,CACf,WAAY,CAAA,EAAG,EAAK,EAAE,CAAC,CACvB,gBAAiB,CAAA,EAAG,EAAW,EAAE,CAAC,AACpC,CACF,EACA,EAAE,wBAAyB,EAAE,uBAAwB,CAAE,IAAA,CAAI,EAAG,IAElE,Q,K,qB,C,6C,c","sources":["<anon>","packages/column-views/src/facets/fossils/taxon-ranges.ts"],"sourcesContent":["import \"./column-views.fac4baff.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.672b683c.js\";\nimport $1vN9E$macrostrathyper from \"@macrostrat/hyper\";\nimport {Box as $1vN9E$Box, useElementSize as $1vN9E$useElementSize} from \"@macrostrat/ui-components\";\nimport {group as $1vN9E$group} from \"d3-array\";\nimport {ColumnSVG as $1vN9E$ColumnSVG, ColumnAxisType as $1vN9E$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {useRef as $1vN9E$useRef} 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 $9cea14fa75e12a56$exports = {};\n\n$parcel$export($9cea14fa75e12a56$exports, \"PBDBOccurrencesMatrix\", () => $9cea14fa75e12a56$export$652730986cccff7a);\n$parcel$export($9cea14fa75e12a56$exports, \"FossilDataType\", () => (parcelRequire(\"dx7no\")).FossilDataType);\n\n\nvar $dx7no = parcelRequire(\"dx7no\");\n\n\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $f7qDU = parcelRequire(\"f7qDU\");\n\nconst $9cea14fa75e12a56$var$h = (0, $1vN9E$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($f7qDU))));\nfunction $9cea14fa75e12a56$export$652730986cccff7a({ columnID: columnID }) {\n /* A column for a matrix of taxon occurrences displayed as a table beside the main column. This will\n eventually be extended with first/last occurrence markers and range bars.\n */ const data = (0, $dx7no.useFossilData)(columnID, (0, $dx7no.FossilDataType).Occurrences);\n const col = (0, $wtIgl.useMacrostratColumnData)();\n const scale = (0, $wtIgl.useCompositeScale)();\n if (data == null) return null;\n const data1 = (0, $1vN9E$group)(data, (d)=>d.unit_id);\n // convert the data to a map\n const occurrenceMap = new Map(data1);\n const matrix = $9cea14fa75e12a56$var$createOccurrenceMatrix(col.units, occurrenceMap, col.axisType);\n const { taxonRanges: taxonRanges } = matrix;\n const padding = 16;\n const spacing = 16;\n const taxonEntries = Array.from(taxonRanges.entries());\n //const taxon = taxonEntries.slice(0, 50); // limit to top 50 taxa\n const width = padding * 2 + spacing * taxonEntries.length;\n return $9cea14fa75e12a56$var$h((0, $1vN9E$Box), {\n className: \"taxon-ranges\",\n width: width,\n height: col.totalHeight\n }, [\n $9cea14fa75e12a56$var$h($9cea14fa75e12a56$var$TaxonOccurrenceLabels, {\n taxonEntries: taxonEntries,\n padding: padding,\n spacing: spacing,\n scale: scale\n }),\n $9cea14fa75e12a56$var$h((0, $1vN9E$ColumnSVG), {\n width: padding * 2 + spacing * taxonEntries.length\n }, $9cea14fa75e12a56$var$h(\"g.taxa-occurrences-matrix\", taxonEntries.map(([taxonName, ranges], rowIndex)=>{\n const xPosition = padding + rowIndex * spacing;\n return $9cea14fa75e12a56$var$h(\"g\", {\n transform: `translate(${xPosition})`\n }, [\n ranges.map(([top, bottom])=>{\n return $9cea14fa75e12a56$var$h(\"line\", {\n y1: scale(top),\n y2: scale(bottom)\n });\n })\n ]);\n })))\n ]);\n}\nfunction $9cea14fa75e12a56$var$TaxonOccurrenceLabels({ taxonEntries: taxonEntries, padding: padding, spacing: spacing, scale: scale }) {\n return $9cea14fa75e12a56$var$h(\"div.taxon-labels\", [\n taxonEntries.map(([taxonName, ranges], rowIndex)=>{\n const top = ranges[0]?.[0] ?? 0;\n let topPx = scale(top) - 20;\n if (topPx < 200) topPx = 0;\n return $9cea14fa75e12a56$var$h($9cea14fa75e12a56$var$TaxonLabel, {\n top: topPx,\n left: padding + rowIndex * spacing,\n taxonName: taxonName\n });\n })\n ]);\n}\nfunction $9cea14fa75e12a56$var$TaxonLabel({ top: top, left: left, taxonName: taxonName }) {\n const ref = (0, $1vN9E$useRef)();\n const textSize = (0, $1vN9E$useElementSize)(ref);\n const labelWidth = textSize?.height ?? 200;\n return $9cea14fa75e12a56$var$h(\"div.taxon-label\", {\n style: {\n top: `${top}px`,\n marginLeft: `${left}px`,\n \"--label-width\": `${labelWidth}px`\n }\n }, $9cea14fa75e12a56$var$h(\"div.taxon-label-inner\", $9cea14fa75e12a56$var$h(\"div.taxon-label-text\", {\n ref: ref\n }, taxonName)));\n}\nfunction $9cea14fa75e12a56$var$TaxonOccurrenceEntry({ xPosition: xPosition, ranges: ranges, scale: scale, name: name }) {\n return $9cea14fa75e12a56$var$h(\"g\", {\n transform: `translate(${xPosition})`\n }, [\n ranges.map(([top, bottom])=>{\n return $9cea14fa75e12a56$var$h(\"line\", {\n y1: scale(top),\n y2: scale(bottom)\n });\n })\n ]);\n}\nfunction $9cea14fa75e12a56$var$createOccurrenceMatrix(units, data, axisType = (0, $1vN9E$ColumnAxisType).AGE) {\n const taxonUnitMap = new Map();\n const taxonOccurrenceMap = new Map();\n for (const [unit_id, occurrences] of data.entries())for (const occ of occurrences){\n const taxonName = occ.best_name ?? occ.taxon_name;\n if (!taxonUnitMap.has(taxonName)) {\n taxonUnitMap.set(taxonName, new Set());\n taxonOccurrenceMap.set(taxonName, []);\n }\n taxonUnitMap.get(taxonName).add(unit_id);\n taxonOccurrenceMap.get(taxonName).push(occ);\n }\n // sort the taxon occurrence map by number of occurrences\n const sortedTaxa = Array.from(taxonUnitMap.entries()).sort((a, b)=>{\n // Sort alphabetically by taxon name\n return b[0].localeCompare(a[0]);\n });\n const taxonRanges = new Map();\n for (const [taxonName, unitSet] of taxonUnitMap.entries())taxonRanges.set(taxonName, $9cea14fa75e12a56$var$accumulatePresenceDomains(units, unitSet, axisType));\n return {\n occurrenceMap: data,\n taxonUnitMap: new Map(sortedTaxa),\n taxonOccurrenceMap: taxonOccurrenceMap,\n taxonRanges: taxonRanges\n };\n}\nfunction $9cea14fa75e12a56$var$accumulatePresenceDomains(unit, presenceUnits, axisType) {\n const domains = [];\n let currentDomain = null;\n for (const u of unit){\n if (presenceUnits.has(u.unit_id)) {\n if (currentDomain == null) {\n if (axisType == (0, $1vN9E$ColumnAxisType).DEPTH || axisType == (0, $1vN9E$ColumnAxisType).HEIGHT) currentDomain = [\n u.t_pos,\n u.b_pos\n ];\n else currentDomain = [\n u.t_age,\n u.b_age\n ];\n } else if (axisType == (0, $1vN9E$ColumnAxisType).DEPTH || axisType == (0, $1vN9E$ColumnAxisType).HEIGHT) currentDomain[1] = u.b_pos;\n else currentDomain[1] = u.b_age;\n } else if (currentDomain != null) {\n domains.push(currentDomain);\n currentDomain = null;\n }\n }\n if (currentDomain != null) domains.push(currentDomain);\n return domains;\n}\n\n\nexport {$9cea14fa75e12a56$export$652730986cccff7a as PBDBOccurrencesMatrix, $8e174c7ae24a4598$export$a990c76b38782f57 as FossilDataType};\n//# sourceMappingURL=column-views.b6e86cf0.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport { FossilDataType, PBDBOccurrence, useFossilData } from \"./provider\";\nimport { Box, useElementSize } from \"@macrostrat/ui-components\";\nimport { group } from \"d3-array\";\nimport { ColumnAxisType, ColumnSVG } from \"@macrostrat/column-components\";\nimport {\n useMacrostratColumnData,\n useCompositeScale,\n} from \"../../data-provider\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport styles from \"./taxon-ranges.module.sass\";\nimport { useRef } from \"react\";\n\nconst h = hyper.styled(styles);\n\nexport { FossilDataType };\n\nexport function PBDBOccurrencesMatrix({ columnID }) {\n /* A column for a matrix of taxon occurrences displayed as a table beside the main column. This will\n eventually be extended with first/last occurrence markers and range bars.\n */\n const data = useFossilData(columnID, FossilDataType.Occurrences);\n const col = useMacrostratColumnData();\n const scale = useCompositeScale();\n\n if (data == null) return null;\n\n const data1 = group(data, (d) => d.unit_id);\n\n // convert the data to a map\n const occurrenceMap = new Map(data1);\n\n const matrix = createOccurrenceMatrix(col.units, occurrenceMap, col.axisType);\n\n const { taxonRanges } = matrix;\n\n const padding = 16;\n const spacing = 16;\n\n const taxonEntries = Array.from(taxonRanges.entries());\n //const taxon = taxonEntries.slice(0, 50); // limit to top 50 taxa\n\n const width = padding * 2 + spacing * taxonEntries.length;\n\n return h(Box, { className: \"taxon-ranges\", width, height: col.totalHeight }, [\n h(TaxonOccurrenceLabels, {\n taxonEntries,\n padding,\n spacing,\n scale,\n }),\n h(\n ColumnSVG,\n {\n width: padding * 2 + spacing * taxonEntries.length,\n },\n h(\n \"g.taxa-occurrences-matrix\",\n taxonEntries.map(([taxonName, ranges], rowIndex) => {\n const xPosition = padding + rowIndex * spacing;\n return h(\"g\", { transform: `translate(${xPosition})` }, [\n ranges.map(([top, bottom]) => {\n return h(\"line\", {\n y1: scale(top),\n y2: scale(bottom),\n });\n }),\n ]);\n }),\n ),\n ),\n ]);\n}\n\nfunction TaxonOccurrenceLabels({ taxonEntries, padding, spacing, scale }) {\n return h(\"div.taxon-labels\", [\n taxonEntries.map(([taxonName, ranges], rowIndex) => {\n const top = ranges[0]?.[0] ?? 0;\n let topPx = scale(top) - 20;\n if (topPx < 200) topPx = 0;\n\n return h(TaxonLabel, {\n top: topPx,\n left: padding + rowIndex * spacing,\n taxonName,\n });\n }),\n ]);\n}\n\nfunction TaxonLabel({ top, left, taxonName }) {\n const ref = useRef();\n const textSize = useElementSize(ref);\n const labelWidth = textSize?.height ?? 200;\n return h(\n \"div.taxon-label\",\n {\n style: {\n top: `${top}px`,\n marginLeft: `${left}px`,\n \"--label-width\": `${labelWidth}px`,\n },\n },\n h(\"div.taxon-label-inner\", h(\"div.taxon-label-text\", { ref }, taxonName)),\n );\n}\n\ntype TaxonUnitMap = Map<string, Set<number>>;\n\ninterface OccurrenceMatrixData {\n occurrenceMap: Map<number, PBDBOccurrence[]>; // Map of unit IDs to occurrences (original data)\n taxonUnitMap: TaxonUnitMap; // Map of taxon names to sets of unit IDs\n taxonOccurrenceMap: Map<string, PBDBOccurrence[]>; // Map of taxon names to occurrences\n taxonRanges: Map<string, [number, number][]>; // Map of taxon names to [top, bottom] pixel ranges\n}\n\nfunction TaxonOccurrenceEntry({\n xPosition,\n ranges,\n scale,\n name,\n}: {\n xPosition: number;\n units: Set<number>;\n}) {\n return h(\"g\", { transform: `translate(${xPosition})` }, [\n ranges.map(([top, bottom]) => {\n return h(\"line\", {\n y1: scale(top),\n y2: scale(bottom),\n });\n }),\n ]);\n}\n\nfunction createOccurrenceMatrix(\n units: UnitLong[],\n data: Map<number, PBDBOccurrence[]>,\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): OccurrenceMatrixData {\n const taxonUnitMap = new Map<string, Set<number>>();\n const taxonOccurrenceMap = new Map<string, PBDBOccurrence[]>();\n\n for (const [unit_id, occurrences] of data.entries()) {\n for (const occ of occurrences) {\n const taxonName = occ.best_name ?? occ.taxon_name;\n if (!taxonUnitMap.has(taxonName)) {\n taxonUnitMap.set(taxonName, new Set());\n taxonOccurrenceMap.set(taxonName, []);\n }\n taxonUnitMap.get(taxonName).add(unit_id);\n taxonOccurrenceMap.get(taxonName).push(occ);\n }\n }\n\n // sort the taxon occurrence map by number of occurrences\n const sortedTaxa = Array.from(taxonUnitMap.entries()).sort((a, b) => {\n // Sort alphabetically by taxon name\n return b[0].localeCompare(a[0]);\n });\n\n const taxonRanges = new Map<string, [number, number][]>();\n for (const [taxonName, unitSet] of taxonUnitMap.entries()) {\n taxonRanges.set(\n taxonName,\n accumulatePresenceDomains(units, unitSet, axisType),\n );\n }\n\n return {\n occurrenceMap: data,\n taxonUnitMap: new Map(sortedTaxa),\n taxonOccurrenceMap: taxonOccurrenceMap,\n taxonRanges,\n };\n}\n\nfunction accumulatePresenceDomains(\n unit: UnitLong[],\n presenceUnits: Set<number>,\n axisType: ColumnAxisType,\n): Array<[number, number]> {\n const domains: Array<[number, number]> = [];\n let currentDomain: [number, number] | null = null;\n\n for (const u of unit) {\n if (presenceUnits.has(u.unit_id)) {\n if (currentDomain == null) {\n if (\n axisType == ColumnAxisType.DEPTH ||\n axisType == ColumnAxisType.HEIGHT\n ) {\n currentDomain = [u.t_pos, u.b_pos];\n } else {\n currentDomain = [u.t_age, u.b_age];\n }\n } else {\n if (\n axisType == ColumnAxisType.DEPTH ||\n axisType == ColumnAxisType.HEIGHT\n ) {\n currentDomain[1] = u.b_pos;\n } else {\n currentDomain[1] = u.b_age;\n }\n }\n } else {\n if (currentDomain != null) {\n domains.push(currentDomain);\n currentDomain = null;\n }\n }\n }\n\n if (currentDomain != null) {\n domains.push(currentDomain);\n }\n\n return domains;\n}\n"],"names":["$1vN9E$macrostrathyper","Box","$1vN9E$Box","useElementSize","$1vN9E$useElementSize","group","$1vN9E$group","ColumnSVG","$1vN9E$ColumnSVG","ColumnAxisType","$1vN9E$ColumnAxisType","useRef","$1vN9E$useRef","$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","$9cea14fa75e12a56$exports","$9cea14fa75e12a56$export$652730986cccff7a","FossilDataType","$dx7no","$wtIgl","$f7qDU","$9cea14fa75e12a56$var$h","styled","a","__esModule","default","columnID","data","useFossilData","Occurrences","col","useMacrostratColumnData","scale","useCompositeScale","occurrenceMap","Map","d","unit_id","taxonRanges","$9cea14fa75e12a56$var$createOccurrenceMatrix","units","axisType","AGE","taxonUnitMap","taxonOccurrenceMap","occurrences","entries","occ","taxonName","best_name","taxon_name","has","Set","add","push","sortedTaxa","Array","from","sort","b","localeCompare","unitSet","$9cea14fa75e12a56$var$accumulatePresenceDomains","unit","presenceUnits","domains","currentDomain","u","DEPTH","HEIGHT","t_pos","b_pos","t_age","b_age","taxonEntries","className","width","padding","spacing","length","height","totalHeight","$9cea14fa75e12a56$var$TaxonOccurrenceLabels","map","ranges","rowIndex","transform","top","bottom","y1","y2","topPx","$9cea14fa75e12a56$var$TaxonLabel","left","ref","textSize","labelWidth","style","marginLeft","PBDBOccurrencesMatrix","$8e174c7ae24a4598$export$a990c76b38782f57"],"version":3,"file":"column-views.b6e86cf0.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.7425d37b.js";import"./column-views.e1813308.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,"useMacrostratBaseURL",()=>w),f(h,"useMacrostratDefs",()=>x),f(h,"useMacrostratColumns",()=>R),f(h,"useMacrostratData",()=>L),f(h,"MacrostratDataProvider",()=>y),f(h,"MacrostratAPIProvider",()=>C),f(h,"MacrostratColumnProvider",()=>D),f(h,"LithologiesProvider",()=>E),f(h,"useLithologies",()=>S),f(h,"useEnvironments",()=>U);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=r.get(n);if(null==o||o.inProcess!=t){let a=["active"];t&&a.push("in process");let l=await (0,g.fetchAllColumns)({projectID:e,statusCode:a,fetch:s});if(null==l)return;o={project_id:e,inProcess:t,columns:l};let i=new Map(r);i.set(n,o),c({columnFootprints:i})}return o.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(_);if(null==r)throw Error("Missing MacrostratDataProvider");return"api"===e?r:i(r,e)}function w(e="https://macrostrat.org/api/v2"){let r=t(_);return null==r?e:r.getState().baseURL}let P={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 x(e){if("columns"==e)throw Error("Columns are not provided as a map");let t=M(P[e]);return r(()=>{t()},[]),M(t=>t[e])}function R(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 L(e,...t){let a=M(P[e]),[n,o]=s(null);return r(()=>{try{a(...t).then(o)}catch(e){console.error(e)}},[a,...t]),n}let _=n($());function y(e){let{baseURL:t="https://dev.macrostrat.org/api/v2",children:r}=e,[a]=s(()=>$(t));return o(C,{baseURL:t},o(_.Provider,{value:a},r))}function C({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 D(e){let{axisType:t}=(0,b.useMacrostratColumnData)(),{units:r,domain:a,pixelScale:s,scale:n,children:l}=e;return o(c,{axisType:t,divisions:r,range:a,pixelsPerMeter:s,scale:n},l)}function E({children:e}){return r(()=>{console.warn("LithologiesProvider is deprecated. Replace with MacrostratDataProvider")},[]),e}function S(){let e=M(e=>e.getLithologies),t=M(e=>e.lithologies);return r(()=>{null==t&&e()},[t,e]),t}function U(){let e=M(e=>e.getEnvironments),t=M(e=>e.environments);return r(()=>{null==t&&e()},[t,e]),t}export{M as useMacrostratStore,w as useMacrostratBaseURL,x as useMacrostratDefs,R as useMacrostratColumns,L as useMacrostratData,y as MacrostratDataProvider,C as MacrostratAPIProvider,D as MacrostratColumnProvider,E as LithologiesProvider,S as useLithologies,U as useEnvironments};
2
- //# sourceMappingURL=column-views.22c2d45b.js.map
1
+ import"./column-views.7425d37b.js";import"./column-views.46efb749.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,"useMacrostratBaseURL",()=>w),f(h,"useMacrostratDefs",()=>x),f(h,"useMacrostratColumns",()=>R),f(h,"useMacrostratData",()=>L),f(h,"MacrostratDataProvider",()=>y),f(h,"MacrostratAPIProvider",()=>C),f(h,"MacrostratColumnProvider",()=>D),f(h,"LithologiesProvider",()=>E),f(h,"useLithologies",()=>S),f(h,"useEnvironments",()=>U);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=r.get(n);if(null==o||o.inProcess!=t){let a=["active"];t&&a.push("in process");let l=await (0,g.fetchAllColumns)({projectID:e,statusCode:a,fetch:s});if(null==l)return;o={project_id:e,inProcess:t,columns:l};let i=new Map(r);i.set(n,o),c({columnFootprints:i})}return o.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(_);if(null==r)throw Error("Missing MacrostratDataProvider");return"api"===e?r:i(r,e)}function w(e="https://macrostrat.org/api/v2"){let r=t(_);return null==r?e:r.getState().baseURL}let P={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 x(e){if("columns"==e)throw Error("Columns are not provided as a map");let t=M(P[e]);return r(()=>{t()},[]),M(t=>t[e])}function R(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 L(e,...t){let a=M(P[e]),[n,o]=s(null);return r(()=>{try{a(...t).then(o)}catch(e){console.error(e)}},[a,...t]),n}let _=n($());function y(e){let{baseURL:t="https://dev.macrostrat.org/api/v2",children:r}=e,[a]=s(()=>$(t));return o(C,{baseURL:t},o(_.Provider,{value:a},r))}function C({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 D(e){let{axisType:t}=(0,b.useMacrostratColumnData)(),{units:r,domain:a,pixelScale:s,scale:n,children:l}=e;return o(c,{axisType:t,divisions:r,range:a,pixelsPerMeter:s,scale:n},l)}function E({children:e}){return r(()=>{console.warn("LithologiesProvider is deprecated. Replace with MacrostratDataProvider")},[]),e}function S(){let e=M(e=>e.getLithologies),t=M(e=>e.lithologies);return r(()=>{null==t&&e()},[t,e]),t}function U(){let e=M(e=>e.getEnvironments),t=M(e=>e.environments);return r(()=>{null==t&&e()},[t,e]),t}export{M as useMacrostratStore,w as useMacrostratBaseURL,x as useMacrostratDefs,R as useMacrostratColumns,L as useMacrostratData,y as MacrostratDataProvider,C as MacrostratAPIProvider,D as MacrostratColumnProvider,E as LithologiesProvider,S as useLithologies,U as useEnvironments};
2
+ //# sourceMappingURL=column-views.c007152b.js.map