@macrostrat/column-views 2.2.1 → 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 (295) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/esm/{column-views.c2fbcba8.js → column-views.04636815.js} +4 -4
  3. package/dist/esm/{column-views.c2fbcba8.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.60365cdb.js → column-views.0da4503a.js} +2 -2
  7. package/dist/esm/{column-views.60365cdb.js.map → column-views.0da4503a.js.map} +1 -1
  8. package/dist/esm/{column-views.53722d0a.js → column-views.107b47b4.js} +9 -9
  9. package/dist/esm/{column-views.53722d0a.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.29a551f6.js → column-views.2708e176.js} +22 -16
  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.d86555b0.js → column-views.2bac03a2.js} +2 -2
  19. package/dist/esm/{column-views.d86555b0.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.418f948f.js.map → column-views.3c9cba65.js.map} +1 -1
  26. package/dist/esm/{column-views.c3495702.js → column-views.3d3e00be.js} +2 -2
  27. package/dist/esm/{column-views.c3495702.js.map → column-views.3d3e00be.js.map} +1 -1
  28. package/dist/esm/{column-views.e1bc3cfa.js → column-views.40094dd9.js} +3 -3
  29. package/dist/esm/{column-views.e1bc3cfa.js.map → column-views.40094dd9.js.map} +1 -1
  30. package/dist/esm/{column-views.787d7696.js → column-views.44373a90.js} +8 -7
  31. package/dist/esm/column-views.44373a90.js.map +1 -0
  32. package/dist/esm/{column-views.8b623b27.js → column-views.488f24b6.js} +2 -2
  33. package/dist/esm/{column-views.8b623b27.js.map → column-views.488f24b6.js.map} +1 -1
  34. package/dist/esm/{column-views.4ed90896.js → column-views.4b259f9e.js} +42 -11
  35. package/dist/esm/column-views.4b259f9e.js.map +1 -0
  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.382c486d.js → column-views.565b193a.js} +3 -3
  39. package/dist/esm/{column-views.382c486d.js.map → column-views.565b193a.js.map} +1 -1
  40. package/dist/esm/{column-views.df34441c.js → column-views.5ca2b219.js} +5 -5
  41. package/dist/esm/{column-views.df34441c.js.map → column-views.5ca2b219.js.map} +1 -1
  42. package/dist/esm/{column-views.8284c3a9.js → column-views.5eb4e6ff.js} +5 -5
  43. package/dist/esm/{column-views.8284c3a9.js.map → column-views.5eb4e6ff.js.map} +1 -1
  44. package/dist/esm/{column-views.2e854496.js → column-views.5fff0716.js} +3 -3
  45. package/dist/esm/{column-views.2e854496.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.7683bb52.js → column-views.63d40878.js} +5 -5
  49. package/dist/esm/{column-views.7683bb52.js.map → column-views.63d40878.js.map} +1 -1
  50. package/dist/esm/{column-views.abeab9aa.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.adec2e4c.js → column-views.92575b87.js} +3 -3
  59. package/dist/esm/column-views.92575b87.js.map +1 -0
  60. package/dist/esm/{column-views.41e5f0dc.js → column-views.9d51a5ab.js} +3 -3
  61. package/dist/esm/{column-views.41e5f0dc.js.map → column-views.9d51a5ab.js.map} +1 -1
  62. package/dist/esm/{column-views.0ce9b697.js → column-views.9ffc089b.js} +3 -3
  63. package/dist/esm/{column-views.0ce9b697.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.413217dc.js → column-views.ad2fe46c.js} +2 -2
  67. package/dist/esm/{column-views.413217dc.js.map → column-views.ad2fe46c.js.map} +1 -1
  68. package/dist/esm/{column-views.0265cf7f.js → column-views.afe0bb48.js} +15 -10
  69. package/dist/esm/column-views.afe0bb48.js.map +1 -0
  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.469a4952.js → column-views.c149f7a5.js} +3 -3
  73. package/dist/esm/{column-views.469a4952.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.a3fabf0f.js → column-views.c44febd0.js} +9 -6
  77. package/dist/esm/column-views.c44febd0.js.map +1 -0
  78. package/dist/esm/{column-views.b7016f82.css → column-views.cb6fc808.css} +10 -10
  79. package/dist/esm/column-views.cb6fc808.css.map +1 -0
  80. package/dist/esm/column-views.cc733361.js.map +1 -1
  81. package/dist/esm/{column-views.f0b0fc56.js → column-views.ce3a3ac8.js} +2 -2
  82. package/dist/esm/{column-views.f0b0fc56.js.map → column-views.ce3a3ac8.js.map} +1 -1
  83. package/dist/esm/{column-views.b08d82e6.js → column-views.d1b49f5c.js} +2 -2
  84. package/dist/esm/{column-views.b08d82e6.js.map → column-views.d1b49f5c.js.map} +1 -1
  85. package/dist/esm/{column-views.2aef5df8.js → column-views.d524075b.js} +4 -4
  86. package/dist/esm/{column-views.2aef5df8.js.map → column-views.d524075b.js.map} +1 -1
  87. package/dist/esm/column-views.d5e788e8.js +31 -0
  88. package/dist/esm/column-views.d5e788e8.js.map +1 -0
  89. package/dist/esm/{column-views.bbc77227.js → column-views.d6c0b7bc.js} +2 -2
  90. package/dist/esm/{column-views.bbc77227.js.map → column-views.d6c0b7bc.js.map} +1 -1
  91. package/dist/esm/{column-views.b29f8718.js → column-views.dc195174.js} +2 -2
  92. package/dist/esm/{column-views.b29f8718.js.map → column-views.dc195174.js.map} +1 -1
  93. package/dist/esm/column-views.de433f18.js +139 -0
  94. package/dist/esm/column-views.de433f18.js.map +1 -0
  95. package/dist/esm/{column-views.2eceafb5.js → column-views.e075af15.js} +2 -2
  96. package/dist/esm/{column-views.2eceafb5.js.map → column-views.e075af15.js.map} +1 -1
  97. package/dist/esm/{column-views.e33ac5c9.css → column-views.e93478c3.css} +7 -2
  98. package/dist/esm/column-views.e93478c3.css.map +1 -0
  99. package/dist/esm/{column-views.cae1a6a1.js → column-views.f7cdf6be.js} +3 -3
  100. package/dist/esm/{column-views.cae1a6a1.js.map → column-views.f7cdf6be.js.map} +1 -1
  101. package/dist/esm/{column-views.81bddbee.js → column-views.faa7e52e.js} +4 -4
  102. package/dist/esm/{column-views.81bddbee.js.map → column-views.faa7e52e.js.map} +1 -1
  103. package/dist/esm/index.d.ts +43 -20
  104. package/dist/esm/index.d.ts.map +1 -1
  105. package/dist/esm/index.js +12 -12
  106. package/dist/node/column-views.012fa10c.js +2 -0
  107. package/dist/node/column-views.012fa10c.js.map +1 -0
  108. package/dist/node/{column-views.edb4ba54.js → column-views.021a6961.js} +2 -2
  109. package/dist/node/{column-views.edb4ba54.js.map → column-views.021a6961.js.map} +1 -1
  110. package/dist/node/{column-views.f1ad131a.js → column-views.08bef1f6.js} +2 -2
  111. package/dist/node/{column-views.f1ad131a.js.map → column-views.08bef1f6.js.map} +1 -1
  112. package/dist/node/column-views.0beae29d.js +2 -0
  113. package/dist/node/column-views.0beae29d.js.map +1 -0
  114. package/dist/node/{column-views.6b8424fd.js → column-views.0f401891.js} +2 -2
  115. package/dist/node/{column-views.6b8424fd.js.map → column-views.0f401891.js.map} +1 -1
  116. package/dist/node/column-views.1d064426.js +2 -0
  117. package/dist/node/column-views.1d064426.js.map +1 -0
  118. package/dist/node/{column-views.ce5904a6.js → column-views.2577dec0.js} +2 -2
  119. package/dist/node/{column-views.ce5904a6.js.map → column-views.2577dec0.js.map} +1 -1
  120. package/dist/node/{column-views.45a03acc.js → column-views.2fe8feb9.js} +2 -2
  121. package/dist/node/{column-views.45a03acc.js.map → column-views.2fe8feb9.js.map} +1 -1
  122. package/dist/node/{column-views.ebe61439.js → column-views.42bc66a8.js} +2 -2
  123. package/dist/node/{column-views.ebe61439.js.map → column-views.42bc66a8.js.map} +1 -1
  124. package/dist/node/{column-views.ae9536b3.js → column-views.465e593b.js} +2 -2
  125. package/dist/node/{column-views.ae9536b3.js.map → column-views.465e593b.js.map} +1 -1
  126. package/dist/node/column-views.46efb749.js +2 -0
  127. package/dist/node/column-views.46efb749.js.map +1 -0
  128. package/dist/node/{column-views.554d44a7.js → column-views.47440961.js} +2 -2
  129. package/dist/node/{column-views.554d44a7.js.map → column-views.47440961.js.map} +1 -1
  130. package/dist/node/column-views.5361f0e2.js +2 -0
  131. package/dist/node/column-views.5361f0e2.js.map +1 -0
  132. package/dist/node/{column-views.f0f5cefd.js → column-views.5559de6a.js} +2 -2
  133. package/dist/node/{column-views.f0f5cefd.js.map → column-views.5559de6a.js.map} +1 -1
  134. package/dist/node/column-views.56f88b8c.js +2 -0
  135. package/dist/node/column-views.56f88b8c.js.map +1 -0
  136. package/dist/node/{column-views.0b3a384e.js → column-views.5a9331a9.js} +2 -2
  137. package/dist/node/{column-views.0b3a384e.js.map → column-views.5a9331a9.js.map} +1 -1
  138. package/dist/node/column-views.5fd6e11a.js +2 -0
  139. package/dist/node/column-views.5fd6e11a.js.map +1 -0
  140. package/dist/node/column-views.672b683c.js +2 -0
  141. package/dist/node/column-views.672b683c.js.map +1 -0
  142. package/dist/node/{column-views.07c503d3.js → column-views.6c7f9245.js} +2 -2
  143. package/dist/node/column-views.6c7f9245.js.map +1 -0
  144. package/dist/node/{column-views.4b4c214a.js → column-views.75456275.js} +2 -2
  145. package/dist/node/{column-views.4b4c214a.js.map → column-views.75456275.js.map} +1 -1
  146. package/dist/node/column-views.75ba0464.css +2 -0
  147. package/dist/node/column-views.75ba0464.css.map +1 -0
  148. package/dist/node/column-views.777b9bb6.js +2 -0
  149. package/dist/node/column-views.777b9bb6.js.map +1 -0
  150. package/dist/node/{column-views.93febe9b.js → column-views.7c322202.js} +2 -2
  151. package/dist/node/{column-views.93febe9b.js.map → column-views.7c322202.js.map} +1 -1
  152. package/dist/node/column-views.7cc1a14f.js +2 -0
  153. package/dist/node/column-views.7cc1a14f.js.map +1 -0
  154. package/dist/node/{column-views.fcdc74c4.js → column-views.8e846c57.js} +2 -2
  155. package/dist/node/{column-views.fcdc74c4.js.map → column-views.8e846c57.js.map} +1 -1
  156. package/dist/node/{column-views.6919fd2a.js → column-views.8ee8469d.js} +2 -2
  157. package/dist/node/{column-views.6919fd2a.js.map → column-views.8ee8469d.js.map} +1 -1
  158. package/dist/node/{column-views.588b02a1.js → column-views.93bde6c1.js} +2 -2
  159. package/dist/node/{column-views.588b02a1.js.map → column-views.93bde6c1.js.map} +1 -1
  160. package/dist/node/{column-views.94c84716.js → column-views.a14f0134.js} +2 -2
  161. package/dist/node/{column-views.94c84716.js.map → column-views.a14f0134.js.map} +1 -1
  162. package/dist/node/{column-views.aef76eee.js → column-views.a596b1f5.js} +2 -2
  163. package/dist/node/{column-views.aef76eee.js.map → column-views.a596b1f5.js.map} +1 -1
  164. package/dist/node/column-views.af480651.js +2 -0
  165. package/dist/node/column-views.af480651.js.map +1 -0
  166. package/dist/node/column-views.b103acbc.js +2 -0
  167. package/dist/node/column-views.b103acbc.js.map +1 -0
  168. package/dist/node/column-views.b40c1b9c.js +2 -0
  169. package/dist/node/column-views.b40c1b9c.js.map +1 -0
  170. package/dist/node/column-views.b6e86cf0.js +2 -0
  171. package/dist/node/column-views.b6e86cf0.js.map +1 -0
  172. package/dist/node/{column-views.6099a3a9.js → column-views.c007152b.js} +2 -2
  173. package/dist/node/{column-views.6099a3a9.js.map → column-views.c007152b.js.map} +1 -1
  174. package/dist/node/{column-views.db4ccacc.js → column-views.c921fa1a.js} +2 -2
  175. package/dist/node/{column-views.db4ccacc.js.map → column-views.c921fa1a.js.map} +1 -1
  176. package/dist/node/{column-views.a1e29a15.js → column-views.c9880a4d.js} +2 -2
  177. package/dist/node/{column-views.a1e29a15.js.map → column-views.c9880a4d.js.map} +1 -1
  178. package/dist/node/column-views.ccfb9afb.css +2 -0
  179. package/dist/node/column-views.ccfb9afb.css.map +1 -0
  180. package/dist/node/{column-views.32344397.js → column-views.cd54f1b1.js} +2 -2
  181. package/dist/node/{column-views.32344397.js.map → column-views.cd54f1b1.js.map} +1 -1
  182. package/dist/node/{column-views.0201566d.js → column-views.d77d260b.js} +2 -2
  183. package/dist/node/{column-views.0201566d.js.map → column-views.d77d260b.js.map} +1 -1
  184. package/dist/node/{column-views.54363c13.js → column-views.d818b387.js} +2 -2
  185. package/dist/node/{column-views.54363c13.js.map → column-views.d818b387.js.map} +1 -1
  186. package/dist/node/{column-views.29483479.js → column-views.d8821a96.js} +2 -2
  187. package/dist/node/{column-views.29483479.js.map → column-views.d8821a96.js.map} +1 -1
  188. package/dist/node/column-views.dbb4a46b.js +2 -0
  189. package/dist/node/column-views.dbb4a46b.js.map +1 -0
  190. package/dist/node/{column-views.e803e4ae.css → column-views.ddc6184e.css} +2 -2
  191. package/dist/node/column-views.ddc6184e.css.map +1 -0
  192. package/dist/node/{column-views.44952ae6.js → column-views.e264a767.js} +2 -2
  193. package/dist/node/{column-views.44952ae6.js.map → column-views.e264a767.js.map} +1 -1
  194. package/dist/node/column-views.e93b3bdb.js +2 -0
  195. package/dist/node/column-views.e93b3bdb.js.map +1 -0
  196. package/dist/node/{column-views.57dd069c.js → column-views.ec691859.js} +2 -2
  197. package/dist/node/{column-views.57dd069c.js.map → column-views.ec691859.js.map} +1 -1
  198. package/dist/node/column-views.ec7cc7cc.js +2 -0
  199. package/dist/node/column-views.ec7cc7cc.js.map +1 -0
  200. package/dist/node/{column-views.aae09aca.js → column-views.eecdc727.js} +2 -2
  201. package/dist/node/{column-views.aae09aca.js.map → column-views.eecdc727.js.map} +1 -1
  202. package/dist/node/{column-views.108db52e.js → column-views.f577d065.js} +2 -2
  203. package/dist/node/{column-views.108db52e.js.map → column-views.f577d065.js.map} +1 -1
  204. package/dist/node/column-views.fac4baff.js +2 -0
  205. package/dist/node/column-views.fac4baff.js.map +1 -0
  206. package/dist/node/index.js +1 -1
  207. package/dist/node/index.js.map +1 -1
  208. package/package.json +2 -2
  209. package/src/age-axis.ts +1 -1
  210. package/src/column.module.sass +7 -5
  211. package/src/column.ts +29 -7
  212. package/src/correlation-chart/stories/correlation-chart.stories.ts +1 -1
  213. package/src/data-provider/store.ts +48 -5
  214. package/src/data-provider/unit-selection.ts +1 -0
  215. package/src/facets/detrital-zircon/index.ts +78 -11
  216. package/src/facets/detrital-zircon/provider.ts +1 -1
  217. package/src/facets/fossils/index.ts +145 -215
  218. package/src/facets/fossils/provider.ts +18 -25
  219. package/src/facets/fossils/taxon-ranges.ts +220 -0
  220. package/src/facets/index.ts +0 -1
  221. package/src/facets/{base-sample-column.module.sass → measurements/base.module.sass} +1 -0
  222. package/src/facets/measurements/base.ts +215 -0
  223. package/src/facets/measurements/index.ts +2 -38
  224. package/src/facets/measurements/sgp.ts +91 -0
  225. package/src/notes.ts +6 -3
  226. package/src/prepare-units/index.ts +8 -2
  227. package/src/prepare-units/utils.ts +55 -9
  228. package/src/section.ts +9 -4
  229. package/src/unit-details/panel.ts +2 -1
  230. package/dist/esm/column-views.0265cf7f.js.map +0 -1
  231. package/dist/esm/column-views.05586d1f.js.map +0 -1
  232. package/dist/esm/column-views.1151416d.css.map +0 -1
  233. package/dist/esm/column-views.29a551f6.js.map +0 -1
  234. package/dist/esm/column-views.3a7179c4.js.map +0 -1
  235. package/dist/esm/column-views.418f948f.js +0 -15
  236. package/dist/esm/column-views.4ed90896.js.map +0 -1
  237. package/dist/esm/column-views.54f8b909.js.map +0 -1
  238. package/dist/esm/column-views.6698b95a.js.map +0 -1
  239. package/dist/esm/column-views.6e7082db.js +0 -16
  240. package/dist/esm/column-views.6e7082db.js.map +0 -1
  241. package/dist/esm/column-views.748dce47.js +0 -95
  242. package/dist/esm/column-views.748dce47.js.map +0 -1
  243. package/dist/esm/column-views.787d7696.js.map +0 -1
  244. package/dist/esm/column-views.a3fabf0f.js.map +0 -1
  245. package/dist/esm/column-views.abeab9aa.js.map +0 -1
  246. package/dist/esm/column-views.adec2e4c.js.map +0 -1
  247. package/dist/esm/column-views.b7016f82.css.map +0 -1
  248. package/dist/esm/column-views.e17f00d3.js +0 -37
  249. package/dist/esm/column-views.e17f00d3.js.map +0 -1
  250. package/dist/esm/column-views.e33ac5c9.css.map +0 -1
  251. package/dist/esm/column-views.ea4ebbb7.js +0 -31
  252. package/dist/esm/column-views.ea4ebbb7.js.map +0 -1
  253. package/dist/esm/column-views.faacfc3c.js +0 -92
  254. package/dist/esm/column-views.faacfc3c.js.map +0 -1
  255. package/dist/node/column-views.07c503d3.js.map +0 -1
  256. package/dist/node/column-views.0e7ac946.js +0 -2
  257. package/dist/node/column-views.0e7ac946.js.map +0 -1
  258. package/dist/node/column-views.16f336ee.js +0 -2
  259. package/dist/node/column-views.16f336ee.js.map +0 -1
  260. package/dist/node/column-views.18d54bbb.js +0 -2
  261. package/dist/node/column-views.18d54bbb.js.map +0 -1
  262. package/dist/node/column-views.19a84c01.js +0 -2
  263. package/dist/node/column-views.19a84c01.js.map +0 -1
  264. package/dist/node/column-views.1a3c399e.js +0 -2
  265. package/dist/node/column-views.1a3c399e.js.map +0 -1
  266. package/dist/node/column-views.29eb25bd.css +0 -2
  267. package/dist/node/column-views.29eb25bd.css.map +0 -1
  268. package/dist/node/column-views.312db572.js +0 -2
  269. package/dist/node/column-views.312db572.js.map +0 -1
  270. package/dist/node/column-views.573cb29d.js +0 -2
  271. package/dist/node/column-views.573cb29d.js.map +0 -1
  272. package/dist/node/column-views.5a8bc8e3.js +0 -2
  273. package/dist/node/column-views.5a8bc8e3.js.map +0 -1
  274. package/dist/node/column-views.5f3b0b04.js +0 -2
  275. package/dist/node/column-views.5f3b0b04.js.map +0 -1
  276. package/dist/node/column-views.77ace3a2.js +0 -2
  277. package/dist/node/column-views.77ace3a2.js.map +0 -1
  278. package/dist/node/column-views.8f54691f.js +0 -2
  279. package/dist/node/column-views.8f54691f.js.map +0 -1
  280. package/dist/node/column-views.92e29010.js +0 -2
  281. package/dist/node/column-views.92e29010.js.map +0 -1
  282. package/dist/node/column-views.a16cd1f2.js +0 -2
  283. package/dist/node/column-views.a16cd1f2.js.map +0 -1
  284. package/dist/node/column-views.abe0a664.js +0 -2
  285. package/dist/node/column-views.abe0a664.js.map +0 -1
  286. package/dist/node/column-views.cd7b223b.css +0 -2
  287. package/dist/node/column-views.cd7b223b.css.map +0 -1
  288. package/dist/node/column-views.d4545f9f.js +0 -2
  289. package/dist/node/column-views.d4545f9f.js.map +0 -1
  290. package/dist/node/column-views.e803e4ae.css.map +0 -1
  291. package/dist/node/column-views.f7d72702.js +0 -2
  292. package/dist/node/column-views.f7d72702.js.map +0 -1
  293. package/src/facets/base-sample-column.ts +0 -114
  294. package/src/facets/measurements/provider.ts +0 -80
  295. /package/src/facets/fossils/{index.module.sass → taxon-ranges.module.sass} +0 -0
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,Q,S,C,K,U,A,Q,kB,C,K,+B,A,Q,oB,C,C,wB,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,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,SCkBO,SAAS,EACd,CAAuB,CACvB,EAA2B,AAAA,EAAe,GAAG,EAK7C,IAAI,EAAY,AAFJ,EAAQ,KAAK,CAEH,GAAG,CAAC,CAAC,GAAG,IAAS,AAiDzC,CAAA,SACE,CAAc,CACd,CAAS,CACT,CAAqB,CACrB,EAA2B,AAAA,EAAe,GAAG,EAG7C,IAAI,EAAY,IACZ,CAAA,GAAY,AAAA,EAAe,GAAG,EAChC,CAAA,EAAY,GAAA,EAGd,IAAM,EAAmB,EAAU,MAAM,CACvC,AAAC,GACC,EAAE,OAAO,EAAI,EAAK,OAAO,EAAI,AAAA,CAAA,EAAA,EAAA,YAAW,AAAX,EAAa,EAAM,EAAG,EAAU,IAE3D,EAAQ,AAAA,CAAA,EAAA,EAAA,kBAAiB,AAAjB,EAAmB,EAAM,GACjC,EAAgB,EAAiB,IAAI,CAAC,AAAC,GAGpC,AAFO,AAAA,CAAA,EAAA,EAAA,kBAAiB,AAAjB,E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-views.5f3b0b04.js\";\nimport {group as $lOZ4A$group} from \"d3-array\";\nimport {ColumnAxisType as $lOZ4A$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {compareAgeRanges as $lOZ4A$compareAgeRanges, AgeRangeRelationship as $lOZ4A$AgeRangeRelationship} 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\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\nconst $57278f42f24b59e5$var$dt = 0.001;\nfunction $57278f42f24b59e5$export$55543e159517d62d(section, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Preprocess units to add overlapping units and columns. */ let units = section.units;\n let divisions = units.map((...args)=>$57278f42f24b59e5$var$extendDivision(...args, axisType));\n for (let d of divisions){\n const overlappingUnits = divisions.filter((u)=>d.overlappingUnits.includes(u.unit_id));\n // Overlapping columns\n const columns = overlappingUnits.map((d)=>d.column);\n if (columns.includes(d.column)) {\n let col = 0;\n // Go through columns to find a better index\n while(columns.includes(col))col++;\n d.column = col;\n }\n // If unit overlaps the edges of a section, set the clip positions\n const [b_pos, t_pos] = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n if (axisType == (0, $lOZ4A$ColumnAxisType).AGE) {\n if (b_pos > section.b_age) d.b_clip_pos = section.b_age;\n if (t_pos < section.t_age) d.t_clip_pos = section.t_age;\n }\n if (axisType == (0, $lOZ4A$ColumnAxisType).DEPTH) {\n if (b_pos > section.b_pos) d.b_clip_pos = section.b_pos;\n if (t_pos < section.t_pos) d.t_clip_pos = section.t_pos;\n }\n // if (axisType == ColumnAxisType.HEIGHT) {\n // if (b_pos < section.b_pos) {\n // d.b_clip_pos = section.b_pos;\n // }\n // if (t_pos > section.t_pos) {\n // d.t_clip_pos = section.t_pos;\n // }\n // }\n }\n return divisions;\n}\nfunction $57278f42f24b59e5$var$extendDivision(unit, i, divisions, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n // TODO: make this configurable\n let tolerance = 0.001; // 1 kyr tolerance for age columns\n if (axisType != (0, $lOZ4A$ColumnAxisType).AGE) tolerance = 0.01; // 1cm tolerance for height/depth columns\n const overlappingUnits = divisions.filter((d)=>d.unit_id != unit.unit_id && (0, $iWhRv.unitsOverlap)(unit, d, axisType, tolerance));\n const u_pos = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n const bottomOverlap = overlappingUnits.some((d)=>{\n const d_pos = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n // Check if the unit is below the current unit\n return d_pos[0] < u_pos[0] + $57278f42f24b59e5$var$dt;\n });\n let column = 0;\n if (overlappingUnits.length == 1) column = 1;\n return {\n ...unit,\n bottomOverlap: bottomOverlap,\n column: column,\n overlappingUnits: overlappingUnits.map((d)=>d.unit_id)\n };\n}\nfunction $57278f42f24b59e5$export$eeade20e3eee4638(units, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Group units into sections by section_id.\n * This works for large-scale Macrostrat columns, where units are grouped by section_id.\n * */ let groups = Array.from((0, $lOZ4A$group)(units, (d)=>d.section_id));\n const unitComparator = (0, $iWhRv.createUnitSorter)(axisType);\n const groups1 = groups.map(([section_id, sectionUnits])=>{\n const [b_age, t_age] = $57278f42f24b59e5$export$8093438ec3e4c6fd(sectionUnits);\n const [b_pos, t_pos] = $57278f42f24b59e5$export$483b05c497fd70c6(sectionUnits, axisType);\n // sort units by position\n sectionUnits.sort(unitComparator);\n return {\n section_id: section_id,\n t_age: t_age,\n b_age: b_age,\n b_pos: b_pos,\n t_pos: t_pos,\n units: sectionUnits\n };\n });\n // Sort sections by increasing top age, then increasing bottom age.\n // Sections have no relative ordinal position other than age...\n const compareSections = (0, $iWhRv.createUnitSorter)(axisType);\n groups1.sort(compareSections);\n return groups1;\n}\nfunction $57278f42f24b59e5$export$bb26cdbde9c8c08b(units, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Group units into sections by overlap.\n * This creates \"synthetic\" sections that correspond to packages bound by scale gaps.\n * This is most useful in the height and depth domains, where gaps (e.g., missing core) are\n * common.\n * */ // Start with each unit as its own \"section\", and progressively merge...\n const sectionList = [];\n for (const unit of units){\n // Check if the unit overlaps with any existing section\n const heightRange = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n let section = sectionList.find((s)=>(0, $lOZ4A$compareAgeRanges)(heightRange, s.heightRange) !== (0, $lOZ4A$AgeRangeRelationship).Disjoint);\n if (section == null) // No overlap, create a new section\n sectionList.push({\n heightRange: heightRange,\n units: [\n unit\n ]\n });\n else {\n // Overlap, merge the unit into the section\n section.units.push(unit);\n // Update the height range\n if (axisType == (0, $lOZ4A$ColumnAxisType).DEPTH || axisType == (0, $lOZ4A$ColumnAxisType).AGE) section.heightRange = [\n Math.max(section.heightRange[0], heightRange[0]),\n Math.min(section.heightRange[1], heightRange[1])\n ];\n else section.heightRange = [\n Math.min(section.heightRange[0], heightRange[0]),\n Math.max(section.heightRange[1], heightRange[1])\n ];\n }\n }\n // We should have a section for each unit, now we can convert to SectionInfo\n // Ages have to be really actually ages, not heights\n return sectionList.map((section, i)=>{\n const [b_age, t_age] = $57278f42f24b59e5$export$8093438ec3e4c6fd(section.units);\n const [b_pos, t_pos] = $57278f42f24b59e5$export$483b05c497fd70c6(section.units, axisType);\n return {\n // Negative section IDs are used to indicate that these are synthetic sections\n section_id: -i,\n t_age: t_age,\n b_age: b_age,\n t_pos: t_pos,\n b_pos: b_pos,\n units: section.units\n };\n });\n}\nfunction $57278f42f24b59e5$export$483b05c497fd70c6(units, axisType) {\n /** Get the overall position range of a set of units. */ const t_positions = units.map((d)=>{\n switch(axisType){\n case (0, $lOZ4A$ColumnAxisType).AGE:\n return d.t_age;\n case (0, $lOZ4A$ColumnAxisType).DEPTH:\n case (0, $lOZ4A$ColumnAxisType).HEIGHT:\n case (0, $lOZ4A$ColumnAxisType).ORDINAL:\n return d.t_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n const b_positions = units.map((d)=>{\n switch(axisType){\n case (0, $lOZ4A$ColumnAxisType).AGE:\n return d.b_age;\n case (0, $lOZ4A$ColumnAxisType).DEPTH:\n case (0, $lOZ4A$ColumnAxisType).HEIGHT:\n case (0, $lOZ4A$ColumnAxisType).ORDINAL:\n return d.b_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n if (axisType == (0, $lOZ4A$ColumnAxisType).AGE || axisType == (0, $lOZ4A$ColumnAxisType).DEPTH) return [\n Math.max(...b_positions),\n Math.min(...t_positions)\n ];\n else return [\n Math.min(...b_positions),\n Math.max(...t_positions)\n ];\n}\nfunction $57278f42f24b59e5$export$8093438ec3e4c6fd(units) {\n /** Get the overall age range of a set of units. */ return $57278f42f24b59e5$export$483b05c497fd70c6(units, (0, $lOZ4A$ColumnAxisType).AGE);\n}\nfunction $57278f42f24b59e5$export$e7bb744b9be37f3d(sections) {\n /** Columns can have sections that overlap in time. Here, we merge overlapping\n * sections into a single section to correctly render gap-bound packages.\n */ const [firstSection, ...rest] = sections;\n const newSections = [\n firstSection\n ];\n for (const section of rest){\n const lastSection = newSections[newSections.length - 1];\n if (lastSection.b_age < section.t_age || lastSection.t_age > section.b_age) {\n // No overlap, add the section as normal\n newSections.push(section);\n continue;\n }\n // Overlap, merge the sections\n lastSection.section_id = [\n ...(0, $iWhRv.ensureArray)(lastSection.section_id),\n ...(0, $iWhRv.ensureArray)(section.section_id)\n ];\n lastSection.units.push(...section.units);\n lastSection.b_age = Math.max(lastSection.b_age, section.b_age);\n lastSection.t_age = Math.min(lastSection.t_age, section.t_age);\n }\n return newSections;\n}\nfunction $57278f42f24b59e5$export$47e05aac3f0b77d4(unit) {\n /** Preprocess a single unit for a \"section\" column type.\n * This mostly handles vagaries of eODP-style columns.\n * */ let b_pos = unit.b_pos;\n let t_pos = unit.t_pos;\n let unit_name = unit.unit_name;\n // eODP columns sometimes have overlapping core sections, which are encoded in the name field\n // Match eODP section names\n const match = unit.unit_name.match(/^(\\d+(\\.\\d+)?)-(\\d+(\\.\\d+)?): (.+)/);\n if (match) {\n // These values should already be set if we've used the show_positions flag\n t_pos ?? (t_pos = (0, $iWhRv.ensureRealFloat)(match[1]));\n b_pos ?? (b_pos = (0, $iWhRv.ensureRealFloat)(match[3]));\n unit_name = match[5];\n }\n return {\n ...unit,\n b_pos: (0, $iWhRv.ensureRealFloat)(b_pos),\n t_pos: (0, $iWhRv.ensureRealFloat)(t_pos),\n unit_name: unit_name\n };\n}\n\n\nexport {$57278f42f24b59e5$export$55543e159517d62d as preprocessUnits, $57278f42f24b59e5$export$eeade20e3eee4638 as groupUnitsIntoSectionsBySectionID, $57278f42f24b59e5$export$8093438ec3e4c6fd as getSectionAgeRange, $57278f42f24b59e5$export$483b05c497fd70c6 as getSectionPosRange, $57278f42f24b59e5$export$bb26cdbde9c8c08b as groupUnitsIntoSectionsByOverlap, $57278f42f24b59e5$export$e7bb744b9be37f3d as mergeOverlappingSections, $57278f42f24b59e5$export$47e05aac3f0b77d4 as preprocessSectionUnit};\n//# sourceMappingURL=column-views.edb4ba54.js.map\n","import type { BaseUnit, UnitLong } from \"@macrostrat/api-types\";\nimport { group } from \"d3-array\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n createUnitSorter,\n ensureArray,\n ensureRealFloat,\n getUnitHeightRange,\n unitsOverlap,\n} from \"./utils\";\nimport {\n AgeRangeRelationship,\n compareAgeRanges,\n} from \"@macrostrat/stratigraphy-utils\";\nimport type { ExtUnit, SectionInfo, StratigraphicPackage } from \"./types\";\n\nconst dt = 0.001;\n\nexport function preprocessUnits<T extends UnitLong = UnitLong>(\n section: SectionInfo<T>,\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): ExtUnit[] {\n /** Preprocess units to add overlapping units and columns. */\n let units = section.units;\n\n let divisions = units.map((...args) => extendDivision(...args, axisType));\n for (let d of divisions) {\n const overlappingUnits = divisions.filter((u) =>\n d.overlappingUnits.includes(u.unit_id),\n );\n\n // Overlapping columns\n const columns = overlappingUnits.map((d) => d.column);\n\n if (columns.includes(d.column)) {\n let col = 0;\n // Go through columns to find a better index\n while (columns.includes(col)) {\n col++;\n }\n d.column = col;\n }\n\n // If unit overlaps the edges of a section, set the clip positions\n const [b_pos, t_pos] = getUnitHeightRange(d, axisType);\n if (axisType == ColumnAxisType.AGE) {\n if (b_pos > section.b_age) {\n d.b_clip_pos = section.b_age;\n }\n if (t_pos < section.t_age) {\n d.t_clip_pos = section.t_age;\n }\n }\n if (axisType == ColumnAxisType.DEPTH) {\n if (b_pos > section.b_pos) {\n d.b_clip_pos = section.b_pos;\n }\n if (t_pos < section.t_pos) {\n d.t_clip_pos = section.t_pos;\n }\n }\n // if (axisType == ColumnAxisType.HEIGHT) {\n // if (b_pos < section.b_pos) {\n // d.b_clip_pos = section.b_pos;\n // }\n // if (t_pos > section.t_pos) {\n // d.t_clip_pos = section.t_pos;\n // }\n // }\n }\n\n return divisions;\n}\n\nfunction extendDivision(\n unit: UnitLong,\n i: number,\n divisions: UnitLong[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): ExtUnit {\n // TODO: make this configurable\n let tolerance = 0.001; // 1 kyr tolerance for age columns\n if (axisType != ColumnAxisType.AGE) {\n tolerance = 0.01; // 1cm tolerance for height/depth columns\n }\n\n const overlappingUnits = divisions.filter(\n (d) =>\n d.unit_id != unit.unit_id && unitsOverlap(unit, d, axisType, tolerance),\n );\n const u_pos = getUnitHeightRange(unit, axisType);\n const bottomOverlap = overlappingUnits.some((d) => {\n const d_pos = getUnitHeightRange(d, axisType);\n // Check if the unit is below the current unit\n return d_pos[0] < u_pos[0] + dt;\n });\n let column = 0;\n if (overlappingUnits.length == 1) {\n column = 1;\n }\n\n return {\n ...unit,\n bottomOverlap,\n column,\n overlappingUnits: overlappingUnits.map((d) => d.unit_id),\n };\n}\n\nexport function groupUnitsIntoSectionsBySectionID<T extends UnitLong>(\n units: T[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): SectionInfo<T>[] {\n /** Group units into sections by section_id.\n * This works for large-scale Macrostrat columns, where units are grouped by section_id.\n * */\n let groups = Array.from(group(units, (d) => d.section_id));\n const unitComparator = createUnitSorter(axisType);\n\n const groups1 = groups.map(([section_id, sectionUnits]) => {\n const [b_age, t_age] = getSectionAgeRange(sectionUnits);\n const [b_pos, t_pos] = getSectionPosRange(sectionUnits, axisType);\n\n // sort units by position\n sectionUnits.sort(unitComparator);\n return { section_id, t_age, b_age, b_pos, t_pos, units: sectionUnits };\n });\n // Sort sections by increasing top age, then increasing bottom age.\n // Sections have no relative ordinal position other than age...\n const compareSections = createUnitSorter(axisType) as (\n a: StratigraphicPackage,\n b: StratigraphicPackage,\n ) => number;\n groups1.sort(compareSections);\n return groups1;\n}\n\ninterface WorkingSection {\n units: UnitLong[];\n // Position or age\n heightRange?: [number, number];\n}\n\nexport function groupUnitsIntoSectionsByOverlap<T extends UnitLong>(\n units: T[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): SectionInfo<T>[] {\n /** Group units into sections by overlap.\n * This creates \"synthetic\" sections that correspond to packages bound by scale gaps.\n * This is most useful in the height and depth domains, where gaps (e.g., missing core) are\n * common.\n * */\n // Start with each unit as its own \"section\", and progressively merge...\n const sectionList: WorkingSection[] = [];\n for (const unit of units) {\n // Check if the unit overlaps with any existing section\n const heightRange = getUnitHeightRange(unit, axisType);\n let section: WorkingSection | undefined = sectionList.find(\n (s) =>\n compareAgeRanges(heightRange, s.heightRange) !==\n AgeRangeRelationship.Disjoint,\n );\n if (section == null) {\n // No overlap, create a new section\n sectionList.push({\n heightRange,\n units: [unit],\n });\n } else {\n // Overlap, merge the unit into the section\n section.units.push(unit);\n // Update the height range\n if (axisType == ColumnAxisType.DEPTH || axisType == ColumnAxisType.AGE) {\n section.heightRange = [\n Math.max(section.heightRange[0], heightRange[0]),\n Math.min(section.heightRange[1], heightRange[1]),\n ];\n } else {\n section.heightRange = [\n Math.min(section.heightRange[0], heightRange[0]),\n Math.max(section.heightRange[1], heightRange[1]),\n ];\n }\n }\n }\n // We should have a section for each unit, now we can convert to SectionInfo\n // Ages have to be really actually ages, not heights\n\n return sectionList.map((section, i) => {\n const [b_age, t_age] = getSectionAgeRange(section.units);\n const [b_pos, t_pos] = getSectionPosRange(section.units, axisType);\n return {\n // Negative section IDs are used to indicate that these are synthetic sections\n section_id: -i,\n t_age,\n b_age,\n t_pos,\n b_pos,\n units: section.units as T[],\n };\n });\n}\n\nexport function getSectionPosRange(\n units: BaseUnit[],\n axisType: ColumnAxisType,\n): [number, number] {\n /** Get the overall position range of a set of units. */\n const t_positions = units.map((d) => {\n switch (axisType) {\n case ColumnAxisType.AGE:\n return d.t_age;\n case ColumnAxisType.DEPTH:\n case ColumnAxisType.HEIGHT:\n case ColumnAxisType.ORDINAL:\n return d.t_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n const b_positions = units.map((d) => {\n switch (axisType) {\n case ColumnAxisType.AGE:\n return d.b_age;\n case ColumnAxisType.DEPTH:\n case ColumnAxisType.HEIGHT:\n case ColumnAxisType.ORDINAL:\n return d.b_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n if (axisType == ColumnAxisType.AGE || axisType == ColumnAxisType.DEPTH) {\n return [Math.max(...b_positions), Math.min(...t_positions)];\n } else {\n return [Math.min(...b_positions), Math.max(...t_positions)];\n }\n}\n\nexport function getSectionAgeRange(units: BaseUnit[]): [number, number] {\n /** Get the overall age range of a set of units. */\n return getSectionPosRange(units, ColumnAxisType.AGE);\n}\n\nexport function mergeOverlappingSections<T extends UnitLong>(\n sections: SectionInfo<T>[],\n): SectionInfo<T>[] {\n /** Columns can have sections that overlap in time. Here, we merge overlapping\n * sections into a single section to correctly render gap-bound packages.\n */\n const [firstSection, ...rest] = sections;\n const newSections = [firstSection];\n for (const section of rest) {\n const lastSection = newSections[newSections.length - 1];\n if (\n lastSection.b_age < section.t_age ||\n lastSection.t_age > section.b_age\n ) {\n // No overlap, add the section as normal\n newSections.push(section);\n continue;\n }\n\n // Overlap, merge the sections\n lastSection.section_id = [\n ...ensureArray(lastSection.section_id),\n ...ensureArray(section.section_id),\n ];\n lastSection.units.push(...section.units);\n lastSection.b_age = Math.max(lastSection.b_age, section.b_age);\n lastSection.t_age = Math.min(lastSection.t_age, section.t_age);\n }\n return newSections;\n}\n\nexport function preprocessSectionUnit(unit: UnitLong): UnitLong {\n /** Preprocess a single unit for a \"section\" column type.\n * This mostly handles vagaries of eODP-style columns.\n * */\n\n let b_pos = unit.b_pos;\n let t_pos = unit.t_pos;\n\n let unit_name = unit.unit_name;\n\n // eODP columns sometimes have overlapping core sections, which are encoded in the name field\n // Match eODP section names\n const match = unit.unit_name.match(/^(\\d+(\\.\\d+)?)-(\\d+(\\.\\d+)?): (.+)/);\n\n if (match) {\n // These values should already be set if we've used the show_positions flag\n t_pos ??= ensureRealFloat(match[1]);\n b_pos ??= ensureRealFloat(match[3]);\n unit_name = match[5];\n }\n\n return {\n ...unit,\n b_pos: ensureRealFloat(b_pos),\n t_pos: ensureRealFloat(t_pos),\n unit_name,\n };\n}\n"],"names":["group","$lOZ4A$group","ColumnAxisType","$lOZ4A$ColumnAxisType","compareAgeRanges","$lOZ4A$compareAgeRanges","AgeRangeRelationship","$lOZ4A$AgeRangeRelationship","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$57278f42f24b59e5$export$55543e159517d62d","section","axisType","AGE","divisions","units","map","args","$57278f42f24b59e5$var$extendDivision","unit","i","tolerance","overlappingUnits","filter","d","unit_id","unitsOverlap","u_pos","getUnitHeightRange","bottomOverlap","some","d_pos","column","length","columns","u","includes","col","b_pos","t_pos","b_age","b_clip_pos","t_age","t_clip_pos","DEPTH","$57278f42f24b59e5$export$eeade20e3eee4638","groups","Array","from","section_id","unitComparator","createUnitSorter","groups1","sectionUnits","$57278f42f24b59e5$export$8093438ec3e4c6fd","$57278f42f24b59e5$export$483b05c497fd70c6","sort","compareSections","$57278f42f24b59e5$export$bb26cdbde9c8c08b","sectionList","heightRange","find","s","Disjoint","push","Math","max","min","t_positions","HEIGHT","ORDINAL","b_positions","$57278f42f24b59e5$export$e7bb744b9be37f3d","sections","firstSection","rest","newSections","lastSection","ensureArray","$57278f42f24b59e5$export$47e05aac3f0b77d4","unit_name","match","ensureRealFloat","preprocessUnits","groupUnitsIntoSectionsBySectionID","getSectionAgeRange","getSectionPosRange","groupUnitsIntoSectionsByOverlap","mergeOverlappingSections","preprocessSectionUnit"],"version":3,"file":"column-views.edb4ba54.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,Q,S,C,K,U,A,Q,kB,C,K,+B,A,Q,oB,C,C,wB,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,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,E,SCkBO,SAAS,EACd,CAAuB,CACvB,EAA2B,AAAA,EAAe,GAAG,EAK7C,IAAI,EAAY,AAFJ,EAAQ,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AAK,CAAC,sCASnC,OAPI,IAEF,GAAA,CAAA,EAAU,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,CAAK,CAAC,EAAE,CAAA,EAClC,GAAA,CAAA,EAAU,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,CAAK,CAAC,EAAE,CAAA,EAClC,EAAY,CAAK,CAAC,EAAE,EAGf,CACL,GAAG,CAAI,CACP,MAAO,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,GACvB,MAAO,AAAA,CAAA,EAAA,EAAA,eAAc,AAAd,EAAgB,GACvB,UAAA,CACF,CACF,Q,K,e,C,K,iC,C,K,kB,C,K,kB,C,K,+B,C,K,wB,C,K,qB","sources":["<anon>","packages/column-views/src/prepare-units/helpers.ts"],"sourcesContent":["import \"./column-views.dbb4a46b.js\";\nimport {group as $lOZ4A$group} from \"d3-array\";\nimport {ColumnAxisType as $lOZ4A$ColumnAxisType} from \"@macrostrat/column-components\";\nimport {compareAgeRanges as $lOZ4A$compareAgeRanges, AgeRangeRelationship as $lOZ4A$AgeRangeRelationship} 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\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\nconst $57278f42f24b59e5$var$dt = 0.001;\nfunction $57278f42f24b59e5$export$55543e159517d62d(section, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Preprocess units to add overlapping units and columns. */ let units = section.units;\n let divisions = units.map((...args)=>$57278f42f24b59e5$var$extendDivision(...args, axisType));\n for (let d of divisions){\n const overlappingUnits = divisions.filter((u)=>d.overlappingUnits.includes(u.unit_id));\n // Overlapping columns\n const columns = overlappingUnits.map((d)=>d.column);\n if (columns.includes(d.column)) {\n let col = 0;\n // Go through columns to find a better index\n while(columns.includes(col))col++;\n d.column = col;\n }\n // If unit overlaps the edges of a section, set the clip positions\n const [b_pos, t_pos] = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n if (axisType == (0, $lOZ4A$ColumnAxisType).AGE) {\n if (b_pos > section.b_age) d.b_clip_pos = section.b_age;\n if (t_pos < section.t_age) d.t_clip_pos = section.t_age;\n }\n if (axisType == (0, $lOZ4A$ColumnAxisType).DEPTH) {\n if (b_pos > section.b_pos) d.b_clip_pos = section.b_pos;\n if (t_pos < section.t_pos) d.t_clip_pos = section.t_pos;\n }\n // if (axisType == ColumnAxisType.HEIGHT) {\n // if (b_pos < section.b_pos) {\n // d.b_clip_pos = section.b_pos;\n // }\n // if (t_pos > section.t_pos) {\n // d.t_clip_pos = section.t_pos;\n // }\n // }\n }\n return divisions;\n}\nfunction $57278f42f24b59e5$var$extendDivision(unit, i, divisions, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n // TODO: make this configurable\n let tolerance = 0.001; // 1 kyr tolerance for age columns\n if (axisType != (0, $lOZ4A$ColumnAxisType).AGE) tolerance = 0.01; // 1cm tolerance for height/depth columns\n const overlappingUnits = divisions.filter((d)=>d.unit_id != unit.unit_id && (0, $iWhRv.unitsOverlap)(unit, d, axisType, tolerance));\n const u_pos = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n const bottomOverlap = overlappingUnits.some((d)=>{\n const d_pos = (0, $iWhRv.getUnitHeightRange)(d, axisType);\n // Check if the unit is below the current unit\n return d_pos[0] < u_pos[0] + $57278f42f24b59e5$var$dt;\n });\n let column = 0;\n if (overlappingUnits.length == 1) column = 1;\n return {\n ...unit,\n bottomOverlap: bottomOverlap,\n column: column,\n overlappingUnits: overlappingUnits.map((d)=>d.unit_id)\n };\n}\nfunction $57278f42f24b59e5$export$eeade20e3eee4638(units, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Group units into sections by section_id.\n * This works for large-scale Macrostrat columns, where units are grouped by section_id.\n * */ let groups = Array.from((0, $lOZ4A$group)(units, (d)=>d.section_id));\n const unitComparator = (0, $iWhRv.createUnitSorter)(axisType);\n const groups1 = groups.map(([section_id, sectionUnits])=>{\n const [b_age, t_age] = $57278f42f24b59e5$export$8093438ec3e4c6fd(sectionUnits);\n const [b_pos, t_pos] = $57278f42f24b59e5$export$483b05c497fd70c6(sectionUnits, axisType);\n // sort units by position\n sectionUnits.sort(unitComparator);\n return {\n section_id: section_id,\n t_age: t_age,\n b_age: b_age,\n b_pos: b_pos,\n t_pos: t_pos,\n units: sectionUnits\n };\n });\n // Sort sections by increasing top age, then increasing bottom age.\n // Sections have no relative ordinal position other than age...\n const compareSections = (0, $iWhRv.createUnitSorter)(axisType);\n groups1.sort(compareSections);\n return groups1;\n}\nfunction $57278f42f24b59e5$export$bb26cdbde9c8c08b(units, axisType = (0, $lOZ4A$ColumnAxisType).AGE) {\n /** Group units into sections by overlap.\n * This creates \"synthetic\" sections that correspond to packages bound by scale gaps.\n * This is most useful in the height and depth domains, where gaps (e.g., missing core) are\n * common.\n * */ // Start with each unit as its own \"section\", and progressively merge...\n const sectionList = [];\n for (const unit of units){\n // Check if the unit overlaps with any existing section\n const heightRange = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n let section = sectionList.find((s)=>(0, $lOZ4A$compareAgeRanges)(heightRange, s.heightRange) !== (0, $lOZ4A$AgeRangeRelationship).Disjoint);\n if (section == null) // No overlap, create a new section\n sectionList.push({\n heightRange: heightRange,\n units: [\n unit\n ]\n });\n else {\n // Overlap, merge the unit into the section\n section.units.push(unit);\n // Update the height range\n if (axisType == (0, $lOZ4A$ColumnAxisType).DEPTH || axisType == (0, $lOZ4A$ColumnAxisType).AGE) section.heightRange = [\n Math.max(section.heightRange[0], heightRange[0]),\n Math.min(section.heightRange[1], heightRange[1])\n ];\n else section.heightRange = [\n Math.min(section.heightRange[0], heightRange[0]),\n Math.max(section.heightRange[1], heightRange[1])\n ];\n }\n }\n // We should have a section for each unit, now we can convert to SectionInfo\n // Ages have to be really actually ages, not heights\n return sectionList.map((section, i)=>{\n const [b_age, t_age] = $57278f42f24b59e5$export$8093438ec3e4c6fd(section.units);\n const [b_pos, t_pos] = $57278f42f24b59e5$export$483b05c497fd70c6(section.units, axisType);\n return {\n // Negative section IDs are used to indicate that these are synthetic sections\n section_id: -i,\n t_age: t_age,\n b_age: b_age,\n t_pos: t_pos,\n b_pos: b_pos,\n units: section.units\n };\n });\n}\nfunction $57278f42f24b59e5$export$483b05c497fd70c6(units, axisType) {\n /** Get the overall position range of a set of units. */ const t_positions = units.map((d)=>{\n switch(axisType){\n case (0, $lOZ4A$ColumnAxisType).AGE:\n return d.t_age;\n case (0, $lOZ4A$ColumnAxisType).DEPTH:\n case (0, $lOZ4A$ColumnAxisType).HEIGHT:\n case (0, $lOZ4A$ColumnAxisType).ORDINAL:\n return d.t_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n const b_positions = units.map((d)=>{\n switch(axisType){\n case (0, $lOZ4A$ColumnAxisType).AGE:\n return d.b_age;\n case (0, $lOZ4A$ColumnAxisType).DEPTH:\n case (0, $lOZ4A$ColumnAxisType).HEIGHT:\n case (0, $lOZ4A$ColumnAxisType).ORDINAL:\n return d.b_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n if (axisType == (0, $lOZ4A$ColumnAxisType).AGE || axisType == (0, $lOZ4A$ColumnAxisType).DEPTH) return [\n Math.max(...b_positions),\n Math.min(...t_positions)\n ];\n else return [\n Math.min(...b_positions),\n Math.max(...t_positions)\n ];\n}\nfunction $57278f42f24b59e5$export$8093438ec3e4c6fd(units) {\n /** Get the overall age range of a set of units. */ return $57278f42f24b59e5$export$483b05c497fd70c6(units, (0, $lOZ4A$ColumnAxisType).AGE);\n}\nfunction $57278f42f24b59e5$export$e7bb744b9be37f3d(sections) {\n /** Columns can have sections that overlap in time. Here, we merge overlapping\n * sections into a single section to correctly render gap-bound packages.\n */ const [firstSection, ...rest] = sections;\n const newSections = [\n firstSection\n ];\n for (const section of rest){\n const lastSection = newSections[newSections.length - 1];\n if (lastSection.b_age < section.t_age || lastSection.t_age > section.b_age) {\n // No overlap, add the section as normal\n newSections.push(section);\n continue;\n }\n // Overlap, merge the sections\n lastSection.section_id = [\n ...(0, $iWhRv.ensureArray)(lastSection.section_id),\n ...(0, $iWhRv.ensureArray)(section.section_id)\n ];\n lastSection.units.push(...section.units);\n lastSection.b_age = Math.max(lastSection.b_age, section.b_age);\n lastSection.t_age = Math.min(lastSection.t_age, section.t_age);\n }\n return newSections;\n}\nfunction $57278f42f24b59e5$export$47e05aac3f0b77d4(unit) {\n /** Preprocess a single unit for a \"section\" column type.\n * This mostly handles vagaries of eODP-style columns.\n * */ let b_pos = unit.b_pos;\n let t_pos = unit.t_pos;\n let unit_name = unit.unit_name;\n // eODP columns sometimes have overlapping core sections, which are encoded in the name field\n // Match eODP section names\n const match = unit.unit_name.match(/^(\\d+(\\.\\d+)?)-(\\d+(\\.\\d+)?): (.+)/);\n if (match) {\n // These values should already be set if we've used the show_positions flag\n t_pos ?? (t_pos = (0, $iWhRv.ensureRealFloat)(match[1]));\n b_pos ?? (b_pos = (0, $iWhRv.ensureRealFloat)(match[3]));\n unit_name = match[5];\n }\n return {\n ...unit,\n b_pos: (0, $iWhRv.ensureRealFloat)(b_pos),\n t_pos: (0, $iWhRv.ensureRealFloat)(t_pos),\n unit_name: unit_name\n };\n}\n\n\nexport {$57278f42f24b59e5$export$55543e159517d62d as preprocessUnits, $57278f42f24b59e5$export$eeade20e3eee4638 as groupUnitsIntoSectionsBySectionID, $57278f42f24b59e5$export$8093438ec3e4c6fd as getSectionAgeRange, $57278f42f24b59e5$export$483b05c497fd70c6 as getSectionPosRange, $57278f42f24b59e5$export$bb26cdbde9c8c08b as groupUnitsIntoSectionsByOverlap, $57278f42f24b59e5$export$e7bb744b9be37f3d as mergeOverlappingSections, $57278f42f24b59e5$export$47e05aac3f0b77d4 as preprocessSectionUnit};\n//# sourceMappingURL=column-views.021a6961.js.map\n","import type { BaseUnit, UnitLong } from \"@macrostrat/api-types\";\nimport { group } from \"d3-array\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport {\n createUnitSorter,\n ensureArray,\n ensureRealFloat,\n getUnitHeightRange,\n unitsOverlap,\n} from \"./utils\";\nimport {\n AgeRangeRelationship,\n compareAgeRanges,\n} from \"@macrostrat/stratigraphy-utils\";\nimport type { ExtUnit, SectionInfo, StratigraphicPackage } from \"./types\";\n\nconst dt = 0.001;\n\nexport function preprocessUnits<T extends UnitLong = UnitLong>(\n section: SectionInfo<T>,\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): ExtUnit[] {\n /** Preprocess units to add overlapping units and columns. */\n let units = section.units;\n\n let divisions = units.map((...args) => extendDivision(...args, axisType));\n for (let d of divisions) {\n const overlappingUnits = divisions.filter((u) =>\n d.overlappingUnits.includes(u.unit_id),\n );\n\n // Overlapping columns\n const columns = overlappingUnits.map((d) => d.column);\n\n if (columns.includes(d.column)) {\n let col = 0;\n // Go through columns to find a better index\n while (columns.includes(col)) {\n col++;\n }\n d.column = col;\n }\n\n // If unit overlaps the edges of a section, set the clip positions\n const [b_pos, t_pos] = getUnitHeightRange(d, axisType);\n if (axisType == ColumnAxisType.AGE) {\n if (b_pos > section.b_age) {\n d.b_clip_pos = section.b_age;\n }\n if (t_pos < section.t_age) {\n d.t_clip_pos = section.t_age;\n }\n }\n if (axisType == ColumnAxisType.DEPTH) {\n if (b_pos > section.b_pos) {\n d.b_clip_pos = section.b_pos;\n }\n if (t_pos < section.t_pos) {\n d.t_clip_pos = section.t_pos;\n }\n }\n // if (axisType == ColumnAxisType.HEIGHT) {\n // if (b_pos < section.b_pos) {\n // d.b_clip_pos = section.b_pos;\n // }\n // if (t_pos > section.t_pos) {\n // d.t_clip_pos = section.t_pos;\n // }\n // }\n }\n\n return divisions;\n}\n\nfunction extendDivision(\n unit: UnitLong,\n i: number,\n divisions: UnitLong[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): ExtUnit {\n // TODO: make this configurable\n let tolerance = 0.001; // 1 kyr tolerance for age columns\n if (axisType != ColumnAxisType.AGE) {\n tolerance = 0.01; // 1cm tolerance for height/depth columns\n }\n\n const overlappingUnits = divisions.filter(\n (d) =>\n d.unit_id != unit.unit_id && unitsOverlap(unit, d, axisType, tolerance),\n );\n const u_pos = getUnitHeightRange(unit, axisType);\n const bottomOverlap = overlappingUnits.some((d) => {\n const d_pos = getUnitHeightRange(d, axisType);\n // Check if the unit is below the current unit\n return d_pos[0] < u_pos[0] + dt;\n });\n let column = 0;\n if (overlappingUnits.length == 1) {\n column = 1;\n }\n\n return {\n ...unit,\n bottomOverlap,\n column,\n overlappingUnits: overlappingUnits.map((d) => d.unit_id),\n };\n}\n\nexport function groupUnitsIntoSectionsBySectionID<T extends UnitLong>(\n units: T[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): SectionInfo<T>[] {\n /** Group units into sections by section_id.\n * This works for large-scale Macrostrat columns, where units are grouped by section_id.\n * */\n let groups = Array.from(group(units, (d) => d.section_id));\n const unitComparator = createUnitSorter(axisType);\n\n const groups1 = groups.map(([section_id, sectionUnits]) => {\n const [b_age, t_age] = getSectionAgeRange(sectionUnits);\n const [b_pos, t_pos] = getSectionPosRange(sectionUnits, axisType);\n\n // sort units by position\n sectionUnits.sort(unitComparator);\n return { section_id, t_age, b_age, b_pos, t_pos, units: sectionUnits };\n });\n // Sort sections by increasing top age, then increasing bottom age.\n // Sections have no relative ordinal position other than age...\n const compareSections = createUnitSorter(axisType) as (\n a: StratigraphicPackage,\n b: StratigraphicPackage,\n ) => number;\n groups1.sort(compareSections);\n return groups1;\n}\n\ninterface WorkingSection {\n units: UnitLong[];\n // Position or age\n heightRange?: [number, number];\n}\n\nexport function groupUnitsIntoSectionsByOverlap<T extends UnitLong>(\n units: T[],\n axisType: ColumnAxisType = ColumnAxisType.AGE,\n): SectionInfo<T>[] {\n /** Group units into sections by overlap.\n * This creates \"synthetic\" sections that correspond to packages bound by scale gaps.\n * This is most useful in the height and depth domains, where gaps (e.g., missing core) are\n * common.\n * */\n // Start with each unit as its own \"section\", and progressively merge...\n const sectionList: WorkingSection[] = [];\n for (const unit of units) {\n // Check if the unit overlaps with any existing section\n const heightRange = getUnitHeightRange(unit, axisType);\n let section: WorkingSection | undefined = sectionList.find(\n (s) =>\n compareAgeRanges(heightRange, s.heightRange) !==\n AgeRangeRelationship.Disjoint,\n );\n if (section == null) {\n // No overlap, create a new section\n sectionList.push({\n heightRange,\n units: [unit],\n });\n } else {\n // Overlap, merge the unit into the section\n section.units.push(unit);\n // Update the height range\n if (axisType == ColumnAxisType.DEPTH || axisType == ColumnAxisType.AGE) {\n section.heightRange = [\n Math.max(section.heightRange[0], heightRange[0]),\n Math.min(section.heightRange[1], heightRange[1]),\n ];\n } else {\n section.heightRange = [\n Math.min(section.heightRange[0], heightRange[0]),\n Math.max(section.heightRange[1], heightRange[1]),\n ];\n }\n }\n }\n // We should have a section for each unit, now we can convert to SectionInfo\n // Ages have to be really actually ages, not heights\n\n return sectionList.map((section, i) => {\n const [b_age, t_age] = getSectionAgeRange(section.units);\n const [b_pos, t_pos] = getSectionPosRange(section.units, axisType);\n return {\n // Negative section IDs are used to indicate that these are synthetic sections\n section_id: -i,\n t_age,\n b_age,\n t_pos,\n b_pos,\n units: section.units as T[],\n };\n });\n}\n\nexport function getSectionPosRange(\n units: BaseUnit[],\n axisType: ColumnAxisType,\n): [number, number] {\n /** Get the overall position range of a set of units. */\n const t_positions = units.map((d) => {\n switch (axisType) {\n case ColumnAxisType.AGE:\n return d.t_age;\n case ColumnAxisType.DEPTH:\n case ColumnAxisType.HEIGHT:\n case ColumnAxisType.ORDINAL:\n return d.t_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n const b_positions = units.map((d) => {\n switch (axisType) {\n case ColumnAxisType.AGE:\n return d.b_age;\n case ColumnAxisType.DEPTH:\n case ColumnAxisType.HEIGHT:\n case ColumnAxisType.ORDINAL:\n return d.b_pos;\n default:\n throw new Error(`Unknown axis type: ${axisType}`);\n }\n });\n if (axisType == ColumnAxisType.AGE || axisType == ColumnAxisType.DEPTH) {\n return [Math.max(...b_positions), Math.min(...t_positions)];\n } else {\n return [Math.min(...b_positions), Math.max(...t_positions)];\n }\n}\n\nexport function getSectionAgeRange(units: BaseUnit[]): [number, number] {\n /** Get the overall age range of a set of units. */\n return getSectionPosRange(units, ColumnAxisType.AGE);\n}\n\nexport function mergeOverlappingSections<T extends UnitLong>(\n sections: SectionInfo<T>[],\n): SectionInfo<T>[] {\n /** Columns can have sections that overlap in time. Here, we merge overlapping\n * sections into a single section to correctly render gap-bound packages.\n */\n const [firstSection, ...rest] = sections;\n const newSections = [firstSection];\n for (const section of rest) {\n const lastSection = newSections[newSections.length - 1];\n if (\n lastSection.b_age < section.t_age ||\n lastSection.t_age > section.b_age\n ) {\n // No overlap, add the section as normal\n newSections.push(section);\n continue;\n }\n\n // Overlap, merge the sections\n lastSection.section_id = [\n ...ensureArray(lastSection.section_id),\n ...ensureArray(section.section_id),\n ];\n lastSection.units.push(...section.units);\n lastSection.b_age = Math.max(lastSection.b_age, section.b_age);\n lastSection.t_age = Math.min(lastSection.t_age, section.t_age);\n }\n return newSections;\n}\n\nexport function preprocessSectionUnit(unit: UnitLong): UnitLong {\n /** Preprocess a single unit for a \"section\" column type.\n * This mostly handles vagaries of eODP-style columns.\n * */\n\n let b_pos = unit.b_pos;\n let t_pos = unit.t_pos;\n\n let unit_name = unit.unit_name;\n\n // eODP columns sometimes have overlapping core sections, which are encoded in the name field\n // Match eODP section names\n const match = unit.unit_name.match(/^(\\d+(\\.\\d+)?)-(\\d+(\\.\\d+)?): (.+)/);\n\n if (match) {\n // These values should already be set if we've used the show_positions flag\n t_pos ??= ensureRealFloat(match[1]);\n b_pos ??= ensureRealFloat(match[3]);\n unit_name = match[5];\n }\n\n return {\n ...unit,\n b_pos: ensureRealFloat(b_pos),\n t_pos: ensureRealFloat(t_pos),\n unit_name,\n };\n}\n"],"names":["group","$lOZ4A$group","ColumnAxisType","$lOZ4A$ColumnAxisType","compareAgeRanges","$lOZ4A$compareAgeRanges","AgeRangeRelationship","$lOZ4A$AgeRangeRelationship","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$iWhRv","$57278f42f24b59e5$export$55543e159517d62d","section","axisType","AGE","divisions","units","map","args","$57278f42f24b59e5$var$extendDivision","unit","i","tolerance","overlappingUnits","filter","d","unit_id","unitsOverlap","u_pos","getUnitHeightRange","bottomOverlap","some","d_pos","column","length","columns","u","includes","col","b_pos","t_pos","b_age","b_clip_pos","t_age","t_clip_pos","DEPTH","$57278f42f24b59e5$export$eeade20e3eee4638","groups","Array","from","section_id","unitComparator","createUnitSorter","groups1","sectionUnits","$57278f42f24b59e5$export$8093438ec3e4c6fd","$57278f42f24b59e5$export$483b05c497fd70c6","sort","compareSections","$57278f42f24b59e5$export$bb26cdbde9c8c08b","sectionList","heightRange","find","s","Disjoint","push","Math","max","min","t_positions","HEIGHT","ORDINAL","b_positions","$57278f42f24b59e5$export$e7bb744b9be37f3d","sections","firstSection","rest","newSections","lastSection","ensureArray","$57278f42f24b59e5$export$47e05aac3f0b77d4","unit_name","match","ensureRealFloat","preprocessUnits","groupUnitsIntoSectionsBySectionID","getSectionAgeRange","getSectionPosRange","groupUnitsIntoSectionsByOverlap","mergeOverlappingSections","preprocessSectionUnit"],"version":3,"file":"column-views.021a6961.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.51fbed89.js";import"./column-views.92e29010.js";import"./column-views.0b3a384e.js";import e from"@macrostrat/hyper";import{useAPIResult as r}from"@macrostrat/ui-components";function o(e,r,o,t){Object.defineProperty(e,r,{get:o,set:t,enumerable:!0,configurable:!0})}var t=globalThis,a={},d={},l=t.parcelRequirea149;null==l&&((l=function(e){if(e in a)return a[e].exports;if(e in d){var r=d[e];delete d[e];var o={id:e,exports:{}};return a[e]=o,r.call(o.exports,o,o.exports),o.exports}var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}).register=function(e,r){d[e]=r},t.parcelRequirea149=l),l.register;var u={};o(u,"BoundaryAgeModelOverlay",()=>p),o(u,"ComputedSurfacesOverlay",()=>m);var s=l("hI4fZ"),n=l("wtIgl"),i=l("dcPBY");let c=e.styled(s&&s.__esModule?s.default:s);function p(){let e=(0,n.useMacrostratUnits)()?.[0]?.col_id,o=(0,n.useCompositeScale)(),t=r("https://dev.macrostrat.org/api/v2/age_model",{col_id:e},e=>e.success.data);return null==t?null:c("div.boundary-age-model",t.map(e=>{let r=o(e.model_age);return c("div.boundary-age-model-surface",{key:e.boundary_id,style:{top:`${r}px`}})}))}function m(){let e=(0,n.useMacrostratUnits)(),r=(0,i.buildColumnSurfaces)(e),o=(0,n.useCompositeScale)();return c("div.boundary-age-model",r.map(e=>{let r=o(e.age);return c("div.boundary-age-model-surface",{key:e.index,style:{top:`${r}px`}})}))}export{p as BoundaryAgeModelOverlay,m as ComputedSurfacesOverlay};
2
- //# sourceMappingURL=column-views.f1ad131a.js.map
1
+ import"./column-views.51fbed89.js";import"./column-views.46efb749.js";import"./column-views.5a9331a9.js";import e from"@macrostrat/hyper";import{useAPIResult as r}from"@macrostrat/ui-components";function o(e,r,o,t){Object.defineProperty(e,r,{get:o,set:t,enumerable:!0,configurable:!0})}var t=globalThis,a={},d={},l=t.parcelRequirea149;null==l&&((l=function(e){if(e in a)return a[e].exports;if(e in d){var r=d[e];delete d[e];var o={id:e,exports:{}};return a[e]=o,r.call(o.exports,o,o.exports),o.exports}var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}).register=function(e,r){d[e]=r},t.parcelRequirea149=l),l.register;var u={};o(u,"BoundaryAgeModelOverlay",()=>p),o(u,"ComputedSurfacesOverlay",()=>m);var s=l("hI4fZ"),n=l("wtIgl"),i=l("dcPBY");let c=e.styled(s&&s.__esModule?s.default:s);function p(){let e=(0,n.useMacrostratUnits)()?.[0]?.col_id,o=(0,n.useCompositeScale)(),t=r("https://dev.macrostrat.org/api/v2/age_model",{col_id:e},e=>e.success.data);return null==t?null:c("div.boundary-age-model",t.map(e=>{let r=o(e.model_age);return c("div.boundary-age-model-surface",{key:e.boundary_id,style:{top:`${r}px`}})}))}function m(){let e=(0,n.useMacrostratUnits)(),r=(0,i.buildColumnSurfaces)(e),o=(0,n.useCompositeScale)();return c("div.boundary-age-model",r.map(e=>{let r=o(e.age);return c("div.boundary-age-model-surface",{key:e.index,style:{top:`${r}px`}})}))}export{p as BoundaryAgeModelOverlay,m as ComputedSurfacesOverlay};
2
+ //# sourceMappingURL=column-views.08bef1f6.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,gB,C,K,2B,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,0B,I,G,E,E,0B,I,G,I,E,E,S,E,E,S,E,E,SC4BA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAoBhB,SAAS,IACd,IAAM,EAAS,AAAA,CAAA,EAAA,EAAA,kBAAiB,AAAjB,KAAsB,CAAC,EAAE,EAAE,OACpC,EAAQ,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,IAER,EAAW,AAAA,EACf,8CACA,CAAE,OAAA,CAAO,EACT,AAAC,GAAQ,EAAI,OAAO,CAAC,IAAI,SAG3B,AAAI,AAAY,MAAZ,EACK,KAGF,EACL,yBACA,EAAS,GAAG,CAAC,AAAC,IACZ,IAAM,EAAS,EAAM,EAAQ,SAAS,EAEtC,OAAO,EAAE,iCAAkC,CACzC,IAAK,EAAQ,WAAW,CACxB,MAAO,CAAE,IAAK,CAAA,EAAG,EAAO,EAAE,CAAC,AAAC,CAC9B,EACF,GAEJ,CAEO,SAAS,IAId,IAAM,EAAQ,AAAA,CAAA,EAAA,EAAA,kBAAiB,AAAjB,IACR,EAAW,AAAA,CAAA,EAAA,EAAA,mBAAkB,AAAlB,EAAoB,GAC/B,EAAQ,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,IAEd,OAAO,EACL,yBACA,EAAS,GAAG,CAAC,AAAC,IACZ,IAAM,EAAS,EAAM,EAAQ,GAAG,EAChC,OAAO,EAAE,iCAAkC,CACzC,IAAK,EAAQ,KAAK,CAClB,MAAO,CAAE,IAAK,CAAA,EAAG,EAAO,EAAE,CAAC,AAAC,CAC9B,EACF,GAEJ,Q,K,uB,C,K,uB","sources":["<anon>","packages/column-views/src/age-model-overlay.ts"],"sourcesContent":["import \"./column-views.51fbed89.js\";\nimport \"./column-views.92e29010.js\";\nimport \"./column-views.0b3a384e.js\";\nimport $f7jEH$macrostrathyper from \"@macrostrat/hyper\";\nimport {useAPIResult as $f7jEH$useAPIResult} from \"@macrostrat/ui-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 $26d029a83b68e870$exports = {};\n\n$parcel$export($26d029a83b68e870$exports, \"BoundaryAgeModelOverlay\", () => $26d029a83b68e870$export$1d1ebe9df97e8db);\n$parcel$export($26d029a83b68e870$exports, \"ComputedSurfacesOverlay\", () => $26d029a83b68e870$export$ddca1abd3171ec6f);\n/** An in-development overlay for a column's age model.\n *\n * Age model info:\n * {\n * \"boundary_id\": 8049,\n * \"col_id\": 432,\n * \"section_id\": 3104,\n * \"interval_id\": 268,\n * \"interval_name\": \"Calymmian\",\n * \"age_bottom\": 1600,\n * \"age_top\": 1400,\n * \"rel_position\": 0.85,\n * \"model_age\": 1430,\n * \"boundary_status\": \"absolute\",\n * \"boundary_type\": \"\",\n * \"boundary_position\": null,\n * \"unit_below\": 11541,\n * \"unit_above\": 0,\n * \"ref_id\": 217\n * },\n *\n * */ \n\nvar $hI4fZ = parcelRequire(\"hI4fZ\");\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $dcPBY = parcelRequire(\"dcPBY\");\nconst $26d029a83b68e870$var$h = (0, $f7jEH$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($hI4fZ))));\nfunction $26d029a83b68e870$export$1d1ebe9df97e8db() {\n const col_id = (0, $wtIgl.useMacrostratUnits)()?.[0]?.col_id;\n const scale = (0, $wtIgl.useCompositeScale)();\n const ageModel = (0, $f7jEH$useAPIResult)(\"https://dev.macrostrat.org/api/v2/age_model\", {\n col_id: col_id\n }, (res)=>res.success.data);\n if (ageModel == null) return null;\n return $26d029a83b68e870$var$h(\"div.boundary-age-model\", ageModel.map((surface)=>{\n const height = scale(surface.model_age);\n return $26d029a83b68e870$var$h(\"div.boundary-age-model-surface\", {\n key: surface.boundary_id,\n style: {\n top: `${height}px`\n }\n });\n }));\n}\nfunction $26d029a83b68e870$export$ddca1abd3171ec6f() {\n /** Overlay showing age surfaces. This is like the boundary age model overlay but\n * it is computed on the fly from unit tops and bottoms.\n */ const units = (0, $wtIgl.useMacrostratUnits)();\n const surfaces = (0, $dcPBY.buildColumnSurfaces)(units);\n const scale = (0, $wtIgl.useCompositeScale)();\n return $26d029a83b68e870$var$h(\"div.boundary-age-model\", surfaces.map((surface)=>{\n const height = scale(surface.age);\n return $26d029a83b68e870$var$h(\"div.boundary-age-model-surface\", {\n key: surface.index,\n style: {\n top: `${height}px`\n }\n });\n }));\n}\n\n\nexport {$26d029a83b68e870$export$1d1ebe9df97e8db as BoundaryAgeModelOverlay, $26d029a83b68e870$export$ddca1abd3171ec6f as ComputedSurfacesOverlay};\n//# sourceMappingURL=column-views.f1ad131a.js.map\n","/** An in-development overlay for a column's age model.\n *\n * Age model info:\n * {\n * \"boundary_id\": 8049,\n * \"col_id\": 432,\n * \"section_id\": 3104,\n * \"interval_id\": 268,\n * \"interval_name\": \"Calymmian\",\n * \"age_bottom\": 1600,\n * \"age_top\": 1400,\n * \"rel_position\": 0.85,\n * \"model_age\": 1430,\n * \"boundary_status\": \"absolute\",\n * \"boundary_type\": \"\",\n * \"boundary_position\": null,\n * \"unit_below\": 11541,\n * \"unit_above\": 0,\n * \"ref_id\": 217\n * },\n *\n * */\n\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./age-model-overlay.module.sass\";\nimport { useAPIResult } from \"@macrostrat/ui-components\";\nimport { useCompositeScale, useMacrostratUnits } from \"./data-provider\";\nimport { buildColumnSurfaces } from \"./prepare-units/dynamic-scales\";\nconst h = hyper.styled(styles);\n\ninterface AgeModelSurface {\n boundary_id: number;\n col_id: number;\n section_id: number;\n interval_id: number;\n interval_name: string;\n age_bottom: number;\n age_top: number;\n rel_position: number;\n model_age: number;\n boundary_status: \"absolute\" | \"relative\" | \"modeled\";\n boundary_type: string;\n boundary_position: null | number;\n unit_below: number;\n unit_above: number;\n ref_id: number;\n}\n\nexport function BoundaryAgeModelOverlay() {\n const col_id = useMacrostratUnits()?.[0]?.col_id;\n const scale = useCompositeScale();\n\n const ageModel = useAPIResult(\n \"https://dev.macrostrat.org/api/v2/age_model\",\n { col_id },\n (res) => res.success.data,\n );\n\n if (ageModel == null) {\n return null;\n }\n\n return h(\n \"div.boundary-age-model\",\n ageModel.map((surface) => {\n const height = scale(surface.model_age);\n\n return h(\"div.boundary-age-model-surface\", {\n key: surface.boundary_id,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n\nexport function ComputedSurfacesOverlay() {\n /** Overlay showing age surfaces. This is like the boundary age model overlay but\n * it is computed on the fly from unit tops and bottoms.\n */\n const units = useMacrostratUnits();\n const surfaces = buildColumnSurfaces(units);\n const scale = useCompositeScale();\n\n return h(\n \"div.boundary-age-model\",\n surfaces.map((surface) => {\n const height = scale(surface.age);\n return h(\"div.boundary-age-model-surface\", {\n key: surface.index,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n"],"names":["$f7jEH$macrostrathyper","useAPIResult","$f7jEH$useAPIResult","$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","$26d029a83b68e870$exports","$26d029a83b68e870$export$1d1ebe9df97e8db","$26d029a83b68e870$export$ddca1abd3171ec6f","$hI4fZ","$wtIgl","$dcPBY","$26d029a83b68e870$var$h","styled","a","__esModule","default","col_id","useMacrostratUnits","scale","useCompositeScale","ageModel","res","success","data","map","surface","height","model_age","key","boundary_id","style","top","units","surfaces","buildColumnSurfaces","age","index","BoundaryAgeModelOverlay","ComputedSurfacesOverlay"],"version":3,"file":"column-views.f1ad131a.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,gB,C,K,2B,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,0B,I,G,E,E,0B,I,G,I,E,E,S,E,E,S,E,E,SC4BA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAoBhB,SAAS,IACd,IAAM,EAAS,AAAA,CAAA,EAAA,EAAA,kBAAiB,AAAjB,KAAsB,CAAC,EAAE,EAAE,OACpC,EAAQ,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,IAER,EAAW,AAAA,EACf,8CACA,CAAE,OAAA,CAAO,EACT,AAAC,GAAQ,EAAI,OAAO,CAAC,IAAI,SAG3B,AAAI,AAAY,MAAZ,EACK,KAGF,EACL,yBACA,EAAS,GAAG,CAAC,AAAC,IACZ,IAAM,EAAS,EAAM,EAAQ,SAAS,EAEtC,OAAO,EAAE,iCAAkC,CACzC,IAAK,EAAQ,WAAW,CACxB,MAAO,CAAE,IAAK,CAAA,EAAG,EAAO,EAAE,CAAC,AAAC,CAC9B,EACF,GAEJ,CAEO,SAAS,IAId,IAAM,EAAQ,AAAA,CAAA,EAAA,EAAA,kBAAiB,AAAjB,IACR,EAAW,AAAA,CAAA,EAAA,EAAA,mBAAkB,AAAlB,EAAoB,GAC/B,EAAQ,AAAA,CAAA,EAAA,EAAA,iBAAgB,AAAhB,IAEd,OAAO,EACL,yBACA,EAAS,GAAG,CAAC,AAAC,IACZ,IAAM,EAAS,EAAM,EAAQ,GAAG,EAChC,OAAO,EAAE,iCAAkC,CACzC,IAAK,EAAQ,KAAK,CAClB,MAAO,CAAE,IAAK,CAAA,EAAG,EAAO,EAAE,CAAC,AAAC,CAC9B,EACF,GAEJ,Q,K,uB,C,K,uB","sources":["<anon>","packages/column-views/src/age-model-overlay.ts"],"sourcesContent":["import \"./column-views.51fbed89.js\";\nimport \"./column-views.46efb749.js\";\nimport \"./column-views.5a9331a9.js\";\nimport $f7jEH$macrostrathyper from \"@macrostrat/hyper\";\nimport {useAPIResult as $f7jEH$useAPIResult} from \"@macrostrat/ui-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 $26d029a83b68e870$exports = {};\n\n$parcel$export($26d029a83b68e870$exports, \"BoundaryAgeModelOverlay\", () => $26d029a83b68e870$export$1d1ebe9df97e8db);\n$parcel$export($26d029a83b68e870$exports, \"ComputedSurfacesOverlay\", () => $26d029a83b68e870$export$ddca1abd3171ec6f);\n/** An in-development overlay for a column's age model.\n *\n * Age model info:\n * {\n * \"boundary_id\": 8049,\n * \"col_id\": 432,\n * \"section_id\": 3104,\n * \"interval_id\": 268,\n * \"interval_name\": \"Calymmian\",\n * \"age_bottom\": 1600,\n * \"age_top\": 1400,\n * \"rel_position\": 0.85,\n * \"model_age\": 1430,\n * \"boundary_status\": \"absolute\",\n * \"boundary_type\": \"\",\n * \"boundary_position\": null,\n * \"unit_below\": 11541,\n * \"unit_above\": 0,\n * \"ref_id\": 217\n * },\n *\n * */ \n\nvar $hI4fZ = parcelRequire(\"hI4fZ\");\n\n\nvar $wtIgl = parcelRequire(\"wtIgl\");\n\nvar $dcPBY = parcelRequire(\"dcPBY\");\nconst $26d029a83b68e870$var$h = (0, $f7jEH$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($hI4fZ))));\nfunction $26d029a83b68e870$export$1d1ebe9df97e8db() {\n const col_id = (0, $wtIgl.useMacrostratUnits)()?.[0]?.col_id;\n const scale = (0, $wtIgl.useCompositeScale)();\n const ageModel = (0, $f7jEH$useAPIResult)(\"https://dev.macrostrat.org/api/v2/age_model\", {\n col_id: col_id\n }, (res)=>res.success.data);\n if (ageModel == null) return null;\n return $26d029a83b68e870$var$h(\"div.boundary-age-model\", ageModel.map((surface)=>{\n const height = scale(surface.model_age);\n return $26d029a83b68e870$var$h(\"div.boundary-age-model-surface\", {\n key: surface.boundary_id,\n style: {\n top: `${height}px`\n }\n });\n }));\n}\nfunction $26d029a83b68e870$export$ddca1abd3171ec6f() {\n /** Overlay showing age surfaces. This is like the boundary age model overlay but\n * it is computed on the fly from unit tops and bottoms.\n */ const units = (0, $wtIgl.useMacrostratUnits)();\n const surfaces = (0, $dcPBY.buildColumnSurfaces)(units);\n const scale = (0, $wtIgl.useCompositeScale)();\n return $26d029a83b68e870$var$h(\"div.boundary-age-model\", surfaces.map((surface)=>{\n const height = scale(surface.age);\n return $26d029a83b68e870$var$h(\"div.boundary-age-model-surface\", {\n key: surface.index,\n style: {\n top: `${height}px`\n }\n });\n }));\n}\n\n\nexport {$26d029a83b68e870$export$1d1ebe9df97e8db as BoundaryAgeModelOverlay, $26d029a83b68e870$export$ddca1abd3171ec6f as ComputedSurfacesOverlay};\n//# sourceMappingURL=column-views.08bef1f6.js.map\n","/** An in-development overlay for a column's age model.\n *\n * Age model info:\n * {\n * \"boundary_id\": 8049,\n * \"col_id\": 432,\n * \"section_id\": 3104,\n * \"interval_id\": 268,\n * \"interval_name\": \"Calymmian\",\n * \"age_bottom\": 1600,\n * \"age_top\": 1400,\n * \"rel_position\": 0.85,\n * \"model_age\": 1430,\n * \"boundary_status\": \"absolute\",\n * \"boundary_type\": \"\",\n * \"boundary_position\": null,\n * \"unit_below\": 11541,\n * \"unit_above\": 0,\n * \"ref_id\": 217\n * },\n *\n * */\n\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./age-model-overlay.module.sass\";\nimport { useAPIResult } from \"@macrostrat/ui-components\";\nimport { useCompositeScale, useMacrostratUnits } from \"./data-provider\";\nimport { buildColumnSurfaces } from \"./prepare-units/dynamic-scales\";\nconst h = hyper.styled(styles);\n\ninterface AgeModelSurface {\n boundary_id: number;\n col_id: number;\n section_id: number;\n interval_id: number;\n interval_name: string;\n age_bottom: number;\n age_top: number;\n rel_position: number;\n model_age: number;\n boundary_status: \"absolute\" | \"relative\" | \"modeled\";\n boundary_type: string;\n boundary_position: null | number;\n unit_below: number;\n unit_above: number;\n ref_id: number;\n}\n\nexport function BoundaryAgeModelOverlay() {\n const col_id = useMacrostratUnits()?.[0]?.col_id;\n const scale = useCompositeScale();\n\n const ageModel = useAPIResult(\n \"https://dev.macrostrat.org/api/v2/age_model\",\n { col_id },\n (res) => res.success.data,\n );\n\n if (ageModel == null) {\n return null;\n }\n\n return h(\n \"div.boundary-age-model\",\n ageModel.map((surface) => {\n const height = scale(surface.model_age);\n\n return h(\"div.boundary-age-model-surface\", {\n key: surface.boundary_id,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n\nexport function ComputedSurfacesOverlay() {\n /** Overlay showing age surfaces. This is like the boundary age model overlay but\n * it is computed on the fly from unit tops and bottoms.\n */\n const units = useMacrostratUnits();\n const surfaces = buildColumnSurfaces(units);\n const scale = useCompositeScale();\n\n return h(\n \"div.boundary-age-model\",\n surfaces.map((surface) => {\n const height = scale(surface.age);\n return h(\"div.boundary-age-model-surface\", {\n key: surface.index,\n style: { top: `${height}px` },\n });\n }),\n );\n}\n"],"names":["$f7jEH$macrostrathyper","useAPIResult","$f7jEH$useAPIResult","$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","$26d029a83b68e870$exports","$26d029a83b68e870$export$1d1ebe9df97e8db","$26d029a83b68e870$export$ddca1abd3171ec6f","$hI4fZ","$wtIgl","$dcPBY","$26d029a83b68e870$var$h","styled","a","__esModule","default","col_id","useMacrostratUnits","scale","useCompositeScale","ageModel","res","success","data","map","surface","height","model_age","key","boundary_id","style","top","units","surfaces","buildColumnSurfaces","age","index","BoundaryAgeModelOverlay","ComputedSurfacesOverlay"],"version":3,"file":"column-views.08bef1f6.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ import e from"@macrostrat/hyper";import{useKeyHandler as t}from"@macrostrat/ui-components";import{createContext as n,useContext as l,useState as i,useEffect as u,useRef as o,useCallback as a}from"react";import{useStore as r,createStore as c}from"zustand";function s(e,t,n,l){Object.defineProperty(e,t,{get:n,set:l,enumerable:!0,configurable:!0})}var d={};s(d,"useUnitSelectionDispatch",()=>U),s(d,"useUnitSelectionStore",()=>p),s(d,"useSelectedUnit",()=>b),s(d,"UnitSelectionProvider",()=>S),s(d,"useUnitSelectionTarget",()=>g),s(d,"UnitKeyboardNavigation",()=>m);let f=n(null);function U(){let e=l(f);return null==e?()=>{}:r(e,e=>e.onUnitSelected)}function p(e){let t=l(f);return null==t?null:r(t,e)}function b(){return p(e=>e.selectedUnitData)}function S(t){let[n]=i(()=>c(e=>({selectedUnit:null,selectedUnitData:null,overlayPosition:null,setSelectedUnit(t){if(null==t)return void e({selectedUnit:null,selectedUnitData:null});"number"==typeof t?e({selectedUnit:t,selectedUnitData:null}):"unit_id"in t&&e({selectedUnit:t.unit_id,selectedUnitData:t})},onUnitSelected:(n,l=null,i=null)=>{if(null==n)return t.onUnitSelected?.(null,null),e({selectedUnit:null,selectedUnitData:null,overlayPosition:null});let u=null;u="number"==typeof n?t.units.find(e=>e.unit_id===n)||null:n;let o=t.columnRef?.current,a=null;if(t.onClickedColumn){let e={unitID:u?.unit_id,unit:u,target:l,height:o?.getBoundingClientRect().height||0};t.onClickedColumn(e,i)}if(null!=u&&null!=o&&null!=l){let e=o.getBoundingClientRect(),t=l.getBoundingClientRect();a={x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height}}return t.onUnitSelected?.(u?.unit_id,u),e({selectedUnit:u?.unit_id,selectedUnitData:u,overlayPosition:a})}}))),{units:l,selectedUnit:o}=t;return u(()=>{if(null!=o){let e=l?.find(e=>e.unit_id===o);n.setState({selectedUnit:o,selectedUnitData:e})}else n.setState({selectedUnit:null,selectedUnitData:null})},[o,l]),e(f.Provider,{value:n},t.children)}function g(e){let t=o(),n=b(),l=p(e=>e.onUnitSelected),i=n?.unit_id==e.unit_id,r=a(n=>{null!=l&&(l(e,t.current,n),n.stopPropagation())},[e,l]);return u(()=>{i&&null!=l&&(l(e,t.current,null),t.current?.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}))},[i,l]),[t,i,r]}function m({units:e}){let n=b(),l=U(),i=e.findIndex(e=>e.unit_id===n?.unit_id),u={38:i-1,40:i+1};return t(t=>{let n=u[t.keyCode];null==n||n<0||n>=e.length||(l(e[n],null,null),t.stopPropagation())},[e,i]),null}export{U as useUnitSelectionDispatch,p as useUnitSelectionStore,b as useSelectedUnit,S as UnitSelectionProvider,g as useUnitSelectionTarget,m as UnitKeyboardNavigation};
2
+ //# sourceMappingURL=column-views.0beae29d.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"A,O,M,mB,A,Q,iB,C,K,2B,A,Q,iB,C,C,c,C,C,Y,C,C,a,C,C,U,C,C,e,C,K,O,A,Q,Y,C,C,e,C,K,S,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,C,E,E,E,2B,I,G,E,E,wB,I,G,E,E,kB,I,G,E,E,wB,I,G,E,E,yB,I,G,E,E,yB,I,GCsBA,IAAM,EAAuB,AAAA,EAA4C,MAElE,SAAS,IACd,IAAM,EAAQ,AAAA,EAAW,UACzB,AAAI,AAAS,MAAT,EACK,KAAO,EAET,AAAA,EAAS,EAAO,AAAC,GAAU,EAAM,cAAc,CACxD,CAEO,SAAS,EACd,CAA0C,EAE1C,IAAM,EAAQ,AAAA,EAAW,UACzB,AAAI,AAAS,MAAT,EACK,KAEF,AAAA,EAAS,EAAO,EACzB,CAEO,SAAS,IACd,OAAO,EAAsB,AAAC,GAAU,EAAM,gBAAgB,CAChE,CAkBO,SAAS,EAA0C,CAOzD,EACC,GAAM,CAAC,EAAM,CAAG,AAAA,EAAS,IACvB,AAAA,EAAgC,AAAC,GAAS,CAAA,CACxC,aAAc,KACd,iBAAkB,KAClB,gBAAiB,KACjB,gBAAgB,CAAsC,EACpD,GAAI,AAAgB,MAAhB,EAAsB,YACxB,EAAI,CAAE,aAAc,KAAM,iBAAkB,IAAK,EAGxC,AAAwB,CAAA,UAAxB,O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esContent":["import $2lWH8$macrostrathyper from \"@macrostrat/hyper\";\nimport {useKeyHandler as $2lWH8$useKeyHandler} from \"@macrostrat/ui-components\";\nimport {createContext as $2lWH8$createContext, useContext as $2lWH8$useContext, useState as $2lWH8$useState, useEffect as $2lWH8$useEffect, useRef as $2lWH8$useRef, useCallback as $2lWH8$useCallback} from \"react\";\nimport {useStore as $2lWH8$useStore, createStore as $2lWH8$createStore} from \"zustand\";\n\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $cfa36458f00f4b0e$exports = {};\n\n$parcel$export($cfa36458f00f4b0e$exports, \"useUnitSelectionDispatch\", () => $cfa36458f00f4b0e$export$77a278d5ca56e309);\n$parcel$export($cfa36458f00f4b0e$exports, \"useUnitSelectionStore\", () => $cfa36458f00f4b0e$export$b220b1d3591dc9e5);\n$parcel$export($cfa36458f00f4b0e$exports, \"useSelectedUnit\", () => $cfa36458f00f4b0e$export$f0dd93f90aa8e5da);\n$parcel$export($cfa36458f00f4b0e$exports, \"UnitSelectionProvider\", () => $cfa36458f00f4b0e$export$f19d75b1d4b676a4);\n$parcel$export($cfa36458f00f4b0e$exports, \"useUnitSelectionTarget\", () => $cfa36458f00f4b0e$export$cbbec12b1451fe7d);\n$parcel$export($cfa36458f00f4b0e$exports, \"UnitKeyboardNavigation\", () => $cfa36458f00f4b0e$export$70f5ee19650fc7d1);\n\n\n\n\nconst $cfa36458f00f4b0e$var$UnitSelectionContext = (0, $2lWH8$createContext)(null);\nfunction $cfa36458f00f4b0e$export$77a278d5ca56e309() {\n const store = (0, $2lWH8$useContext)($cfa36458f00f4b0e$var$UnitSelectionContext);\n if (store == null) return ()=>{};\n return (0, $2lWH8$useStore)(store, (state)=>state.onUnitSelected);\n}\nfunction $cfa36458f00f4b0e$export$b220b1d3591dc9e5(selector) {\n const store = (0, $2lWH8$useContext)($cfa36458f00f4b0e$var$UnitSelectionContext);\n if (store == null) return null;\n return (0, $2lWH8$useStore)(store, selector);\n}\nfunction $cfa36458f00f4b0e$export$f0dd93f90aa8e5da() {\n return $cfa36458f00f4b0e$export$b220b1d3591dc9e5((state)=>state.selectedUnitData);\n}\nfunction $cfa36458f00f4b0e$export$f19d75b1d4b676a4(props) {\n const [store] = (0, $2lWH8$useState)(()=>(0, $2lWH8$createStore)((set)=>({\n selectedUnit: null,\n selectedUnitData: null,\n overlayPosition: null,\n setSelectedUnit (selectedUnit) {\n if (selectedUnit == null) {\n set({\n selectedUnit: null,\n selectedUnitData: null\n });\n return;\n // If it's a number, set the selected unit\n } else if (typeof selectedUnit === \"number\") set({\n selectedUnit: selectedUnit,\n selectedUnitData: null\n });\n else if (\"unit_id\" in selectedUnit) set({\n selectedUnit: selectedUnit.unit_id,\n selectedUnitData: selectedUnit\n });\n },\n onUnitSelected: (input, target = null, event = null)=>{\n if (input == null) {\n props.onUnitSelected?.(null, null);\n return set({\n selectedUnit: null,\n selectedUnitData: null,\n overlayPosition: null\n });\n }\n let unit = null;\n if (typeof input === \"number\") unit = props.units.find((u)=>u.unit_id === input) || null;\n else unit = input;\n const el = props.columnRef?.current;\n let overlayPosition = null;\n /** This is not the natural place to get positions within the column,\n * but it will work for now.\n */ if (props.onClickedColumn) {\n // Infer height from top and bottom height of unit (because that's passed back with the call)\n //const py = event.y;\n //const [bottom, top] = getUnitHeightRange(unit, axisType);\n //const height = Math.abs(bottom - top);\n /** Ideally this would be defined at the column level */ const columnClickData = {\n unitID: unit?.unit_id,\n unit: unit,\n target: target,\n height: el?.getBoundingClientRect().height || 0\n };\n props.onClickedColumn(columnClickData, event);\n }\n if (unit != null && el != null && target != null) {\n const rect = el.getBoundingClientRect();\n const targetRect = target.getBoundingClientRect();\n overlayPosition = {\n x: targetRect.left - rect.left,\n y: targetRect.top - rect.top,\n width: targetRect.width,\n height: targetRect.height\n };\n }\n props.onUnitSelected?.(unit?.unit_id, unit);\n return set({\n selectedUnit: unit?.unit_id,\n selectedUnitData: unit,\n overlayPosition: overlayPosition\n });\n }\n })));\n const { units: units, selectedUnit: selectedUnit } = props;\n (0, $2lWH8$useEffect)(()=>{\n // Synchronize store with provided props\n if (selectedUnit != null) {\n const unitData = units?.find((u)=>u.unit_id === selectedUnit);\n store.setState({\n selectedUnit: selectedUnit,\n selectedUnitData: unitData\n });\n } else store.setState({\n selectedUnit: null,\n selectedUnitData: null\n });\n }, [\n selectedUnit,\n units\n ]);\n return (0, $2lWH8$macrostrathyper)($cfa36458f00f4b0e$var$UnitSelectionContext.Provider, {\n value: store\n }, props.children);\n}\nfunction $cfa36458f00f4b0e$export$cbbec12b1451fe7d(unit) {\n const ref = (0, $2lWH8$useRef)();\n const selectedUnit = $cfa36458f00f4b0e$export$f0dd93f90aa8e5da();\n const onSelectUnit = $cfa36458f00f4b0e$export$b220b1d3591dc9e5((state)=>state.onUnitSelected);\n const selected = selectedUnit?.unit_id == unit.unit_id;\n const onClick = (0, $2lWH8$useCallback)((evt)=>{\n if (onSelectUnit == null) return;\n onSelectUnit(unit, ref.current, evt);\n evt.stopPropagation();\n }, [\n unit,\n onSelectUnit\n ]);\n (0, $2lWH8$useEffect)(()=>{\n if (!selected || onSelectUnit == null) return;\n // In case we haven't set the position of the unit (if we don't have a target), set the selected unit\n onSelectUnit(unit, ref.current, null);\n // Scroll the unit into view\n ref.current?.scrollIntoView({\n behavior: \"smooth\",\n block: \"center\",\n inline: \"nearest\"\n });\n }, [\n selected,\n onSelectUnit\n ]);\n return [\n ref,\n selected,\n onClick\n ];\n}\nfunction $cfa36458f00f4b0e$export$70f5ee19650fc7d1({ units: units }) {\n const selectedUnit = $cfa36458f00f4b0e$export$f0dd93f90aa8e5da();\n const selectUnit = $cfa36458f00f4b0e$export$77a278d5ca56e309();\n const ix = units.findIndex((unit)=>unit.unit_id === selectedUnit?.unit_id);\n const keyMap = {\n 38: ix - 1,\n 40: ix + 1\n };\n (0, $2lWH8$useKeyHandler)((event)=>{\n const nextIx = keyMap[event.keyCode];\n if (nextIx == null || nextIx < 0 || nextIx >= units.length) return;\n selectUnit(units[nextIx], null, null);\n event.stopPropagation();\n }, [\n units,\n ix\n ]);\n return null;\n}\n\n\nexport {$cfa36458f00f4b0e$export$77a278d5ca56e309 as useUnitSelectionDispatch, $cfa36458f00f4b0e$export$b220b1d3591dc9e5 as useUnitSelectionStore, $cfa36458f00f4b0e$export$f0dd93f90aa8e5da as useSelectedUnit, $cfa36458f00f4b0e$export$f19d75b1d4b676a4 as UnitSelectionProvider, $cfa36458f00f4b0e$export$cbbec12b1451fe7d as useUnitSelectionTarget, $cfa36458f00f4b0e$export$70f5ee19650fc7d1 as UnitKeyboardNavigation};\n//# sourceMappingURL=column-views.0beae29d.js.map\n","import { BaseUnit } from \"@macrostrat/api-types\";\nimport h from \"@macrostrat/hyper\";\nimport { useKeyHandler } from \"@macrostrat/ui-components\";\nimport {\n createContext,\n useContext,\n useEffect,\n useState,\n ReactNode,\n RefObject,\n useRef,\n useCallback,\n} from \"react\";\nimport { createStore, StoreApi, useStore } from \"zustand\";\nimport type { RectBounds, IUnit } from \"../units/types\";\n\ntype UnitSelectDispatch = (\n unit: number | BaseUnit | null,\n target: HTMLElement | null,\n event: Event | null,\n) => void;\n\nconst UnitSelectionContext = createContext<StoreApi<UnitSelectionStore>>(null);\n\nexport function useUnitSelectionDispatch(): UnitSelectDispatch {\n const store = useContext(UnitSelectionContext);\n if (store == null) {\n return () => {};\n }\n return useStore(store, (state) => state.onUnitSelected);\n}\n\nexport function useUnitSelectionStore<T>(\n selector: (state: UnitSelectionStore) => T,\n): T {\n const store = useContext(UnitSelectionContext);\n if (store == null) {\n return null;\n }\n return useStore(store, selector);\n}\n\nexport function useSelectedUnit() {\n return useUnitSelectionStore((state) => state.selectedUnitData);\n}\n\ninterface UnitSelectionStore {\n selectedUnit: number | null;\n selectedUnitData: BaseUnit | null;\n overlayPosition: RectBounds | null;\n onUnitSelected: UnitSelectDispatch;\n setSelectedUnit: (unit: number | null) => void;\n}\n\nexport interface ColumnClickData {\n unitID: number | null;\n unit: BaseUnit | null;\n target: HTMLElement | null;\n height: number;\n // Room for boundary IDs eventually\n}\n\nexport function UnitSelectionProvider<T extends BaseUnit>(props: {\n children: ReactNode;\n columnRef?: RefObject<HTMLElement>;\n units: T[];\n selectedUnit: number | null;\n onClickedColumn?: (columnClickData: ColumnClickData, event: Event) => void;\n onUnitSelected?: (unitID: number | null, unit: T | null) => void;\n}) {\n const [store] = useState(() =>\n createStore<UnitSelectionStore>((set) => ({\n selectedUnit: null,\n selectedUnitData: null,\n overlayPosition: null,\n setSelectedUnit(selectedUnit: number | null | BaseUnit) {\n if (selectedUnit == null) {\n set({ selectedUnit: null, selectedUnitData: null });\n return;\n // If it's a number, set the selected unit\n } else if (typeof selectedUnit === \"number\") {\n set({ selectedUnit, selectedUnitData: null });\n } else if (\"unit_id\" in selectedUnit) {\n set({\n selectedUnit: selectedUnit.unit_id,\n selectedUnitData: selectedUnit,\n });\n }\n },\n onUnitSelected: (\n input: number | T | null,\n target: HTMLElement = null,\n event: PointerEvent = null,\n ) => {\n if (input == null) {\n props.onUnitSelected?.(null, null);\n return set({\n selectedUnit: null,\n selectedUnitData: null,\n overlayPosition: null,\n });\n }\n\n let unit: T | null = null;\n if (typeof input === \"number\") {\n unit = props.units.find((u) => u.unit_id === input) || null;\n } else {\n unit = input;\n }\n\n const el = props.columnRef?.current;\n let overlayPosition = null;\n\n /** This is not the natural place to get positions within the column,\n * but it will work for now.\n */\n if (props.onClickedColumn) {\n // Infer height from top and bottom height of unit (because that's passed back with the call)\n //const py = event.y;\n //const [bottom, top] = getUnitHeightRange(unit, axisType);\n //const height = Math.abs(bottom - top);\n\n /** Ideally this would be defined at the column level */\n const columnClickData: ColumnClickData = {\n unitID: unit?.unit_id,\n unit,\n target,\n height: el?.getBoundingClientRect().height || 0,\n };\n props.onClickedColumn(columnClickData, event);\n }\n\n if (unit != null && el != null && target != null) {\n const rect = el.getBoundingClientRect();\n const targetRect = target.getBoundingClientRect();\n\n overlayPosition = {\n x: targetRect.left - rect.left,\n y: targetRect.top - rect.top,\n width: targetRect.width,\n height: targetRect.height,\n };\n }\n props.onUnitSelected?.(unit?.unit_id, unit);\n\n return set({\n selectedUnit: unit?.unit_id,\n selectedUnitData: unit,\n overlayPosition,\n });\n },\n })),\n );\n\n const { units, selectedUnit } = props;\n\n useEffect(() => {\n // Synchronize store with provided props\n if (selectedUnit != null) {\n const unitData = units?.find((u) => u.unit_id === selectedUnit);\n store.setState({ selectedUnit, selectedUnitData: unitData });\n } else {\n store.setState({ selectedUnit: null, selectedUnitData: null });\n }\n }, [selectedUnit, units]);\n\n return h(UnitSelectionContext.Provider, { value: store }, props.children);\n}\n\nexport function useUnitSelectionTarget(\n unit: IUnit,\n): [React.RefObject<HTMLElement>, boolean, (evt: Event) => void] {\n const ref = useRef<HTMLElement>();\n const selectedUnit = useSelectedUnit();\n const onSelectUnit = useUnitSelectionStore((state) => state.onUnitSelected);\n const selected = selectedUnit?.unit_id == unit.unit_id;\n\n const onClick = useCallback(\n (evt: Event) => {\n if (onSelectUnit == null) return;\n onSelectUnit(unit, ref.current, evt);\n evt.stopPropagation();\n },\n [unit, onSelectUnit],\n );\n\n useEffect(() => {\n if (!selected || onSelectUnit == null) return;\n // In case we haven't set the position of the unit (if we don't have a target), set the selected unit\n onSelectUnit(unit, ref.current, null);\n\n // Scroll the unit into view\n ref.current?.scrollIntoView({\n behavior: \"smooth\",\n block: \"center\",\n inline: \"nearest\",\n });\n }, [selected, onSelectUnit]);\n\n return [ref, selected, onClick];\n}\n\nexport function UnitKeyboardNavigation<T extends BaseUnit>({\n units,\n}: {\n units: T[];\n}) {\n const selectedUnit = useSelectedUnit();\n const selectUnit = useUnitSelectionDispatch();\n\n const ix = units.findIndex((unit) => unit.unit_id === selectedUnit?.unit_id);\n\n const keyMap = {\n 38: ix - 1,\n 40: ix + 1,\n };\n\n useKeyHandler(\n (event) => {\n const nextIx = keyMap[event.keyCode];\n if (nextIx == null || nextIx < 0 || nextIx >= units.length) return;\n selectUnit(units[nextIx], null, null);\n event.stopPropagation();\n },\n [units, ix],\n );\n return null;\n}\n"],"names":["$2lWH8$macrostrathyper","useKeyHandler","$2lWH8$useKeyHandler","createContext","$2lWH8$createContext","useContext","$2lWH8$useContext","useState","$2lWH8$useState","useEffect","$2lWH8$useEffect","useRef","$2lWH8$useRef","useCallback","$2lWH8$useCallback","useStore","$2lWH8$useStore","createStore","$2lWH8$createStore","$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$cfa36458f00f4b0e$exports","$cfa36458f00f4b0e$export$77a278d5ca56e309","$cfa36458f00f4b0e$export$b220b1d3591dc9e5","$cfa36458f00f4b0e$export$f0dd93f90aa8e5da","$cfa36458f00f4b0e$export$f19d75b1d4b676a4","$cfa36458f00f4b0e$export$cbbec12b1451fe7d","$cfa36458f00f4b0e$export$70f5ee19650fc7d1","$cfa36458f00f4b0e$var$UnitSelectionContext","store","state","onUnitSelected","selector","selectedUnitData","props","selectedUnit","overlayPosition","setSelectedUnit","unit_id","input","target","event","unit","units","find","u","el","columnRef","current","onClickedColumn","columnClickData","unitID","height","getBoundingClientRect","rect","targetRect","x","left","y","top","width","unitData","setState","Provider","value","children","ref","onSelectUnit","selected","onClick","evt","stopPropagation","scrollIntoView","behavior","block","inline","selectUnit","ix","findIndex","keyMap","nextIx","keyCode","length","useUnitSelectionDispatch","useUnitSelectionStore","useSelectedUnit","UnitSelectionProvider","useUnitSelectionTarget","UnitKeyboardNavigation"],"version":3,"file":"column-views.0beae29d.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.32344397.js";import"./column-views.7d45bbeb.js";import{useMemo as e,useCallback as r,useEffect as t}from"react";import{setGeoJSON as n,buildGeoJSONSource as l}from"@macrostrat/mapbox-utils";import{useMapRef as o,useMapStyleOperator as i}from"@macrostrat/mapbox-react";var a=globalThis,u={},s={},c=a.parcelRequirea149;null==c&&((c=function(e){if(e in u)return u[e].exports;if(e in s){var r=s[e];delete s[e];var t={id:e,exports:{}};return u[e]=t,r.call(t.exports,t,t.exports),t.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){s[e]=r},a.parcelRequirea149=c),c.register;var p=c("c4zVj"),d=c("iVYEX");function f(l){let{showTriangulation:a=!1}=l,u=(0,p.useColumnNavigationStore)(e=>e.columns),s=(0,p.useColumnNavigationStore)(e=>e.selectedColumn),c=(0,p.useColumnNavigationStore)(e=>e.selectColumn),f=e(()=>u&&0!=u.length?(0,d.buildTriangulation)(u):null,[u]),m=o().current,v=e(()=>{if(null==u||null==f||null==m)return null;let e=u.findIndex(e=>e.properties.col_id==s),r=f.tri.delaunay.neighbors[e];return(0,d.buildKeyMapping)(r,f.centroids,e,e=>{let r=m.project(e);return[r.x,r.y]})},[s,u,f,m]),b=r(e=>{if(null==v)return;let r=v[e.which];if(null!=r)return e.preventDefault(),e.stopPropagation(),c(u[r].id),!1},[v,c]);return t(()=>{if(null==m)return;let e=m.getCanvas();return e.addEventListener("keydown",b),()=>{e.removeEventListener("keydown",b)}},[m,b]),i(e=>{if(null==f||!a)return;let{features:r}=f.tri.links();n(e,"column-links",{type:"FeatureCollection",features:r})},[f,a]),null}function m(e="purple"){return{sources:{"column-links":l()},layers:[{id:"column-links",type:"line",source:"column-links",paint:{"line-color":e,"line-width":1.5}},{id:"column-centers",type:"circle",source:"column-links",paint:{"circle-radius":2,"circle-color":e}}]}}export{f as ColumnKeyboardNavigation,m as buildKeyboardNavigationStyle};
2
- //# sourceMappingURL=column-views.6b8424fd.js.map
1
+ import"./column-views.cd54f1b1.js";import"./column-views.7d45bbeb.js";import{useMemo as e,useCallback as r,useEffect as t}from"react";import{setGeoJSON as n,buildGeoJSONSource as l}from"@macrostrat/mapbox-utils";import{useMapRef as o,useMapStyleOperator as i}from"@macrostrat/mapbox-react";var a=globalThis,u={},s={},c=a.parcelRequirea149;null==c&&((c=function(e){if(e in u)return u[e].exports;if(e in s){var r=s[e];delete s[e];var t={id:e,exports:{}};return u[e]=t,r.call(t.exports,t,t.exports),t.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){s[e]=r},a.parcelRequirea149=c),c.register;var p=c("c4zVj"),d=c("iVYEX");function f(l){let{showTriangulation:a=!1}=l,u=(0,p.useColumnNavigationStore)(e=>e.columns),s=(0,p.useColumnNavigationStore)(e=>e.selectedColumn),c=(0,p.useColumnNavigationStore)(e=>e.selectColumn),f=e(()=>u&&0!=u.length?(0,d.buildTriangulation)(u):null,[u]),m=o().current,v=e(()=>{if(null==u||null==f||null==m)return null;let e=u.findIndex(e=>e.properties.col_id==s),r=f.tri.delaunay.neighbors[e];return(0,d.buildKeyMapping)(r,f.centroids,e,e=>{let r=m.project(e);return[r.x,r.y]})},[s,u,f,m]),b=r(e=>{if(null==v)return;let r=v[e.which];if(null!=r)return e.preventDefault(),e.stopPropagation(),c(u[r].id),!1},[v,c]);return t(()=>{if(null==m)return;let e=m.getCanvas();return e.addEventListener("keydown",b),()=>{e.removeEventListener("keydown",b)}},[m,b]),i(e=>{if(null==f||!a)return;let{features:r}=f.tri.links();n(e,"column-links",{type:"FeatureCollection",features:r})},[f,a]),null}function m(e="purple"){return{sources:{"column-links":l()},layers:[{id:"column-links",type:"line",source:"column-links",paint:{"line-color":e,"line-width":1.5}},{id:"column-centers",type:"circle",source:"column-links",paint:{"circle-radius":2,"circle-color":e}}]}}export{f as ColumnKeyboardNavigation,m as buildKeyboardNavigationStyle};
2
+ //# sourceMappingURL=column-views.0f401891.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,A,Q,W,C,C,e,C,C,a,C,K,O,A,Q,c,C,C,sB,C,K,0B,A,Q,a,C,C,uB,C,K,0B,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,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U,CAAC,EAAM,KAAK,CAAC,CAC5C,GAAI,AAAgB,MAAhB,EAKJ,OAJA,EAAM,cAAc,GACpB,EAAM,eAAe,GAErB,EAAa,CAAO,CAAC,EAAa,CAAC,EAAE,EAC9B,CAAA,CACT,EACA,CAAC,EAAY,EAAa,EA4B5B,OAzBA,AAAA,EAAU,KACR,GAAI,AAAO,MAAP,EAAa,OACjB,IAAM,EAAS,EAAI,SAAS,GAE5B,OADA,EAAO,gBAAgB,CAAC,UAAW,GAC5B,KACL,EAAO,mBAAmB,CAAC,UAAW,EACxC,CACF,EAAG,CAAC,EAAK,EAAU,EAEnB,AAAA,EACE,AAAC,IACC,GAAI,AAAW,MAAX,GAAmB,CAAC,EAAmB,OAC3C,GAAM,CAAA,SAAE,CAAQ,CAAE,CAAG,EAAQ,GAAG,CAAC,KAAK,GAEtC,AAAA,EAAW,EAAK,eAAgB,CAC9B,KAAM,oBACN,SAAA,CACF,EACF,EACA,CAAC,EAAS,EAAkB,EAMvB,IACT,CAEO,SAAS,EAA6B,EAAgB,QAAQ,EACnE,MAAO,CACL,QAAS,CACP,eAAgB,AAAA,GAElB,EACA,OAAQ,CACN,CACE,GAAI,eACJ,KAAM,OACN,OAAQ,eACR,MAAO,CACL,aAAc,EACd,aAAc,GAChB,CACF,EACA,CACE,GAAI,iBACJ,KAAM,SACN,OAAQ,eACR,MAAO,CACL,gBAAiB,EACjB,eAAgB,CAClB,CACF,EACD,AACH,CACF,Q,K,wB,C,K,4B","sources":["<anon>","packages/column-views/src/maps/column-navigation/mapbox/keyboard-navigation.ts"],"sourcesContent":["import \"./column-views.32344397.js\";\nimport \"./column-views.7d45bbeb.js\";\nimport {useMemo as $6HCEc$useMemo, useCallback as $6HCEc$useCallback, useEffect as $6HCEc$useEffect} from \"react\";\nimport {setGeoJSON as $6HCEc$setGeoJSON, buildGeoJSONSource as $6HCEc$buildGeoJSONSource} from \"@macrostrat/mapbox-utils\";\nimport {useMapRef as $6HCEc$useMapRef, useMapStyleOperator as $6HCEc$useMapStyleOperator} from \"@macrostrat/mapbox-react\";\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\nvar $c4zVj = parcelRequire(\"c4zVj\");\n\nvar $iVYEX = parcelRequire(\"iVYEX\");\nfunction $ee9901df79ff88e8$export$8c41dd563753848(props) {\n /** Keyboard navigation of columns using a Delaunay triangulation */ const { showTriangulation: showTriangulation = false } = props;\n const columns = (0, $c4zVj.useColumnNavigationStore)((state)=>state.columns);\n const col_id = (0, $c4zVj.useColumnNavigationStore)((state)=>state.selectedColumn);\n const selectColumn = (0, $c4zVj.useColumnNavigationStore)((state)=>state.selectColumn);\n const voronoi = (0, $6HCEc$useMemo)(()=>{\n if (!columns || columns.length == 0) return null;\n return (0, $iVYEX.buildTriangulation)(columns);\n }, [\n columns\n ]);\n const mapRef = (0, $6HCEc$useMapRef)();\n const map = mapRef.current;\n const keyMapping = (0, $6HCEc$useMemo)(()=>{\n if (columns == null || voronoi == null || map == null) return null;\n const projection = (d)=>{\n const pt = map.project(d);\n return [\n pt.x,\n pt.y\n ];\n };\n const currentIndex = columns.findIndex((d)=>d.properties.col_id == col_id);\n const neighbors = voronoi.tri.delaunay.neighbors[currentIndex];\n return (0, $iVYEX.buildKeyMapping)(neighbors, voronoi.centroids, currentIndex, projection);\n }, [\n col_id,\n columns,\n voronoi,\n map\n ]);\n const onKeyDown = (0, $6HCEc$useCallback)((event)=>{\n if (keyMapping == null) return;\n const nextColumnIx = keyMapping[event.which];\n if (nextColumnIx == null) return;\n event.preventDefault();\n event.stopPropagation();\n // @ts-ignore\n selectColumn(columns[nextColumnIx].id);\n return false;\n }, [\n keyMapping,\n selectColumn\n ]);\n (0, $6HCEc$useEffect)(()=>{\n if (map == null) return;\n const canvas = map.getCanvas();\n canvas.addEventListener(\"keydown\", onKeyDown);\n return ()=>{\n canvas.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [\n map,\n onKeyDown\n ]);\n (0, $6HCEc$useMapStyleOperator)((map)=>{\n if (voronoi == null || !showTriangulation) return;\n const { features: features } = voronoi.tri.links();\n (0, $6HCEc$setGeoJSON)(map, \"column-links\", {\n type: \"FeatureCollection\",\n features: features\n });\n }, [\n voronoi,\n showTriangulation\n ]);\n //if (neighbors == null) return null;\n //const neighborFeatures = neighbors.map((d) => features[d]);\n return null;\n}\nfunction $ee9901df79ff88e8$export$c613fba0aabeee13(color = \"purple\") {\n return {\n sources: {\n \"column-links\": (0, $6HCEc$buildGeoJSONSource)()\n },\n layers: [\n {\n id: \"column-links\",\n type: \"line\",\n source: \"column-links\",\n paint: {\n \"line-color\": color,\n \"line-width\": 1.5\n }\n },\n {\n id: \"column-centers\",\n type: \"circle\",\n source: \"column-links\",\n paint: {\n \"circle-radius\": 2,\n \"circle-color\": color\n }\n }\n ]\n };\n}\n\n\nexport {$ee9901df79ff88e8$export$8c41dd563753848 as ColumnKeyboardNavigation, $ee9901df79ff88e8$export$c613fba0aabeee13 as buildKeyboardNavigationStyle};\n//# sourceMappingURL=column-views.6b8424fd.js.map\n","import { useCallback, useEffect, useMemo } from \"react\";\nimport { buildGeoJSONSource, setGeoJSON } from \"@macrostrat/mapbox-utils\";\nimport { useMapRef, useMapStyleOperator } from \"@macrostrat/mapbox-react\";\nimport { useColumnNavigationStore } from \"./state\";\nimport {\n buildTriangulation,\n buildKeyMapping,\n} from \"../utils/keyboard-navigation\";\n\ninterface KeyboardNavProps {\n showTriangulation: boolean;\n}\n\nexport function ColumnKeyboardNavigation(props: KeyboardNavProps) {\n /** Keyboard navigation of columns using a Delaunay triangulation */\n const { showTriangulation = false } = props;\n const columns = useColumnNavigationStore((state) => state.columns);\n const col_id = useColumnNavigationStore((state) => state.selectedColumn);\n const selectColumn = useColumnNavigationStore((state) => state.selectColumn);\n\n const voronoi = useMemo(() => {\n if (!columns || columns.length == 0) return null;\n return buildTriangulation(columns);\n }, [columns]);\n\n const mapRef = useMapRef();\n const map = mapRef.current;\n\n const keyMapping = useMemo(() => {\n if (columns == null || voronoi == null || map == null) return null;\n\n const projection = (d) => {\n const pt = map.project(d);\n return [pt.x, pt.y];\n };\n\n const currentIndex = columns.findIndex(\n (d) => d.properties.col_id == col_id,\n );\n\n const neighbors = voronoi.tri.delaunay.neighbors[currentIndex];\n return buildKeyMapping(\n neighbors,\n voronoi.centroids,\n currentIndex,\n projection,\n );\n }, [col_id, columns, voronoi, map]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (keyMapping == null) return;\n const nextColumnIx = keyMapping[event.which];\n if (nextColumnIx == null) return;\n event.preventDefault();\n event.stopPropagation();\n // @ts-ignore\n selectColumn(columns[nextColumnIx].id);\n return false;\n },\n [keyMapping, selectColumn],\n );\n\n useEffect(() => {\n if (map == null) return;\n const canvas = map.getCanvas();\n canvas.addEventListener(\"keydown\", onKeyDown);\n return () => {\n canvas.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [map, onKeyDown]);\n\n useMapStyleOperator(\n (map) => {\n if (voronoi == null || !showTriangulation) return;\n const { features } = voronoi.tri.links();\n\n setGeoJSON(map, \"column-links\", {\n type: \"FeatureCollection\",\n features,\n });\n },\n [voronoi, showTriangulation],\n );\n\n //if (neighbors == null) return null;\n //const neighborFeatures = neighbors.map((d) => features[d]);\n\n return null;\n}\n\nexport function buildKeyboardNavigationStyle(color: string = \"purple\") {\n return {\n sources: {\n \"column-links\": buildGeoJSONSource(),\n //neighbors: buildGeoJSONSource(),\n },\n layers: [\n {\n id: \"column-links\",\n type: \"line\",\n source: \"column-links\",\n paint: {\n \"line-color\": color,\n \"line-width\": 1.5,\n },\n },\n {\n id: \"column-centers\",\n type: \"circle\",\n source: \"column-links\",\n paint: {\n \"circle-radius\": 2,\n \"circle-color\": color,\n },\n },\n ],\n };\n}\n"],"names":["useMemo","$6HCEc$useMemo","useCallback","$6HCEc$useCallback","useEffect","$6HCEc$useEffect","setGeoJSON","$6HCEc$setGeoJSON","buildGeoJSONSource","$6HCEc$buildGeoJSONSource","useMapRef","$6HCEc$useMapRef","useMapStyleOperator","$6HCEc$useMapStyleOperator","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$c4zVj","$iVYEX","$ee9901df79ff88e8$export$8c41dd563753848","props","showTriangulation","columns","useColumnNavigationStore","state","col_id","selectedColumn","selectColumn","voronoi","length","buildTriangulation","map","mapRef","current","keyMapping","currentIndex","findIndex","d","properties","neighbors","tri","delaunay","buildKeyMapping","centroids","pt","project","x","y","onKeyDown","event","nextColumnIx","which","preventDefault","stopPropagation","canvas","getCanvas","addEventListener","removeEventListener","features","links","type","$ee9901df79ff88e8$export$c613fba0aabeee13","color","sources","layers","source","paint","ColumnKeyboardNavigation","buildKeyboardNavigationStyle"],"version":3,"file":"column-views.6b8424fd.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,A,Q,W,C,C,e,C,C,a,C,K,O,A,Q,c,C,C,sB,C,K,0B,A,Q,a,C,C,uB,C,K,0B,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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,GAAI,AAAgB,MAAhB,EAKJ,OAJA,EAAM,cAAc,GACpB,EAAM,eAAe,GAErB,EAAa,CAAO,CAAC,EAAa,CAAC,EAAE,EAC9B,CAAA,CACT,EACA,CAAC,EAAY,EAAa,EA4B5B,OAzBA,AAAA,EAAU,KACR,GAAI,AAAO,MAAP,EAAa,OACjB,IAAM,EAAS,EAAI,SAAS,GAE5B,OADA,EAAO,gBAAgB,CAAC,UAAW,GAC5B,KACL,EAAO,mBAAmB,CAAC,UAAW,EACxC,CACF,EAAG,CAAC,EAAK,EAAU,EAEnB,AAAA,EACE,AAAC,IACC,GAAI,AAAW,MAAX,GAAmB,CAAC,EAAmB,OAC3C,GAAM,CAAA,SAAE,CAAQ,CAAE,CAAG,EAAQ,GAAG,CAAC,KAAK,GAEtC,AAAA,EAAW,EAAK,eAAgB,CAC9B,KAAM,oBACN,SAAA,CACF,EACF,EACA,CAAC,EAAS,EAAkB,EAMvB,IACT,CAEO,SAAS,EAA6B,EAAgB,QAAQ,EACnE,MAAO,CACL,QAAS,CACP,eAAgB,AAAA,GAElB,EACA,OAAQ,CACN,CACE,GAAI,eACJ,KAAM,OACN,OAAQ,eACR,MAAO,CACL,aAAc,EACd,aAAc,GAChB,CACF,EACA,CACE,GAAI,iBACJ,KAAM,SACN,OAAQ,eACR,MAAO,CACL,gBAAiB,EACjB,eAAgB,CAClB,CACF,EACD,AACH,CACF,Q,K,wB,C,K,4B","sources":["<anon>","packages/column-views/src/maps/column-navigation/mapbox/keyboard-navigation.ts"],"sourcesContent":["import \"./column-views.cd54f1b1.js\";\nimport \"./column-views.7d45bbeb.js\";\nimport {useMemo as $6HCEc$useMemo, useCallback as $6HCEc$useCallback, useEffect as $6HCEc$useEffect} from \"react\";\nimport {setGeoJSON as $6HCEc$setGeoJSON, buildGeoJSONSource as $6HCEc$buildGeoJSONSource} from \"@macrostrat/mapbox-utils\";\nimport {useMapRef as $6HCEc$useMapRef, useMapStyleOperator as $6HCEc$useMapStyleOperator} from \"@macrostrat/mapbox-react\";\n\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\n\n\n\n\nvar $c4zVj = parcelRequire(\"c4zVj\");\n\nvar $iVYEX = parcelRequire(\"iVYEX\");\nfunction $ee9901df79ff88e8$export$8c41dd563753848(props) {\n /** Keyboard navigation of columns using a Delaunay triangulation */ const { showTriangulation: showTriangulation = false } = props;\n const columns = (0, $c4zVj.useColumnNavigationStore)((state)=>state.columns);\n const col_id = (0, $c4zVj.useColumnNavigationStore)((state)=>state.selectedColumn);\n const selectColumn = (0, $c4zVj.useColumnNavigationStore)((state)=>state.selectColumn);\n const voronoi = (0, $6HCEc$useMemo)(()=>{\n if (!columns || columns.length == 0) return null;\n return (0, $iVYEX.buildTriangulation)(columns);\n }, [\n columns\n ]);\n const mapRef = (0, $6HCEc$useMapRef)();\n const map = mapRef.current;\n const keyMapping = (0, $6HCEc$useMemo)(()=>{\n if (columns == null || voronoi == null || map == null) return null;\n const projection = (d)=>{\n const pt = map.project(d);\n return [\n pt.x,\n pt.y\n ];\n };\n const currentIndex = columns.findIndex((d)=>d.properties.col_id == col_id);\n const neighbors = voronoi.tri.delaunay.neighbors[currentIndex];\n return (0, $iVYEX.buildKeyMapping)(neighbors, voronoi.centroids, currentIndex, projection);\n }, [\n col_id,\n columns,\n voronoi,\n map\n ]);\n const onKeyDown = (0, $6HCEc$useCallback)((event)=>{\n if (keyMapping == null) return;\n const nextColumnIx = keyMapping[event.which];\n if (nextColumnIx == null) return;\n event.preventDefault();\n event.stopPropagation();\n // @ts-ignore\n selectColumn(columns[nextColumnIx].id);\n return false;\n }, [\n keyMapping,\n selectColumn\n ]);\n (0, $6HCEc$useEffect)(()=>{\n if (map == null) return;\n const canvas = map.getCanvas();\n canvas.addEventListener(\"keydown\", onKeyDown);\n return ()=>{\n canvas.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [\n map,\n onKeyDown\n ]);\n (0, $6HCEc$useMapStyleOperator)((map)=>{\n if (voronoi == null || !showTriangulation) return;\n const { features: features } = voronoi.tri.links();\n (0, $6HCEc$setGeoJSON)(map, \"column-links\", {\n type: \"FeatureCollection\",\n features: features\n });\n }, [\n voronoi,\n showTriangulation\n ]);\n //if (neighbors == null) return null;\n //const neighborFeatures = neighbors.map((d) => features[d]);\n return null;\n}\nfunction $ee9901df79ff88e8$export$c613fba0aabeee13(color = \"purple\") {\n return {\n sources: {\n \"column-links\": (0, $6HCEc$buildGeoJSONSource)()\n },\n layers: [\n {\n id: \"column-links\",\n type: \"line\",\n source: \"column-links\",\n paint: {\n \"line-color\": color,\n \"line-width\": 1.5\n }\n },\n {\n id: \"column-centers\",\n type: \"circle\",\n source: \"column-links\",\n paint: {\n \"circle-radius\": 2,\n \"circle-color\": color\n }\n }\n ]\n };\n}\n\n\nexport {$ee9901df79ff88e8$export$8c41dd563753848 as ColumnKeyboardNavigation, $ee9901df79ff88e8$export$c613fba0aabeee13 as buildKeyboardNavigationStyle};\n//# sourceMappingURL=column-views.0f401891.js.map\n","import { useCallback, useEffect, useMemo } from \"react\";\nimport { buildGeoJSONSource, setGeoJSON } from \"@macrostrat/mapbox-utils\";\nimport { useMapRef, useMapStyleOperator } from \"@macrostrat/mapbox-react\";\nimport { useColumnNavigationStore } from \"./state\";\nimport {\n buildTriangulation,\n buildKeyMapping,\n} from \"../utils/keyboard-navigation\";\n\ninterface KeyboardNavProps {\n showTriangulation: boolean;\n}\n\nexport function ColumnKeyboardNavigation(props: KeyboardNavProps) {\n /** Keyboard navigation of columns using a Delaunay triangulation */\n const { showTriangulation = false } = props;\n const columns = useColumnNavigationStore((state) => state.columns);\n const col_id = useColumnNavigationStore((state) => state.selectedColumn);\n const selectColumn = useColumnNavigationStore((state) => state.selectColumn);\n\n const voronoi = useMemo(() => {\n if (!columns || columns.length == 0) return null;\n return buildTriangulation(columns);\n }, [columns]);\n\n const mapRef = useMapRef();\n const map = mapRef.current;\n\n const keyMapping = useMemo(() => {\n if (columns == null || voronoi == null || map == null) return null;\n\n const projection = (d) => {\n const pt = map.project(d);\n return [pt.x, pt.y];\n };\n\n const currentIndex = columns.findIndex(\n (d) => d.properties.col_id == col_id,\n );\n\n const neighbors = voronoi.tri.delaunay.neighbors[currentIndex];\n return buildKeyMapping(\n neighbors,\n voronoi.centroids,\n currentIndex,\n projection,\n );\n }, [col_id, columns, voronoi, map]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (keyMapping == null) return;\n const nextColumnIx = keyMapping[event.which];\n if (nextColumnIx == null) return;\n event.preventDefault();\n event.stopPropagation();\n // @ts-ignore\n selectColumn(columns[nextColumnIx].id);\n return false;\n },\n [keyMapping, selectColumn],\n );\n\n useEffect(() => {\n if (map == null) return;\n const canvas = map.getCanvas();\n canvas.addEventListener(\"keydown\", onKeyDown);\n return () => {\n canvas.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [map, onKeyDown]);\n\n useMapStyleOperator(\n (map) => {\n if (voronoi == null || !showTriangulation) return;\n const { features } = voronoi.tri.links();\n\n setGeoJSON(map, \"column-links\", {\n type: \"FeatureCollection\",\n features,\n });\n },\n [voronoi, showTriangulation],\n );\n\n //if (neighbors == null) return null;\n //const neighborFeatures = neighbors.map((d) => features[d]);\n\n return null;\n}\n\nexport function buildKeyboardNavigationStyle(color: string = \"purple\") {\n return {\n sources: {\n \"column-links\": buildGeoJSONSource(),\n //neighbors: buildGeoJSONSource(),\n },\n layers: [\n {\n id: \"column-links\",\n type: \"line\",\n source: \"column-links\",\n paint: {\n \"line-color\": color,\n \"line-width\": 1.5,\n },\n },\n {\n id: \"column-centers\",\n type: \"circle\",\n source: \"column-links\",\n paint: {\n \"circle-radius\": 2,\n \"circle-color\": color,\n },\n },\n ],\n };\n}\n"],"names":["useMemo","$6HCEc$useMemo","useCallback","$6HCEc$useCallback","useEffect","$6HCEc$useEffect","setGeoJSON","$6HCEc$setGeoJSON","buildGeoJSONSource","$6HCEc$buildGeoJSONSource","useMapRef","$6HCEc$useMapRef","useMapStyleOperator","$6HCEc$useMapStyleOperator","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","$c4zVj","$iVYEX","$ee9901df79ff88e8$export$8c41dd563753848","props","showTriangulation","columns","useColumnNavigationStore","state","col_id","selectedColumn","selectColumn","voronoi","length","buildTriangulation","map","mapRef","current","keyMapping","currentIndex","findIndex","d","properties","neighbors","tri","delaunay","buildKeyMapping","centroids","pt","project","x","y","onKeyDown","event","nextColumnIx","which","preventDefault","stopPropagation","canvas","getCanvas","addEventListener","removeEventListener","features","links","type","$ee9901df79ff88e8$export$c613fba0aabeee13","color","sources","layers","source","paint","ColumnKeyboardNavigation","buildKeyboardNavigationStyle"],"version":3,"file":"column-views.0f401891.js.map","sourceRoot":"../../../../"}
@@ -0,0 +1,2 @@
1
+ import"./column-views.012fa10c.js";import"./column-views.dbb4a46b.js";import"./column-views.7cc1a14f.js";import e from"@macrostrat/hyper";import{ColumnAxisType as t}from"@macrostrat/column-components";function n(e,t,n,i){Object.defineProperty(e,t,{get:n,set:i,enumerable:!0,configurable:!0})}var i=globalThis,o={},r={},a=i.parcelRequirea149;null==a&&((a=function(e){if(e in o)return o[e].exports;if(e in r){var t=r[e];delete r[e];var n={id:e,exports:{}};return o[e]=n,t.call(n.exports,n,n.exports),n.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,t){r[e]=t},i.parcelRequirea149=a),a.register;var h={};n(h,"standardizeMeasurementHeight",()=>m),n(h,"mergeHeightRanges",()=>g),n(h,"BaseMeasurementsColumn",()=>p),n(h,"TruncatedList",()=>c),n(h,"groupNotesByPixelDistance",()=>f);var l=a("ff1AM"),s=a("iWhRv"),u=a("6KYbn");let d=e.styled(l&&l.__esModule?l.default:l);function m(e,t,n){if("height"in e)return e;let i=t.find(t=>t.unit_id===e.unit_id);if(null==i)return null;if(null!=e.unit_rel_pos){let t=(0,s.getPositionWithinUnit)(e.unit_rel_pos,i,n);return null==t?null:{height:t}}{let[e,t]=(0,s.getUnitHeightRange)(i,n);return{height:e,top_height:t}}}function g(e,n){let i,o,r=[];for(let t of e)r.push(t.height),null!=t.top_height&&r.push(t.top_height);return(n===t.AGE||n===t.DEPTH?(i=Math.max(...r),o=Math.min(...r)):(i=Math.min(...r),o=Math.max(...r)),o===i)?{height:i}:{height:i,top_height:o}}function p({data:e,noteComponent:t,width:n=500,paddingLeft:i=40,className:o,deltaConnectorAttachment:r,focusedNoteComponent:a}){return null==e?null:d("div.measurements-column",{className:o},d(u.ColumnNotes,{width:n,paddingLeft:i,notes:e,noteComponent:t,deltaConnectorAttachment:r,focusedNoteComponent:a}))}function c({data:e,className:t,maxItems:n=5,itemRenderer:i=e=>d("span",e.data)}){let o=null,r=e;if(e.length>n){let t=e.length-n;r=e.slice(0,n),o=d("li.too-many",`and ${t} more`)}return d("ul.truncated-list",{className:t},[r.map((e,t)=>d("li.element",{key:t},d(i,{data:e}))),o])}function f(e,n,i,o){if(0===e.length||o<=0)return e;i===t.AGE||i===t.DEPTH?e.sort((e,t)=>t.height-e.height):e.sort((e,t)=>e.height-t.height);let r=[],a=null,h=1/0;for(let l of e)if(h-n(l.top_height??l.height)<=o){if(null==a)throw Error("Current group is null when it shouldn't be");a.data.push(...l.data);let e=l.top_height??l.height;i===t.AGE||i===t.DEPTH?a.top_height=Math.min(a.top_height,e):a.top_height=Math.max(a.top_height,e),a.key=`${a.height}-${a.top_height}`}else h=n((a={...l,data:[...l.data]}).height)??n(a.top_height)??1/0,r.push(a);return r}export{m as standardizeMeasurementHeight,g as mergeHeightRanges,p as BaseMeasurementsColumn,c as TruncatedList,f as groupNotesByPixelDistance};
2
+ //# sourceMappingURL=column-views.1d064426.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"A,M,6C,A,O,6C,A,O,6C,A,Q,M,mB,A,Q,kB,C,K,+B,C,S,E,C,C,C,C,C,C,C,E,O,c,C,E,E,C,I,E,I,E,W,C,E,a,C,C,E,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,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,+B,I,G,E,E,oB,I,G,E,E,yB,I,G,E,E,gB,I,G,E,E,4B,I,G,I,E,E,S,E,E,S,E,E,SCOA,IAAM,EAAI,AAAA,EAAM,MAAM,C,AAAC,G,AAAA,E,U,C,AAAA,E,O,CAAA,GAiChB,SAAS,EACd,CAAmC,CACnC,CAAiB,CACjB,CAAwB,EAKxB,GAAI,WAAY,EACd,OAAO,EAET,IAAM,EAAO,EAAM,IAAI,CAAC,AAAC,GAAM,EAAE,OAAO,GAAK,EAAI,OAAO,EACxD,GAAI,AAAQ,MAAR,EACF,OAAO,KAET,GAAI,AAAoB,MAApB,EAAI,YAAY,CAAU,CAC5B,IAAM,EAAM,AAAA,CAAA,EAAA,EAAA,qBAAoB,AAApB,EAAsB,EAAI,YAAY,CAAE,EAAM,UAC1D,AAAI,AAAO,MAAP,EAAoB,KACjB,C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CAAA,EAAe,CAAE,GAAG,CAAC,CAAE,KAAM,IAAI,EAAE,IAAI,CAAC,AAAC,CAAA,EAEpB,MAAM,GACzB,EAAM,EAAa,UAAU,GAC7B,IACF,EAAY,IAAI,CAAC,GAIrB,OAAO,CACT,Q,K,4B,C,K,iB,C,K,sB,C,K,a,C,K,yB","sources":["<anon>","packages/column-views/src/facets/measurements/base.ts"],"sourcesContent":["import \"./column-views.012fa10c.js\";\nimport \"./column-views.dbb4a46b.js\";\nimport \"./column-views.7cc1a14f.js\";\nimport $7Z3it$macrostrathyper from \"@macrostrat/hyper\";\nimport {ColumnAxisType as $7Z3it$ColumnAxisType} from \"@macrostrat/column-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 $7e05644cbb5d2dbb$exports = {};\n\n$parcel$export($7e05644cbb5d2dbb$exports, \"standardizeMeasurementHeight\", () => $7e05644cbb5d2dbb$export$9d101e1fcb2166a6);\n$parcel$export($7e05644cbb5d2dbb$exports, \"mergeHeightRanges\", () => $7e05644cbb5d2dbb$export$8f2afa8ddee7317e);\n$parcel$export($7e05644cbb5d2dbb$exports, \"BaseMeasurementsColumn\", () => $7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d);\n$parcel$export($7e05644cbb5d2dbb$exports, \"TruncatedList\", () => $7e05644cbb5d2dbb$export$653e47a7a0da0f0d);\n$parcel$export($7e05644cbb5d2dbb$exports, \"groupNotesByPixelDistance\", () => $7e05644cbb5d2dbb$export$4e649f790614b299);\n\n\nvar $ff1AM = parcelRequire(\"ff1AM\");\n\nvar $iWhRv = parcelRequire(\"iWhRv\");\n\nvar $6KYbn = parcelRequire(\"6KYbn\");\n\nconst $7e05644cbb5d2dbb$var$h = (0, $7Z3it$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($ff1AM))));\nfunction $7e05644cbb5d2dbb$export$9d101e1fcb2166a6(pos, units, axisType) {\n /** Get a standardized height representation from position information for\n * a measurement\n */ if (\"height\" in pos) return pos;\n const unit = units.find((u)=>u.unit_id === pos.unit_id);\n if (unit == null) return null;\n if (pos.unit_rel_pos != null) {\n const res = (0, $iWhRv.getPositionWithinUnit)(pos.unit_rel_pos, unit, axisType);\n if (res == null) return null;\n return {\n height: res\n };\n } else {\n const [height, top_height] = (0, $iWhRv.getUnitHeightRange)(unit, axisType);\n return {\n height: height,\n top_height: top_height\n };\n }\n}\nfunction $7e05644cbb5d2dbb$export$8f2afa8ddee7317e(data, axisType) {\n /** Merge multiple height ranges into a single range */ const heights = [];\n for (const d of data){\n heights.push(d.height);\n if (d.top_height != null) heights.push(d.top_height);\n }\n let height;\n let top_height;\n if (axisType === (0, $7Z3it$ColumnAxisType).AGE || axisType === (0, $7Z3it$ColumnAxisType).DEPTH) {\n height = Math.max(...heights);\n top_height = Math.min(...heights);\n } else {\n height = Math.min(...heights);\n top_height = Math.max(...heights);\n }\n if (top_height === height) return {\n height: height\n };\n return {\n height: height,\n top_height: top_height\n };\n}\nfunction $7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d({ data: data, noteComponent: noteComponent, width: width = 500, paddingLeft: paddingLeft = 40, className: className, deltaConnectorAttachment: deltaConnectorAttachment, focusedNoteComponent: focusedNoteComponent }) {\n if (data == null) return null;\n return $7e05644cbb5d2dbb$var$h(\"div.measurements-column\", {\n className: className\n }, $7e05644cbb5d2dbb$var$h((0, $6KYbn.ColumnNotes), {\n width: width,\n paddingLeft: paddingLeft,\n notes: data,\n noteComponent: noteComponent,\n deltaConnectorAttachment: deltaConnectorAttachment,\n focusedNoteComponent: focusedNoteComponent\n }));\n}\nfunction $7e05644cbb5d2dbb$export$653e47a7a0da0f0d({ data: data, className: className, maxItems: maxItems = 5, itemRenderer: itemRenderer = (p)=>$7e05644cbb5d2dbb$var$h(\"span\", p.data) }) {\n let tooMany = null;\n let d1 = data;\n if (data.length > maxItems) {\n const n = data.length - maxItems;\n d1 = data.slice(0, maxItems);\n tooMany = $7e05644cbb5d2dbb$var$h(\"li.too-many\", `and ${n} more`);\n }\n return $7e05644cbb5d2dbb$var$h(\"ul.truncated-list\", {\n className: className\n }, [\n d1.map((d, i)=>{\n return $7e05644cbb5d2dbb$var$h(\"li.element\", {\n key: i\n }, $7e05644cbb5d2dbb$var$h(itemRenderer, {\n data: d\n }));\n }),\n tooMany\n ]);\n}\nfunction $7e05644cbb5d2dbb$export$4e649f790614b299(data, scale, axisType, groupDistance) {\n /** Group notes that are within a certain pixel distance of each other\n * in display space\n */ if (data.length === 0 || groupDistance <= 0) return data;\n if (axisType === (0, $7Z3it$ColumnAxisType).AGE || axisType === (0, $7Z3it$ColumnAxisType).DEPTH) data.sort((a, b)=>b.height - a.height);\n else // Sort data by height (ascending up the column)\n data.sort((a, b)=>a.height - b.height);\n const groupedData = [];\n let currentGroup = null;\n let currentGroupPosition = Infinity;\n for (const d of data){\n // Check distance from current max position\n // Pixels go up as we go down in the section\n // The _top_ of the next group must be within groupDistance of the\n // _bottom_ of the current group. This makes sure that we don't collapse\n // groups that are separated by a large distance\n const distance = currentGroupPosition - scale(d.top_height ?? d.height);\n if (distance <= groupDistance) {\n if (currentGroup == null) throw new Error(\"Current group is null when it shouldn't be\");\n // Merge into current group\n currentGroup.data.push(...d.data);\n // Update height range\n const top_height = d.top_height ?? d.height;\n if (axisType === (0, $7Z3it$ColumnAxisType).AGE || axisType === (0, $7Z3it$ColumnAxisType).DEPTH) // Inverted axis\n currentGroup.top_height = Math.min(currentGroup.top_height, top_height);\n else currentGroup.top_height = Math.max(currentGroup.top_height, top_height);\n currentGroup.key = `${currentGroup.height}-${currentGroup.top_height}`;\n } else {\n // Start a new group\n currentGroup = {\n ...d,\n data: [\n ...d.data\n ]\n };\n currentGroupPosition = scale(currentGroup.height) ?? scale(currentGroup.top_height) ?? Infinity;\n groupedData.push(currentGroup);\n }\n }\n return groupedData;\n}\n\n\nexport {$7e05644cbb5d2dbb$export$9d101e1fcb2166a6 as standardizeMeasurementHeight, $7e05644cbb5d2dbb$export$8f2afa8ddee7317e as mergeHeightRanges, $7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d as BaseMeasurementsColumn, $7e05644cbb5d2dbb$export$653e47a7a0da0f0d as TruncatedList, $7e05644cbb5d2dbb$export$4e649f790614b299 as groupNotesByPixelDistance};\n//# sourceMappingURL=column-views.1d064426.js.map\n","import hyper from \"@macrostrat/hyper\";\nimport styles from \"./base.module.sass\";\nimport { getPositionWithinUnit, getUnitHeightRange } from \"../../prepare-units\";\nimport { ColumnNotes } from \"../../notes\";\nimport { UnitLong } from \"@macrostrat/api-types\";\nimport { ColumnAxisType } from \"@macrostrat/column-components\";\nimport type { CompositeColumnScale } from \"../../units\";\nconst h = hyper.styled(styles);\n\ntype GetHeightRangeFn<T> = (\n data: T,\n unit: UnitLong | null,\n axisType: ColumnAxisType,\n) => MeasurementHeightData;\n\nexport interface BaseMeasurementsColumnProps<T> {\n data: T[];\n noteComponent?: any;\n width?: number;\n paddingLeft?: number;\n className?: string;\n // TODO: these props are confusing\n getUnitID?: (d: T) => number | string;\n isMatchingUnit?: (d: T, unit: UnitLong) => boolean;\n getHeightRange?: GetHeightRangeFn<T>;\n deltaConnectorAttachment?: number;\n}\n\nexport interface ColumnMeasurementData<T = any> extends MeasurementHeightData {\n data: T;\n id: string | number;\n}\n\ntype MeasurementPositionInformation =\n | MeasurementHeightData\n | {\n unit_id: number;\n unit_rel_pos?: number;\n };\n\nexport function standardizeMeasurementHeight(\n pos: MeasurementPositionInformation,\n units: UnitLong[],\n axisType: ColumnAxisType,\n): MeasurementHeightData | null {\n /** Get a standardized height representation from position information for\n * a measurement\n */\n if (\"height\" in pos) {\n return pos;\n }\n const unit = units.find((u) => u.unit_id === pos.unit_id);\n if (unit == null) {\n return null;\n }\n if (pos.unit_rel_pos != null) {\n const res = getPositionWithinUnit(pos.unit_rel_pos, unit, axisType);\n if (res == null) return null;\n return { height: res };\n } else {\n const [height, top_height] = getUnitHeightRange(unit, axisType);\n return { height, top_height };\n }\n}\n\nexport function mergeHeightRanges(\n data: MeasurementHeightData[],\n axisType: ColumnAxisType,\n): MeasurementHeightData {\n /** Merge multiple height ranges into a single range */\n const heights = [];\n\n for (const d of data) {\n heights.push(d.height);\n if (d.top_height != null) {\n heights.push(d.top_height);\n }\n }\n\n let height: number;\n let top_height: number;\n if (axisType === ColumnAxisType.AGE || axisType === ColumnAxisType.DEPTH) {\n height = Math.max(...heights);\n top_height = Math.min(...heights);\n } else {\n height = Math.min(...heights);\n top_height = Math.max(...heights);\n }\n\n if (top_height === height) {\n return { height };\n }\n return { height, top_height };\n}\n\nexport type MeasurementHeightData = {\n height: number;\n top_height?: number | null;\n};\n\nexport function BaseMeasurementsColumn({\n data,\n noteComponent,\n width = 500,\n paddingLeft = 40,\n className,\n deltaConnectorAttachment,\n focusedNoteComponent,\n}: BaseMeasurementsColumnProps<any>) {\n if (data == null) return null;\n\n return h(\n \"div.measurements-column\",\n { className },\n h(ColumnNotes, {\n width,\n paddingLeft,\n notes: data,\n noteComponent,\n deltaConnectorAttachment,\n focusedNoteComponent,\n }),\n );\n}\n\ninterface TruncatedListProps {\n data: any[];\n className?: string;\n maxItems?: number;\n itemRenderer?: (props: { data: any }) => any;\n}\n\nexport function TruncatedList({\n data,\n className,\n maxItems = 5,\n itemRenderer = (p) => h(\"span\", p.data),\n}: TruncatedListProps) {\n let tooMany = null;\n let d1 = data;\n if (data.length > maxItems) {\n const n = data.length - maxItems;\n d1 = data.slice(0, maxItems);\n tooMany = h(\"li.too-many\", `and ${n} more`);\n }\n\n return h(\"ul.truncated-list\", { className }, [\n d1.map((d, i) => {\n return h(\"li.element\", { key: i }, h(itemRenderer, { data: d }));\n }),\n tooMany,\n ]);\n}\n\nexport function groupNotesByPixelDistance<T = any>(\n data: ColumnMeasurementData<T[]>[],\n scale: CompositeColumnScale,\n axisType: ColumnAxisType,\n groupDistance: number,\n) {\n /** Group notes that are within a certain pixel distance of each other\n * in display space\n */\n if (data.length === 0 || groupDistance <= 0) return data;\n if (axisType === ColumnAxisType.AGE || axisType === ColumnAxisType.DEPTH) {\n data.sort((a, b) => b.height - a.height);\n } else {\n // Sort data by height (ascending up the column)\n data.sort((a, b) => a.height - b.height);\n }\n\n const groupedData: ColumnMeasurementData<T[]>[] = [];\n let currentGroup: ColumnMeasurementData<T[]> | null = null;\n let currentGroupPosition: number = Infinity;\n\n for (const d of data) {\n // Check distance from current max position\n // Pixels go up as we go down in the section\n\n // The _top_ of the next group must be within groupDistance of the\n // _bottom_ of the current group. This makes sure that we don't collapse\n // groups that are separated by a large distance\n const distance = currentGroupPosition - scale(d.top_height ?? d.height);\n\n if (distance <= groupDistance) {\n if (currentGroup == null) {\n throw new Error(\"Current group is null when it shouldn't be\");\n }\n // Merge into current group\n currentGroup.data.push(...d.data);\n // Update height range\n const top_height = d.top_height ?? d.height;\n if (\n axisType === ColumnAxisType.AGE ||\n axisType === ColumnAxisType.DEPTH\n ) {\n // Inverted axis\n currentGroup.top_height = Math.min(currentGroup.top_height, top_height);\n } else {\n currentGroup.top_height = Math.max(currentGroup.top_height, top_height);\n }\n currentGroup.key = `${currentGroup.height}-${currentGroup.top_height}`;\n } else {\n // Start a new group\n currentGroup = { ...d, data: [...d.data] };\n currentGroupPosition =\n scale(currentGroup.height) ??\n scale(currentGroup.top_height) ??\n Infinity;\n groupedData.push(currentGroup);\n }\n }\n\n return groupedData;\n}\n"],"names":["$7Z3it$macrostrathyper","ColumnAxisType","$7Z3it$ColumnAxisType","$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","$7e05644cbb5d2dbb$exports","$7e05644cbb5d2dbb$export$9d101e1fcb2166a6","$7e05644cbb5d2dbb$export$8f2afa8ddee7317e","$7e05644cbb5d2dbb$export$ce5c4f2fdf4e644d","$7e05644cbb5d2dbb$export$653e47a7a0da0f0d","$7e05644cbb5d2dbb$export$4e649f790614b299","$ff1AM","$iWhRv","$6KYbn","$7e05644cbb5d2dbb$var$h","styled","a","__esModule","default","pos","units","axisType","unit","find","u","unit_id","unit_rel_pos","res","getPositionWithinUnit","height","top_height","getUnitHeightRange","data","heights","d","push","AGE","DEPTH","Math","max","min","noteComponent","width","paddingLeft","className","deltaConnectorAttachment","focusedNoteComponent","ColumnNotes","notes","maxItems","itemRenderer","p","tooMany","d1","length","slice","map","i","key","scale","groupDistance","sort","b","groupedData","currentGroup","currentGroupPosition","Infinity","distance","standardizeMeasurementHeight","mergeHeightRanges","BaseMeasurementsColumn","TruncatedList","groupNotesByPixelDistance"],"version":3,"file":"column-views.1d064426.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.54363c13.js";import"./column-views.fcdc74c4.js";function e(e,r){return Object.keys(r).forEach(function(o){"default"===o||"__esModule"===o||Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[o]}})}),e}var r=globalThis,o={},t={},a=r.parcelRequirea149;null==a&&((a=function(e){if(e in o)return o[e].exports;if(e in t){var r=t[e];delete t[e];var a={id:e,exports:{}};return o[e]=a,r.call(a.exports,a,a.exports),a.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){t[e]=r},r.parcelRequirea149=a),a.register;var n={},i=a("lYiwV"),c=a("gIQRH");e(n,i),e(n,c);export{$2e0f3abda6f981c3$export$8e7d97509e84cc49 as ColumnCorrelationMap,$c36af3ba15da093b$export$72ffe141ebf87ef1 as ColumnCorrelationProvider,$c36af3ba15da093b$export$21398703d3a9bb4d as useCorrelationMapStore};
2
- //# sourceMappingURL=column-views.ce5904a6.js.map
1
+ import"./column-views.d818b387.js";import"./column-views.8e846c57.js";function e(e,r){return Object.keys(r).forEach(function(o){"default"===o||"__esModule"===o||Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[o]}})}),e}var r=globalThis,o={},t={},a=r.parcelRequirea149;null==a&&((a=function(e){if(e in o)return o[e].exports;if(e in t){var r=t[e];delete t[e];var a={id:e,exports:{}};return o[e]=a,r.call(a.exports,a,a.exports),a.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){t[e]=r},r.parcelRequirea149=a),a.register;var n={},i=a("lYiwV"),c=a("gIQRH");e(n,i),e(n,c);export{$2e0f3abda6f981c3$export$8e7d97509e84cc49 as ColumnCorrelationMap,$c36af3ba15da093b$export$72ffe141ebf87ef1 as ColumnCorrelationProvider,$c36af3ba15da093b$export$21398703d3a9bb4d as useCorrelationMapStore};
2
+ //# sourceMappingURL=column-views.2577dec0.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,S,E,E,S,E,E,G,E,E,U,6C,oB,C,6C,yB,C,6C,sB","sources":["<anon>","packages/column-views/src/maps/column-correlation/index.ts"],"sourcesContent":["import \"./column-views.54363c13.js\";\nimport \"./column-views.fcdc74c4.js\";\n\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $4a2a62442a98ced4$exports = {};\n\nvar $lYiwV = parcelRequire(\"lYiwV\");\n\nvar $gIQRH = parcelRequire(\"gIQRH\");\n$parcel$exportWildcard($4a2a62442a98ced4$exports, $lYiwV);\n$parcel$exportWildcard($4a2a62442a98ced4$exports, $gIQRH);\n\n\nexport {$2e0f3abda6f981c3$export$8e7d97509e84cc49 as ColumnCorrelationMap, $c36af3ba15da093b$export$72ffe141ebf87ef1 as ColumnCorrelationProvider, $c36af3ba15da093b$export$21398703d3a9bb4d as useCorrelationMapStore};\n//# sourceMappingURL=column-views.ce5904a6.js.map\n","export * from \"./core\";\nexport * from \"./state\";\n"],"names":["$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$4a2a62442a98ced4$exports","$lYiwV","$gIQRH","$2e0f3abda6f981c3$export$8e7d97509e84cc49","ColumnCorrelationMap","$c36af3ba15da093b$export$72ffe141ebf87ef1","ColumnCorrelationProvider","$c36af3ba15da093b$export$21398703d3a9bb4d","useCorrelationMapStore"],"version":3,"file":"column-views.ce5904a6.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,S,E,E,S,E,E,G,E,E,U,6C,oB,C,6C,yB,C,6C,sB","sources":["<anon>","packages/column-views/src/maps/column-correlation/index.ts"],"sourcesContent":["import \"./column-views.d818b387.js\";\nimport \"./column-views.8e846c57.js\";\n\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $4a2a62442a98ced4$exports = {};\n\nvar $lYiwV = parcelRequire(\"lYiwV\");\n\nvar $gIQRH = parcelRequire(\"gIQRH\");\n$parcel$exportWildcard($4a2a62442a98ced4$exports, $lYiwV);\n$parcel$exportWildcard($4a2a62442a98ced4$exports, $gIQRH);\n\n\nexport {$2e0f3abda6f981c3$export$8e7d97509e84cc49 as ColumnCorrelationMap, $c36af3ba15da093b$export$72ffe141ebf87ef1 as ColumnCorrelationProvider, $c36af3ba15da093b$export$21398703d3a9bb4d as useCorrelationMapStore};\n//# sourceMappingURL=column-views.2577dec0.js.map\n","export * from \"./core\";\nexport * from \"./state\";\n"],"names":["$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$4a2a62442a98ced4$exports","$lYiwV","$gIQRH","$2e0f3abda6f981c3$export$8e7d97509e84cc49","ColumnCorrelationMap","$c36af3ba15da093b$export$72ffe141ebf87ef1","ColumnCorrelationProvider","$c36af3ba15da093b$export$21398703d3a9bb4d","useCorrelationMapStore"],"version":3,"file":"column-views.2577dec0.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.94c84716.js";import"./column-views.d529d3aa.js";function e(e,r){return Object.keys(r).forEach(function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})}),e}var r=globalThis,a={},o={},t=r.parcelRequirea149;null==t&&((t=function(e){if(e in a)return a[e].exports;if(e in o){var r=o[e];delete o[e];var t={id:e,exports:{}};return a[e]=t,r.call(t.exports,t,t.exports),t.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){o[e]=r},r.parcelRequirea149=t),t.register;var n={},c=t("fIgv5"),f=t("c27x8");e(n,c),e(n,f);export{$44d1d5e5d8e823d1$export$821baedf611249f3 as ColumnNavigationMap,$5a7fd801cb316afa$export$c4313db718750a5a as ResizableMapFrame,$5a7fd801cb316afa$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap,$372e0c9189556f66$export$2254347cd20e6080 as MeasurementsLayer,$372e0c9189556f66$export$f177ff57c101017a as ColumnFeatures,$372e0c9189556f66$export$8c41dd563753848 as ColumnKeyboardNavigation,$372e0c9189556f66$export$f02cc02ad0e0bba3 as Columns,$372e0c9189556f66$export$4d8f6e6df85d9012 as ColumnCenters,$372e0c9189556f66$export$b9d912252344e099 as CurrentColumn};
2
- //# sourceMappingURL=column-views.45a03acc.js.map
1
+ import"./column-views.a14f0134.js";import"./column-views.d529d3aa.js";function e(e,r){return Object.keys(r).forEach(function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})}),e}var r=globalThis,a={},o={},t=r.parcelRequirea149;null==t&&((t=function(e){if(e in a)return a[e].exports;if(e in o){var r=o[e];delete o[e];var t={id:e,exports:{}};return a[e]=t,r.call(t.exports,t,t.exports),t.exports}var n=Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(e,r){o[e]=r},r.parcelRequirea149=t),t.register;var n={},c=t("fIgv5"),f=t("c27x8");e(n,c),e(n,f);export{$44d1d5e5d8e823d1$export$821baedf611249f3 as ColumnNavigationMap,$5a7fd801cb316afa$export$c4313db718750a5a as ResizableMapFrame,$5a7fd801cb316afa$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap,$372e0c9189556f66$export$2254347cd20e6080 as MeasurementsLayer,$372e0c9189556f66$export$f177ff57c101017a as ColumnFeatures,$372e0c9189556f66$export$8c41dd563753848 as ColumnKeyboardNavigation,$372e0c9189556f66$export$f02cc02ad0e0bba3 as Columns,$372e0c9189556f66$export$4d8f6e6df85d9012 as ColumnCenters,$372e0c9189556f66$export$b9d912252344e099 as CurrentColumn};
2
+ //# sourceMappingURL=column-views.2fe8feb9.js.map
@@ -1 +1 @@
1
- {"mappings":"A,M,6C,A,O,6C,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,S,E,E,S,E,E,G,E,E,U,6C,mB,C,6C,iB,C,6C,sB,C,6C,iB,C,6C,c,C,4C,wB,C,6C,O,C,6C,a,C,6C,a","sources":["<anon>","packages/column-views/src/maps/column-navigation/index.ts"],"sourcesContent":["import \"./column-views.94c84716.js\";\nimport \"./column-views.d529d3aa.js\";\n\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $7ff4e0023faa490a$exports = {};\n\nvar $fIgv5 = parcelRequire(\"fIgv5\");\n\nvar $c27x8 = parcelRequire(\"c27x8\");\n$parcel$exportWildcard($7ff4e0023faa490a$exports, $fIgv5);\n$parcel$exportWildcard($7ff4e0023faa490a$exports, $c27x8);\n\n\nexport {$44d1d5e5d8e823d1$export$821baedf611249f3 as ColumnNavigationMap, $5a7fd801cb316afa$export$c4313db718750a5a as ResizableMapFrame, $5a7fd801cb316afa$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap, $372e0c9189556f66$export$2254347cd20e6080 as MeasurementsLayer, $372e0c9189556f66$export$f177ff57c101017a as ColumnFeatures, $372e0c9189556f66$export$8c41dd563753848 as ColumnKeyboardNavigation, $372e0c9189556f66$export$f02cc02ad0e0bba3 as Columns, $372e0c9189556f66$export$4d8f6e6df85d9012 as ColumnCenters, $372e0c9189556f66$export$b9d912252344e099 as CurrentColumn};\n//# sourceMappingURL=column-views.45a03acc.js.map\n","export * from \"./mapbox\";\nexport * from \"./svg\";\n"],"names":["$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$7ff4e0023faa490a$exports","$fIgv5","$c27x8","$44d1d5e5d8e823d1$export$821baedf611249f3","ColumnNavigationMap","$5a7fd801cb316afa$export$c4313db718750a5a","ResizableMapFrame","$5a7fd801cb316afa$export$9595c40c7a4c4f7b","ColumnNavigationSVGMap","$372e0c9189556f66$export$2254347cd20e6080","MeasurementsLayer","$372e0c9189556f66$export$f177ff57c101017a","ColumnFeatures","$372e0c9189556f66$export$8c41dd563753848","ColumnKeyboardNavigation","$372e0c9189556f66$export$f02cc02ad0e0bba3","Columns","$372e0c9189556f66$export$4d8f6e6df85d9012","ColumnCenters","$372e0c9189556f66$export$b9d912252344e099","CurrentColumn"],"version":3,"file":"column-views.45a03acc.js.map","sourceRoot":"../../../../"}
1
+ {"mappings":"A,M,6C,A,O,6C,C,S,E,C,C,C,E,O,O,I,C,G,O,C,S,C,E,Y,G,A,e,G,O,S,C,c,C,I,C,E,I,O,c,C,E,E,C,W,C,E,I,W,O,C,C,E,A,C,E,G,C,C,I,E,W,E,C,E,E,C,E,E,E,iB,A,O,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,E,Q,C,I,E,C,E,E,E,S,E,E,S,E,E,G,E,E,U,6C,mB,C,6C,iB,C,6C,sB,C,6C,iB,C,6C,c,C,4C,wB,C,6C,O,C,6C,a,C,6C,a","sources":["<anon>","packages/column-views/src/maps/column-navigation/index.ts"],"sourcesContent":["import \"./column-views.a14f0134.js\";\nimport \"./column-views.d529d3aa.js\";\n\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n }\n });\n });\n\n return dest;\n}\n\n var $parcel$global = globalThis;\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequirea149\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequirea149\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nvar $7ff4e0023faa490a$exports = {};\n\nvar $fIgv5 = parcelRequire(\"fIgv5\");\n\nvar $c27x8 = parcelRequire(\"c27x8\");\n$parcel$exportWildcard($7ff4e0023faa490a$exports, $fIgv5);\n$parcel$exportWildcard($7ff4e0023faa490a$exports, $c27x8);\n\n\nexport {$44d1d5e5d8e823d1$export$821baedf611249f3 as ColumnNavigationMap, $5a7fd801cb316afa$export$c4313db718750a5a as ResizableMapFrame, $5a7fd801cb316afa$export$9595c40c7a4c4f7b as ColumnNavigationSVGMap, $372e0c9189556f66$export$2254347cd20e6080 as MeasurementsLayer, $372e0c9189556f66$export$f177ff57c101017a as ColumnFeatures, $372e0c9189556f66$export$8c41dd563753848 as ColumnKeyboardNavigation, $372e0c9189556f66$export$f02cc02ad0e0bba3 as Columns, $372e0c9189556f66$export$4d8f6e6df85d9012 as ColumnCenters, $372e0c9189556f66$export$b9d912252344e099 as CurrentColumn};\n//# sourceMappingURL=column-views.2fe8feb9.js.map\n","export * from \"./mapbox\";\nexport * from \"./svg\";\n"],"names":["$parcel$exportWildcard","dest","source","Object","keys","forEach","key","prototype","hasOwnProperty","call","defineProperty","enumerable","get","$parcel$global","globalThis","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","err","Error","code","register","$7ff4e0023faa490a$exports","$fIgv5","$c27x8","$44d1d5e5d8e823d1$export$821baedf611249f3","ColumnNavigationMap","$5a7fd801cb316afa$export$c4313db718750a5a","ResizableMapFrame","$5a7fd801cb316afa$export$9595c40c7a4c4f7b","ColumnNavigationSVGMap","$372e0c9189556f66$export$2254347cd20e6080","MeasurementsLayer","$372e0c9189556f66$export$f177ff57c101017a","ColumnFeatures","$372e0c9189556f66$export$8c41dd563753848","ColumnKeyboardNavigation","$372e0c9189556f66$export$f02cc02ad0e0bba3","Columns","$372e0c9189556f66$export$4d8f6e6df85d9012","ColumnCenters","$372e0c9189556f66$export$b9d912252344e099","CurrentColumn"],"version":3,"file":"column-views.2fe8feb9.js.map","sourceRoot":"../../../../"}
@@ -1,2 +1,2 @@
1
- import"./column-views.1a3c399e.js";import"./column-views.108db52e.js";import"./column-views.fea32686.js";import"./column-views.312db572.js";import"./column-views.aae09aca.js";import"./column-views.0201566d.js";import"./column-views.6919fd2a.js";import"./column-views.db4ccacc.js";import"./column-views.18d54bbb.js";import e from"@macrostrat/hyper";import{useMemo as n,useRef as t}from"react";import{useInDarkMode as o}from"@macrostrat/ui-components";import i from"classnames";import{SVG as a,ColumnProvider as r,ColumnAxisType as l}from"@macrostrat/column-components";var s=globalThis,c={},m={},u=s.parcelRequirea149;null==u&&((u=function(e){if(e in c)return c[e].exports;if(e in m){var n=m[e];delete m[e];var t={id:e,exports:{}};return c[e]=t,n.call(t.exports,t,t.exports),t.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,n){m[e]=n},s.parcelRequirea149=u),u.register,Object.defineProperty({},"CorrelationChart",{get:()=>_,set:void 0,enumerable:!0,configurable:!0});var p=u("5SO8b"),f=u("2KV3o"),d=u("cf1sk"),b=u("7exMg"),g=u("8ldOM"),C=u("4hG2H"),S=u("7tWYE"),h=u("1n4Pb"),v=u("dMbCm");let H=e.styled(d&&d.__esModule?d.default:d);function _({data:e,columnSpacing:r=0,columnWidth:l=130,unconformityLabels:s=!0,showUnitPopover:c=!0,selectedUnit:m,onUnitSelected:u,unitComponent:d,...b}){let C={targetUnitHeight:10,unconformityHeight:60,minSectionHeight:60,collapseSmallUnconformities:!0},S=n(()=>e?(0,g.buildCorrelationChartData)(e,{...C,...b}):null,[e,...Object.values(b)]),h=t(null),_=n(()=>e?.map(e=>e.units).flat()??[],[e]),U=i({"dark-mode":o()});if(null==S)return null;let{packages:A,scaleInfo:E,nColumns:R}=S;return H(v.ColumnContainer,{className:"correlation-diagram"},H(p.UnitSelectionProvider,{columnRef:h,selectedUnit:m,onUnitSelected:u,units:_},H(w,[H(y,{key:"timescale",scaleInfo:E,unconformityLabels:s}),H("div.main-chart",{ref:h},[H(a,{className:U,innerWidth:(l+r)*R,height:E.totalHeight,paddingH:4},A.map((e,n)=>{let{offset:t,domain:o,pixelScale:i,scale:a,key:s}=E.packages[n];return H(x,{columnData:e.columnData,key:s,columnWidth:l,columnSpacing:r,offset:t,domain:o,pixelScale:i,scale:a,unitComponent:d})})),H.if(c)(f.UnitSelectionPopover),H(p.UnitKeyboardNavigation,{units:_})])])))}function x({columnData:e,columnSpacing:n,columnWidth:t,unitComponent:o,offset:i,domain:a,pixelScale:r,scale:l}){return H("g.package",{transform:`translate(0 ${i})`},[H("g.column-units",[e.map((e,i)=>H(U,{units:e.units,unitComponent:o,width:t,key:i,domain:a,pixelScale:r,scale:l,offsetLeft:i*(t+n)}))])])}function U(e){let{units:n,width:t=150,offsetLeft:o,domain:i,pixelScale:a,scale:s,unitComponent:c=S.ColoredUnitComponent}=e;return 0==n.length?null:H("g.section",{transform:`translate(${o} 0)`},H(r,{divisions:n,range:i,scale:s,pixelsPerMeter:a,axisType:l.AGE},H(h.UnitBoxes,{unitComponent:c,unitComponentProps:{nColumns:2,width:t,showLabel:!1}})))}function w({children:e}){let n=(0,p.useUnitSelectionStore)(e=>e.setSelectedUnit);return H("div.correlation-chart-inner",{onClick(){n(null)}},e)}function y(e){let{scaleInfo:n,unconformityLabels:t=!0}=e;return H("div.column-container.age-axis-container",[H(C.CompositeAgeAxisCore,{...n}),H(b.CompositeTimescaleCore,{...n,unconformityLabels:t})])}export{_ as CorrelationChart};
2
- //# sourceMappingURL=column-views.ebe61439.js.map
1
+ import"./column-views.0beae29d.js";import"./column-views.f577d065.js";import"./column-views.fea32686.js";import"./column-views.b40c1b9c.js";import"./column-views.eecdc727.js";import"./column-views.d77d260b.js";import"./column-views.8ee8469d.js";import"./column-views.c921fa1a.js";import"./column-views.56f88b8c.js";import e from"@macrostrat/hyper";import{useMemo as n,useRef as t}from"react";import{useInDarkMode as o}from"@macrostrat/ui-components";import i from"classnames";import{SVG as a,ColumnProvider as r,ColumnAxisType as l}from"@macrostrat/column-components";var s=globalThis,c={},m={},u=s.parcelRequirea149;null==u&&((u=function(e){if(e in c)return c[e].exports;if(e in m){var n=m[e];delete m[e];var t={id:e,exports:{}};return c[e]=t,n.call(t.exports,t,t.exports),t.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,n){m[e]=n},s.parcelRequirea149=u),u.register,Object.defineProperty({},"CorrelationChart",{get:()=>_,set:void 0,enumerable:!0,configurable:!0});var p=u("5SO8b"),f=u("2KV3o"),d=u("cf1sk"),b=u("7exMg"),g=u("8ldOM"),C=u("4hG2H"),S=u("7tWYE"),h=u("1n4Pb"),v=u("dMbCm");let H=e.styled(d&&d.__esModule?d.default:d);function _({data:e,columnSpacing:r=0,columnWidth:l=130,unconformityLabels:s=!0,showUnitPopover:c=!0,selectedUnit:m,onUnitSelected:u,unitComponent:d,...b}){let C={targetUnitHeight:10,unconformityHeight:60,minSectionHeight:60,collapseSmallUnconformities:!0},S=n(()=>e?(0,g.buildCorrelationChartData)(e,{...C,...b}):null,[e,...Object.values(b)]),h=t(null),_=n(()=>e?.map(e=>e.units).flat()??[],[e]),U=i({"dark-mode":o()});if(null==S)return null;let{packages:A,scaleInfo:E,nColumns:R}=S;return H(v.ColumnContainer,{className:"correlation-diagram"},H(p.UnitSelectionProvider,{columnRef:h,selectedUnit:m,onUnitSelected:u,units:_},H(w,[H(y,{key:"timescale",scaleInfo:E,unconformityLabels:s}),H("div.main-chart",{ref:h},[H(a,{className:U,innerWidth:(l+r)*R,height:E.totalHeight,paddingH:4},A.map((e,n)=>{let{offset:t,domain:o,pixelScale:i,scale:a,key:s}=E.packages[n];return H(x,{columnData:e.columnData,key:s,columnWidth:l,columnSpacing:r,offset:t,domain:o,pixelScale:i,scale:a,unitComponent:d})})),H.if(c)(f.UnitSelectionPopover),H(p.UnitKeyboardNavigation,{units:_})])])))}function x({columnData:e,columnSpacing:n,columnWidth:t,unitComponent:o,offset:i,domain:a,pixelScale:r,scale:l}){return H("g.package",{transform:`translate(0 ${i})`},[H("g.column-units",[e.map((e,i)=>H(U,{units:e.units,unitComponent:o,width:t,key:i,domain:a,pixelScale:r,scale:l,offsetLeft:i*(t+n)}))])])}function U(e){let{units:n,width:t=150,offsetLeft:o,domain:i,pixelScale:a,scale:s,unitComponent:c=S.ColoredUnitComponent}=e;return 0==n.length?null:H("g.section",{transform:`translate(${o} 0)`},H(r,{divisions:n,range:i,scale:s,pixelsPerMeter:a,axisType:l.AGE},H(h.UnitBoxes,{unitComponent:c,unitComponentProps:{nColumns:2,width:t,showLabel:!1}})))}function w({children:e}){let n=(0,p.useUnitSelectionStore)(e=>e.setSelectedUnit);return H("div.correlation-chart-inner",{onClick(){n(null)}},e)}function y(e){let{scaleInfo:n,unconformityLabels:t=!0}=e;return H("div.column-container.age-axis-container",[H(C.CompositeAgeAxisCore,{...n}),H(b.CompositeTimescaleCore,{...n,unconformityLabels:t})])}export{_ as CorrelationChart};
2
+ //# sourceMappingURL=column-views.42bc66a8.js.map