@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
@@ -0,0 +1,2 @@
1
+ import"./column-views.e93b3bdb.js";import"./column-views.869c7199.js";import"./column-views.1d064426.js";import"./column-views.46efb749.js";import"./column-views.dbb4a46b.js";import{usePlotArea as e,DetritalSpectrumPlot as t,DetritalSeries as r}from"@macrostrat/data-components";import a from"@macrostrat/hyper";import{useMemo as o}from"react";import i from"classnames";import{group as n}from"d3-array";function l(e,t,r,a){Object.defineProperty(e,t,{get:r,set:a,enumerable:!0,configurable:!0})}var s=globalThis,u={},m={},c=s.parcelRequirea149;null==c&&((c=function(e){if(e in u)return u[e].exports;if(e in m){var t=m[e];delete m[e];var r={id:e,exports:{}};return u[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){m[e]=t},s.parcelRequirea149=c),c.register;var d={};l(d,"DetritalColumn",()=>w),l(d,"DetritalGroup",()=>b);var p=c("ehHhC"),f=c("jtfAP"),h=c("kIQUG"),g=c("wtIgl"),_=c("iWhRv");let v=a.styled(f&&f.__esModule?f.default:f);function w({columnID:e,color:t="magenta"}){let r=(0,p.useDetritalMeasurements)({col_id:e}),a=o(()=>e=>v(b,{width:360,height:40,color:t,...e}),[400,t]),{axisType:i,units:l}=(0,g.useMacrostratColumnData)(),s=o(()=>null==r||null==l?null:function(e,t,r){let a=n(e,e=>e.measuremeta_id),o=new Map;for(let e of a.values()){let a=Array.from(new Set(e.map(e=>e.unit_id)));a.sort();let i=a.join("-");if(!o.has(i)){let e=a.map(e=>t.find(t=>t.unit_id===e)).filter(Boolean),n=e.map(e=>{let[t,a]=(0,_.getUnitHeightRange)(e,r);return{height:t,top_height:a}}),l=(0,h.mergeHeightRanges)(n,r);o.set(i,{id:i,data:[],units:e,...l})}o.get(i).data.push(e[0])}return Array.from(o.values())}(r,l,i),[r,l,i]);return v(h.BaseMeasurementsColumn,{data:s,noteComponent:a,deltaConnectorAttachment:20})}function H({unit:t}){let{xScale:r,height:a}=e(),{t_age:o,b_age:i}=t,n=r(o);return v("rect.depositional-age",{x:n,width:r(i)-n,y:0,height:a})}function b(e){let{note:a,width:o,height:n,color:l,spacing:s}=e,{data:u,units:m}=a;return v("div.detrital-group",{className:i({"hide-axis":(s?.below??100)<60})},[v(t,{width:o,innerHeight:n,showAxisLabels:!0,paddingBottom:40},[m.map(e=>v(H,{unit:e})),u.map(e=>v(r,{bandwidth:20,data:e.measure_value,color:l}))])])}export{w as DetritalColumn,b as DetritalGroup};
2
+ //# sourceMappingURL=column-views.5361f0e2.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,e,C,C,wB,C,C,kB,C,K,6B,A,Q,M,mB,A,Q,W,C,K,O,A,Q,M,Y,A,Q,S,C,K,U,C,S,E,C,C,C,C,C,C,C,E,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AAE,CAAI,CAAA,MAAE,CAAK,CAAE,CAAG,EAOxB,OAAO,EACL,qBACA,CAAE,UAAW,AAAA,EAAW,CAAE,YAJL,AADJ,CAAA,GAAS,OAAS,GAArC,EACoC,EAIoB,EAAG,EACzD,CACE,EACE,EACA,CAAE,MAAA,EAAO,YAAa,EAAQ,eAAgB,CAAA,EAAM,cAAe,EAAG,EACtE,CACE,EAAM,GAAG,CAAC,AAAC,GACF,EAAE,EAAiB,CAAE,KAAA,CAAK,IAEnC,EAAK,GAAG,CAAC,AAAC,GACD,EAAE,EAAgB,CACvB,UAAW,GACX,KAAM,EAAE,aAAa,CACrB,MApBG,CAqBL,IAEH,EAEJ,CAEL,Q,K,c,C,K,a","sources":["<anon>","packages/column-views/src/facets/detrital-zircon/index.ts"],"sourcesContent":["import \"./column-views.e93b3bdb.js\";\nimport \"./column-views.869c7199.js\";\nimport \"./column-views.1d064426.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport {usePlotArea as $9VOFI$usePlotArea, DetritalSpectrumPlot as $9VOFI$DetritalSpectrumPlot, DetritalSeries as $9VOFI$DetritalSeries} from \"@macrostrat/data-components\";\nimport $9VOFI$macrostrathyper from \"@macrostrat/hyper\";\nimport {useMemo as $9VOFI$useMemo} from \"react\";\nimport $9VOFI$classnames from \"classnames\";\nimport {group as $9VOFI$group} from \"d3-array\";\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 $68f55e74a5c97233$exports = {};\n\n$parcel$export($68f55e74a5c97233$exports, \"DetritalColumn\", () => $68f55e74a5c97233$export$f176396e104db8d5);\n$parcel$export($68f55e74a5c97233$exports, \"DetritalGroup\", () => $68f55e74a5c97233$export$1b3047373cd1c8c7);\n\n\n\nvar $ehHhC = parcelRequire(\"ehHhC\");\n\n\nvar $jtfAP = parcelRequire(\"jtfAP\");\n\n\nvar $kIQUG = parcelRequire(\"kIQUG\");\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\nconst $68f55e74a5c97233$var$h = (0, $9VOFI$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($jtfAP))));\nfunction $68f55e74a5c97233$var$prepareDetritalData(data, units, axisType) {\n /** Right now measurement data could be duplicated if there are multiple units linked to the same\n * measuremeta_id. THis happens because matches to units might be at a lower rank (e.g, if the column\n * contains Formations but the measurements are linked to a Group). To handle this, we group by measuremeta_id\n * and then create unique keys based on the set of units linked to each measurement.\n */ // Group data by measuremeta_id\n const measurementsGrouped = (0, $9VOFI$group)(data, (d)=>d.measuremeta_id);\n const resMap = new Map();\n for (const measurements of measurementsGrouped.values()){\n // Get a list of unique unit_ids for this measurement\n const unitIDs = new Set(measurements.map((m)=>m.unit_id));\n const ids = Array.from(unitIDs);\n ids.sort();\n // Key is unique to the set of units\n const key = ids.join(\"-\");\n if (!resMap.has(key)) {\n const unitData = ids.map((id)=>{\n return units.find((u)=>u.unit_id === id);\n }).filter(Boolean);\n const positions = unitData.map((unit)=>{\n const [height, top_height] = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n return {\n height: height,\n top_height: top_height\n };\n });\n // merge positions (note: we could also have multiple separate notes per measurement)\n const pos = (0, $kIQUG.mergeHeightRanges)(positions, axisType);\n resMap.set(key, {\n id: key,\n data: [],\n units: unitData,\n ...pos\n });\n }\n resMap.get(key).data.push(measurements[0]);\n }\n return Array.from(resMap.values());\n}\nfunction $68f55e74a5c97233$export$f176396e104db8d5({ columnID: columnID, color: color = \"magenta\" }) {\n const data = (0, $ehHhC.useDetritalMeasurements)({\n col_id: columnID\n });\n const width = 400;\n const paddingLeft = 40;\n const spectrumWidth = width - paddingLeft;\n const noteComponent = (0, $9VOFI$useMemo)(()=>{\n return (props)=>{\n return $68f55e74a5c97233$var$h($68f55e74a5c97233$export$1b3047373cd1c8c7, {\n width: spectrumWidth,\n height: 40,\n color: color,\n ...props\n });\n };\n }, [\n width,\n color\n ]);\n const { axisType: axisType, units: units } = (0, $wtIgl.useMacrostratColumnData)();\n const data1 = (0, $9VOFI$useMemo)(()=>{\n if (data == null || units == null) return null;\n return $68f55e74a5c97233$var$prepareDetritalData(data, units, axisType);\n }, [\n data,\n units,\n axisType\n ]);\n return $68f55e74a5c97233$var$h((0, $kIQUG.BaseMeasurementsColumn), {\n data: data1,\n noteComponent: noteComponent,\n deltaConnectorAttachment: 20\n });\n}\nfunction $68f55e74a5c97233$var$DepositionalAge({ unit: unit }) {\n const { xScale: xScale, height: height } = (0, $9VOFI$usePlotArea)();\n const { t_age: t_age, b_age: b_age } = unit;\n const x = xScale(t_age);\n const x1 = xScale(b_age);\n return $68f55e74a5c97233$var$h(\"rect.depositional-age\", {\n x: x,\n width: x1 - x,\n y: 0,\n height: height\n });\n}\nfunction $68f55e74a5c97233$export$1b3047373cd1c8c7(props) {\n const { note: note, width: width, height: height, color: color, spacing: spacing } = props;\n const { data: data, units: units } = note;\n const _color = color;\n const spaceBelow = spacing?.below ?? 100;\n const hideAxisLabels = spaceBelow < 60;\n return $68f55e74a5c97233$var$h(\"div.detrital-group\", {\n className: (0, $9VOFI$classnames)({\n \"hide-axis\": hideAxisLabels\n })\n }, [\n $68f55e74a5c97233$var$h((0, $9VOFI$DetritalSpectrumPlot), {\n width: width,\n innerHeight: height,\n showAxisLabels: true,\n paddingBottom: 40\n }, [\n units.map((unit)=>{\n return $68f55e74a5c97233$var$h($68f55e74a5c97233$var$DepositionalAge, {\n unit: unit\n });\n }),\n data.map((d)=>{\n return $68f55e74a5c97233$var$h((0, $9VOFI$DetritalSeries), {\n bandwidth: 20,\n data: d.measure_value,\n color: _color\n });\n })\n ])\n ]);\n}\n\n\nexport {$68f55e74a5c97233$export$f176396e104db8d5 as DetritalColumn, $68f55e74a5c97233$export$1b3047373cd1c8c7 as DetritalGroup};\n//# sourceMappingURL=column-views.5361f0e2.js.map\n","import {\n DetritalSpectrumPlot,\n DetritalSeries,\n usePlotArea,\n} from \"@macrostrat/data-components\";\nimport type { IUnit } from \"../../units/types\";\nimport hyper from \"@macrostrat/hyper\";\nimport { useDetritalMeasurements, MeasurementInfo } from \"./provider\";\nimport { useMemo } from \"react\";\nimport styles from \"./index.module.sass\";\nimport classNames from \"classnames\";\nimport {\n BaseMeasurementsColumn,\n mergeHeightRanges,\n ColumnMeasurementData,\n} from \"../measurements\";\nimport { group } from \"d3-array\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { useMacrostratColumnData } from \"../../data-provider\";\nimport { getUnitHeightRange } from \"../../prepare-units\";\n\nconst h = hyper.styled(styles);\n\ninterface DetritalItemProps {\n note: DZMeasurementInfo;\n spacing?: {\n below?: number;\n above?: number;\n };\n width?: number;\n height?: number;\n color?: string;\n}\n\ninterface DZMeasurementInfo extends ColumnMeasurementData<MeasurementInfo[]> {\n units: IUnit[];\n}\n\nfunction prepareDetritalData(\n data: MeasurementInfo[],\n units: IUnit[],\n axisType: ColumnAxisType,\n) {\n /** Right now measurement data could be duplicated if there are multiple units linked to the same\n * measuremeta_id. THis happens because matches to units might be at a lower rank (e.g, if the column\n * contains Formations but the measurements are linked to a Group). To handle this, we group by measuremeta_id\n * and then create unique keys based on the set of units linked to each measurement.\n */\n\n // Group data by measuremeta_id\n const measurementsGrouped = group(data, (d) => d.measuremeta_id);\n\n const resMap = new Map<string, DZMeasurementInfo>();\n\n for (const measurements of measurementsGrouped.values()) {\n // Get a list of unique unit_ids for this measurement\n const unitIDs = new Set(measurements.map((m) => m.unit_id));\n const ids = Array.from(unitIDs);\n ids.sort();\n // Key is unique to the set of units\n const key = ids.join(\"-\");\n\n if (!resMap.has(key)) {\n const unitData = ids\n .map((id) => {\n return units.find((u) => u.unit_id === id);\n })\n .filter(Boolean);\n\n const positions = unitData.map((unit) => {\n const [height, top_height] = getUnitHeightRange(unit, axisType);\n return { height, top_height };\n });\n\n // merge positions (note: we could also have multiple separate notes per measurement)\n const pos = mergeHeightRanges(positions, axisType);\n\n resMap.set(key, {\n id: key,\n data: [],\n units: unitData as IUnit[],\n ...pos,\n });\n }\n resMap.get(key)!.data.push(measurements[0]);\n }\n\n return Array.from(resMap.values());\n}\n\nfunction DetritalColumn({ columnID, color = \"magenta\" }) {\n const data = useDetritalMeasurements({ col_id: columnID });\n\n const width = 400;\n const paddingLeft = 40;\n\n const spectrumWidth = width - paddingLeft;\n\n const noteComponent = useMemo(() => {\n return (props) => {\n return h(DetritalGroup, {\n width: spectrumWidth,\n height: 40,\n color,\n ...props,\n });\n };\n }, [width, color]);\n\n const { axisType, units } = useMacrostratColumnData();\n\n const data1 = useMemo(() => {\n if (data == null || units == null) return null;\n return prepareDetritalData(data, units, axisType);\n }, [data, units, axisType]);\n\n return h(BaseMeasurementsColumn, {\n data: data1,\n noteComponent,\n deltaConnectorAttachment: 20,\n });\n}\n\nfunction DepositionalAge({ unit }) {\n const { xScale, height } = usePlotArea();\n\n const { t_age, b_age } = unit;\n const x = xScale(t_age);\n const x1 = xScale(b_age);\n\n return h(\"rect.depositional-age\", { x, width: x1 - x, y: 0, height });\n}\n\nfunction DetritalGroup(props: DetritalItemProps) {\n const { note, width, height, color, spacing } = props;\n const { data, units } = note;\n\n const _color = color;\n\n const spaceBelow = spacing?.below ?? 100;\n const hideAxisLabels = spaceBelow < 60;\n\n return h(\n \"div.detrital-group\",\n { className: classNames({ \"hide-axis\": hideAxisLabels }) },\n [\n h(\n DetritalSpectrumPlot,\n { width, innerHeight: height, showAxisLabels: true, paddingBottom: 40 },\n [\n units.map((unit) => {\n return h(DepositionalAge, { unit });\n }),\n data.map((d) => {\n return h(DetritalSeries, {\n bandwidth: 20,\n data: d.measure_value,\n color: _color,\n });\n }),\n ],\n ),\n ],\n );\n}\n\nexport { DetritalColumn, DetritalGroup };\n"],"names":["usePlotArea","$9VOFI$usePlotArea","DetritalSpectrumPlot","$9VOFI$DetritalSpectrumPlot","DetritalSeries","$9VOFI$DetritalSeries","$9VOFI$macrostrathyper","useMemo","$9VOFI$useMemo","$9VOFI$classnames","group","$9VOFI$group","$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","$68f55e74a5c97233$exports","$68f55e74a5c97233$export$f176396e104db8d5","$68f55e74a5c97233$export$1b3047373cd1c8c7","$ehHhC","$jtfAP","$kIQUG","$wtIgl","$iWhRv","$68f55e74a5c97233$var$h","styled","a","__esModule","default","columnID","color","data","useDetritalMeasurements","col_id","noteComponent","props","width","height","axisType","units","useMacrostratColumnData","data1","$68f55e74a5c97233$var$prepareDetritalData","measurementsGrouped","d","measuremeta_id","resMap","Map","measurements","values","ids","Array","from","Set","map","m","unit_id","sort","key","join","has","unitData","find","u","filter","Boolean","positions","unit","top_height","getUnitHeightRange","pos","mergeHeightRanges","push","BaseMeasurementsColumn","deltaConnectorAttachment","$68f55e74a5c97233$var$DepositionalAge","xScale","t_age","b_age","x","x1","y","note","spacing","className","spaceBelow","below","innerHeight","showAxisLabels","paddingBottom","bandwidth","measure_value","DetritalColumn","DetritalGroup"],"version":3,"file":"column-views.5361f0e2.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.420b60d2.js";import"./column-views.b6943236.js";import"./column-views.6a0a35e7.js";import"./column-views.e1813308.js";import"./column-views.0beae29d.js";import{hyperStyled as e}from"@macrostrat/hyper";import{LithologyColumn as t,SVG as n,ColumnContext as o}from"@macrostrat/column-components";import{createContext as a,useState as i,useRef as r,useCallback as l,useContext as s,useEffect as u}from"react";function d(e,t,n,o){Object.defineProperty(e,t,{get:n,set:o,enumerable:!0,configurable:!0})}var c=globalThis,p={},m={},f=c.parcelRequirea149;null==f&&((f=function(e){if(e in p)return p[e].exports;if(e in m){var t=m[e];delete m[e];var n={id:e,exports:{}};return p[e]=n,t.call(n.exports,n,n.exports),n.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){m[e]=t},c.parcelRequirea149=f),f.register;var b={};d(b,"LabelTrackerProvider",()=>S),d(b,"TrackedLabeledUnit",()=>w),d(b,"CompositeUnitComponent",()=>L),d(b,"CompositeUnitsColumn",()=>P),d(b,"AnnotatedUnitsColumn",()=>T),d(b,"SectionLabelsColumn",()=>y),d(b,"ColumnNotesProvider",()=>F);var C=f("jiUaC"),v=f("1n4Pb"),x=f("45u6B"),h=f("wtIgl"),$=f("5SO8b");let U=e(x&&x.__esModule?x.default:x),g=a(null),H=a(null),_=e=>e.unit_id;function S(e){let{children:t,units:n,findUnitID:o=_}=e,[a,s]=i(null),u=r({}),d=l((e,t)=>{let a=o(e);u.current[a]=t,Object.keys(u.current).length==n.length&&s(n.filter(e=>{let t=o(e);return!1==u.current[t]}))},[u,n,o]);return U(g.Provider,{value:d},U(H.Provider,{value:a},t))}function w({division:e,nameForDivision:t=C.defaultNameFunction,...n}){let o=s(g);return U(v.LabeledUnit,{division:e,label:t(e),onLabelUpdated(t,n){o?.(e,n)},...n})}let L=w;function P(e){let{width:n,unitComponent:o=w,unitComponentProps:a,clipToFrame:i,...r}=e;return U(t,{width:n,clipToFrame:i},[U(v.UnitBoxes,{unitComponent:o,unitComponentProps:a,...r})])}function T(e){return u(()=>{console.warn("AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes")},[]),null}function y(e){let{width:t=300,noteMode:o="unlabeled",labelOffset:a=30,noteComponent:i,shouldRenderNote:r}=e,{totalHeight:l,axisType:u}=(0,h.useMacrostratColumnData)(),d=(0,h.useCompositeScale)(),c=s(H),p=(0,$.useUnitSelectionDispatch)();return U("div.section-labels-column",[U(F,{units:[],scale:d,totalHeight:l,axisType:u},U(n,{height:l,innerWidth:t-4,paddingH:1,paddingLeft:3},U(C.UnitNamesColumn,{divisions:"unlabeled"==o?c:void 0,paddingLeft:a,width:t,noteComponent:i,shouldRenderNote:r,scale:d,onClickNote(e){p(e.data,null,null)}})))])}function F(e){let{children:t,scale:n,totalHeight:a,pixelScale:i}=e,{axisType:r}=(0,h.useMacrostratColumnData)();return U(o.Provider,{value:{divisions:[],scale:n,scaleClamped:n,pixelHeight:a,pixelsPerMeter:i,axisType:r,zoom:1}},t)}export{S as LabelTrackerProvider,w as TrackedLabeledUnit,L as CompositeUnitComponent,P as CompositeUnitsColumn,T as AnnotatedUnitsColumn,y as SectionLabelsColumn,F as ColumnNotesProvider};
2
- //# sourceMappingURL=column-views.38835c99.js.map
1
+ import"./column-views.93bde6c1.js";import"./column-views.c921fa1a.js";import"./column-views.6a0a35e7.js";import"./column-views.46efb749.js";import"./column-views.0beae29d.js";import{hyperStyled as e}from"@macrostrat/hyper";import{LithologyColumn as t,SVG as n,ColumnContext as o}from"@macrostrat/column-components";import{createContext as a,useState as i,useRef as r,useCallback as l,useContext as s,useEffect as u}from"react";function d(e,t,n,o){Object.defineProperty(e,t,{get:n,set:o,enumerable:!0,configurable:!0})}var c=globalThis,p={},m={},f=c.parcelRequirea149;null==f&&((f=function(e){if(e in p)return p[e].exports;if(e in m){var t=m[e];delete m[e];var n={id:e,exports:{}};return p[e]=n,t.call(n.exports,n,n.exports),n.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){m[e]=t},c.parcelRequirea149=f),f.register;var b={};d(b,"LabelTrackerProvider",()=>S),d(b,"TrackedLabeledUnit",()=>w),d(b,"CompositeUnitComponent",()=>L),d(b,"CompositeUnitsColumn",()=>P),d(b,"AnnotatedUnitsColumn",()=>T),d(b,"SectionLabelsColumn",()=>y),d(b,"ColumnNotesProvider",()=>F);var C=f("jiUaC"),v=f("1n4Pb"),x=f("45u6B"),h=f("wtIgl"),$=f("5SO8b");let U=e(x&&x.__esModule?x.default:x),g=a(null),H=a(null),_=e=>e.unit_id;function S(e){let{children:t,units:n,findUnitID:o=_}=e,[a,s]=i(null),u=r({}),d=l((e,t)=>{let a=o(e);u.current[a]=t,Object.keys(u.current).length==n.length&&s(n.filter(e=>{let t=o(e);return!1==u.current[t]}))},[u,n,o]);return U(g.Provider,{value:d},U(H.Provider,{value:a},t))}function w({division:e,nameForDivision:t=C.defaultNameFunction,...n}){let o=s(g);return U(v.LabeledUnit,{division:e,label:t(e),onLabelUpdated(t,n){o?.(e,n)},...n})}let L=w;function P(e){let{width:n,unitComponent:o=w,unitComponentProps:a,clipToFrame:i,...r}=e;return U(t,{width:n,clipToFrame:i},[U(v.UnitBoxes,{unitComponent:o,unitComponentProps:a,...r})])}function T(e){return u(()=>{console.warn("AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes")},[]),null}function y(e){let{width:t=300,noteMode:o="unlabeled",labelOffset:a=30,noteComponent:i,shouldRenderNote:r}=e,{totalHeight:l,axisType:u}=(0,h.useMacrostratColumnData)(),d=(0,h.useCompositeScale)(),c=s(H),p=(0,$.useUnitSelectionDispatch)();return U("div.section-labels-column",[U(F,{units:[],scale:d,totalHeight:l,axisType:u},U(n,{height:l,innerWidth:t-4,paddingH:1,paddingLeft:3},U(C.UnitNamesColumn,{divisions:"unlabeled"==o?c:void 0,paddingLeft:a,width:t,noteComponent:i,shouldRenderNote:r,scale:d,onClickNote(e){p(e.data,null,null)}})))])}function F(e){let{children:t,scale:n,totalHeight:a,pixelScale:i}=e,{axisType:r}=(0,h.useMacrostratColumnData)();return U(o.Provider,{value:{divisions:[],scale:n,scaleClamped:n,pixelHeight:a,pixelsPerMeter:i,axisType:r,zoom:1}},t)}export{S as LabelTrackerProvider,w as TrackedLabeledUnit,L as CompositeUnitComponent,P as CompositeUnitsColumn,T as AnnotatedUnitsColumn,y as SectionLabelsColumn,F as ColumnNotesProvider};
2
+ //# sourceMappingURL=column-views.5559de6a.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,e,C,K,mB,A,Q,mB,C,C,O,C,C,iB,C,K,+B,A,Q,iB,C,C,Y,C,C,U,C,C,e,C,C,c,C,C,a,C,K,O,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,uB,I,G,E,E,qB,I,G,E,E,yB,I,G,E,E,uB,I,G,E,E,uB,I,G,E,E,sB,I,G,E,E,sB,I,G,I,E,E,S,E,E,S,E,E,S,E,E,S,E,E,SCwBA,IAAM,EAAI,AAAA,E,AAAY,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAMhB,EAAsB,AAAA,EAAc,MACpC,EAA4B,AAAA,EAAc,MAE1C,EAAuB,AAAC,GAAM,EAAE,OAAO,CAEtC,SAAS,EAAqB,CAAK,EAIxC,GAAM,CAAA,SAAE,CAAQ,CAAA,MAAE,CAAK,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-views/src/units/composite.ts"],"sourcesContent":["import \"./column-views.420b60d2.js\";\nimport \"./column-views.b6943236.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.e1813308.js\";\nimport \"./column-views.0beae29d.js\";\nimport {hyperStyled as $hj0lx$hyperStyled} from \"@macrostrat/hyper\";\nimport {LithologyColumn as $hj0lx$LithologyColumn, SVG as $hj0lx$SVG, ColumnContext as $hj0lx$ColumnContext} from \"@macrostrat/column-components\";\nimport {createContext as $hj0lx$createContext, useState as $hj0lx$useState, useRef as $hj0lx$useRef, useCallback as $hj0lx$useCallback, useContext as $hj0lx$useContext, useEffect as $hj0lx$useEffect} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $6b7af672ec278734$exports = {};\n\n$parcel$export($6b7af672ec278734$exports, \"LabelTrackerProvider\", () => $6b7af672ec278734$export$e4e89ab6c86ac513);\n$parcel$export($6b7af672ec278734$exports, \"TrackedLabeledUnit\", () => $6b7af672ec278734$export$f613830566442374);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitComponent\", () => $6b7af672ec278734$export$1dfa200d57964eee);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitsColumn\", () => $6b7af672ec278734$export$a6684360fef0406e);\n$parcel$export($6b7af672ec278734$exports, \"AnnotatedUnitsColumn\", () => $6b7af672ec278734$export$d8c3f2fdd653a082);\n$parcel$export($6b7af672ec278734$exports, \"SectionLabelsColumn\", () => $6b7af672ec278734$export$13984e34afdbb040);\n$parcel$export($6b7af672ec278734$exports, \"ColumnNotesProvider\", () => $6b7af672ec278734$export$6cc7a9df4edde18);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\nvar $45u6B = parcelRequire(\"45u6B\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\nconst $6b7af672ec278734$var$h = (0, $hj0lx$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($45u6B))));\nconst $6b7af672ec278734$var$LabelTrackerContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$UnlabeledDivisionsContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$findMacrostratUnitID = (u)=>u.unit_id;\nfunction $6b7af672ec278734$export$e4e89ab6c86ac513(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */ const { children: children, units: units, findUnitID: findUnitID = $6b7af672ec278734$var$findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = (0, $hj0lx$useState)(null);\n const labelTrackerRef = (0, $hj0lx$useRef)({});\n const trackLabelVisibility = (0, $hj0lx$useCallback)((div, visible)=>{\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) setUnlabeledDivisions(// @ts-ignore\n units.filter((d)=>{\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }));\n }, [\n labelTrackerRef,\n units,\n findUnitID\n ]);\n const value = trackLabelVisibility;\n return $6b7af672ec278734$var$h($6b7af672ec278734$var$LabelTrackerContext.Provider, {\n value: value\n }, $6b7af672ec278734$var$h($6b7af672ec278734$var$UnlabeledDivisionsContext.Provider, {\n value: unlabeledDivisions\n }, children));\n}\nfunction $6b7af672ec278734$export$f613830566442374({ division: division, nameForDivision: nameForDivision = (0, $jiUaC.defaultNameFunction), ...rest }) {\n const trackLabelVisibility = (0, $hj0lx$useContext)($6b7af672ec278734$var$LabelTrackerContext);\n return $6b7af672ec278734$var$h((0, $1n4Pb.LabeledUnit), {\n division: division,\n label: nameForDivision(division),\n onLabelUpdated (label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest\n });\n}\nconst $6b7af672ec278734$export$1dfa200d57964eee = $6b7af672ec278734$export$f613830566442374;\nfunction $6b7af672ec278734$export$a6684360fef0406e(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { width: width, unitComponent: unitComponent = $6b7af672ec278734$export$f613830566442374, unitComponentProps: unitComponentProps, clipToFrame: clipToFrame, ...rest } = props;\n return $6b7af672ec278734$var$h((0, $hj0lx$LithologyColumn), {\n width: width,\n clipToFrame: clipToFrame\n }, [\n $6b7af672ec278734$var$h((0, $1n4Pb.UnitBoxes), {\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n ...rest\n })\n ]);\n}\nfunction $6b7af672ec278734$export$d8c3f2fdd653a082(props) {\n (0, $hj0lx$useEffect)(()=>{\n console.warn(\"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\");\n }, []);\n return null;\n}\nfunction $6b7af672ec278734$export$13984e34afdbb040(props) {\n // Section with \"squishy\" time scale\n const { width: width = 300, noteMode: noteMode = \"unlabeled\", labelOffset: labelOffset = 30, noteComponent: noteComponent, shouldRenderNote: shouldRenderNote } = props;\n const { totalHeight: totalHeight, axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n const _compositeScale = (0, $wtIgl.useCompositeScale)();\n const unlabeledUnits = (0, $hj0lx$useContext)($6b7af672ec278734$var$UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n const selectUnit = (0, $5SO8b.useUnitSelectionDispatch)();\n return $6b7af672ec278734$var$h(\"div.section-labels-column\", [\n $6b7af672ec278734$var$h($6b7af672ec278734$export$6cc7a9df4edde18, {\n units: [],\n scale: _compositeScale,\n totalHeight: totalHeight,\n axisType: axisType\n }, $6b7af672ec278734$var$h((0, $hj0lx$SVG), {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3\n }, $6b7af672ec278734$var$h((0, $jiUaC.UnitNamesColumn), {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width: width,\n noteComponent: noteComponent,\n shouldRenderNote: shouldRenderNote,\n scale: _compositeScale,\n onClickNote (note) {\n selectUnit(note.data, null, null);\n }\n })))\n ]);\n}\nfunction $6b7af672ec278734$export$6cc7a9df4edde18(props) {\n // A fake column axis provider that allows scales to cross\n const { children: children, scale: scale, totalHeight: totalHeight, pixelScale: pixelScale } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n return $6b7af672ec278734$var$h((0, $hj0lx$ColumnContext).Provider, {\n value: {\n divisions: [],\n scale: scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType: axisType,\n zoom: 1\n }\n }, children);\n}\n\n\nexport {$6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider};\n//# sourceMappingURL=column-views.38835c99.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n SVG,\n ColumnContext,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\n} from \"react\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport { LabeledUnit, UnitBoxes } from \"./boxes\";\nimport styles from \"./composite.module.sass\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n useUnitSelectionDispatch,\n} from \"../data-provider\";\n\nconst h = hyperStyled(styles);\n\ninterface LabelTracker {\n [key: number]: boolean;\n}\n\nconst LabelTrackerContext = createContext(null);\nconst UnlabeledDivisionsContext = createContext(null);\n\nconst findMacrostratUnitID = (u) => u.unit_id;\n\nexport function LabelTrackerProvider(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */\n const { children, units, findUnitID = findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = useState<\n BaseUnit[] | null\n >(null);\n const labelTrackerRef = useRef<LabelTracker>({});\n const trackLabelVisibility = useCallback(\n (div, visible) => {\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) {\n setUnlabeledDivisions(\n // @ts-ignore\n units.filter((d) => {\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }),\n );\n }\n },\n [labelTrackerRef, units, findUnitID],\n );\n\n const value = trackLabelVisibility;\n return h(\n LabelTrackerContext.Provider,\n { value },\n h(\n UnlabeledDivisionsContext.Provider,\n { value: unlabeledDivisions },\n children,\n ),\n );\n}\n\nfunction TrackedLabeledUnit({\n division,\n nameForDivision = defaultNameFunction,\n ...rest\n}) {\n const trackLabelVisibility = useContext(LabelTrackerContext);\n return h(LabeledUnit, {\n division,\n label: nameForDivision(division),\n onLabelUpdated(label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest,\n });\n}\n\nexport const CompositeUnitComponent = TrackedLabeledUnit;\n\ntype BaseUnitProps = {\n width: number;\n showLabels?: boolean;\n columnWidth?: number;\n clipToFrame?: boolean;\n};\n\ntype ICompositeUnitProps = BaseUnitProps & {\n gutterWidth?: number;\n labelOffset?: number;\n paddingLeft?: number;\n nameForDivision?: (division: BaseUnit) => string;\n children?: React.ReactNode;\n unitComponent?: React.FC<any>;\n unitComponentProps?: any;\n noteMode?: \"labeled\" | \"unlabeled\";\n showLabelColumn?: boolean;\n noteComponent?: React.FC<any>;\n shouldRenderNote?: (d: any) => boolean;\n};\n\ninterface CompositeUnitProps {\n unitComponent: React.FC<any>;\n unitComponentProps?: any;\n width: number;\n showLabels?: boolean;\n clipToFrame?: boolean;\n}\n\nexport function CompositeUnitsColumn(props: CompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const {\n width,\n unitComponent = TrackedLabeledUnit,\n unitComponentProps,\n clipToFrame,\n ...rest\n } = props;\n\n return h(LithologyColumn, { width, clipToFrame }, [\n h(UnitBoxes, {\n unitComponent,\n unitComponentProps,\n ...rest,\n }),\n ]);\n}\n\nexport function AnnotatedUnitsColumn(props: ICompositeUnitProps) {\n useEffect(() => {\n console.warn(\n \"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\",\n );\n }, []);\n return null;\n}\n\nexport function SectionLabelsColumn(props: ICompositeUnitProps) {\n // Section with \"squishy\" time scale\n const {\n width = 300,\n noteMode = \"unlabeled\",\n labelOffset = 30,\n noteComponent,\n shouldRenderNote,\n } = props;\n\n const { totalHeight, axisType } = useMacrostratColumnData();\n const _compositeScale = useCompositeScale();\n\n const unlabeledUnits = useContext(UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n\n const selectUnit = useUnitSelectionDispatch();\n\n return h(\"div.section-labels-column\", [\n h(\n ColumnNotesProvider,\n {\n units: [],\n scale: _compositeScale,\n totalHeight,\n axisType,\n },\n h(\n SVG,\n {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3,\n },\n h(UnitNamesColumn, {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width,\n noteComponent,\n shouldRenderNote,\n scale: _compositeScale,\n onClickNote(note) {\n selectUnit(note.data, null, null);\n },\n }),\n ),\n ),\n ]);\n}\n\nexport interface CompositeColumnScale {\n (val: number): number;\n copy(): CompositeColumnScale;\n domain(): number[];\n}\n\nexport function ColumnNotesProvider(props) {\n // A fake column axis provider that allows scales to cross\n const { children, scale, totalHeight, pixelScale } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n return h(\n ColumnContext.Provider,\n {\n value: {\n divisions: [],\n scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType,\n zoom: 1,\n },\n },\n children,\n );\n}\n\nexport { TrackedLabeledUnit, ICompositeUnitProps };\n"],"names":["hyperStyled","$hj0lx$hyperStyled","LithologyColumn","$hj0lx$LithologyColumn","SVG","$hj0lx$SVG","ColumnContext","$hj0lx$ColumnContext","createContext","$hj0lx$createContext","useState","$hj0lx$useState","useRef","$hj0lx$useRef","useCallback","$hj0lx$useCallback","useContext","$hj0lx$useContext","useEffect","$hj0lx$useEffect","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6b7af672ec278734$exports","$6b7af672ec278734$export$e4e89ab6c86ac513","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","$6b7af672ec278734$export$a6684360fef0406e","$6b7af672ec278734$export$d8c3f2fdd653a082","$6b7af672ec278734$export$13984e34afdbb040","$6b7af672ec278734$export$6cc7a9df4edde18","$jiUaC","$1n4Pb","$45u6B","$wtIgl","$5SO8b","$6b7af672ec278734$var$h","a","__esModule","default","$6b7af672ec278734$var$LabelTrackerContext","$6b7af672ec278734$var$UnlabeledDivisionsContext","$6b7af672ec278734$var$findMacrostratUnitID","u","unit_id","props","children","units","findUnitID","unlabeledDivisions","setUnlabeledDivisions","labelTrackerRef","trackLabelVisibility","div","visible","current","keys","length","filter","d","Provider","value","division","nameForDivision","defaultNameFunction","rest","LabeledUnit","label","onLabelUpdated","width","unitComponent","unitComponentProps","clipToFrame","UnitBoxes","console","warn","noteMode","labelOffset","noteComponent","shouldRenderNote","totalHeight","axisType","useMacrostratColumnData","_compositeScale","useCompositeScale","unlabeledUnits","selectUnit","useUnitSelectionDispatch","scale","height","innerWidth","paddingH","paddingLeft","UnitNamesColumn","divisions","undefined","onClickNote","note","data","pixelScale","scaleClamped","pixelHeight","pixelsPerMeter","zoom","LabelTrackerProvider","TrackedLabeledUnit","CompositeUnitComponent","CompositeUnitsColumn","AnnotatedUnitsColumn","SectionLabelsColumn","ColumnNotesProvider"],"version":3,"file":"column-views.38835c99.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,e,C,K,mB,A,Q,mB,C,C,O,C,C,iB,C,K,+B,A,Q,iB,C,C,Y,C,C,U,C,C,e,C,C,c,C,C,a,C,K,O,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,uB,I,G,E,E,qB,I,G,E,E,yB,I,G,E,E,uB,I,G,E,E,uB,I,G,E,E,s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Q,CAAE,CAAG,AAAA,CAAA,EAAA,EAAA,uBAAsB,AAAtB,IAErB,OAAO,EACL,AAAA,EAAc,QAAQ,CACtB,CACE,MAAO,CACL,UAAW,EAAE,CACb,MAAA,EACA,aAAc,EACd,YAAa,EACb,eAAgB,EAChB,SAAA,EACA,KAAM,CACR,CACF,EACA,EAEJ,Q,K,oB,C,K,kB,C,K,sB,C,K,oB,C,K,oB,C,K,mB,C,K,mB","sources":["<anon>","packages/column-views/src/units/composite.ts"],"sourcesContent":["import \"./column-views.93bde6c1.js\";\nimport \"./column-views.c921fa1a.js\";\nimport \"./column-views.6a0a35e7.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.0beae29d.js\";\nimport {hyperStyled as $hj0lx$hyperStyled} from \"@macrostrat/hyper\";\nimport {LithologyColumn as $hj0lx$LithologyColumn, SVG as $hj0lx$SVG, ColumnContext as $hj0lx$ColumnContext} from \"@macrostrat/column-components\";\nimport {createContext as $hj0lx$createContext, useState as $hj0lx$useState, useRef as $hj0lx$useRef, useCallback as $hj0lx$useCallback, useContext as $hj0lx$useContext, useEffect as $hj0lx$useEffect} from \"react\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $6b7af672ec278734$exports = {};\n\n$parcel$export($6b7af672ec278734$exports, \"LabelTrackerProvider\", () => $6b7af672ec278734$export$e4e89ab6c86ac513);\n$parcel$export($6b7af672ec278734$exports, \"TrackedLabeledUnit\", () => $6b7af672ec278734$export$f613830566442374);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitComponent\", () => $6b7af672ec278734$export$1dfa200d57964eee);\n$parcel$export($6b7af672ec278734$exports, \"CompositeUnitsColumn\", () => $6b7af672ec278734$export$a6684360fef0406e);\n$parcel$export($6b7af672ec278734$exports, \"AnnotatedUnitsColumn\", () => $6b7af672ec278734$export$d8c3f2fdd653a082);\n$parcel$export($6b7af672ec278734$exports, \"SectionLabelsColumn\", () => $6b7af672ec278734$export$13984e34afdbb040);\n$parcel$export($6b7af672ec278734$exports, \"ColumnNotesProvider\", () => $6b7af672ec278734$export$6cc7a9df4edde18);\n\n\n\nvar $jiUaC = parcelRequire(\"jiUaC\");\n\n\nvar $1n4Pb = parcelRequire(\"1n4Pb\");\n\nvar $45u6B = parcelRequire(\"45u6B\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\nconst $6b7af672ec278734$var$h = (0, $hj0lx$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($45u6B))));\nconst $6b7af672ec278734$var$LabelTrackerContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$UnlabeledDivisionsContext = (0, $hj0lx$createContext)(null);\nconst $6b7af672ec278734$var$findMacrostratUnitID = (u)=>u.unit_id;\nfunction $6b7af672ec278734$export$e4e89ab6c86ac513(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */ const { children: children, units: units, findUnitID: findUnitID = $6b7af672ec278734$var$findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = (0, $hj0lx$useState)(null);\n const labelTrackerRef = (0, $hj0lx$useRef)({});\n const trackLabelVisibility = (0, $hj0lx$useCallback)((div, visible)=>{\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) setUnlabeledDivisions(// @ts-ignore\n units.filter((d)=>{\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }));\n }, [\n labelTrackerRef,\n units,\n findUnitID\n ]);\n const value = trackLabelVisibility;\n return $6b7af672ec278734$var$h($6b7af672ec278734$var$LabelTrackerContext.Provider, {\n value: value\n }, $6b7af672ec278734$var$h($6b7af672ec278734$var$UnlabeledDivisionsContext.Provider, {\n value: unlabeledDivisions\n }, children));\n}\nfunction $6b7af672ec278734$export$f613830566442374({ division: division, nameForDivision: nameForDivision = (0, $jiUaC.defaultNameFunction), ...rest }) {\n const trackLabelVisibility = (0, $hj0lx$useContext)($6b7af672ec278734$var$LabelTrackerContext);\n return $6b7af672ec278734$var$h((0, $1n4Pb.LabeledUnit), {\n division: division,\n label: nameForDivision(division),\n onLabelUpdated (label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest\n });\n}\nconst $6b7af672ec278734$export$1dfa200d57964eee = $6b7af672ec278734$export$f613830566442374;\nfunction $6b7af672ec278734$export$a6684360fef0406e(props) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */ const { width: width, unitComponent: unitComponent = $6b7af672ec278734$export$f613830566442374, unitComponentProps: unitComponentProps, clipToFrame: clipToFrame, ...rest } = props;\n return $6b7af672ec278734$var$h((0, $hj0lx$LithologyColumn), {\n width: width,\n clipToFrame: clipToFrame\n }, [\n $6b7af672ec278734$var$h((0, $1n4Pb.UnitBoxes), {\n unitComponent: unitComponent,\n unitComponentProps: unitComponentProps,\n ...rest\n })\n ]);\n}\nfunction $6b7af672ec278734$export$d8c3f2fdd653a082(props) {\n (0, $hj0lx$useEffect)(()=>{\n console.warn(\"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\");\n }, []);\n return null;\n}\nfunction $6b7af672ec278734$export$13984e34afdbb040(props) {\n // Section with \"squishy\" time scale\n const { width: width = 300, noteMode: noteMode = \"unlabeled\", labelOffset: labelOffset = 30, noteComponent: noteComponent, shouldRenderNote: shouldRenderNote } = props;\n const { totalHeight: totalHeight, axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n const _compositeScale = (0, $wtIgl.useCompositeScale)();\n const unlabeledUnits = (0, $hj0lx$useContext)($6b7af672ec278734$var$UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n const selectUnit = (0, $5SO8b.useUnitSelectionDispatch)();\n return $6b7af672ec278734$var$h(\"div.section-labels-column\", [\n $6b7af672ec278734$var$h($6b7af672ec278734$export$6cc7a9df4edde18, {\n units: [],\n scale: _compositeScale,\n totalHeight: totalHeight,\n axisType: axisType\n }, $6b7af672ec278734$var$h((0, $hj0lx$SVG), {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3\n }, $6b7af672ec278734$var$h((0, $jiUaC.UnitNamesColumn), {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width: width,\n noteComponent: noteComponent,\n shouldRenderNote: shouldRenderNote,\n scale: _compositeScale,\n onClickNote (note) {\n selectUnit(note.data, null, null);\n }\n })))\n ]);\n}\nfunction $6b7af672ec278734$export$6cc7a9df4edde18(props) {\n // A fake column axis provider that allows scales to cross\n const { children: children, scale: scale, totalHeight: totalHeight, pixelScale: pixelScale } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n return $6b7af672ec278734$var$h((0, $hj0lx$ColumnContext).Provider, {\n value: {\n divisions: [],\n scale: scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType: axisType,\n zoom: 1\n }\n }, children);\n}\n\n\nexport {$6b7af672ec278734$export$e4e89ab6c86ac513 as LabelTrackerProvider, $6b7af672ec278734$export$f613830566442374 as TrackedLabeledUnit, $6b7af672ec278734$export$1dfa200d57964eee as CompositeUnitComponent, $6b7af672ec278734$export$a6684360fef0406e as CompositeUnitsColumn, $6b7af672ec278734$export$d8c3f2fdd653a082 as AnnotatedUnitsColumn, $6b7af672ec278734$export$13984e34afdbb040 as SectionLabelsColumn, $6b7af672ec278734$export$6cc7a9df4edde18 as ColumnNotesProvider};\n//# sourceMappingURL=column-views.5559de6a.js.map\n","import { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n LithologyColumn,\n SVG,\n ColumnContext,\n} from \"@macrostrat/column-components\";\nimport { defaultNameFunction, UnitNamesColumn } from \"./names\";\nimport {\n createContext,\n useContext,\n useState,\n useRef,\n useCallback,\n useEffect,\n} from \"react\";\nimport { BaseUnit } from \"@macrostrat/api-types\";\nimport { LabeledUnit, UnitBoxes } from \"./boxes\";\nimport styles from \"./composite.module.sass\";\nimport {\n useCompositeScale,\n useMacrostratColumnData,\n useUnitSelectionDispatch,\n} from \"../data-provider\";\n\nconst h = hyperStyled(styles);\n\ninterface LabelTracker {\n [key: number]: boolean;\n}\n\nconst LabelTrackerContext = createContext(null);\nconst UnlabeledDivisionsContext = createContext(null);\n\nconst findMacrostratUnitID = (u) => u.unit_id;\n\nexport function LabelTrackerProvider(props) {\n /** Tracker for units to handle state for whether their labels fit inline or not.\n * Designed to work for single or composite columns.\n */\n const { children, units, findUnitID = findMacrostratUnitID } = props;\n const [unlabeledDivisions, setUnlabeledDivisions] = useState<\n BaseUnit[] | null\n >(null);\n const labelTrackerRef = useRef<LabelTracker>({});\n const trackLabelVisibility = useCallback(\n (div, visible) => {\n const id = findUnitID(div);\n labelTrackerRef.current[id] = visible;\n if (Object.keys(labelTrackerRef.current).length == units.length) {\n setUnlabeledDivisions(\n // @ts-ignore\n units.filter((d) => {\n const id = findUnitID(d);\n return labelTrackerRef.current[id] == false;\n }),\n );\n }\n },\n [labelTrackerRef, units, findUnitID],\n );\n\n const value = trackLabelVisibility;\n return h(\n LabelTrackerContext.Provider,\n { value },\n h(\n UnlabeledDivisionsContext.Provider,\n { value: unlabeledDivisions },\n children,\n ),\n );\n}\n\nfunction TrackedLabeledUnit({\n division,\n nameForDivision = defaultNameFunction,\n ...rest\n}) {\n const trackLabelVisibility = useContext(LabelTrackerContext);\n return h(LabeledUnit, {\n division,\n label: nameForDivision(division),\n onLabelUpdated(label, visible) {\n // If there is al LabelTrackerContext, update the label visibility\n trackLabelVisibility?.(division, visible);\n },\n ...rest,\n });\n}\n\nexport const CompositeUnitComponent = TrackedLabeledUnit;\n\ntype BaseUnitProps = {\n width: number;\n showLabels?: boolean;\n columnWidth?: number;\n clipToFrame?: boolean;\n};\n\ntype ICompositeUnitProps = BaseUnitProps & {\n gutterWidth?: number;\n labelOffset?: number;\n paddingLeft?: number;\n nameForDivision?: (division: BaseUnit) => string;\n children?: React.ReactNode;\n unitComponent?: React.FC<any>;\n unitComponentProps?: any;\n noteMode?: \"labeled\" | \"unlabeled\";\n showLabelColumn?: boolean;\n noteComponent?: React.FC<any>;\n shouldRenderNote?: (d: any) => boolean;\n};\n\ninterface CompositeUnitProps {\n unitComponent: React.FC<any>;\n unitComponentProps?: any;\n width: number;\n showLabels?: boolean;\n clipToFrame?: boolean;\n}\n\nexport function CompositeUnitsColumn(props: CompositeUnitProps) {\n /*\n A column with units and names either\n overlapping or offset to the right\n */\n const {\n width,\n unitComponent = TrackedLabeledUnit,\n unitComponentProps,\n clipToFrame,\n ...rest\n } = props;\n\n return h(LithologyColumn, { width, clipToFrame }, [\n h(UnitBoxes, {\n unitComponent,\n unitComponentProps,\n ...rest,\n }),\n ]);\n}\n\nexport function AnnotatedUnitsColumn(props: ICompositeUnitProps) {\n useEffect(() => {\n console.warn(\n \"AnnotatedUnitsColumn is deprecated and currently renders a no-op for transition purposes\",\n );\n }, []);\n return null;\n}\n\nexport function SectionLabelsColumn(props: ICompositeUnitProps) {\n // Section with \"squishy\" time scale\n const {\n width = 300,\n noteMode = \"unlabeled\",\n labelOffset = 30,\n noteComponent,\n shouldRenderNote,\n } = props;\n\n const { totalHeight, axisType } = useMacrostratColumnData();\n const _compositeScale = useCompositeScale();\n\n const unlabeledUnits = useContext(UnlabeledDivisionsContext);\n const unitsToLabel = noteMode == \"unlabeled\" ? unlabeledUnits : undefined;\n\n const selectUnit = useUnitSelectionDispatch();\n\n return h(\"div.section-labels-column\", [\n h(\n ColumnNotesProvider,\n {\n units: [],\n scale: _compositeScale,\n totalHeight,\n axisType,\n },\n h(\n SVG,\n {\n height: totalHeight,\n innerWidth: width - 4,\n paddingH: 1,\n paddingLeft: 3,\n },\n h(UnitNamesColumn, {\n divisions: unitsToLabel,\n paddingLeft: labelOffset,\n width,\n noteComponent,\n shouldRenderNote,\n scale: _compositeScale,\n onClickNote(note) {\n selectUnit(note.data, null, null);\n },\n }),\n ),\n ),\n ]);\n}\n\nexport interface CompositeColumnScale {\n (val: number): number;\n copy(): CompositeColumnScale;\n domain(): number[];\n}\n\nexport function ColumnNotesProvider(props) {\n // A fake column axis provider that allows scales to cross\n const { children, scale, totalHeight, pixelScale } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n return h(\n ColumnContext.Provider,\n {\n value: {\n divisions: [],\n scale,\n scaleClamped: scale,\n pixelHeight: totalHeight,\n pixelsPerMeter: pixelScale,\n axisType,\n zoom: 1,\n },\n },\n children,\n );\n}\n\nexport { TrackedLabeledUnit, ICompositeUnitProps };\n"],"names":["hyperStyled","$hj0lx$hyperStyled","LithologyColumn","$hj0lx$LithologyColumn","SVG","$hj0lx$SVG","ColumnContext","$hj0lx$ColumnContext","createContext","$hj0lx$createContext","useState","$hj0lx$useState","useRef","$hj0lx$useRef","useCallback","$hj0lx$useCallback","useContext","$hj0lx$useContext","useEffect","$hj0lx$useEffect","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$6b7af672ec278734$exports","$6b7af672ec278734$export$e4e89ab6c86ac513","$6b7af672ec278734$export$f613830566442374","$6b7af672ec278734$export$1dfa200d57964eee","$6b7af672ec278734$export$a6684360fef0406e","$6b7af672ec278734$export$d8c3f2fdd653a082","$6b7af672ec278734$export$13984e34afdbb040","$6b7af672ec278734$export$6cc7a9df4edde18","$jiUaC","$1n4Pb","$45u6B","$wtIgl","$5SO8b","$6b7af672ec278734$var$h","a","__esModule","default","$6b7af672ec278734$var$LabelTrackerContext","$6b7af672ec278734$var$UnlabeledDivisionsContext","$6b7af672ec278734$var$findMacrostratUnitID","u","unit_id","props","children","units","findUnitID","unlabeledDivisions","setUnlabeledDivisions","labelTrackerRef","trackLabelVisibility","div","visible","current","keys","length","filter","d","Provider","value","division","nameForDivision","defaultNameFunction","rest","LabeledUnit","label","onLabelUpdated","width","unitComponent","unitComponentProps","clipToFrame","UnitBoxes","console","warn","noteMode","labelOffset","noteComponent","shouldRenderNote","totalHeight","axisType","useMacrostratColumnData","_compositeScale","useCompositeScale","unlabeledUnits","selectUnit","useUnitSelectionDispatch","scale","height","innerWidth","paddingH","paddingLeft","UnitNamesColumn","divisions","undefined","onClickNote","note","data","pixelScale","scaleClamped","pixelHeight","pixelsPerMeter","zoom","LabelTrackerProvider","TrackedLabeledUnit","CompositeUnitComponent","CompositeUnitsColumn","AnnotatedUnitsColumn","SectionLabelsColumn","ColumnNotesProvider"],"version":3,"file":"column-views.5559de6a.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.1261be59.js";import"./column-views.003348f6.js";import"./column-views.e1813308.js";import"./column-views.0beae29d.js";import"./column-views.a08b0c9f.js";import"./column-views.d08e4328.js";import"./column-views.60b5663d.js";import"./column-views.db47fe3c.js";import"./column-views.7f9c7448.js";import"./column-views.a16cd1f2.js";import{ColumnAxisType as e}from"@macrostrat/column-components";import{hyperStyled as o}from"@macrostrat/hyper";import{extractPadding as n,useDarkMode as t,Box as i}from"@macrostrat/ui-components";import l from"classnames";import{useRef as a,useCallback as s}from"react";import{NonIdealState as r}from"@blueprintjs/core";import{DataField as c}from"@macrostrat/data-components";function m(e,o,n,t){Object.defineProperty(e,o,{get:n,set:t,enumerable:!0,configurable:!0})}var u=globalThis,p={},d={},f=u.parcelRequirea149;null==f&&((f=function(e){if(e in p)return p[e].exports;if(e in d){var o=d[e];delete d[e];var n={id:e,exports:{}};return p[e]=n,o.call(n.exports,n,n.exports),n.exports}var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}).register=function(e,o){d[e]=o},u.parcelRequirea149=f),f.register;var b={};m(b,"Column",()=>R),m(b,"ColumnContainer",()=>E),m(b,"ColumnBasicInfo",()=>M);var g=f("7YHvf"),v=f("7tWYE"),h=f("wtIgl"),_=f("5SO8b"),x=f("iYfAq"),S=f("2KV3o"),H=f("7exMg"),C=f("4hG2H"),w=f("76iYI"),A=f("610tc");let y=o(g&&g.__esModule?g.default:g);function R(o){let{showUnitPopover:n=!1,keyboardNavigation:t=!1,mergeSections:i,onUnitSelected:l,selectedUnit:s,children:c,units:m,t_age:u,b_age:p,t_pos:d,b_pos:f,unconformityHeight:b=30,targetUnitHeight:g=20,pixelScale:v,minPixelScale:x=.2,minSectionHeight:H=50,collapseSmallUnconformities:R=!0,allowUnitSelection:E,hybridScale:M,scale:F,axisType:$,...j}=o,T=a(),N=g,L=H,O=x;null!=v&&(N=null,L=0,O=v);let I=$??e.AGE,P=C.CompositeAgeAxis;M?.type===w.HybridScaleType.ApproximateHeight&&I!=e.AGE&&(P=C.ApproximateHeightAxis,I=e.AGE);let{sections:D,units:k,totalHeight:G}=(0,A.usePreparedColumnUnits)(m,{axisType:I,t_age:u,b_age:p,t_pos:d,b_pos:f,mergeSections:i,targetUnitHeight:N,unconformityHeight:b,pixelScale:v,minPixelScale:O,minSectionHeight:L,collapseSmallUnconformities:R,scale:F,hybridScale:M});if(0===D.length)return y("div.column-container.empty",y(r,{title:"Empty column",description:"No sections found in this column.",icon:"warning-sign"}));let B=y(U,{columnRef:T,ageAxisComponent:P,...j},[c,y.if(n)(S.UnitSelectionPopover),y.if(t)(_.UnitKeyboardNavigation,{units:k})]),Y=E??!1;return(n||null!=s||null!=l)&&(Y=!0),Y&&(B=y(_.UnitSelectionProvider,{columnRef:T,onUnitSelected:l,selectedUnit:s,units:k},B)),y(h.MacrostratColumnDataProvider,{units:k,sections:D,totalHeight:G,axisType:I},B)}function U(o){let t=n(o),i={"--column-padding-top":`${t.paddingTop}px`,"--column-padding-bottom":`${t.paddingBottom}px`,"--column-padding-left":`${t.paddingLeft}px`,"--column-padding-right":`${t.paddingRight}px`},{unitComponent:l=v.UnitComponent,unconformityLabels:a="minimal",showLabels:r=!0,width:c=300,columnWidth:m=150,showLabelColumn:u=!0,className:p,columnRef:d,clipUnits:f=!1,children:b,showTimescale:g,timescaleLevels:x,maxInternalColumns:S,onMouseOver:w,ageAxisComponent:A=C.CompositeAgeAxis}=o,{axisType:R}=(0,h.useMacrostratColumnData)(),U=!1,M=!1;!0===a||"prominent"===a?M=!0:"minimal"===a&&(U=!0);let F=m;F>c&&(F=c);let $=u;F>c-10&&($=!1);let j=g??!0;return null!=x&&(j=!0),j=R==e.AGE&&j,y(E,{...function(e=null){let o=(0,_.useUnitSelectionDispatch)(),n=s(e=>{o?.(null,null,e)},[o]),t=(0,h.useCompositeScale)(),i=s(o=>{let n=t.invert(o.clientY-o.currentTarget.getBoundingClientRect().top);e?.(null,n,o)},[t,e]),l=s(()=>{e?.(null,null,null)},[e]);return null==e?{onClick:n,onMouseOver:void 0,onMouseMove:void 0,onMouseOut:void 0}:{onMouseOver:i,onMouseMove:i,onMouseOut:l,onClick:n}}(w),style:i,className:p},y("div.column",{ref:d},[y(A),y.if(j)(H.CompositeTimescale,{levels:x,unconformityLabels:U}),y(H.SectionsColumn,{unitComponent:l,showLabels:r,width:c,columnWidth:F,showLabelColumn:$,clipUnits:f,unconformityLabels:M,maxInternalColumns:S}),b]))}function E(e){let{className:o,...n}=e,a=t();return y(i,{className:l(o,{"dark-mode":a?.isEnabled??!1},"column-container"),...n})}function M({data:e,showColumnID:o=!0,showReferences:n=!0}){return null==e?null:y("div.column-info",[y("div.column-title-row",[y("h2",e.col_name),y.if(o)("h4",y(x.Identifier,{id:e.col_id}))]),y(c,{row:!0,label:"Group",value:e.col_group}),y.if(n)(x.ReferencesField,{refs:e.refs,inline:!1,row:!1,className:"column-refs"})])}export{R as Column,E as ColumnContainer,M as ColumnBasicInfo};
2
- //# sourceMappingURL=column-views.52cc4dd0.js.map
1
+ import"./column-views.1261be59.js";import"./column-views.8ee8469d.js";import"./column-views.46efb749.js";import"./column-views.0beae29d.js";import"./column-views.6c7f9245.js";import"./column-views.f577d065.js";import"./column-views.b40c1b9c.js";import"./column-views.d77d260b.js";import"./column-views.7f9c7448.js";import"./column-views.5fd6e11a.js";import{ColumnAxisType as e}from"@macrostrat/column-components";import{hyperStyled as o}from"@macrostrat/hyper";import{extractPadding as n,useDarkMode as t,Box as i}from"@macrostrat/ui-components";import l from"classnames";import{useRef as a,useCallback as s}from"react";import{NonIdealState as r}from"@blueprintjs/core";import{DataField as c}from"@macrostrat/data-components";function m(e,o,n,t){Object.defineProperty(e,o,{get:n,set:t,enumerable:!0,configurable:!0})}var u=globalThis,p={},d={},f=u.parcelRequirea149;null==f&&((f=function(e){if(e in p)return p[e].exports;if(e in d){var o=d[e];delete d[e];var n={id:e,exports:{}};return p[e]=n,o.call(n.exports,n,n.exports),n.exports}var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}).register=function(e,o){d[e]=o},u.parcelRequirea149=f),f.register;var b={};m(b,"Column",()=>R),m(b,"ColumnContainer",()=>E),m(b,"ColumnBasicInfo",()=>M);var g=f("7YHvf"),v=f("7tWYE"),h=f("wtIgl"),_=f("5SO8b"),x=f("iYfAq"),S=f("2KV3o"),H=f("7exMg"),C=f("4hG2H"),w=f("76iYI"),A=f("610tc");let y=o(g&&g.__esModule?g.default:g);function R(o){let{showUnitPopover:n=!1,keyboardNavigation:t=!1,mergeSections:i,onUnitSelected:l,selectedUnit:s,children:c,units:m,t_age:u,b_age:p,t_pos:d,b_pos:f,unconformityHeight:b=30,targetUnitHeight:g=20,pixelScale:v,minPixelScale:x=.2,minSectionHeight:H=50,collapseSmallUnconformities:R=!0,allowUnitSelection:E,hybridScale:M,scale:F,axisType:$,...j}=o,T=a(),N=g,L=H,O=x;null!=v&&(N=null,L=0,O=v);let I=$??e.AGE,P=C.CompositeAgeAxis;M?.type===w.HybridScaleType.ApproximateHeight&&I!=e.AGE&&(P=C.ApproximateHeightAxis,I=e.AGE);let{sections:D,units:k,totalHeight:G}=(0,A.usePreparedColumnUnits)(m,{axisType:I,t_age:u,b_age:p,t_pos:d,b_pos:f,mergeSections:i,targetUnitHeight:N,unconformityHeight:b,pixelScale:v,minPixelScale:O,minSectionHeight:L,collapseSmallUnconformities:R,scale:F,hybridScale:M});if(0===D.length)return y("div.column-container.empty",y(r,{title:"Empty column",description:"No sections found in this column.",icon:"warning-sign"}));let B=y(U,{columnRef:T,ageAxisComponent:P,...j},[c,y.if(n)(S.UnitSelectionPopover),y.if(t)(_.UnitKeyboardNavigation,{units:k})]),Y=E??!1;return(n||null!=s||null!=l)&&(Y=!0),Y&&(B=y(_.UnitSelectionProvider,{columnRef:T,onUnitSelected:l,selectedUnit:s,units:k},B)),y(h.MacrostratColumnDataProvider,{units:k,sections:D,totalHeight:G,axisType:I},B)}function U(o){let t=n(o),i={"--column-padding-top":`${t.paddingTop}px`,"--column-padding-bottom":`${t.paddingBottom}px`,"--column-padding-left":`${t.paddingLeft}px`,"--column-padding-right":`${t.paddingRight}px`},{unitComponent:l=v.UnitComponent,unconformityLabels:a="minimal",showLabels:r=!0,width:c=300,columnWidth:m=150,showLabelColumn:u=!0,className:p,columnRef:d,clipUnits:f=!1,children:b,showTimescale:g,timescaleLevels:x,maxInternalColumns:S,onMouseOver:w,ageAxisComponent:A=C.CompositeAgeAxis}=o,{axisType:R}=(0,h.useMacrostratColumnData)(),U=!1,M=!1;!0===a||"prominent"===a?M=!0:"minimal"===a&&(U=!0);let F=m;F>c&&(F=c);let $=u;F>c-10&&($=!1);let j=g??!0;return null!=x&&(j=!0),j=R==e.AGE&&j,y(E,{...function(e=null){let o=(0,_.useUnitSelectionDispatch)(),n=s(e=>{o?.(null,null,e)},[o]),t=(0,h.useCompositeScale)(),i=s(o=>{let n=t.invert(o.clientY-o.currentTarget.getBoundingClientRect().top);e?.(null,n,o)},[t,e]),l=s(()=>{e?.(null,null,null)},[e]);return null==e?{onClick:n,onMouseOver:void 0,onMouseMove:void 0,onMouseOut:void 0}:{onMouseOver:i,onMouseMove:i,onMouseOut:l,onClick:n}}(w),style:i,className:p},y("div.column",{ref:d},[y(A),y.if(j)(H.CompositeTimescale,{levels:x,unconformityLabels:U}),y(H.SectionsColumn,{unitComponent:l,showLabels:r,width:c,columnWidth:F,showLabelColumn:$,clipUnits:f,unconformityLabels:M,maxInternalColumns:S}),b]))}function E(e){let{className:o,...n}=e,a=t();return y(i,{className:l(o,{"dark-mode":a?.isEnabled??!1},"column-container"),...n})}function M({data:e,showColumnID:o=!0,showReferences:n=!0}){return null==e?null:y("div.column-info",[y("div.column-title-row",[y("h2",e.col_name),y.if(o)("h4",y(x.Identifier,{id:e.col_id}))]),y(c,{row:!0,label:"Group",value:e.col_group}),y.if(n)(x.ReferencesField,{refs:e.refs,inline:!1,row:!1,className:"column-refs"})])}export{R as Column,E as ColumnContainer,M as ColumnBasicInfo};
2
+ //# sourceMappingURL=column-views.56f88b8c.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,e,C,K,mB,A,Q,kB,C,C,e,C,C,O,C,K,2B,A,Q,M,Y,A,Q,U,C,C,e,C,K,O,A,Q,iB,C,K,mB,A,Q,a,C,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M,EAAK,QAAQ,EACrB,EAAE,EAAE,CAAC,GAAc,KAAM,EAAE,EAAA,UAAS,CAAG,CAAE,GAAI,EAAK,MAAM,AAAC,IAC1D,EACD,EAAE,EAAW,CAAE,IAAK,CAAA,EAAM,MAAO,QAAS,MAAO,EAAK,SAAS,AAAC,GAChE,EAAE,EAAE,CAAC,GAAgB,EAAA,eAAc,CAAG,CACpC,KAAM,EAAK,IAAI,CACf,OAAQ,CAAA,EACR,IAAK,CAAA,EACL,UAAW,aACb,GACD,CACH,Q,K,M,C,K,e,C,K,e","sources":["<anon>","packages/column-views/src/column.ts"],"sourcesContent":["import \"./column-views.1261be59.js\";\nimport \"./column-views.003348f6.js\";\nimport \"./column-views.e1813308.js\";\nimport \"./column-views.0beae29d.js\";\nimport \"./column-views.a08b0c9f.js\";\nimport \"./column-views.d08e4328.js\";\nimport \"./column-views.60b5663d.js\";\nimport \"./column-views.db47fe3c.js\";\nimport \"./column-views.7f9c7448.js\";\nimport \"./column-views.a16cd1f2.js\";\nimport {ColumnAxisType as $6sU8d$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {hyperStyled as $6sU8d$hyperStyled} from \"@macrostrat/hyper\";\nimport {extractPadding as $6sU8d$extractPadding, useDarkMode as $6sU8d$useDarkMode, Box as $6sU8d$Box} from \"@macrostrat/ui-components\";\nimport $6sU8d$classnames from \"classnames\";\nimport {useRef as $6sU8d$useRef, useCallback as $6sU8d$useCallback} from \"react\";\nimport {NonIdealState as $6sU8d$NonIdealState} from \"@blueprintjs/core\";\nimport {DataField as $6sU8d$DataField} from \"@macrostrat/data-components\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $4721fb147cb3f5e1$exports = {};\n\n$parcel$export($4721fb147cb3f5e1$exports, \"Column\", () => $4721fb147cb3f5e1$export$816b5d811295e6bc);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnContainer\", () => $4721fb147cb3f5e1$export$2194471aa3d52446);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnBasicInfo\", () => $4721fb147cb3f5e1$export$fcdf79c491a4504f);\n\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $7tWYE = parcelRequire(\"7tWYE\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\nvar $2KV3o = parcelRequire(\"2KV3o\");\n\nvar $7exMg = parcelRequire(\"7exMg\");\n\nvar $4hG2H = parcelRequire(\"4hG2H\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nvar $610tc = parcelRequire(\"610tc\");\n\n\nconst $4721fb147cb3f5e1$var$h = (0, $6sU8d$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $4721fb147cb3f5e1$export$816b5d811295e6bc(props) {\n const { showUnitPopover: showUnitPopover = false, keyboardNavigation: keyboardNavigation = false, mergeSections: mergeSections, onUnitSelected: onUnitSelected, selectedUnit: selectedUnit, children: children, units: rawUnits, t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos, unconformityHeight: unconformityHeight = 30, targetUnitHeight: targetUnitHeight = 20, pixelScale: pixelScale, minPixelScale: minPixelScale = 0.2, minSectionHeight: minSectionHeight = 50, collapseSmallUnconformities: collapseSmallUnconformities = true, allowUnitSelection: allowUnitSelection, hybridScale: hybridScale, scale: scale, axisType: axisType, ...rest } = props;\n const ref = (0, $6sU8d$useRef)();\n // Selected item position\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */ let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? (0, $6sU8d$ColumnAxisType).AGE;\n let ageAxisComponent = (0, $4hG2H.CompositeAgeAxis);\n if (hybridScale?.type === (0, $76iYI.HybridScaleType).ApproximateHeight && _axisType != (0, $6sU8d$ColumnAxisType).AGE) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = (0, $4hG2H.ApproximateHeightAxis);\n _axisType = (0, $6sU8d$ColumnAxisType).AGE;\n }\n const { sections: sections, units: units, totalHeight: totalHeight } = (0, $610tc.usePreparedColumnUnits)(rawUnits, {\n axisType: _axisType,\n t_age: t_age,\n b_age: b_age,\n t_pos: t_pos,\n b_pos: b_pos,\n mergeSections: mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight: unconformityHeight,\n pixelScale: pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities: collapseSmallUnconformities,\n scale: // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale: hybridScale\n });\n if (sections.length === 0) return $4721fb147cb3f5e1$var$h(\"div.column-container.empty\", $4721fb147cb3f5e1$var$h((0, $6sU8d$NonIdealState), {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\"\n }));\n let main = $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$var$ColumnInner, {\n columnRef: ref,\n ageAxisComponent: ageAxisComponent,\n ...rest\n }, [\n children,\n $4721fb147cb3f5e1$var$h.if(showUnitPopover)((0, $2KV3o.UnitSelectionPopover)),\n $4721fb147cb3f5e1$var$h.if(keyboardNavigation)((0, $5SO8b.UnitKeyboardNavigation), {\n units: units\n })\n ]);\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */ let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) _allowUnitSelection = true;\n if (_allowUnitSelection) main = $4721fb147cb3f5e1$var$h((0, $5SO8b.UnitSelectionProvider), {\n columnRef: ref,\n onUnitSelected: onUnitSelected,\n selectedUnit: selectedUnit,\n units: units\n }, main);\n return $4721fb147cb3f5e1$var$h((0, $wtIgl.MacrostratColumnDataProvider), {\n units: units,\n sections: sections,\n totalHeight: totalHeight,\n axisType: _axisType\n }, main);\n}\nfunction $4721fb147cb3f5e1$var$ColumnInner(props) {\n const padding = (0, $6sU8d$extractPadding)(props);\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`\n };\n const { unitComponent: unitComponent = (0, $7tWYE.UnitComponent), unconformityLabels: unconformityLabels = \"minimal\", showLabels: showLabels = true, width: _width = 300, columnWidth: _columnWidth = 150, showLabelColumn: _showLabelColumn = true, className: className, columnRef: columnRef, clipUnits: clipUnits = false, children: children, showTimescale: showTimescale, timescaleLevels: timescaleLevels, maxInternalColumns: maxInternalColumns, onMouseOver: onMouseOver, ageAxisComponent: ageAxisComponent = (0, $4hG2H.CompositeAgeAxis) } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") _sectionUnconformityLabels = true;\n else if (unconformityLabels === \"minimal\") _timescaleUnconformityLabels = true;\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) columnWidth = width;\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) showLabelColumn = false;\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) _showTimescale = true;\n _showTimescale = axisType == (0, $6sU8d$ColumnAxisType).AGE && _showTimescale;\n return $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$export$2194471aa3d52446, {\n ...$4721fb147cb3f5e1$var$useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className: className\n }, $4721fb147cb3f5e1$var$h(\"div.column\", {\n ref: columnRef\n }, [\n $4721fb147cb3f5e1$var$h(ageAxisComponent),\n $4721fb147cb3f5e1$var$h.if(_showTimescale)((0, $7exMg.CompositeTimescale), {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels\n }),\n $4721fb147cb3f5e1$var$h((0, $7exMg.SectionsColumn), {\n unitComponent: unitComponent,\n showLabels: showLabels,\n width: width,\n columnWidth: columnWidth,\n showLabelColumn: showLabelColumn,\n clipUnits: clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns: maxInternalColumns\n }),\n children\n ]));\n}\nfunction $4721fb147cb3f5e1$var$useMouseEventHandlers(_onMouseOver = null) {\n /** Click event handler */ // Click handler for unit selection\n const dispatch = (0, $5SO8b.useUnitSelectionDispatch)();\n const onClick = (0, $6sU8d$useCallback)((evt)=>{\n dispatch?.(null, null, evt);\n }, [\n dispatch\n ]);\n /** Hover event handlers */ const scale = (0, $wtIgl.useCompositeScale)();\n const onMouseOver = (0, $6sU8d$useCallback)((evt)=>{\n const height = scale.invert(evt.clientY - evt.currentTarget.getBoundingClientRect().top);\n _onMouseOver?.(null, height, evt);\n }, [\n scale,\n _onMouseOver\n ]);\n const onMouseOut = (0, $6sU8d$useCallback)(()=>{\n _onMouseOver?.(null, null, null);\n }, [\n _onMouseOver\n ]);\n if (_onMouseOver == null) return {\n onClick: onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined\n };\n return {\n onMouseOver: onMouseOver,\n onMouseMove: onMouseOver,\n onMouseOut: onMouseOut,\n onClick: onClick\n };\n}\nfunction $4721fb147cb3f5e1$export$2194471aa3d52446(props) {\n const { className: className, ...rest } = props;\n const darkMode = (0, $6sU8d$useDarkMode)();\n return $4721fb147cb3f5e1$var$h((0, $6sU8d$Box), {\n className: (0, $6sU8d$classnames)(className, {\n \"dark-mode\": darkMode?.isEnabled ?? false\n }, \"column-container\"),\n ...rest\n });\n}\nfunction $4721fb147cb3f5e1$export$fcdf79c491a4504f({ data: data, showColumnID: showColumnID = true, showReferences: showReferences = true }) {\n if (data == null) return null;\n return $4721fb147cb3f5e1$var$h(\"div.column-info\", [\n $4721fb147cb3f5e1$var$h(\"div.column-title-row\", [\n $4721fb147cb3f5e1$var$h(\"h2\", data.col_name),\n $4721fb147cb3f5e1$var$h.if(showColumnID)(\"h4\", $4721fb147cb3f5e1$var$h((0, $iYfAq.Identifier), {\n id: data.col_id\n }))\n ]),\n $4721fb147cb3f5e1$var$h((0, $6sU8d$DataField), {\n row: true,\n label: \"Group\",\n value: data.col_group\n }),\n $4721fb147cb3f5e1$var$h.if(showReferences)((0, $iYfAq.ReferencesField), {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\"\n })\n ]);\n}\n\n\nexport {$4721fb147cb3f5e1$export$816b5d811295e6bc as Column, $4721fb147cb3f5e1$export$2194471aa3d52446 as ColumnContainer, $4721fb147cb3f5e1$export$fcdf79c491a4504f as ColumnBasicInfo};\n//# sourceMappingURL=column-views.52cc4dd0.js.map\n","import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n RefObject,\n useRef,\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n} from \"react\";\nimport styles from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n UnitSelectionProvider,\n UnitKeyboardNavigation,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\nconst h = hyperStyled(styles);\n\ninterface BaseColumnProps extends SectionSharedProps {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n collapseSmallUnconformities = true,\n allowUnitSelection,\n hybridScale,\n scale,\n axisType,\n ...rest\n } = props;\n const ref = useRef<HTMLElement>();\n // Selected item position\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n let main: any = h(\n ColumnInner,\n { columnRef: ref, ageAxisComponent, ...rest },\n [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ],\n );\n\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */\n let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) {\n _allowUnitSelection = true;\n }\n\n if (_allowUnitSelection) {\n main = h(\n UnitSelectionProvider,\n {\n columnRef: ref,\n onUnitSelected,\n selectedUnit,\n units,\n },\n main,\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n { units, sections, totalHeight, axisType: _axisType },\n main,\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n columnRef: RefObject<HTMLElement>;\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n columnRef,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null, evt as any);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":["ColumnAxisType","$6sU8d$ColumnAxisType","hyperStyled","$6sU8d$hyperStyled","extractPadding","$6sU8d$extractPadding","useDarkMode","$6sU8d$useDarkMode","Box","$6sU8d$Box","$6sU8d$classnames","useRef","$6sU8d$useRef","useCallback","$6sU8d$useCallback","NonIdealState","$6sU8d$NonIdealState","DataField","$6sU8d$DataField","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$4721fb147cb3f5e1$exports","$4721fb147cb3f5e1$export$816b5d811295e6bc","$4721fb147cb3f5e1$export$2194471aa3d52446","$4721fb147cb3f5e1$export$fcdf79c491a4504f","$7YHvf","$7tWYE","$wtIgl","$5SO8b","$iYfAq","$2KV3o","$7exMg","$4hG2H","$76iYI","$610tc","$4721fb147cb3f5e1$var$h","a","__esModule","default","props","showUnitPopover","keyboardNavigation","mergeSections","onUnitSelected","selectedUnit","children","units","rawUnits","t_age","b_age","t_pos","b_pos","unconformityHeight","targetUnitHeight","pixelScale","minPixelScale","minSectionHeight","collapseSmallUnconformities","allowUnitSelection","hybridScale","scale","axisType","rest","ref","_targetUnitHeight","_minSectionHeight","_minPixelScale","_axisType","AGE","ageAxisComponent","CompositeAgeAxis","type","HybridScaleType","ApproximateHeight","ApproximateHeightAxis","sections","totalHeight","usePreparedColumnUnits","length","title","description","icon","main","$4721fb147cb3f5e1$var$ColumnInner","columnRef","if","UnitSelectionPopover","UnitKeyboardNavigation","_allowUnitSelection","UnitSelectionProvider","MacrostratColumnDataProvider","padding","paddingVars","paddingTop","paddingBottom","paddingLeft","paddingRight","unitComponent","UnitComponent","unconformityLabels","showLabels","width","_width","columnWidth","_columnWidth","showLabelColumn","_showLabelColumn","className","clipUnits","showTimescale","timescaleLevels","maxInternalColumns","onMouseOver","useMacrostratColumnData","_timescaleUnconformityLabels","_sectionUnconformityLabels","_showTimescale","$4721fb147cb3f5e1$var$useMouseEventHandlers","_onMouseOver","dispatch","useUnitSelectionDispatch","onClick","evt","useCompositeScale","height","invert","clientY","currentTarget","getBoundingClientRect","top","onMouseOut","undefined","onMouseMove","style","CompositeTimescale","levels","SectionsColumn","darkMode","isEnabled","data","showColumnID","showReferences","col_name","Identifier","col_id","row","label","value","col_group","ReferencesField","refs","inline","Column","ColumnContainer","ColumnBasicInfo"],"version":3,"file":"column-views.52cc4dd0.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,e,C,K,mB,A,Q,kB,C,C,e,C,C,O,C,K,2B,A,Q,M,Y,A,Q,U,C,C,e,C,K,O,A,Q,iB,C,K,mB,A,Q,a,C,K,6B,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,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,EAAA,eAAc,CAAG,CACpC,KAAM,EAAK,IAAI,CACf,OAAQ,CAAA,EACR,IAAK,CAAA,EACL,UAAW,aACb,GACD,CACH,Q,K,M,C,K,e,C,K,e","sources":["<anon>","packages/column-views/src/column.ts"],"sourcesContent":["import \"./column-views.1261be59.js\";\nimport \"./column-views.8ee8469d.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.0beae29d.js\";\nimport \"./column-views.6c7f9245.js\";\nimport \"./column-views.f577d065.js\";\nimport \"./column-views.b40c1b9c.js\";\nimport \"./column-views.d77d260b.js\";\nimport \"./column-views.7f9c7448.js\";\nimport \"./column-views.5fd6e11a.js\";\nimport {ColumnAxisType as $6sU8d$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {hyperStyled as $6sU8d$hyperStyled} from \"@macrostrat/hyper\";\nimport {extractPadding as $6sU8d$extractPadding, useDarkMode as $6sU8d$useDarkMode, Box as $6sU8d$Box} from \"@macrostrat/ui-components\";\nimport $6sU8d$classnames from \"classnames\";\nimport {useRef as $6sU8d$useRef, useCallback as $6sU8d$useCallback} from \"react\";\nimport {NonIdealState as $6sU8d$NonIdealState} from \"@blueprintjs/core\";\nimport {DataField as $6sU8d$DataField} from \"@macrostrat/data-components\";\n\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $4721fb147cb3f5e1$exports = {};\n\n$parcel$export($4721fb147cb3f5e1$exports, \"Column\", () => $4721fb147cb3f5e1$export$816b5d811295e6bc);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnContainer\", () => $4721fb147cb3f5e1$export$2194471aa3d52446);\n$parcel$export($4721fb147cb3f5e1$exports, \"ColumnBasicInfo\", () => $4721fb147cb3f5e1$export$fcdf79c491a4504f);\n\n\n\n\n\n\nvar $7YHvf = parcelRequire(\"7YHvf\");\n\nvar $7tWYE = parcelRequire(\"7tWYE\");\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\nvar $5SO8b = parcelRequire(\"5SO8b\");\n\nvar $iYfAq = parcelRequire(\"iYfAq\");\nvar $2KV3o = parcelRequire(\"2KV3o\");\n\nvar $7exMg = parcelRequire(\"7exMg\");\n\nvar $4hG2H = parcelRequire(\"4hG2H\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nvar $610tc = parcelRequire(\"610tc\");\n\n\nconst $4721fb147cb3f5e1$var$h = (0, $6sU8d$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($7YHvf))));\nfunction $4721fb147cb3f5e1$export$816b5d811295e6bc(props) {\n const { showUnitPopover: showUnitPopover = false, keyboardNavigation: keyboardNavigation = false, mergeSections: mergeSections, onUnitSelected: onUnitSelected, selectedUnit: selectedUnit, children: children, units: rawUnits, t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos, unconformityHeight: unconformityHeight = 30, targetUnitHeight: targetUnitHeight = 20, pixelScale: pixelScale, minPixelScale: minPixelScale = 0.2, minSectionHeight: minSectionHeight = 50, collapseSmallUnconformities: collapseSmallUnconformities = true, allowUnitSelection: allowUnitSelection, hybridScale: hybridScale, scale: scale, axisType: axisType, ...rest } = props;\n const ref = (0, $6sU8d$useRef)();\n // Selected item position\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */ let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? (0, $6sU8d$ColumnAxisType).AGE;\n let ageAxisComponent = (0, $4hG2H.CompositeAgeAxis);\n if (hybridScale?.type === (0, $76iYI.HybridScaleType).ApproximateHeight && _axisType != (0, $6sU8d$ColumnAxisType).AGE) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = (0, $4hG2H.ApproximateHeightAxis);\n _axisType = (0, $6sU8d$ColumnAxisType).AGE;\n }\n const { sections: sections, units: units, totalHeight: totalHeight } = (0, $610tc.usePreparedColumnUnits)(rawUnits, {\n axisType: _axisType,\n t_age: t_age,\n b_age: b_age,\n t_pos: t_pos,\n b_pos: b_pos,\n mergeSections: mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight: unconformityHeight,\n pixelScale: pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities: collapseSmallUnconformities,\n scale: // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale: hybridScale\n });\n if (sections.length === 0) return $4721fb147cb3f5e1$var$h(\"div.column-container.empty\", $4721fb147cb3f5e1$var$h((0, $6sU8d$NonIdealState), {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\"\n }));\n let main = $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$var$ColumnInner, {\n columnRef: ref,\n ageAxisComponent: ageAxisComponent,\n ...rest\n }, [\n children,\n $4721fb147cb3f5e1$var$h.if(showUnitPopover)((0, $2KV3o.UnitSelectionPopover)),\n $4721fb147cb3f5e1$var$h.if(keyboardNavigation)((0, $5SO8b.UnitKeyboardNavigation), {\n units: units\n })\n ]);\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */ let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) _allowUnitSelection = true;\n if (_allowUnitSelection) main = $4721fb147cb3f5e1$var$h((0, $5SO8b.UnitSelectionProvider), {\n columnRef: ref,\n onUnitSelected: onUnitSelected,\n selectedUnit: selectedUnit,\n units: units\n }, main);\n return $4721fb147cb3f5e1$var$h((0, $wtIgl.MacrostratColumnDataProvider), {\n units: units,\n sections: sections,\n totalHeight: totalHeight,\n axisType: _axisType\n }, main);\n}\nfunction $4721fb147cb3f5e1$var$ColumnInner(props) {\n const padding = (0, $6sU8d$extractPadding)(props);\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`\n };\n const { unitComponent: unitComponent = (0, $7tWYE.UnitComponent), unconformityLabels: unconformityLabels = \"minimal\", showLabels: showLabels = true, width: _width = 300, columnWidth: _columnWidth = 150, showLabelColumn: _showLabelColumn = true, className: className, columnRef: columnRef, clipUnits: clipUnits = false, children: children, showTimescale: showTimescale, timescaleLevels: timescaleLevels, maxInternalColumns: maxInternalColumns, onMouseOver: onMouseOver, ageAxisComponent: ageAxisComponent = (0, $4hG2H.CompositeAgeAxis) } = props;\n const { axisType: axisType } = (0, $wtIgl.useMacrostratColumnData)();\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") _sectionUnconformityLabels = true;\n else if (unconformityLabels === \"minimal\") _timescaleUnconformityLabels = true;\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) columnWidth = width;\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) showLabelColumn = false;\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) _showTimescale = true;\n _showTimescale = axisType == (0, $6sU8d$ColumnAxisType).AGE && _showTimescale;\n return $4721fb147cb3f5e1$var$h($4721fb147cb3f5e1$export$2194471aa3d52446, {\n ...$4721fb147cb3f5e1$var$useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className: className\n }, $4721fb147cb3f5e1$var$h(\"div.column\", {\n ref: columnRef\n }, [\n $4721fb147cb3f5e1$var$h(ageAxisComponent),\n $4721fb147cb3f5e1$var$h.if(_showTimescale)((0, $7exMg.CompositeTimescale), {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels\n }),\n $4721fb147cb3f5e1$var$h((0, $7exMg.SectionsColumn), {\n unitComponent: unitComponent,\n showLabels: showLabels,\n width: width,\n columnWidth: columnWidth,\n showLabelColumn: showLabelColumn,\n clipUnits: clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns: maxInternalColumns\n }),\n children\n ]));\n}\nfunction $4721fb147cb3f5e1$var$useMouseEventHandlers(_onMouseOver = null) {\n /** Click event handler */ // Click handler for unit selection\n const dispatch = (0, $5SO8b.useUnitSelectionDispatch)();\n const onClick = (0, $6sU8d$useCallback)((evt)=>{\n dispatch?.(null, null, evt);\n }, [\n dispatch\n ]);\n /** Hover event handlers */ const scale = (0, $wtIgl.useCompositeScale)();\n const onMouseOver = (0, $6sU8d$useCallback)((evt)=>{\n const height = scale.invert(evt.clientY - evt.currentTarget.getBoundingClientRect().top);\n _onMouseOver?.(null, height, evt);\n }, [\n scale,\n _onMouseOver\n ]);\n const onMouseOut = (0, $6sU8d$useCallback)(()=>{\n _onMouseOver?.(null, null, null);\n }, [\n _onMouseOver\n ]);\n if (_onMouseOver == null) return {\n onClick: onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined\n };\n return {\n onMouseOver: onMouseOver,\n onMouseMove: onMouseOver,\n onMouseOut: onMouseOut,\n onClick: onClick\n };\n}\nfunction $4721fb147cb3f5e1$export$2194471aa3d52446(props) {\n const { className: className, ...rest } = props;\n const darkMode = (0, $6sU8d$useDarkMode)();\n return $4721fb147cb3f5e1$var$h((0, $6sU8d$Box), {\n className: (0, $6sU8d$classnames)(className, {\n \"dark-mode\": darkMode?.isEnabled ?? false\n }, \"column-container\"),\n ...rest\n });\n}\nfunction $4721fb147cb3f5e1$export$fcdf79c491a4504f({ data: data, showColumnID: showColumnID = true, showReferences: showReferences = true }) {\n if (data == null) return null;\n return $4721fb147cb3f5e1$var$h(\"div.column-info\", [\n $4721fb147cb3f5e1$var$h(\"div.column-title-row\", [\n $4721fb147cb3f5e1$var$h(\"h2\", data.col_name),\n $4721fb147cb3f5e1$var$h.if(showColumnID)(\"h4\", $4721fb147cb3f5e1$var$h((0, $iYfAq.Identifier), {\n id: data.col_id\n }))\n ]),\n $4721fb147cb3f5e1$var$h((0, $6sU8d$DataField), {\n row: true,\n label: \"Group\",\n value: data.col_group\n }),\n $4721fb147cb3f5e1$var$h.if(showReferences)((0, $iYfAq.ReferencesField), {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\"\n })\n ]);\n}\n\n\nexport {$4721fb147cb3f5e1$export$816b5d811295e6bc as Column, $4721fb147cb3f5e1$export$2194471aa3d52446 as ColumnContainer, $4721fb147cb3f5e1$export$fcdf79c491a4504f as ColumnBasicInfo};\n//# sourceMappingURL=column-views.56f88b8c.js.map\n","import { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { hyperStyled } from \"@macrostrat/hyper\";\nimport {\n Box,\n extractPadding,\n Padding,\n useDarkMode,\n} from \"@macrostrat/ui-components\";\nimport classNames from \"classnames\";\nimport {\n RefObject,\n useRef,\n HTMLAttributes,\n useCallback,\n CSSProperties,\n ComponentType,\n} from \"react\";\nimport styles from \"./column.module.sass\";\nimport { UnitComponent } from \"./units\";\nimport {\n UnitSelectionProvider,\n UnitKeyboardNavigation,\n useUnitSelectionDispatch,\n} from \"./data-provider\";\n\nimport {\n Identifier,\n ReferencesField,\n UnitSelectionPopover,\n} from \"./unit-details\";\nimport {\n MacrostratColumnDataProvider,\n useCompositeScale,\n useMacrostratColumnData,\n} from \"./data-provider\";\nimport {\n SectionSharedProps,\n CompositeTimescale,\n SectionsColumn,\n} from \"./section\";\nimport { ApproximateHeightAxis, CompositeAgeAxis } from \"./age-axis\";\nimport {\n MergeSectionsMode,\n usePreparedColumnUnits,\n HybridScaleType,\n ColumnHeightScaleOptions,\n} from \"./prepare-units\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { NonIdealState } from \"@blueprintjs/core\";\nimport { DataField } from \"@macrostrat/data-components\";\nimport { ScaleContinuousNumeric } from \"d3-scale\";\n\nconst h = hyperStyled(styles);\n\ninterface BaseColumnProps extends Omit<\n SectionSharedProps,\n \"unconformityLabels\"\n> {\n className?: string;\n showLabelColumn?: boolean;\n keyboardNavigation?: boolean;\n showLabels?: boolean;\n maxInternalColumns?: number;\n // Timescale properties\n showTimescale?: boolean;\n timescaleLevels?: number | [number, number];\n unconformityLabels?: boolean | UnconformityLabelPlacement;\n onMouseOver?: (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n ) => void;\n}\n\nexport type UnconformityLabelPlacement = \"minimal\" | \"prominent\" | \"none\";\n\nexport interface ColumnProps\n extends Padding, BaseColumnProps, ColumnHeightScaleOptions {\n // Macrostrat units\n units: UnitLong[];\n t_age?: number;\n b_age?: number;\n t_pos?: number;\n b_pos?: number;\n mergeSections?: MergeSectionsMode;\n showUnitPopover?: boolean;\n allowUnitSelection?: boolean;\n selectedUnit?: number | null;\n onUnitSelected?: (unitID: number | null, unit: any) => void;\n // Unconformity height in pixels\n unconformityHeight?: number;\n scale?: ScaleContinuousNumeric<number, number>;\n}\n\nexport function Column(props: ColumnProps) {\n const {\n showUnitPopover = false,\n keyboardNavigation = false,\n mergeSections,\n onUnitSelected,\n selectedUnit,\n children,\n units: rawUnits,\n t_age,\n b_age,\n t_pos,\n b_pos,\n unconformityHeight = 30,\n targetUnitHeight = 20,\n pixelScale,\n minPixelScale = 0.2,\n minSectionHeight = 50,\n collapseSmallUnconformities = true,\n allowUnitSelection,\n hybridScale,\n scale,\n axisType,\n ...rest\n } = props;\n const ref = useRef<HTMLElement>();\n // Selected item position\n\n /* Make pixelScale and targetUnitHeight mutually exclusive. PixelScale implies\n * standardization of scales in all sections */\n let _targetUnitHeight = targetUnitHeight;\n let _minSectionHeight = minSectionHeight;\n let _minPixelScale = minPixelScale;\n if (pixelScale != null) {\n _targetUnitHeight = null;\n _minSectionHeight = 0;\n _minPixelScale = pixelScale;\n }\n\n // Handle special cases for hybrid scales (WIP, we need to regularize this)\n let _axisType = axisType ?? ColumnAxisType.AGE;\n let ageAxisComponent = CompositeAgeAxis;\n if (\n hybridScale?.type === HybridScaleType.ApproximateHeight &&\n _axisType != ColumnAxisType.AGE\n ) {\n // Use approximate height axis for non-age columns if a non-age axis type is requested\n ageAxisComponent = ApproximateHeightAxis;\n _axisType = ColumnAxisType.AGE;\n }\n\n const { sections, units, totalHeight } = usePreparedColumnUnits(rawUnits, {\n axisType: _axisType,\n t_age,\n b_age,\n t_pos,\n b_pos,\n mergeSections,\n targetUnitHeight: _targetUnitHeight,\n unconformityHeight,\n pixelScale,\n minPixelScale: _minPixelScale,\n minSectionHeight: _minSectionHeight,\n collapseSmallUnconformities,\n // TODO: consider unifying scale and hybridScale options\n scale,\n hybridScale,\n });\n\n if (sections.length === 0) {\n return h(\n \"div.column-container.empty\",\n h(NonIdealState, {\n title: \"Empty column\",\n description: \"No sections found in this column.\",\n icon: \"warning-sign\",\n }),\n );\n }\n\n let main: any = h(\n ColumnInner,\n { columnRef: ref, ageAxisComponent, ...rest },\n [\n children,\n h.if(showUnitPopover)(UnitSelectionPopover),\n h.if(keyboardNavigation)(UnitKeyboardNavigation, { units }),\n ],\n );\n\n /* By default, unit selection is disabled. However, if any related props are passed,\n we enable it.\n */\n let _allowUnitSelection = allowUnitSelection ?? false;\n if (showUnitPopover || selectedUnit != null || onUnitSelected != null) {\n _allowUnitSelection = true;\n }\n\n if (_allowUnitSelection) {\n main = h(\n UnitSelectionProvider,\n {\n columnRef: ref,\n onUnitSelected,\n selectedUnit,\n units,\n },\n main,\n );\n }\n\n return h(\n MacrostratColumnDataProvider,\n { units, sections, totalHeight, axisType: _axisType },\n main,\n );\n}\n\ninterface ColumnInnerProps extends BaseColumnProps {\n columnRef: RefObject<HTMLElement>;\n ageAxisComponent?: ComponentType;\n}\n\nfunction ColumnInner(props: ColumnInnerProps) {\n const padding = extractPadding(props);\n\n // TODO: integrate padding vars more closely with the rest of the spacing (right now padding is a bit ad-hoc)\n const paddingVars: any = {\n \"--column-padding-top\": `${padding.paddingTop}px`,\n \"--column-padding-bottom\": `${padding.paddingBottom}px`,\n \"--column-padding-left\": `${padding.paddingLeft}px`,\n \"--column-padding-right\": `${padding.paddingRight}px`,\n };\n\n const {\n unitComponent = UnitComponent,\n unconformityLabels = \"minimal\",\n showLabels = true,\n width: _width = 300,\n columnWidth: _columnWidth = 150,\n showLabelColumn: _showLabelColumn = true,\n className,\n columnRef,\n clipUnits = false,\n children,\n showTimescale,\n timescaleLevels,\n maxInternalColumns,\n onMouseOver,\n ageAxisComponent = CompositeAgeAxis,\n } = props;\n\n const { axisType } = useMacrostratColumnData();\n\n // Coalesce unconformity label setting to a boolean\n let _timescaleUnconformityLabels = false;\n let _sectionUnconformityLabels = false;\n if (unconformityLabels === true || unconformityLabels === \"prominent\") {\n _sectionUnconformityLabels = true;\n } else if (unconformityLabels === \"minimal\") {\n _timescaleUnconformityLabels = true;\n }\n\n let width = _width;\n let columnWidth = _columnWidth;\n if (columnWidth > width) {\n columnWidth = width;\n }\n let showLabelColumn = _showLabelColumn;\n if (columnWidth > width - 10) {\n showLabelColumn = false;\n }\n\n let _showTimescale = showTimescale ?? true;\n if (timescaleLevels != null) {\n _showTimescale = true;\n }\n _showTimescale = axisType == ColumnAxisType.AGE && _showTimescale;\n\n return h(\n ColumnContainer,\n {\n ...useMouseEventHandlers(onMouseOver),\n style: paddingVars,\n className,\n },\n h(\"div.column\", { ref: columnRef }, [\n h(ageAxisComponent),\n h.if(_showTimescale)(CompositeTimescale, {\n levels: timescaleLevels,\n unconformityLabels: _timescaleUnconformityLabels,\n }),\n h(SectionsColumn, {\n unitComponent,\n showLabels,\n width,\n columnWidth,\n showLabelColumn,\n clipUnits,\n unconformityLabels: _sectionUnconformityLabels,\n maxInternalColumns,\n }),\n children,\n ]),\n );\n}\n\ntype ColumnMouseOverHandler = (\n unit: UnitLong | null,\n height: number | null,\n evt: MouseEvent,\n) => void;\n\nfunction useMouseEventHandlers(\n _onMouseOver: ColumnMouseOverHandler | null = null,\n) {\n /** Click event handler */\n\n // Click handler for unit selection\n const dispatch = useUnitSelectionDispatch();\n const onClick = useCallback(\n (evt) => {\n dispatch?.(null, null, evt as any);\n },\n [dispatch],\n );\n\n /** Hover event handlers */\n const scale = useCompositeScale();\n\n const onMouseOver = useCallback(\n (evt) => {\n const height = scale.invert(\n evt.clientY - evt.currentTarget.getBoundingClientRect().top,\n );\n _onMouseOver?.(null, height, evt);\n },\n [scale, _onMouseOver],\n );\n\n const onMouseOut = useCallback(() => {\n _onMouseOver?.(null, null, null);\n }, [_onMouseOver]);\n\n if (_onMouseOver == null) {\n return {\n onClick,\n onMouseOver: undefined,\n onMouseMove: undefined,\n onMouseOut: undefined,\n };\n }\n\n return { onMouseOver, onMouseMove: onMouseOver, onMouseOut, onClick };\n}\n\nexport interface ColumnContainerProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n style?: CSSProperties;\n}\n\nexport function ColumnContainer(props: ColumnContainerProps) {\n const { className, ...rest } = props;\n const darkMode = useDarkMode();\n\n return h(Box, {\n className: classNames(\n className,\n {\n \"dark-mode\": darkMode?.isEnabled ?? false,\n },\n \"column-container\",\n ),\n ...rest,\n });\n}\n\nexport function ColumnBasicInfo({\n data,\n showColumnID = true,\n showReferences = true,\n}) {\n if (data == null) return null;\n return h(\"div.column-info\", [\n h(\"div.column-title-row\", [\n h(\"h2\", data.col_name),\n h.if(showColumnID)(\"h4\", h(Identifier, { id: data.col_id })),\n ]),\n h(DataField, { row: true, label: \"Group\", value: data.col_group }),\n h.if(showReferences)(ReferencesField, {\n refs: data.refs,\n inline: false,\n row: false,\n className: \"column-refs\",\n }),\n ]);\n}\n"],"names":["ColumnAxisType","$6sU8d$ColumnAxisType","hyperStyled","$6sU8d$hyperStyled","extractPadding","$6sU8d$extractPadding","useDarkMode","$6sU8d$useDarkMode","Box","$6sU8d$Box","$6sU8d$classnames","useRef","$6sU8d$useRef","useCallback","$6sU8d$useCallback","NonIdealState","$6sU8d$NonIdealState","DataField","$6sU8d$DataField","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$4721fb147cb3f5e1$exports","$4721fb147cb3f5e1$export$816b5d811295e6bc","$4721fb147cb3f5e1$export$2194471aa3d52446","$4721fb147cb3f5e1$export$fcdf79c491a4504f","$7YHvf","$7tWYE","$wtIgl","$5SO8b","$iYfAq","$2KV3o","$7exMg","$4hG2H","$76iYI","$610tc","$4721fb147cb3f5e1$var$h","a","__esModule","default","props","showUnitPopover","keyboardNavigation","mergeSections","onUnitSelected","selectedUnit","children","units","rawUnits","t_age","b_age","t_pos","b_pos","unconformityHeight","targetUnitHeight","pixelScale","minPixelScale","minSectionHeight","collapseSmallUnconformities","allowUnitSelection","hybridScale","scale","axisType","rest","ref","_targetUnitHeight","_minSectionHeight","_minPixelScale","_axisType","AGE","ageAxisComponent","CompositeAgeAxis","type","HybridScaleType","ApproximateHeight","ApproximateHeightAxis","sections","totalHeight","usePreparedColumnUnits","length","title","description","icon","main","$4721fb147cb3f5e1$var$ColumnInner","columnRef","if","UnitSelectionPopover","UnitKeyboardNavigation","_allowUnitSelection","UnitSelectionProvider","MacrostratColumnDataProvider","padding","paddingVars","paddingTop","paddingBottom","paddingLeft","paddingRight","unitComponent","UnitComponent","unconformityLabels","showLabels","width","_width","columnWidth","_columnWidth","showLabelColumn","_showLabelColumn","className","clipUnits","showTimescale","timescaleLevels","maxInternalColumns","onMouseOver","useMacrostratColumnData","_timescaleUnconformityLabels","_sectionUnconformityLabels","_showTimescale","$4721fb147cb3f5e1$var$useMouseEventHandlers","_onMouseOver","dispatch","useUnitSelectionDispatch","onClick","evt","useCompositeScale","height","invert","clientY","currentTarget","getBoundingClientRect","top","onMouseOut","undefined","onMouseMove","style","CompositeTimescale","levels","SectionsColumn","darkMode","isEnabled","data","showColumnID","showReferences","col_name","Identifier","col_id","row","label","value","col_group","ReferencesField","refs","inline","Column","ColumnContainer","ColumnBasicInfo"],"version":3,"file":"column-views.56f88b8c.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.5f3b0b04.js";import"./column-views.7f9c7448.js";import{scaleLinear as e}from"d3-scale";import{ColumnAxisType as t}from"@macrostrat/column-components";import{mergeAgeRanges as a,MergeMode as i}from"@macrostrat/stratigraphy-utils";var n=globalThis,l={},r={},o=n.parcelRequirea149;null==o&&((o=function(e){if(e in l)return l[e].exports;if(e in r){var t=r[e];delete r[e];var a={id:e,exports:{}};return l[e]=a,t.call(a.exports,a,a.exports),a.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){r[e]=t},n.parcelRequirea149=o),o.register;var u=o("iWhRv"),s=o("76iYI");function g(e,t=.001){let a=[];for(let t of e)a.push({age:t.t_age,units_below:[t.unit_id],units_above:[]}),a.push({age:t.b_age,units_above:[t.unit_id],units_below:[]});let i=[];for(let e of a){let a=i.find(a=>Math.abs(a.age-e.age)<t);a?(a.units_above.push(...e.units_above),a.units_below.push(...e.units_below)):i.push(e)}return i.sort((e,t)=>e.age-t.age),i.map((e,t)=>({...e,index:t}))}function h(e,t,a,i={}){let n=g(t).filter(e=>e.age<Math.max(...a)&&e.age>Math.min(...a)),l=[{index:-1,age:Math.min(...a),units_above:[],units_below:[]},...n,{index:-1,age:Math.max(...a),units_above:[],units_below:[]}],{type:r,...o}=e;return r===s.HybridScaleType.EquidistantSurfaces?p(l,i):f(l,t,{...i,...o})}function f(n,l,r={}){let{pixelScale:o=1,pixelOffset:g=0,minHeight:h=5,heightMethod:p=s.HeightMethod.Maximum,defaultHeight:c=100}=r,m=function(e,t){let a=[];for(let i=0;i<e.length-1;i++){let n=e[i],l=e[i+1],r=t.filter(e=>e.t_age<=n.age+.001&&e.b_age>=l.age-.001);a.push({t_age:n.age,b_age:l.age,units:r})}return a}(n,l),d=[],b=[],_=g;for(let e of m){_==g&&(d.push(_),b.push(e.t_age));let n=e.units,l=[];for(let r of n){let n=function(e,n,l){let r=(0,u.getUnitHeightRange)(e,t.AGE),o=a([r,[l,n]],i.Inner),s=Math.abs(r[1]-r[0]);return Math.abs(o[1]-o[0])/s}(r,e.t_age,e.b_age),o=function(e,t=s.HeightMethod.Maximum){let a=[];if(e.min_thick,t===s.HeightMethod.Minimum||t===s.HeightMethod.Average){let t=e.min_thick;null!=t&&!isNaN(t)&&t>0&&a.push(t)}if(t===s.HeightMethod.Average||t===s.HeightMethod.Maximum){let t=e.max_thick;null!=t&&!isNaN(t)&&t>0&&a.push(t)}return 0===a.length?null:t===s.HeightMethod.Average?a.reduce((e,t)=>e+t,0)/a.length:a[0]}(r,p);null!=o&&l.push({unit:r,height:o*n})}let r=0;if(0===l.length)r=c;else{let e=l.reduce((e,t)=>e+t.height,0)/l.length;r=0==e?c:e<h?h:e}_+=r,d.push(_),b.push(e.b_age)}let x=d.map(e=>e*o),M=e().domain(b).range(x),H=d.map(e=>_-e),v=e().domain(H).range(x);return{scale:M,pixelScale:null,domain:[b[b.length-1],b[0]],pixelHeight:Math.abs(x[x.length-1]-x[0]),heightScale:v}}function p(t,a={}){let{pixelScale:i=30}=a,n=[t[t.length-1].age,t[0].age],l=t.map((e,t)=>t*i),r=t.map(e=>e.age);return{scale:e().domain(r).range(l),pixelScale:null,domain:n,pixelHeight:Math.abs(l[l.length-1]-l[0])}}export{g as buildColumnSurfaces,h as buildHybridScale,p as buildScaleFromSurfacesSimple,f as buildApproximateHeightScale};
2
- //# sourceMappingURL=column-views.0b3a384e.js.map
1
+ import"./column-views.dbb4a46b.js";import"./column-views.7f9c7448.js";import{scaleLinear as e}from"d3-scale";import{ColumnAxisType as t}from"@macrostrat/column-components";import{mergeAgeRanges as a,MergeMode as i}from"@macrostrat/stratigraphy-utils";var n=globalThis,l={},r={},o=n.parcelRequirea149;null==o&&((o=function(e){if(e in l)return l[e].exports;if(e in r){var t=r[e];delete r[e];var a={id:e,exports:{}};return l[e]=a,t.call(a.exports,a,a.exports),a.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){r[e]=t},n.parcelRequirea149=o),o.register;var u=o("iWhRv"),s=o("76iYI");function g(e,t=.001){let a=[];for(let t of e)a.push({age:t.t_age,units_below:[t.unit_id],units_above:[]}),a.push({age:t.b_age,units_above:[t.unit_id],units_below:[]});let i=[];for(let e of a){let a=i.find(a=>Math.abs(a.age-e.age)<t);a?(a.units_above.push(...e.units_above),a.units_below.push(...e.units_below)):i.push(e)}return i.sort((e,t)=>e.age-t.age),i.map((e,t)=>({...e,index:t}))}function h(e,t,a,i={}){let n=g(t).filter(e=>e.age<Math.max(...a)&&e.age>Math.min(...a)),l=[{index:-1,age:Math.min(...a),units_above:[],units_below:[]},...n,{index:-1,age:Math.max(...a),units_above:[],units_below:[]}],{type:r,...o}=e;return r===s.HybridScaleType.EquidistantSurfaces?p(l,i):f(l,t,{...i,...o})}function f(n,l,r={}){let{pixelScale:o=1,pixelOffset:g=0,minHeight:h=5,heightMethod:p=s.HeightMethod.Maximum,defaultHeight:c=100}=r,m=function(e,t){let a=[];for(let i=0;i<e.length-1;i++){let n=e[i],l=e[i+1],r=t.filter(e=>e.t_age<=n.age+.001&&e.b_age>=l.age-.001);a.push({t_age:n.age,b_age:l.age,units:r})}return a}(n,l),d=[],b=[],_=g;for(let e of m){_==g&&(d.push(_),b.push(e.t_age));let n=e.units,l=[];for(let r of n){let n=function(e,n,l){let r=(0,u.getUnitHeightRange)(e,t.AGE),o=a([r,[l,n]],i.Inner),s=Math.abs(r[1]-r[0]);return Math.abs(o[1]-o[0])/s}(r,e.t_age,e.b_age),o=function(e,t=s.HeightMethod.Maximum){let a=[];if(e.min_thick,t===s.HeightMethod.Minimum||t===s.HeightMethod.Average){let t=e.min_thick;null!=t&&!isNaN(t)&&t>0&&a.push(t)}if(t===s.HeightMethod.Average||t===s.HeightMethod.Maximum){let t=e.max_thick;null!=t&&!isNaN(t)&&t>0&&a.push(t)}return 0===a.length?null:t===s.HeightMethod.Average?a.reduce((e,t)=>e+t,0)/a.length:a[0]}(r,p);null!=o&&l.push({unit:r,height:o*n})}let r=0;if(0===l.length)r=c;else{let e=l.reduce((e,t)=>e+t.height,0)/l.length;r=0==e?c:e<h?h:e}_+=r,d.push(_),b.push(e.b_age)}let x=d.map(e=>e*o),M=e().domain(b).range(x),H=d.map(e=>_-e),v=e().domain(H).range(x);return{scale:M,pixelScale:null,domain:[b[b.length-1],b[0]],pixelHeight:Math.abs(x[x.length-1]-x[0]),heightScale:v}}function p(t,a={}){let{pixelScale:i=30}=a,n=[t[t.length-1].age,t[0].age],l=t.map((e,t)=>t*i),r=t.map(e=>e.age);return{scale:e().domain(r).range(l),pixelScale:null,domain:n,pixelHeight:Math.abs(l[l.length-1]-l[0])}}export{g as buildColumnSurfaces,h as buildHybridScale,p as buildScaleFromSurfacesSimple,f as buildApproximateHeightScale};
2
+ //# sourceMappingURL=column-views.5a9331a9.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,A,Q,e,C,K,U,A,Q,kB,C,K,+B,A,Q,kB,C,C,a,C,K,gC,C,I,E,W,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CAAC,AAAC,GAAM,EAAE,GAAG,EAK3C,MAAO,CACL,MAHY,AAAA,IAAc,MAAM,CAAC,GAAW,KAAK,CAFhC,GAMjB,WAAY,KACZ,OAAA,EACA,YAAa,KAAK,GAAG,CAAC,AARL,CAQe,CAAC,AARhB,EAQ2B,MAAM,CAAG,EAAE,CAAG,AARzC,CAQmD,CAAC,EAAE,CACzE,CACF,Q,K,mB,C,K,gB,C,K,4B,C,K,2B","sources":["<anon>","packages/column-views/src/prepare-units/dynamic-scales.ts"],"sourcesContent":["import \"./column-views.5f3b0b04.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {scaleLinear as $gr21k$scaleLinear} from \"d3-scale\";\nimport {ColumnAxisType as $gr21k$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {mergeAgeRanges as $gr21k$mergeAgeRanges, MergeMode as $gr21k$MergeMode} from \"@macrostrat/stratigraphy-utils\";\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $b83252c9fe80810e$export$151c207e6887154c(units, tolerance = 0.001) {\n /** Compute age surfaces for a column based on unit tops and bottoms */ const surfaces = [];\n for (const unit of units){\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [\n unit.unit_id\n ],\n units_above: []\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [\n unit.unit_id\n ],\n units_below: []\n });\n }\n // Merge duplicate surfaces (same age)\n const mergedSurfaces = [];\n for (const surface of surfaces){\n const existingSurface = mergedSurfaces.find((s)=>Math.abs(s.age - surface.age) < tolerance);\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else mergedSurfaces.push(surface);\n }\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b)=>a.age - b.age);\n return mergedSurfaces.map((s, i)=>({\n ...s,\n index: i\n }));\n}\nfunction $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units) {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo = [];\n for(let i = 0; i < surfaces.length - 1; i++){\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit)=>{\n return unit.t_age <= topSurface.age + 0.001 && unit.b_age >= bottomSurface.age - 0.001;\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain\n });\n }\n return domainUnitInfo;\n}\nfunction $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, t_age, b_age) {\n // Compute the proportion of a unit's height that lies within the given age domain\n const rng = (0, $iWhRv.getUnitHeightRange)(unit, (0, $gr21k$ColumnAxisType).AGE);\n const rng1 = [\n b_age,\n t_age\n ];\n // Compute overlap\n const mergedRange = (0, $gr21k$mergeAgeRanges)([\n rng,\n rng1\n ], (0, $gr21k$MergeMode).Inner);\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n return mergedHeight / unitHeight;\n}\nfunction $b83252c9fe80810e$export$6b39f1b6356d94b6(def, units, domain, options = {}) {\n const surfaces = $b83252c9fe80810e$export$151c207e6887154c(units);\n const filteredSurfaces = surfaces.filter((s)=>s.age < Math.max(...domain) && s.age > Math.min(...domain));\n const s1 = [\n {\n index: -1,\n age: Math.min(...domain),\n units_above: [],\n units_below: []\n },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: []\n }\n ];\n const { type: type, ...rest } = def;\n if (type === (0, $76iYI.HybridScaleType).EquidistantSurfaces) return $b83252c9fe80810e$export$d02d2d708a7b495f(s1, options);\n return $b83252c9fe80810e$export$be7a6f1f0a23d12c(s1, units, {\n ...options,\n ...rest\n });\n}\nfunction $b83252c9fe80810e$var$getApproximateHeight(unit, method = (0, $76iYI.HeightMethod).Maximum) {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === (0, $76iYI.HeightMethod).Minimum || method === (0, $76iYI.HeightMethod).Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === (0, $76iYI.HeightMethod).Average || method === (0, $76iYI.HeightMethod).Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (heights.length === 0) return null;\n if (method === (0, $76iYI.HeightMethod).Average) return heights.reduce((sum, h)=>sum + h, 0) / heights.length;\n else return heights[0];\n}\nfunction $b83252c9fe80810e$export$be7a6f1f0a23d12c(surfaces, units, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 1, pixelOffset: pixelOffset = 0, minHeight: minHeight = 5, heightMethod: heightMethod = (0, $76iYI.HeightMethod).Maximum, defaultHeight: // Default height for when height is unknown\n defaultHeight = 100 } = options;\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units);\n // Compute the height in pixels for each surface\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n for (const domain of domainInfo){\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo = [];\n for (const unit of units){\n const proportion = $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, domain.t_age, domain.b_age);\n const height = $b83252c9fe80810e$var$getApproximateHeight(unit, heightMethod);\n if (height != null) unitHeightInfo.push({\n unit: unit,\n height: height * proportion\n });\n }\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) thisHeight = defaultHeight; // Default height if no units with height info\n else {\n // Normalize weights (take the mean)\n const meanHeight = unitHeightInfo.reduce((sum, d)=>sum + d.height, 0) / unitHeightInfo.length;\n if (meanHeight == 0) thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n else if (meanHeight < minHeight) thisHeight = minHeight; // Minimum height\n else thisHeight = meanHeight;\n }\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h)=>h * pixelScale);\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n const heightDomain = surfaceHeights.map((h)=>lastHeight - h);\n const heightScale = (0, $gr21k$scaleLinear)().domain(heightDomain).range(pixelRange);\n const domain = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0]\n ];\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale: heightScale\n };\n}\nfunction $b83252c9fe80810e$export$d02d2d708a7b495f(surfaces, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 30 } = options;\n const domain = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age\n ];\n // Compute the height in pixels for each surface\n const surfaceHeights = surfaces.map((surface, i)=>{\n return i * pixelScale;\n });\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s)=>s.age);\n const pixelRange = surfaceHeights;\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0])\n };\n}\n\n\nexport {$b83252c9fe80810e$export$151c207e6887154c as buildColumnSurfaces, $b83252c9fe80810e$export$6b39f1b6356d94b6 as buildHybridScale, $b83252c9fe80810e$export$d02d2d708a7b495f as buildScaleFromSurfacesSimple, $b83252c9fe80810e$export$be7a6f1f0a23d12c as buildApproximateHeightScale};\n//# sourceMappingURL=column-views.0b3a384e.js.map\n","import type { UnitLong } from \"@macrostrat/api-types\";\nimport { scaleLinear } from \"d3-scale\";\nimport { getUnitHeightRange } from \"./utils\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { mergeAgeRanges, MergeMode } from \"@macrostrat/stratigraphy-utils\";\nimport type {\n ApproxHeightScaleOptions,\n ExtUnit,\n HybridScaleDefinition,\n HybridScaleOptions,\n PackageScaleInfo,\n} from \"./types\";\nimport { HybridScaleType, HeightMethod } from \"./types\";\n\ninterface BaseSurface {\n index: number;\n age: number;\n units_below: number[];\n units_above: number[];\n}\n\nexport function buildColumnSurfaces<T extends UnitLong>(\n units: T[],\n tolerance: number = 0.001,\n): BaseSurface[] {\n /** Compute age surfaces for a column based on unit tops and bottoms */\n const surfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const unit of units) {\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [unit.unit_id],\n units_above: [],\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [unit.unit_id],\n units_below: [],\n });\n }\n\n // Merge duplicate surfaces (same age)\n const mergedSurfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const surface of surfaces) {\n const existingSurface = mergedSurfaces.find(\n (s) => Math.abs(s.age - surface.age) < tolerance,\n );\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else {\n mergedSurfaces.push(surface);\n }\n }\n\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b) => a.age - b.age);\n\n return mergedSurfaces.map((s, i) => ({ ...s, index: i }));\n}\n\ninterface AgeDomainUnitInfo {\n t_age: number;\n b_age: number;\n units: ExtUnit[];\n}\n\nfunction getUnitsInAgeDomains(\n surfaces: BaseSurface[],\n units: ExtUnit[],\n): AgeDomainUnitInfo[] {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo: AgeDomainUnitInfo[] = [];\n for (let i = 0; i < surfaces.length - 1; i++) {\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit) => {\n return (\n unit.t_age <= topSurface.age + 0.001 &&\n unit.b_age >= bottomSurface.age - 0.001\n );\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain,\n });\n }\n return domainUnitInfo;\n}\n\nfunction proportionOfUnitInDomain(\n unit: ExtUnit,\n t_age: number,\n b_age: number,\n): number {\n // Compute the proportion of a unit's height that lies within the given age domain\n\n const rng = getUnitHeightRange(unit, ColumnAxisType.AGE);\n const rng1: [number, number] = [b_age, t_age];\n // Compute overlap\n\n const mergedRange = mergeAgeRanges([rng, rng1], MergeMode.Inner);\n\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n\n return mergedHeight / unitHeight;\n}\n\nexport function buildHybridScale<T extends UnitLong>(\n def: HybridScaleDefinition,\n units: T[],\n domain: [number, number],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n const surfaces = buildColumnSurfaces(units);\n\n const filteredSurfaces = surfaces.filter(\n (s) => s.age < Math.max(...domain) && s.age > Math.min(...domain),\n );\n\n const s1 = [\n { index: -1, age: Math.min(...domain), units_above: [], units_below: [] },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: [],\n },\n ];\n\n const { type, ...rest } = def;\n\n if (type === HybridScaleType.EquidistantSurfaces) {\n return buildScaleFromSurfacesSimple(s1, options);\n }\n\n return buildApproximateHeightScale(s1, units, { ...options, ...rest });\n}\n\nfunction getApproximateHeight(\n unit: ExtUnit,\n method: HeightMethod = HeightMethod.Maximum,\n): number | null {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === HeightMethod.Minimum || method === HeightMethod.Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === HeightMethod.Average || method === HeightMethod.Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n\n if (heights.length === 0) return null;\n\n if (method === HeightMethod.Average) {\n return heights.reduce((sum, h) => sum + h, 0) / heights.length;\n } else {\n return heights[0];\n }\n}\n\nexport function buildApproximateHeightScale(\n surfaces: BaseSurface[],\n units: UnitLong[],\n options: HybridScaleOptions & ApproxHeightScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const {\n pixelScale = 1, // pixels per meter\n pixelOffset = 0,\n minHeight = 5,\n heightMethod = HeightMethod.Maximum,\n // Default height for when height is unknown\n defaultHeight = 100,\n } = options;\n\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = getUnitsInAgeDomains(surfaces, units as ExtUnit[]);\n\n // Compute the height in pixels for each surface\n\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n\n for (const domain of domainInfo) {\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo: { unit: ExtUnit; height: number }[] = [];\n\n for (const unit of units) {\n const proportion = proportionOfUnitInDomain(\n unit,\n domain.t_age,\n domain.b_age,\n );\n const height = getApproximateHeight(unit, heightMethod);\n if (height != null) {\n unitHeightInfo.push({ unit, height: height * proportion });\n }\n }\n\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) {\n thisHeight = defaultHeight; // Default height if no units with height info\n } else {\n // Normalize weights (take the mean)\n\n const meanHeight =\n unitHeightInfo.reduce((sum, d) => sum + d.height, 0) /\n unitHeightInfo.length;\n\n if (meanHeight == 0) {\n thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n } else if (meanHeight < minHeight) {\n thisHeight = minHeight; // Minimum height\n } else {\n thisHeight = meanHeight;\n }\n }\n\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h) => h * pixelScale);\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n const heightDomain = surfaceHeights.map((h) => lastHeight - h);\n\n const heightScale = scaleLinear().domain(heightDomain).range(pixelRange);\n\n const domain: [number, number] = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0],\n ];\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale,\n };\n}\n\nexport function buildScaleFromSurfacesSimple(\n surfaces: BaseSurface[],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const { pixelScale = 30 } = options;\n\n const domain: [number, number] = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age,\n ];\n // Compute the height in pixels for each surface\n\n const surfaceHeights = surfaces.map((surface, i) => {\n return i * pixelScale;\n });\n\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s) => s.age);\n const pixelRange = surfaceHeights;\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n };\n}\n"],"names":["scaleLinear","$gr21k$scaleLinear","ColumnAxisType","$gr21k$ColumnAxisType","mergeAgeRanges","$gr21k$mergeAgeRanges","MergeMode","$gr21k$MergeMode","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$76iYI","$b83252c9fe80810e$export$151c207e6887154c","units","tolerance","surfaces","unit","push","age","t_age","units_below","unit_id","units_above","b_age","mergedSurfaces","surface","existingSurface","find","s","Math","abs","sort","a","b","map","i","index","$b83252c9fe80810e$export$6b39f1b6356d94b6","def","domain","options","filteredSurfaces","filter","max","min","s1","type","rest","HybridScaleType","EquidistantSurfaces","$b83252c9fe80810e$export$d02d2d708a7b495f","$b83252c9fe80810e$export$be7a6f1f0a23d12c","pixelScale","pixelOffset","minHeight","heightMethod","HeightMethod","Maximum","defaultHeight","domainInfo","$b83252c9fe80810e$var$getUnitsInAgeDomains","domainUnitInfo","length","topSurface","bottomSurface","unitsInDomain","surfaceHeights","ageDomain","lastHeight","unitHeightInfo","proportion","$b83252c9fe80810e$var$proportionOfUnitInDomain","rng","getUnitHeightRange","AGE","mergedRange","Inner","unitHeight","mergedHeight","height","$b83252c9fe80810e$var$getApproximateHeight","method","heights","min_thick","Minimum","Average","h","isNaN","max_thick","reduce","sum","thisHeight","meanHeight","d","pixelRange","scale","range","heightDomain","heightScale","pixelHeight","buildColumnSurfaces","buildHybridScale","buildScaleFromSurfacesSimple","buildApproximateHeightScale"],"version":3,"file":"column-views.0b3a384e.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,A,Q,e,C,K,U,A,Q,kB,C,K,+B,A,Q,kB,C,C,a,C,K,gC,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,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,CAAC,GAAW,KAAK,CAFhC,GAMjB,WAAY,KACZ,OAAA,EACA,YAAa,KAAK,GAAG,CAAC,AARL,CAQe,CAAC,AARhB,EAQ2B,MAAM,CAAG,EAAE,CAAG,AARzC,CAQmD,CAAC,EAAE,CACzE,CACF,Q,K,mB,C,K,gB,C,K,4B,C,K,2B","sources":["<anon>","packages/column-views/src/prepare-units/dynamic-scales.ts"],"sourcesContent":["import \"./column-views.dbb4a46b.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {scaleLinear as $gr21k$scaleLinear} from \"d3-scale\";\nimport {ColumnAxisType as $gr21k$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {mergeAgeRanges as $gr21k$mergeAgeRanges, MergeMode as $gr21k$MergeMode} from \"@macrostrat/stratigraphy-utils\";\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\n\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $b83252c9fe80810e$export$151c207e6887154c(units, tolerance = 0.001) {\n /** Compute age surfaces for a column based on unit tops and bottoms */ const surfaces = [];\n for (const unit of units){\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [\n unit.unit_id\n ],\n units_above: []\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [\n unit.unit_id\n ],\n units_below: []\n });\n }\n // Merge duplicate surfaces (same age)\n const mergedSurfaces = [];\n for (const surface of surfaces){\n const existingSurface = mergedSurfaces.find((s)=>Math.abs(s.age - surface.age) < tolerance);\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else mergedSurfaces.push(surface);\n }\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b)=>a.age - b.age);\n return mergedSurfaces.map((s, i)=>({\n ...s,\n index: i\n }));\n}\nfunction $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units) {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo = [];\n for(let i = 0; i < surfaces.length - 1; i++){\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit)=>{\n return unit.t_age <= topSurface.age + 0.001 && unit.b_age >= bottomSurface.age - 0.001;\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain\n });\n }\n return domainUnitInfo;\n}\nfunction $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, t_age, b_age) {\n // Compute the proportion of a unit's height that lies within the given age domain\n const rng = (0, $iWhRv.getUnitHeightRange)(unit, (0, $gr21k$ColumnAxisType).AGE);\n const rng1 = [\n b_age,\n t_age\n ];\n // Compute overlap\n const mergedRange = (0, $gr21k$mergeAgeRanges)([\n rng,\n rng1\n ], (0, $gr21k$MergeMode).Inner);\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n return mergedHeight / unitHeight;\n}\nfunction $b83252c9fe80810e$export$6b39f1b6356d94b6(def, units, domain, options = {}) {\n const surfaces = $b83252c9fe80810e$export$151c207e6887154c(units);\n const filteredSurfaces = surfaces.filter((s)=>s.age < Math.max(...domain) && s.age > Math.min(...domain));\n const s1 = [\n {\n index: -1,\n age: Math.min(...domain),\n units_above: [],\n units_below: []\n },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: []\n }\n ];\n const { type: type, ...rest } = def;\n if (type === (0, $76iYI.HybridScaleType).EquidistantSurfaces) return $b83252c9fe80810e$export$d02d2d708a7b495f(s1, options);\n return $b83252c9fe80810e$export$be7a6f1f0a23d12c(s1, units, {\n ...options,\n ...rest\n });\n}\nfunction $b83252c9fe80810e$var$getApproximateHeight(unit, method = (0, $76iYI.HeightMethod).Maximum) {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === (0, $76iYI.HeightMethod).Minimum || method === (0, $76iYI.HeightMethod).Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === (0, $76iYI.HeightMethod).Average || method === (0, $76iYI.HeightMethod).Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (heights.length === 0) return null;\n if (method === (0, $76iYI.HeightMethod).Average) return heights.reduce((sum, h)=>sum + h, 0) / heights.length;\n else return heights[0];\n}\nfunction $b83252c9fe80810e$export$be7a6f1f0a23d12c(surfaces, units, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 1, pixelOffset: pixelOffset = 0, minHeight: minHeight = 5, heightMethod: heightMethod = (0, $76iYI.HeightMethod).Maximum, defaultHeight: // Default height for when height is unknown\n defaultHeight = 100 } = options;\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = $b83252c9fe80810e$var$getUnitsInAgeDomains(surfaces, units);\n // Compute the height in pixels for each surface\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n for (const domain of domainInfo){\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo = [];\n for (const unit of units){\n const proportion = $b83252c9fe80810e$var$proportionOfUnitInDomain(unit, domain.t_age, domain.b_age);\n const height = $b83252c9fe80810e$var$getApproximateHeight(unit, heightMethod);\n if (height != null) unitHeightInfo.push({\n unit: unit,\n height: height * proportion\n });\n }\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) thisHeight = defaultHeight; // Default height if no units with height info\n else {\n // Normalize weights (take the mean)\n const meanHeight = unitHeightInfo.reduce((sum, d)=>sum + d.height, 0) / unitHeightInfo.length;\n if (meanHeight == 0) thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n else if (meanHeight < minHeight) thisHeight = minHeight; // Minimum height\n else thisHeight = meanHeight;\n }\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h)=>h * pixelScale);\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n const heightDomain = surfaceHeights.map((h)=>lastHeight - h);\n const heightScale = (0, $gr21k$scaleLinear)().domain(heightDomain).range(pixelRange);\n const domain = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0]\n ];\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale: heightScale\n };\n}\nfunction $b83252c9fe80810e$export$d02d2d708a7b495f(surfaces, options = {}) {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */ const { pixelScale: pixelScale = 30 } = options;\n const domain = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age\n ];\n // Compute the height in pixels for each surface\n const surfaceHeights = surfaces.map((surface, i)=>{\n return i * pixelScale;\n });\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s)=>s.age);\n const pixelRange = surfaceHeights;\n const scale = (0, $gr21k$scaleLinear)().domain(ageDomain).range(pixelRange);\n return {\n scale: scale,\n pixelScale: null,\n domain: domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0])\n };\n}\n\n\nexport {$b83252c9fe80810e$export$151c207e6887154c as buildColumnSurfaces, $b83252c9fe80810e$export$6b39f1b6356d94b6 as buildHybridScale, $b83252c9fe80810e$export$d02d2d708a7b495f as buildScaleFromSurfacesSimple, $b83252c9fe80810e$export$be7a6f1f0a23d12c as buildApproximateHeightScale};\n//# sourceMappingURL=column-views.5a9331a9.js.map\n","import type { UnitLong } from \"@macrostrat/api-types\";\nimport { scaleLinear } from \"d3-scale\";\nimport { getUnitHeightRange } from \"./utils\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { mergeAgeRanges, MergeMode } from \"@macrostrat/stratigraphy-utils\";\nimport type {\n ApproxHeightScaleOptions,\n ExtUnit,\n HybridScaleDefinition,\n HybridScaleOptions,\n PackageScaleInfo,\n} from \"./types\";\nimport { HybridScaleType, HeightMethod } from \"./types\";\n\ninterface BaseSurface {\n index: number;\n age: number;\n units_below: number[];\n units_above: number[];\n}\n\nexport function buildColumnSurfaces<T extends UnitLong>(\n units: T[],\n tolerance: number = 0.001,\n): BaseSurface[] {\n /** Compute age surfaces for a column based on unit tops and bottoms */\n const surfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const unit of units) {\n // Top surface\n surfaces.push({\n age: unit.t_age,\n units_below: [unit.unit_id],\n units_above: [],\n });\n // Bottom surface\n surfaces.push({\n age: unit.b_age,\n units_above: [unit.unit_id],\n units_below: [],\n });\n }\n\n // Merge duplicate surfaces (same age)\n const mergedSurfaces: Omit<BaseSurface, \"index\">[] = [];\n for (const surface of surfaces) {\n const existingSurface = mergedSurfaces.find(\n (s) => Math.abs(s.age - surface.age) < tolerance,\n );\n if (existingSurface) {\n existingSurface.units_above.push(...surface.units_above);\n existingSurface.units_below.push(...surface.units_below);\n } else {\n mergedSurfaces.push(surface);\n }\n }\n\n // Sort surfaces by age (ascending)\n mergedSurfaces.sort((a, b) => a.age - b.age);\n\n return mergedSurfaces.map((s, i) => ({ ...s, index: i }));\n}\n\ninterface AgeDomainUnitInfo {\n t_age: number;\n b_age: number;\n units: ExtUnit[];\n}\n\nfunction getUnitsInAgeDomains(\n surfaces: BaseSurface[],\n units: ExtUnit[],\n): AgeDomainUnitInfo[] {\n // Get unit IDs represented between the same surface, and the proportion of their total height represented\n const domainUnitInfo: AgeDomainUnitInfo[] = [];\n for (let i = 0; i < surfaces.length - 1; i++) {\n const topSurface = surfaces[i];\n const bottomSurface = surfaces[i + 1];\n const unitsInDomain = units.filter((unit) => {\n return (\n unit.t_age <= topSurface.age + 0.001 &&\n unit.b_age >= bottomSurface.age - 0.001\n );\n });\n domainUnitInfo.push({\n t_age: topSurface.age,\n b_age: bottomSurface.age,\n units: unitsInDomain,\n });\n }\n return domainUnitInfo;\n}\n\nfunction proportionOfUnitInDomain(\n unit: ExtUnit,\n t_age: number,\n b_age: number,\n): number {\n // Compute the proportion of a unit's height that lies within the given age domain\n\n const rng = getUnitHeightRange(unit, ColumnAxisType.AGE);\n const rng1: [number, number] = [b_age, t_age];\n // Compute overlap\n\n const mergedRange = mergeAgeRanges([rng, rng1], MergeMode.Inner);\n\n const unitHeight = Math.abs(rng[1] - rng[0]);\n const mergedHeight = Math.abs(mergedRange[1] - mergedRange[0]);\n\n return mergedHeight / unitHeight;\n}\n\nexport function buildHybridScale<T extends UnitLong>(\n def: HybridScaleDefinition,\n units: T[],\n domain: [number, number],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n const surfaces = buildColumnSurfaces(units);\n\n const filteredSurfaces = surfaces.filter(\n (s) => s.age < Math.max(...domain) && s.age > Math.min(...domain),\n );\n\n const s1 = [\n { index: -1, age: Math.min(...domain), units_above: [], units_below: [] },\n ...filteredSurfaces,\n {\n index: -1,\n age: Math.max(...domain),\n units_above: [],\n units_below: [],\n },\n ];\n\n const { type, ...rest } = def;\n\n if (type === HybridScaleType.EquidistantSurfaces) {\n return buildScaleFromSurfacesSimple(s1, options);\n }\n\n return buildApproximateHeightScale(s1, units, { ...options, ...rest });\n}\n\nfunction getApproximateHeight(\n unit: ExtUnit,\n method: HeightMethod = HeightMethod.Maximum,\n): number | null {\n // Get approximate height of a unit based on specified method\n const heights = [];\n let minHeight = unit.min_thick;\n if (method === HeightMethod.Minimum || method === HeightMethod.Average) {\n const h = unit.min_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n if (method === HeightMethod.Average || method === HeightMethod.Maximum) {\n const h = unit.max_thick;\n if (h != null && !isNaN(h) && h > 0) heights.push(h);\n }\n\n if (heights.length === 0) return null;\n\n if (method === HeightMethod.Average) {\n return heights.reduce((sum, h) => sum + h, 0) / heights.length;\n } else {\n return heights[0];\n }\n}\n\nexport function buildApproximateHeightScale(\n surfaces: BaseSurface[],\n units: UnitLong[],\n options: HybridScaleOptions & ApproxHeightScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const {\n pixelScale = 1, // pixels per meter\n pixelOffset = 0,\n minHeight = 5,\n heightMethod = HeightMethod.Maximum,\n // Default height for when height is unknown\n defaultHeight = 100,\n } = options;\n\n // Get units associated with each surface\n // Note: we could hoist this if it proved useful for other scale types\n const domainInfo = getUnitsInAgeDomains(surfaces, units as ExtUnit[]);\n\n // Compute the height in pixels for each surface\n\n const surfaceHeights = [];\n const ageDomain = [];\n let lastHeight = pixelOffset;\n\n for (const domain of domainInfo) {\n if (lastHeight == pixelOffset) {\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.t_age);\n }\n\n // Approximate height based on units in this domain\n const units = domain.units;\n let unitHeightInfo: { unit: ExtUnit; height: number }[] = [];\n\n for (const unit of units) {\n const proportion = proportionOfUnitInDomain(\n unit,\n domain.t_age,\n domain.b_age,\n );\n const height = getApproximateHeight(unit, heightMethod);\n if (height != null) {\n unitHeightInfo.push({ unit, height: height * proportion });\n }\n }\n\n let thisHeight = 0;\n if (unitHeightInfo.length === 0) {\n thisHeight = defaultHeight; // Default height if no units with height info\n } else {\n // Normalize weights (take the mean)\n\n const meanHeight =\n unitHeightInfo.reduce((sum, d) => sum + d.height, 0) /\n unitHeightInfo.length;\n\n if (meanHeight == 0) {\n thisHeight = defaultHeight; // Arbitrary height for zero-height intervals\n } else if (meanHeight < minHeight) {\n thisHeight = minHeight; // Minimum height\n } else {\n thisHeight = meanHeight;\n }\n }\n\n lastHeight += thisHeight;\n surfaceHeights.push(lastHeight);\n ageDomain.push(domain.b_age);\n }\n\n // Build a piecewise linear scale mapping age to pixel height\n const pixelRange = surfaceHeights.map((h) => h * pixelScale);\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n const heightDomain = surfaceHeights.map((h) => lastHeight - h);\n\n const heightScale = scaleLinear().domain(heightDomain).range(pixelRange);\n\n const domain: [number, number] = [\n ageDomain[ageDomain.length - 1],\n ageDomain[0],\n ];\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n heightScale,\n };\n}\n\nexport function buildScaleFromSurfacesSimple(\n surfaces: BaseSurface[],\n options: HybridScaleOptions = {},\n): PackageScaleInfo {\n /** Build a variable age scale that places age surfaces equally far apart in height space.\n * It is presumed that gaps are already removed from the unit set provided.\n * */\n\n const { pixelScale = 30 } = options;\n\n const domain: [number, number] = [\n surfaces[surfaces.length - 1].age,\n surfaces[0].age,\n ];\n // Compute the height in pixels for each surface\n\n const surfaceHeights = surfaces.map((surface, i) => {\n return i * pixelScale;\n });\n\n // Build a piecewise linear scale mapping age to pixel height\n const ageDomain = surfaces.map((s) => s.age);\n const pixelRange = surfaceHeights;\n\n const scale = scaleLinear().domain(ageDomain).range(pixelRange);\n\n return {\n scale,\n pixelScale: null, // pixels per unit\n domain,\n pixelHeight: Math.abs(pixelRange[pixelRange.length - 1] - pixelRange[0]),\n };\n}\n"],"names":["scaleLinear","$gr21k$scaleLinear","ColumnAxisType","$gr21k$ColumnAxisType","mergeAgeRanges","$gr21k$mergeAgeRanges","MergeMode","$gr21k$MergeMode","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$76iYI","$b83252c9fe80810e$export$151c207e6887154c","units","tolerance","surfaces","unit","push","age","t_age","units_below","unit_id","units_above","b_age","mergedSurfaces","surface","existingSurface","find","s","Math","abs","sort","a","b","map","i","index","$b83252c9fe80810e$export$6b39f1b6356d94b6","def","domain","options","filteredSurfaces","filter","max","min","s1","type","rest","HybridScaleType","EquidistantSurfaces","$b83252c9fe80810e$export$d02d2d708a7b495f","$b83252c9fe80810e$export$be7a6f1f0a23d12c","pixelScale","pixelOffset","minHeight","heightMethod","HeightMethod","Maximum","defaultHeight","domainInfo","$b83252c9fe80810e$var$getUnitsInAgeDomains","domainUnitInfo","length","topSurface","bottomSurface","unitsInDomain","surfaceHeights","ageDomain","lastHeight","unitHeightInfo","proportion","$b83252c9fe80810e$var$proportionOfUnitInDomain","rng","getUnitHeightRange","AGE","mergedRange","Inner","unitHeight","mergedHeight","height","$b83252c9fe80810e$var$getApproximateHeight","method","heights","min_thick","Minimum","Average","h","isNaN","max_thick","reduce","sum","thisHeight","meanHeight","d","pixelRange","scale","range","heightDomain","heightScale","pixelHeight","buildColumnSurfaces","buildHybridScale","buildScaleFromSurfacesSimple","buildApproximateHeightScale"],"version":3,"file":"column-views.5a9331a9.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ import"./column-views.021a6961.js";import"./column-views.a596b1f5.js";import"./column-views.dbb4a46b.js";import"./column-views.7f9c7448.js";import{ColumnAxisType as e}from"@macrostrat/column-components";import{useMemo as t}from"react";function o(e,t){return Object.keys(t).forEach(function(o){"default"===o||"__esModule"===o||Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[o]}})}),e}function a(e,t,o,a){Object.defineProperty(e,t,{get:o,set:a,enumerable:!0,configurable:!0})}var r=globalThis,n={},s={},i=r.parcelRequirea149;null==i&&((i=function(e){if(e in n)return n[e].exports;if(e in s){var t=s[e];delete s[e];var o={id:e,exports:{}};return n[e]=o,t.call(o.exports,o,o.exports),o.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){s[e]=t},r.parcelRequirea149=i),i.register;var c={};a(c,"usePreparedColumnUnits",()=>b),a(c,"prepareColumnUnits",()=>m),a(c,"preprocessUnits",()=>i("ickj2").preprocessUnits);var p=i("ickj2"),l=i("bBAza"),f=i("iWhRv"),u=i("76iYI");function b(e,o){return t(()=>m(e,o),[e,...Object.values(o)])}function m(t,o){let a,{t_age:r,b_age:n,t_pos:s,b_pos:i}=o,{mergeSections:c=f.MergeSectionsMode.OVERLAPPING,axisType:u,unconformityHeight:b,collapseSmallUnconformities:m=!1,hybridScale:g,scale:$}=o,d=null;if(null!=$){let t=$.domain();u==e.AGE?(null==r&&(r=Math.min(...t)),null==n&&(n=Math.max(...t)),d=Math.abs($(n)-$(r))):(null==s&&(s=Math.min(...t)),null==i&&(i=Math.max(...t)),d=Math.abs($(i)-$(s)))}let _=t.map(p.preprocessSectionUnit);if(_=_.filter(t=>u==e.AGE?(0,f.agesOverlap)(t,{t_age:r,b_age:n}):(0,f.unitsOverlap)(t,{t_pos:s,b_pos:i},u)),c==f.MergeSectionsMode.ALL){let[e,t]=(0,p.getSectionPosRange)(_,u),[o,r]=(0,p.getSectionAgeRange)(_);a=[{section_id:0,t_pos:t,b_pos:e,t_age:r,b_age:o,units:_}]}else a=u==e.AGE?(0,p.groupUnitsIntoSectionsBySectionID)(_,u):(0,p.groupUnitsIntoSectionsByOverlap)(_,u);for(let t of a)u==e.AGE?(t.t_age=Math.max(t.t_age,r??-1/0),t.b_age=Math.min(t.b_age,n??1/0)):u==e.DEPTH?(t.t_pos=Math.max(t.t_pos,s??-1/0),t.b_pos=Math.min(t.b_pos,i??1/0)):u==e.HEIGHT&&(t.t_pos=Math.max(t.t_pos,s??-1/0),t.b_pos=Math.min(t.b_pos,i??1/0));let h=a;c==f.MergeSectionsMode.OVERLAPPING&&u==e.AGE&&(h=(0,p.mergeOverlappingSections)(h)),h=h.filter(e=>null!=e);let x=(0,l.computeSectionHeights)(h,o);if(m&&null==g){let e=b??30;"number"==typeof m&&(e=m),x=(0,l.collapseUnconformitiesByPixelHeight)(x,e,o)}let{totalHeight:M,sections:S}=(0,l.finalizeSectionHeights)(x,b),H=S.map(e=>({...e,units:(0,p.preprocessUnits)(e,u)}));return{units:H.reduce((e,t)=>{let{units:o}=t;for(let t of o)e.push(t);return e},[]),totalHeight:d??M,sections:H}}o(c,f),o(c,u);export{b as usePreparedColumnUnits,m as prepareColumnUnits,$57278f42f24b59e5$export$55543e159517d62d as preprocessUnits,$f811753598b339f3$export$e1644389ce074058 as MergeSectionsMode,$f811753598b339f3$export$f1a15f539858307 as unitsOverlap,$f811753598b339f3$export$70e712e2ac0237a as getUnitHeightRange,$f811753598b339f3$export$d92a67740c050efb as agesOverlap,$f811753598b339f3$export$441710fb21b4ae09 as getPositionWithinUnit,$f811753598b339f3$export$ab14c04795685c55 as createUnitSorter,$f811753598b339f3$export$d0c8ecbd4ed8940c as ensureArray,$f811753598b339f3$export$97de5b0a6b4e4dac as ensureRealFloat,$6a8fb6360a4f5dac$export$45e8e2d7a1794c23 as HybridScaleType,$6a8fb6360a4f5dac$export$e40aae6f0de9bb95 as HeightMethod};
2
+ //# sourceMappingURL=column-views.5fd6e11a.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,O,6C,A,Q,kB,C,K,+B,A,Q,W,C,K,O,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G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C,Y,C,4C,kB,C,6C,W,C,6C,qB,C,6C,gB,C,6C,W,C,6C,e,C,6C,e,C,6C,Y","sources":["<anon>","packages/column-views/src/prepare-units/index.ts"],"sourcesContent":["import \"./column-views.021a6961.js\";\nimport \"./column-views.a596b1f5.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport \"./column-views.7f9c7448.js\";\nimport {ColumnAxisType as $7dPhe$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {useMemo as $7dPhe$useMemo} from \"react\";\n\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $031426a894870747$exports = {};\n\n$parcel$export($031426a894870747$exports, \"usePreparedColumnUnits\", () => $031426a894870747$export$206a0cb85295e433);\n$parcel$export($031426a894870747$exports, \"prepareColumnUnits\", () => $031426a894870747$export$be8c5a449df4bde4);\n$parcel$export($031426a894870747$exports, \"preprocessUnits\", () => (parcelRequire(\"ickj2\")).preprocessUnits);\n\nvar $ickj2 = parcelRequire(\"ickj2\");\n\n\n\nvar $bBAza = parcelRequire(\"bBAza\");\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\nvar $76iYI = parcelRequire(\"76iYI\");\nfunction $031426a894870747$export$206a0cb85295e433(data, options) {\n /** This function wraps and memoizes all preparation steps for converting\n * an array of units from the /units route to a form ready for usage.\n */ return (0, $7dPhe$useMemo)(()=>{\n return $031426a894870747$export$be8c5a449df4bde4(data, options);\n }, [\n data,\n ...Object.values(options)\n ]);\n}\nfunction $031426a894870747$export$be8c5a449df4bde4(units, options) {\n /** Prepare units for rendering into Macrostrat columns */ let { t_age: t_age, b_age: b_age, t_pos: t_pos, b_pos: b_pos } = options;\n const { mergeSections: mergeSections = (0, $iWhRv.MergeSectionsMode).OVERLAPPING, axisType: axisType, unconformityHeight: unconformityHeight, collapseSmallUnconformities: collapseSmallUnconformities = false, hybridScale: hybridScale, scale: scale } = options;\n let _totalHeight = null;\n if (scale != null) {\n // Set t_age and b_age based on scale domain if not already set\n const domain = scale.domain();\n if (axisType == (0, $7dPhe$ColumnAxisType).AGE) {\n if (t_age == null) t_age = Math.min(...domain);\n if (b_age == null) b_age = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_age) - scale(t_age));\n } else {\n if (t_pos == null) t_pos = Math.min(...domain);\n if (b_pos == null) b_pos = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_pos) - scale(t_pos));\n }\n }\n // Start by ensuring that ages and positions are numbers\n // also set up some values for eODP-style columns\n let units1 = units.map((0, $ickj2.preprocessSectionUnit));\n /** Prototype filtering to age range */ units1 = units1.filter((d)=>{\n // Filter units by t_age and b_age, inclusive\n if (axisType == (0, $7dPhe$ColumnAxisType).AGE) return (0, $iWhRv.agesOverlap)(d, {\n t_age: t_age,\n b_age: b_age\n });\n else return (0, $iWhRv.unitsOverlap)(d, {\n t_pos: t_pos,\n b_pos: b_pos\n }, axisType);\n });\n let mergeMode = mergeSections;\n // if (axisType != ColumnAxisType.AGE) {\n // // For non-age columns, we always merge sections.\n // // This is because the \"groupUnitsIntoSections\" function is not well-defined\n // // for non-age columns.\n // mergeMode = MergeSectionsMode.ALL;\n // }\n let sections0;\n if (mergeMode == (0, $iWhRv.MergeSectionsMode).ALL) {\n // For the \"merge sections\" mode, we need to create a single section\n const [b_unit_pos, t_unit_pos] = (0, $ickj2.getSectionPosRange)(units1, axisType);\n const [b_unit_age, t_unit_age] = (0, $ickj2.getSectionAgeRange)(units1);\n sections0 = [\n {\n section_id: 0,\n /**\n * If ages limits are directly specified, use them to define the section bounds.\n * */ t_pos: t_unit_pos,\n b_pos: b_unit_pos,\n t_age: t_unit_age,\n b_age: b_unit_age,\n units: units1\n }\n ];\n } else if (axisType == (0, $7dPhe$ColumnAxisType).AGE) sections0 = (0, $ickj2.groupUnitsIntoSectionsBySectionID)(units1, axisType);\n else sections0 = (0, $ickj2.groupUnitsIntoSectionsByOverlap)(units1, axisType);\n // Limit sections to the range specified by t_age/b_age or t_pos/b_pos global options\n for (let section of sections0){\n if (axisType == (0, $7dPhe$ColumnAxisType).AGE) {\n section.t_age = Math.max(section.t_age, t_age ?? -Infinity);\n section.b_age = Math.min(section.b_age, b_age ?? Infinity);\n } else if (axisType == (0, $7dPhe$ColumnAxisType).DEPTH) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n } else if (axisType == (0, $7dPhe$ColumnAxisType).HEIGHT) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n }\n }\n /** Merging overlapping sections really only makes sense for age/height/depth\n * columns. Ordinal columns are numbered by section so merging them\n * results in collisions.\n */ let sections = sections0;\n if (mergeSections == (0, $iWhRv.MergeSectionsMode).OVERLAPPING && axisType == (0, $7dPhe$ColumnAxisType).AGE) sections = (0, $ickj2.mergeOverlappingSections)(sections);\n // Filter out undefined sections just in case\n sections = sections.filter((d)=>d != null);\n // SCALES\n /* Compute pixel scales etc. for sections\n * We need to do this now to determine which unconformities\n * are small enough to collapse.\n */ let sectionsWithScales = (0, $bBAza.computeSectionHeights)(sections, options);\n if (collapseSmallUnconformities && hybridScale == null) {\n // Collapse small unconformities in pixel height space\n // TODO: this doesn't seem to work properly for non-age columns?\n let threshold = unconformityHeight ?? 30;\n if (typeof collapseSmallUnconformities == \"number\") threshold = collapseSmallUnconformities;\n sectionsWithScales = (0, $bBAza.collapseUnconformitiesByPixelHeight)(sectionsWithScales, threshold, options);\n }\n /** Prepare section scale information using groups.\n * Total height is computed from section scales.\n * */ let { totalHeight: totalHeight, sections: sections2 } = (0, $bBAza.finalizeSectionHeights)(sectionsWithScales, unconformityHeight);\n /** For each section, find units that are overlapping.\n * We do this after merging sections so that we can\n * handle cases where there are overlapping units across sections\n * */ const sectionsOut = sections2.map((section)=>{\n return {\n ...section,\n units: (0, $ickj2.preprocessUnits)(section, axisType)\n };\n });\n /** Reconstitute the units so that they are sorted by section and properly enhanced.\n * This is mostly important so that unit keyboard navigation\n * predictably selects adjacent units.\n */ const units2 = sectionsOut.reduce((acc, group)=>{\n const { units: units } = group;\n for (const unit of units)acc.push(unit);\n return acc;\n }, []);\n return {\n units: units2,\n totalHeight: _totalHeight ?? totalHeight,\n sections: sectionsOut\n };\n}\n$parcel$exportWildcard($031426a894870747$exports, $iWhRv);\n$parcel$exportWildcard($031426a894870747$exports, $76iYI);\n\n\nexport {$031426a894870747$export$206a0cb85295e433 as usePreparedColumnUnits, $031426a894870747$export$be8c5a449df4bde4 as prepareColumnUnits, $57278f42f24b59e5$export$55543e159517d62d as preprocessUnits, $f811753598b339f3$export$e1644389ce074058 as MergeSectionsMode, $f811753598b339f3$export$f1a15f539858307 as unitsOverlap, $f811753598b339f3$export$70e712e2ac0237a as getUnitHeightRange, $f811753598b339f3$export$d92a67740c050efb as agesOverlap, $f811753598b339f3$export$441710fb21b4ae09 as getPositionWithinUnit, $f811753598b339f3$export$ab14c04795685c55 as createUnitSorter, $f811753598b339f3$export$d0c8ecbd4ed8940c as ensureArray, $f811753598b339f3$export$97de5b0a6b4e4dac as ensureRealFloat, $6a8fb6360a4f5dac$export$45e8e2d7a1794c23 as HybridScaleType, $6a8fb6360a4f5dac$export$e40aae6f0de9bb95 as HeightMethod};\n//# sourceMappingURL=column-views.5fd6e11a.js.map\n","import {\n getSectionAgeRange,\n getSectionPosRange,\n groupUnitsIntoSectionsByOverlap,\n groupUnitsIntoSectionsBySectionID,\n mergeOverlappingSections,\n preprocessSectionUnit,\n preprocessUnits,\n} from \"./helpers\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport { useMemo } from \"react\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport {\n collapseUnconformitiesByPixelHeight,\n computeSectionHeights,\n finalizeSectionHeights,\n} from \"./composite-scale\";\nimport {\n agesOverlap,\n MergeSectionsMode,\n PrepareColumnOptions,\n PreparedColumnData,\n unitsOverlap,\n} from \"./utils\";\nimport { SectionInfo } from \"./types\";\n\nexport * from \"./utils\";\nexport * from \"./types\";\nexport { preprocessUnits };\n\nexport function usePreparedColumnUnits(\n data: UnitLong[],\n options: PrepareColumnOptions,\n): PreparedColumnData {\n /** This function wraps and memoizes all preparation steps for converting\n * an array of units from the /units route to a form ready for usage.\n */\n return useMemo(() => {\n return prepareColumnUnits(data, options);\n }, [data, ...Object.values(options)]);\n}\n\nexport function prepareColumnUnits(\n units: UnitLong[],\n options: PrepareColumnOptions,\n): PreparedColumnData {\n /** Prepare units for rendering into Macrostrat columns */\n\n let { t_age, b_age, t_pos, b_pos } = options;\n\n const {\n mergeSections = MergeSectionsMode.OVERLAPPING,\n axisType,\n unconformityHeight,\n collapseSmallUnconformities = false,\n hybridScale,\n scale,\n } = options;\n\n let _totalHeight = null;\n\n if (scale != null) {\n // Set t_age and b_age based on scale domain if not already set\n const domain = scale.domain();\n if (axisType == ColumnAxisType.AGE) {\n if (t_age == null) t_age = Math.min(...domain);\n if (b_age == null) b_age = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_age) - scale(t_age));\n } else {\n if (t_pos == null) t_pos = Math.min(...domain);\n if (b_pos == null) b_pos = Math.max(...domain);\n _totalHeight = Math.abs(scale(b_pos) - scale(t_pos));\n }\n }\n\n // Start by ensuring that ages and positions are numbers\n // also set up some values for eODP-style columns\n let units1 = units.map(preprocessSectionUnit);\n\n /** Prototype filtering to age range */\n units1 = units1.filter((d) => {\n // Filter units by t_age and b_age, inclusive\n if (axisType == ColumnAxisType.AGE) {\n return agesOverlap(d, { t_age, b_age });\n } else {\n return unitsOverlap(d, { t_pos, b_pos } as any, axisType);\n }\n });\n\n let mergeMode = mergeSections;\n // if (axisType != ColumnAxisType.AGE) {\n // // For non-age columns, we always merge sections.\n // // This is because the \"groupUnitsIntoSections\" function is not well-defined\n // // for non-age columns.\n // mergeMode = MergeSectionsMode.ALL;\n // }\n\n let sections0: SectionInfo<UnitLong>[];\n if (mergeMode == MergeSectionsMode.ALL) {\n // For the \"merge sections\" mode, we need to create a single section\n const [b_unit_pos, t_unit_pos] = getSectionPosRange(units1, axisType);\n const [b_unit_age, t_unit_age] = getSectionAgeRange(units1);\n sections0 = [\n {\n section_id: 0,\n /**\n * If ages limits are directly specified, use them to define the section bounds.\n * */\n t_pos: t_unit_pos,\n b_pos: b_unit_pos,\n t_age: t_unit_age,\n b_age: b_unit_age,\n units: units1,\n },\n ];\n } else if (axisType == ColumnAxisType.AGE) {\n sections0 = groupUnitsIntoSectionsBySectionID(units1, axisType);\n } else {\n sections0 = groupUnitsIntoSectionsByOverlap(units1, axisType);\n }\n\n // Limit sections to the range specified by t_age/b_age or t_pos/b_pos global options\n for (let section of sections0) {\n if (axisType == ColumnAxisType.AGE) {\n section.t_age = Math.max(section.t_age, t_age ?? -Infinity);\n section.b_age = Math.min(section.b_age, b_age ?? Infinity);\n } else if (axisType == ColumnAxisType.DEPTH) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n } else if (axisType == ColumnAxisType.HEIGHT) {\n section.t_pos = Math.max(section.t_pos, t_pos ?? -Infinity);\n section.b_pos = Math.min(section.b_pos, b_pos ?? Infinity);\n }\n }\n\n /** Merging overlapping sections really only makes sense for age/height/depth\n * columns. Ordinal columns are numbered by section so merging them\n * results in collisions.\n */\n let sections = sections0;\n if (\n mergeSections == MergeSectionsMode.OVERLAPPING &&\n axisType == ColumnAxisType.AGE\n ) {\n sections = mergeOverlappingSections(sections);\n }\n // Filter out undefined sections just in case\n sections = sections.filter((d) => d != null);\n\n // SCALES\n\n /* Compute pixel scales etc. for sections\n * We need to do this now to determine which unconformities\n * are small enough to collapse.\n */\n let sectionsWithScales = computeSectionHeights(sections, options);\n\n if (collapseSmallUnconformities && hybridScale == null) {\n // Collapse small unconformities in pixel height space\n // TODO: this doesn't seem to work properly for non-age columns?\n let threshold = unconformityHeight ?? 30;\n if (typeof collapseSmallUnconformities == \"number\") {\n threshold = collapseSmallUnconformities;\n }\n\n sectionsWithScales = collapseUnconformitiesByPixelHeight(\n sectionsWithScales,\n threshold,\n options,\n );\n }\n\n /** Prepare section scale information using groups.\n * Total height is computed from section scales.\n * */\n let { totalHeight, sections: sections2 } = finalizeSectionHeights(\n sectionsWithScales,\n unconformityHeight,\n );\n\n /** For each section, find units that are overlapping.\n * We do this after merging sections so that we can\n * handle cases where there are overlapping units across sections\n * */\n const sectionsOut = sections2.map((section) => {\n return {\n ...section,\n units: preprocessUnits(section, axisType),\n };\n });\n\n /** Reconstitute the units so that they are sorted by section and properly enhanced.\n * This is mostly important so that unit keyboard navigation\n * predictably selects adjacent units.\n */\n const units2 = sectionsOut.reduce((acc, group) => {\n const { units } = group;\n for (const unit of units) {\n acc.push(unit);\n }\n return acc;\n }, []);\n\n return {\n units: units2,\n totalHeight: _totalHeight ?? totalHeight,\n sections: sectionsOut,\n };\n}\n"],"names":["ColumnAxisType","$7dPhe$ColumnAxisType","useMemo","$7dPhe$useMemo","$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$export","e","n","v","s","set","configurable","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$031426a894870747$exports","$031426a894870747$export$206a0cb85295e433","$031426a894870747$export$be8c5a449df4bde4","preprocessUnits","$ickj2","$bBAza","$iWhRv","$76iYI","data","options","values","units","sections0","t_age","b_age","t_pos","b_pos","mergeSections","MergeSectionsMode","OVERLAPPING","axisType","unconformityHeight","collapseSmallUnconformities","hybridScale","scale","_totalHeight","domain","AGE","Math","min","max","abs","units1","map","preprocessSectionUnit","filter","d","agesOverlap","unitsOverlap","mergeMode","ALL","b_unit_pos","t_unit_pos","getSectionPosRange","b_unit_age","t_unit_age","getSectionAgeRange","section_id","groupUnitsIntoSectionsBySectionID","groupUnitsIntoSectionsByOverlap","section","Infinity","DEPTH","HEIGHT","sections","mergeOverlappingSections","sectionsWithScales","computeSectionHeights","threshold","collapseUnconformitiesByPixelHeight","totalHeight","sections2","finalizeSectionHeights","sectionsOut","reduce","acc","group","unit","push","usePreparedColumnUnits","prepareColumnUnits","$57278f42f24b59e5$export$55543e159517d62d","$f811753598b339f3$export$e1644389ce074058","$f811753598b339f3$export$f1a15f539858307","$f811753598b339f3$export$70e712e2ac0237a","getUnitHeightRange","$f811753598b339f3$export$d92a67740c050efb","$f811753598b339f3$export$441710fb21b4ae09","getPositionWithinUnit","$f811753598b339f3$export$ab14c04795685c55","createUnitSorter","$f811753598b339f3$export$d0c8ecbd4ed8940c","ensureArray","$f811753598b339f3$export$97de5b0a6b4e4dac","ensureRealFloat","$6a8fb6360a4f5dac$export$45e8e2d7a1794c23","HybridScaleType","$6a8fb6360a4f5dac$export$e40aae6f0de9bb95","HeightMethod"],"version":3,"file":"column-views.5fd6e11a.js.map","sourceRoot":"../../../../"}