@genome-spy/core 0.69.1 → 0.71.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 (285) hide show
  1. package/dist/bundle/{AbortablePromiseCache-CcuMrnn7.js → AbortablePromiseCache-Dj0vzLnp.js} +4 -4
  2. package/dist/bundle/{browser-BRemItdO.js → browser-0iNU5Wit.js} +33 -33
  3. package/dist/bundle/index-BYsZN7b0.js +1597 -0
  4. package/dist/bundle/{index-Cq3QFUxX.js → index-C3kClAEN.js} +583 -593
  5. package/dist/bundle/{index-D-w7Mmt9.js → index-C7wOh6y1.js} +138 -140
  6. package/dist/bundle/index-CRaQAuki.js +326 -0
  7. package/dist/bundle/{index-D74H8TTz.js → index-D9v1PCj9.js} +1 -2
  8. package/dist/bundle/{index-BatuyGAI.js → index-GDOuv_D5.js} +75 -80
  9. package/dist/bundle/{index-DbJ0oeYM.js → index-Gt44EOIH.js} +160 -163
  10. package/dist/bundle/index.es.js +9095 -9129
  11. package/dist/bundle/index.js +121 -163
  12. package/dist/bundle/{unzip-NywezaRR.js → unzip-Bac01w6X.js} +1 -1
  13. package/dist/schema.json +0 -48
  14. package/dist/src/genomeSpy/containerUi.d.ts.map +1 -1
  15. package/dist/src/genomeSpy/containerUi.js +0 -1
  16. package/dist/src/genomeSpy/viewHighlight.js +2 -2
  17. package/dist/src/genomeSpy.d.ts +3 -3
  18. package/dist/src/genomeSpy.d.ts.map +1 -1
  19. package/dist/src/genomeSpy.js +27 -3
  20. package/dist/src/gl/colorUtils.d.ts +2 -1
  21. package/dist/src/gl/colorUtils.d.ts.map +1 -1
  22. package/dist/src/gl/colorUtils.js +15 -3
  23. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  24. package/dist/src/gl/webGLHelper.js +2 -1
  25. package/dist/src/index.d.ts.map +1 -1
  26. package/dist/src/index.js +2 -5
  27. package/dist/src/marks/mark.d.ts +1 -3
  28. package/dist/src/marks/mark.d.ts.map +1 -1
  29. package/dist/src/marks/mark.js +0 -8
  30. package/dist/src/marks/rect.d.ts.map +1 -1
  31. package/dist/src/marks/rect.js +0 -8
  32. package/dist/src/spec/view.d.ts +0 -10
  33. package/dist/src/utils/deepEqual.d.ts +14 -0
  34. package/dist/src/utils/deepEqual.d.ts.map +1 -0
  35. package/dist/src/utils/deepEqual.js +63 -0
  36. package/dist/src/utils/fetchUtils.d.ts +27 -0
  37. package/dist/src/utils/fetchUtils.d.ts.map +1 -0
  38. package/dist/src/utils/fetchUtils.js +47 -0
  39. package/dist/src/utils/keyboardZoomMotion.d.ts +93 -0
  40. package/dist/src/utils/keyboardZoomMotion.d.ts.map +1 -0
  41. package/dist/src/utils/keyboardZoomMotion.js +285 -0
  42. package/dist/src/utils/url.d.ts +12 -0
  43. package/dist/src/utils/url.d.ts.map +1 -1
  44. package/dist/src/utils/url.js +45 -0
  45. package/dist/src/view/axisGridView.d.ts +1 -1
  46. package/dist/src/view/axisGridView.js +0 -1
  47. package/dist/src/view/axisView.d.ts +1 -1
  48. package/dist/src/view/concatView.d.ts +6 -3
  49. package/dist/src/view/concatView.d.ts.map +1 -1
  50. package/dist/src/view/concatView.js +9 -2
  51. package/dist/src/view/containerMutationHelper.d.ts +6 -6
  52. package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
  53. package/dist/src/view/containerView.d.ts +7 -5
  54. package/dist/src/view/containerView.d.ts.map +1 -1
  55. package/dist/src/view/containerView.js +4 -1
  56. package/dist/src/view/facetView.d.ts +1 -1
  57. package/dist/src/view/flowBuilder.d.ts +1 -1
  58. package/dist/src/view/flowBuilder.d.ts.map +1 -1
  59. package/dist/src/view/gridView/gridChild.d.ts +3 -3
  60. package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
  61. package/dist/src/view/gridView/gridChild.js +0 -2
  62. package/dist/src/view/gridView/gridView.d.ts +13 -11
  63. package/dist/src/view/gridView/gridView.d.ts.map +1 -1
  64. package/dist/src/view/gridView/gridView.js +17 -26
  65. package/dist/src/view/gridView/keyboardZoomController.d.ts +21 -0
  66. package/dist/src/view/gridView/keyboardZoomController.d.ts.map +1 -0
  67. package/dist/src/view/gridView/keyboardZoomController.js +202 -0
  68. package/dist/src/view/gridView/scrollbar.d.ts +1 -1
  69. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
  70. package/dist/src/view/gridView/scrollbar.js +0 -1
  71. package/dist/src/view/gridView/selectionRect.d.ts +1 -1
  72. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
  73. package/dist/src/view/gridView/selectionRect.js +0 -1
  74. package/dist/src/view/gridView/separatorView.js +0 -1
  75. package/dist/src/view/gridView/zoomNavigationUtils.d.ts +19 -0
  76. package/dist/src/view/gridView/zoomNavigationUtils.d.ts.map +1 -0
  77. package/dist/src/view/gridView/zoomNavigationUtils.js +51 -0
  78. package/dist/src/view/layerView.d.ts +8 -5
  79. package/dist/src/view/layerView.d.ts.map +1 -1
  80. package/dist/src/view/layerView.js +6 -2
  81. package/dist/src/view/title.d.ts.map +1 -1
  82. package/dist/src/view/title.js +0 -1
  83. package/dist/src/view/unitView.d.ts +7 -4
  84. package/dist/src/view/unitView.d.ts.map +1 -1
  85. package/dist/src/view/unitView.js +5 -1
  86. package/dist/src/view/view.d.ts +13 -9
  87. package/dist/src/view/view.d.ts.map +1 -1
  88. package/dist/src/view/view.js +7 -1
  89. package/dist/src/view/viewError.d.ts +1 -1
  90. package/dist/src/view/viewError.d.ts.map +1 -1
  91. package/dist/src/view/viewFactory.d.ts +3 -44
  92. package/dist/src/view/viewFactory.d.ts.map +1 -1
  93. package/dist/src/view/viewFactory.js +28 -69
  94. package/dist/src/view/viewSelectors.d.ts.map +1 -1
  95. package/dist/src/view/viewSelectors.js +123 -160
  96. package/dist/src/view/viewSpecGuards.d.ts +43 -0
  97. package/dist/src/view/viewSpecGuards.d.ts.map +1 -0
  98. package/dist/src/view/viewSpecGuards.js +69 -0
  99. package/dist/src/view/viewUtils.d.ts +1 -1
  100. package/dist/src/view/viewUtils.d.ts.map +1 -1
  101. package/dist/src/view/viewUtils.js +4 -5
  102. package/dist/src/view/zoom.d.ts +1 -0
  103. package/dist/src/view/zoom.d.ts.map +1 -1
  104. package/dist/src/view/zoom.js +5 -1
  105. package/package.json +3 -3
  106. package/dist/bundle/index-ByuE8dvu.js +0 -332
  107. package/dist/bundle/index-D28m8tSW.js +0 -1607
  108. package/dist/src/data/collector.test.d.ts +0 -2
  109. package/dist/src/data/collector.test.d.ts.map +0 -1
  110. package/dist/src/data/dataFlow.test.d.ts +0 -2
  111. package/dist/src/data/dataFlow.test.d.ts.map +0 -1
  112. package/dist/src/data/flow.test.d.ts +0 -2
  113. package/dist/src/data/flow.test.d.ts.map +0 -1
  114. package/dist/src/data/flowInit.test.d.ts +0 -2
  115. package/dist/src/data/flowInit.test.d.ts.map +0 -1
  116. package/dist/src/data/flowNode.test.d.ts +0 -2
  117. package/dist/src/data/flowNode.test.d.ts.map +0 -1
  118. package/dist/src/data/flowOptimizer.test.d.ts +0 -2
  119. package/dist/src/data/flowOptimizer.test.d.ts.map +0 -1
  120. package/dist/src/data/formats/fasta.test.d.ts +0 -2
  121. package/dist/src/data/formats/fasta.test.d.ts.map +0 -1
  122. package/dist/src/data/keyIndex.test.d.ts +0 -2
  123. package/dist/src/data/keyIndex.test.d.ts.map +0 -1
  124. package/dist/src/data/sources/inlineSource.test.d.ts +0 -2
  125. package/dist/src/data/sources/inlineSource.test.d.ts.map +0 -1
  126. package/dist/src/data/sources/sequenceSource.test.d.ts +0 -2
  127. package/dist/src/data/sources/sequenceSource.test.d.ts.map +0 -1
  128. package/dist/src/data/transforms/aggregate.test.d.ts +0 -2
  129. package/dist/src/data/transforms/aggregate.test.d.ts.map +0 -1
  130. package/dist/src/data/transforms/clone.test.d.ts +0 -2
  131. package/dist/src/data/transforms/clone.test.d.ts.map +0 -1
  132. package/dist/src/data/transforms/coverage.test.d.ts +0 -2
  133. package/dist/src/data/transforms/coverage.test.d.ts.map +0 -1
  134. package/dist/src/data/transforms/filter.test.d.ts +0 -2
  135. package/dist/src/data/transforms/filter.test.d.ts.map +0 -1
  136. package/dist/src/data/transforms/filterScoredLabels.test.d.ts +0 -2
  137. package/dist/src/data/transforms/filterScoredLabels.test.d.ts.map +0 -1
  138. package/dist/src/data/transforms/flatten.test.d.ts +0 -2
  139. package/dist/src/data/transforms/flatten.test.d.ts.map +0 -1
  140. package/dist/src/data/transforms/flattenDelimited.test.d.ts +0 -2
  141. package/dist/src/data/transforms/flattenDelimited.test.d.ts.map +0 -1
  142. package/dist/src/data/transforms/flattenSequence.test.d.ts +0 -2
  143. package/dist/src/data/transforms/flattenSequence.test.d.ts.map +0 -1
  144. package/dist/src/data/transforms/formula.test.d.ts +0 -2
  145. package/dist/src/data/transforms/formula.test.d.ts.map +0 -1
  146. package/dist/src/data/transforms/identifier.test.d.ts +0 -2
  147. package/dist/src/data/transforms/identifier.test.d.ts.map +0 -1
  148. package/dist/src/data/transforms/pileup.test.d.ts +0 -2
  149. package/dist/src/data/transforms/pileup.test.d.ts.map +0 -1
  150. package/dist/src/data/transforms/project.test.d.ts +0 -2
  151. package/dist/src/data/transforms/project.test.d.ts.map +0 -1
  152. package/dist/src/data/transforms/regexExtract.test.d.ts +0 -2
  153. package/dist/src/data/transforms/regexExtract.test.d.ts.map +0 -1
  154. package/dist/src/data/transforms/regexFold.test.d.ts +0 -2
  155. package/dist/src/data/transforms/regexFold.test.d.ts.map +0 -1
  156. package/dist/src/data/transforms/sample.test.d.ts +0 -2
  157. package/dist/src/data/transforms/sample.test.d.ts.map +0 -1
  158. package/dist/src/data/transforms/stack.test.d.ts +0 -2
  159. package/dist/src/data/transforms/stack.test.d.ts.map +0 -1
  160. package/dist/src/encoder/accessor.test.d.ts +0 -2
  161. package/dist/src/encoder/accessor.test.d.ts.map +0 -1
  162. package/dist/src/encoder/encoder.test.d.ts +0 -2
  163. package/dist/src/encoder/encoder.test.d.ts.map +0 -1
  164. package/dist/src/encoder/metadataChannels.test.d.ts +0 -2
  165. package/dist/src/encoder/metadataChannels.test.d.ts.map +0 -1
  166. package/dist/src/genome/genome.test.d.ts +0 -2
  167. package/dist/src/genome/genome.test.d.ts.map +0 -1
  168. package/dist/src/genome/genomes.test.d.ts +0 -2
  169. package/dist/src/genome/genomes.test.d.ts.map +0 -1
  170. package/dist/src/genome/scaleIndex.test.d.ts +0 -2
  171. package/dist/src/genome/scaleIndex.test.d.ts.map +0 -1
  172. package/dist/src/genome/scaleLocus.test.d.ts +0 -2
  173. package/dist/src/genome/scaleLocus.test.d.ts.map +0 -1
  174. package/dist/src/genomeSpy/viewDataInit.test.d.ts +0 -2
  175. package/dist/src/genomeSpy/viewDataInit.test.d.ts.map +0 -1
  176. package/dist/src/paramRuntime/expressionRef.test.d.ts +0 -2
  177. package/dist/src/paramRuntime/expressionRef.test.d.ts.map +0 -1
  178. package/dist/src/paramRuntime/graphRuntime.test.d.ts +0 -2
  179. package/dist/src/paramRuntime/graphRuntime.test.d.ts.map +0 -1
  180. package/dist/src/paramRuntime/paramRuntime.test.d.ts +0 -2
  181. package/dist/src/paramRuntime/paramRuntime.test.d.ts.map +0 -1
  182. package/dist/src/paramRuntime/paramStore.test.d.ts +0 -2
  183. package/dist/src/paramRuntime/paramStore.test.d.ts.map +0 -1
  184. package/dist/src/scale/scale.test.d.ts +0 -2
  185. package/dist/src/scale/scale.test.d.ts.map +0 -1
  186. package/dist/src/scale/ticks.test.d.ts +0 -2
  187. package/dist/src/scale/ticks.test.d.ts.map +0 -1
  188. package/dist/src/scales/axisResolution.test.d.ts +0 -2
  189. package/dist/src/scales/axisResolution.test.d.ts.map +0 -1
  190. package/dist/src/scales/domainPlanner.test.d.ts +0 -2
  191. package/dist/src/scales/domainPlanner.test.d.ts.map +0 -1
  192. package/dist/src/scales/scaleInstanceManager.test.d.ts +0 -2
  193. package/dist/src/scales/scaleInstanceManager.test.d.ts.map +0 -1
  194. package/dist/src/scales/scaleInteractionController.test.d.ts +0 -2
  195. package/dist/src/scales/scaleInteractionController.test.d.ts.map +0 -1
  196. package/dist/src/scales/scaleResolution.test.d.ts +0 -2
  197. package/dist/src/scales/scaleResolution.test.d.ts.map +0 -1
  198. package/dist/src/scales/scaleRules.test.d.ts +0 -2
  199. package/dist/src/scales/scaleRules.test.d.ts.map +0 -1
  200. package/dist/src/selection/selection.test.d.ts +0 -2
  201. package/dist/src/selection/selection.test.d.ts.map +0 -1
  202. package/dist/src/tooltip/dataTooltipHandler.test.d.ts +0 -2
  203. package/dist/src/tooltip/dataTooltipHandler.test.d.ts.map +0 -1
  204. package/dist/src/tooltip/flattenDatumRows.test.d.ts +0 -2
  205. package/dist/src/tooltip/flattenDatumRows.test.d.ts.map +0 -1
  206. package/dist/src/tooltip/tooltipContext.test.d.ts +0 -2
  207. package/dist/src/tooltip/tooltipContext.test.d.ts.map +0 -1
  208. package/dist/src/utils/addBaseUrl.test.d.ts +0 -2
  209. package/dist/src/utils/addBaseUrl.test.d.ts.map +0 -1
  210. package/dist/src/utils/binnedIndex.test.d.ts +0 -2
  211. package/dist/src/utils/binnedIndex.test.d.ts.map +0 -1
  212. package/dist/src/utils/cloner.test.d.ts +0 -2
  213. package/dist/src/utils/cloner.test.d.ts.map +0 -1
  214. package/dist/src/utils/coalesce.test.d.ts +0 -2
  215. package/dist/src/utils/coalesce.test.d.ts.map +0 -1
  216. package/dist/src/utils/concatIterables.test.d.ts +0 -2
  217. package/dist/src/utils/concatIterables.test.d.ts.map +0 -1
  218. package/dist/src/utils/domainArray.test.d.ts +0 -2
  219. package/dist/src/utils/domainArray.test.d.ts.map +0 -1
  220. package/dist/src/utils/indexer.test.d.ts +0 -2
  221. package/dist/src/utils/indexer.test.d.ts.map +0 -1
  222. package/dist/src/utils/interactionEvent.test.d.ts +0 -2
  223. package/dist/src/utils/interactionEvent.test.d.ts.map +0 -1
  224. package/dist/src/utils/iterateNestedMaps.test.d.ts +0 -2
  225. package/dist/src/utils/iterateNestedMaps.test.d.ts.map +0 -1
  226. package/dist/src/utils/kWayMerge.test.d.ts +0 -2
  227. package/dist/src/utils/kWayMerge.test.d.ts.map +0 -1
  228. package/dist/src/utils/mergeObjects.test.d.ts +0 -2
  229. package/dist/src/utils/mergeObjects.test.d.ts.map +0 -1
  230. package/dist/src/utils/numberExtractor.test.d.ts +0 -2
  231. package/dist/src/utils/numberExtractor.test.d.ts.map +0 -1
  232. package/dist/src/utils/propertyCacher.test.d.ts +0 -2
  233. package/dist/src/utils/propertyCacher.test.d.ts.map +0 -1
  234. package/dist/src/utils/propertyCoalescer.test.d.ts +0 -2
  235. package/dist/src/utils/propertyCoalescer.test.d.ts.map +0 -1
  236. package/dist/src/utils/radixSort.test.d.ts +0 -2
  237. package/dist/src/utils/radixSort.test.d.ts.map +0 -1
  238. package/dist/src/utils/reservationMap.test.d.ts +0 -2
  239. package/dist/src/utils/reservationMap.test.d.ts.map +0 -1
  240. package/dist/src/utils/ringBuffer.test.d.ts +0 -2
  241. package/dist/src/utils/ringBuffer.test.d.ts.map +0 -1
  242. package/dist/src/utils/throttle.test.d.ts +0 -2
  243. package/dist/src/utils/throttle.test.d.ts.map +0 -1
  244. package/dist/src/utils/topK.test.d.ts +0 -2
  245. package/dist/src/utils/topK.test.d.ts.map +0 -1
  246. package/dist/src/utils/trees.test.d.ts +0 -2
  247. package/dist/src/utils/trees.test.d.ts.map +0 -1
  248. package/dist/src/utils/ui/tooltip.test.d.ts +0 -2
  249. package/dist/src/utils/ui/tooltip.test.d.ts.map +0 -1
  250. package/dist/src/utils/url.test.d.ts +0 -2
  251. package/dist/src/utils/url.test.d.ts.map +0 -1
  252. package/dist/src/utils/variableTools.test.d.ts +0 -2
  253. package/dist/src/utils/variableTools.test.d.ts.map +0 -1
  254. package/dist/src/view/concatView.test.d.ts +0 -2
  255. package/dist/src/view/concatView.test.d.ts.map +0 -1
  256. package/dist/src/view/dataReadiness.test.d.ts +0 -2
  257. package/dist/src/view/dataReadiness.test.d.ts.map +0 -1
  258. package/dist/src/view/flowBuilder.test.d.ts +0 -2
  259. package/dist/src/view/flowBuilder.test.d.ts.map +0 -1
  260. package/dist/src/view/gridView/gridView.test.d.ts +0 -2
  261. package/dist/src/view/gridView/gridView.test.d.ts.map +0 -1
  262. package/dist/src/view/gridView/selectionRect.test.d.ts +0 -2
  263. package/dist/src/view/gridView/selectionRect.test.d.ts.map +0 -1
  264. package/dist/src/view/layerView.test.d.ts +0 -2
  265. package/dist/src/view/layerView.test.d.ts.map +0 -1
  266. package/dist/src/view/layout/flexLayout.test.d.ts +0 -2
  267. package/dist/src/view/layout/flexLayout.test.d.ts.map +0 -1
  268. package/dist/src/view/layout/grid.test.d.ts +0 -2
  269. package/dist/src/view/layout/grid.test.d.ts.map +0 -1
  270. package/dist/src/view/layout/rectangle.test.d.ts +0 -2
  271. package/dist/src/view/layout/rectangle.test.d.ts.map +0 -1
  272. package/dist/src/view/multiscale.test.d.ts +0 -2
  273. package/dist/src/view/multiscale.test.d.ts.map +0 -1
  274. package/dist/src/view/view.test.d.ts +0 -2
  275. package/dist/src/view/view.test.d.ts.map +0 -1
  276. package/dist/src/view/viewDispose.test.d.ts +0 -2
  277. package/dist/src/view/viewDispose.test.d.ts.map +0 -1
  278. package/dist/src/view/viewFactory.test.d.ts +0 -2
  279. package/dist/src/view/viewFactory.test.d.ts.map +0 -1
  280. package/dist/src/view/viewParamRuntime.test.d.ts +0 -2
  281. package/dist/src/view/viewParamRuntime.test.d.ts.map +0 -1
  282. package/dist/src/view/viewSelectors.test.d.ts +0 -2
  283. package/dist/src/view/viewSelectors.test.d.ts.map +0 -1
  284. package/dist/src/view/viewUtils.test.d.ts +0 -2
  285. package/dist/src/view/viewUtils.test.d.ts.map +0 -1
