@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
@@ -0,0 +1,41 @@
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
+ #count = 0;
7
+
8
+ /** @type {() => void} */
9
+ #onResume;
10
+
11
+ /**
12
+ * @param {() => void} [onResume]
13
+ */
14
+ constructor(onResume = () => undefined) {
15
+ this.#onResume = onResume;
16
+ }
17
+
18
+ get active() {
19
+ return this.#count > 0;
20
+ }
21
+
22
+ /**
23
+ * @returns {() => void}
24
+ */
25
+ suspend() {
26
+ this.#count += 1;
27
+ let released = false;
28
+
29
+ return () => {
30
+ if (released) {
31
+ return;
32
+ }
33
+
34
+ released = true;
35
+ this.#count -= 1;
36
+ if (this.#count == 0) {
37
+ this.#onResume();
38
+ }
39
+ };
40
+ }
41
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"axisGridView.d.ts","sourceRoot":"","sources":["../../../src/view/axisGridView.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH;;;;;;GAMG;AACH;IACI;;;;;;;OAOG;IACH,uBAPW,IAAI,QAEJ,MAAM,WADN,OAAO,yBAAyB,EAAE,OAAO,gBAEzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,YAC3B,OAAO,WAAW,EAAE,WAAW,EAmBzC;IAJG,0CAA0B;IAM9B,kDAEC;CAKJ;gCA9CY,OAAO,oBAAoB,EAAE,wBAAwB;iCACrD,OAAO,iBAAiB,EAAE,kBAAkB;;;;mBAM5C,OAAO,WAAW,EAAE,OAAO;;;;mBAC3B,OAAO,iBAAiB,EAAE,IAAI;;;;yBAC9B,OAAO,iBAAiB,EAAE,UAAU;sBAd3B,gBAAgB"}
1
+ {"version":3,"file":"axisGridView.d.ts","sourceRoot":"","sources":["../../../src/view/axisGridView.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH;;;;;;GAMG;AACH;IACI;;;;;;;OAOG;IACH,uBAPW,IAAI,QAEJ,MAAM,WADN,OAAO,yBAAyB,EAAE,OAAO,gBAEzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,YAC3B,OAAO,WAAW,EAAE,WAAW,EAgBzC;IAJG,0CAA0B;IAM9B,kDAEC;CAKJ;gCA3CY,OAAO,oBAAoB,EAAE,wBAAwB;iCACrD,OAAO,iBAAiB,EAAE,kBAAkB;;;;mBAM5C,OAAO,WAAW,EAAE,OAAO;;;;mBAC3B,OAAO,iBAAiB,EAAE,IAAI;;;;yBAC9B,OAAO,iBAAiB,EAAE,UAAU;sBAd3B,gBAAgB"}
@@ -30,10 +30,7 @@ export default class AxisGridView extends LayerView {
30
30
  layoutParent,
31
31
  dataParent,
32
32
  `axisGrid_${axisProps.orient}`,
33
- {
34
- blockEncodingInheritance: true,
35
- ...options,
36
- }
33
+ options
37
34
  );
38
35
 
39
36
  this.axisProps = axisProps;
@@ -2,6 +2,14 @@
2
2
  * @param {AxisOrient} slot
3
3
  */
4
4
  export function orient2channel(slot: import("../spec/axis.js").AxisOrient): import("../spec/channel.js").PrimaryPositionalChannel;
5
+ /**
6
+ * Returns the horizontal or vertical space reserved by an outside axis.
7
+ * Inside axes are drawn over the plot and therefore reserve no external space.
8
+ *
9
+ * @param {AxisView | undefined} axisView
10
+ * @returns {number}
11
+ */
12
+ export function getExternalAxisOverhang(axisView: AxisView | undefined): number;
5
13
  /**
6
14
  * @param {GenomeAxis} axisProps
7
15
  * @param {string} type
@@ -31,6 +39,9 @@ export default class AxisView extends LayerView<import("../spec/view.js").LayerS
31
39
  * @typedef {import("../spec/axis.js").GenomeAxis} GenomeAxis
32
40
  * @typedef {import("../spec/axis.js").AxisOrient} AxisOrient
33
41
  * @typedef {import("./layout/flexLayout.js").SizeDef} SizeDef
42
+ * @typedef {import("./view.js").ViewOptions & {
43
+ * labelClipPolicy?: AxisLabelClipPolicy
44
+ * }} AxisViewOptions
34
45
  */
35
46
  /**
36
47
  * @param {Axis} axisProps
@@ -38,12 +49,17 @@ export default class AxisView extends LayerView<import("../spec/view.js").LayerS
38
49
  * @param {string} type Data type (quantitative, ..., locus)
39
50
  * @param {import("./containerView.js").default} layoutParent
40
51
  * @param {import("./view.js").default} dataParent
41
- * @param {import("./view.js").ViewOptions} [options]
52
+ * @param {AxisViewOptions} [options]
42
53
  */
43
- constructor(axisProps: import("../spec/axis.js").Axis, type: string, context: import("../types/viewContext.js").default, layoutParent: import("./containerView.js").default, dataParent: import("./view.js").default, options?: import("./view.js").ViewOptions);
54
+ constructor(axisProps: import("../spec/axis.js").Axis, type: string, context: import("../types/viewContext.js").default, layoutParent: import("./containerView.js").default, dataParent: import("./view.js").default, options?: import("../types/viewContext.js").ViewOptions & {
55
+ labelClipPolicy?: AxisLabelClipPolicy;
56
+ });
57
+ /** @type {AxisLabelClipPolicy} */
58
+ labelClipPolicy: AxisLabelClipPolicy;
44
59
  axisProps: import("../spec/axis.js").Axis | import("../spec/axis.js").GenomeAxis;
45
60
  getPerpendicularSize(): number;
46
61
  #private;
47
62
  }
