@genome-spy/core 0.37.3 → 0.38.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 (356) hide show
  1. package/dist/bundle/__vite-browser-external-ENoMJThg.js +8 -0
  2. package/dist/bundle/_commonjsHelpers-QtkX90xp.js +30 -0
  3. package/dist/bundle/index-1QVesMzU.js +1074 -0
  4. package/dist/bundle/index-Cbz74kpR.js +638 -0
  5. package/dist/bundle/index-LD6yPc3X.js +515 -0
  6. package/dist/bundle/index-Pv3tKJ1W.js +2190 -0
  7. package/dist/bundle/index-UyrC0vvF.js +72 -0
  8. package/dist/bundle/index-Y-LdHNIz.js +501 -0
  9. package/dist/bundle/index-gn8bhQ8w.js +4050 -0
  10. package/dist/bundle/index-lmJu1tfP.js +1372 -0
  11. package/dist/bundle/index-z4Cs62EO.js +279 -0
  12. package/dist/bundle/index.es.js +6448 -20571
  13. package/dist/bundle/index.js +93 -112
  14. package/dist/bundle/long-Veu0zKh9.js +2382 -0
  15. package/dist/bundle/remoteFile-Ur-gRKsH.js +96 -0
  16. package/dist/schema.json +492 -108
  17. package/dist/src/data/collector.d.ts +11 -11
  18. package/dist/src/data/collector.d.ts.map +1 -1
  19. package/dist/src/data/collector.js +8 -8
  20. package/dist/src/data/dataFlow.d.ts +18 -18
  21. package/dist/src/data/dataFlow.d.ts.map +1 -1
  22. package/dist/src/data/dataFlow.js +7 -7
  23. package/dist/src/data/flowNode.d.ts +9 -9
  24. package/dist/src/data/flowNode.d.ts.map +1 -1
  25. package/dist/src/data/flowNode.js +5 -5
  26. package/dist/src/data/flowOptimizer.d.ts +11 -11
  27. package/dist/src/data/flowOptimizer.d.ts.map +1 -1
  28. package/dist/src/data/flowOptimizer.js +7 -7
  29. package/dist/src/data/flowTestUtils.d.ts +2 -2
  30. package/dist/src/data/flowTestUtils.d.ts.map +1 -1
  31. package/dist/src/data/flowTestUtils.js +1 -1
  32. package/dist/src/data/sources/dataSource.js +1 -1
  33. package/dist/src/data/sources/dataSourceFactory.d.ts +3 -3
  34. package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
  35. package/dist/src/data/sources/dataSourceFactory.js +20 -20
  36. package/dist/src/data/sources/dataUtils.d.ts +20 -20
  37. package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
  38. package/dist/src/data/sources/dataUtils.js +11 -11
  39. package/dist/src/data/sources/dynamic/axisGenomeSource.d.ts +3 -3
  40. package/dist/src/data/sources/dynamic/axisGenomeSource.d.ts.map +1 -1
  41. package/dist/src/data/sources/dynamic/axisGenomeSource.js +2 -2
  42. package/dist/src/data/sources/dynamic/axisTickSource.d.ts +6 -6
  43. package/dist/src/data/sources/dynamic/axisTickSource.d.ts.map +1 -1
  44. package/dist/src/data/sources/dynamic/axisTickSource.js +4 -4
  45. package/dist/src/data/sources/dynamic/bamSource.d.ts +7 -13
  46. package/dist/src/data/sources/dynamic/bamSource.d.ts.map +1 -1
  47. package/dist/src/data/sources/dynamic/bamSource.js +35 -27
  48. package/dist/src/data/sources/dynamic/bigBedSource.d.ts +9 -9
  49. package/dist/src/data/sources/dynamic/bigBedSource.d.ts.map +1 -1
  50. package/dist/src/data/sources/dynamic/bigBedSource.js +31 -18
  51. package/dist/src/data/sources/dynamic/bigWigSource.d.ts +7 -7
  52. package/dist/src/data/sources/dynamic/bigWigSource.d.ts.map +1 -1
  53. package/dist/src/data/sources/dynamic/bigWigSource.js +33 -26
  54. package/dist/src/data/sources/dynamic/gff3Source.d.ts +9 -0
  55. package/dist/src/data/sources/dynamic/gff3Source.d.ts.map +1 -1
  56. package/dist/src/data/sources/dynamic/gff3Source.js +17 -2
  57. package/dist/src/data/sources/dynamic/indexedFastaSource.d.ts +6 -9
  58. package/dist/src/data/sources/dynamic/indexedFastaSource.d.ts.map +1 -1
  59. package/dist/src/data/sources/dynamic/indexedFastaSource.js +28 -18
  60. package/dist/src/data/sources/dynamic/singleAxisLazySource.d.ts +10 -10
  61. package/dist/src/data/sources/dynamic/singleAxisLazySource.d.ts.map +1 -1
  62. package/dist/src/data/sources/dynamic/singleAxisLazySource.js +6 -6
  63. package/dist/src/data/sources/dynamic/tabixSource.d.ts +11 -8
  64. package/dist/src/data/sources/dynamic/tabixSource.d.ts.map +1 -1
  65. package/dist/src/data/sources/dynamic/tabixSource.js +31 -17
  66. package/dist/src/data/sources/inlineSource.d.ts +7 -7
  67. package/dist/src/data/sources/inlineSource.d.ts.map +1 -1
  68. package/dist/src/data/sources/inlineSource.js +5 -5
  69. package/dist/src/data/sources/namedSource.d.ts +9 -9
  70. package/dist/src/data/sources/namedSource.d.ts.map +1 -1
  71. package/dist/src/data/sources/namedSource.js +6 -6
  72. package/dist/src/data/sources/sequenceSource.d.ts +7 -7
  73. package/dist/src/data/sources/sequenceSource.d.ts.map +1 -1
  74. package/dist/src/data/sources/sequenceSource.js +4 -4
  75. package/dist/src/data/sources/urlSource.d.ts +7 -7
  76. package/dist/src/data/sources/urlSource.d.ts.map +1 -1
  77. package/dist/src/data/sources/urlSource.js +4 -4
  78. package/dist/src/data/transforms/aggregate.d.ts +3 -3
  79. package/dist/src/data/transforms/aggregate.d.ts.map +1 -1
  80. package/dist/src/data/transforms/aggregate.js +2 -2
  81. package/dist/src/data/transforms/clone.d.ts +2 -2
  82. package/dist/src/data/transforms/clone.d.ts.map +1 -1
  83. package/dist/src/data/transforms/clone.js +1 -1
  84. package/dist/src/data/transforms/coverage.d.ts +3 -3
  85. package/dist/src/data/transforms/coverage.d.ts.map +1 -1
  86. package/dist/src/data/transforms/coverage.js +1 -1
  87. package/dist/src/data/transforms/coverage.test.js +1 -1
  88. package/dist/src/data/transforms/filter.d.ts +3 -3
  89. package/dist/src/data/transforms/filter.d.ts.map +1 -1
  90. package/dist/src/data/transforms/filter.js +2 -2
  91. package/dist/src/data/transforms/filter.test.js +1 -1
  92. package/dist/src/data/transforms/filterScoredLabels.d.ts +4 -4
  93. package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
  94. package/dist/src/data/transforms/filterScoredLabels.js +3 -3
  95. package/dist/src/data/transforms/flatten.d.ts +2 -2
  96. package/dist/src/data/transforms/flatten.d.ts.map +1 -1
  97. package/dist/src/data/transforms/flatten.js +3 -3
  98. package/dist/src/data/transforms/flatten.test.js +6 -6
  99. package/dist/src/data/transforms/flattenCompressedExons.d.ts +2 -2
  100. package/dist/src/data/transforms/flattenCompressedExons.d.ts.map +1 -1
  101. package/dist/src/data/transforms/flattenCompressedExons.js +1 -1
  102. package/dist/src/data/transforms/flattenDelimited.d.ts +2 -2
  103. package/dist/src/data/transforms/flattenDelimited.d.ts.map +1 -1
  104. package/dist/src/data/transforms/flattenDelimited.js +2 -2
  105. package/dist/src/data/transforms/flattenDelimited.test.js +5 -5
  106. package/dist/src/data/transforms/flattenSequence.d.ts +2 -2
  107. package/dist/src/data/transforms/flattenSequence.d.ts.map +1 -1
  108. package/dist/src/data/transforms/flattenSequence.js +1 -1
  109. package/dist/src/data/transforms/flattenSequence.test.js +1 -1
  110. package/dist/src/data/transforms/formula.d.ts +3 -3
  111. package/dist/src/data/transforms/formula.d.ts.map +1 -1
  112. package/dist/src/data/transforms/formula.js +2 -2
  113. package/dist/src/data/transforms/identifier.d.ts +3 -3
  114. package/dist/src/data/transforms/identifier.d.ts.map +1 -1
  115. package/dist/src/data/transforms/identifier.js +2 -2
  116. package/dist/src/data/transforms/linearizeGenomicCoordinate.d.ts +3 -3
  117. package/dist/src/data/transforms/linearizeGenomicCoordinate.d.ts.map +1 -1
  118. package/dist/src/data/transforms/linearizeGenomicCoordinate.js +2 -2
  119. package/dist/src/data/transforms/measureText.d.ts +2 -2
  120. package/dist/src/data/transforms/measureText.d.ts.map +1 -1
  121. package/dist/src/data/transforms/measureText.js +1 -1
  122. package/dist/src/data/transforms/pileup.d.ts +3 -3
  123. package/dist/src/data/transforms/pileup.d.ts.map +1 -1
  124. package/dist/src/data/transforms/pileup.js +1 -1
  125. package/dist/src/data/transforms/pileup.test.js +1 -1
  126. package/dist/src/data/transforms/project.d.ts +2 -2
  127. package/dist/src/data/transforms/project.d.ts.map +1 -1
  128. package/dist/src/data/transforms/project.js +1 -1
  129. package/dist/src/data/transforms/project.test.js +1 -1
  130. package/dist/src/data/transforms/regexExtract.d.ts +2 -2
  131. package/dist/src/data/transforms/regexExtract.d.ts.map +1 -1
  132. package/dist/src/data/transforms/regexExtract.js +1 -1
  133. package/dist/src/data/transforms/regexExtract.test.js +3 -3
  134. package/dist/src/data/transforms/regexFold.d.ts +2 -2
  135. package/dist/src/data/transforms/regexFold.d.ts.map +1 -1
  136. package/dist/src/data/transforms/regexFold.js +2 -2
  137. package/dist/src/data/transforms/regexFold.test.js +3 -3
  138. package/dist/src/data/transforms/sample.d.ts +2 -2
  139. package/dist/src/data/transforms/sample.d.ts.map +1 -1
  140. package/dist/src/data/transforms/sample.js +2 -2
  141. package/dist/src/data/transforms/stack.d.ts +3 -3
  142. package/dist/src/data/transforms/stack.d.ts.map +1 -1
  143. package/dist/src/data/transforms/stack.js +2 -2
  144. package/dist/src/data/transforms/stack.test.js +2 -2
  145. package/dist/src/data/transforms/transformFactory.d.ts +5 -5
  146. package/dist/src/data/transforms/transformFactory.d.ts.map +1 -1
  147. package/dist/src/data/transforms/transformFactory.js +3 -3
  148. package/dist/src/encoder/accessor.d.ts +6 -6
  149. package/dist/src/encoder/accessor.d.ts.map +1 -1
  150. package/dist/src/encoder/accessor.js +4 -4
  151. package/dist/src/encoder/encoder.d.ts +59 -59
  152. package/dist/src/encoder/encoder.d.ts.map +1 -1
  153. package/dist/src/encoder/encoder.js +40 -40
  154. package/dist/src/encoder/encoder.test.js +4 -4
  155. package/dist/src/fonts/bmFontManager.d.ts +7 -7
  156. package/dist/src/fonts/bmFontManager.d.ts.map +1 -1
  157. package/dist/src/fonts/bmFontManager.js +3 -3
  158. package/dist/src/fonts/bmFontMetrics.d.ts +6 -6
  159. package/dist/src/fonts/bmFontMetrics.d.ts.map +1 -1
  160. package/dist/src/fonts/bmFontMetrics.js +4 -4
  161. package/dist/src/genome/genome.d.ts +7 -7
  162. package/dist/src/genome/genome.d.ts.map +1 -1
  163. package/dist/src/genome/genome.js +2 -2
  164. package/dist/src/genome/genomeStore.d.ts +2 -2
  165. package/dist/src/genome/genomeStore.d.ts.map +1 -1
  166. package/dist/src/genome/genomeStore.js +1 -1
  167. package/dist/src/genome/locusFormat.d.ts +7 -7
  168. package/dist/src/genome/locusFormat.d.ts.map +1 -1
  169. package/dist/src/genome/locusFormat.js +4 -4
  170. package/dist/src/genome/scaleIndex.d.ts +1 -1
  171. package/dist/src/genome/scaleIndex.d.ts.map +1 -1
  172. package/dist/src/genome/scaleIndex.js +1 -1
  173. package/dist/src/genome/scaleLocus.d.ts +2 -2
  174. package/dist/src/genome/scaleLocus.d.ts.map +1 -1
  175. package/dist/src/genome/scaleLocus.js +3 -3
  176. package/dist/src/genomeSpy.d.ts +12 -12
  177. package/dist/src/genomeSpy.d.ts.map +1 -1
  178. package/dist/src/genomeSpy.js +52 -35
  179. package/dist/src/gl/arrayBuilder.d.ts.map +1 -1
  180. package/dist/src/gl/dataToVertices.d.ts +18 -18
  181. package/dist/src/gl/dataToVertices.d.ts.map +1 -1
  182. package/dist/src/gl/dataToVertices.js +10 -10
  183. package/dist/src/gl/webGLHelper.d.ts +4 -4
  184. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  185. package/dist/src/gl/webGLHelper.js +2 -2
  186. package/dist/src/index.d.ts.map +1 -1
  187. package/dist/src/index.js +1 -1
  188. package/dist/src/marks/link.js +5 -5
  189. package/dist/src/marks/mark.d.ts +35 -32
  190. package/dist/src/marks/mark.d.ts.map +1 -1
  191. package/dist/src/marks/mark.js +26 -23
  192. package/dist/src/marks/markUtils.d.ts +10 -10
  193. package/dist/src/marks/markUtils.d.ts.map +1 -1
  194. package/dist/src/marks/markUtils.js +5 -5
  195. package/dist/src/marks/pointMark.d.ts +1 -1
  196. package/dist/src/marks/pointMark.d.ts.map +1 -1
  197. package/dist/src/marks/pointMark.js +7 -7
  198. package/dist/src/marks/rectMark.d.ts +2 -2
  199. package/dist/src/marks/rectMark.d.ts.map +1 -1
  200. package/dist/src/marks/rectMark.js +7 -7
  201. package/dist/src/marks/rule.js +6 -6
  202. package/dist/src/marks/text.d.ts +1 -1
  203. package/dist/src/marks/text.d.ts.map +1 -1
  204. package/dist/src/marks/text.js +6 -6
  205. package/dist/src/scale/colorUtils.d.ts +4 -4
  206. package/dist/src/scale/colorUtils.d.ts.map +1 -1
  207. package/dist/src/scale/colorUtils.js +2 -2
  208. package/dist/src/scale/glslScaleGenerator.d.ts +3 -3
  209. package/dist/src/scale/glslScaleGenerator.d.ts.map +1 -1
  210. package/dist/src/scale/glslScaleGenerator.js +2 -2
  211. package/dist/src/scale/scale.d.ts +3 -3
  212. package/dist/src/scale/scale.d.ts.map +1 -1
  213. package/dist/src/scale/scale.js +2 -2
  214. package/dist/src/scale/ticks.d.ts +4 -4
  215. package/dist/src/scale/ticks.js +4 -4
  216. package/dist/src/spec/axis.d.ts +1 -1
  217. package/dist/src/spec/channel.d.ts +2 -2
  218. package/dist/src/spec/data.d.ts +2 -2
  219. package/dist/src/spec/mark.d.ts +3 -3
  220. package/dist/src/spec/root.d.ts +2 -2
  221. package/dist/src/spec/sampleView.d.ts +5 -5
  222. package/dist/src/spec/scale.d.ts +1 -1
  223. package/dist/src/spec/title.d.ts +1 -1
  224. package/dist/src/spec/view.d.ts +36 -9
  225. package/dist/src/tooltip/dataTooltipHandler.js +1 -1
  226. package/dist/src/tooltip/refseqGeneTooltipHandler.d.ts.map +1 -1
  227. package/dist/src/tooltip/refseqGeneTooltipHandler.js +1 -1
  228. package/dist/src/tooltip/tooltipHandler.d.ts +1 -1
  229. package/dist/src/tooltip/tooltipHandler.d.ts.map +1 -1
  230. package/dist/src/tooltip/tooltipHandler.ts +1 -1
  231. package/dist/src/types/embedApi.d.ts +3 -3
  232. package/dist/src/types/encoder.d.ts +4 -4
  233. package/dist/src/types/flowBatch.d.ts +1 -1
  234. package/dist/src/types/rendering.d.ts +3 -3
  235. package/dist/src/types/scaleResolutionApi.d.ts +2 -2
  236. package/dist/src/types/viewContext.d.ts +41 -12
  237. package/dist/src/utils/animator.d.ts +2 -2
  238. package/dist/src/utils/animator.d.ts.map +1 -1
  239. package/dist/src/utils/animator.js +1 -1
  240. package/dist/src/utils/inertia.d.ts +3 -3
  241. package/dist/src/utils/inertia.d.ts.map +1 -1
  242. package/dist/src/utils/inertia.js +1 -1
  243. package/dist/src/utils/interactionEvent.d.ts +5 -5
  244. package/dist/src/utils/interactionEvent.d.ts.map +1 -1
  245. package/dist/src/utils/interactionEvent.js +2 -2
  246. package/dist/src/utils/trees.js +1 -1
  247. package/dist/src/view/axisGridView.d.ts +17 -16
  248. package/dist/src/view/axisGridView.d.ts.map +1 -1
  249. package/dist/src/view/axisGridView.js +24 -20
  250. package/dist/src/view/axisResolution.d.ts +10 -10
  251. package/dist/src/view/axisResolution.d.ts.map +1 -1
  252. package/dist/src/view/axisResolution.js +6 -6
  253. package/dist/src/view/axisResolution.test.js +1 -1
  254. package/dist/src/view/axisView.d.ts +18 -17
  255. package/dist/src/view/axisView.d.ts.map +1 -1
  256. package/dist/src/view/axisView.js +39 -35
  257. package/dist/src/view/concatView.d.ts +5 -5
  258. package/dist/src/view/concatView.d.ts.map +1 -1
  259. package/dist/src/view/concatView.js +23 -23
  260. package/dist/src/view/containerView.d.ts +10 -8
  261. package/dist/src/view/containerView.d.ts.map +1 -1
  262. package/dist/src/view/containerView.js +18 -13
  263. package/dist/src/view/facetView.d.ts +12 -12
  264. package/dist/src/view/facetView.d.ts.map +1 -1
  265. package/dist/src/view/facetView.js +19 -19
  266. package/dist/src/view/flowBuilder.d.ts +4 -4
  267. package/dist/src/view/flowBuilder.d.ts.map +1 -1
  268. package/dist/src/view/flowBuilder.js +13 -13
  269. package/dist/src/view/flowBuilder.test.js +7 -7
  270. package/dist/src/view/gridView.d.ts +63 -35
  271. package/dist/src/view/gridView.d.ts.map +1 -1
  272. package/dist/src/view/gridView.js +400 -113
  273. package/dist/src/view/layerView.d.ts +12 -14
  274. package/dist/src/view/layerView.d.ts.map +1 -1
  275. package/dist/src/view/layerView.js +55 -26
  276. package/dist/src/{utils → view}/layout/flexLayout.d.ts +6 -6
  277. package/dist/src/view/layout/flexLayout.d.ts.map +1 -0
  278. package/dist/src/{utils → view}/layout/flexLayout.js +4 -4
  279. package/dist/src/view/layout/grid.d.ts.map +1 -0
  280. package/dist/src/{utils → view}/layout/padding.d.ts +4 -4
  281. package/dist/src/view/layout/padding.d.ts.map +1 -0
  282. package/dist/src/{utils → view}/layout/padding.js +2 -2
  283. package/dist/src/view/layout/point.d.ts.map +1 -0
  284. package/dist/src/{utils → view}/layout/rectangle.d.ts +8 -2
  285. package/dist/src/view/layout/rectangle.d.ts.map +1 -0
  286. package/dist/src/{utils → view}/layout/rectangle.js +22 -2
  287. package/dist/src/{utils → view}/layout/rectangle.test.js +8 -0
  288. package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts +10 -10
  289. package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
  290. package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +10 -10
  291. package/dist/src/view/renderingContext/compositeViewRenderingContext.d.ts +2 -2
  292. package/dist/src/view/renderingContext/compositeViewRenderingContext.d.ts.map +1 -1
  293. package/dist/src/view/renderingContext/compositeViewRenderingContext.js +4 -4
  294. package/dist/src/view/renderingContext/debuggingViewRenderingContext.d.ts +4 -4
  295. package/dist/src/view/renderingContext/debuggingViewRenderingContext.d.ts.map +1 -1
  296. package/dist/src/view/renderingContext/debuggingViewRenderingContext.js +3 -3
  297. package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts +8 -8
  298. package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts.map +1 -1
  299. package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.js +4 -4
  300. package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts +6 -6
  301. package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts.map +1 -1
  302. package/dist/src/view/renderingContext/simpleViewRenderingContext.js +7 -7
  303. package/dist/src/view/renderingContext/svgViewRenderingContext.d.ts +4 -4
  304. package/dist/src/view/renderingContext/svgViewRenderingContext.d.ts.map +1 -1
  305. package/dist/src/view/renderingContext/svgViewRenderingContext.js +6 -6
  306. package/dist/src/view/renderingContext/viewRenderingContext.d.ts +10 -10
  307. package/dist/src/view/renderingContext/viewRenderingContext.d.ts.map +1 -1
  308. package/dist/src/view/renderingContext/viewRenderingContext.js +5 -5
  309. package/dist/src/view/scaleResolution.d.ts +21 -17
  310. package/dist/src/view/scaleResolution.d.ts.map +1 -1
  311. package/dist/src/view/scaleResolution.js +29 -24
  312. package/dist/src/view/scaleResolution.test.js +57 -72
  313. package/dist/src/view/testUtils.d.ts +6 -15
  314. package/dist/src/view/testUtils.d.ts.map +1 -1
  315. package/dist/src/view/testUtils.js +40 -44
  316. package/dist/src/view/title.d.ts +3 -3
  317. package/dist/src/view/title.d.ts.map +1 -1
  318. package/dist/src/view/title.js +12 -12
  319. package/dist/src/view/unitView.d.ts +31 -30
  320. package/dist/src/view/unitView.d.ts.map +1 -1
  321. package/dist/src/view/unitView.js +30 -22
  322. package/dist/src/view/view.d.ts +86 -57
  323. package/dist/src/view/view.d.ts.map +1 -1
  324. package/dist/src/view/view.js +148 -103
  325. package/dist/src/view/view.test.js +9 -8
  326. package/dist/src/view/viewError.d.ts +9 -0
  327. package/dist/src/view/viewError.d.ts.map +1 -0
  328. package/dist/src/view/viewError.js +11 -0
  329. package/dist/src/view/viewFactory.d.ts +53 -20
  330. package/dist/src/view/viewFactory.d.ts.map +1 -1
  331. package/dist/src/view/viewFactory.js +148 -33
  332. package/dist/src/view/viewFactory.test.js +8 -0
  333. package/dist/src/view/viewUtils.d.ts +14 -12
  334. package/dist/src/view/viewUtils.d.ts.map +1 -1
  335. package/dist/src/view/viewUtils.js +10 -63
  336. package/dist/src/view/zoom.d.ts +4 -4
  337. package/dist/src/view/zoom.d.ts.map +1 -1
  338. package/dist/src/view/zoom.js +3 -3
  339. package/package.json +7 -5
  340. package/dist/src/utils/layout/flexLayout.d.ts.map +0 -1
  341. package/dist/src/utils/layout/grid.d.ts.map +0 -1
  342. package/dist/src/utils/layout/padding.d.ts.map +0 -1
  343. package/dist/src/utils/layout/point.d.ts.map +0 -1
  344. package/dist/src/utils/layout/rectangle.d.ts.map +0 -1
  345. package/dist/src/view/implicitRootView.d.ts +0 -9
  346. package/dist/src/view/implicitRootView.d.ts.map +0 -1
  347. package/dist/src/view/implicitRootView.js +0 -23
  348. package/dist/src/view/importView.d.ts +0 -17
  349. package/dist/src/view/importView.d.ts.map +0 -1
  350. package/dist/src/view/importView.js +0 -22
  351. /package/dist/src/{utils → view}/layout/flexLayout.test.js +0 -0
  352. /package/dist/src/{utils → view}/layout/grid.d.ts +0 -0
  353. /package/dist/src/{utils → view}/layout/grid.js +0 -0
  354. /package/dist/src/{utils → view}/layout/grid.test.js +0 -0
  355. /package/dist/src/{utils → view}/layout/point.d.ts +0 -0
  356. /package/dist/src/{utils → view}/layout/point.js +0 -0