@@ -163,7 +163,7 @@ class qI extends Map {
163
163
  toString() {
164
164
  return `QuickLRU(${this.size}/${this.maxSize})`;
165
165
  }
166
- [Symbol.for("nodejs.util.inspect.custom")]() {
166
+ [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
167
167
  return this.toString();
168
168
  }
169
169
  }
package/dist/schema.json CHANGED
@@ -997,10 +997,6 @@
997
997
  },
998
998
  "type": "array"
999
999
  },
1000
- "configurableVisibility": {
1001
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
1002
- "type": "boolean"
1003
- },
1004
1000
  "data": {
1005
1001
  "$ref": "#/definitions/Data",
1006
1002
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -1571,10 +1567,6 @@
1571
1567
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
1572
1568
  "type": "string"
1573
1569
  },
1574
- "configurableVisibility": {
1575
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
1576
- "type": "boolean"
1577
- },
1578
1570
  "data": {
1579
1571
  "$ref": "#/definitions/Data",
1580
1572
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -1927,10 +1919,6 @@
1927
1919
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
1928
1920
  "type": "string"
1929
1921
  },
1930
- "configurableVisibility": {
1931
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
1932
- "type": "boolean"
1933
- },
1934
1922
  "data": {
1935
1923
  "$ref": "#/definitions/Data",
1936
1924
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -2290,10 +2278,6 @@
2290
2278
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
2291
2279
  "type": "string"
2292
2280
  },