63
+ export type AxisLabelClipPolicy = "pixel" | "anchor";
48
64
  import LayerView from "./layerView.js";
49
65
  //# sourceMappingURL=axisView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"axisView.d.ts","sourceRoot":"","sources":["../../../src/view/axisView.js"],"names":[],"mappings":"AAuCA;;GAEG;AACH,kIAEC;AAshBD;;;;GAIG;AACH,wFAHW,MAAM,uCAqNhB;AAnwBD;;GAEG;AACH,8BAFU,MAAM,CAAC,OAAO,oBAAoB,EAAE,wBAAwB,EAAE,sCAAY,CAAC,CAKnF;AAEF;;GAEG;AACH,8BAFU,MAAM,uCAAa,OAAO,oBAAoB,EAAE,wBAAwB,CAAC,CAMjF;AASF;;;;;GAKG;AACH;IAeI;;;;;;;;OAQG;IAEH;;;;;;;OAOG;IACH,6DALW,MAAM,WADN,OAAO,yBAAyB,EAAE,OAAO,gBAEzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,YAC3B,OAAO,WAAW,EAAE,WAAW,EAuDzC;IATG,iFAA8B;IA+ClC,+BAEC;;CAuEJ;sBAzPqB,gBAAgB"}
1
+ {"version":3,"file":"axisView.d.ts","sourceRoot":"","sources":["../../../src/view/axisView.js"],"names":[],"mappings":"AA8CA;;GAEG;AACH,kIAEC;AAyCD;;;;;;GAMG;AACH,kDAHW,QAAQ,GAAG,SAAS,GAClB,MAAM,CAWlB;AAwlBD;;;;GAIG;AACH,wFAHW,MAAM,uCA4LhB;AAr2BD;;GAEG;AACH,8BAFU,MAAM,CAAC,OAAO,oBAAoB,EAAE,wBAAwB,EAAE,sCAAY,CAAC,CAKnF;AAEF;;GAEG;AACH,8BAFU,MAAM,uCAAa,OAAO,oBAAoB,EAAE,wBAAwB,CAAC,CAMjF;AAkEF;;;;;GAKG;AACH;IAeI;;;;;;;;;;;OAWG;IAEH;;;;;;;OAOG;IACH,6DALW,MAAM,WADN,OAAO,yBAAyB,EAAE,OAAO,gBAEzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO;0BATb,mBAAmB;OAwE3C;IAZG,kCAAkC;IAClC,iBADW,mBAAmB,CAC4B;IAE1D,iFAA8B;IA+ClC,+BAEC;;CA8EJ;kCAxTY,OAAO,GAAG,QAAQ;sBAhBT,gBAAgB"}
@@ -1,8 +1,11 @@
1
+ import { isContinuous } from "vega-scale";
2
+
1
3
  import LayerView from "./layerView.js";
