@genome-spy/core 0.72.0 → 0.74.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 (396) hide show
  1. package/LICENSE +1 -1
  2. package/dist/bundle/AbortablePromiseCache-3gHJdF3E.js +96 -0
  3. package/dist/bundle/browser-BTgw5ieH.js +126 -0
  4. package/dist/bundle/chunk-DmhlhrBa.js +11 -0
  5. package/dist/bundle/esm-BDFRLEuD.js +1248 -0
  6. package/dist/bundle/esm-BygJiwh0.js +573 -0
  7. package/dist/bundle/esm-CGX-qz1d.js +155 -0
  8. package/dist/bundle/esm-CgfVIRJ-.js +121 -0
  9. package/dist/bundle/esm-CuMSzCHy.js +298 -0
  10. package/dist/bundle/esm-DMXpJXM4.js +369 -0
  11. package/dist/bundle/esm-DQiq2Zhd.js +1426 -0
  12. package/dist/bundle/esm-DtE8VqAv.js +1015 -0
  13. package/dist/bundle/esm-sIoQYZ21.js +461 -0
  14. package/dist/bundle/index.es.js +21078 -24556
  15. package/dist/bundle/index.js +379 -383
  16. package/dist/bundle/parquetRead-DG_-F5j5.js +1609 -0
  17. package/dist/schema.json +13349 -7082
  18. package/dist/src/config/axisConfig.d.ts +16 -0
  19. package/dist/src/config/axisConfig.d.ts.map +1 -0
  20. package/dist/src/config/axisConfig.js +84 -0
  21. package/dist/src/config/defaultConfig.d.ts +3 -0
  22. package/dist/src/config/defaultConfig.d.ts.map +1 -0
  23. package/dist/src/config/defaultConfig.js +38 -0
  24. package/dist/src/config/defaults/axisDefaults.d.ts +5 -0
  25. package/dist/src/config/defaults/axisDefaults.d.ts.map +1 -0
  26. package/dist/src/config/defaults/axisDefaults.js +72 -0
  27. package/dist/src/config/defaults/markDefaults.d.ts +15 -0
  28. package/dist/src/config/defaults/markDefaults.d.ts.map +1 -0
  29. package/dist/src/config/defaults/markDefaults.js +121 -0
  30. package/dist/src/config/defaults/scaleDefaults.d.ts +5 -0
  31. package/dist/src/config/defaults/scaleDefaults.d.ts.map +1 -0
  32. package/dist/src/config/defaults/scaleDefaults.js +18 -0
  33. package/dist/src/config/defaults/titleDefaults.d.ts +5 -0
  34. package/dist/src/config/defaults/titleDefaults.d.ts.map +1 -0
  35. package/dist/src/config/defaults/titleDefaults.js +47 -0
  36. package/dist/src/config/defaults/viewDefaults.d.ts +3 -0
  37. package/dist/src/config/defaults/viewDefaults.d.ts.map +1 -0
  38. package/dist/src/config/defaults/viewDefaults.js +2 -0
  39. package/dist/src/config/markConfig.d.ts +8 -0
  40. package/dist/src/config/markConfig.d.ts.map +1 -0
  41. package/dist/src/config/markConfig.js +27 -0
  42. package/dist/src/config/mergeConfig.d.ts +8 -0
  43. package/dist/src/config/mergeConfig.d.ts.map +1 -0
  44. package/dist/src/config/mergeConfig.js +81 -0
  45. package/dist/src/config/resolveConfig.d.ts +22 -0
  46. package/dist/src/config/resolveConfig.d.ts.map +1 -0
  47. package/dist/src/config/resolveConfig.js +32 -0
  48. package/dist/src/config/scaleConfig.d.ts +40 -0
  49. package/dist/src/config/scaleConfig.d.ts.map +1 -0
  50. package/dist/src/config/scaleConfig.js +220 -0
  51. package/dist/src/config/styleUtils.d.ts +6 -0
  52. package/dist/src/config/styleUtils.d.ts.map +1 -0
  53. package/dist/src/config/styleUtils.js +10 -0
  54. package/dist/src/config/themes.d.ts +15 -0
  55. package/dist/src/config/themes.d.ts.map +1 -0
  56. package/dist/src/config/themes.js +293 -0
  57. package/dist/src/config/titleConfig.d.ts +12 -0
  58. package/dist/src/config/titleConfig.d.ts.map +1 -0
  59. package/dist/src/config/titleConfig.js +42 -0
  60. package/dist/src/config/viewConfig.d.ts +7 -0
  61. package/dist/src/config/viewConfig.d.ts.map +1 -0
  62. package/dist/src/config/viewConfig.js +29 -0
  63. package/dist/src/data/flowNode.d.ts +22 -1
  64. package/dist/src/data/flowNode.d.ts.map +1 -1
  65. package/dist/src/data/flowNode.js +37 -1
  66. package/dist/src/data/formats/bed.d.ts +8 -0
  67. package/dist/src/data/formats/bed.d.ts.map +1 -0
  68. package/dist/src/data/formats/bed.js +58 -0
  69. package/dist/src/data/formats/bedpe.d.ts +8 -0
  70. package/dist/src/data/formats/bedpe.d.ts.map +1 -0
  71. package/dist/src/data/formats/bedpe.js +164 -0
  72. package/dist/src/data/formats/fasta.d.ts.map +1 -1
  73. package/dist/src/data/formats/fasta.js +4 -0
  74. package/dist/src/data/formats/parquet.d.ts.map +1 -1
  75. package/dist/src/data/formats/parquet.js +4 -0
  76. package/dist/src/data/sources/dataSourceFactory.d.ts +2 -13
  77. package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
  78. package/dist/src/data/sources/dataSourceFactory.js +5 -141
  79. package/dist/src/data/sources/dataUtils.d.ts +16 -0
  80. package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
  81. package/dist/src/data/sources/dataUtils.js +53 -3
  82. package/dist/src/data/sources/lazy/axisGenomeSource.d.ts.map +1 -1
  83. package/dist/src/data/sources/lazy/axisGenomeSource.js +11 -0
  84. package/dist/src/data/sources/lazy/axisTickSource.d.ts +1 -1
  85. package/dist/src/data/sources/lazy/axisTickSource.d.ts.map +1 -1
  86. package/dist/src/data/sources/lazy/axisTickSource.js +19 -8
  87. package/dist/src/data/sources/lazy/bamSource.d.ts.map +1 -1
  88. package/dist/src/data/sources/lazy/bamSource.js +11 -0
  89. package/dist/src/data/sources/lazy/bigBedSource.d.ts.map +1 -1
  90. package/dist/src/data/sources/lazy/bigBedSource.js +12 -1
  91. package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
  92. package/dist/src/data/sources/lazy/bigWigSource.js +11 -0
  93. package/dist/src/data/sources/lazy/gff3Source.d.ts.map +1 -1
  94. package/dist/src/data/sources/lazy/gff3Source.js +12 -1
  95. package/dist/src/data/sources/lazy/indexedFastaSource.d.ts.map +1 -1
  96. package/dist/src/data/sources/lazy/indexedFastaSource.js +11 -0
  97. package/dist/src/data/sources/lazy/lazyDataSourceRegistry.d.ts +27 -0
  98. package/dist/src/data/sources/lazy/lazyDataSourceRegistry.d.ts.map +1 -0
  99. package/dist/src/data/sources/lazy/lazyDataSourceRegistry.js +65 -0
  100. package/dist/src/data/sources/lazy/registerBuiltInLazySources.d.ts +2 -0
  101. package/dist/src/data/sources/lazy/registerBuiltInLazySources.d.ts.map +1 -0
  102. package/dist/src/data/sources/lazy/registerBuiltInLazySources.js +8 -0
  103. package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
  104. package/dist/src/data/sources/lazy/singleAxisLazySource.js +11 -2
  105. package/dist/src/data/sources/lazy/vcfSource.d.ts.map +1 -1
  106. package/dist/src/data/sources/lazy/vcfSource.js +11 -0
  107. package/dist/src/data/sources/urlSource.d.ts +4 -0
  108. package/dist/src/data/sources/urlSource.d.ts.map +1 -1
  109. package/dist/src/data/sources/urlSource.js +138 -16
  110. package/dist/src/data/transforms/aggregate.d.ts +1 -0
  111. package/dist/src/data/transforms/aggregate.d.ts.map +1 -1
  112. package/dist/src/data/transforms/aggregate.js +30 -8
  113. package/dist/src/data/transforms/aggregateOps.d.ts.map +1 -1
  114. package/dist/src/data/transforms/aggregateOps.js +12 -1
  115. package/dist/src/data/transforms/coverage.js +2 -2
  116. package/dist/src/data/transforms/filter.js +1 -1
  117. package/dist/src/data/transforms/filterScoredLabels.d.ts +6 -0
  118. package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
  119. package/dist/src/data/transforms/filterScoredLabels.js +9 -0
  120. package/dist/src/data/transforms/measureText.d.ts +1 -0
  121. package/dist/src/data/transforms/measureText.d.ts.map +1 -1
  122. package/dist/src/data/transforms/measureText.js +14 -5
  123. package/dist/src/data/transforms/pileup.d.ts.map +1 -1
  124. package/dist/src/data/transforms/pileup.js +1 -2
  125. package/dist/src/data/transforms/regexFold.d.ts.map +1 -1
  126. package/dist/src/data/transforms/regexFold.js +0 -1
  127. package/dist/src/embedFactory.d.ts +13 -0
  128. package/dist/src/embedFactory.d.ts.map +1 -0
  129. package/dist/src/embedFactory.js +127 -0
  130. package/dist/src/encoder/accessor.d.ts +3 -12
  131. package/dist/src/encoder/accessor.d.ts.map +1 -1
  132. package/dist/src/encoder/accessor.js +10 -65
  133. package/dist/src/encoder/encoder.d.ts +51 -8
  134. package/dist/src/encoder/encoder.d.ts.map +1 -1
  135. package/dist/src/encoder/encoder.js +179 -55
  136. package/dist/src/fonts/bmFontManager.js +1 -1
  137. package/dist/src/full.d.ts +2 -0
  138. package/dist/src/full.d.ts.map +1 -0
  139. package/dist/src/full.js +2 -0
  140. package/dist/src/genome/assemblyPreflight.d.ts +31 -0
  141. package/dist/src/genome/assemblyPreflight.d.ts.map +1 -0
  142. package/dist/src/genome/assemblyPreflight.js +99 -0
  143. package/dist/src/genome/genome.d.ts +10 -2
  144. package/dist/src/genome/genome.d.ts.map +1 -1
  145. package/dist/src/genome/genome.js +20 -2
  146. package/dist/src/genome/genomeStore.d.ts +34 -3
  147. package/dist/src/genome/genomeStore.d.ts.map +1 -1
  148. package/dist/src/genome/genomeStore.js +409 -18
  149. package/dist/src/genome/rootGenomeConfig.d.ts +26 -0
  150. package/dist/src/genome/rootGenomeConfig.d.ts.map +1 -0
  151. package/dist/src/genome/rootGenomeConfig.js +98 -0
  152. package/dist/src/genome/scaleLocus.d.ts.map +1 -1
  153. package/dist/src/genome/scaleLocus.js +26 -7
  154. package/dist/src/genomeSpy/cursorManager.d.ts +69 -0
  155. package/dist/src/genomeSpy/cursorManager.d.ts.map +1 -0
  156. package/dist/src/genomeSpy/cursorManager.js +131 -0
  157. package/dist/src/genomeSpy/headlessBootstrap.d.ts +113 -0
  158. package/dist/src/genomeSpy/headlessBootstrap.d.ts.map +1 -0
  159. package/dist/src/genomeSpy/headlessBootstrap.js +246 -0
  160. package/dist/src/genomeSpy/interactionController.d.ts +10 -1
  161. package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
  162. package/dist/src/genomeSpy/interactionController.js +448 -40
  163. package/dist/src/genomeSpy/interactionDispatcher.d.ts +50 -0
  164. package/dist/src/genomeSpy/interactionDispatcher.d.ts.map +1 -0
  165. package/dist/src/genomeSpy/interactionDispatcher.js +203 -0
  166. package/dist/src/genomeSpy/renderCoordinator.js +1 -1
  167. package/dist/src/genomeSpy/viewContextFactory.d.ts +4 -2
  168. package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
  169. package/dist/src/genomeSpy/viewContextFactory.js +12 -4
  170. package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
  171. package/dist/src/genomeSpy/viewDataInit.js +7 -3
  172. package/dist/src/genomeSpy.d.ts +1 -114
  173. package/dist/src/genomeSpy.d.ts.map +1 -1
  174. package/dist/src/genomeSpy.js +7 -614
  175. package/dist/src/genomeSpyBase.d.ts +133 -0
  176. package/dist/src/genomeSpyBase.d.ts.map +1 -0
  177. package/dist/src/genomeSpyBase.js +719 -0
  178. package/dist/src/gl/arrayBuilder.d.ts.map +1 -1
  179. package/dist/src/gl/arrayBuilder.js +0 -3
  180. package/dist/src/gl/canvasSizeHelper.d.ts +74 -0
  181. package/dist/src/gl/canvasSizeHelper.d.ts.map +1 -0
  182. package/dist/src/gl/canvasSizeHelper.js +203 -0
  183. package/dist/src/gl/colorUtils.d.ts.map +1 -1
  184. package/dist/src/gl/colorUtils.js +3 -0
  185. package/dist/src/gl/dataToVertices.d.ts.map +1 -1
  186. package/dist/src/gl/dataToVertices.js +13 -8
  187. package/dist/src/gl/glslScaleGenerator.d.ts +2 -2
  188. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
  189. package/dist/src/gl/glslScaleGenerator.js +5 -7
  190. package/dist/src/gl/webGLHelper.d.ts +25 -11
  191. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  192. package/dist/src/gl/webGLHelper.js +59 -33
  193. package/dist/src/index.d.ts +3 -9
  194. package/dist/src/index.d.ts.map +1 -1
  195. package/dist/src/index.js +5 -111
  196. package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +4462 -0
  197. package/dist/src/marks/link.d.ts.map +1 -1
  198. package/dist/src/marks/link.js +5 -26
  199. package/dist/src/marks/mark.d.ts +8 -1
  200. package/dist/src/marks/mark.d.ts.map +1 -1
  201. package/dist/src/marks/mark.js +67 -21
  202. package/dist/src/marks/markUtils.d.ts +18 -1
  203. package/dist/src/marks/markUtils.d.ts.map +1 -1
  204. package/dist/src/marks/markUtils.js +52 -4
  205. package/dist/src/marks/point.d.ts.map +1 -1
  206. package/dist/src/marks/point.js +6 -26
  207. package/dist/src/marks/rect.d.ts.map +1 -1
  208. package/dist/src/marks/rect.js +13 -21
  209. package/dist/src/marks/rule.d.ts +7 -2
  210. package/dist/src/marks/rule.d.ts.map +1 -1
  211. package/dist/src/marks/rule.js +125 -16
  212. package/dist/src/marks/text.d.ts.map +1 -1
  213. package/dist/src/marks/text.js +5 -47
  214. package/dist/src/minimal.d.ts +8 -0
  215. package/dist/src/minimal.d.ts.map +1 -0
  216. package/dist/src/minimal.js +21 -0
  217. package/dist/src/paramRuntime/viewParamRuntime.d.ts +19 -0
  218. package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
  219. package/dist/src/paramRuntime/viewParamRuntime.js +35 -0
  220. package/dist/src/scale/scale.d.ts.map +1 -1
  221. package/dist/src/scale/scale.js +13 -7
  222. package/dist/src/scales/axisResolution.d.ts.map +1 -1
  223. package/dist/src/scales/axisResolution.js +9 -5
  224. package/dist/src/scales/domainPlanner.d.ts +58 -7
  225. package/dist/src/scales/domainPlanner.d.ts.map +1 -1
  226. package/dist/src/scales/domainPlanner.js +395 -40
  227. package/dist/src/scales/indexLikeDomainUtils.d.ts +29 -0
  228. package/dist/src/scales/indexLikeDomainUtils.d.ts.map +1 -0
  229. package/dist/src/scales/indexLikeDomainUtils.js +67 -0
  230. package/dist/src/scales/resolutionMemberOrder.d.ts +15 -0
  231. package/dist/src/scales/resolutionMemberOrder.d.ts.map +1 -0
  232. package/dist/src/scales/resolutionMemberOrder.js +22 -0
  233. package/dist/src/scales/scaleInstanceManager.d.ts +2 -1
  234. package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
  235. package/dist/src/scales/scaleInstanceManager.js +10 -11
  236. package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
  237. package/dist/src/scales/scaleInteractionController.js +59 -18
  238. package/dist/src/scales/scalePropsResolver.d.ts +3 -1
  239. package/dist/src/scales/scalePropsResolver.d.ts.map +1 -1
  240. package/dist/src/scales/scalePropsResolver.js +83 -6
  241. package/dist/src/scales/scaleResolution.d.ts +39 -0
  242. package/dist/src/scales/scaleResolution.d.ts.map +1 -1
  243. package/dist/src/scales/scaleResolution.js +504 -82
  244. package/dist/src/scales/scaleResolutionTestUtils.d.ts +21 -0
  245. package/dist/src/scales/scaleResolutionTestUtils.d.ts.map +1 -0
  246. package/dist/src/scales/scaleResolutionTestUtils.js +37 -0
  247. package/dist/src/scales/scaleRules.d.ts.map +1 -1
  248. package/dist/src/scales/scaleRules.js +16 -2
  249. package/dist/src/scales/selectionDomainUtils.d.ts +52 -0
  250. package/dist/src/scales/selectionDomainUtils.d.ts.map +1 -0
  251. package/dist/src/scales/selectionDomainUtils.js +194 -0
  252. package/dist/src/scales/zoomDomainUtils.d.ts +18 -0
  253. package/dist/src/scales/zoomDomainUtils.d.ts.map +1 -0
  254. package/dist/src/scales/zoomDomainUtils.js +69 -0
  255. package/dist/src/screenshotHarness.d.ts +16 -0
  256. package/dist/src/screenshotHarness.d.ts.map +1 -0
  257. package/dist/src/screenshotHarness.js +241 -0
  258. package/dist/src/singlePageApp.js +1 -1
  259. package/dist/src/spec/axis.d.ts +41 -30
  260. package/dist/src/spec/channel.d.ts +15 -9
  261. package/dist/src/spec/config.d.ts +264 -0
  262. package/dist/src/spec/data.d.ts +30 -3
  263. package/dist/src/spec/decoration.d.ts +51 -0
  264. package/dist/src/spec/exampleFiles.d.ts +12 -0
  265. package/dist/src/spec/exampleFiles.d.ts.map +1 -0
  266. package/dist/src/spec/exampleFiles.js +52 -0
  267. package/dist/src/spec/font.d.ts +1 -1
  268. package/dist/src/spec/genome.d.ts +22 -2
  269. package/dist/src/spec/mark.d.ts +97 -13
  270. package/dist/src/spec/parameter.d.ts +62 -5
  271. package/dist/src/spec/root.d.ts +34 -1
  272. package/dist/src/spec/scale.d.ts +46 -5
  273. package/dist/src/spec/title.d.ts +13 -2
  274. package/dist/src/spec/tooltip.d.ts +1 -1
  275. package/dist/src/spec/transform.d.ts +39 -4
  276. package/dist/src/spec/view.d.ts +67 -19
  277. package/dist/src/styles/genome-spy.css +63 -55
  278. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  279. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  280. package/dist/src/styles/genome-spy.css.js +31 -22
  281. package/dist/src/testSetup.d.ts +2 -0
  282. package/dist/src/testSetup.d.ts.map +1 -0
  283. package/dist/src/testSetup.js +5 -0
  284. package/dist/src/tooltip/dataTooltipHandler.js +66 -11
  285. package/dist/src/tooltip/tooltipContext.d.ts.map +1 -1
  286. package/dist/src/tooltip/tooltipContext.js +3 -2
  287. package/dist/src/types/embedApi.d.ts +26 -0
  288. package/dist/src/types/encoder.d.ts +17 -15
  289. package/dist/src/types/scaleResolutionApi.d.ts +20 -0
  290. package/dist/src/types/viewContext.d.ts +23 -1
  291. package/dist/src/utils/expression.d.ts +2 -2
  292. package/dist/src/utils/expression.d.ts.map +1 -1
  293. package/dist/src/utils/expression.js +63 -8
  294. package/dist/src/utils/field.d.ts.map +1 -1
  295. package/dist/src/utils/field.js +0 -1
  296. package/dist/src/utils/inertia.d.ts.map +1 -1
  297. package/dist/src/utils/inertia.js +0 -1
  298. package/dist/src/utils/inferSpecBaseUrl.d.ts +14 -0
  299. package/dist/src/utils/inferSpecBaseUrl.d.ts.map +1 -0
  300. package/dist/src/utils/inferSpecBaseUrl.js +73 -0
  301. package/dist/src/utils/inputBinding.d.ts +1 -1
  302. package/dist/src/utils/interaction.d.ts +109 -0
  303. package/dist/src/utils/interaction.d.ts.map +1 -0
  304. package/dist/src/utils/interaction.js +200 -0
  305. package/dist/src/utils/interactionEvent.d.ts +62 -33
  306. package/dist/src/utils/interactionEvent.d.ts.map +1 -1
  307. package/dist/src/utils/interactionEvent.js +86 -48
  308. package/dist/src/utils/kWayMerge.js +1 -1
  309. package/dist/src/utils/mergeObjects.d.ts.map +1 -1
  310. package/dist/src/utils/mergeObjects.js +0 -2
  311. package/dist/src/utils/radixSort.d.ts.map +1 -1
  312. package/dist/src/utils/radixSort.js +0 -2
  313. package/dist/src/utils/throttle.d.ts.map +1 -1
  314. package/dist/src/utils/throttle.js +0 -2
  315. package/dist/src/utils/ui/tooltip.d.ts +1 -0
  316. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  317. package/dist/src/utils/ui/tooltip.js +1 -0
  318. package/dist/src/utils/url.js +1 -1
  319. package/dist/src/view/axisGridView.d.ts +1 -1
  320. package/dist/src/view/axisGridView.d.ts.map +1 -1
  321. package/dist/src/view/axisGridView.js +2 -47
  322. package/dist/src/view/axisView.d.ts +2 -3
  323. package/dist/src/view/axisView.d.ts.map +1 -1
  324. package/dist/src/view/axisView.js +251 -106
  325. package/dist/src/view/concatView.d.ts +2 -1
  326. package/dist/src/view/concatView.d.ts.map +1 -1
  327. package/dist/src/view/concatView.js +4 -2
  328. package/dist/src/view/containerMutationHelper.d.ts +3 -0
  329. package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
  330. package/dist/src/view/containerMutationHelper.js +12 -1
  331. package/dist/src/view/dataReadiness.d.ts +2 -2
  332. package/dist/src/view/dataReadiness.d.ts.map +1 -1
  333. package/dist/src/view/dataReadiness.js +63 -58
  334. package/dist/src/view/facetView.d.ts +1 -1
  335. package/dist/src/view/facetView.js +4 -4
  336. package/dist/src/view/flowBuilder.js +2 -2
  337. package/dist/src/view/gridView/gridChild.d.ts +13 -0
  338. package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
  339. package/dist/src/view/gridView/gridChild.js +247 -49
  340. package/dist/src/view/gridView/gridView.d.ts.map +1 -1
  341. package/dist/src/view/gridView/gridView.js +296 -99
  342. package/dist/src/view/gridView/keyboardZoomController.d.ts +2 -2
  343. package/dist/src/view/gridView/keyboardZoomController.d.ts.map +1 -1
  344. package/dist/src/view/gridView/keyboardZoomController.js +1 -1
  345. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
  346. package/dist/src/view/gridView/scrollbar.js +4 -2
  347. package/dist/src/view/gridView/selectionRect.d.ts +4 -0
  348. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
  349. package/dist/src/view/gridView/selectionRect.js +20 -1
  350. package/dist/src/view/gridView/separatorView.d.ts +1 -0
  351. package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
  352. package/dist/src/view/gridView/separatorView.js +9 -0
  353. package/dist/src/view/interactionRouting.d.ts +20 -0
  354. package/dist/src/view/interactionRouting.d.ts.map +1 -0
  355. package/dist/src/view/interactionRouting.js +53 -0
  356. package/dist/src/view/layerView.d.ts.map +1 -1
  357. package/dist/src/view/layerView.js +12 -9
  358. package/dist/src/view/layout/grid.js +1 -1
  359. package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
  360. package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +0 -2
  361. package/dist/src/view/testUtils.d.ts +17 -3
  362. package/dist/src/view/testUtils.d.ts.map +1 -1
  363. package/dist/src/view/testUtils.js +62 -69
  364. package/dist/src/view/title.d.ts +8 -1
  365. package/dist/src/view/title.d.ts.map +1 -1
  366. package/dist/src/view/title.js +66 -76
  367. package/dist/src/view/unitView.d.ts +1 -1
  368. package/dist/src/view/unitView.d.ts.map +1 -1
  369. package/dist/src/view/unitView.js +67 -17
  370. package/dist/src/view/view.d.ts +76 -30
  371. package/dist/src/view/view.d.ts.map +1 -1
  372. package/dist/src/view/view.js +136 -47
  373. package/dist/src/view/viewFactory.d.ts +11 -3
  374. package/dist/src/view/viewFactory.d.ts.map +1 -1
  375. package/dist/src/view/viewFactory.js +37 -11
  376. package/dist/src/view/viewUtils.d.ts.map +1 -1
  377. package/dist/src/view/viewUtils.js +41 -5
  378. package/dist/src/view/zoom.d.ts +15 -3
  379. package/dist/src/view/zoom.d.ts.map +1 -1
  380. package/dist/src/view/zoom.js +375 -80
  381. package/package.json +20 -10
  382. package/dist/bundle/AbortablePromiseCache-Dj0vzLnp.js +0 -149
  383. package/dist/bundle/browser-0iNU5Wit.js +0 -138
  384. package/dist/bundle/index-BYsZN7b0.js +0 -1597
  385. package/dist/bundle/index-C3kClAEN.js +0 -1771
  386. package/dist/bundle/index-C7wOh6y1.js +0 -657
  387. package/dist/bundle/index-CRaQAuki.js +0 -326
  388. package/dist/bundle/index-D9v1PCj9.js +0 -507
  389. package/dist/bundle/index-GDOuv_D5.js +0 -266
  390. package/dist/bundle/index-Gt44EOIH.js +0 -628
  391. package/dist/bundle/inflate-GtwLkvSP.js +0 -1048
  392. package/dist/bundle/parquetRead-BnAGCa4_.js +0 -1663
  393. package/dist/bundle/unzip-Bac01w6X.js +0 -1492
  394. package/dist/src/config/scaleDefaults.d.ts +0 -8
  395. package/dist/src/config/scaleDefaults.d.ts.map +0 -1
  396. package/dist/src/config/scaleDefaults.js +0 -45