2293
- "configurableVisibility": {
2294
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
2295
- "type": "boolean"
2296
- },
2297
2281
  "data": {
2298
2282
  "$ref": "#/definitions/Data",
2299
2283
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -2658,10 +2642,6 @@
2658
2642
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
2659
2643
  "type": "string"
2660
2644
  },
2661
- "configurableVisibility": {
2662
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
2663
- "type": "boolean"
2664
- },
2665
2645
  "data": {
2666
2646
  "$ref": "#/definitions/Data",
2667
2647
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -3023,10 +3003,6 @@
3023
3003
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
3024
3004
  "type": "string"
3025
3005
  },
3026
- "configurableVisibility": {
3027
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
3028
- "type": "boolean"
3029
- },
3030
3006
  "data": {
3031
3007
  "$ref": "#/definitions/Data",
3032
3008
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -3405,10 +3381,6 @@
3405
3381
  },
3406
3382
  "type": "array"
3407
3383
  },
3408
- "configurableVisibility": {
3409
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
3410
- "type": "boolean"
3411
- },
3412
3384
  "data": {
3413
3385
  "$ref": "#/definitions/Data",
3414
3386
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -5455,10 +5427,6 @@
5455
5427
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
5456
5428
  "type": "string"
5457
5429
  },
5458
- "configurableVisibility": {
5459
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
5460
- "type": "boolean"
5461
- },
5462
5430
  "data": {
5463
5431
  "$ref": "#/definitions/Data",
5464
5432
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -6097,10 +6065,6 @@
6097
6065
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
6098
6066
  "type": "string"
6099
6067
  },
