@genome-spy/core 0.78.0 → 0.79.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 (289) 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 +14840 -11661
  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 +217 -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 +454 -78
  218. package/dist/src/view/gridView/legendLayout.d.ts +26 -0
  219. package/dist/src/view/gridView/legendLayout.d.ts.map +1 -0
  220. package/dist/src/view/gridView/legendLayout.js +111 -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 +134 -0
  240. package/dist/src/view/legendView.d.ts.map +1 -0
  241. package/dist/src/view/legendView.js +1611 -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 +29 -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 +121 -16
  264. package/dist/src/view/viewFactory.d.ts +2 -5
  265. package/dist/src/view/viewFactory.d.ts.map +1 -1
  266. package/dist/src/view/viewFactory.js +1 -2
  267. package/dist/src/view/viewIdentityRegistry.d.ts +37 -0
  268. package/dist/src/view/viewIdentityRegistry.d.ts.map +1 -0
  269. package/dist/src/view/viewIdentityRegistry.js +71 -0
  270. package/dist/src/view/viewMutationAcidTestUtils.d.ts +112 -0
  271. package/dist/src/view/viewMutationAcidTestUtils.d.ts.map +1 -0
  272. package/dist/src/view/viewMutationAcidTestUtils.js +234 -0
  273. package/dist/src/view/viewMutationApi.d.ts +42 -0
  274. package/dist/src/view/viewMutationApi.d.ts.map +1 -0
  275. package/dist/src/view/viewMutationApi.js +811 -0
  276. package/dist/src/view/viewSelectors.d.ts +10 -0
  277. package/dist/src/view/viewSelectors.d.ts.map +1 -1
  278. package/dist/src/view/viewSelectors.js +23 -1
  279. package/package.json +4 -4
  280. package/dist/bundle/esm-CuMSzCHy.js +0 -298
  281. package/dist/bundle/esm-DAnOffpD.js +0 -1426
  282. package/dist/bundle/esm-DMXpJXM4.js +0 -369
  283. package/dist/bundle/esm-DNtC3H80.js +0 -121
  284. package/dist/src/view/title.d.ts +0 -13
  285. package/dist/src/view/title.d.ts.map +0 -1
  286. package/dist/src/view/title.js +0 -154
  287. /package/dist/bundle/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BTmAcN-t.js} +0 -0
  288. /package/dist/bundle/{esm-CuVa5T98.js → esm-VvpZ9hsq.js} +0 -0
  289. /package/dist/bundle/{chunk-DmhlhrBa.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
@@ -12,7 +12,13 @@
12
12
  * Constants and utilities for data.
13
13
  */
14
14
  import { Axis } from "./axis.js";
15
- import { FieldName, PrimaryPositionalChannel } from "./channel.js";
15
+ import {
16
+ ChannelWithScale,
17
+ FieldName,
18
+ PrimaryPositionalChannel,
19
+ Scalar,
20
+ Type as ChannelType,
21
+ } from "./channel.js";
16
22
  import { ExprRef } from "./parameter.js";
17
23
 
18
24
  export type ParseValue =
@@ -172,14 +178,82 @@ export interface UrlList {
172
178
  type?: "json" | "csv" | "tsv";
173
179
  }
174
180
 
181
+ export interface UrlTemplate {
182
+ /**
183
+ * URL template. The value from `values` is substituted for the placeholder
184
+ * named by `field`, for example `{sample}`.
185
+ */
186
+ template: string;
187
+
188
+ /**
189
+ * Values used for template expansion. Duplicate resolved URLs are loaded
190
+ * once. An ExprRef can reference reactive parameters such as
191
+ * `visibleSamples`.
192
+ */
193
+ values: Scalar[] | ExprRef;
194
+
195
+ /**
196
+ * Field name used as the template placeholder and as the datum field
197
+ * attached to loaded rows.
198
+ */
199
+ field: FieldName;
200
+
201
+ /**
202
+ * Whether to attach the template value to each loaded datum using `field`
203
+ * as the datum field name. Disable this when the expanded URL identifies
204
+ * only a file partition and the loaded data already contains the relevant
205
+ * identifiers.
206
+ *
207
+ * __Default value:__ `true`
208
+ */
209
+ attach?: boolean;
210
+
211
+ /**
212
+ * Maximum number of distinct resolved values to load. If the limit is
213
+ * exceeded, the source loads no data.
214
+ */
215
+ maxValues?: number;
216
+
217
+ /**
218
+ * Behavior when loading an expanded URL fails. The default `"error"`
219
+ * fails the data source. Use `"skip"` when some expanded URLs are expected
220
+ * to be unavailable, for example when data files for some patients have
221
+ * not been generated yet.
222
+ *
223
+ * __Default value:__ `"error"`
224
+ */
225
+ onLoadError?: "error" | "skip";
226
+ }
227
+
228
+ export interface IndexUrlTemplate {
229
+ /**
230
+ * URL template for index files. Uses the same values and field placeholder
231
+ * as the `url` template.
232
+ */
233
+ template: string;
234
+ }
235
+
236
+ export type UrlSourceRef = string | string[] | ExprRef | UrlList | UrlTemplate;
237
+
238
+ export type SingleUrlSourceRef = string | ExprRef | UrlTemplate;
239
+
240
+ export type MultiUrlSourceRef = string | string[] | ExprRef | UrlTemplate;
241
+
242
+ export type IndexUrlSourceRef = string | ExprRef | IndexUrlTemplate;
243
+
175
244
  export interface UrlData extends DataBase {
176
245
  /**
177
- * An URL or an array of URLs from which to load the data set.
246
+ * An URL, a list of URLs, or a URL expansion definition from which to load
247
+ * the data set.
248
+ *
249
+ * A URL template can expand values from an ExprRef and attach the expanded
250
+ * value as a field to loaded rows.
251
+ *
178
252
  * Gzip-compressed resources are decompressed transparently when the URL,
179
253
  * MIME type, or payload indicates gzip content. Use the `format.type`
180
254
  * property to ensure the loaded data is correctly parsed.
181
255
  */
182
- url: string | string[] | ExprRef | UrlList;
256
+ url: UrlSourceRef;
183
257
  }
184
258
 
185
259
  export interface InlineData extends DataBase {
@@ -263,6 +337,9 @@ export interface LazyData {
263
337
 
264
338
  export type LazyDataParams =
265
339
  | AxisTicksData
340
+ | LegendEntriesData
341
+ | LegendGradientData
342
+ | LegendGradientTicksData
266
343
  | AxisGenomeData
267
344
  | IndexedFastaData
268
345
  | BigWigData
@@ -312,6 +389,80 @@ export interface AxisTicksData {
312
389
  channel: PrimaryPositionalChannel;
313
390
  }
314
391
 
392
+ /**
393
+ * Internal data source for generated legend entries.
394
+ *
395
+ * @internal
396
+ */
397
+ export interface LegendEntriesData {
398
+ type: "legendEntries";
399
+
400
+ /** Which channel's scale domain to use */
401
+ channel: ChannelWithScale;
402
+
403
+ /** The data type of the source channel */
404
+ dataType?: ChannelType;
405
+
406
+ /** D3 number format specifier for labels */
407
+ format?: string;
408
+
409
+ /** Explicit legend values */
410
+ values?: Scalar[];
411
+
412
+ /** Number of representative entries to generate for quantitative scales */
413
+ count?: number;
414
+
415
+ /**
416
+ * Whether size entries should also include the scale output as a stroke
417
+ * width for stroke-based legend symbols.
418
+ *
419
+ * @internal
420
+ */
421
+ sizeMode?: "area" | "strokeWidth";
422
+ }
423
+
424
+ /**
425
+ * Internal data source for generated gradient legend ramp samples.
426
+ *
427
+ * @internal
428
+ */
429
+ export interface LegendGradientData {
430
+ type: "legendGradient";
431
+
432
+ /** Which channel's scale domain to use */
433
+ channel: ChannelWithScale;
434
+
435
+ /** Number of ramp samples to generate */
436
+ count?: number;
437
+
438
+ /** D3 number format specifier for labels derived from this source */
439
+ format?: string;
440
+
441
+ /** Explicit tick values derived from this source */
442
+ values?: Scalar[];
443
+ }
444
+
445
+ /**
446
+ * Internal data source for generated gradient legend ticks.
447
+ *
448
+ * @internal
449
+ */
450
+ export interface LegendGradientTicksData {
451
+ type: "legendGradientTicks";
452
+
453
+ /** Which channel's scale domain to use */
454
+ channel: ChannelWithScale;
455
+
456
+ /** Number of ticks to generate */
457
+ count?: number;
458
+
459
+ /** D3 number format specifier for tick labels */
460
+ format?: string;
461
+
462
+ /** Explicit tick values */
463
+ values?: Scalar[];
464
+ }
465
+
315
466
  export interface AxisGenomeData {
316
467
  type: "axisGenome";
317
468
 
@@ -330,16 +481,18 @@ export interface IndexedFastaData extends DebouncedData {
330
481
  channel?: PrimaryPositionalChannel;
331
482
 
332
483
  /**
333
- * URL of the fasta file.
484
+ * URL of the fasta file. URL templates must resolve to one URL.
334
485
  */
335
- url: string;
486
+ url: SingleUrlSourceRef;
336
487
 
337
488
  /**
338
489
  * URL of the index file.
490
+ * When `url` is a template, this can be an index URL template using the
491
+ * same placeholder and values.
339
492
  *
340
493
  * __Default value:__ `url` + `".fai"`.
341
494
  */
342
- indexUrl?: string;
495
+ indexUrl?: IndexUrlSourceRef;
343
496
 
344
497
  /**
345
498
  * Size of each chunk when fetching the fasta file. Data is only fetched
@@ -361,9 +514,10 @@ export interface BigWigData extends DebouncedData {
361
514
  channel?: PrimaryPositionalChannel;
362
515
 
363
516
  /**
364
- * URL of the BigWig file.
517
+ * URL of the BigWig file. URL templates load multiple BigWig files and
518
+ * attach the template field to loaded rows.
365
519
  */
366
- url: string | ExprRef;
520
+ url: MultiUrlSourceRef;
367
521
 
368
522
  /**
369
523
  * The approximate minimum width of each data bin, in pixels.
@@ -384,9 +538,10 @@ export interface BigBedData extends DebouncedData {
384
538
  channel?: PrimaryPositionalChannel;
385
539
 
386
540
  /**
387
- * URL of the BigBed file.
541
+ * URL of the BigBed file. URL templates load multiple BigBed files and
542
+ * attach the template field to loaded rows.
388
543
  */
389
- url: string | ExprRef;
544
+ url: MultiUrlSourceRef;
390
545
 
391
546
  /**
392
547
  * Size of each chunk when fetching the BigBed file. Data is only fetched
@@ -408,16 +563,18 @@ export interface BamData extends DebouncedData {
408
563
  channel?: PrimaryPositionalChannel;
409
564
 
410
565
  /**
411
- * URL of the BigBed file.
566
+ * URL of the BAM file. URL templates must resolve to one URL.
412
567
  */
413
- url: string;
568
+ url: SingleUrlSourceRef;
414
569
 
415
570
  /**
416
571
  * URL of the index file.
572
+ * When `url` is a template, this can be an index URL template using the
573
+ * same placeholder and values.
417
574
  *
418
575
  * __Default value:__ `url` + `".bai"`.
419
576
  */
420
- indexUrl?: string;
577
+ indexUrl?: IndexUrlSourceRef;
421
578
 
422
579
  /**
423
580
  * Size of each chunk when fetching the BigBed file. Data is only fetched
@@ -437,16 +594,19 @@ export interface TabixData extends DebouncedData {
437
594
  channel?: PrimaryPositionalChannel;
438
595
 
439
596
  /**
440
- * Url of the bgzip compressed file.
597
+ * URL of the bgzip-compressed file. URL templates load multiple files and
598
+ * attach the template field to loaded rows.
441
599
  */
442
- url: string;
600
+ url: MultiUrlSourceRef;
443
601
 
444
602
  /**
445
- * Url of the tabix index file.
603
+ * URL of the tabix index file.
604
+ * When `url` is a template, this can be an index URL template using the
605
+ * same placeholder and values.
446
606
  *
447
607
  * __Default value:__ `url` + `".tbi"`.
448
608
  */
449
- indexUrl?: string;
609
+ indexUrl?: IndexUrlSourceRef;
450
610
 
451
611
  /**
452
612
  * Add a `chr` (boolean) or custom (string) prefix to the chromosome names
@@ -0,0 +1,246 @@
1
+ import { Align, Baseline, FontStyle, FontWeight } from "./font.js";
2
+ import { ExprRef } from "./parameter.js";
3
+
4
+ export type LegendOrient =
5
+ | "left"
6
+ | "right"
7
+ | "top"
8
+ | "bottom"
9
+ | "top-left"
10
+ | "top-right"
11
+ | "bottom-left"
12
+ | "bottom-right";
13
+
14
+ export type LegendDirection = "vertical" | "horizontal";
15
+
16
+ export type LegendTitleOrient = "top" | "bottom" | "left" | "right";
17
+
18
+ // TODO: Consider adding more Vega/Vega-Lite legend properties when concrete
19
+ // use cases appear. Known gaps include tick controls (`tickCount`,
20
+ // `tickMinStep`), explicit legend `type`, gradient sizing/styling knobs
21
+ // (`gradientLength`, `gradientThickness`, `gradientOpacity`,
22
+ // `gradientStrokeColor`, `gradientStrokeWidth`), label overlap controls, and
23
+ // symbol override properties such as `symbolFillColor`, `symbolStrokeColor`,
24
+ // `symbolOpacity`, and `symbolLimit`.
25
+
26
+ /**
27
+ * Legend properties. The initial legend surface is adapted from Vega:
28
+ * https://github.com/vega/vega/
29
+ */
30
+ export interface Legend {
31
+ /**
32
+ * Named style reference or references resolved from `config.style`. If an
33
+ * array is provided, later styles override earlier ones. Set to `null` to
34
+ * reset inherited legend styles.
35
+ */
36
+ style?: string | string[] | null;
37
+
38
+ /**
39
+ * Title text for the legend. If `null`, the title is removed.
40
+ */
41
+ title?: string | null;
42
+
43
+ /**
44
+ * The plot side or inside corner where the legend is placed. Side legends
45
+ * are placed outside the plot area. Corner legends are placed inside the
46
+ * plot area.
47
+ */
48
+ orient?: LegendOrient | ExprRef;
49
+
50
+ /**
51
+ * The direction in which legend entries are laid out.
52
+ */
53
+ direction?: LegendDirection;
54
+
55
+ /**
56
+ * External gap in pixels between the legend and the plot edge.
57
+ */
58
+ offset?: number;
59
+
60
+ /**
61
+ * Internal padding in pixels around the legend content and background.
62
+ */
63
+ padding?: number;
64
+
65
+ /**
66
+ * The number of columns in which to arrange symbol legend entries.
67
+ */
68
+ columns?: number;
69
+
70
+ /**
71
+ * Explicit values to show in the legend. For discrete symbol legends, the
72
+ * values define an ordered subset of entries. For quantitative symbol and
73
+ * gradient legends, the values define the shown representative values or
74
+ * ticks.
75
+ */
76
+ values?: (string | number | boolean)[];
77
+
78
+ /**
79
+ * Maximum label text width in pixels.
80
+ */
81
+ labelLimit?: number;
82
+
83
+ /**
84
+ * Fill color of the legend background.
85
+ */
86
+ backgroundFill?: string;
87
+
88
+ /**
89
+ * Opacity of the legend background fill.
90
+ */
91
+ backgroundFillOpacity?: number;
92
+
93
+ /**
94
+ * Stroke color of the legend background.
95
+ */
96
+ backgroundStroke?: string;
97
+
98
+ /**
99
+ * Stroke width of the legend background border.
100
+ */
101
+ backgroundStrokeWidth?: number;
102
+
103
+ /**
104
+ * Opacity of the legend background stroke.
105
+ */
106
+ backgroundStrokeOpacity?: number;
107
+
108
+ /**
109
+ * Symbol size in pixels squared.
110
+ */
111
+ symbolSize?: number;
112
+
113
+ /**
114
+ * Symbol shape.
115
+ */
116
+ symbolType?: string;
117
+
118
+ /**
119
+ * The side of the legend on which to place the title.
120
+ */
121
+ titleOrient?: LegendTitleOrient;
122
+ }
123
+
124
+ /**
125
+ * Legend defaults. The initial legend surface is adapted from Vega:
126
+ * https://github.com/vega/vega/
127
+ */
128
+ export interface LegendConfig extends Legend {
129
+ /**
130
+ * Disable automatic legend creation. Use `legend: null` on an encoding
131
+ * channel to remove that channel's legend.
132
+ *
133
+ * __Default value:__ `false`
134
+ */
135
+ disable?: boolean | ExprRef;
136
+
137
+ /**
138
+ * Spacing in pixels between legends collected into the same legend region.
139
+ */
140
+ spacing?: number;
141
+
142
+ /**
143
+ * Padding between legend rows in pixels.
144
+ */
145
+ rowPadding?: number;
146
+
147
+ /**
148
+ * Padding between legend columns in pixels.
149
+ */
150
+ columnPadding?: number;
151
+
152
+ /**
153
+ * Horizontal alignment of legend labels.
154
+ */
155
+ labelAlign?: Align;
156
+
157
+ /**
158
+ * Baseline alignment of legend labels.
159
+ */
160
+ labelBaseline?: Baseline;
161
+
162
+ /**
163
+ * Legend label color.
164
+ */
165
+ labelColor?: string;
166
+
167
+ /**
168
+ * Legend label font.
169
+ */
170
+ labelFont?: string;
171
+
172
+ /**
173
+ * Legend label font size in pixels.
174
+ */
175
+ labelFontSize?: number;
176
+
177
+ /**
178
+ * Legend label font style.
179
+ */
180
+ labelFontStyle?: FontStyle;
181
+
182
+ /**
183
+ * Legend label font weight.
184
+ */
185
+ labelFontWeight?: FontWeight;
186
+
187
+ /**
188
+ * Offset between legend symbols and labels in pixels.
189
+ */
190
+ labelOffset?: number;
191
+
192
+ /**
193
+ * Offset applied to legend symbols in pixels.
194
+ */
195
+ symbolOffset?: number;
196
+
197
+ /**
198
+ * Legend symbol stroke width in pixels.
199
+ */
200
+ symbolStrokeWidth?: number;
201
+
202
+ /**
203
+ * Base fill color for legend symbols when the legend does not encode fill.
204
+ */
205
+ symbolBaseFillColor?: string;
206
+
207
+ /**
208
+ * Base stroke color for legend symbols when the legend does not encode stroke.
209
+ */
210
+ symbolBaseStrokeColor?: string;
211
+
212
+ /**
213
+ * Legend title color.
214
+ */
215
+ titleColor?: string;
216
+
217
+ /**
218
+ * Legend title font.
219
+ */
220
+ titleFont?: string;
221
+
222
+ /**
223
+ * Legend title font size in pixels.
224
+ */
225
+ titleFontSize?: number;
226
+
227
+ /**
228
+ * Legend title font style.
229
+ */
230
+ titleFontStyle?: FontStyle;
231
+
232
+ /**
233
+ * Legend title font weight.
234
+ */
235
+ titleFontWeight?: FontWeight;
236
+
237
+ /**
238
+ * Maximum title text width in pixels.
239
+ */
240
+ titleLimit?: number;
241
+
242
+ /**
243
+ * Padding in pixels between the legend title and the legend body.
244
+ */
245
+ titlePadding?: number;
246
+ }
@@ -45,10 +45,14 @@ export interface MarkPropsBase {
45
45
  opacity?: number | ExprRef;
46
46
 
47
47
  /**
48
- * If true, the mark is clipped to the UnitView's rectangle. By default, clipping
49
- * is enabled for marks that have zoomable positional scales.
48
+ * Controls whether the mark is clipped to the UnitView's rectangle. The
49
+ * values `"x"` and `"y"` clip only in the corresponding screen-space
50
+ * direction. Inherited clipping from parent containers still applies unless
51
+ * `"never"` is used.
52
+ *
53
+ * __Default value:__ the direction of zoomable positional scales
50
54
  */
51
- clip?: boolean | "never";
55
+ clip?: boolean | "x" | "y" | "never";
52
56
 
53
57
  /**
54
58
  * Offsets of the `x` and `x2` coordinates in pixels. The offset is applied
@@ -84,9 +88,17 @@ export interface MarkPropsBase {
84
88
  */
85
89
  buildIndex?: boolean;
86
90
 
91
+ /**
92
+ * Hide point-like mark instances whose anchor falls outside the inherited
93
+ * visible range in the given screen-space direction.
94
+ *
95
+ * @internal
96
+ */
97
+ cullByVisibleRange?: boolean | "x" | "y";
98
+
87
99
  /**
88
100
  * Tooltip handler. If `null`, no tooltip is shown. If string, specifies
89
- * the [tooltip handler](https://genomespy.app/docs/api/#custom-tooltip-handlers)
101
+ * the [tooltip handler](https://genomespy.app/docs/api/embed-options/#custom-tooltip-handlers)
90
102
  * to use.
91
103
  */
92
104
  tooltip?: Tooltip;
@@ -22,6 +22,11 @@ export interface Title extends ZIndexProps {
22
22
  */
23
23
  text: string | ExprRef;
24
24
 
25
+ /**
26
+ * The subtitle text.
27
+ */
28
+ subtitle?: string | ExprRef;
29
+
25
30
  /**
26
31
  * A mark style property to apply to the title text mark. If not specified, a default style of `"group-title"` is applied.
27
32
  */
@@ -33,7 +38,11 @@ export interface Title extends ZIndexProps {
33
38
  anchor?: TitleAnchor;
34
39
 
35
40
  /**
36
- * The reference frame for the anchor position, one of `"bounds"` (to anchor relative to the full bounding box) or `"group"` (to anchor relative to the group width or height).
41
+ * The reference frame for the title anchor. `"group"` anchors the title
42
+ * along the plot area. `"bounds"` anchors the title along the full bounds,
43
+ * including axes, legends, and other reserved space.
44
+ *
45
+ * __Default value:__ `"group"`
37
46
  */
38
47
  frame?: TitleFrame;
39
48
 
@@ -42,6 +51,18 @@ export interface Title extends ZIndexProps {
42
51
  */
43
52
  offset?: number;
44
53
 
54
+ /**
55
+ * Whether the title reserves layout space outside the plot area. Reserved
56
+ * titles are placed outside axes, legends, and other guide space on the same
57
+ * side.
58
+ *
59
+ * Setting this to `false` lets the title render without affecting layout,
60
+ * enabling wilder layouts where titles may overlap nearby content.
61
+ *
62
+ * __Default value:__ `true`
63
+ */
64
+ reserve?: boolean;
65
+
45
66
  /**
46
67
  * Z-order of the title relative to the view content.
47
68
  *
@@ -111,4 +132,40 @@ export interface Title extends ZIndexProps {
111
132
  * This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
112
133
  */
113
134
  fontWeight?: FontWeight;
135
+
136
+ // ---------- Subtitle Text ----------
137
+ /**
138
+ * Text color for subtitle text.
139
+ */
140
+ subtitleColor?: string | ExprRef;
141
+
142
+ /**
143
+ * Font name for subtitle text.
144
+ */
145
+ subtitleFont?: string;
146
+
147
+ /**
148
+ * Font size in pixels for subtitle text.
149
+ *
150
+ * @minimum 0
151
+ */
152
+ subtitleFontSize?: number | ExprRef;
153
+
154
+ /**
155
+ * Font style for subtitle text.
156
+ */
157
+ subtitleFontStyle?: FontStyle;
158
+
159
+ /**
160
+ * Font weight for subtitle text.
161
+ * This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).
162
+ */
163
+ subtitleFontWeight?: FontWeight;
164
+
165
+ /**
166
+ * Padding in pixels between title and subtitle text.
167
+ *
168
+ * __Default value:__ `3`
169
+ */
170
+ subtitlePadding?: number;
114
171
  }