@@ -0,0 +1,73 @@
1
+ const CURATED_EXAMPLE_BASES = [
2
+ ["/docs/examples/", "/docs/examples/"],
3
+ ["/examples/core/", "/examples/"],
4
+ ["/examples/docs/", "/examples/"],
5
+ ["/examples/app/", "/examples/"],
6
+ ];
7
+
8
+ const EXTERNAL_URL_RE = /^(?:[a-z]+:)?\/\//i;
9
+ const DUMMY_ORIGIN = "https://example.invalid";
10
+
11
+ /**
12
+ * @param {string} url
13
+ */
14
+ function getUrlKind(url) {
15
+ if (EXTERNAL_URL_RE.test(url)) {
16
+ return "external";
17
+ } else if (url.startsWith("/")) {
18
+ return "root";
19
+ } else {
20
+ return "relative";
21
+ }
22
+ }
23
+
24
+ /**
25
+ * @param {string} url
26
+ */
27
+ export function getCuratedExampleBaseUrl(url) {
28
+ const parsed = new URL(url, DUMMY_ORIGIN);
29
+ const match = CURATED_EXAMPLE_BASES.find(([prefix]) =>
30
+ parsed.pathname.startsWith(prefix)
31
+ );
32
+
33
+ if (!match) {
34
+ return undefined;
35
+ }
36
+
37
+ return formatOutputUrl(match[1], parsed, getUrlKind(url));
38
+ }
39
+
40
+ /**
41
+ * Infers the effective base URL for a spec loaded from the given URL or path.
42
+ *
43
+ * Curated shared examples resolve against the examples root so they can use
44
+ * tidy `data/...` and `shared/...` paths regardless of their subdirectory.
45
+ *
46
+ * @param {string} url
47
+ */
48
+ export default function inferSpecBaseUrl(url) {
49
+ const curatedBaseUrl = getCuratedExampleBaseUrl(url);
50
+ if (curatedBaseUrl) {
51
+ return curatedBaseUrl;
52
+ }
53
+
54
+ const parsed = new URL(url, DUMMY_ORIGIN);
55
+ const directoryUrl = new URL("./", parsed);
56
+
57
+ return formatOutputUrl(directoryUrl.pathname, parsed, getUrlKind(url));
58
+ }
59
+
60
+ /**
61
+ * @param {string} pathname
62
+ * @param {URL} parsed
63
+ * @param {"external" | "root" | "relative"} kind
64
+ */
65
+ function formatOutputUrl(pathname, parsed, kind) {
66
+ if (kind === "external") {
67
+ return parsed.origin + pathname;
68
+ } else if (kind === "root") {
69
+ return pathname;
70
+ } else {
71
+ return pathname.slice(1);
72
+ }
73
+ }
@@ -9,5 +9,5 @@ export default function createBindingInputs(mediator: {
9
9
  paramConfigs: ReadonlyMap<string, import("../spec/parameter.js").Parameter>;
10
10
  setValue: (name: string, value: any) => void;
11
11
  getValue: (name: string) => any;
12
- }): import("lit-html").TemplateResult<2 | 1 | 3>[];
12
+ }): import("lit-html").TemplateResult<1 | 2 | 3>[];
13
13
  //# sourceMappingURL=inputBinding.d.ts.map
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Internal event object used by GenomeSpy's canvas interaction pipeline.
3
+ *
4
+ * Interaction is deliberately smaller than DOM Event. It models the pieces
5
+ * that GenomeSpy needs for hierarchical pointer handling:
6
+ * - `point` is always in canvas coordinates
7
+ * - `uiEvent` is the original native or synthesized low-level event
8
+ * - `target` is the resolved deepest view target after propagation
9
+ * - `currentTarget` and `relatedTarget` are used by synthesized
10
+ * `mouseenter` / `mouseleave` delivery
11
+ *
12
+ * Runtime flow:
13
+ * 1. `InteractionController` converts native canvas events into Interaction
14
+ * instances and asks `InteractionDispatcher` to route them.
15
+ * 2. Container views route the interaction through the view hierarchy and may
16
+ * add policy on top, such as wheel claiming, zoom handling, or scrollbar
17
+ * dispatch.
18
+ * 3. `InteractionDispatcher` compares successive hover paths and synthesizes
19
+ * subtree-level `mouseenter` / `mouseleave` transitions.
20
+ *
21
+ * Differences from the DOM model:
22
+ * - propagation is view-driven rather than browser-driven
23
+ * - only the event types used by GenomeSpy are represented
24
+ * - there is only `stopPropagation()`, not stop-immediate semantics
25
+ * - mark picking is not encoded into `target`; mark hover lives separately in
26
+ * `InteractionController`
27
+ *
28
+ * Mouse and wheel helpers:
29
+ * - `mouseEvent` exposes the underlying MouseEvent for imperative handlers
30
+ * - `proxiedMouseEvent` exposes only primitive properties for places that
31
+ * must not retain live DOM objects
32
+ * - `wheelEvent` exposes the underlying wheel-like event, optionally with
33
+ * temporary delta overrides applied by `setWheelDeltas()`
34
+ *
35
+ * Special event types:
36
+ * - `wheelclaimprobe` asks pointed views whether they would consume wheel,
37
+ * without running the actual wheel side effects yet
38
+ * - `touchgesture` is a synthesized high-level gesture event derived from
39
+ * touch input
40
+ */
41
+ export default class Interaction {
42
+ /**
43
+ * @param {import("../view/layout/point.js").default} point
44
+ * @param {import("./interactionEvent.js").InteractionUiEvent} uiEvent
45
+ * @param {string} [type]
46
+ */
47
+ constructor(point: import("../view/layout/point.js").default, uiEvent: import("./interactionEvent.js").InteractionUiEvent, type?: string);
48
+ point: import("../view/layout/point.js").default;
49
+ stopped: boolean;
50
+ wheelClaimed: boolean;
51
+ /**
52
+ * The target is known only after the interaction has been resolved
53
+ * against the view hierarchy.
54
+ *
55
+ * @type {import("../view/view.js").default | undefined}
56
+ */
57
+ target: import("../view/view.js").default | undefined;
58
+ /**
59
+ * Reserved for the new interaction dispatcher.
60
+ *
61
+ * @type {import("../view/view.js").default | undefined}
62
+ */
63
+ currentTarget: import("../view/view.js").default | undefined;
64
+ /**
65
+ * Reserved for enter/leave-style transition events.
66
+ *
67
+ * @type {import("../view/view.js").default | undefined}
68
+ */
69
+ relatedTarget: import("../view/view.js").default | undefined;
70
+ set uiEvent(value: import("./interactionEvent.js").InteractionUiEvent);
71
+ get uiEvent(): import("./interactionEvent.js").InteractionUiEvent;
72
+ stopPropagation(): void;
73
+ /**
74
+ * Marks the current wheel interaction as claimed by the pointed view
75
+ * hierarchy.
76
+ *
77
+ * This is used both for real wheel events and for the synthetic
78
+ * `wheelclaimprobe` preflight. Controllers use the claimed state to decide
79
+ * whether the native wheel event should call `preventDefault()`.
80
+ */
81
+ claimWheel(): void;
82
+ /**
83
+ * @param {number} deltaX
84
+ * @param {number} deltaY
85
+ */
86
+ setWheelDeltas(deltaX: number, deltaY: number): void;
87
+ set type(value: string);
88
+ get type(): string;
89
+ /**
90
+ * Returns a primitive-only proxy of the underlying MouseEvent.
91
+ *
92
+ * This is intended for places such as expression evaluation, where the
93
+ * caller needs scalar event fields but should not receive a live DOM event
94
+ * object with methods, nested objects, or browser-specific prototypes.
95
+ */
96
+ get proxiedMouseEvent(): MouseEvent;
97
+ get mouseEvent(): MouseEvent;
98
+ /**
99
+ * Returns a wheel-like event with any temporary delta overrides applied.
100
+ *
101
+ * The wrapped event keeps the original event identity for all properties
102
+ * except `deltaX` and `deltaY`, which allows intermediate handlers to
103
+ * consume part of the wheel interaction while keeping downstream wheel
104
+ * handling on the same event instance.
105
+ */
106
+ get wheelEvent(): Pick<WheelEvent, "type" | "deltaX" | "deltaY" | "deltaMode" | "preventDefault" | "ctrlKey">;
107
+ #private;
108
+ }
109
+ //# sourceMappingURL=interaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../src/utils/interaction.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IAOI;;;;OAIG;IACH,mBAJW,OAAO,yBAAyB,EAAE,OAAO,WACzC,OAAO,uBAAuB,EAAE,kBAAkB,SAClD,MAAM,EA8BhB;IA3BG,iDAAkB;IAElB,iBAAoB;IACpB,sBAAyB;IAGzB;;;;;OAKG;IACH,QAFU,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAEhC;IAEvB;;;;OAIG;IACH,eAFU,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAEzB;IAE9B;;;;OAIG;IACH,eAFU,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAEzB;IAclC,uEAKC;IATD,kEAEC;IASD,wBAEC;IAED;;;;;;;OAOG;IACH,mBAMC;IAED;;;OAGG;IACH,uBAHW,MAAM,UACN,MAAM,QAShB;IAMD,wBAEC;IAND,mBAEC;IAMD;;;;;;OAMG;IACH,oCAQC;IAED,6BAMC;IAED;;;;;;;OAOG;IACH,8GAkBC;;CACJ"}
@@ -0,0 +1,200 @@
1
+ import {
2
+ createPrimitiveEventProxy,
3
+ isWheelEvent,
4
+ overrideWheelEventDeltas,
5
+ } from "./interactionEvent.js";
6
+
7
+ /**
8
+ * Internal event object used by GenomeSpy's canvas interaction pipeline.
9
+ *
10
+ * Interaction is deliberately smaller than DOM Event. It models the pieces
11
+ * that GenomeSpy needs for hierarchical pointer handling:
12
+ * - `point` is always in canvas coordinates
13
+ * - `uiEvent` is the original native or synthesized low-level event
14
+ * - `target` is the resolved deepest view target after propagation
15
+ * - `currentTarget` and `relatedTarget` are used by synthesized
16
+ * `mouseenter` / `mouseleave` delivery
17
+ *
18
+ * Runtime flow:
19
+ * 1. `InteractionController` converts native canvas events into Interaction
20
+ * instances and asks `InteractionDispatcher` to route them.
21
+ * 2. Container views route the interaction through the view hierarchy and may
22
+ * add policy on top, such as wheel claiming, zoom handling, or scrollbar
23
+ * dispatch.
24
+ * 3. `InteractionDispatcher` compares successive hover paths and synthesizes
25
+ * subtree-level `mouseenter` / `mouseleave` transitions.
26
+ *
27
+ * Differences from the DOM model:
28
+ * - propagation is view-driven rather than browser-driven
29
+ * - only the event types used by GenomeSpy are represented
30
+ * - there is only `stopPropagation()`, not stop-immediate semantics
31
+ * - mark picking is not encoded into `target`; mark hover lives separately in
32
+ * `InteractionController`
33
+ *
34
+ * Mouse and wheel helpers:
35
+ * - `mouseEvent` exposes the underlying MouseEvent for imperative handlers
36
+ * - `proxiedMouseEvent` exposes only primitive properties for places that
37
+ * must not retain live DOM objects
38
+ * - `wheelEvent` exposes the underlying wheel-like event, optionally with
39
+ * temporary delta overrides applied by `setWheelDeltas()`
40
+ *
41
+ * Special event types:
42
+ * - `wheelclaimprobe` asks pointed views whether they would consume wheel,
43
+ * without running the actual wheel side effects yet
44
+ * - `touchgesture` is a synthesized high-level gesture event derived from
45
+ * touch input
46
+ */
47
+ export default class Interaction {
48
+ /** @type {MouseEvent} */
49
+ #primitiveMouseEventProxy;
50
+
51
+ /** @type {import("./interactionEvent.js").WheelLikeEvent | undefined} */
52
+ #wheelEventProxy;
53
+
54
+ /**
55
+ * @param {import("../view/layout/point.js").default} point
56
+ * @param {import("./interactionEvent.js").InteractionUiEvent} uiEvent
57
+ * @param {string} [type]
58
+ */
59
+ constructor(point, uiEvent, type) {
60
+ this.point = point;
61
+ this.#uiEvent = uiEvent;
62
+ this.stopped = false;
63
+ this.wheelClaimed = false;
64
+ this.#typeOverride = type;
65
+
66
+ /**
67
+ * The target is known only after the interaction has been resolved
68
+ * against the view hierarchy.
69
+ *
70
+ * @type {import("../view/view.js").default | undefined}
71
+ */
72
+ this.target = undefined;
73
+
74
+ /**
75
+ * Reserved for the new interaction dispatcher.
76
+ *
77
+ * @type {import("../view/view.js").default | undefined}
78
+ */
79
+ this.currentTarget = undefined;
80
+
81
+ /**
82
+ * Reserved for enter/leave-style transition events.
83
+ *
84
+ * @type {import("../view/view.js").default | undefined}
85
+ */
86
+ this.relatedTarget = undefined;
87
+ }
88
+
89
+ /** @type {import("./interactionEvent.js").InteractionUiEvent} */
90
+ #uiEvent;
91
+ /** @type {string | undefined} */
92
+ #typeOverride;
93
+ /** @type {{ deltaX: number, deltaY: number } | undefined} */
94
+ #wheelDeltaOverride;
95
+
96
+ get uiEvent() {
97
+ return this.#uiEvent;
98
+ }
99
+
100
+ set uiEvent(value) {
101
+ this.#uiEvent = value;
102
+ this.#primitiveMouseEventProxy = undefined;
103
+ this.#wheelEventProxy = undefined;
104
+ this.#wheelDeltaOverride = undefined;
105
+ }
106
+
107
+ stopPropagation() {
108
+ this.stopped = true;
109
+ }
110
+
111
+ /**
112
+ * Marks the current wheel interaction as claimed by the pointed view
113
+ * hierarchy.
114
+ *
115
+ * This is used both for real wheel events and for the synthetic
116
+ * `wheelclaimprobe` preflight. Controllers use the claimed state to decide
117
+ * whether the native wheel event should call `preventDefault()`.
118
+ */
119
+ claimWheel() {
120
+ if (this.type !== "wheel" && this.type !== "wheelclaimprobe") {
121
+ throw new Error("Can claim wheel only for wheel events!");
122
+ }
123
+
124
+ this.wheelClaimed = true;
125
+ }
126
+
127
+ /**
128
+ * @param {number} deltaX
129
+ * @param {number} deltaY
130
+ */
131
+ setWheelDeltas(deltaX, deltaY) {
132
+ if (!isWheelEvent(this.uiEvent)) {
133
+ throw new Error("Not a WheelEvent!");
134
+ }
135
+
136
+ this.#wheelDeltaOverride = { deltaX, deltaY };
137
+ this.#wheelEventProxy = undefined;
138
+ }
139
+
140
+ get type() {
141
+ return this.#typeOverride ?? this.uiEvent.type;
142
+ }
143
+
144
+ set type(value) {
145
+ this.#typeOverride = value;
146
+ }
147
+
148
+ /**
149
+ * Returns a primitive-only proxy of the underlying MouseEvent.
150
+ *
151
+ * This is intended for places such as expression evaluation, where the
152
+ * caller needs scalar event fields but should not receive a live DOM event
153
+ * object with methods, nested objects, or browser-specific prototypes.
154
+ */
155
+ get proxiedMouseEvent() {
156
+ if (!this.#primitiveMouseEventProxy) {
157
+ this.#primitiveMouseEventProxy = createPrimitiveEventProxy(
158
+ this.mouseEvent
159
+ );
160
+ }
161
+
162
+ return this.#primitiveMouseEventProxy;
163
+ }
164
+
165
+ get mouseEvent() {
166
+ if (this.uiEvent instanceof MouseEvent) {
167
+ return this.uiEvent;
168
+ } else {
169
+ throw new Error("Not a MouseEvent!");
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Returns a wheel-like event with any temporary delta overrides applied.
175
+ *
176
+ * The wrapped event keeps the original event identity for all properties
177
+ * except `deltaX` and `deltaY`, which allows intermediate handlers to
178
+ * consume part of the wheel interaction while keeping downstream wheel
179
+ * handling on the same event instance.
180
+ */
181
+ get wheelEvent() {
182
+ if (!isWheelEvent(this.uiEvent)) {
183
+ throw new Error("Not a WheelEvent!");
184
+ }
185
+
186
+ if (!this.#wheelDeltaOverride) {
187
+ return this.uiEvent;
188
+ }
189
+
190
+ if (!this.#wheelEventProxy) {
191
+ this.#wheelEventProxy = overrideWheelEventDeltas(
192
+ this.uiEvent,
193
+ this.#wheelDeltaOverride.deltaX,
194
+ this.#wheelDeltaOverride.deltaY
195
+ );
196
+ }
197
+
198
+ return this.#wheelEventProxy;
199
+ }
200
+ }
@@ -1,3 +1,47 @@
1
+ /**
2
+ * @typedef {object} TouchGestureEvent
3
+ * @prop {"touchgesture"} type
4
+ * @prop {"move" | "end"} phase
5
+ * @prop {1 | 2} pointerCount
6
+ * @prop {number} xDelta
7
+ * @prop {number} yDelta
8
+ * @prop {number} zDelta
9
+ * @prop {() => void} [preventDefault]
10
+ */
11
+ /**
12
+ * Side-effect-free query event for wheel ownership. Handlers should only
13
+ * claim wheel if they would consume native wheel at the current pointer
14
+ * location.
15
+ *
16
+ * @typedef {object} WheelClaimProbeEvent
17
+ * @prop {"wheelclaimprobe"} type
18
+ */
19
+ /**
20
+ * @typedef {Pick<
21
+ * WheelEvent,
22
+ * "type" | "deltaX" | "deltaY" | "deltaMode" | "preventDefault" | "ctrlKey"
23
+ * >} WheelLikeEvent
24
+ */
25
+ /**
26
+ * @typedef {UIEvent | WheelLikeEvent | TouchGestureEvent | WheelClaimProbeEvent} InteractionUiEvent
27
+ */
28
+ /**
29
+ * @param {unknown} eventLike
30
+ * @returns {eventLike is TouchGestureEvent}
31
+ */
32
+ export function isTouchGestureEvent(eventLike: unknown): eventLike is TouchGestureEvent;
33
+ /**
34
+ * @param {unknown} eventLike
35
+ * @returns {eventLike is WheelLikeEvent}
36
+ */
37
+ export function isWheelEvent(eventLike: unknown): eventLike is WheelLikeEvent;
38
+ /**
39
+ * @param {WheelLikeEvent} wheelEvent
40
+ * @param {number} deltaX
41
+ * @param {number} deltaY
42
+ * @returns {WheelLikeEvent}
43
+ */
44
+ export function overrideWheelEventDeltas(wheelEvent: WheelLikeEvent, deltaX: number, deltaY: number): WheelLikeEvent;
1
45
  /**
2
46
  * Create a safe proxy for an event-like object that exposes only primitive
3
47
  * (string, number, boolean, bigint, symbol, undefined) properties and null.
@@ -7,38 +51,23 @@
7
51
  * @template T
8
52
  */