2
4
  import { FlexDimensions } from "./layout/flexLayout.js";
3
5
  import UnitView from "./unitView.js";
4
6
  import { markViewAsChrome, markViewAsNonAddressable } from "./viewSelectors.js";
5
7
  import { getConfiguredAxisDefaults } from "../config/axisConfig.js";
8
+ import { getProjectedTextExtent, getTextHeight } from "../fonts/textMetrics.js";
6
9
 
7
10
  const CHROM_LAYER_NAME = "chromosome_ticks_and_labels";
8
11
  const LABELS_LAYER_NAME = "labels_main";
@@ -12,6 +15,10 @@ const LABEL_WIDTH_FIELD = "_labelWidth";
12
15
  const Y_AXIS_LABEL_HEURISTIC_PX = 10;
13
16
  const AUTO_EXTENT_GROW_THRESHOLD_PX = 2;
14
17
 
18
+ /**
19
+ * @typedef {"pixel" | "anchor"} AxisLabelClipPolicy
20
+ */
21
+
15
22
  /**
16
23
  * @param {import("../spec/channel.js").PrimaryPositionalChannel} channel
17
24
  * @returns {import("../spec/channel.js").PrimaryPositionalChannel}
@@ -44,6 +51,63 @@ export function orient2channel(slot) {
44
51
  return ORIENT_CHANNELS[slot];
45
52
  }
46
53
 
54
+ /**
55
+ * @param {AxisOrient} orient
56
+ * @returns {AxisOrient}
57
+ */
58
+ function getOppositeOrient(orient) {
59
+ switch (orient) {
60
+ case "left":
61
+ return "right";
62
+ case "right":
63
+ return "left";
64
+ case "top":
65
+ return "bottom";
66
+ case "bottom":
67
+ return "top";
68
+ default:
69
+ throw new Error("Invalid axis orient: " + orient);
70
+ }
71
+ }
72
+
73
+ /**
74
+ * @param {Axis} axisProps
75
+ */
76
+ function getAxisGeometry(axisProps) {
77
+ const tickSide =
78
+ axisProps.placement === "inside"
79
+ ? getOppositeOrient(axisProps.orient)
80
+ : axisProps.orient;
81
+
82
+ const anchor = tickSide == "bottom" || tickSide == "left" ? 1 : 0;
83
+ const offsetDirection =
84
+ tickSide == "bottom" || tickSide == "right" ? 1 : -1;
85
+
86
+ return {
87
+ tickSide,
88
+ anchor,
89
+ offsetDirection,
90
+ };
91
+ }
92
+
93
+ /**
94
+ * Returns the horizontal or vertical space reserved by an outside axis.
95
+ * Inside axes are drawn over the plot and therefore reserve no external space.
96
+ *
97
+ * @param {AxisView | undefined} axisView
98
+ * @returns {number}
99
+ */
100
+ export function getExternalAxisOverhang(axisView) {
101
+ if (!axisView || axisView.axisProps.placement === "inside") {
102
+ return 0;
103
+ }
104
+
105
+ return Math.max(
106
+ axisView.getPerpendicularSize() + (axisView.axisProps.offset ?? 0),
107
+ 0
108
+ );
109
+ }
110
+
47
111
  /**
48
112
  * An internal view that renders an axis.
49
113
  *
@@ -73,6 +137,9 @@ export default class AxisView extends LayerView {
73
137
  * @typedef {import("../spec/axis.js").GenomeAxis} GenomeAxis
74
138
  * @typedef {import("../spec/axis.js").AxisOrient} AxisOrient
75
139
  * @typedef {import("./layout/flexLayout.js").SizeDef} SizeDef
140
+ * @typedef {import("./view.js").ViewOptions & {
141
+ * labelClipPolicy?: AxisLabelClipPolicy
142
+ * }} AxisViewOptions
76
143
  */