@@ -2,26 +2,51 @@
2
2
  import View from "./view.js";
3
3
 
4
4
  import UnitView from "./unitView.js";
5
- import ImportView from "./importView.js";
6
5
  import LayerView from "./layerView.js";
7
6
  import ConcatView from "./concatView.js";
8
7
  import { isArray, isObject, isString } from "vega-util";
8
+ import { loadExternalViewSpec } from "./viewUtils.js";
9
+ import ContainerView from "./containerView.js";
10
+ import ViewError from "./viewError.js";
9
11
 
12
+ export const VIEW_ROOT_NAME = "viewRoot";
13
+
14
+ /**
15
+ * @typedef {object} ViewFactoryOptions
16
+ * @property {boolean} [allowImport]
17
+ * @property {boolean} [wrapRoot]
18
+ */
19
+
20
+ /**
21
+ *
22
+ */
10
23
  export class ViewFactory {
11
24
  /**
12
- * @typedef {import("../types/viewContext").default} ViewContext
13
- * @typedef {import("../spec/view").UnitSpec} UnitSpec
14
- * @typedef {import("../spec/view").ViewSpec} ViewSpec
15
- * @typedef {import("../spec/view").LayerSpec} LayerSpec
16
- * @typedef {import("../spec/view").VConcatSpec} VConcatSpec
17
- * @typedef {import("../spec/view").ConcatSpec} ConcatSpec
25
+ * @typedef {import("../types/viewContext.js").default} ViewContext
26
+ * @typedef {import("../spec/view.js").UnitSpec} UnitSpec
27
+ * @typedef {import("../spec/view.js").ViewSpec} ViewSpec
28
+ * @typedef {import("../spec/view.js").LayerSpec} LayerSpec
29
+ * @typedef {import("../spec/view.js").VConcatSpec} VConcatSpec
30
+ * @typedef {import("../spec/view.js").ConcatSpec} ConcatSpec
31
+ * @typedef {import("../spec/sampleView.js").SampleSpec} SampleSpec
18
32
  *
19
33
  * @typedef {(spec: ViewSpec) => boolean} SpecGuard
20
- * @typedef {(spec: ViewSpec, context: ViewContext, layoutParent?: import("./containerView").default, dataParent?: import("./view").default, defaultName?: string) => View} Factory
34
+ * @typedef {(spec: ViewSpec, context: ViewContext, layoutParent?: import("./containerView.js").default, dataParent?: import("./view.js").default, defaultName?: string) => View} Factory
21
35
  */
22
- constructor() {
23
- /** @type {{specGuard: SpecGuard, factory: Factory}[]} */
24
- this.types = [];
36
+
37
+ /** @type {Map<SpecGuard, Factory>} */
38
+ #types = new Map();
39
+
40
+ /**
41
+ * @param {ViewFactoryOptions} [options]
42
+ */
43
+ constructor(options = {}) {
44
+ /** @type {Required<ViewFactoryOptions>} */
45
+ this.options = {
46
+ allowImport: true,
47
+ wrapRoot: true,
48
+ ...options,
49
+ };
25
50
 
26
51
  const makeDefaultFactory =
27
52
  (/** @type {typeof View} */ ViewClass) =>
@@ -37,14 +62,18 @@ export class ViewFactory {
37
62
  )
38
63
  );
39
64
 
40
- // @ts-expect-error TODO: Fix typing
41
- this.addViewType(isImportSpec, makeDefaultFactory(ImportView));
42
65
  this.addViewType(isLayerSpec, makeDefaultFactory(LayerView));
43
66
  this.addViewType(isUnitSpec, makeDefaultFactory(UnitView));
44
67
  this.addViewType(isVConcatSpec, makeDefaultFactory(ConcatView));
45
68
  this.addViewType(isHConcatSpec, makeDefaultFactory(ConcatView));
46
69
  this.addViewType(isConcatSpec, makeDefaultFactory(ConcatView));
47
70
  //this.addViewType(isFacetSpec, makeDefaultFactory(FacetView));
71
+
72
+ this.addViewType(isSampleSpec, () => {
73
+ throw new Error(
74
+ "SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!"
75
+ );
76
+ });
48
77
  }
49
78
 
50
79
  /**
@@ -52,32 +81,33 @@ export class ViewFactory {
52
81
  * @param {Factory} factory
53
82
  */
54
83
  addViewType(specGuard, factory) {
55
- this.types.push({ specGuard, factory });
84
+ this.#types.set(specGuard, factory);
56
85
  }
57
86
 
58
87
  /**
59
88
  * @param {ViewSpec} spec
60
89
  * @param {ViewContext} context
61
- * @param {import("./containerView").default} [layoutParent]
62
- * @param {import("./view").default} [dataParent]
90
+ * @param {import("./containerView.js").default} [layoutParent]
91
+ * @param {import("./view.js").default} [dataParent]
63
92
  * @param {string} [defaultName]
64
93
  */
65
94
  createView(spec, context, layoutParent, dataParent, defaultName) {
66
- const type = this.types.find((type) => type.specGuard(spec));
67
- if (type) {
68
- return type.factory(
69
- spec,
70
- context,
71
- layoutParent,
72
- dataParent,
73
- defaultName ?? "unnamed"
74
- );
75
- } else {
76
- throw new Error(
77
- "Invalid spec, cannot figure out the view type from the properties: " +
78
- JSON.stringify([...Object.keys(spec)])
79
- );
95
+ for (const [guard, factory] of this.#types) {
96
+ if (guard(spec)) {
97
+ return factory(
98
+ spec,
99
+ context,
100
+ layoutParent,
101
+ dataParent,
102
+ defaultName
103
+ );
104
+ }
80
105
  }
106
+
107
+ throw new Error(
108
+ "Invalid spec, cannot figure out the view type from the properties: " +
109
+ JSON.stringify([...Object.keys(spec)])
110
+ );
81
111
  }
82
112
 
83
113
  /**
@@ -86,7 +116,7 @@ export class ViewFactory {
86
116
  * @returns {spec is ViewSpec}
87
117
  */
88
118
  isViewSpec(spec) {
89
- const matches = this.types.filter((type) => type.specGuard(spec));
119
+ const matches = [...this.#types.keys()].filter((guard) => guard(spec));
90
120
 
91
121
  if (matches.length > 1) {
92
122
  throw new Error("Ambiguous spec. Cannot create a view!");
@@ -94,6 +124,77 @@ export class ViewFactory {
94
124
 
95
125
  return matches.length == 1;
96
126
  }
127
+
128
+ /**
129
+ * Creates a view from a spec, or imports it from an external source.
130
+ * Also initializes child views.
131
+ *
132
+ * @param {ViewSpec | import("../spec/view.js").ImportSpec} spec
133
+ * @param {ViewContext} context
134
+ * @param {import("./containerView.js").default} [layoutParent]
135
+ * @param {import("./view.js").default} [dataParent]
136
+ * @param {string} [defaultName]
137
+ * @param {(spec: ViewSpec) => void} [validator]
138
+ */
139
+ async createOrImportView(
140
+ spec,
141
+ context,
142
+ layoutParent,
143
+ dataParent,
144
+ defaultName,
145
+ validator
146
+ ) {
147
+ /** @type {ViewSpec} */
148
+ let viewSpec;
149
+
150
+ if (isImportSpec(spec)) {
151
+ if (this.options.allowImport) {
152
+ viewSpec = await loadExternalViewSpec(
153
+ spec,
154
+ dataParent.getBaseUrl(),
155
+ context
156
+ );
157
+
158
+ if (validator) {
159
+ validator(viewSpec);
160
+ }
161
+ } else {
162
+ throw new ViewError(
163
+ "Importing views is not allowed!",
164
+ layoutParent
165
+ );
166
+ }
167
+ } else {
168
+ viewSpec = spec;
169
+ }
170
+
171
+ // Wrap a unit spec at root into a grid view to get axes, etc.
172
+ if (
173
+ !dataParent &&
174
+ this.options.wrapRoot &&
175
+ (isUnitSpec(viewSpec) || isLayerSpec(viewSpec)) &&
176
+ defaultName === VIEW_ROOT_NAME
177
+ ) {
178
+ viewSpec = {
179
+ name: "implicitRoot",
180
+ vconcat: [viewSpec],
181
+ };
182
+ }
183
+
184
+ const view = this.createView(
185
+ viewSpec,
186
+ context,
187
+ layoutParent,
188
+ dataParent,
189
+ defaultName
190
+ );
191
+
192
+ if (view instanceof ContainerView) {
193
+ await view.initializeChildren();
194
+ }
195
+
196
+ return view;
197
+ }
97
198
  }
98
199
 
99
200
  /**
@@ -131,7 +232,7 @@ export function isFacetSpec(spec) {
131
232
  /**
132
233
  *
133
234
  * @param {ViewSpec} spec
134
- * @returns {spec is import("../spec/view").AggregateSamplesSpec}
235
+ * @returns {spec is import("../spec/view.js").AggregateSamplesSpec}
135
236
  */
136
237
  export function isAggregateSamplesSpec(spec) {
137
238
  return (
@@ -144,7 +245,7 @@ export function isAggregateSamplesSpec(spec) {
144
245
  /**
145
246
  *
146
247
  * @param {object} spec
147
- * @returns {spec is ImportSpec}
248
+ * @returns {spec is import("../spec/view.js").ImportSpec}
148
249
  */
149
250
  export function isImportSpec(spec) {
150
251
  return "import" in spec;
@@ -176,3 +277,17 @@ export function isHConcatSpec(spec) {
176
277
  export function isConcatSpec(spec) {
177
278
  return "concat" in spec && isArray(spec.concat);
178
279
  }
280
+
281
+ /**
282
+ *
283
+ * @param {ViewSpec} spec
284
+ * @returns {spec is SampleSpec}
285
+ */
286
+ export function isSampleSpec(spec) {
287
+ return (
288
+ "samples" in spec &&
289
+ isObject(spec.samples) &&
290
+ "spec" in spec &&
291
+ isObject(spec.spec)
292
+ );
293
+ }
@@ -15,3 +15,11 @@ test("isViewSpec", () => {
15
15
 
16
16
  expect(() => factory.isViewSpec({ mark: "rect", layer: [] })).toThrow();
17
17
  });
18
+
19
+ test("Throws if importing is not allowed", () => {
20
+ const factory = new ViewFactory({ allowImport: false });
21
+
22
+ expect(() =>
23
+ factory.createOrImportView({ import: { url: "" } })
24
+ ).rejects.toThrow();
25
+ });
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  *
3
- * @param {import("../spec/channel").ChannelDef | import("../spec/view").FacetMapping} def
3
+ * @param {import("../spec/channel.js").ChannelDef | import("../spec/view.js").FacetMapping} def
4
4
  * @returns {spec is FacetFieldDef}
5
5
  */
6
- export function isFacetFieldDef(def: import("../spec/channel").ChannelDef | import("../spec/view").FacetMapping): spec is FacetFieldDef;
6
+ export function isFacetFieldDef(def: import("../spec/channel.js").ChannelDef | import("../spec/view.js").FacetMapping): spec is FacetFieldDef;
7
7
  /**
8
8
  *
9
- * @param {import("../spec/channel").FacetFieldDef | import("../spec/view").FacetMapping} def
9
+ * @param {import("../spec/channel.js").FacetFieldDef | import("../spec/view.js").FacetMapping} def
10
10
  * @returns {spec is FacetMapping}
11
11
  */
12
- export function isFacetMapping(def: import("../spec/channel").FacetFieldDef | import("../spec/view").FacetMapping): spec is FacetMapping;
12
+ export function isFacetMapping(def: import("../spec/channel.js").FacetFieldDef | import("../spec/view.js").FacetMapping): spec is FacetMapping;
13
13
  /**
14
14
  *
15
15
  * @param {object} config
@@ -30,7 +30,7 @@ export function getFlattenedViews(root: View): View[];
30
30
  /**
31
31
  * @param {View} root
32
32
  */
33
- export function resolveScalesAndAxes(root: View): void;
33
+ export function checkForDuplicateScaleNames(root: View): void;
34
34
  /**
35
35
  * Gives names to zoomable scales that have been pulled to the root. This allows
36
36
  * the zoomed domains to be bookmarked without explicitly specifying the names.
@@ -42,24 +42,26 @@ export function resolveScalesAndAxes(root: View): void;
42
42
  export function setImplicitScaleNames(root: View): void;
43
43
  /**
44
44
  * @param {View} root
45
- * @param {import("../data/dataFlow").default<View>} [existingFlow] Add data flow
45
+ * @param {import("../data/dataFlow.js").default<View>} [existingFlow] Add data flow
46
46
  * graphs to an existing DataFlow object.
47
47
  */
48
- export function initializeData(root: View, existingFlow?: import("../data/dataFlow").default<View>): Promise<import("../data/dataFlow").default<View>>;
48
+ export function initializeData(root: View, existingFlow?: import("../data/dataFlow.js").default<View>): Promise<import("../data/dataFlow.js").default<View>>;
49
49
  /**
50
50
  *
51
51
  * @param {View} view
52
52
  */
53
53
  export function findEncodedFields(view: View): {
54
54
  view: UnitView;
55
- channel: import("../spec/channel").Channel;
56
- field: import("../spec/channel").Field;
57
- type: import("../spec/channel").Type;
55
+ channel: import("../spec/channel.js").Channel;
56
+ field: import("../spec/channel.js").Field;
57
+ type: import("../spec/channel.js").Type;
58
58
  }[];
59
59
  /**
60
- * @param {import("./view").default} viewRoot
60
+ * @param {import("../spec/view.js").ImportSpec} spec
61
+ * @param {string} baseUrl
62
+ * @param {import("../types/viewContext.js").default} viewContext
61
63
  */
62
- export function processImports(viewRoot: import("./view").default): Promise<void>;
64
+ export function loadExternalViewSpec(spec: import("../spec/view.js").ImportSpec, baseUrl: string, viewContext: import("../types/viewContext.js").default): Promise<any>;
63
65
  /**
64
66
  * @param {function(View, View[]):void} visitor
65
67
  */
@@ -1 +1 @@
1
- {"version":3,"file":"viewUtils.d.ts","sourceRoot":"","sources":["../../../src/view/viewUtils.js"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,qCAHW,OAAO,iBAAiB,EAAE,UAAU,GAAG,OAAO,cAAc,EAAE,YAAY,yBAKpF;AAED;;;;GAIG;AACH,oCAHW,OAAO,iBAAiB,EAAE,aAAa,GAAG,OAAO,cAAc,EAAE,YAAY,wBAQvF;AAED;;;;GAIG;AACH,uCAHW,MAAM,0BAKhB;AAED;;;GAGG;AACH,+BAFW,IAAI,wCAMd;AAED;;;;GAIG;AACH,wCAFW,IAAI,UASd;AAED;;GAEG;AACH,2CAFW,IAAI,QA8Bd;AAED;;;;;;;GAOG;AACH,4CAFW,IAAI,QAUd;AAED;;;;GAIG;AACH,qCAJW,IAAI,iBACJ,OAAO,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,qDAclD;AAED;;;GAGG;AACH,wCAFW,IAAI;UAGO,QAAQ;aAAW,OAAO,iBAAiB,EAAE,OAAO;WAAS,OAAO,iBAAiB,EAAE,KAAK;UAAQ,OAAO,iBAAiB,EAAE,IAAI;IAqBvJ;AAqCD;;GAEG;AACH,yCAFW,OAAO,QAAQ,EAAE,OAAO,iBAoClC;AAED;;GAEG;AACH,gDAFoB,IAAI,QAAE,IAAI,EAAE,KAAE,IAAI,+BAkBrC;AAED;;;;;;GAMG;AACH,4CAJW,IAAI,QACJ,MAAM,GACJ,IAAI,EAAE,CAalB;AAED;;;GAGG;AACH,0CAFW,IAAI,eAqBd;AAOD;;GAEG;AACH,8CAFW,IAAI;;;EAgBd;AAnBM,uCAFI,MAAM,WAE0D;iBA5S9B,WAAW;qBAHnC,eAAe"}
1
+ {"version":3,"file":"viewUtils.d.ts","sourceRoot":"","sources":["../../../src/view/viewUtils.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,qCAHW,OAAO,oBAAoB,EAAE,UAAU,GAAG,OAAO,iBAAiB,EAAE,YAAY,yBAK1F;AAED;;;;GAIG;AACH,oCAHW,OAAO,oBAAoB,EAAE,aAAa,GAAG,OAAO,iBAAiB,EAAE,YAAY,wBAQ7F;AAED;;;;GAIG;AACH,uCAHW,MAAM,0BAKhB;AAED;;;GAGG;AACH,+BAFW,IAAI,wCAMd;AAED;;;;GAIG;AACH,wCAFW,IAAI,UASd;AAED;;GAEG;AACH,kDAFW,IAAI,QAiBd;AAED;;;;;;;GAOG;AACH,4CAFW,IAAI,QAUd;AAED;;;;GAIG;AACH,qCAJW,IAAI,iBACJ,OAAO,qBAAqB,EAAE,OAAO,CAAC,IAAI,CAAC,wDAcrD;AAED;;;GAGG;AACH,wCAFW,IAAI;UAGO,QAAQ;aAAW,OAAO,oBAAoB,EAAE,OAAO;WAAS,OAAO,oBAAoB,EAAE,KAAK;UAAQ,OAAO,oBAAoB,EAAE,IAAI;IAqBhK;AAED;;;;GAIG;AACH,2CAJW,OAAO,iBAAiB,EAAE,UAAU,WACpC,MAAM,eACN,OAAO,yBAAyB,EAAE,OAAO,gBA8BnD;AAED;;GAEG;AACH,gDAFoB,IAAI,QAAE,IAAI,EAAE,KAAE,IAAI,+BAkBrC;AAED;;;;;;GAMG;AACH,4CAJW,IAAI,QACJ,MAAM,GACJ,IAAI,EAAE,CAalB;AAED;;;GAGG;AACH,0CAFW,IAAI,eAqBd;AAOD;;GAEG;AACH,8CAFW,IAAI;;;EAgBd;AAnBM,uCAFI,MAAM,WAE0D;iBAxP9B,WAAW;qBAFnC,eAAe"}
@@ -2,7 +2,6 @@ import { isObject, isString } from "vega-util";
2
2
  import { loader as vegaLoader } from "vega-loader";
3
3
 
4
4
  import UnitView from "./unitView.js";
5
- import ImportView from "./importView.js";
6
5
  // eslint-disable-next-line no-unused-vars
7
6
  import View, { VISIT_SKIP, VISIT_STOP } from "./view.js";
8
7
  import { buildDataFlow } from "./flowBuilder.js";
@@ -12,7 +11,7 @@ import { rollup } from "d3-array";
12
11
 
13
12
  /**
14
13
  *
15
- * @param {import("../spec/channel").ChannelDef | import("../spec/view").FacetMapping} def
14
+ * @param {import("../spec/channel.js").ChannelDef | import("../spec/view.js").FacetMapping} def
16
15
  * @returns {spec is FacetFieldDef}
17
16
  */
18
17
  export function isFacetFieldDef(def) {
@@ -21,7 +20,7 @@ export function isFacetFieldDef(def) {
21
20
 
22
21
  /**
23
22
  *
24
- * @param {import("../spec/channel").FacetFieldDef | import("../spec/view").FacetMapping} def
23
+ * @param {import("../spec/channel.js").FacetFieldDef | import("../spec/view.js").FacetMapping} def
25
24
  * @returns {spec is FacetMapping}
26
25
  */
27
26
  export function isFacetMapping(def) {
@@ -67,13 +66,7 @@ export function getFlattenedViews(root) {
67
66
  /**
68
67
  * @param {View} root
69
68
  */
70
- export function resolveScalesAndAxes(root) {
71
- root.visit((view) => {
72
- if (view instanceof UnitView) {
73
- view.resolve("scale");
74
- }
75
- });
76
-
69
+ export function checkForDuplicateScaleNames(root) {
77
70
  // Check that each scale resolution has a unique name
78
71
  /** @type {Set<string>} */
79
72
  const scaleNames = new Set();
@@ -88,13 +81,6 @@ export function resolveScalesAndAxes(root) {
88
81
  scaleNames.add(name);
89
82
  }
90
83
  });
91
-
92
- root.visit((view) => {
93
- if (view instanceof UnitView) {
94
- view.resolve("axis");
95
- }
96
- });
97
- root.visit((view) => view.onScalesResolved());
98
84
  }
99
85
 
100
86
  /**
@@ -117,7 +103,7 @@ export function setImplicitScaleNames(root) {
117
103
 
118
104
  /**
119
105
  * @param {View} root
120
- * @param {import("../data/dataFlow").default<View>} [existingFlow] Add data flow
106
+ * @param {import("../data/dataFlow.js").default<View>} [existingFlow] Add data flow
121
107
  * graphs to an existing DataFlow object.
122
108
  */
123
109
  export async function initializeData(root, existingFlow) {
@@ -138,7 +124,7 @@ export async function initializeData(root, existingFlow) {
138
124
  * @param {View} view
139
125
  */
140
126
  export function findEncodedFields(view) {
141
- /** @type {{view: UnitView, channel: import("../spec/channel").Channel, field: import("../spec/channel").Field, type: import("../spec/channel").Type}[]} */
127
+ /** @type {{view: UnitView, channel: import("../spec/channel.js").Channel, field: import("../spec/channel.js").Field, type: import("../spec/channel.js").Type}[]} */
142
128
  const fieldInfos = [];
143
129
 
144
130
  view.visit((view) => {
@@ -162,11 +148,11 @@ export function findEncodedFields(view) {
162
148
  }
163
149
 
164
150
  /**
165
- * @param {import("../spec/view").ImportSpec} spec
151
+ * @param {import("../spec/view.js").ImportSpec} spec
166
152
  * @param {string} baseUrl
167
- * @param {import("../types/viewContext").default} viewContext
153
+ * @param {import("../types/viewContext.js").default} viewContext
168
154
  */
169
- async function loadExternalViewSpec(spec, baseUrl, viewContext) {
155
+ export async function loadExternalViewSpec(spec, baseUrl, viewContext) {
170
156
  if (!spec.import.url) {
171
157
  throw new Error(
172
158
  "Cannot import, not an import spec: " + JSON.stringify(spec)
@@ -196,45 +182,6 @@ async function loadExternalViewSpec(spec, baseUrl, viewContext) {
196
182
  }
197
183
  }
198
184
 
199
- /**
200
- * @param {import("./view").default} viewRoot
201
- */
202
- export async function processImports(viewRoot) {
203
- /** @type {ImportView[]} */
204
- const importViews = [];
205
-
206
- viewRoot.visit((view) => {
207
- if (view instanceof ImportView) {
208
- importViews.push(view);
209
- return VISIT_SKIP;
210
- }
211
- });
212
-
213
- for (const view of importViews) {
214
- const context = view.context;
215
-
216
- // TODO: Parallelize using promises, don't use await
217
- const loadedSpec = await loadExternalViewSpec(
218
- view.spec,
219
- view.getBaseUrl(),
220
- context
221
- );
222
-
223
- // TODO: Let importSpec have a name
224
- const importedView = context.createView(
225
- loadedSpec,
226
- view.layoutParent,
227
- view.dataParent,
228
- view.name
229
- );
230
- // @ts-expect-error TODO: Fix typing issue
231
- view.layoutParent.replaceChild(view, importedView);
232
-
233
- // Import recursively
234
- await processImports(importedView);
235
- }
236
- }
237
-
238
185
  /**
239
186
  * @param {function(View, View[]):void} visitor
240
187
  */
@@ -242,7 +189,7 @@ export function stackifyVisitor(visitor) {
242
189
  /** @type {View[]} */
243
190
  const stack = [];
244
191
 
245
- /** @type {import("./view").Visitor} */
192
+ /** @type {import("./view.js").Visitor} */
246
193
  const stackified = (view) => visitor(view, stack);
247
194
 
248
195
  stackified.beforeChildren = (view) => {
@@ -317,7 +264,7 @@ export function calculateCanvasSize(viewRoot) {
317
264
  // container.
318
265
  // TODO: Enforce the minimum size (in case of both absolute and growing components).
319
266
 
320
- /** @param {import("../utils/layout/flexLayout").SizeDef} dim */
267
+ /** @param {import("./layout/flexLayout.js").SizeDef} dim */
321
268
  const f = (dim) => (dim.grow > 0 ? undefined : dim.px);
322
269
  return {
323
270
  width: f(size.width),
@@ -7,12 +7,12 @@
7
7
  * @prop {number} zDelta
8
8
  */
9
9
  /**
10
- * @param {import("../utils/interactionEvent").default} event
11
- * @param {import("./renderingContext/layoutRecorderViewRenderingContext").Rectangle} coords The plot area
10
+ * @param {import("../utils/interactionEvent.js").default} event
11
+ * @param {import("./renderingContext/layoutRecorderViewRenderingContext.js").Rectangle} coords The plot area
12
12
  * @param {(zoomEvent: ZoomEvent) => void} handleZoom
13
- * @param {import("../types/viewContext").Hover} [hover]
13
+ * @param {import("../types/viewContext.js").Hover} [hover]
14
14
  */
15
- export default function interactionToZoom(event: import("../utils/interactionEvent").default, coords: import("./renderingContext/layoutRecorderViewRenderingContext").Rectangle, handleZoom: (zoomEvent: ZoomEvent) => void, hover?: import("../types/viewContext").Hover): void;
15
+ export default function interactionToZoom(event: import("../utils/interactionEvent.js").default, coords: import("./renderingContext/layoutRecorderViewRenderingContext.js").Rectangle, handleZoom: (zoomEvent: ZoomEvent) => void, hover?: import("../types/viewContext.js").Hover): void;
16
16
  export type ZoomEvent = {
17
17
  x: number;
18
18
  y: number;
@@ -1 +1 @@
1
- {"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../../src/view/zoom.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,iDALW,OAAO,2BAA2B,EAAE,OAAO,UAC3C,OAAO,uDAAuD,EAAE,SAAS,0BAC7D,SAAS,KAAK,IAAI,UAC9B,OAAO,sBAAsB,EAAE,KAAK,QA2E9C;;OAtFS,MAAM;OACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM"}
1
+ {"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../../src/view/zoom.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,iDALW,OAAO,8BAA8B,EAAE,OAAO,UAC9C,OAAO,0DAA0D,EAAE,SAAS,0BAChE,SAAS,KAAK,IAAI,UAC9B,OAAO,yBAAyB,EAAE,KAAK,QA2EjD;;OAtFS,MAAM;OACN,MAAM;YACN,MAAM;YACN,MAAM;YACN,MAAM"}
@@ -8,10 +8,10 @@
8
8
  */
9
9
 
10
10
  /**
11
- * @param {import("../utils/interactionEvent").default} event
12
- * @param {import("./renderingContext/layoutRecorderViewRenderingContext").Rectangle} coords The plot area
11
+ * @param {import("../utils/interactionEvent.js").default} event
12
+ * @param {import("./renderingContext/layoutRecorderViewRenderingContext.js").Rectangle} coords The plot area
13
13
  * @param {(zoomEvent: ZoomEvent) => void} handleZoom
14
- * @param {import("../types/viewContext").Hover} [hover]
14
+ * @param {import("../types/viewContext.js").Hover} [hover]
15
15
  */
16
16
  export default function interactionToZoom(event, coords, handleZoom, hover) {
17
17
  if (event.type == "wheel") {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "contributors": [],
9
9
  "license": "MIT",
10
- "version": "0.37.3",
10
+ "version": "0.38.0",
11
11
  "jsdelivr": "dist/bundle/index.js",
12
12
  "unpkg": "dist/bundle/index.js",
13
13
  "browser": "dist/bundle/index.js",
@@ -26,7 +26,7 @@
26
26
  "directory": "packages/core"
27
27
  },
28
28
  "scripts": {
29
- "dev": "node dev-server.js",
29
+ "dev": "node dev-server.mjs",
30
30
  "build": "rm -rf dist && mkdir -p dist && node scripts/build.mjs && vite build && npm run build:schema && npm run build:typings",
31
31
  "prepublishOnly": "npm run build",
32
32
  "test:tsc": "tsc -p tsconfig.json --noEmit",
@@ -36,9 +36,10 @@
36
36
  "postpack": "node scripts/postpack.mjs"
37
37
  },
38
38
  "dependencies": {
39
- "@gmod/bam": "^1.1.18",
39
+ "@gmod/bam": "^2.0.0",
40
40
  "@gmod/bbi": "^4.0.0",
41
41
  "@gmod/bed": "^2.1.2",
42
+ "@gmod/bgzf-filehandle": "^1.4.7",
42
43
  "@gmod/gff": "^1.3.0",
43
44
  "@gmod/indexedfasta": "^2.0.4",
44
45
  "@gmod/tabix": "^1.5.10",
@@ -56,12 +57,13 @@
56
57
  "events": "^3.3.0",
57
58
  "flatqueue": "^2.0.3",
58
59
  "internmap": "^2.0.3",
59
- "lit-html": "^2.4.0",
60
+ "lit": "^3.1.0",
61
+ "lit-html": "^3.0.2",
60
62
  "twgl.js": "^4.19.1",
61
63
  "vega-expression": "^5.0.0",
62
64
  "vega-loader": "^4.4.0",
63
65
  "vega-scale": "^7.1.1",
64
66
  "vega-util": "^1.16.0"
65
67
  },
66
- "gitHead": "cb11c23493db027579bc855ed2c019c3faa57327"
68
+ "gitHead": "cd0ae7c4bc32d3a8937b04baa14af742b0fab889"
67
69
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"flexLayout.d.ts","sourceRoot":"","sources":["../../../../src/utils/layout/flexLayout.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wCALW,OAAO,EAAE,iBACT,MAAM,mDACN,WAAW,GACT,OAAO,EAAE,CAqGrB;AAED;;;;;GAKG;AACH,sCAHW,SAAS,OAAO,CAAC,gBACjB,WAAW,UAQrB;AAED;;;GAGG;AACH,sCAHW,SAAS,OAAO,CAAC,GACf,OAAO,CAWnB;AAED;;;GAGG;AACH,oCAFW,OAAO,EAAE,WAInB;AAED;;;GAGG;AACH,sCAFW,OAAO,EAAE;;;EASnB;AAmED;;;;GAIG;AACH,uCAFW,OAAO,WAIjB;AAWD;;;;GAIG;AACH,sDAEC;AAED;;;;GAIG;AACH,mCAHW,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,iBAAiB,EAAE,IAAI,GAC7D,OAAO,CAiBnB;AAID;;;;;;;GAOG;AACH,0CALW,OAAO,MACP,OAAO,eACI,MAAM,GACf,OAAO,CA4BnB;AAED;;;;;;GAMG;AACH,0CAJW,OAAO,UACP,MAAM,UAAc,MAAM,CAAA,GACxB,OAAO,CAanB;AAED;;;;;;GAMG;AACH,sCAJW,OAAO,UACP,MAAM,UAAc,MAAM,CAAA,GACxB,OAAO,CAanB;AAED;;;GAGG;AACH,yCAHW,OAAO,SACP,MAAM,WAIhB;AAtMD;IACI;;;;OAIG;IACH,mBAHW,OAAO,UACP,OAAO,EAQjB;IAJG,gBAAgB;IAChB,wBAAkB;IAClB,gBAAgB;IAChB,yBAAoB;IAGxB;;;;OAIG;IACH,oBAFW,OAAO,WAAW,EAAE,OAAO,kBAIrC;IAED;;;;OAIG;IACH,yBAFW,OAAO,WAAW,EAAE,OAAO,kBAIrC;;CAkBJ;AAED;;;;GAIG;AACH,2BAFU,OAAO,CAKd;AAEH,iDAGE;;;;;;;;SAzOQ,MAAM;;;;WACN,MAAM;;;;;;cAGN,MAAM;UACN,MAAM;;;;;;;;;;;;;;cAGN,MAAM;;;;;uBACN,MAAM;;;;aAEN,MAAM;;;;cACN,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../src/utils/layout/grid.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IACI;;;;OAIG;IACH,uBAHW,MAAM,YACN,MAAM,EAKhB;IAFG,UAAkB;IAClB,gBAAkC;IAGtC,oBAEC;IAED,oBAEC;IAED,6BAmBC;IAED,6BAmBC;IAED;;;OAGG;IACH,kBAHW,MAAM,OACN,MAAM,UAchB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ5B;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"padding.d.ts","sourceRoot":"","sources":["../../../../src/utils/layout/padding.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;IAyGI;;;OAGG;IACH,gCAFW,aAAa,WAUvB;IAED;;OAEG;IACH,kCAFW,QAAQ,WASlB;IAED;;OAEG;IACH,uBAEC;IAED;;;OAGG;IACH,mCAFW,MAAM,WAIhB;IA/ID;;;;;OAKG;IACH,iBALW,MAAM,SACN,MAAM,UACN,MAAM,QACN,MAAM,EAOhB;IAJG,gBAAgB,CAAC,qBAAmB;IACpC,gBAAgB,CAAC,uBAAuB;IACxC,gBAAgB,CAAC,wBAAyB;IAC1C,gBAAgB,CAAC,sBAAqB;IAG1C;;OAEG;IACH,oBAEC;IAED;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,eAFW,MAAM,WAahB;IAED;;;OAGG;IACH,aAFW,OAAO,WASjB;IAED;;;OAGG;IACH,kBAFW,OAAO,WASjB;IAED;;;OAGG;IACH,eAFW,OAAO,WASjB;IAED;;OAEG;IACH,yBAEC;IAED;;OAEG;IACH,uBAEC;IAED,8BAEC;IAED,4BAEC;CA0CJ;;;;uBApJY,OAAO,iBAAiB,EAAE,QAAQ;;;;4BAClC,OAAO,iBAAiB,EAAE,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../../src/utils/layout/point.js"],"names":[],"mappings":"AAAA;IACI;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,EAKhB;IAFG,gBAAgB,CAAC,mBAAU;IAC3B,gBAAgB,CAAC,mBAAU;IAG/B;;;OAGG;IACH,cAFW,KAAK,WAQf;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rectangle.d.ts","sourceRoot":"","sources":["../../../../src/utils/layout/rectangle.js"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH;IACI;;;;;;OAMG;IACH,iBALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,aAShB;IAED,uBAA2C;IA+B3C;;;;;;OAMG;IACH,eALW,QAAQ,KACR,QAAQ,SACR,QAAQ,UACR,QAAQ,EAOlB;IAzCD;;;;OAIG;IACH,cAJW,IAAI,SACJ,MAAM,UAAc,MAAM,CAAA,GACxB,QAAQ,CAiBpB;IAED;;OAEG;IACH,mBAFW,IAAI,YAId;IAUG,gBAAgB,CAAC,sBAAW;IAC5B,gBAAgB,CAAC,sBAAW;IAC5B,gBAAgB,CAAC,0BAAmB;IACpC,gBAAgB,CAAC,2BAAqB;IAG1C;;OAEG;IACH,gBAEC;IAED;;OAEG;IACH,gBAEC;IAED;;OAEG;IACH,oBAEC;IAED;;OAEG;IACH,qBAEC;IAED,iBAEC;IAED,iBAEC;IAED;;;;OAIG;IACH,kBAFW,SAAS,WAcnB;IAED;;;OAGG;IACH,cAFW,QAAQ,OAAO,IAAI,EAAE,MAAM,UAAc,MAAM,CAAA,CAAC,CAAC,aAkB3D;IAED;;;;OAIG;IACH,aAHW,MAAM,UAAc,MAAM,CAAA,KAC1B,MAAM,UAAc,MAAM,CAAA,aAapC;IAED;;;;OAIG;IACH,uBAFW,SAAS,aAKnB;IAED;;;OAGG;IACH,gBAFW,OAAO,iCA0BjB;IAED;;;OAGG;IACH,gBAFW,OAAO,aAIjB;IAED;;;;OAIG;IACH,qBAFW,SAAS,aAenB;IAED;;OAEG;IACH,qBAEC;IAED;;;OAGG;IACH,qBAOC;IAED;;;;;OAKG;IACH,iBAHW,MAAM,KACN,MAAM,WAIhB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,KACN,MAAM;;;MAOhB;IAED,mBAEC;IAED,0BAMC;CACJ;;;;;mBA3RY,CAAC,GAAG,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,CAAC;;;;;sBAChC,OAAO,WAAW,EAAE,OAAO;;;;;uBAC3B,MAAM,MAAM"}
@@ -1,9 +0,0 @@
1
- export default class ImplicitRootView extends GridView {
2
- /**
3
- * @param {import("../types/viewContext").default} context
4
- * @param {import("./view").default} view
5
- */
6
- constructor(context: import("../types/viewContext").default, view: import("./view").default);
7
- }
8
- import GridView from "./gridView.js";
9
- //# sourceMappingURL=implicitRootView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"implicitRootView.d.ts","sourceRoot":"","sources":["../../../src/view/implicitRootView.js"],"names":[],"mappings":"AAEA;IACI;;;OAGG;IACH,qBAHW,OAAO,sBAAsB,EAAE,OAAO,QACtC,OAAO,QAAQ,EAAE,OAAO,EAgBlC;CACJ;qBAtBoB,eAAe"}
@@ -1,23 +0,0 @@
1
- import GridView from "./gridView.js";
2
-
3
- export default class ImplicitRootView extends GridView {
4
- /**
5
- * @param {import("../types/viewContext").default} context
6
- * @param {import("./view").default} view
7
- */
8
- constructor(context, view) {
9
- super(
10
- { vconcat: [] },
11
- context,
12
- undefined,
13
- undefined,
14
- "implicitRoot",
15
- 1
16
- );
17
-
18
- view.layoutParent = this;
19
- view.dataParent = this;
20
-
21
- this.appendChild(view);
22
- }
23
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * This is just a placeholder for custom tracks that are imported by name.
3
- */
4
- export default class ImportView extends View {
5
- /**
6
- *
7
- * @param {import("../spec/view").ImportSpec} spec
8
- * @param {import("../types/viewContext").default} context
9
- * @param {import("./containerView").default} layoutParent
10
- * @param {import("./view").default} dataParent
11
- * @param {string} name
12
- */
13
- constructor(spec: import("../spec/view").ImportSpec, context: import("../types/viewContext").default, layoutParent: import("./containerView").default, dataParent: import("./view").default, name: string);
14
- spec: import("../spec/view").ImportSpec;
15
- }
16
- import View from "./view.js";
17
- //# sourceMappingURL=importView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"importView.d.ts","sourceRoot":"","sources":["../../../src/view/importView.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH;IACI;;;;;;;OAOG;IACH,kBANW,OAAO,cAAc,EAAE,UAAU,WACjC,OAAO,sBAAsB,EAAE,OAAO,gBACtC,OAAO,iBAAiB,EAAE,OAAO,cACjC,OAAO,QAAQ,EAAE,OAAO,QACxB,MAAM,EAOhB;IADG,wCAAgB;CAEvB;iBArBgB,WAAW"}