@genome-spy/core 0.77.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 (317) 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-CRMf_I9V.js → esm-CTUHLDbv.js} +30 -30
  6. package/dist/bundle/esm-Cx-EbkOj.js +1221 -0
  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 +14102 -10810
  11. package/dist/bundle/index.js +109 -95
  12. package/dist/bundle/{parquetRead-DG_-F5j5.js → parquetRead-Cad1SOVV.js} +473 -399
  13. package/dist/schema.json +23788 -11049
  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 +8 -0
  131. package/dist/src/genomeSpy/interactionController.d.ts +4 -1
  132. package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
  133. package/dist/src/genomeSpy/interactionController.js +57 -13
  134. package/dist/src/genomeSpy/renderCoordinator.d.ts.map +1 -1
  135. package/dist/src/genomeSpy/renderCoordinator.js +25 -3
  136. package/dist/src/genomeSpy/viewDataInit.d.ts +14 -0
  137. package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
  138. package/dist/src/genomeSpy/viewDataInit.js +45 -8
  139. package/dist/src/genomeSpyBase.d.ts +6 -0
  140. package/dist/src/genomeSpyBase.d.ts.map +1 -1
  141. package/dist/src/genomeSpyBase.js +25 -4
  142. package/dist/src/gl/glslScaleGenerator.d.ts +17 -0
  143. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
  144. package/dist/src/gl/glslScaleGenerator.js +39 -2
  145. package/dist/src/gl/includes/common.glsl.js +1 -1
  146. package/dist/src/gl/vertexRangeIndex.d.ts.map +1 -1
  147. package/dist/src/gl/vertexRangeIndex.js +4 -2
  148. package/dist/src/gl/webGLHelper.d.ts +1 -1
  149. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  150. package/dist/src/gl/webGLHelper.js +13 -8
  151. package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +140 -3
  152. package/dist/src/marks/mark.d.ts +47 -4
  153. package/dist/src/marks/mark.d.ts.map +1 -1
  154. package/dist/src/marks/mark.js +158 -54
  155. package/dist/src/marks/point.d.ts.map +1 -1
  156. package/dist/src/marks/point.js +4 -0
  157. package/dist/src/marks/point.vertex.glsl.js +1 -1
  158. package/dist/src/marks/text.d.ts +1 -1
  159. package/dist/src/marks/text.d.ts.map +1 -1
  160. package/dist/src/marks/text.js +2 -7
  161. package/dist/src/marks/text.vertex.glsl.js +1 -1
  162. package/dist/src/paramRuntime/paramUtils.d.ts +43 -9
  163. package/dist/src/paramRuntime/paramUtils.d.ts.map +1 -1
  164. package/dist/src/paramRuntime/paramUtils.js +61 -1
  165. package/dist/src/paramRuntime/viewParamRuntime.d.ts +32 -0
  166. package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
  167. package/dist/src/paramRuntime/viewParamRuntime.js +63 -0
  168. package/dist/src/scales/axisResolution.d.ts +35 -0
  169. package/dist/src/scales/axisResolution.d.ts.map +1 -1
  170. package/dist/src/scales/axisResolution.js +115 -7
  171. package/dist/src/scales/domainExpressions.d.ts +21 -0
  172. package/dist/src/scales/domainExpressions.d.ts.map +1 -0
  173. package/dist/src/scales/domainExpressions.js +43 -0
  174. package/dist/src/scales/domainPlanner.d.ts +12 -1
  175. package/dist/src/scales/domainPlanner.d.ts.map +1 -1
  176. package/dist/src/scales/domainPlanner.js +55 -36
  177. package/dist/src/scales/legendResolution.d.ts +83 -0
  178. package/dist/src/scales/legendResolution.d.ts.map +1 -0
  179. package/dist/src/scales/legendResolution.js +461 -0
  180. package/dist/src/scales/scaleInstanceManager.d.ts +1 -0
  181. package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
  182. package/dist/src/scales/scaleInstanceManager.js +5 -0
  183. package/dist/src/scales/scalePropsResolver.d.ts +6 -1
  184. package/dist/src/scales/scalePropsResolver.d.ts.map +1 -1
  185. package/dist/src/scales/scalePropsResolver.js +35 -10
  186. package/dist/src/scales/scaleResolution.d.ts +52 -0
  187. package/dist/src/scales/scaleResolution.d.ts.map +1 -1
  188. package/dist/src/scales/scaleResolution.js +195 -16
  189. package/dist/src/scales/scaleRules.d.ts +10 -0
  190. package/dist/src/scales/scaleRules.d.ts.map +1 -1
  191. package/dist/src/scales/scaleRules.js +38 -1
  192. package/dist/src/scales/viewLevelGuideConfig.d.ts +53 -0
  193. package/dist/src/scales/viewLevelGuideConfig.d.ts.map +1 -0
  194. package/dist/src/scales/viewLevelGuideConfig.js +224 -0
  195. package/dist/src/scales/viewLevelScaleConfig.d.ts +45 -0
  196. package/dist/src/scales/viewLevelScaleConfig.d.ts.map +1 -0
  197. package/dist/src/scales/viewLevelScaleConfig.js +149 -0
  198. package/dist/src/spec/axis.d.ts +109 -3
  199. package/dist/src/spec/channel.d.ts +23 -4
  200. package/dist/src/spec/config.d.ts +59 -4
  201. package/dist/src/spec/data.d.ts +177 -17
  202. package/dist/src/spec/legend.d.ts +246 -0
  203. package/dist/src/spec/mark.d.ts +16 -4
  204. package/dist/src/spec/scale.d.ts +19 -6
  205. package/dist/src/spec/title.d.ts +58 -1
  206. package/dist/src/spec/transform.d.ts +149 -0
  207. package/dist/src/spec/view.d.ts +50 -6
  208. package/dist/src/styles/genome-spy.css +4 -1
  209. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  210. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  211. package/dist/src/styles/genome-spy.css.js +4 -1
  212. package/dist/src/types/embedApi.d.ts +262 -6
  213. package/dist/src/types/rendering.d.ts +19 -3
  214. package/dist/src/types/viewContext.d.ts +18 -2
  215. package/dist/src/utils/arrayUtils.d.ts +11 -0
  216. package/dist/src/utils/arrayUtils.d.ts.map +1 -1
  217. package/dist/src/utils/arrayUtils.js +23 -0
  218. package/dist/src/utils/suspension.d.ts +17 -0
  219. package/dist/src/utils/suspension.d.ts.map +1 -0
  220. package/dist/src/utils/suspension.js +41 -0
  221. package/dist/src/utils/ui/tooltip.d.ts +4 -0
  222. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  223. package/dist/src/utils/ui/tooltip.js +35 -10
  224. package/dist/src/view/axisGridView.d.ts.map +1 -1
  225. package/dist/src/view/axisGridView.js +1 -4
  226. package/dist/src/view/axisView.d.ts +18 -2
  227. package/dist/src/view/axisView.d.ts.map +1 -1
  228. package/dist/src/view/axisView.js +180 -75
  229. package/dist/src/view/concatView.d.ts +10 -2
  230. package/dist/src/view/concatView.d.ts.map +1 -1
  231. package/dist/src/view/concatView.js +46 -9
  232. package/dist/src/view/containerMutationHelper.d.ts +20 -1
  233. package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
  234. package/dist/src/view/containerMutationHelper.js +203 -32
  235. package/dist/src/view/facetView.d.ts +1 -1
  236. package/dist/src/view/gridView/gridChild.d.ts +54 -4
  237. package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
  238. package/dist/src/view/gridView/gridChild.js +301 -120
  239. package/dist/src/view/gridView/gridChildLegends.d.ts +57 -0
  240. package/dist/src/view/gridView/gridChildLegends.d.ts.map +1 -0
  241. package/dist/src/view/gridView/gridChildLegends.js +503 -0
  242. package/dist/src/view/gridView/gridView.d.ts +25 -0
  243. package/dist/src/view/gridView/gridView.d.ts.map +1 -1
  244. package/dist/src/view/gridView/gridView.js +454 -78
  245. package/dist/src/view/gridView/legendLayout.d.ts +26 -0
  246. package/dist/src/view/gridView/legendLayout.d.ts.map +1 -0
  247. package/dist/src/view/gridView/legendLayout.js +111 -0
  248. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
  249. package/dist/src/view/gridView/scrollbar.js +1 -4
  250. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
  251. package/dist/src/view/gridView/selectionRect.js +1 -4
  252. package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
  253. package/dist/src/view/gridView/separatorView.js +1 -4
  254. package/dist/src/view/layerView.d.ts +9 -2
  255. package/dist/src/view/layerView.d.ts.map +1 -1
  256. package/dist/src/view/layerView.js +18 -1
  257. package/dist/src/view/layout/flexLayout.d.ts +20 -4
  258. package/dist/src/view/layout/flexLayout.d.ts.map +1 -1
  259. package/dist/src/view/layout/flexLayout.js +331 -31
  260. package/dist/src/view/layout/rectangle.d.ts +14 -0
  261. package/dist/src/view/layout/rectangle.d.ts.map +1 -1
  262. package/dist/src/view/layout/rectangle.js +40 -0
  263. package/dist/src/view/legend/legendEntries.d.ts +20 -0
  264. package/dist/src/view/legend/legendEntries.d.ts.map +1 -0
  265. package/dist/src/view/legend/legendEntries.js +21 -0
  266. package/dist/src/view/legendView.d.ts +134 -0
  267. package/dist/src/view/legendView.d.ts.map +1 -0
  268. package/dist/src/view/legendView.js +1611 -0
  269. package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
  270. package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +26 -4
  271. package/dist/src/view/renderingContext/clipOptions.d.ts +44 -0
  272. package/dist/src/view/renderingContext/clipOptions.d.ts.map +1 -0
  273. package/dist/src/view/renderingContext/clipOptions.js +140 -0
  274. package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts.map +1 -1
  275. package/dist/src/view/renderingContext/simpleViewRenderingContext.js +12 -1
  276. package/dist/src/view/resolutionPlanner.d.ts +2 -1
  277. package/dist/src/view/resolutionPlanner.d.ts.map +1 -1
  278. package/dist/src/view/resolutionPlanner.js +89 -25
  279. package/dist/src/view/testUtils.d.ts +4 -2
  280. package/dist/src/view/testUtils.d.ts.map +1 -1
  281. package/dist/src/view/testUtils.js +29 -7
  282. package/dist/src/view/titleView.d.ts +37 -0
  283. package/dist/src/view/titleView.d.ts.map +1 -0
  284. package/dist/src/view/titleView.js +584 -0
  285. package/dist/src/view/unitView.d.ts +3 -3
  286. package/dist/src/view/unitView.d.ts.map +1 -1
  287. package/dist/src/view/unitView.js +3 -2
  288. package/dist/src/view/view.d.ts +25 -24
  289. package/dist/src/view/view.d.ts.map +1 -1
  290. package/dist/src/view/view.js +121 -16
  291. package/dist/src/view/viewFactory.d.ts +2 -5
  292. package/dist/src/view/viewFactory.d.ts.map +1 -1
  293. package/dist/src/view/viewFactory.js +1 -2
  294. package/dist/src/view/viewIdentityRegistry.d.ts +37 -0
  295. package/dist/src/view/viewIdentityRegistry.d.ts.map +1 -0
  296. package/dist/src/view/viewIdentityRegistry.js +71 -0
  297. package/dist/src/view/viewMutationAcidTestUtils.d.ts +112 -0
  298. package/dist/src/view/viewMutationAcidTestUtils.d.ts.map +1 -0
  299. package/dist/src/view/viewMutationAcidTestUtils.js +234 -0
  300. package/dist/src/view/viewMutationApi.d.ts +42 -0
  301. package/dist/src/view/viewMutationApi.d.ts.map +1 -0
  302. package/dist/src/view/viewMutationApi.js +811 -0
  303. package/dist/src/view/viewSelectors.d.ts +10 -0
  304. package/dist/src/view/viewSelectors.d.ts.map +1 -1
  305. package/dist/src/view/viewSelectors.js +23 -1
  306. package/package.json +4 -4
  307. package/dist/bundle/esm-0dYHNV_D.js +0 -121
  308. package/dist/bundle/esm-C49STiCR.js +0 -1248
  309. package/dist/bundle/esm-CscjKVDc.js +0 -1426
  310. package/dist/bundle/esm-CuMSzCHy.js +0 -298
  311. package/dist/bundle/esm-DMXpJXM4.js +0 -369
  312. package/dist/src/view/title.d.ts +0 -13
  313. package/dist/src/view/title.d.ts.map +0 -1
  314. package/dist/src/view/title.js +0 -154
  315. /package/dist/bundle/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BTmAcN-t.js} +0 -0
  316. /package/dist/bundle/{esm-CuVa5T98.js → esm-VvpZ9hsq.js} +0 -0
  317. /package/dist/bundle/{chunk-DmhlhrBa.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
@@ -0,0 +1,94 @@
1
+ import { BEHAVIOR_MODIFIES } from "../flowNode.js";
2
+ import { field } from "../../utils/field.js";
3
+ import Transform from "./transform.js";
4
+
5
+ const DEFAULT_ELLIPSIS = "...";
6
+
7
+ /**
8
+ * @param {string} text
9
+ * @param {number | undefined} limit
10
+ * @param {((text: string, fontSize?: number) => number) | undefined} measureWidth
11
+ * @param {number} fontSize
12
+ * @param {string} ellipsis
13
+ */
14
+ export function truncateText(text, limit, measureWidth, fontSize, ellipsis) {
15
+ if (limit === undefined || !Number.isFinite(limit)) {
16
+ return text;
17
+ }
18
+
19
+ if (limit <= 0) {
20
+ return "";
21
+ }
22
+
23
+ if (!measureWidth || measureWidth(text, fontSize) <= limit) {
24
+ return text;
25
+ }
26
+
27
+ if (measureWidth(ellipsis, fontSize) > limit) {
28
+ return "";
29
+ }
30
+
31
+ let low = 0;
32
+ let high = text.length;
33
+ while (low < high) {
34
+ const mid = Math.ceil((low + high) / 2);
35
+ if (measureWidth(text.slice(0, mid) + ellipsis, fontSize) <= limit) {
36
+ low = mid;
37
+ } else {
38
+ high = mid - 1;
39
+ }
40
+ }
41
+
42
+ return text.slice(0, low) + ellipsis;
43
+ }
44
+
45
+ export default class TruncateTextTransform extends Transform {
46
+ get behavior() {
47
+ return BEHAVIOR_MODIFIES;
48
+ }
49
+
50
+ /**
51
+ * @param {import("../../spec/transform.js").TruncateTextParams} params
52
+ * @param {import("../flowNode.js").ParamRuntimeProvider} paramRuntimeProvider
53
+ */
54
+ constructor(params, paramRuntimeProvider) {
55
+ super(params, paramRuntimeProvider);
56
+
57
+ this.params = params;
58
+ this.accessor = field(params.field);
59
+ this.as = params.as ?? params.field;
60
+ this.fontSize = params.fontSize;
61
+ this.ellipsis = params.ellipsis ?? DEFAULT_ELLIPSIS;
62
+ }
63
+
64
+ initialize() {
65
+ const fontManager = this.paramRuntimeProvider.context.fontManager;
66
+ this.font = this.params.font
67
+ ? fontManager.getFont(
68
+ this.params.font,
69
+ this.params.fontStyle,
70
+ this.params.fontWeight
71
+ )
72
+ : fontManager.getDefaultFont();
73
+ }
74
+
75
+ /**
76
+ * @param {any} datum
77
+ */
78
+ handle(datum) {
79
+ const value = this.accessor(datum);
80
+ if (value === undefined || value === null) {
81
+ datum[this.as] = "";
82
+ } else {
83
+ datum[this.as] = truncateText(
84
+ "" + value,
85
+ this.params.limit,
86
+ this.font.metrics?.measureWidth,
87
+ this.fontSize,
88
+ this.ellipsis
89
+ );
90
+ }
91
+
92
+ this._propagate(datum);
93
+ }
94
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @typedef {object} DataflowDebugSnapshotOptions
3
+ * @prop {(object: object) => string} getDebugId
4
+ * @prop {import("../view/view.js").default} [rootView]
5
+ */
6
+ /**
7
+ * @typedef {object} DataflowDebugSnapshot
8
+ * @prop {string[]} sourceIds
9
+ * @prop {DataflowDebugNode[]} nodes
10
+ * @prop {number} collectorCount
11
+ */
12
+ /**
13
+ * @typedef {object} DataflowDebugNode
14
+ * @prop {string} id
15
+ * @prop {string | undefined} parentId
16
+ * @prop {string[]} childIds
17
+ * @prop {string} label
18
+ * @prop {number} count
19
+ * @prop {Record<string, any> | null} first
20
+ * @prop {boolean} completed
21
+ * @prop {boolean} initialized
22
+ * @prop {boolean} disposed
23
+ * @prop {Record<string, any> | undefined} params
24
+ * @prop {string | undefined} viewId
25
+ * @prop {string | undefined} viewPath
26
+ * @prop {string[]} domainSensitiveScaleChannels
27
+ */
28
+ /**
29
+ * @param {import("../data/dataFlow.js").default | undefined} dataFlow
30
+ * @param {DataflowDebugSnapshotOptions} options
31
+ * @returns {DataflowDebugSnapshot}
32
+ */
33
+ export function createDataflowDebugSnapshot(dataFlow: import("../data/dataFlow.js").default | undefined, options: DataflowDebugSnapshotOptions): DataflowDebugSnapshot;
34
+ export type DataflowDebugSnapshotOptions = {
35
+ getDebugId: (object: object) => string;
36
+ rootView?: import("../view/view.js").default;
37
+ };
38
+ export type DataflowDebugSnapshot = {
39
+ sourceIds: string[];
40
+ nodes: DataflowDebugNode[];
41
+ collectorCount: number;
42
+ };
43
+ export type DataflowDebugNode = {
44
+ id: string;
45
+ parentId: string | undefined;
46
+ childIds: string[];
47
+ label: string;
48
+ count: number;
49
+ first: Record<string, any> | null;
50
+ completed: boolean;
51
+ initialized: boolean;
52
+ disposed: boolean;
53
+ params: Record<string, any> | undefined;
54
+ viewId: string | undefined;
55
+ viewPath: string | undefined;
56
+ domainSensitiveScaleChannels: string[];
57
+ };
58
+ //# sourceMappingURL=dataflowDebugSnapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataflowDebugSnapshot.d.ts","sourceRoot":"","sources":["../../../src/debug/dataflowDebugSnapshot.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,sDAJW,OAAO,qBAAqB,EAAE,OAAO,GAAG,SAAS,WACjD,4BAA4B,GAC1B,qBAAqB,CAmCjC;;gBAlES,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;eAC1B,OAAO,iBAAiB,EAAE,OAAO;;;eAKjC,MAAM,EAAE;WACR,iBAAiB,EAAE;oBACnB,MAAM;;;QAKN,MAAM;cACN,MAAM,GAAG,SAAS;cAClB,MAAM,EAAE;WACR,MAAM;WACN,MAAM;WACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;eAC1B,OAAO;iBACP,OAAO;cACP,OAAO;YACP,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS;YAC/B,MAAM,GAAG,SAAS;cAClB,MAAM,GAAG,SAAS;kCAClB,MAAM,EAAE"}
@@ -0,0 +1,159 @@
1
+ import { previewValue } from "./valuePreview.js";
2
+
3
+ /**
4
+ * @typedef {object} DataflowDebugSnapshotOptions
5
+ * @prop {(object: object) => string} getDebugId
6
+ * @prop {import("../view/view.js").default} [rootView]
7
+ */
8
+
9
+ /**
10
+ * @typedef {object} DataflowDebugSnapshot
11
+ * @prop {string[]} sourceIds
12
+ * @prop {DataflowDebugNode[]} nodes
13
+ * @prop {number} collectorCount
14
+ */
15
+
16
+ /**
17
+ * @typedef {object} DataflowDebugNode
18
+ * @prop {string} id
19
+ * @prop {string | undefined} parentId
20
+ * @prop {string[]} childIds
21
+ * @prop {string} label
22
+ * @prop {number} count
23
+ * @prop {Record<string, any> | null} first
24
+ * @prop {boolean} completed
25
+ * @prop {boolean} initialized
26
+ * @prop {boolean} disposed
27
+ * @prop {Record<string, any> | undefined} params
28
+ * @prop {string | undefined} viewId
29
+ * @prop {string | undefined} viewPath
30
+ * @prop {string[]} domainSensitiveScaleChannels
31
+ */
32
+
33
+ /**
34
+ * @param {import("../data/dataFlow.js").default | undefined} dataFlow
35
+ * @param {DataflowDebugSnapshotOptions} options
36
+ * @returns {DataflowDebugSnapshot}
37
+ */
38
+ export function createDataflowDebugSnapshot(dataFlow, options) {
39
+ if (!dataFlow) {
40
+ return {
41
+ sourceIds: [],
42
+ nodes: [],
43
+ collectorCount: 0,
44
+ };
45
+ }
46
+
47
+ /** @type {DataflowDebugNode[]} */
48
+ const nodes = [];
49
+ /** @type {string[]} */
50
+ const sourceIds = [];
51
+ const seen = new Set();
52
+ const flowNodeViewLookup = createFlowNodeViewLookup(options.rootView);
53
+
54
+ for (const source of dataFlow.dataSources) {
55
+ const node = visitFlowNode(
56
+ source,
57
+ undefined,
58
+ options,
59
+ nodes,
60
+ seen,
61
+ flowNodeViewLookup
62
+ );
63
+ sourceIds.push(node.id);
64
+ }
65
+
66
+ return {
67
+ sourceIds,
68
+ nodes,
69
+ collectorCount: dataFlow.collectors.length,
70
+ };
71
+ }
72
+
73
+ /**
74
+ * @param {import("../data/flowNode.js").default} flowNode
75
+ * @param {string | undefined} parentId
76
+ * @param {DataflowDebugSnapshotOptions} options
77
+ * @param {DataflowDebugNode[]} nodes
78
+ * @param {Set<object>} seen
79
+ * @param {WeakMap<object, import("../view/view.js").default>} flowNodeViewLookup
80
+ * @returns {DataflowDebugNode}
81
+ */
82
+ function visitFlowNode(
83
+ flowNode,
84
+ parentId,
85
+ options,
86
+ nodes,
87
+ seen,
88
+ flowNodeViewLookup
89
+ ) {
90
+ const id = options.getDebugId(flowNode);
91
+ if (seen.has(flowNode)) {
92
+ const existing = nodes.find((node) => node.id === id);
93
+ if (!existing) {
94
+ throw new Error("Seen flow node missing from debug snapshot.");
95
+ }
96
+ return existing;
97
+ }
98
+
99
+ seen.add(flowNode);
100
+ const state = flowNode.getDebugState();
101
+ const view = state.view ?? flowNodeViewLookup.get(flowNode);
102
+ /** @type {string[]} */
103
+ const childIds = [];
104
+ const node = {
105
+ id,
106
+ parentId,
107
+ childIds,
108
+ label: state.label,
109
+ count: state.stats.count,
110
+ first: previewValue(state.stats.first),
111
+ completed: state.completed,
112
+ initialized: state.initialized,
113
+ disposed: state.disposed,
114
+ params: state.params ? previewValue(state.params) : undefined,
115
+ viewId: view ? options.getDebugId(view) : undefined,
116
+ viewPath: view ? view.getPathString() : undefined,
117
+ domainSensitiveScaleChannels: state.domainSensitiveScaleChannels,
118
+ };
119
+ nodes.push(node);
120
+
121
+ for (const child of state.children) {
122
+ const childNode = visitFlowNode(
123
+ child,
124
+ id,
125
+ options,
126
+ nodes,
127
+ seen,
128
+ flowNodeViewLookup
129
+ );
130
+ node.childIds.push(childNode.id);
131
+ }
132
+
133
+ return node;
134
+ }
135
+
136
+ /**
137
+ * @param {import("../view/view.js").default | undefined} root
138
+ * @returns {WeakMap<object, import("../view/view.js").default>}
139
+ */
140
+ function createFlowNodeViewLookup(root) {
141
+ const lookup = new WeakMap();
142
+ if (!root) {
143
+ return lookup;
144
+ }
145
+
146
+ root.visit((view) => {
147
+ const flowHandle = view.flowHandle;
148
+ if (flowHandle?.dataSource) {
149
+ lookup.set(flowHandle.dataSource, view);
150
+ }
151
+ if (flowHandle?.node) {
152
+ lookup.set(flowHandle.node, view);
153
+ }
154
+ if (flowHandle?.collector) {
155
+ lookup.set(flowHandle.collector, view);
156
+ }
157
+ });
158
+ return lookup;
159
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @typedef {object} MarkDebugSnapshotOptions
3
+ * @prop {(object: object) => string} getDebugId
4
+ */
5
+ /**
6
+ * @typedef {object} MarkDebugSnapshot
7
+ * @prop {MarkDebugNode[]} marks
8
+ */
9
+ /**
10
+ * @typedef {object} MarkDebugNode
11
+ * @prop {string} viewId
12
+ * @prop {string} viewPath
13
+ * @prop {string} type
14
+ * @prop {boolean} ready
15
+ * @prop {boolean} pickingParticipant
16
+ * @prop {boolean} markUniformsAltered
17
+ * @prop {string[]} encodingChannels
18
+ * @prop {string[]} encoderChannels
19
+ * @prop {string[]} searchFields
20
+ * @prop {number | undefined} dataCount
21
+ * @prop {number | undefined} vertexCount
22
+ * @prop {number | undefined} allocatedVertices
23
+ * @prop {number} rangeCount
24
+ * @prop {Record<string, any>} properties
25
+ */
26
+ /**
27
+ * @param {import("../view/view.js").default | undefined} root
28
+ * @param {MarkDebugSnapshotOptions} options
29
+ * @returns {MarkDebugSnapshot}
30
+ */
31
+ export function createMarkDebugSnapshot(root: import("../view/view.js").default | undefined, options: MarkDebugSnapshotOptions): MarkDebugSnapshot;
32
+ export type MarkDebugSnapshotOptions = {
33
+ getDebugId: (object: object) => string;
34
+ };
35
+ export type MarkDebugSnapshot = {
36
+ marks: MarkDebugNode[];
37
+ };
38
+ export type MarkDebugNode = {
39
+ viewId: string;
40
+ viewPath: string;
41
+ type: string;
42
+ ready: boolean;
43
+ pickingParticipant: boolean;
44
+ markUniformsAltered: boolean;
45
+ encodingChannels: string[];
46
+ encoderChannels: string[];
47
+ searchFields: string[];
48
+ dataCount: number | undefined;
49
+ vertexCount: number | undefined;
50
+ allocatedVertices: number | undefined;
51
+ rangeCount: number;
52
+ properties: Record<string, any>;
53
+ };
54
+ //# sourceMappingURL=markDebugSnapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markDebugSnapshot.d.ts","sourceRoot":"","sources":["../../../src/debug/markDebugSnapshot.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACH,8CAJW,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,WAC7C,wBAAwB,GACtB,iBAAiB,CAuC7B;;gBApES,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;;;WAK1B,aAAa,EAAE;;;YAKf,MAAM;cACN,MAAM;UACN,MAAM;WACN,OAAO;wBACP,OAAO;yBACP,OAAO;sBACP,MAAM,EAAE;qBACR,MAAM,EAAE;kBACR,MAAM,EAAE;eACR,MAAM,GAAG,SAAS;iBAClB,MAAM,GAAG,SAAS;uBAClB,MAAM,GAAG,SAAS;gBAClB,MAAM;gBACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC"}
@@ -0,0 +1,100 @@
1
+ import ContainerView from "../view/containerView.js";
2
+ import { getEncodingSearchFields } from "../encoder/metadataChannels.js";
3
+ import { previewValue } from "./valuePreview.js";
4
+
5
+ /**
6
+ * @typedef {object} MarkDebugSnapshotOptions
7
+ * @prop {(object: object) => string} getDebugId
8
+ */
9
+
10
+ /**
11
+ * @typedef {object} MarkDebugSnapshot
12
+ * @prop {MarkDebugNode[]} marks
13
+ */
14
+
15
+ /**
16
+ * @typedef {object} MarkDebugNode
17
+ * @prop {string} viewId
18
+ * @prop {string} viewPath
19
+ * @prop {string} type
20
+ * @prop {boolean} ready
21
+ * @prop {boolean} pickingParticipant
22
+ * @prop {boolean} markUniformsAltered
23
+ * @prop {string[]} encodingChannels
24
+ * @prop {string[]} encoderChannels
25
+ * @prop {string[]} searchFields
26
+ * @prop {number | undefined} dataCount
27
+ * @prop {number | undefined} vertexCount
28
+ * @prop {number | undefined} allocatedVertices
29
+ * @prop {number} rangeCount
30
+ * @prop {Record<string, any>} properties
31
+ */
32
+
33
+ /**
34
+ * @param {import("../view/view.js").default | undefined} root
35
+ * @param {MarkDebugSnapshotOptions} options
36
+ * @returns {MarkDebugSnapshot}
37
+ */
38
+ export function createMarkDebugSnapshot(root, options) {
39
+ if (!root) {
40
+ return { marks: [] };
41
+ }
42
+
43
+ /** @type {MarkDebugNode[]} */
44
+ const marks = [];
45
+
46
+ visitViews(root, (view) => {
47
+ const mark =
48
+ /** @type {{ mark?: import("../marks/mark.js").default }} */ (
49
+ /** @type {unknown} */ (view)
50
+ ).mark;
51
+ if (!mark) {
52
+ return;
53
+ }
54
+
55
+ const state = mark.getDebugState();
56
+ marks.push({
57
+ viewId: options.getDebugId(view),
58
+ viewPath: view.getPathString(),
59
+ type: mark.getType(),
60
+ ready: Boolean(mark.isReady()),
61
+ pickingParticipant: mark.isPickingParticipant(),
62
+ markUniformsAltered: state.markUniformsAltered,
63
+ encodingChannels: Object.keys(mark.encoding),
64
+ encoderChannels: mark.encoders ? Object.keys(mark.encoders) : [],
65
+ searchFields: getEncodingSearchFields(view.getEncoding()) ?? [],
66
+ dataCount: getDataCount(view),
67
+ vertexCount: state.vertexCount,
68
+ allocatedVertices: state.allocatedVertices,
69
+ rangeCount: mark.rangeMap.size,
70
+ properties: previewValue(state.properties),
71
+ });
72
+ });
73
+
74
+ return { marks };
75
+ }
76
+
77
+ /**
78
+ * @param {import("../view/view.js").default} root
79
+ * @param {(view: import("../view/view.js").default) => void} visitor
80
+ */
81
+ function visitViews(root, visitor) {
82
+ visitor(root);
83
+ if (root instanceof ContainerView) {
84
+ for (const child of root) {
85
+ visitViews(child, visitor);
86
+ }
87
+ }
88
+ }
89
+
90
+ /**
91
+ * @param {import("../view/view.js").default} view
92
+ * @returns {number | undefined}
93
+ */
94
+ function getDataCount(view) {
95
+ const collector =
96
+ /** @type {{ getCollector?: () => import("../data/collector.js").default | undefined }} */ (
97
+ /** @type {unknown} */ (view)
98
+ ).getCollector?.();
99
+ return collector?.getItemCount();
100
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @typedef {object} ParamDebugSnapshotOptions
3
+ * @prop {(object: object) => string} getDebugId
4
+ */
5
+ /**
6
+ * @typedef {object} ParamDebugSnapshot
7
+ * @prop {ParamScopeDebugNode[]} scopes
8
+ */
9
+ /**
10
+ * @typedef {object} ParamScopeDebugNode
11
+ * @prop {string} viewId
12
+ * @prop {string} viewPath
13
+ * @prop {string} scopeId
14
+ * @prop {boolean} disposed
15
+ * @prop {ParamDebugNode[]} params
16
+ */
17
+ /**
18
+ * @typedef {object} ParamDebugNode
19
+ * @prop {string} name
20
+ * @prop {"auto" | "base" | "derived" | "selection" | "push"} kind
21
+ * @prop {any} value
22
+ * @prop {boolean} writable
23
+ * @prop {boolean} configured
24
+ * @prop {Record<string, any> | undefined} config
25
+ */
26
+ /**
27
+ * @param {import("../view/view.js").default | undefined} root
28
+ * @param {ParamDebugSnapshotOptions} options
29
+ * @returns {ParamDebugSnapshot}
30
+ */
31
+ export function createParamDebugSnapshot(root: import("../view/view.js").default | undefined, options: ParamDebugSnapshotOptions): ParamDebugSnapshot;
32
+ export type ParamDebugSnapshotOptions = {
33
+ getDebugId: (object: object) => string;
34
+ };
35
+ export type ParamDebugSnapshot = {
36
+ scopes: ParamScopeDebugNode[];
37
+ };
38
+ export type ParamScopeDebugNode = {
39
+ viewId: string;
40
+ viewPath: string;
41
+ scopeId: string;
42
+ disposed: boolean;
43
+ params: ParamDebugNode[];
44
+ };
45
+ export type ParamDebugNode = {
46
+ name: string;
47
+ kind: "auto" | "base" | "derived" | "selection" | "push";
48
+ value: any;
49
+ writable: boolean;
50
+ configured: boolean;
51
+ config: Record<string, any> | undefined;
52
+ };
53
+ //# sourceMappingURL=paramDebugSnapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paramDebugSnapshot.d.ts","sourceRoot":"","sources":["../../../src/debug/paramDebugSnapshot.js"],"names":[],"mappings":"AAGA;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,+CAJW,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,WAC7C,yBAAyB,GACvB,kBAAkB,CAqC9B;;gBAnES,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;;;YAK1B,mBAAmB,EAAE;;;YAKrB,MAAM;cACN,MAAM;aACN,MAAM;cACN,OAAO;YACP,cAAc,EAAE;;;UAKhB,MAAM;UACN,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM;WAClD,GAAG;cACH,OAAO;gBACP,OAAO;YACP,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS"}
@@ -0,0 +1,86 @@
1
+ import ContainerView from "../view/containerView.js";
2
+ import { previewValue } from "./valuePreview.js";
3
+
4
+ /**
5
+ * @typedef {object} ParamDebugSnapshotOptions
6
+ * @prop {(object: object) => string} getDebugId
7
+ */
8
+
9
+ /**
10
+ * @typedef {object} ParamDebugSnapshot
11
+ * @prop {ParamScopeDebugNode[]} scopes
12
+ */
13
+
14
+ /**
15
+ * @typedef {object} ParamScopeDebugNode
16
+ * @prop {string} viewId
17
+ * @prop {string} viewPath
18
+ * @prop {string} scopeId
19
+ * @prop {boolean} disposed
20
+ * @prop {ParamDebugNode[]} params
21
+ */
22
+
23
+ /**
24
+ * @typedef {object} ParamDebugNode
25
+ * @prop {string} name
26
+ * @prop {"auto" | "base" | "derived" | "selection" | "push"} kind
27
+ * @prop {any} value
28
+ * @prop {boolean} writable
29
+ * @prop {boolean} configured
30
+ * @prop {Record<string, any> | undefined} config
31
+ */
32
+
33
+ /**
34
+ * @param {import("../view/view.js").default | undefined} root
35
+ * @param {ParamDebugSnapshotOptions} options
36
+ * @returns {ParamDebugSnapshot}
37
+ */
38
+ export function createParamDebugSnapshot(root, options) {
39
+ if (!root) {
40
+ return { scopes: [] };
41
+ }
42
+
43
+ /** @type {ParamScopeDebugNode[]} */
44
+ const scopes = [];
45
+
46
+ visitViews(root, (view) => {
47
+ const state = view.paramRuntime.getDebugState();
48
+ scopes.push({
49
+ viewId: options.getDebugId(view),
50
+ viewPath: view.getPathString(),
51
+ scopeId: state.scopeId,
52
+ disposed: state.disposed,
53
+ params: state.params.map(
54
+ /**
55
+ * @param {import("../paramRuntime/viewParamRuntime.js").ViewParamDebugState} param
56
+ * @returns {ParamDebugNode}
57
+ */
58
+ (param) => ({
59
+ name: param.name,
60
+ kind: param.kind,
61
+ value: previewValue(param.value),
62
+ writable: param.writable,
63
+ configured: param.configured,
64
+ config: param.config
65
+ ? previewValue(param.config)
66
+ : undefined,
67
+ })
68
+ ),
69
+ });
70
+ });
71
+
72
+ return { scopes };
73
+ }
74
+
75
+ /**
76
+ * @param {import("../view/view.js").default} root
77
+ * @param {(view: import("../view/view.js").default) => void} visitor
78
+ */
79
+ function visitViews(root, visitor) {
80
+ visitor(root);
81
+ if (root instanceof ContainerView) {
82
+ for (const child of root) {
83
+ visitViews(child, visitor);
84
+ }
85
+ }
86
+ }