@genome-spy/core 0.78.0 → 0.79.1

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 (292) hide show
  1. package/dist/bundle/{browser-KWU9rWZT.js → browser-CETrb2cm.js} +53 -33
  2. package/dist/bundle/esm-BdLYkz-m.js +248 -0
  3. package/dist/bundle/esm-BwiDsqSb.js +1367 -0
  4. package/dist/bundle/esm-CDFd1cjk.js +441 -0
  5. package/dist/bundle/{esm-DVOHLB1e.js → esm-CTUHLDbv.js} +30 -30
  6. package/dist/bundle/{esm-NIYEaYkc.js → esm-Cx-EbkOj.js} +13 -13
  7. package/dist/bundle/esm-DlYGqi79.js +128 -0
  8. package/dist/bundle/{esm-BygJiwh0.js → esm-k9p3oHkt.js} +133 -158
  9. package/dist/bundle/{esm-CT3ygiMq.js → esm-zAZJQO6D.js} +226 -212
  10. package/dist/bundle/index.es.js +14879 -11656
  11. package/dist/bundle/index.js +119 -108
  12. package/dist/bundle/{parquetRead-DG_-F5j5.js → parquetRead-Cad1SOVV.js} +473 -399
  13. package/dist/schema.json +18940 -6914
  14. package/dist/src/config/axisConfig.d.ts +2 -2
  15. package/dist/src/config/axisConfig.d.ts.map +1 -1
  16. package/dist/src/config/axisConfig.js +28 -44
  17. package/dist/src/config/configLayers.d.ts +45 -0
  18. package/dist/src/config/configLayers.d.ts.map +1 -0
  19. package/dist/src/config/configLayers.js +110 -0
  20. package/dist/src/config/defaultConfig.d.ts.map +1 -1
  21. package/dist/src/config/defaultConfig.js +8 -1
  22. package/dist/src/config/defaults/legendDefaults.d.ts +14 -0
  23. package/dist/src/config/defaults/legendDefaults.d.ts.map +1 -0
  24. package/dist/src/config/defaults/legendDefaults.js +46 -0
  25. package/dist/src/config/defaults/titleDefaults.d.ts.map +1 -1
  26. package/dist/src/config/defaults/titleDefaults.js +26 -18
  27. package/dist/src/config/legendConfig.d.ts +11 -0
  28. package/dist/src/config/legendConfig.d.ts.map +1 -0
  29. package/dist/src/config/legendConfig.js +63 -0
  30. package/dist/src/config/styleUtils.d.ts +8 -2
  31. package/dist/src/config/styleUtils.d.ts.map +1 -1
  32. package/dist/src/config/styleUtils.js +25 -1
  33. package/dist/src/config/themes.d.ts.map +1 -1
  34. package/dist/src/config/themes.js +21 -2
  35. package/dist/src/config/titleConfig.d.ts.map +1 -1
  36. package/dist/src/config/titleConfig.js +2 -18
  37. package/dist/src/data/collector.d.ts.map +1 -1
  38. package/dist/src/data/collector.js +40 -18
  39. package/dist/src/data/flowInit.d.ts +6 -0
  40. package/dist/src/data/flowInit.d.ts.map +1 -1
  41. package/dist/src/data/flowInit.js +1 -1
  42. package/dist/src/data/flowNode.d.ts +32 -0
  43. package/dist/src/data/flowNode.d.ts.map +1 -1
  44. package/dist/src/data/flowNode.js +59 -0
  45. package/dist/src/data/sources/lazy/bamSource.d.ts +0 -1
  46. package/dist/src/data/sources/lazy/bamSource.d.ts.map +1 -1
  47. package/dist/src/data/sources/lazy/bamSource.js +39 -30
  48. package/dist/src/data/sources/lazy/bigBedSource.d.ts +0 -10
  49. package/dist/src/data/sources/lazy/bigBedSource.d.ts.map +1 -1
  50. package/dist/src/data/sources/lazy/bigBedSource.js +127 -62
  51. package/dist/src/data/sources/lazy/bigWigSource.d.ts +2 -2
  52. package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
  53. package/dist/src/data/sources/lazy/bigWigSource.js +234 -81
  54. package/dist/src/data/sources/lazy/gff3Source.d.ts +7 -3
  55. package/dist/src/data/sources/lazy/gff3Source.d.ts.map +1 -1
  56. package/dist/src/data/sources/lazy/gff3Source.js +7 -8
  57. package/dist/src/data/sources/lazy/indexedFastaSource.d.ts +1 -1
  58. package/dist/src/data/sources/lazy/indexedFastaSource.d.ts.map +1 -1
  59. package/dist/src/data/sources/lazy/indexedFastaSource.js +28 -19
  60. package/dist/src/data/sources/lazy/legendEntriesSource.d.ts +24 -0
  61. package/dist/src/data/sources/lazy/legendEntriesSource.d.ts.map +1 -0
  62. package/dist/src/data/sources/lazy/legendEntriesSource.js +218 -0
  63. package/dist/src/data/sources/lazy/legendGradientSource.d.ts +30 -0
  64. package/dist/src/data/sources/lazy/legendGradientSource.d.ts.map +1 -0
  65. package/dist/src/data/sources/lazy/legendGradientSource.js +388 -0
  66. package/dist/src/data/sources/lazy/mockLazySource.d.ts +4 -1
  67. package/dist/src/data/sources/lazy/mockLazySource.d.ts.map +1 -1
  68. package/dist/src/data/sources/lazy/mockLazySource.js +49 -4
  69. package/dist/src/data/sources/lazy/registerCoreLazySources.js +2 -0
  70. package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
  71. package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +3 -4
  72. package/dist/src/data/sources/lazy/tabixSource.d.ts +9 -4
  73. package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
  74. package/dist/src/data/sources/lazy/tabixSource.js +201 -70
  75. package/dist/src/data/sources/lazy/tabixTsvSource.d.ts +2 -3
  76. package/dist/src/data/sources/lazy/tabixTsvSource.d.ts.map +1 -1
  77. package/dist/src/data/sources/lazy/tabixTsvSource.js +14 -12
  78. package/dist/src/data/sources/lazy/vcfSource.d.ts +7 -3
  79. package/dist/src/data/sources/lazy/vcfSource.d.ts.map +1 -1
  80. package/dist/src/data/sources/lazy/vcfSource.js +7 -8
  81. package/dist/src/data/sources/urlDescriptor.d.ts +165 -0
  82. package/dist/src/data/sources/urlDescriptor.d.ts.map +1 -0
  83. package/dist/src/data/sources/urlDescriptor.js +473 -0
  84. package/dist/src/data/sources/urlDescriptorController.d.ts +25 -0
  85. package/dist/src/data/sources/urlDescriptorController.d.ts.map +1 -0
  86. package/dist/src/data/sources/urlDescriptorController.js +72 -0
  87. package/dist/src/data/sources/urlDescriptorState.d.ts +47 -0
  88. package/dist/src/data/sources/urlDescriptorState.d.ts.map +1 -0
  89. package/dist/src/data/sources/urlDescriptorState.js +129 -0
  90. package/dist/src/data/sources/urlSource.d.ts.map +1 -1
  91. package/dist/src/data/sources/urlSource.js +101 -61
  92. package/dist/src/data/transforms/packLegendLabels.d.ts +21 -0
  93. package/dist/src/data/transforms/packLegendLabels.d.ts.map +1 -0
  94. package/dist/src/data/transforms/packLegendLabels.js +189 -0
  95. package/dist/src/data/transforms/transformFactory.d.ts.map +1 -1
  96. package/dist/src/data/transforms/transformFactory.js +4 -0
  97. package/dist/src/data/transforms/truncateText.d.ts +27 -0
  98. package/dist/src/data/transforms/truncateText.d.ts.map +1 -0
  99. package/dist/src/data/transforms/truncateText.js +94 -0
  100. package/dist/src/debug/dataflowDebugSnapshot.d.ts +58 -0
  101. package/dist/src/debug/dataflowDebugSnapshot.d.ts.map +1 -0
  102. package/dist/src/debug/dataflowDebugSnapshot.js +159 -0
  103. package/dist/src/debug/markDebugSnapshot.d.ts +54 -0
  104. package/dist/src/debug/markDebugSnapshot.d.ts.map +1 -0
  105. package/dist/src/debug/markDebugSnapshot.js +100 -0
  106. package/dist/src/debug/paramDebugSnapshot.d.ts +53 -0
  107. package/dist/src/debug/paramDebugSnapshot.d.ts.map +1 -0
  108. package/dist/src/debug/paramDebugSnapshot.js +86 -0
  109. package/dist/src/debug/resolutionDebugSnapshot.d.ts +155 -0
  110. package/dist/src/debug/resolutionDebugSnapshot.d.ts.map +1 -0
  111. package/dist/src/debug/resolutionDebugSnapshot.js +291 -0
  112. package/dist/src/debug/valuePreview.d.ts +9 -0
  113. package/dist/src/debug/valuePreview.d.ts.map +1 -0
  114. package/dist/src/debug/valuePreview.js +57 -0
  115. package/dist/src/debug/viewDebugSnapshot.d.ts +131 -0
  116. package/dist/src/debug/viewDebugSnapshot.d.ts.map +1 -0
  117. package/dist/src/debug/viewDebugSnapshot.js +390 -0
  118. package/dist/src/embedFactory.d.ts.map +1 -1
  119. package/dist/src/embedFactory.js +6 -1
  120. package/dist/src/encoder/encoder.d.ts +2 -2
  121. package/dist/src/encoder/encoder.d.ts.map +1 -1
  122. package/dist/src/encoder/encoder.js +5 -4
  123. package/dist/src/fonts/bmFontManager.d.ts +1 -1
  124. package/dist/src/fonts/bmFontManager.d.ts.map +1 -1
  125. package/dist/src/fonts/bmFontManager.js +45 -10
  126. package/dist/src/fonts/textMetrics.d.ts +69 -0
  127. package/dist/src/fonts/textMetrics.d.ts.map +1 -0
  128. package/dist/src/fonts/textMetrics.js +73 -0
  129. package/dist/src/genomeSpy/headlessBootstrap.d.ts.map +1 -1
  130. package/dist/src/genomeSpy/headlessBootstrap.js +6 -0
  131. package/dist/src/genomeSpy/renderCoordinator.d.ts.map +1 -1
  132. package/dist/src/genomeSpy/renderCoordinator.js +25 -3
  133. package/dist/src/genomeSpy/viewDataInit.d.ts +14 -0
  134. package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
  135. package/dist/src/genomeSpy/viewDataInit.js +45 -8
  136. package/dist/src/genomeSpyBase.d.ts +6 -0
  137. package/dist/src/genomeSpyBase.d.ts.map +1 -1
  138. package/dist/src/genomeSpyBase.js +20 -3
  139. package/dist/src/gl/glslScaleGenerator.d.ts +17 -0
  140. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
  141. package/dist/src/gl/glslScaleGenerator.js +39 -2
  142. package/dist/src/gl/includes/common.glsl.js +1 -1
  143. package/dist/src/gl/vertexRangeIndex.d.ts.map +1 -1
  144. package/dist/src/gl/vertexRangeIndex.js +4 -2
  145. package/dist/src/gl/webGLHelper.d.ts +1 -1
  146. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  147. package/dist/src/gl/webGLHelper.js +13 -8
  148. package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +140 -3
  149. package/dist/src/marks/mark.d.ts +47 -4
  150. package/dist/src/marks/mark.d.ts.map +1 -1
  151. package/dist/src/marks/mark.js +158 -54
  152. package/dist/src/marks/point.d.ts.map +1 -1
  153. package/dist/src/marks/point.js +4 -0
  154. package/dist/src/marks/point.vertex.glsl.js +1 -1
  155. package/dist/src/marks/text.d.ts +1 -1
  156. package/dist/src/marks/text.d.ts.map +1 -1
  157. package/dist/src/marks/text.js +2 -7
  158. package/dist/src/marks/text.vertex.glsl.js +1 -1
  159. package/dist/src/paramRuntime/paramUtils.d.ts +43 -9
  160. package/dist/src/paramRuntime/paramUtils.d.ts.map +1 -1
  161. package/dist/src/paramRuntime/paramUtils.js +61 -1
  162. package/dist/src/paramRuntime/viewParamRuntime.d.ts +32 -0
  163. package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
  164. package/dist/src/paramRuntime/viewParamRuntime.js +63 -0
  165. package/dist/src/scales/axisResolution.d.ts +35 -0
  166. package/dist/src/scales/axisResolution.d.ts.map +1 -1
  167. package/dist/src/scales/axisResolution.js +115 -7
  168. package/dist/src/scales/legendResolution.d.ts +83 -0
  169. package/dist/src/scales/legendResolution.d.ts.map +1 -0
  170. package/dist/src/scales/legendResolution.js +461 -0
  171. package/dist/src/scales/scaleResolution.d.ts +36 -0
  172. package/dist/src/scales/scaleResolution.d.ts.map +1 -1
  173. package/dist/src/scales/scaleResolution.js +59 -0
  174. package/dist/src/scales/viewLevelGuideConfig.d.ts +53 -0
  175. package/dist/src/scales/viewLevelGuideConfig.d.ts.map +1 -0
  176. package/dist/src/scales/viewLevelGuideConfig.js +224 -0
  177. package/dist/src/scales/viewLevelScaleConfig.d.ts.map +1 -1
  178. package/dist/src/scales/viewLevelScaleConfig.js +13 -2
  179. package/dist/src/spec/axis.d.ts +109 -3
  180. package/dist/src/spec/channel.d.ts +23 -4
  181. package/dist/src/spec/config.d.ts +59 -4
  182. package/dist/src/spec/data.d.ts +177 -17
  183. package/dist/src/spec/legend.d.ts +246 -0
  184. package/dist/src/spec/mark.d.ts +16 -4
  185. package/dist/src/spec/title.d.ts +58 -1
  186. package/dist/src/spec/transform.d.ts +149 -0
  187. package/dist/src/spec/view.d.ts +39 -6
  188. package/dist/src/types/embedApi.d.ts +262 -6
  189. package/dist/src/types/rendering.d.ts +19 -3
  190. package/dist/src/types/viewContext.d.ts +18 -2
  191. package/dist/src/utils/arrayUtils.d.ts +11 -0
  192. package/dist/src/utils/arrayUtils.d.ts.map +1 -1
  193. package/dist/src/utils/arrayUtils.js +23 -0
  194. package/dist/src/utils/suspension.d.ts +17 -0
  195. package/dist/src/utils/suspension.d.ts.map +1 -0
  196. package/dist/src/utils/suspension.js +41 -0
  197. package/dist/src/view/axisGridView.d.ts.map +1 -1
  198. package/dist/src/view/axisGridView.js +1 -4
  199. package/dist/src/view/axisView.d.ts +18 -2
  200. package/dist/src/view/axisView.d.ts.map +1 -1
  201. package/dist/src/view/axisView.js +180 -75
  202. package/dist/src/view/concatView.d.ts +10 -2
  203. package/dist/src/view/concatView.d.ts.map +1 -1
  204. package/dist/src/view/concatView.js +46 -9
  205. package/dist/src/view/containerMutationHelper.d.ts +20 -1
  206. package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
  207. package/dist/src/view/containerMutationHelper.js +196 -33
  208. package/dist/src/view/facetView.d.ts +1 -1
  209. package/dist/src/view/gridView/gridChild.d.ts +54 -4
  210. package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
  211. package/dist/src/view/gridView/gridChild.js +301 -120
  212. package/dist/src/view/gridView/gridChildLegends.d.ts +57 -0
  213. package/dist/src/view/gridView/gridChildLegends.d.ts.map +1 -0
  214. package/dist/src/view/gridView/gridChildLegends.js +503 -0
  215. package/dist/src/view/gridView/gridView.d.ts +25 -0
  216. package/dist/src/view/gridView/gridView.d.ts.map +1 -1
  217. package/dist/src/view/gridView/gridView.js +490 -78
  218. package/dist/src/view/gridView/legendLayout.d.ts +30 -0
  219. package/dist/src/view/gridView/legendLayout.d.ts.map +1 -0
  220. package/dist/src/view/gridView/legendLayout.js +115 -0
  221. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
  222. package/dist/src/view/gridView/scrollbar.js +1 -4
  223. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
  224. package/dist/src/view/gridView/selectionRect.js +1 -4
  225. package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
  226. package/dist/src/view/gridView/separatorView.js +1 -4
  227. package/dist/src/view/layerView.d.ts +9 -2
  228. package/dist/src/view/layerView.d.ts.map +1 -1
  229. package/dist/src/view/layerView.js +18 -1
  230. package/dist/src/view/layout/flexLayout.d.ts +20 -4
  231. package/dist/src/view/layout/flexLayout.d.ts.map +1 -1
  232. package/dist/src/view/layout/flexLayout.js +331 -31
  233. package/dist/src/view/layout/rectangle.d.ts +14 -0
  234. package/dist/src/view/layout/rectangle.d.ts.map +1 -1
  235. package/dist/src/view/layout/rectangle.js +40 -0
  236. package/dist/src/view/legend/legendEntries.d.ts +20 -0
  237. package/dist/src/view/legend/legendEntries.d.ts.map +1 -0
  238. package/dist/src/view/legend/legendEntries.js +21 -0
  239. package/dist/src/view/legendView.d.ts +137 -0
  240. package/dist/src/view/legendView.d.ts.map +1 -0
  241. package/dist/src/view/legendView.js +1654 -0
  242. package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
  243. package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +26 -4
  244. package/dist/src/view/renderingContext/clipOptions.d.ts +44 -0
  245. package/dist/src/view/renderingContext/clipOptions.d.ts.map +1 -0
  246. package/dist/src/view/renderingContext/clipOptions.js +140 -0
  247. package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts.map +1 -1
  248. package/dist/src/view/renderingContext/simpleViewRenderingContext.js +12 -1
  249. package/dist/src/view/resolutionPlanner.d.ts +2 -1
  250. package/dist/src/view/resolutionPlanner.d.ts.map +1 -1
  251. package/dist/src/view/resolutionPlanner.js +89 -25
  252. package/dist/src/view/testUtils.d.ts +4 -2
  253. package/dist/src/view/testUtils.d.ts.map +1 -1
  254. package/dist/src/view/testUtils.js +60 -7
  255. package/dist/src/view/titleView.d.ts +37 -0
  256. package/dist/src/view/titleView.d.ts.map +1 -0
  257. package/dist/src/view/titleView.js +584 -0
  258. package/dist/src/view/unitView.d.ts +3 -3
  259. package/dist/src/view/unitView.d.ts.map +1 -1
  260. package/dist/src/view/unitView.js +3 -2
  261. package/dist/src/view/view.d.ts +25 -24
  262. package/dist/src/view/view.d.ts.map +1 -1
  263. package/dist/src/view/view.js +126 -16
  264. package/dist/src/view/viewChrome.d.ts +33 -0
  265. package/dist/src/view/viewChrome.d.ts.map +1 -0
  266. package/dist/src/view/viewChrome.js +64 -0
  267. package/dist/src/view/viewFactory.d.ts +2 -5
  268. package/dist/src/view/viewFactory.d.ts.map +1 -1
  269. package/dist/src/view/viewFactory.js +1 -2
  270. package/dist/src/view/viewIdentityRegistry.d.ts +37 -0
  271. package/dist/src/view/viewIdentityRegistry.d.ts.map +1 -0
  272. package/dist/src/view/viewIdentityRegistry.js +71 -0
  273. package/dist/src/view/viewMutationAcidTestUtils.d.ts +112 -0
  274. package/dist/src/view/viewMutationAcidTestUtils.d.ts.map +1 -0
  275. package/dist/src/view/viewMutationAcidTestUtils.js +234 -0
  276. package/dist/src/view/viewMutationApi.d.ts +42 -0
  277. package/dist/src/view/viewMutationApi.d.ts.map +1 -0
  278. package/dist/src/view/viewMutationApi.js +811 -0
  279. package/dist/src/view/viewSelectors.d.ts +11 -9
  280. package/dist/src/view/viewSelectors.d.ts.map +1 -1
  281. package/dist/src/view/viewSelectors.js +28 -17
  282. package/package.json +4 -4
  283. package/dist/bundle/esm-CuMSzCHy.js +0 -298
  284. package/dist/bundle/esm-DAnOffpD.js +0 -1426
  285. package/dist/bundle/esm-DMXpJXM4.js +0 -369
  286. package/dist/bundle/esm-DNtC3H80.js +0 -121
  287. package/dist/src/view/title.d.ts +0 -13
  288. package/dist/src/view/title.d.ts.map +0 -1
  289. package/dist/src/view/title.js +0 -154
  290. /package/dist/bundle/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BTmAcN-t.js} +0 -0
  291. /package/dist/bundle/{esm-CuVa5T98.js → esm-VvpZ9hsq.js} +0 -0
  292. /package/dist/bundle/{chunk-DmhlhrBa.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
@@ -474,6 +474,153 @@ export interface MeasureTextParams extends TransformParamsBase {
474
474
  as: string;
475
475
  }
476
476
 
477
+ export interface TruncateTextParams extends TransformParamsBase {
478
+ type: "truncateText";
479
+
480
+ /**
481
+ * The field that contains the text to be truncated.
482
+ */
483
+ field: Field;
484
+
485
+ /**
486
+ * Maximum text width in pixels.
487
+ */
488
+ limit?: number;
489
+
490
+ /**
491
+ * The font size in pixels.
492
+ */
493
+ fontSize: number;
494
+
495
+ /**
496
+ * The font typeface. Uses the same asynchronously loaded SDF fonts as the
497
+ * `"text"` mark.
498
+ *
499
+ * **Default:** `"Lato"`
500
+ */
501
+ font?: string;
502
+
503
+ /**
504
+ * The font style. Valid values: `"normal"` and `"italic"`.
505
+ *
506
+ * **Default:** `"normal"`
507
+ */
508
+ fontStyle?: FontStyle;
509
+
510
+ /**
511
+ * The font weight.
512
+ *
513
+ * **Default:** `"regular"`
514
+ */
515
+ fontWeight?: FontWeight;
516
+
517
+ /**
518
+ * Text appended after truncation.
519
+ *
520
+ * **Default:** `"..."`.
521
+ */
522
+ ellipsis?: string;
523
+
524
+ /**
525
+ * The output field where the truncated text is written.
526
+ *
527
+ * **Default:** Same as `field`.
528
+ */
529
+ as?: string;
530
+ }
531
+
532
+ export interface PackLegendLabelsParams extends TransformParamsBase {
533
+ type: "packLegendLabels";
534
+
535
+ /**
536
+ * The field that contains measured label width in pixels.
537
+ */
538
+ labelWidth: Field;
539
+
540
+ /**
541
+ * The direction in which entries are laid out.
542
+ *
543
+ * **Default:** `"vertical"`
544
+ */
545
+ direction?: "vertical" | "horizontal";
546
+
547
+ /**
548
+ * The number of columns in which to arrange entries.
549
+ */
550
+ columns?: number;
551
+
552
+ /**
553
+ * Symbol size in pixels squared, or a field containing per-entry symbol
554
+ * sizes in pixels squared.
555
+ *
556
+ * **Default:** `100`
557
+ */
558
+ symbolSize?: number | Field;
559
+
560
+ /**
561
+ * Symbol stroke width in pixels, or a field containing per-entry stroke
562
+ * widths in pixels.
563
+ *
564
+ * **Default:** `0`
565
+ */
566
+ symbolStrokeWidth?: number | Field;
567
+
568
+ /**
569
+ * Offset between the symbol and label in pixels.
570
+ *
571
+ * **Default:** `0`
572
+ */
573
+ labelOffset?: number;
574
+
575
+ /**
576
+ * Label font size in pixels.
577
+ *
578
+ * **Default:** `10`
579
+ */
580
+ fontSize?: number;
581
+
582
+ /**
583
+ * Padding between rows in pixels.
584
+ *
585
+ * **Default:** `0`
586
+ */
587
+ rowPadding?: number;
588
+
589
+ /**
590
+ * Padding between columns in pixels.
591
+ *
592
+ * **Default:** `0`
593
+ */
594
+ columnPadding?: number;
595
+
596
+ /**
597
+ * Horizontal offset for all generated entry coordinates in pixels.
598
+ *
599
+ * **Default:** `0`
600
+ */
601
+ xOffset?: number;
602
+
603
+ /**
604
+ * Horizontal offset for generated symbol coordinates in pixels.
605
+ *
606
+ * **Default:** `0`
607
+ */
608
+ symbolOffset?: number;
609
+
610
+ /**
611
+ * Vertical offset for all generated entry coordinates in pixels.
612
+ *
613
+ * **Default:** `0`
614
+ */
615
+ yOffset?: number;
616
+
617
+ /**
618
+ * Height of the pixel-space layout area. When provided, the transform also
619
+ * emits inverted y coordinates for GenomeSpy's unit y range.
620
+ */
621
+ yExtent?: number | ExprRef;
622
+ }
623
+
477
624
  export interface MergeFacetsParams extends TransformParamsBase {
478
625
  type: "mergeFacets";
479
626
  }
@@ -606,6 +753,8 @@ export type TransformParams =
606
753
  | IdentifierParams
607
754
  | LinearizeGenomicCoordinateParams
608
755
  | MeasureTextParams
756
+ | TruncateTextParams
757
+ | PackLegendLabelsParams
609
758
  | MergeFacetsParams
610
759
  | PileupParams
611
760
  | ProjectParams
@@ -5,6 +5,7 @@ import {
5
5
  ChannelWithScale,
6
6
  Encoding,
7
7
  FacetFieldDef,
8
+ NonPositionalChannelWithScale,
8
9
  PrimaryPositionalChannel,
9
10
  } from "./channel.js";
10
11
  import { MarkProps, MarkType, RuleProps } from "./mark.js";
@@ -14,6 +15,8 @@ import { Parameter } from "./parameter.js";
14
15
  import { GenomeSpyConfig } from "./config.js";
15
16
  import { ViewBackgroundProps, ZIndexProps } from "./decoration.js";
16
17
  import { Scale } from "./scale.js";
18
+ import { Axis, GenomeAxis } from "./axis.js";
19
+ import { Legend } from "./legend.js";
17
20
 
18
21
  export interface SizeDef {
19
22
  /**
@@ -27,6 +30,16 @@ export interface SizeDef {
27
30
  * for details.
28
31
  */
29
32
  grow?: number;
33
+
34
+ /**
35
+ * Minimum size in pixels.
36
+ */
37
+ minPx?: number;
38
+
39
+ /**
40
+ * Maximum size in pixels.
41
+ */
42
+ maxPx?: number;
30
43
  }
31
44
 
32
45
  // TODO: Perhaps this should be in "utils"
@@ -222,6 +235,26 @@ export interface ViewSpecBase extends ResolveSpec {
222
235
  */
223
236
  scales?: Partial<Record<ChannelWithScale, Scale>>;
224
237
 
238
+ /**
239
+ * Configures axis resolutions used by this view subtree.
240
+ *
241
+ * Use this when a composed view shares an axis across child views and the
242
+ * axis settings belong to the composed view rather than an individual
243
+ * encoding.
244
+ */
245
+ axes?: Partial<
246
+ Record<PrimaryPositionalChannel, Partial<Axis & GenomeAxis>>
247
+ >;
248
+
249
+ /**
250
+ * Configures legend resolutions used by this view subtree.
251
+ *
252
+ * Use this when a composed view shares a legend across child views and the
253
+ * legend settings belong to the composed view rather than an individual
254
+ * encoding.
255
+ */
256
+ legends?: Partial<Record<NonPositionalChannelWithScale, Legend>>;
257
+
225
258
  /**
226
259
  * Specifies a [data source](https://genomespy.app/docs/grammar/data/).
227
260
  * If omitted, the data source is inherited from the parent view.
@@ -252,9 +285,6 @@ export interface ViewSpecBase extends ResolveSpec {
252
285
 
253
286
  /**
254
287
  * View title.
255
- * N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to
256
- * manually specify proper padding for the view to ensure that the title is
257
- * visible.
258
288
  */
259
289
  title?: string | Title;
260
290
 
@@ -401,7 +431,7 @@ export interface FacetSpec extends ViewSpecBase {
401
431
  spacing?: number;
402
432
  }
403
433
 
404
- export type ResolutionTarget = "scale" | "axis";
434
+ export type ResolutionTarget = "scale" | "axis" | "legend";
405
435
 
406
436
  /**
407
437
  * `"independent"` and `"shared"` behave similarly to Vega-Lite.
@@ -417,9 +447,12 @@ export type ResolutionBehavior =
417
447
 
418
448
  export interface ResolveSpec {
419
449
  /**
420
- * Specifies how scales and axes are
421
- * [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution)
450
+ * Specifies how scales, axes, and legends are
451
+ * [resolved](https://genomespy.app/docs/grammar/composition/#scale-axis-and-legend-resolution)
422
452
  * in the view hierarchy.
453
+ *
454
+ * If legend resolution is not configured explicitly, it follows the
455
+ * corresponding scale resolution.
423
456
  */
424
457
  resolve?: Partial<
425
458
  Record<
@@ -4,6 +4,8 @@ import { RootSpec } from "../spec/root.js";
4
4
  import { GenomeSpyConfig } from "../spec/config.js";
5
5
  import { Scalar } from "../spec/channel.js";
6
6
  import { IntervalSelection } from "./selectionTypes.js";
7
+ import { ImportSpec, ViewSpec } from "../spec/view.js";
8
+ import { ViewSelector } from "../view/viewUtilTypes.js";
7
9
 
8
10
  /**
9
11
  * Embeds GenomeSpy into the DOM
@@ -97,10 +99,255 @@ export interface ParamApi<T = ParamValue> {
97
99
  subscribe: (listener: (value: T) => void) => () => void;
98
100
  }
99
101
 
102
+ /**
103
+ * Address of a view in the live layout hierarchy.
104
+ *
105
+ * Use a `ViewSelector` for durable references to named views within import or
106
+ * insertion scopes. Use a `ViewHandle` for views returned by this API,
107
+ * including anonymous views. Use `"root"` to address the root view.
108
+ */
109
+ export type ViewAddress = ViewHandle | ViewSelector | "root";
110
+
111
+ /**
112
+ * Options for inserting a new child view or subtree.
113
+ */
114
+ export interface InsertViewOptions {
115
+ /**
116
+ * Child index where the view is inserted. If omitted, the view is appended.
117
+ */
118
+ index?: number;
119
+
120
+ /**
121
+ * Optional scope name for the inserted subtree.
122
+ *
123
+ * The scope makes repeated instances of the same spec independently
124
+ * addressable by selectors. It does not replace the inserted root view's
125
+ * own `name`.
126
+ */
127
+ scope?: string | null;
128
+ }
129
+
130
+ /**
131
+ * Public view kind reported by `ViewHandle`.
132
+ */
133
+ export type ViewHandleType = "unit" | "layer" | "concat" | "grid" | "unknown";
134
+
135
+ /**
136
+ * Last rendered layout bounds for a view, in CSS pixels.
137
+ *
138
+ * The coordinate space is the embedded GenomeSpy canvas. Convert these bounds
139
+ * to DOM coordinates in the embedding application when positioning external
140
+ * controls.
141
+ */
142
+ export interface ViewLayoutBounds {
143
+ /**
144
+ * Horizontal position of the view's left edge.
145
+ */
146
+ x: number;
147
+
148
+ /**
149
+ * Vertical position of the view's top edge.
150
+ */
151
+ y: number;
152
+
153
+ /**
154
+ * View width.
155
+ */
156
+ width: number;
157
+
158
+ /**
159
+ * View height.
160
+ */
161
+ height: number;
162
+ }
163
+
164
+ /**
165
+ * Options for reordering a view within its current parent container.
166
+ */
167
+ export interface MoveViewOptions {
168
+ /**
169
+ * Destination child index within the target's current parent.
170
+ *
171
+ * The index is zero-based and is interpreted after temporarily removing
172
+ * the target from its parent. Values from `0` through the remaining child
173
+ * count are valid. A value equal to the remaining child count places the
174
+ * target last. Negative values and larger values throw.
175
+ *
176
+ * For children `[A, B, C, D]`, moving `B` with `index: 3` results in
177
+ * `[A, C, D, B]`.
178
+ */
179
+ index: number;
180
+ }
181
+
182
+ /**
183
+ * Live handle to a view in the embedded GenomeSpy instance.
184
+ *
185
+ * The exposed hierarchy matches the layout tree derived from the
186
+ * visualization spec: unit views and container views are represented as view
187
+ * handles, and child order is the layout order declared by the spec.
188
+ * GenomeSpy may add an implicit root layout container, for example when a
189
+ * root unit view needs space for axes, titles, or other guides.
190
+ *
191
+ * Handles are opaque public references. They do not expose internal `View`
192
+ * objects, and callers should check `isAlive()` before reusing a handle after
193
+ * mutations that may have removed its subtree.
194
+ */
195
+ export interface ViewHandle {
196
+ /**
197
+ * Runtime-stable id for this handle.
198
+ *
199
+ * The id is stable only for the current embedded instance. It is not a
200
+ * bookmark or serialization format.
201
+ */
202
+ readonly id: string;
203
+
204
+ /**
205
+ * Explicit view name, if the view has one.
206
+ */
207
+ readonly name: string | undefined;
208
+
209
+ /**
210
+ * Selector for this view, if the view is addressable by selector.
211
+ */
212
+ readonly selector: ViewSelector | undefined;
213
+
214
+ /**
215
+ * Public view kind.
216
+ */
217
+ readonly type: ViewHandleType;
218
+
219
+ /**
220
+ * Returns whether the referenced view is still part of the live hierarchy.
221
+ */
222
+ isAlive: () => boolean;
223
+
224
+ /**
225
+ * Returns a handle to the layout parent, if the view has one.
226
+ */
227
+ parent: () => ViewHandle | undefined;
228
+
229
+ /**
230
+ * Returns handles for the current layout child views in spec order.
231
+ */
232
+ children: () => ViewHandle[];
233
+ }
234
+
235
+ /**
236
+ * API for inspecting and mutating the live layout hierarchy.
237
+ *
238
+ * The hierarchy model matches the layout tree derived from the visualization
239
+ * spec. The API addresses view nodes such as unit, layer, concat, and grid
240
+ * views, plus implicit layout containers that GenomeSpy may add at the root.
241
+ * It does not address rendered marks, guide primitives, DOM nodes, or other
242
+ * internal implementation objects.
243
+ *
244
+ * Mutations are asynchronous because view creation, imports, dataflow
245
+ * initialization, data loading, guide rebuilding, and layout updates may all be
246
+ * involved. Mutation promises resolve when the operation-specific lifecycle has
247
+ * completed.
248
+ */
249
+ export interface ViewApi {
250
+ /**
251
+ * Returns a handle to the root layout view.
252
+ *
253
+ * The root may be an implicit layout container rather than the top-level
254
+ * view declared by the input spec.
255
+ */
256
+ root: () => ViewHandle;
257
+
258
+ /**
259
+ * Resolves an address to a live view handle.
260
+ *
261
+ * Returns `undefined` when the address cannot be resolved or when a handle
262
+ * no longer refers to a live view.
263
+ */
264
+ resolve: (address: ViewAddress) => ViewHandle | undefined;
265
+
266
+ /**
267
+ * Resolves an address to a live view handle.
268
+ *
269
+ * Throws if the address cannot be resolved or if a handle no longer refers
270
+ * to a live view.
271
+ */
272
+ get: (address: ViewAddress) => ViewHandle;
273
+
274
+ /**
275
+ * Returns the last rendered layout bounds for a view.
276
+ *
277
+ * Bounds are returned in CSS pixels in the embedded GenomeSpy canvas
278
+ * coordinate space. Returns `undefined` if the address is unresolved, the
279
+ * view is no longer live, or the view has not been rendered yet.
280
+ */
281
+ getLayoutBounds: (address: ViewAddress) => ViewLayoutBounds | undefined;
282
+
283
+ /**
284
+ * Subscribes to completed layout updates.
285
+ *
286
+ * The listener is called after a layout/render pass has updated view
287
+ * bounds. Returns an unsubscribe function.
288
+ */
289
+ subscribeToLayout: (listener: () => void) => () => void;
290
+
291
+ /**
292
+ * Inserts a new child view or subtree under a mutable container view.
293
+ *
294
+ * The `spec` can be an ordinary view spec or an import spec. Use
295
+ * `options.scope` to give the inserted instance a selector scope, allowing
296
+ * the same spec to be inserted multiple times and addressed independently.
297
+ */
298
+ insert: (
299
+ parent: ViewAddress,
300
+ spec: ViewSpec | ImportSpec,
301
+ options?: InsertViewOptions
302
+ ) => Promise<ViewHandle>;
303
+
304
+ /**
305
+ * Removes a view and disposes its subtree.
306
+ *
307
+ * Removing the root view is not supported.
308
+ */
309
+ remove: (target: ViewAddress) => Promise<void>;
310
+
311
+ /**
312
+ * Reorders a view within its current parent container.
313
+ *
314
+ * `options.index` is the destination index after temporarily removing the
315
+ * target from its current position.
316
+ *
317
+ * Moving a view to another branch of the hierarchy is not supported by the
318
+ * initial API.
319
+ */
320
+ move: (
321
+ target: ViewAddress,
322
+ options: MoveViewOptions
323
+ ) => Promise<ViewHandle>;
324
+
325
+ /**
326
+ * Runs multiple mutations as one ordered transaction.
327
+ *
328
+ * Implementations may defer layout and rendering work until the callback
329
+ * has completed.
330
+ */
331
+ transaction: <T>(
332
+ callback: (views: ViewApi) => T | Promise<T>
333
+ ) => Promise<T>;
334
+ }
335
+
336
+ /**
337
+ * @deprecated Use `ViewApi`. The `api.views` namespace now includes both
338
+ * mutation and layout observation methods.
339
+ */
340
+ export type ViewMutationApi = ViewApi;
341
+
100
342
  /**
101
343
  * An API for controlling the embedded GenomeSpy instance.
102
344
  */
103
345
  export interface EmbedResult {
346
+ /**
347
+ * Inspects and controls the live view hierarchy.
348
+ */
349
+ views: ViewApi;
350
+
104
351
  /**
105
352
  * Releases all resources and unregisters event listeners, etc.
106
353
  */
@@ -121,9 +368,10 @@ export interface EmbedResult {
121
368
 
122
369
  /**
123
370
  * Returns a named `ScaleResolution` object that allows for attaching event
124
- * listeners and controlling the scale domain.
371
+ * listeners and controlling the scale domain. Returns `undefined` when the
372
+ * name is not registered.
125
373
  */
126
- getScaleResolutionByName: (name: string) => ScaleResolutionApi;
374
+ getScaleResolutionByName: (name: string) => ScaleResolutionApi | undefined;
127
375
 
128
376
  /**
129
377
  * Returns a handle for reading, writing, and subscribing to a named
@@ -173,9 +421,17 @@ export interface EmbedResult {
173
421
  * @returns A PNG data URL
174
422
  */
175
423
  exportCanvas: (
176
- logicalWidth: number,
177
- logicalHeight: number,
178
- devicePixelRatio: number,
179
- clearColor: string
424
+ logicalWidth?: number,
425
+ logicalHeight?: number,
426
+ devicePixelRatio?: number,
427
+ clearColor?: string
180
428
  ) => string;
429
+
430
+ /**
431
+ * Returns the internal root view for optional developer tooling.
432
+ *
433
+ * This API is intended for debug inspectors that need access to internal
434
+ * runtime structures without forcing debug modules into normal Core use.
435
+ */
436
+ getDebugViewRoot: () => object | undefined;
181
437
  }
@@ -35,10 +35,25 @@ export interface RenderingOptions {
35
35
  sampleFacetRenderingOptions?: SampleFacetRenderingOptions;
36
36
 
37
37
  /**
38
- * Clip rendering using the given rectangle.
39
- * Mainly intended for clipping scrollable views.
38
+ * Convenience shorthand for clipping rendering to the given rectangle in
39
+ * both directions. Core rendering internals normalize this to `clip`.
40
+ *
41
+ * Mainly intended for existing callers that need ordinary rectangular
42
+ * clipping.
40
43
  */
41
44
  clipRect?: Rectangle;
45
+
46
+ /**
47
+ * Clip rendering using the given rectangle and direction flags. Prefer this
48
+ * option when clipping should apply only horizontally or vertically.
49
+ */
50
+ clip?: ClipOptions;
51
+ }
52
+
53
+ export interface ClipOptions {
54
+ rect: Rectangle;
55
+ clipX: boolean;
56
+ clipY: boolean;
42
57
  }
43
58
 
44
59
  /**
@@ -60,7 +75,8 @@ export interface BufferedRenderingRequest {
60
75
  mark: Mark;
61
76
  callback: () => void;
62
77
  coords: Rectangle;
63
- clipRect?: Rectangle;
78
+ clip?: ClipOptions;
79
+ cullClip?: ClipOptions;
64
80
  }
65
81
 
66
82
  /**
@@ -10,6 +10,8 @@ import { Datum } from "../data/flowNode.js";
10
10
  import { ImportSpec, ViewSpec } from "../spec/view.js";
11
11
  import ContainerView from "../view/containerView.js";
12
12
  import { BroadcastEventType } from "../genomeSpy.js";
13
+ import { AxisLabelClipPolicy } from "../view/axisView.js";
14
+ import { PrimaryPositionalChannel } from "../spec/channel.js";
13
15
 
14
16
  export interface Hover {
15
17
  mark: Mark;
@@ -18,10 +20,24 @@ export interface Hover {
18
20
 
19
21
  export type DataLoadingStatus = "loading" | "complete" | "error";
20
22
 
21
- export interface CreateViewOptions {
22
- layoutSizeParams?: "own" | "inherit";
23
+ export interface ViewOptions {
24
+ /** Inherits encodings from the data parent. Authored composition children opt in. */
25
+ inheritEncoding?: boolean;
26
+ /**
27
+ * Controls whether the view allocates local layout-driven width/height
28
+ * parameters. `"own"` preserves explicitly configured ancestor params,
29
+ * `"inherit"` disables local layout params, and `"force"` always allocates
30
+ * local layout params.
31
+ */
32
+ layoutSizeParams?: "own" | "inherit" | "force";
33
+ /** Overrides label clipping for axes created for this view. */
34
+ axisLabelClipPolicy?: Partial<
35
+ Record<PrimaryPositionalChannel, AxisLabelClipPolicy>
36
+ >;
23
37
  }
24
38
 
39
+ export type CreateViewOptions = ViewOptions;
40
+
25
41
  /**
26
42
  * ViewContext provides essential data and interfaces to View classes.
27
43
  */
@@ -31,4 +31,15 @@ export function asArray<T>(obj: T[] | T): T[];
31
31
  * @template T
32
32
  */
33
33
  export function peek<T>(arr: T[]): T;
34
+ /**
35
+ * Moves an item within an array.
36
+ *
37
+ * The destination index is interpreted after temporarily removing the item.
38
+ *
39
+ * @param {T[]} arr
40
+ * @param {number} fromIndex
41
+ * @param {number} index
42
+ * @template T
43
+ */
44
+ export function moveArrayItem<T>(arr: T[], fromIndex: number, index: number): void;
34
45
  //# sourceMappingURL=arrayUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arrayUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/arrayUtils.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mCAFa,CAAC,KAFH,CAAC,EAAE,KACH,CAAC,EAAE,WAKb;AAED;;;;;;GAMG;AACH,gDAFa,CAAC,EAAE,CAAC,EAAE,CAAC,KAJT,CAAC,EAAE,KACH,CAAC,EAAE,aACH,CAAS,IAAC,EAAD,CAAC,KAAE,CAAC,aACb,CAAS,IAAC,EAAD,CAAC,KAAE,CAAC,WAQvB;AAED;;;GAGG;AACH,iCAFW,GAAG,EAAE,WASf;AAED;;;;GAIG;AACH,wBAFa,CAAC,OAFH,CAAC,EAAE,GAAG,CAAC,GACL,CAAC,EAAE,CAWf;AAED;;;;;;GAMG;AACH,qBAFa,CAAC,OADH,CAAC,EAAE,KAKb"}
1
+ {"version":3,"file":"arrayUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/arrayUtils.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mCAFa,CAAC,KAFH,CAAC,EAAE,KACH,CAAC,EAAE,WAKb;AAED;;;;;;GAMG;AACH,gDAFa,CAAC,EAAE,CAAC,EAAE,CAAC,KAJT,CAAC,EAAE,KACH,CAAC,EAAE,aACH,CAAS,IAAC,EAAD,CAAC,KAAE,CAAC,aACb,CAAS,IAAC,EAAD,CAAC,KAAE,CAAC,WAQvB;AAED;;;GAGG;AACH,iCAFW,GAAG,EAAE,WASf;AAED;;;;GAIG;AACH,wBAFa,CAAC,OAFH,CAAC,EAAE,GAAG,CAAC,GACL,CAAC,EAAE,CAWf;AAED;;;;;;GAMG;AACH,qBAFa,CAAC,OADH,CAAC,EAAE,KAKb;AAED;;;;;;;;;GASG;AACH,8BAFa,CAAC,OAHH,CAAC,EAAE,aACH,MAAM,SACN,MAAM,QAchB"}
@@ -59,3 +59,26 @@ export function asArray(obj) {
59
59
  export function peek(arr) {
60
60
  return arr[arr.length - 1];
61
61
  }
62
+
63
+ /**
64
+ * Moves an item within an array.
65
+ *
66
+ * The destination index is interpreted after temporarily removing the item.
67
+ *
68
+ * @param {T[]} arr
69
+ * @param {number} fromIndex
70
+ * @param {number} index
71
+ * @template T
72
+ */
73
+ export function moveArrayItem(arr, fromIndex, index) {
74
+ if (fromIndex < 0 || fromIndex >= arr.length) {
75
+ throw new Error("Source index out of range.");
76
+ }
77
+
78
+ if (index < 0 || index > arr.length - 1) {
79
+ throw new Error("Destination index out of range.");
80
+ }
81
+
82
+ const [item] = arr.splice(fromIndex, 1);
83
+ arr.splice(index, 0, item);
84
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Reference-counted suspension guard. Nested suspensions are supported and the
3
+ * resume callback runs only when the outermost release happens.
4
+ */
5
+ export default class Suspension {
6
+ /**
7
+ * @param {() => void} [onResume]
8
+ */
9
+ constructor(onResume?: () => void);
10
+ get active(): boolean;
11
+ /**
12
+ * @returns {() => void}
13
+ */
14
+ suspend(): () => void;
15
+ #private;
16
+ }
17
+ //# sourceMappingURL=suspension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suspension.d.ts","sourceRoot":"","sources":["../../../src/utils/suspension.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;IAMI;;OAEG;IACH,uBAFW,MAAM,IAAI,EAIpB;IAED,sBAEC;IAED;;OAEG;IACH,WAFa,MAAM,IAAI,CAiBtB;;CACJ"}