6100
- "configurableVisibility": {
6101
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
6102
- "type": "boolean"
6103
- },
6104
6068
  "data": {
6105
6069
  "$ref": "#/definitions/Data",
6106
6070
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -6923,10 +6887,6 @@
6923
6887
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
6924
6888
  "type": "string"
6925
6889
  },
6926
- "configurableVisibility": {
6927
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
6928
- "type": "boolean"
6929
- },
6930
6890
  "data": {
6931
6891
  "$ref": "#/definitions/Data",
6932
6892
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -10140,10 +10100,6 @@
10140
10100
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
10141
10101
  "type": "string"
10142
10102
  },
10143
- "configurableVisibility": {
10144
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
10145
- "type": "boolean"
10146
- },
10147
10103
  "data": {
10148
10104
  "$ref": "#/definitions/Data",
10149
10105
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -10568,10 +10524,6 @@
10568
10524
  "description": "The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",
10569
10525
  "type": "string"
10570
10526
  },
10571
- "configurableVisibility": {
10572
- "description": "Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is unique within its import scope.\n\n**Default:** `false` for children of `layer`, `true` for others.",
10573
- "type": "boolean"
10574
- },
10575
10527
  "data": {
10576
10528
  "$ref": "#/definitions/Data",
10577
10529
  "description": "Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."
@@ -1 +1 @@
1
- {"version":3,"file":"containerUi.d.ts","sourceRoot":"","sources":["../../../src/genomeSpy/containerUi.js"],"names":[],"mappings":"AAGA;;GAEG;AACH,6CAFW,WAAW;;;;;EA6BrB;AAED;;;GAGG;AACH,4CAHW,WAAW,WACX,MAAM,QAUhB;oBA9CmB,wBAAwB"}
1
+ {"version":3,"file":"containerUi.d.ts","sourceRoot":"","sources":["../../../src/genomeSpy/containerUi.js"],"names":[],"mappings":"AAGA;;GAEG;AACH,6CAFW,WAAW;;;;;EA4BrB;AAED;;;GAGG;AACH,4CAHW,WAAW,WACX,MAAM,QAUhB;oBA7CmB,wBAAwB"}
@@ -21,7 +21,6 @@ export function createContainerUi(container) {
21
21
  const loadingIndicatorsElement = element("div", {
22
22
  class: "loading-indicators",
23
23
  });
24
- canvasWrapper.appendChild(loadingIndicatorsElement);
25
24
 
26
25
  const tooltip = new Tooltip(container);
27
26
 
@@ -8,7 +8,7 @@ export function createViewHighlighter(container) {
8
8
  return (view) => {
9
9
  container.querySelector(".view-highlight")?.remove();
10
10
  if (view) {
11
- if (!view.isConfiguredVisible()) {
11
+ if (!view.isVisible()) {
12
12
  return;
13
13
  }
14
14
  const coords = view.coords;
@@ -21,7 +21,7 @@ export function createViewHighlighter(container) {
21
21
  div.style.width = coords.width + "px";
22
22
  div.style.height = coords.height + "px";
23
23
  div.style.border = "1px solid green";
24
- div.style.backgroundColor = "rgba(0, 255, 0, 0.1)";
24
+ div.style.backgroundColor = "rgba(0, 255, 0, 0.05)";
25
25
  div.style.pointerEvents = "none";
26
26
  container.appendChild(div);
27
27
  }
@@ -28,11 +28,11 @@ export default class GenomeSpy {
28
28
  *
29
29
  * @type {(view: View) => boolean}
30
30
  */
31
- viewVisibilityPredicate: (view: import("./view/view.js").default) => boolean;
31
+ viewVisibilityPredicate: (view: import("./view/view.js").default<import("./spec/view.js").ViewSpec>) => boolean;
32
32
  /** @type {Record<string, import("./tooltip/tooltipHandler.js").TooltipHandler>}> */
33
33
  tooltipHandlers: Record<string, import("./tooltip/tooltipHandler.js").TooltipHandler>;
34
34
  /** @type {View} */
35
- viewRoot: import("./view/view.js").default;
35
+ viewRoot: import("./view/view.js").default<import("./spec/view.js").ViewSpec>;
36
36
  dpr: number;
37
37
  /**
38
38
  *
@@ -104,7 +104,7 @@ export default class GenomeSpy {
104
104
  computeLayout(): void;
105
105
  renderAll(): void;
106
106
  renderPickingFramebuffer(): void;
107
- getSearchableViews(): UnitView[];
107
+ getSearchableViews(): UnitView<import("./spec/view.js").UnitSpec>[];
108
108
  getNamedScaleResolutions(): Map<string, import("./scales/scaleResolution.js").default>;
109
109
  #private;
110
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"genomeSpy.d.ts","sourceRoot":"","sources":["../../src/genomeSpy.js"],"names":[],"mappings":"AA+CA;IAoBI;;;;;OAKG;IAEH;;;;;OAKG;IACH,uBAJW,WAAW,qDAEX,OAAO,qBAAqB,EAAE,YAAY,EA0CpD;IAvCG,uBAA0B;IAC1B,oDAAsB;IAItB,sCAAsC;IACtC,wCAAgB;IAEhB,yBAAoC;IAEpC,4CAA4C;IAC5C,oBADW,CAAC,CAAS,IAAM,EAAN,MAAM,KAAE,MAAM,EAAE,CAAC,EAAE,CACZ;IAE5B,mBAAoD;IAEpD,0BAA0B;IAC1B,aADW,WAAW,CACM;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ACN,MAAM,qBACN,MAAM,eACN,MAAM,UAuBhB;IAED;;;MAEC;IAED,sBAEC;IAED,kBAEC;IAED,iCAEC;IAED,oEAYC;IAED,uFAWC;;CACJ;;;;iCA/jBY,eAAe,GAAG,QAAQ,GAAG,gBAAgB,GAAG,kBAAkB;4BAbnC,uBAAuB;qBAR9C,qBAAqB;wBAElB,yBAAyB;qBAL5B,oBAAoB"}
@@ -253,6 +253,8 @@ export default class GenomeSpy {
253
253
  { powerPreference: this.options.powerPreference ?? "default" }
254
254
  );
255
255
 
256
+ canvasWrapper.appendChild(loadingIndicatorsElement);
257
+
256
258
  this.tooltip = tooltip;
257
259
  this.#loadingStatusRegistry = new LoadingStatusRegistry();
258
260
  this.#loadingIndicatorManager = new LoadingIndicatorManager(
@@ -322,9 +324,11 @@ export default class GenomeSpy {
322
324
  getCurrentHover: () =>
323
325
  this.#interactionController.getCurrentHover(),
324
326
  addKeyboardListener: (type, listener) => {
325
- // TODO: Listeners should be called only when the mouse pointer is inside the
326
- // container or the app covers the full document.
327
- this.#keyboardListenerManager.add(type, listener);
327
+ this.#keyboardListenerManager.add(type, (event) => {
328
+ if (this.#shouldDispatchKeyboardEvent(type, event)) {
329
+ listener(event);
330
+ }
331
+ });
328
332
  },
329
333
  addBroadcastListener: (type, listener) =>
330
334
  this.#extraBroadcastListeners.add(type, listener),
@@ -352,6 +356,26 @@ export default class GenomeSpy {
352
356
  });
353
357
  }
354
358
 
359
+ /**
360
+ * Scopes keydown events to the active embed (focused container or hovered container).
361
+ * Keyup is always dispatched so key-state machines can reliably release keys.
362
+ *
363
+ * @param {"keydown" | "keyup"} type
364
+ * @param {KeyboardEvent} event
365
+ */
366
+ #shouldDispatchKeyboardEvent(type, event) {
367
+ if (type === "keyup") {
368
+ return true;
369
+ }
370
+
371
+ const activeElement = document.activeElement;
372
+ if (activeElement && activeElement !== document.body) {
373
+ return this.container.contains(activeElement);
374
+ } else {
375
+ return this.container.matches(":hover");
376
+ }
377
+ }
378
+
355
379
  /**
356
380
  * @param {import("./types/viewContext.js").default} context
357
381
  */
@@ -3,8 +3,9 @@
3
3
  * @param {WebGL2RenderingContext} gl
4
4
  * @param {number} [count]
5
5
  * @param {WebGLTexture} [existingTexture]
6
+ * @param {boolean} [reverse]
6
7
  */
7
- export function createSchemeTexture(schemeParams: string | import("../spec/scale.js").SchemeParams, gl: WebGL2RenderingContext, count?: number, existingTexture?: WebGLTexture): WebGLTexture;
8
+ export function createSchemeTexture(schemeParams: string | import("../spec/scale.js").SchemeParams, gl: WebGL2RenderingContext, count?: number, existingTexture?: WebGLTexture, reverse?: boolean): WebGLTexture;
8
9
  /**
9
10
  * @param {string[]} colors
10
11
  * @param {import("../spec/scale.js").ScaleInterpolate | import("../spec/scale.js").ScaleInterpolateParams} interpolateParams
@@ -1 +1 @@
1
- {"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../../../src/gl/colorUtils.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,kDALW,MAAM,GAAG,OAAO,kBAAkB,EAAE,YAAY,MAChD,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBAqCtB;AAED;;;;;GAKG;AACH,uDALW,MAAM,EAAE,qBACR,OAAO,kBAAkB,EAAE,gBAAgB,GAAG,OAAO,kBAAkB,EAAE,sBAAsB,MAC/F,sBAAsB,oBACtB,YAAY,gBA6BtB;AAED;;;;;;;;GAQG;AACH,6CALW,MAAM,EAAE,MACR,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBAqBtB;AAED;;;;;;;GAOG;AACH,mDALW,MAAM,EAAE,MACR,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBActB;AAyDD;;GAEG;AACH,uCAFW,MAAM,YAKhB"}
1
+ {"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../../../src/gl/colorUtils.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,kDANW,MAAM,GAAG,OAAO,kBAAkB,EAAE,YAAY,MAChD,sBAAsB,UACtB,MAAM,oBACN,YAAY,YACZ,OAAO,gBAgDjB;AAED;;;;;GAKG;AACH,uDALW,MAAM,EAAE,qBACR,OAAO,kBAAkB,EAAE,gBAAgB,GAAG,OAAO,kBAAkB,EAAE,sBAAsB,MAC/F,sBAAsB,oBACtB,YAAY,gBA6BtB;AAED;;;;;;;;GAQG;AACH,6CALW,MAAM,EAAE,MACR,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBAqBtB;AAED;;;;;;;GAOG;AACH,mDALW,MAAM,EAAE,MACR,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBActB;AAyDD;;GAEG;AACH,uCAFW,MAAM,YAKhB"}
@@ -10,8 +10,15 @@ import { createOrUpdateTexture } from "./webGLHelper.js";
10
10
  * @param {WebGL2RenderingContext} gl
11
11
  * @param {number} [count]
12
12
  * @param {WebGLTexture} [existingTexture]
13
+ * @param {boolean} [reverse]
13
14
  */
14
- export function createSchemeTexture(schemeParams, gl, count, existingTexture) {
15
+ export function createSchemeTexture(
16
+ schemeParams,
17
+ gl,
18
+ count,
19
+ existingTexture,
20
+ reverse = false
21
+ ) {
15
22
  const schemeName = isString(schemeParams)
16
23
  ? schemeParams
17
24
  : schemeParams.name;
@@ -24,10 +31,10 @@ export function createSchemeTexture(schemeParams, gl, count, existingTexture) {
24
31
  if (schemeName) {
25
32
  const scheme = vegaScheme(schemeName);
26
33
  if (isFunction(scheme)) {
27
- // TODO: Reverse
28
34
  const textureData = interpolatorToTextureData(scheme, {
29
35
  extent,
30
36
  count,
37
+ reverse,
31
38
  });
32
39
  return createOrUpdateTexture(
33
40
  gl,
@@ -41,7 +48,12 @@ export function createSchemeTexture(schemeParams, gl, count, existingTexture) {
41
48
  existingTexture
42
49
  );
43
50
  } else if (isArray(scheme)) {
44
- return createDiscreteColorTexture(scheme, gl);
51
+ return createDiscreteColorTexture(
52
+ reverse ? Array.from(scheme).reverse() : scheme,
53
+ gl,
54
+ count,
55
+ existingTexture
56
+ );
45
57
  } else {
46
58
  throw new Error("Unknown scheme: " + schemeName);
47
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"webGLHelper.d.ts","sourceRoot":"","sources":["../../../src/gl/webGLHelper.js"],"names":[],"mappings":"AAwZA;;;;GAIG;AACH,kCAJW,sBAAsB,gBACtB,WAAW,kBACX,WAAW;;;;;;EA8CrB;AAED;;;;;GAKG;AACH,0CALW,qBAAqB,WACrB,IAAI,CAAC,OAAO,SAAS,EAAE,cAAc,EAAE,KAAK,CAAC,OAC7C,MAAM,EAAE,GAAG,eAAe,YAC1B,YAAY,gBAYtB;AAED;;;;;;GAMG;AACH,qCALW,sBAAsB,mBACtB,OAAO,SAAS,EAAE,eAAe,KACjC,MAAM,KACN,MAAM,2BAWhB;AAED;;;;;GAKG;AACH,yCAJW,sBAAsB,mBACtB,OAAO,SAAS,EAAE,eAAe,SACjC,MAAM,UA4BhB;AAjfD;IACI;;;;;;;OAOG;IACH,uBANW,WAAW,eACX,MAAM;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,2BAGrC,sBAAsB,EAsFhC;IAnFG,wBAA2B;IAC3B;;;MAKO;IAEP,uCAAuC;IACvC,cADW,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CACN;IAE7B,6EAA6E;IAC7E,eADW,OAAO,CAAC,OAAO,qBAAqB,EAAE,SAAS,EAAE,YAAY,CAAC,CACvC;IAElC;;OAEG;IACH,mBAFU,OAAO,CAAC,OAAO,4BAA4B,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAEnD;IA8CtC,0BAAoB;IACpB,2BAAY;IAGZ,oDAAoD;IACpD,2BADW,OAAO,SAAS,EAAE,iBAAiB,EAAE,CAQ/C;IACD,sDAGC;IAML,uBAGC;IAFG;;;MAAmC;IAIvC;;;;;OAKG;IACH,oBAHW,MAAM,QACN,MAAM,GAAG,MAAM,EAAE,eA2B3B;IAED,iBAcC;IAED,iBAEC;IAED;;;;OAIG;IACH,oCAFW;QAAE,KAAK,EAAE,MA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B,EAAE,CAQ/C;IACD,sDAGC;IAML,uBAGC;IAFG;;;MAAmC;IAIvC;;;;;OAKG;IACH,oBAHW,MAAM,QACN,MAAM,GAAG,MAAM,EAAE,eA2B3B;IAED,iBAcC;IAED,iBAEC;IAED;;;;OAIG;IACH,oCAFW;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;;;MAS3C;IAED;;;OAGG;IACH;;;MAuBC;IAED;;;;;;;;;OASG;IACH,+BAHW,OAAO,8BAA8B,EAAE,OAAO,WAC9C,OAAO,QA2GjB;IAED;;OAEG;IACH,kCAFW,OAAO,4BAA4B,EAAE,mBAAmB,0BA+BlE;CACJ"}
@@ -291,7 +291,8 @@ export default class WebGLHelper {
291
291
  props.scheme,
292
292
  this.gl,
293
293
  count,
294
- existingTexture
294
+ existingTexture,
295
+ !!props.reverse
295
296
  );
296
297
  }
297
298
  } else if (
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";AA+FA;;;;;GAKG;AACH,8BAFW,MAAM,gBAuBhB;sBAvHqB,gBAAgB;qBAFjB,KAAK;iBAGT,kBAAkB;oBACf,6BAA6B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";AAgGA;;;;;GAKG;AACH,8BAFW,MAAM,gBAmBhB;sBApHqB,gBAAgB;qBAFjB,KAAK;iBAGT,kBAAkB;oBACf,6BAA6B"}
package/dist/src/index.js CHANGED
@@ -4,6 +4,7 @@ import { html } from "lit";
4
4
  import GenomeSpy from "./genomeSpy.js";
5
5
  import icon from "./img/bowtie.svg";
6
6
  import favIcon from "./img/genomespy-favicon.svg";
7
+ import { fetchJson } from "./utils/fetchUtils.js";
7
8
 
8
9
  export { GenomeSpy, html, icon, favIcon };
9
10
 
@@ -103,11 +104,7 @@ export async function loadSpec(url) {
103
104
  let spec;
104
105
 
105
106
  try {
106
- const response = await fetch(url);
107
- if (!response.ok) {
108
- throw new Error(`${response.status} ${response.statusText}`);
109
- }
110
- spec = await response.json();
107
+ spec = /** @type {any} */ (await fetchJson(url));
111
108
  } catch (e) {
112
109
  throw new Error(
113
110
  `Could not load or parse configuration: ${url}, reason: ${e.message}`
@@ -23,7 +23,7 @@ export default class Mark<P extends import("../spec/mark.js").MarkProps = import
23
23
  * @param {import("../view/unitView.js").default} unitView
24
24
  */
25
25
  constructor(unitView: import("../view/unitView.js").default);
26
- unitView: import("../view/unitView.js").default;
26
+ unitView: import("../view/unitView.js").default<import("../spec/view.js").UnitSpec>;
27
27
  /** @type {Partial<Record<Channel, import("../types/encoder.js").Encoder>>} */
28
28
  encoders: Partial<Record<import("../spec/channel.js").Channel, import("../types/encoder.js").Encoder>>;
29
29
  /**
@@ -210,8 +210,6 @@ export default class Mark<P extends import("../spec/mark.js").MarkProps = import
210
210
  get glHelper(): import("../gl/webGLHelper.js").default;
211
211
  /** Convenience method */
212
212
  get gl(): WebGL2RenderingContext;
213
- onBeforeSampleAnimation(): void;
214
- onAfterSampleAnimation(): void;
215
213
  isReady(): import("twgl.js").ProgramInfo;
216
214
  /**
217
215
  * Returns true if this mark instance participates in picking.
@@ -1 +1 @@
1
- {"version":3,"file":"mark.d.ts","sourceRoot":"","sources":["../../../src/marks/mark.js"],"names":[],"mappings":"AA6DA,mCAAoC,sBAAsB,CAAC;AAC3D,mCAAoC,sBAAsB,CAAC;AAE3D,uCAAwC,oBAAoB,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH,0BAF0B,CAAC,SAAd,mCAAW;IAkBpB;;OAEG;IACH,sBAFW,OAAO,qBAAqB,EAAE,OAAO,EA4G/C;IAzGG,gDAAwB;IAExB,8EAA8E;IAC9E,UADW,OAAO,CAAC,MAAM,uCAAU,OAAO,qBAAqB,EAAE,OAAO,CAAC,CAAC,CACjD;IAIzB;;;OAGG;IACH,sBAHU,OAAO,SAAS,EAAE,UAAU,GAAG;QAAE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OAC/B,MAAM,UACN,OAAO,6BAA6B,EAAE,OAAO,aAC7C,OAAO,6BAA6B,EAAE,OAAO,GAC3C,OAAO,CA+GnB;IAED;;;;;;;;;OASG;IACH,qBAJW,MAAM,KACN,OAAO,oBAAoB,EAAE,MAAM,GACjC,GAAG,CAIf;;CACJ;+BAx7CY,OAAO,uBAAuB,EAAE,gBAAgB;;;;;;wBAEnD,OAAO;;mCAEJ,gBAAgB,GAAG,qBAAqB;oCAG1C,MAAM,SACN,MAAM;0BAEJ,YAAY,GAAG,UAAU,GAAG,WAAW;AAg7CpD;;;GAGG;AACH,uBAFa,CAAC;IAGV,cAEC;IAkBD;;;OAGG;IACH,2BAFW,GAAG,CAAC,CAAC,EAAE,OAAO,yBAAyB,EAAE,UAAU,CAAC,QAiB9D;CACJ;0BA3/CyB,WAAW"}
@@ -1151,14 +1151,6 @@ export default class Mark {
1151
1151
  return this.glHelper.gl;
1152
1152
  }
1153
1153
 
1154
- onBeforeSampleAnimation() {
1155
- // override
1156
- }
1157
-
1158
- onAfterSampleAnimation() {
1159
- // override
1160
- }
1161
-
1162
1154
  isReady() {
1163
1155
  return this.bufferInfo && this.programInfo;
1164
1156
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/marks/rect.js"],"names":[],"mappings":"AA2BA;;GAEG;AACH;IACI;;OAEG;IACH,sBAFW,OAAO,qBAAqB,EAAE,OAAO,EAkB/C;IAkOD;;;;;;;;;;OAUG;IACH,8BALW,GAAG,KACH,OAAO,oBAAoB,EAAE,MAAM,GACjC,GAAG,CAyBf;;CACJ;iBAhTgB,WAAW"}
1
+ {"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../../src/marks/rect.js"],"names":[],"mappings":"AA2BA;;GAEG;AACH;IACI;;OAEG;IACH,sBAFW,OAAO,qBAAqB,EAAE,OAAO,EAkB/C;IA0ND;;;;;;;;;;OAUG;IACH,8BALW,GAAG,KACH,OAAO,oBAAoB,EAAE,MAAM,GACjC,GAAG,CAyBf;;CACJ;iBAxSgB,WAAW"}
@@ -120,14 +120,6 @@ export default class RectMark extends Mark {
120
120
  return encoding;
121
121
  }
122
122
 
123
- onBeforeSampleAnimation() {
124
- // TODO: Tessellate rects inside the viewport
125
- }
126
-
127
- onAfterSampleAnimation() {
128
- // TODO: Pop the previous buffers
129
- }
130
-
131
123
  #isRoundedCorners() {
132
124
  const p = this.properties;
133
125
  return (
@@ -233,16 +233,6 @@ export interface ViewSpecBase extends ResolveSpec {
233
233
  */
234
234
  visible?: boolean;
235
235
 
236
- /**
237
- * Is the visibility configurable interactively from the [GenomeSpy
238
- * App](https://genomespy.app/docs/sample-collections/).
239
- * Configurability requires that the view has an explicitly specified name
240
- * that is unique within its import scope.
241
- *
242
- * **Default:** `false` for children of `layer`, `true` for others.
243
- */
244
- configurableVisibility?: boolean;
245
-
246
236
  /**
247
237
  * [Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates)
248
238
  * that can be reused within the view specification by importing them with the template key.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Deep equality for JSON-like values (primitives, arrays, plain objects).
3
+ *
4
+ * Notes:
5
+ * - Non-plain objects (Date, Map, Set, class instances, etc.) are compared by
6
+ * reference (`Object.is`), not by value.
7
+ * - Circular references are not supported.
8
+ *
9
+ * @param {unknown} a
10
+ * @param {unknown} b
11
+ * @returns {boolean}
12
+ */
13
+ export default function deepEqual(a: unknown, b: unknown): boolean;
14
+ //# sourceMappingURL=deepEqual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepEqual.d.ts","sourceRoot":"","sources":["../../../src/utils/deepEqual.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,qCAJW,OAAO,KACP,OAAO,GACL,OAAO,CAuCnB"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Deep equality for JSON-like values (primitives, arrays, plain objects).
3
+ *
4
+ * Notes:
5
+ * - Non-plain objects (Date, Map, Set, class instances, etc.) are compared by
6
+ * reference (`Object.is`), not by value.
7
+ * - Circular references are not supported.
8
+ *
9
+ * @param {unknown} a
10
+ * @param {unknown} b
11
+ * @returns {boolean}
12
+ */
13
+ export default function deepEqual(a, b) {
14
+ if (Object.is(a, b)) {
15
+ return true;
16
+ }
17
+
18
+ if (Array.isArray(a) || Array.isArray(b)) {
19
+ if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {
20
+ return false;
21
+ }
22
+ for (let i = 0; i < a.length; i++) {
23
+ if (!deepEqual(a[i], b[i])) {
24
+ return false;
25
+ }
26
+ }
27
+ return true;
28
+ }
29
+
30
+ if (!isPlainObject(a) || !isPlainObject(b)) {
31
+ return false;
32
+ }
33
+
34
+ const keysA = Object.keys(a);
35
+ const keysB = Object.keys(b);
36
+ if (keysA.length !== keysB.length) {
37
+ return false;
38
+ }
39
+
40
+ for (const key of keysA) {
41
+ if (
42
+ !Object.prototype.hasOwnProperty.call(b, key) ||
43
+ !deepEqual(a[key], b[key])
44
+ ) {
45
+ return false;
46
+ }
47
+ }
48
+
49
+ return true;
50
+ }
51
+
52
+ /**
53
+ * @param {unknown} value
54
+ * @returns {value is Record<string, any>}
55
+ */
56
+ function isPlainObject(value) {
57
+ if (value == null || typeof value !== "object" || Array.isArray(value)) {
58
+ return false;
59
+ }
60
+
61
+ const proto = Object.getPrototypeOf(value);
62
+ return proto === Object.prototype || proto === null;
63
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Fetches JSON from a URL and throws explicit errors for HTTP status and
3
+ * JSON parsing failures.
4
+ *
5
+ * @param {string} url
6
+ * @param {{ signal?: AbortSignal }} [options]
7
+ * @returns {Promise<unknown>}
8
+ */
9
+ export function fetchJson(url: string, options?: {
10
+ signal?: AbortSignal;
11
+ }): Promise<unknown>;
12
+ /**
13
+ * @typedef {"network" | "http" | "json"} FetchJsonErrorKind
14
+ */
15
+ /**
16
+ * @extends {Error}
17
+ */
18
+ export class FetchJsonError extends Error {
19
+ /**
20
+ * @param {FetchJsonErrorKind} kind
21
+ * @param {string} message
22
+ */
23
+ constructor(kind: FetchJsonErrorKind, message: string);
24
+ kind: FetchJsonErrorKind;
25
+ }
26
+ export type FetchJsonErrorKind = "network" | "http" | "json";
27
+ //# sourceMappingURL=fetchUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/fetchUtils.js"],"names":[],"mappings":"AAkBA;;;;;;;GAOG;AACH,+BAJW,MAAM,YACN;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GACtB,OAAO,CAAC,OAAO,CAAC,CAsB5B;AA9CD;;GAEG;AAEH;;GAEG;AACH;IACI;;;OAGG;IACH,kBAHW,kBAAkB,WAClB,MAAM,EAKhB;IADG,yBAAgB;CAEvB;iCAfY,SAAS,GAAG,MAAM,GAAG,MAAM"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @typedef {"network" | "http" | "json"} FetchJsonErrorKind
3
+ */
4
+
5
+ /**
6
+ * @extends {Error}
7
+ */
8
+ export class FetchJsonError extends Error {
9
+ /**
10
+ * @param {FetchJsonErrorKind} kind
11
+ * @param {string} message
12
+ */
13
+ constructor(kind, message) {
14
+ super(message);
15
+ this.kind = kind;
16
+ }
17
+ }
18
+
19
+ /**
20
+ * Fetches JSON from a URL and throws explicit errors for HTTP status and
21
+ * JSON parsing failures.
22
+ *
23
+ * @param {string} url
24
+ * @param {{ signal?: AbortSignal }} [options]
25
+ * @returns {Promise<unknown>}
26
+ */
27
+ export async function fetchJson(url, options = {}) {
28
+ let response;
29
+ try {
30
+ response = await fetch(url, { signal: options.signal });
31
+ } catch (error) {
32
+ throw new FetchJsonError("network", String(error));
33
+ }
34
+
35
+ if (!response.ok) {
36
+ throw new FetchJsonError(
37
+ "http",
38
+ String(response.status) + " " + response.statusText
39
+ );
40
+ }
41
+
42
+ try {
43
+ return await response.json();
44
+ } catch (error) {
45
+ throw new FetchJsonError("json", String(error));
46
+ }
47
+ }