9
53
  export function createPrimitiveEventProxy<T>(target: T): T;
54
+ export type TouchGestureEvent = {
55
+ type: "touchgesture";
56
+ phase: "move" | "end";
57
+ pointerCount: 1 | 2;
58
+ xDelta: number;
59
+ yDelta: number;
60
+ zDelta: number;
61
+ preventDefault?: () => void;
62
+ };
10
63
  /**
11
- * This class wraps a MouseEvent (or similar) and allows for
12
- * its propagation through the view hierarchy in a similar manner
13
- * as in the DOM.
14
- */
15
- export default class InteractionEvent {
16
- /**
17
- * @param {import("../view/layout/point.js").default} point Event coordinates
18
- * inside the visualization canvas.
19
- * @param {UIEvent} uiEvent The event to be wrapped
20
- */
21
- constructor(point: import("../view/layout/point.js").default, uiEvent: UIEvent);
22
- point: import("../view/layout/point.js").default;
23
- uiEvent: UIEvent;
24
- stopped: boolean;
25
- /**
26
- * The target is known only in the bubbling phase
27
- *
28
- * @type {import("../view/view.js").default}
29
- */
30
- target: import("../view/view.js").default;
31
- stopPropagation(): void;
32
- /**
33
- * The event type string of the underlying UI event (e.g. "click", "keydown").
34
- *
35
- * This getter proxies and returns the `type` property from the internal `UIEvent` instance (`this.uiEvent`).
36
- *
37
- * @returns {string} The UI event type.
38
- */
39
- get type(): string;
40
- get proxiedMouseEvent(): MouseEvent;
41
- get mouseEvent(): MouseEvent;
42
- #private;
43
- }
64
+ * Side-effect-free query event for wheel ownership. Handlers should only
65
+ * claim wheel if they would consume native wheel at the current pointer
66
+ * location.
67
+ */
68
+ export type WheelClaimProbeEvent = {
69
+ type: "wheelclaimprobe";
70
+ };
71
+ export type WheelLikeEvent = Pick<WheelEvent, "type" | "deltaX" | "deltaY" | "deltaMode" | "preventDefault" | "ctrlKey">;
72
+ export type InteractionUiEvent = UIEvent | WheelLikeEvent | TouchGestureEvent | WheelClaimProbeEvent;
44
73
  //# sourceMappingURL=interactionEvent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interactionEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/interactionEvent.js"],"names":[],"mappings":"AA6DA;;;;;;;GAOG;AACH,0CAFa,CAAC,UAFH,CAAC,GACC,CAAC,CA0Eb;AA5ID;;;;GAIG;AACH;IAII;;;;OAIG;IACH,mBAJW,OAAO,yBAAyB,EAAE,OAAO,WAEzC,OAAO,EAajB;IAVG,iDAAkB;IAClB,iBAAsB;IACtB,iBAAoB;IAEpB;;;;OAIG;IACH,QAFU,OAAO,iBAAiB,EAAE,OAAO,CAEpB;IAG3B,wBAEC;IAED;;;;;;OAMG;IACH,YAFa,MAAM,CAIlB;IAED,oCAQC;IAED,6BAMC;;CACJ"}