77
144
 
78
145
  /**
@@ -81,7 +148,7 @@ export default class AxisView extends LayerView {
81
148
  * @param {string} type Data type (quantitative, ..., locus)
82
149
  * @param {import("./containerView.js").default} layoutParent
83
150
  * @param {import("./view.js").default} dataParent
84
- * @param {import("./view.js").ViewOptions} [options]
151
+ * @param {AxisViewOptions} [options]
85
152
  */
86
153
  constructor(axisProps, type, context, layoutParent, dataParent, options) {
87
154
  const channel = orient2channel(axisProps.orient);
@@ -101,32 +168,39 @@ export default class AxisView extends LayerView {
101
168
  ...axisProps,
102
169
  };
103
170
 
171
+ // Now the presence of genomeAxis is based on field type, not scale type.
172
+ // TODO: Use scale instead. However, it would make the initialization much more
173
+ // complex because scales are not available before scale resolution.
174
+ const genomeAxis = type == "locus";
175
+
104
176
  /** @type {Axis | GenomeAxis} */
105
177
  const fullAxisProps = {
106
178
  ...configuredDefaults,
107
179
  ...getDefaultAngleAndAlign(type, preliminaryAxisProps),
108
180
  ...axisProps,
181
+ ...(genomeAxis
182
+ ? getFixedGenomeAxisProps(preliminaryAxisProps)
183
+ : {}),
109
184
  };
110
185
 
111
- // Now the presence of genomeAxis is based on field type, not scale type.
112
- // TODO: Use scale instead. However, it would make the initialization much more
113
- // complex because scales are not available before scale resolution.
114
- const genomeAxis = type == "locus";
115
-
116
186
  super(
117
187
  genomeAxis
118
188
  ? createGenomeAxis(fullAxisProps, type)
119
- : createAxis(fullAxisProps, type),
189
+ : createAxis(
190
+ fullAxisProps,
191
+ type,
192
+ options?.labelClipPolicy ?? "pixel"
193
+ ),
120
194
  context,
121
195
  layoutParent,
122
196
  dataParent,
123
197
  `axis_${axisProps.orient}`,
124
- {
125
- blockEncodingInheritance: true,
126
- ...options,
127
- }
198
+ options
128
199
  );
129
200
 
201
+ /** @type {AxisLabelClipPolicy} */
202
+ this.labelClipPolicy = options?.labelClipPolicy ?? "pixel";
203
+
130
204
  this.axisProps = fullAxisProps;
131
205
  this.#effectiveExtent = getExtent(fullAxisProps);
132
206
  this.#axisExtentSetter = this.paramRuntime.allocateSetter(
@@ -225,6 +299,13 @@ export default class AxisView extends LayerView {
225
299
  return;
226
300
  }
227
301
 
302
+ if (scaleResolution) {
303
+ const scale = scaleResolution.getScale();
304
+ if (hasDegenerateContinuousDomain(scale)) {
305
+ return;
306
+ }
307
+ }
308
+
228
309
  const measuredLabelExtent = getMeasuredLabelExtent(
229
310
  this.axisProps,
230
311
  this.context,
@@ -249,6 +330,18 @@ export default class AxisView extends LayerView {
249
330
  }
250
331
  }
251
332
 
333
+ /**
334
+ * @param {import("../types/encoder.js").VegaScale} scale
335
+ */
336
+ function hasDegenerateContinuousDomain(scale) {
337
+ const domain = /** @type {unknown[]} */ (scale.domain());
338
+ return (
339
+ isContinuous(scale.type) &&
340
+ domain.length >= 2 &&
341
+ domain.every((value) => value === domain[0])
342
+ );
343
+ }
344
+
252
345
  /**
253
346
  * @param {Axis} axisProps
254
347
  * @param {number} [measuredLabelExtent]
@@ -335,28 +428,48 @@ function getMeasuredLabelExtent(axisProps, context, labelsView) {
335
428
  return undefined;
336
429
  }
337
430
 
338
- const labelHeight =
339
- ((metrics.capHeight + metrics.descent) / metrics.common.base) *
340
- axisProps.labelFontSize;
341
-
342
- const radians = (axisProps.labelAngle * Math.PI) / 180;
343
- const absSin = Math.abs(Math.sin(radians));
344
- const absCos = Math.abs(Math.cos(radians));
345
-
346
- const perpendicularExtent =
347
- orient2channel(axisProps.orient) == "x"
348
- ? maxWidth * absSin + labelHeight * absCos
349
- : maxWidth * absCos + labelHeight * absSin;
431
+ const labelHeight = getTextHeight(metrics, axisProps.labelFontSize);
432
+ const perpendicularExtent = getProjectedTextExtent(
433
+ { width: maxWidth, height: labelHeight },
434
+ axisProps.labelAngle,
435
+ orient2channel(axisProps.orient) == "x" ? "vertical" : "horizontal"
436
+ );
350
437
 
351
438
  return Math.ceil(perpendicularExtent);
352
439
  }
353
440
 
441
+ /**
442
+ * @param {GenomeAxis} axisProps
443
+ * @returns {Axis}
444
+ */
445
+ function getFixedGenomeAxisProps(axisProps) {
446
+ switch (getAxisGeometry(axisProps).tickSide) {
447
+ case "bottom":
448
+ case "top":
449
+ return {};
450
+ case "left":
451
+ return {
452
+ labelAngle: -90,
453
+ labelAlign: "center",
454
+ labelPadding: 6,
455
+ };
456
+ case "right":
457
+ return {
458
+ labelAngle: 90,
459
+ labelAlign: "center",
460
+ labelPadding: 6,
461
+ };
462
+ default:
463
+ throw new Error("Invalid axis orient: " + axisProps.orient);
464
+ }
465
+ }
466
+
354
467
  /**
355
468
  * @param {string} type
356
469
  * @param {Axis} axisProps
357
470
  */
358
471
  function getDefaultAngleAndAlign(type, axisProps) {
359
- const orient = axisProps.orient;
472
+ const orient = getAxisGeometry(axisProps).tickSide;
360
473
  const discrete = type == "nominal" || type == "ordinal";
361
474
 
362
475
  /** @type {import("../spec/font.js").Align} */
@@ -400,9 +513,10 @@ function getDefaultAngleAndAlign(type, axisProps) {
400
513
  /**
401
514
  * @param {Axis} axisProps
402
515
  * @param {string} type
516
+ * @param {"pixel" | "anchor"} labelClipPolicy
403
517
  * @returns {LayerSpec}
404
518
  */
405
- function createAxis(axisProps, type) {
519
+ function createAxis(axisProps, type, labelClipPolicy = "pixel") {
406
520
  // TODO: Ensure that no channels except the positional ones are shared
407
521
 
408
522
  const ap = axisProps;
@@ -410,10 +524,7 @@ function createAxis(axisProps, type) {
410
524
  const main = orient2channel(ap.orient);
411
525
  const secondary = getPerpendicularChannel(main);
412
526
 
413
- const offsetDirection =
414
- ap.orient == "bottom" || ap.orient == "right" ? 1 : -1;
415
-
416
- const anchor = ap.orient == "bottom" || ap.orient == "left" ? 1 : 0;
527
+ const { anchor, offsetDirection, tickSide } = getAxisGeometry(ap);
417
528
 
418
529
  const makeMainDomainDef = () => ({
419
530
  field: "value",
@@ -455,7 +566,8 @@ function createAxis(axisProps, type) {
455
566
  ],
456
567
  mark: {
457
568
  type: "text",
458
- clip: false,
569
+ clip: labelClipPolicy === "anchor" ? "never" : false,
570
+ cullByVisibleRange: labelClipPolicy === "anchor" ? main : undefined,
459
571
  align: ap.labelAlign,
460
572
  angle: ap.labelAngle,
461
573
  baseline: ap.labelBaseline,
@@ -504,23 +616,41 @@ function createAxis(axisProps, type) {
504
616
  /**
505
617
  * @return {import("../spec/view.js").UnitSpec}
506
618
  */
507
- const createTitle = () => ({
508
- name: "title",
509
- data: { values: [{}] },
510
- mark: {
511
- type: "text",
512
- clip: false,
513
- align: "center",
514
- baseline: ap.orient == "bottom" ? "bottom" : "top",
515
- angle: [0, 90, 0, -90][
516
- ["top", "right", "bottom", "left"].indexOf(ap.orient)
517
- ],
518
- text: ap.title,
519
- color: ap.titleColor,
520
- [main]: 0.5,
521
- [secondary]: 1 - anchor,
522
- },
523
- });
619
+ const createTitle = () => {
620
+ /** @type {Partial<import("../spec/mark.js").TextProps>} */
621
+ const rangedTitleProps =
622
+ ap.titleFit === "range"
623
+ ? {
624
+ [main]: 0,
625
+ [main + "2"]: 1,
626
+ [main === "x" ? "flushX" : "flushY"]: true,
627
+ }
628
+ : {
629
+ [main]: 0.5,
630
+ };
631
+
632
+ return {
633
+ name: "title",
634
+ data: { values: [{}] },
635
+ mark: {
636
+ ...rangedTitleProps,
637
+ type: "text",
638
+ clip: false,
639
+ align: "center",
640
+ baseline: tickSide == "bottom" ? "bottom" : "top",
641
+ angle: [0, 90, 0, -90][
642
+ ["top", "right", "bottom", "left"].indexOf(tickSide)
643
+ ],
644
+ text: ap.title,
645
+ color: ap.titleColor,
646
+ font: ap.titleFont,
647
+ size: ap.titleFontSize,
648
+ fontStyle: ap.titleFontStyle,
649
+ fontWeight: ap.titleFontWeight,
650
+ [secondary]: 1 - anchor,
651
+ },
652
+ };
653
+ };
524
654
 
525
655
  /**
526
656
  * @return {import("../spec/view.js").LayerSpec}
@@ -587,7 +717,7 @@ export function createGenomeAxis(axisProps, type) {
587
717
  const main = orient2channel(ap.orient);
588
718
  const secondary = getPerpendicularChannel(main);
589
719
 
590
- const anchor = ap.orient == "bottom" || ap.orient == "left" ? 1 : 0;
720
+ const { anchor, tickSide } = getAxisGeometry(ap);
591
721
 
592
722
  /**
593
723
  * @return {import("../spec/view.js").UnitSpec}
@@ -615,7 +745,7 @@ export function createGenomeAxis(axisProps, type) {
615
745
  const createChromosomeLabels = () => {
616
746
  /** @type {Partial<import("../spec/mark.js").TextProps>} */
617
747
  let chromLabelMarkProps;
618
- switch (ap.orient) {
748
+ switch (tickSide) {
619
749
  case "top":
620
750
  chromLabelMarkProps = {
621
751
  y: 0,
@@ -691,36 +821,11 @@ export function createGenomeAxis(axisProps, type) {
691
821
  return labels;
692
822
  };
693
823
 
694
- /** @type {Axis} */
695
- let fixedAxisProps;
696
- switch (ap.orient) {
697
- case "bottom":
698
- case "top":
699
- fixedAxisProps = {};
700
- break;
701
- case "left":
702
- fixedAxisProps = {
703
- labelAngle: -90,
704
- labelAlign: "center",
705
- labelPadding: 6,
706
- };
707
- break;
708
- case "right":
709
- fixedAxisProps = {
710
- labelAngle: 90,
711
- labelAlign: "center",
712
- labelPadding: 6,
713
- };
714
- break;
715
- default:
716
- fixedAxisProps = {};
717
- }
718
-
719
824
  // Create an ordinary axis
720
825
  const axisSpec = createAxis(
721
826
  {
722
827
  ...axisProps,
723
- ...fixedAxisProps,
828
+ ...getFixedGenomeAxisProps(axisProps),
724
829
  // TODO: Allow the user to override fixedAxisProps
725
830
  },
726
831
  type
@@ -21,17 +21,25 @@ export default class ConcatView<TSpec extends import("../spec/view.js").AnyConca
21
21
  * Callers should prefer this over direct GridView insertion to ensure
22
22
  * dataflow initialization, axis wiring, and layout reflow are handled.
23
23
  *
24
- * @param {import("../spec/view.js").ViewSpec} childSpec
24
+ * @param {import("../spec/view.js").ViewSpec | import("../spec/view.js").ImportSpec} childSpec
25
25
  * @param {number} [index]
26
26
  * @returns {Promise<import("./view.js").default>}
27
27
  */
28
- addChildSpec(childSpec: import("../spec/view.js").ViewSpec, index?: number): Promise<import("./view.js").default>;
28
+ addChildSpec(childSpec: import("../spec/view.js").ViewSpec | import("../spec/view.js").ImportSpec, index?: number): Promise<import("./view.js").default>;
29
29
  /**
30
30
  * Removes a child by index. Intended for post-initialization updates.
31
31
  *
32
32
  * @param {number} index
33
33
  */
34
34
  removeChildAt(index: number): Promise<void>;
35
+ /**
36
+ * Moves a child within the concat container without recreating it.
37
+ *
38
+ * @param {number} fromIndex
39
+ * @param {number} index Destination index after temporarily removing the child.
40
+ * @returns {Promise<void>}
41
+ */
42
+ moveChildAt(fromIndex: number, index: number): Promise<void>;
35
43
  #private;
36
44
  }
37
45
  import GridView from "./gridView/gridView.js";
@@ -1 +1 @@
1
- {"version":3,"file":"concatView.d.ts","sourceRoot":"","sources":["../../../src/view/concatView.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,gCAHwD,KAAK,SAAhD,OAAQ,iBAAiB,EAAE,aAAc;IAIlD;;;;;;;;OAQG;IACH,kBAPW,KAAK,WACL,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAkBzC;IA6BD;;;;;;;;;OASG;IACH,wBAJW,OAAO,iBAAiB,EAAE,QAAQ,UAClC,MAAM,GACJ,OAAO,CAAC,OAAO,WAAW,EAAE,OAAO,CAAC,CAIhD;IAED;;;;OAIG;IACH,qBAFW,MAAM,iBAIhB;;CA2EJ;qBAhKoB,wBAAwB"}
1
+ {"version":3,"file":"concatView.d.ts","sourceRoot":"","sources":["../../../src/view/concatView.js"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,gCAHwD,KAAK,SAAhD,OAAQ,iBAAiB,EAAE,aAAc;IAIlD;;;;;;;;OAQG;IACH,kBAPW,KAAK,WACL,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAkBzC;IAsCD;;;;;;;;;OASG;IACH,wBAJW,OAAO,iBAAiB,EAAE,QAAQ,GAAG,OAAO,iBAAiB,EAAE,UAAU,UACzE,MAAM,GACJ,OAAO,CAAC,OAAO,WAAW,EAAE,OAAO,CAAC,CAIhD;IAED;;;;OAIG;IACH,qBAFW,MAAM,iBAIhB;IAED;;;;;;OAMG;IACH,uBAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAYzB;;CAmFJ;qBArMoB,wBAAwB"}
@@ -5,6 +5,7 @@ import {
5
5
  } from "./viewSpecGuards.js";
6
6
  import GridView from "./gridView/gridView.js";
7
7
  import ContainerMutationHelper from "./containerMutationHelper.js";
8
+ import { moveArrayItem } from "../utils/arrayUtils.js";
8
9
 
9
10
  /**
10
11
  * Creates a vertically or horizontally concatenated layout for children.
@@ -50,6 +51,13 @@ export default class ConcatView extends GridView {
50
51
  : isVConcatSpec(spec)
51
52
  ? spec.vconcat
52
53
  : spec.hconcat;
54
+ /** @type {import("./view.js").ViewOptions} */
55
+ const childOptions = {
56
+ inheritEncoding: true,
57
+ };
58
+ if (this.options.layoutSizeParams == "force") {
59
+ childOptions.layoutSizeParams = "force";
60
+ }
53
61
 
54
62
  this.setChildren(
55
63
  await Promise.all(
@@ -58,7 +66,9 @@ export default class ConcatView extends GridView {
58
66
  childSpec,
59
67
  this,
60
68
  this,
61
- this.getNextAutoName("grid")
69
+ this.getNextAutoName("grid"),
70
+ undefined,
71
+ childOptions
62
72
  )
63
73
  )
64
74
  )
@@ -73,7 +83,7 @@ export default class ConcatView extends GridView {
73
83
  * Callers should prefer this over direct GridView insertion to ensure
74
84
  * dataflow initialization, axis wiring, and layout reflow are handled.
75
85
  *
76
- * @param {import("../spec/view.js").ViewSpec} childSpec
86
+ * @param {import("../spec/view.js").ViewSpec | import("../spec/view.js").ImportSpec} childSpec
77
87
  * @param {number} [index]
78
88
  * @returns {Promise<import("./view.js").default>}
79
89
  */
@@ -90,6 +100,25 @@ export default class ConcatView extends GridView {
90
100
  await this.#getMutationHelper().removeChildAt(index);
91
101
  }
92
102
 
103
+ /**
104
+ * Moves a child within the concat container without recreating it.
105
+ *
106
+ * @param {number} fromIndex
107
+ * @param {number} index Destination index after temporarily removing the child.
108
+ * @returns {Promise<void>}
109
+ */
110
+ async moveChildAt(fromIndex, index) {
111
+ const mutationHelper = this.#getMutationHelper();
112
+ const { specs } = this.#getChildSpecs();
113
+ moveArrayItem(specs, fromIndex, index);
114
+ super.moveChildAt(fromIndex, index);
115
+ // Reordering can move shared guide ownership without changing existing
116
+ // child-local guides.
117
+ await this.syncGuideViews({ gridChildren: [] });
118
+ await mutationHelper.initializeUninitializedChromeViews();
119
+ this.context.requestLayoutReflow();
120
+ }
121
+
93
122
  /**
94
123
  * @param {import("../spec/channel.js").Channel} channel
95
124
  * @param {import("../spec/view.js").ResolutionTarget} resolutionType
@@ -149,18 +178,26 @@ export default class ConcatView extends GridView {
149
178
  * @returns {ContainerMutationHelper}
150
179
  */
151
180
  #getMutationHelper() {
181
+ /** @type {import("./view.js").ViewOptions} */
182
+ const createViewOptions = {
183
+ inheritEncoding: true,
184
+ };
185
+ if (this.options.layoutSizeParams == "force") {
186
+ createViewOptions.layoutSizeParams = "force";
187
+ }
188
+
152
189
  return new ContainerMutationHelper(this, {
153
190
  getChildSpecs: this.#getChildSpecs.bind(this),
154
191
  insertView: (view, index) => this.insertChildViewAt(view, index),
155
192
  removeView: (index) => super.removeChildAt(index),
156
- prepareView: async (view, _index, gridChild) => {
157
- await gridChild.createAxes();
158
- await this.syncSharedAxes();
159
- },
160
- afterRemove: async () => {
161
- await this.syncSharedAxes();
162
- },
193
+ syncMutationGuideViews: (_view, _index, gridChild) =>
194
+ this.syncGuideViews({
195
+ // Only inserted grid children need new local guides. Shared
196
+ // guides are synced by GridView regardless of this filter.
197
+ gridChildren: gridChild ? [gridChild] : [],
198
+ }),
163
199
  defaultName: () => this.getNextAutoName("grid"),
200
+ createViewOptions,
164
201
  });
165
202
  }
166
203
  }