1
+ {"version":3,"file":"interactionEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/interactionEvent.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;;GAGG;AACH,+CAHW,OAAO,GACL,SAAS,IAAI,iBAAiB,CAoB1C;AAED;;;GAGG;AACH,wCAHW,OAAO,GACL,SAAS,IAAI,cAAc,CAmBvC;AAED;;;;;GAKG;AACH,qDALW,cAAc,UACd,MAAM,UACN,MAAM,GACJ,cAAc,CAe1B;AAED;;;;;;;GAOG;AACH,0CAFa,CAAC,UAFH,CAAC,GACC,CAAC,CA0Eb;;UAhLS,cAAc;WACd,MAAM,GAAG,KAAK;kBACd,CAAC,GAAG,CAAC;YACL,MAAM;YACN,MAAM;YACN,MAAM;qBACN,MAAM,IAAI;;;;;;;;UASV,iBAAiB;;6BAId,IAAI,CACT,UAAU,EACjB,MAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,gBAAgB,GAAG,SAAS,CAC7E;iCAIS,OAAO,GAAG,cAAc,GAAG,iBAAiB,GAAG,oBAAoB"}
@@ -1,62 +1,100 @@
1
1
  /**
2
- * This class wraps a MouseEvent (or similar) and allows for
3
- * its propagation through the view hierarchy in a similar manner
4
- * as in the DOM.
2
+ * @typedef {object} TouchGestureEvent
3
+ * @prop {"touchgesture"} type
4
+ * @prop {"move" | "end"} phase
5
+ * @prop {1 | 2} pointerCount
6
+ * @prop {number} xDelta
7
+ * @prop {number} yDelta
8
+ * @prop {number} zDelta
9
+ * @prop {() => void} [preventDefault]
5
10
  */
6
- export default class InteractionEvent {
7
- /** @type {MouseEvent} */
8
- #primitiveMouseEventProxy;
9
11
 
10
- /**
11
- * @param {import("../view/layout/point.js").default} point Event coordinates
12
- * inside the visualization canvas.
13
- * @param {UIEvent} uiEvent The event to be wrapped
14
- */
15
- constructor(point, uiEvent) {
16
- this.point = point;
17
- this.uiEvent = uiEvent;
18
- this.stopped = false;
12
+ /**
13
+ * Side-effect-free query event for wheel ownership. Handlers should only
14
+ * claim wheel if they would consume native wheel at the current pointer
15
+ * location.
16
+ *
17
+ * @typedef {object} WheelClaimProbeEvent
18
+ * @prop {"wheelclaimprobe"} type
19
+ */
19
20
 
20
- /**
21
- * The target is known only in the bubbling phase
22
- *
23
- * @type {import("../view/view.js").default}
24
- */
25
- this.target = undefined;
26
- }
21
+ /**
22
+ * @typedef {Pick<
23
+ * WheelEvent,
24
+ * "type" | "deltaX" | "deltaY" | "deltaMode" | "preventDefault" | "ctrlKey"
25
+ * >} WheelLikeEvent
26
+ */
27
27
 
28
- stopPropagation() {
29
- this.stopped = true;
30
- }
28
+ /**
29
+ * @typedef {UIEvent | WheelLikeEvent | TouchGestureEvent | WheelClaimProbeEvent} InteractionUiEvent
30
+ */
31
31
 
32
- /**
33
- * The event type string of the underlying UI event (e.g. "click", "keydown").
34
- *
35
- * This getter proxies and returns the `type` property from the internal `UIEvent` instance (`this.uiEvent`).
36
- *
37
- * @returns {string} The UI event type.
38
- */
39
- get type() {
40
- return this.uiEvent.type;
32
+ /**
33
+ * @param {unknown} eventLike
34
+ * @returns {eventLike is TouchGestureEvent}
35
+ */
36
+ export function isTouchGestureEvent(eventLike) {
37
+ if (!eventLike || typeof eventLike !== "object") {
38
+ return false;
41
39
  }
42
40
 
43
- get proxiedMouseEvent() {
44
- if (!this.#primitiveMouseEventProxy) {
45
- this.#primitiveMouseEventProxy = createPrimitiveEventProxy(
46
- this.mouseEvent
47
- );
48
- }
41
+ const candidate =
42
+ /** @type {{type?: unknown, phase?: unknown, pointerCount?: unknown, xDelta?: unknown, yDelta?: unknown, zDelta?: unknown}} */ (
43
+ eventLike
44
+ );
49
45
 
50
- return this.#primitiveMouseEventProxy;
51
- }
46
+ return (
47
+ candidate.type === "touchgesture" &&
48
+ (candidate.phase === "move" || candidate.phase === "end") &&
49
+ (candidate.pointerCount === 1 || candidate.pointerCount === 2) &&
50
+ Number.isFinite(candidate.xDelta) &&
51
+ Number.isFinite(candidate.yDelta) &&
52
+ Number.isFinite(candidate.zDelta)
53
+ );
54
+ }
52
55
 
53
- get mouseEvent() {
54
- if (this.uiEvent instanceof MouseEvent) {
55
- return this.uiEvent;
56
- } else {
57
- throw new Error("Not a MouseEvent!");
58
- }
56
+ /**
57
+ * @param {unknown} eventLike
58
+ * @returns {eventLike is WheelLikeEvent}
59
+ */
60
+ export function isWheelEvent(eventLike) {
61
+ if (!eventLike || typeof eventLike !== "object") {
62
+ return false;
59
63
  }
64
+
65
+ const candidate =
66
+ /** @type {{type?: unknown, deltaX?: unknown, deltaY?: unknown, deltaMode?: unknown, preventDefault?: unknown}} */ (
67
+ eventLike
68
+ );
69
+
70
+ return (
71
+ candidate.type === "wheel" &&
72
+ Number.isFinite(candidate.deltaX) &&
73
+ Number.isFinite(candidate.deltaY) &&
74
+ Number.isFinite(candidate.deltaMode) &&
75
+ typeof candidate.preventDefault === "function"
76
+ );
77
+ }
78
+
79
+ /**
80
+ * @param {WheelLikeEvent} wheelEvent
81
+ * @param {number} deltaX
82
+ * @param {number} deltaY
83
+ * @returns {WheelLikeEvent}
84
+ */
85
+ export function overrideWheelEventDeltas(wheelEvent, deltaX, deltaY) {
86
+ return new Proxy(wheelEvent, {
87
+ get(target, prop) {
88
+ if (prop === "deltaX") {
89
+ return deltaX;
90
+ } else if (prop === "deltaY") {
91
+ return deltaY;
92
+ }
93
+
94
+ const value = Reflect.get(target, prop, target);
95
+ return typeof value === "function" ? value.bind(target) : value;
96
+ },
97
+ });
60
98
  }
61
99
 
62
100
  /**
@@ -26,7 +26,7 @@ export default function kWayMerge(arrays, handler, accessor = (x) => +x) {
26
26
  }
27
27
  }
28
28
 
29
- let i = 0;
29
+ let i;
30
30
  while ((i = heap.pop()) !== undefined) {
31
31
  const array = arrays[i];
32
32
  let pointer = pointers[i];
@@ -1 +1 @@
1
- {"version":3,"file":"mergeObjects.d.ts","sourceRoot":"","sources":["../../../src/utils/mergeObjects.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,qCAFa,CAAC,WAJF,CAAC,EAAE,cACJ,MAAM,SACN,MAAM,EAAE,GACN,CAAC,CAiFb"}
1
+ {"version":3,"file":"mergeObjects.d.ts","sourceRoot":"","sources":["../../../src/utils/mergeObjects.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,qCAFa,CAAC,WAJF,CAAC,EAAE,cACJ,MAAM,SACN,MAAM,EAAE,GACN,CAAC,CAgFb"}