@genome-spy/core 0.67.0 → 0.68.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 (172) hide show
  1. package/dist/bundle/index.es.js +7641 -6313
  2. package/dist/bundle/index.js +115 -134
  3. package/dist/schema.json +534 -132
  4. package/dist/src/data/collector.d.ts +20 -0
  5. package/dist/src/data/collector.d.ts.map +1 -1
  6. package/dist/src/data/collector.js +148 -0
  7. package/dist/src/data/dataFlow.d.ts +6 -0
  8. package/dist/src/data/dataFlow.d.ts.map +1 -1
  9. package/dist/src/data/dataFlow.js +10 -0
  10. package/dist/src/data/flowInit.d.ts.map +1 -1
  11. package/dist/src/data/flowInit.js +2 -3
  12. package/dist/src/data/flowNode.d.ts +8 -0
  13. package/dist/src/data/flowNode.d.ts.map +1 -1
  14. package/dist/src/data/flowNode.js +18 -0
  15. package/dist/src/data/keyIndex.d.ts +18 -0
  16. package/dist/src/data/keyIndex.d.ts.map +1 -0
  17. package/dist/src/data/keyIndex.js +241 -0
  18. package/dist/src/data/keyIndex.test.d.ts +2 -0
  19. package/dist/src/data/keyIndex.test.d.ts.map +1 -0
  20. package/dist/src/data/sources/dataSource.d.ts.map +1 -1
  21. package/dist/src/data/sources/dataSource.js +5 -1
  22. package/dist/src/data/sources/dataSourceFactory.d.ts +14 -12
  23. package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
  24. package/dist/src/data/sources/dataSourceFactory.js +52 -16
  25. package/dist/src/data/sources/lazy/mockLazySource.d.ts +29 -0
  26. package/dist/src/data/sources/lazy/mockLazySource.d.ts.map +1 -0
  27. package/dist/src/data/sources/lazy/mockLazySource.js +44 -0
  28. package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts +22 -1
  29. package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
  30. package/dist/src/data/sources/lazy/singleAxisLazySource.js +34 -2
  31. package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
  32. package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +15 -0
  33. package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
  34. package/dist/src/data/sources/lazy/tabixSource.js +15 -5
  35. package/dist/src/data/transforms/stack.d.ts.map +1 -1
  36. package/dist/src/data/transforms/stack.js +1 -0
  37. package/dist/src/encoder/accessor.d.ts +43 -0
  38. package/dist/src/encoder/accessor.d.ts.map +1 -1
  39. package/dist/src/encoder/accessor.js +164 -0
  40. package/dist/src/encoder/encoder.d.ts +11 -2
  41. package/dist/src/encoder/encoder.d.ts.map +1 -1
  42. package/dist/src/encoder/encoder.js +24 -4
  43. package/dist/src/encoder/metadataChannels.d.ts +15 -0
  44. package/dist/src/encoder/metadataChannels.d.ts.map +1 -0
  45. package/dist/src/encoder/metadataChannels.js +65 -0
  46. package/dist/src/encoder/metadataChannels.test.d.ts +2 -0
  47. package/dist/src/encoder/metadataChannels.test.d.ts.map +1 -0
  48. package/dist/src/genome/scaleLocus.d.ts.map +1 -1
  49. package/dist/src/genome/scaleLocus.js +14 -1
  50. package/dist/src/genomeSpy/containerUi.d.ts +0 -1
  51. package/dist/src/genomeSpy/containerUi.d.ts.map +1 -1
  52. package/dist/src/genomeSpy/containerUi.js +0 -14
  53. package/dist/src/genomeSpy/loadingIndicatorManager.d.ts +3 -7
  54. package/dist/src/genomeSpy/loadingIndicatorManager.d.ts.map +1 -1
  55. package/dist/src/genomeSpy/loadingIndicatorManager.js +68 -20
  56. package/dist/src/genomeSpy/loadingStatusRegistry.d.ts +52 -0
  57. package/dist/src/genomeSpy/loadingStatusRegistry.d.ts.map +1 -0
  58. package/dist/src/genomeSpy/loadingStatusRegistry.js +86 -0
  59. package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
  60. package/dist/src/genomeSpy/viewContextFactory.js +0 -1
  61. package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
  62. package/dist/src/genomeSpy/viewDataInit.js +56 -11
  63. package/dist/src/genomeSpy.d.ts +0 -2
  64. package/dist/src/genomeSpy.d.ts.map +1 -1
  65. package/dist/src/genomeSpy.js +46 -26
  66. package/dist/src/marks/mark.d.ts.map +1 -1
  67. package/dist/src/marks/mark.js +18 -11
  68. package/dist/src/marks/markUtils.js +1 -1
  69. package/dist/src/scale/scale.d.ts +6 -1
  70. package/dist/src/scale/scale.d.ts.map +1 -1
  71. package/dist/src/scale/scale.js +83 -23
  72. package/dist/src/scales/axisResolution.d.ts.map +1 -1
  73. package/dist/src/scales/axisResolution.js +10 -0
  74. package/dist/src/scales/{scaleDomainAggregator.d.ts → domainPlanner.d.ts} +6 -3
  75. package/dist/src/scales/domainPlanner.d.ts.map +1 -0
  76. package/dist/src/scales/{scaleDomainAggregator.js → domainPlanner.js} +128 -10
  77. package/dist/src/scales/domainPlanner.test.d.ts +2 -0
  78. package/dist/src/scales/domainPlanner.test.d.ts.map +1 -0
  79. package/dist/src/scales/scaleInteractionController.d.ts +6 -0
  80. package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
  81. package/dist/src/scales/scaleInteractionController.js +41 -3
  82. package/dist/src/scales/scaleResolution.d.ts +19 -17
  83. package/dist/src/scales/scaleResolution.d.ts.map +1 -1
  84. package/dist/src/scales/scaleResolution.js +181 -70
  85. package/dist/src/scales/scaleResolution.test.d.ts.map +1 -1
  86. package/dist/src/selection/selection.d.ts +21 -0
  87. package/dist/src/selection/selection.d.ts.map +1 -1
  88. package/dist/src/selection/selection.js +82 -0
  89. package/dist/src/spec/channel.d.ts +52 -15
  90. package/dist/src/spec/data.d.ts +4 -0
  91. package/dist/src/spec/parameter.d.ts +16 -11
  92. package/dist/src/spec/testing.d.ts +12 -0
  93. package/dist/src/spec/testing.d.ts.map +1 -0
  94. package/dist/src/spec/testing.js +20 -0
  95. package/dist/src/spec/view.d.ts +45 -10
  96. package/dist/src/styles/genome-spy.css +3 -31
  97. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  98. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  99. package/dist/src/styles/genome-spy.css.js +0 -29
  100. package/dist/src/types/encoder.d.ts +37 -2
  101. package/dist/src/types/rendering.d.ts +4 -3
  102. package/dist/src/types/viewContext.d.ts +0 -14
  103. package/dist/src/utils/throttle.d.ts +4 -1
  104. package/dist/src/utils/throttle.d.ts.map +1 -1
  105. package/dist/src/utils/throttle.js +54 -23
  106. package/dist/src/utils/throttle.test.d.ts +2 -0
  107. package/dist/src/utils/throttle.test.d.ts.map +1 -0
  108. package/dist/src/utils/transition.d.ts +21 -0
  109. package/dist/src/utils/transition.d.ts.map +1 -1
  110. package/dist/src/utils/transition.js +28 -0
  111. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  112. package/dist/src/utils/ui/tooltip.js +7 -1
  113. package/dist/src/utils/ui/tooltip.test.d.ts +2 -0
  114. package/dist/src/utils/ui/tooltip.test.d.ts.map +1 -0
  115. package/dist/src/view/axisGridView.d.ts.map +1 -1
  116. package/dist/src/view/axisGridView.js +22 -5
  117. package/dist/src/view/axisView.d.ts.map +1 -1
  118. package/dist/src/view/axisView.js +20 -5
  119. package/dist/src/view/concatView.js +3 -3
  120. package/dist/src/view/containerMutationHelper.js +1 -1
  121. package/dist/src/view/containerView.d.ts +9 -5
  122. package/dist/src/view/containerView.d.ts.map +1 -1
  123. package/dist/src/view/containerView.js +34 -9
  124. package/dist/src/view/dataReadiness.d.ts +46 -0
  125. package/dist/src/view/dataReadiness.d.ts.map +1 -0
  126. package/dist/src/view/dataReadiness.js +267 -0
  127. package/dist/src/view/dataReadiness.test.d.ts +2 -0
  128. package/dist/src/view/dataReadiness.test.d.ts.map +1 -0
  129. package/dist/src/view/facetView.d.ts.map +1 -1
  130. package/dist/src/view/facetView.js +7 -5
  131. package/dist/src/view/flowBuilder.d.ts.map +1 -1
  132. package/dist/src/view/flowBuilder.js +5 -1
  133. package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
  134. package/dist/src/view/gridView/gridChild.js +8 -0
  135. package/dist/src/view/gridView/gridView.d.ts.map +1 -1
  136. package/dist/src/view/gridView/gridView.js +119 -2
  137. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
  138. package/dist/src/view/gridView/scrollbar.js +3 -0
  139. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
  140. package/dist/src/view/gridView/selectionRect.js +20 -5
  141. package/dist/src/view/gridView/separatorView.d.ts +51 -0
  142. package/dist/src/view/gridView/separatorView.d.ts.map +1 -0
  143. package/dist/src/view/gridView/separatorView.js +275 -0
  144. package/dist/src/view/layerView.js +3 -3
  145. package/dist/src/view/layout/flexLayout.d.ts +0 -30
  146. package/dist/src/view/layout/flexLayout.d.ts.map +1 -1
  147. package/dist/src/view/layout/flexLayout.js +0 -86
  148. package/dist/src/view/paramMediator.d.ts +19 -0
  149. package/dist/src/view/paramMediator.d.ts.map +1 -1
  150. package/dist/src/view/paramMediator.js +86 -19
  151. package/dist/src/view/testUtils.d.ts.map +1 -1
  152. package/dist/src/view/testUtils.js +6 -1
  153. package/dist/src/view/unitView.d.ts +8 -13
  154. package/dist/src/view/unitView.d.ts.map +1 -1
  155. package/dist/src/view/unitView.js +110 -41
  156. package/dist/src/view/view.d.ts +22 -14
  157. package/dist/src/view/view.d.ts.map +1 -1
  158. package/dist/src/view/view.js +93 -9
  159. package/dist/src/view/viewFactory.d.ts.map +1 -1
  160. package/dist/src/view/viewFactory.js +20 -1
  161. package/dist/src/view/viewSelectors.d.ts +148 -0
  162. package/dist/src/view/viewSelectors.d.ts.map +1 -0
  163. package/dist/src/view/viewSelectors.js +773 -0
  164. package/dist/src/view/viewSelectors.test.d.ts +2 -0
  165. package/dist/src/view/viewSelectors.test.d.ts.map +1 -0
  166. package/dist/src/view/viewUtils.d.ts +0 -8
  167. package/dist/src/view/viewUtils.d.ts.map +1 -1
  168. package/dist/src/view/viewUtils.js +1 -21
  169. package/package.json +3 -3
  170. package/dist/src/scales/scaleDomainAggregator.d.ts.map +0 -1
  171. package/dist/src/scales/scaleDomainAggregator.test.d.ts +0 -2
  172. package/dist/src/scales/scaleDomainAggregator.test.d.ts.map +0 -1
@@ -12,6 +12,7 @@ import coalesce from "../utils/coalesce.js";
12
12
  import { field as vegaField } from "vega-util";
13
13
  import DecoratorView from "./decoratorView.js";
14
14
  import Padding from "./layout/padding.js";
15
+ import { markViewAsNonAddressable } from "./viewSelectors.js";
15
16
 
16
17
  const DEFAULT_SPACING = 20;
17
18
 
@@ -95,15 +96,16 @@ export default class FacetView extends ContainerView {
95
96
  * @type {Record<FacetChannel, UnitView>}
96
97
  */
97
98
  this._labelViews = Object.fromEntries(
98
- FACET_CHANNELS.map((channel) => [
99
- channel,
100
- new UnitView(
99
+ FACET_CHANNELS.map((channel) => {
100
+ const labelView = new UnitView(
101
101
  createLabelViewSpec(headerConfigs[channel]),
102
102
  this.context,
103
103
  this,
104
104
  `facetLabel-${channel}`
105
- ),
106
- ])
105
+ );
106
+ markViewAsNonAddressable(labelView, { skipSubtree: true });
107
+ return [channel, labelView];
108
+ })
107
109
  );
108
110
 
109
111
  /** @type {Record<FacetChannel, FacetDimension>} */
@@ -1 +1 @@
1
- {"version":3,"file":"flowBuilder.d.ts","sourceRoot":"","sources":["../../../src/view/flowBuilder.js"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,gFALW,QAAQ,eAER,CAAC,IAAI,6BAAM,KAAK,OAAO,gCACvB,CAAC,IAAI,6BAAM,KAAK,OAAO,YAoPjC;AAuBD;;;;;;GAMG;AACH,2CAFW,OAAO,eAAe,EAAE,OAAO;;;IAuG5B;;;OAGG;;EAYhB;AAgCD;;;;;;GAMG;AACH,4BAFwB,CAAC,SAAZ,qCAAU,cAFZ,CAAC,iBACA,uCAAW;;;0BAwBG,OAAO,CAAC,QAAQ,CAAC,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAC;EAkB/E;qBA3eoB,qBAAqB;sBAPpB,sBAAsB"}
1
+ {"version":3,"file":"flowBuilder.d.ts","sourceRoot":"","sources":["../../../src/view/flowBuilder.js"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,gFALW,QAAQ,eAER,CAAC,IAAI,6BAAM,KAAK,OAAO,gCACvB,CAAC,IAAI,6BAAM,KAAK,OAAO,YAoPjC;AAuBD;;;;;;GAMG;AACH,2CAFW,OAAO,eAAe,EAAE,OAAO;;;IA2G5B;;;OAGG;;EAYhB;AAgCD;;;;;;GAMG;AACH,4BAFwB,CAAC,SAAZ,qCAAU,cAFZ,CAAC,iBACA,uCAAW;;;0BAwBG,OAAO,CAAC,QAAQ,CAAC,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAC;EAkB/E;qBA/eoB,qBAAqB;sBAPpB,sBAAsB"}
@@ -328,7 +328,11 @@ export function linearizeLocusAccess(view) {
328
328
  // that share the chromosome field and channel.
329
329
  for (const [c, channelDef] of Object.entries(encoding)) {
330
330
  const channel = /** @type {Channel} */ (c);
331
- if (isPositionalChannel(channel) && isChromPosDef(channelDef)) {
331
+ if (
332
+ isPositionalChannel(channel) &&
333
+ !Array.isArray(channelDef) &&
334
+ isChromPosDef(channelDef)
335
+ ) {
332
336
  channelsAndChromPosDefs.push({ channel, chromPosDef: channelDef });
333
337
  }
334
338
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gridChild.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridChild.js"],"names":[],"mappings":"AA4rBA;;;GAGG;AACH,iDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA8BjD;AAED;;;GAGG;AACH,uDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA6CjD;AA1vBD;IACI;;;;;;OAMG;IAEH;;;;OAIG;IACH,kBAJW,OAAO,YAAY,EAAE,OAAO,gBAC5B,OAAO,qBAAqB,EAAE,OAAO,UACrC,MAAM,EAyFhB;IAtFG,oDAAgC;IAChC,mCAAgB;IAChB,eAAoB;IAEpB,uBAAuB;IACvB,YADW,QAAQ,CACQ;IAE3B,uBAAuB;IACvB,kBADW,QAAQ,CACc;IAEjC,sFAAsF;IACtF,MADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAC/D;IAEd,+FAA+F;IAC/F,WADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAC9D;IAEnB,mFAAmF;IACnF,YADW,OAAO,CAAC,MAAM,CAAC,OAAO,gBAAgB,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAC3D;IAEpB,4BAA4B;IAC5B,eADW,aAAa,CACM;IAE9B,uBAAuB;IACvB,OADW,QAAQ,CACG;IAEtB,wBAAwB;IACxB,QADW,SAAS,CACQ;IAoZhC,sEAiBC;IAED;;OAEG;IACH,4BAwKC;IAED;;OAEG;IACH,yBAWC;IAED,uBAqBC;IAED,iCAEC;;CACJ;qBA3qBoB,gBAAgB;qBANK,gBAAgB;yBADjC,oBAAoB;sBAQvB,gBAAgB;0BACZ,oBAAoB;sBAJxB,wBAAwB;oBAF1B,sBAAsB"}
1
+ {"version":3,"file":"gridChild.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridChild.js"],"names":[],"mappings":"AAosBA;;;GAGG;AACH,iDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA8BjD;AAED;;;GAGG;AACH,uDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA6CjD;AAjwBD;IACI;;;;;;OAMG;IAEH;;;;OAIG;IACH,kBAJW,OAAO,YAAY,EAAE,OAAO,gBAC5B,OAAO,qBAAqB,EAAE,OAAO,UACrC,MAAM,EAgGhB;IA7FG,oDAAgC;IAChC,mCAAgB;IAChB,eAAoB;IAEpB,uBAAuB;IACvB,YADW,QAAQ,CACQ;IAE3B,uBAAuB;IACvB,kBADW,QAAQ,CACc;IAEjC,sFAAsF;IACtF,MADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAC/D;IAEd,+FAA+F;IAC/F,WADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAC9D;IAEnB,mFAAmF;IACnF,YADW,OAAO,CAAC,MAAM,CAAC,OAAO,gBAAgB,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAC3D;IAEpB,4BAA4B;IAC5B,eADW,aAAa,CACM;IAE9B,uBAAuB;IACvB,OADW,QAAQ,CACG;IAEtB,wBAAwB;IACxB,QADW,SAAS,CACQ;IA2ZhC,sEAiBC;IAED;;OAEG;IACH,4BAwKC;IAED;;OAEG;IACH,yBAWC;IAED,uBAqBC;IAED,iCAEC;;CACJ;qBAnrBoB,gBAAgB;qBANK,gBAAgB;yBADjC,oBAAoB;sBASvB,gBAAgB;0BACZ,oBAAoB;sBALxB,wBAAwB;oBAF1B,sBAAsB"}
@@ -14,6 +14,7 @@ import Point from "../layout/point.js";
14
14
  import Rectangle from "../layout/rectangle.js";
15
15
  import createTitle from "../title.js";
16
16
  import UnitView from "../unitView.js";
17
+ import { markViewAsNonAddressable } from "../viewSelectors.js";
17
18
  import Scrollbar from "./scrollbar.js";
18
19
  import SelectionRect from "./selectionRect.js";
19
20
 
@@ -76,6 +77,9 @@ export default class GridChild {
76
77
  blockEncodingInheritance: true,
77
78
  }
78
79
  );
80
+ markViewAsNonAddressable(this.background, {
81
+ skipSubtree: true,
82
+ });
79
83
  }
80
84
 
81
85
  const backgroundStrokeSpec = createBackgroundStroke(viewBackground);
@@ -90,6 +94,9 @@ export default class GridChild {
90
94
  blockEncodingInheritance: true,
91
95
  }
92
96
  );
97
+ markViewAsNonAddressable(this.backgroundStroke, {
98
+ skipSubtree: true,
99
+ });
93
100
  }
94
101
 
95
102
  const title = createTitle(view.spec.title);
@@ -105,6 +112,7 @@ export default class GridChild {
105
112
  }
106
113
  );
107
114
  this.title = unitView;
115
+ markViewAsNonAddressable(this.title, { skipSubtree: true });
108
116
  }
109
117
  }
110
118
 
@@ -1 +1 @@
1
- {"version":3,"file":"gridView.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridView.js"],"names":[],"mappings":"AA42BA;;GAEG;AACH,+EAUC;AAED;;;;;GAKG;AACH,4CAJW,OAAO,wBAAwB,EAAE,OAAO,UACxC,OAAO,oBAAoB,EAAE,UAAU,YACvC,QAAQ,aAmBlB;AA/3BD;;;;;;;;;;;;;;;GAeG;AACH;IAoCI;;;;;;;;;OASG;IACH,kBARW,OAAO,oBAAoB,EAAE,aAAa,WAC1C,OAAO,4BAA4B,EAAE,OAAO,gBAC5C,aAAa,kDAEb,MAAM,WACN,MAAM,YACN,OAAO,YAAY,EAAE,WAAW,EAoB1C;IARG,iDAAgB;IAOhB,uBAA0B;IAG9B;;OAEG;IACH,sDAEC;IAED;;;;;;OAMG;IACH,qDAFa,SAAS,CAIrB;IAED;;;;;;;OAOG;IACH,6DAHW,MAAM,GACJ,SAAS,CAQrB;IAED;;;;;OAKG;IACH,0DAQC;IAED;;;;;OAKG;IACH,qBAFW,MAAM,QAShB;IAeD;;OAEG;IACH,mBAFW,8BAAM,QAUhB;IAYD;;OAEG;IACH,+CAEC;IAED,yBAEC;IAED;;OAEG;IACH,sCAKC;IAED;;;;OAIG;IACH,gCAqCC;;CAwkBJ;qBAr0B0D,gBAAgB;sBADrD,wBAAwB;0BAEpB,qBAAqB;sBAIzB,gBAAgB"}
1
+ {"version":3,"file":"gridView.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridView.js"],"names":[],"mappings":"AAg9BA;;GAEG;AACH,+EAUC;AAmBD;;;;;GAKG;AACH,4CAJW,OAAO,wBAAwB,EAAE,OAAO,UACxC,OAAO,oBAAoB,EAAE,UAAU,YACvC,QAAQ,aAmBlB;AAn/BD;;;;;;;;;;;;;;;GAeG;AACH;IAuCI;;;;;;;;;OASG;IACH,kBARW,OAAO,oBAAoB,EAAE,aAAa,WAC1C,OAAO,4BAA4B,EAAE,OAAO,gBAC5C,aAAa,kDAEb,MAAM,WACN,MAAM,YACN,OAAO,YAAY,EAAE,WAAW,EAkC1C;IAtBG,iDAAgB;IAOhB,uBAA0B;IAiB9B;;OAEG;IACH,sDAEC;IAED;;;;;;OAMG;IACH,qDAFa,SAAS,CAIrB;IAED;;;;;;;OAOG;IACH,6DAHW,MAAM,GACJ,SAAS,CASrB;IAED;;;;;OAKG;IACH,0DAQC;IAED;;;;;OAKG;IACH,qBAFW,MAAM,QAUhB;IAeD;;OAEG;IACH,mBAFW,8BAAM,QAWhB;IAYD;;OAEG;IACH,+CAEC;IAED,yBAEC;IAED;;OAEG;IACH,sCAKC;IAED;;;;OAIG;IACH,gCAqCC;;CAupBJ;qBAz6B0D,gBAAgB;sBADrD,wBAAwB;0BAEpB,qBAAqB;sBAIzB,gBAAgB"}
@@ -16,6 +16,7 @@ import LayerView from "../layerView.js";
16
16
  import UnitView from "../unitView.js";
17
17
  import { interactionToZoom } from "../zoom.js";
18
18
  import GridChild from "./gridChild.js";
19
+ import SeparatorView, { resolveSeparatorProps } from "./separatorView.js";
19
20
 
20
21
  /**
21
22
  * Modeled after: https://vega.github.io/vega/docs/layout/
@@ -69,6 +70,9 @@ export default class GridView extends ContainerView {
69
70
 
70
71
  #childSerial = 0;
71
72
 
73
+ /** @type {Partial<Record<"horizontal" | "vertical", SeparatorView>>} */
74
+ #separatorViews = {};
75
+
72
76
  /**
73
77
  *
74
78
  * @param {import("../../spec/view.js").AnyConcatSpec} spec
@@ -97,6 +101,20 @@ export default class GridView extends ContainerView {
97
101
  this.#children = [];
98
102
 
99
103
  this.wrappingFacet = false;
104
+
105
+ const separatorProps = resolveSeparatorProps(spec.separator);
106
+ if (separatorProps) {
107
+ for (const direction of getSeparatorDirections(spec)) {
108
+ this.#separatorViews[direction] = new SeparatorView({
109
+ direction,
110
+ props: separatorProps,
111
+ context: this.context,
112
+ layoutParent: this,
113
+ dataParent: this,
114
+ getName: (prefix) => this.getNextAutoName(prefix),
115
+ });
116
+ }
117
+ }
100
118
  }
101
119
 
102
120
  /**
@@ -130,6 +148,7 @@ export default class GridView extends ContainerView {
130
148
  const gridChild = new GridChild(view, this, this.#childSerial);
131
149
  this.#childSerial++;
132
150
  this.#children.splice(index, 0, gridChild);
151
+ this.invalidateSizeCache();
133
152
  return gridChild;
134
153
  }
135
154
 
@@ -162,6 +181,7 @@ export default class GridView extends ContainerView {
162
181
  }
163
182
  this.#disposeGridChild(gridChild);
164
183
  this.#children.splice(index, 1);
184
+ this.invalidateSizeCache();
165
185
  }
166
186
 
167
187
  get #visibleChildren() {
@@ -188,6 +208,7 @@ export default class GridView extends ContainerView {
188
208
  for (const view of views) {
189
209
  this.appendChild(view);
190
210
  }
211
+ this.invalidateSizeCache();
191
212
  }
192
213
 
193
214
  /**
@@ -273,6 +294,10 @@ export default class GridView extends ContainerView {
273
294
  yield* gridChild.getChildren();
274
295
  }
275
296
 
297
+ for (const separatorView of Object.values(this.#separatorViews)) {
298
+ yield separatorView.view;
299
+ }
300
+
276
301
  for (const axisView of Object.values(this.#sharedAxes)) {
277
302
  yield axisView;
278
303
  }
@@ -519,8 +544,10 @@ export default class GridView extends ContainerView {
519
544
 
520
545
  context.pushView(this, coords);
521
546
 
547
+ const devicePixelRatio = context.getDevicePixelRatio();
548
+
522
549
  const flexOpts = {
523
- devicePixelRatio: context.getDevicePixelRatio(),
550
+ devicePixelRatio,
524
551
  };
525
552
  const columnFlexCoords = mapToPixelCoords(
526
553
  this.#makeFlexItems("column"),
@@ -543,6 +570,10 @@ export default class GridView extends ContainerView {
543
570
  const round = (x) =>
544
571
  Math.round(x * devicePixelRatio) / devicePixelRatio;
545
572
 
573
+ // Two-phase render: compute layout once, then render backgrounds/separators
574
+ // before gridlines/axes/marks without recomputing per-child coords.
575
+ const renderItems = [];
576
+
546
577
  for (const [i, gridChild] of this.#visibleChildren.entries()) {
547
578
  const {
548
579
  view,
@@ -619,10 +650,79 @@ export default class GridView extends ContainerView {
619
650
  ? viewportCoords.intersect(options.clipRect)
620
651
  : viewportCoords;
621
652
 
622
- background?.render(context, clippedChildCoords, {
653
+ renderItems.push({
654
+ col,
655
+ row,
656
+ view,
657
+ axes,
658
+ gridLines,
659
+ background,
660
+ backgroundStroke,
661
+ title,
662
+ selectionRect,
663
+ viewportCoords,
664
+ viewCoords,
665
+ clippedChildCoords,
666
+ viewWidth,
667
+ viewHeight,
668
+ scrollable,
669
+ gridChild,
670
+ });
671
+ }
672
+
673
+ for (const item of renderItems) {
674
+ item.background?.render(context, item.clippedChildCoords, {
623
675
  ...options,
624
676
  clipRect: undefined,
625
677
  });
678
+ }
679
+
680
+ const gridOverhang = this.#getGridOverhang();
681
+
682
+ const verticalSeparator = this.#separatorViews.vertical;
683
+ if (verticalSeparator) {
684
+ verticalSeparator.update(
685
+ columnFlexCoords,
686
+ grid.nCols,
687
+ coords,
688
+ (direction, index) => this.#getViewSlot(direction, index),
689
+ this.wrappingFacet,
690
+ gridOverhang
691
+ );
692
+ verticalSeparator.render(context, coords, options);
693
+ }
694
+
695
+ const horizontalSeparator = this.#separatorViews.horizontal;
696
+ if (horizontalSeparator) {
697
+ horizontalSeparator.update(
698
+ rowFlexCoords,
699
+ grid.nRows,
700
+ coords,
701
+ (direction, index) => this.#getViewSlot(direction, index),
702
+ this.wrappingFacet,
703
+ gridOverhang
704
+ );
705
+ horizontalSeparator.render(context, coords, options);
706
+ }
707
+
708
+ for (const item of renderItems) {
709
+ const {
710
+ view,
711
+ axes,
712
+ gridLines,
713
+ backgroundStroke,
714
+ title,
715
+ selectionRect,
716
+ viewportCoords,
717
+ viewCoords,
718
+ clippedChildCoords,
719
+ viewWidth,
720
+ viewHeight,
721
+ scrollable,
722
+ gridChild,
723
+ col,
724
+ row,
725
+ } = item;
626
726
 
627
727
  for (const gridLineView of Object.values(gridLines)) {
628
728
  gridLineView.render(context, viewportCoords, options);
@@ -889,6 +989,23 @@ export function isClippedChildren(view) {
889
989
  return clipped;
890
990
  }
891
991
 
992
+ /**
993
+ * @param {import("../../spec/view.js").AnyConcatSpec} spec
994
+ * @returns {("horizontal" | "vertical")[]}
995
+ */
996
+ function getSeparatorDirections(spec) {
997
+ // vconcat = horizontal separators, hconcat = vertical separators, concat = both
998
+ if ("vconcat" in spec) {
999
+ return ["horizontal"];
1000
+ }
1001
+
1002
+ if ("hconcat" in spec) {
1003
+ return ["vertical"];
1004
+ }
1005
+
1006
+ return ["horizontal", "vertical"];
1007
+ }
1008
+
892
1009
  /**
893
1010
  *
894
1011
  * @param {import("../layout/rectangle.js").default} coords
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/scrollbar.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH;IAwBI;;;;OAIG;IACH,uBAJW,OAAO,gBAAgB,EAAE,OAAO,mBAChC,eAAe,YACf;QAAE,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,EAwH/D;IAvID;;;;;;OAMG;IACH,uBAAmB;IAiDf;;;;MAAoB;IAiFxB,2BAEC;IAED;;;OAGG;IACH,yBAHW,MAAM,6BACN;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,QAYtD;IAqFD;;;;;;;;;OASG;IACH,gCAHW,SAAS,iBACT,SAAS,QASnB;IAMG;;;;MAWC;;CAER;;;;;8BAlSY,YAAY,GAAG,UAAU;qBANjB,gBAAgB;sBADf,wBAAwB"}
1
+ {"version":3,"file":"scrollbar.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/scrollbar.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH;IAwBI;;;;OAIG;IACH,uBAJW,OAAO,gBAAgB,EAAE,OAAO,mBAChC,eAAe,YACf;QAAE,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,EA0H/D;IAzID;;;;;;OAMG;IACH,uBAAmB;IAmDf;;;;MAAoB;IAiFxB,2BAEC;IAED;;;OAGG;IACH,yBAHW,MAAM,6BACN;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,QAYtD;IAqFD;;;;;;;;;OASG;IACH,gCAHW,SAAS,iBACT,SAAS,QASnB;IAMG;;;;MAWC;;CAER;;;;;8BApSY,YAAY,GAAG,UAAU;qBAPjB,gBAAgB;sBADf,wBAAwB"}
@@ -2,6 +2,7 @@ import clamp from "../../utils/clamp.js";
2
2
  import { makeLerpSmoother } from "../../utils/animator.js";
3
3
  import Rectangle from "../layout/rectangle.js";
4
4
  import UnitView from "../unitView.js";
5
+ import { markViewAsNonAddressable } from "../viewSelectors.js";
5
6
 
6
7
  /**
7
8
  * This class represents a scrollbar thumb that can be used within a grid view
@@ -77,6 +78,8 @@ export default class Scrollbar extends UnitView {
77
78
  }
78
79
  );
79
80
 
81
+ markViewAsNonAddressable(this, { skipSubtree: true });
82
+
80
83
  this.config = config;
81
84
  this.#scrollDirection = scrollDirection;
82
85
  this.#onViewportOffsetChange = options.onViewportOffsetChange;
@@ -1 +1 @@
1
- {"version":3,"file":"selectionRect.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/selectionRect.js"],"names":[],"mappings":"AAGA;IAYI;;;;OAIG;IACH,uBAJW,OAAO,gBAAgB,EAAE,OAAO,iBAChC,OAAO,qBAAqB,EAAE,eAAe,gBAC7C,OAAO,yBAAyB,EAAE,WAAW,EAqJvD;IAnKD;;;OAGG;IAEH,4DAA4D;IAC5D,gBADW,OAAO,qBAAqB,EAAE,eAAe,CACzC;IAEf,yBAAyB;IACzB,oBADW,MAAM,IAAI,CACF;CAmKtB;sBA/KqB,iBAAiB"}
1
+ {"version":3,"file":"selectionRect.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/selectionRect.js"],"names":[],"mappings":"AAIA;IAYI;;;;OAIG;IACH,uBAJW,OAAO,gBAAgB,EAAE,OAAO,iBAChC,OAAO,qBAAqB,EAAE,eAAe,gBAC7C,OAAO,yBAAyB,EAAE,WAAW,EAmKvD;IAjLD;;;OAGG;IAEH,4DAA4D;IAC5D,gBADW,OAAO,qBAAqB,EAAE,eAAe,CACzC;IAEf,yBAAyB;IACzB,oBADW,MAAM,IAAI,CACF;CAiLtB;sBA9LqB,iBAAiB"}
@@ -1,5 +1,6 @@
1
1
  import { primaryPositionalChannels } from "../../encoder/encoder.js";
2
2
  import LayerView from "../layerView.js";
3
+ import { markViewAsNonAddressable } from "../viewSelectors.js";
3
4
 
4
5
  export default class SelectionRect extends LayerView {
5
6
  /**
@@ -34,6 +35,7 @@ export default class SelectionRect extends LayerView {
34
35
  const layerSpec = {
35
36
  name: "selectionRect",
36
37
  configurableVisibility: false,
38
+ domainInert: true,
37
39
  resolve: {
38
40
  scale: {
39
41
  x: "forced",
@@ -46,12 +48,24 @@ export default class SelectionRect extends LayerView {
46
48
  };
47
49
 
48
50
  if (channels.includes("x")) {
49
- layerSpec.encoding.x = { field: "_x", type: null, title: null };
50
- layerSpec.encoding.x2 = { field: "_x2" };
51
+ layerSpec.encoding.x = {
52
+ field: "_x",
53
+ type: null,
54
+ title: null,
55
+ };
56
+ layerSpec.encoding.x2 = {
57
+ field: "_x2",
58
+ };
51
59
  }
52
60
  if (channels.includes("y")) {
53
- layerSpec.encoding.y = { field: "_y", type: null, title: null };
54
- layerSpec.encoding.y2 = { field: "_y2" };
61
+ layerSpec.encoding.y = {
62
+ field: "_y",
63
+ type: null,
64
+ title: null,
65
+ };
66
+ layerSpec.encoding.y2 = {
67
+ field: "_y2",
68
+ };
55
69
  }
56
70
 
57
71
  layerSpec.layer.push({
@@ -137,10 +151,11 @@ export default class SelectionRect extends LayerView {
137
151
  "selectionRect", // TODO: Serial
138
152
  {
139
153
  blockEncodingInheritance: true,
140
- contributesToScaleDomain: false,
141
154
  }
142
155
  );
143
156
 
157
+ markViewAsNonAddressable(this, { skipSubtree: true });
158
+
144
159
  /** @type {import("../paramMediator.js").ExprRefFunction} */
145
160
  this._selectionExpr = selectionExpr;
146
161
 
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @param {import("../../spec/view.js").SeparatorProps | boolean | undefined} separator
3
+ * @returns {import("../../spec/view.js").SeparatorProps | null}
4
+ */
5
+ export function resolveSeparatorProps(separator: import("../../spec/view.js").SeparatorProps | boolean | undefined): import("../../spec/view.js").SeparatorProps | null;
6
+ /**
7
+ * Draws separator rules for a single direction in a grid layout.
8
+ */
9
+ export default class SeparatorView {
10
+ /**
11
+ * @param {{
12
+ * direction: SeparatorDirection,
13
+ * props: import("../../spec/view.js").SeparatorProps,
14
+ * context: import("../../types/viewContext.js").default,
15
+ * layoutParent: import("../containerView.js").default,
16
+ * dataParent: import("../view.js").default,
17
+ * getName: (prefix: string) => string
18
+ * }} options
19
+ */
20
+ constructor({ direction, props, context, layoutParent, dataParent, getName, }: {
21
+ direction: SeparatorDirection;
22
+ props: import("../../spec/view.js").SeparatorProps;
23
+ context: import("../../types/viewContext.js").default;
24
+ layoutParent: import("../containerView.js").default;
25
+ dataParent: import("../view.js").default;
26
+ getName: (prefix: string) => string;
27
+ });
28
+ /**
29
+ * @returns {UnitView}
30
+ */
31
+ get view(): UnitView;
32
+ /**
33
+ * @param {import("../layout/flexLayout.js").LocSize[]} flexCoords
34
+ * @param {number} count
35
+ * @param {import("../layout/rectangle.js").default} coords
36
+ * @param {(direction: "row" | "column", index: number) => number} getViewSlot
37
+ * @param {boolean} wrappingFacet
38
+ * @param {import("../layout/padding.js").default} overhang
39
+ */
40
+ update(flexCoords: import("../layout/flexLayout.js").LocSize[], count: number, coords: import("../layout/rectangle.js").default, getViewSlot: (direction: "row" | "column", index: number) => number, wrappingFacet: boolean, overhang: import("../layout/padding.js").default): void;
41
+ /**
42
+ * @param {import("../renderingContext/viewRenderingContext.js").default} context
43
+ * @param {import("../layout/rectangle.js").default} coords
44
+ * @param {import("../../types/rendering.js").RenderingOptions} options
45
+ */
46
+ render(context: import("../renderingContext/viewRenderingContext.js").default, coords: import("../layout/rectangle.js").default, options: import("../../types/rendering.js").RenderingOptions): void;
47
+ #private;
48
+ }
49
+ export type SeparatorDirection = "horizontal" | "vertical";
50
+ import UnitView from "../unitView.js";
51
+ //# sourceMappingURL=separatorView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separatorView.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/separatorView.js"],"names":[],"mappings":"AA2NA;;;GAGG;AACH,iDAHW,OAAO,oBAAoB,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS,GAC/D,OAAO,oBAAoB,EAAE,cAAc,GAAG,IAAI,CAiB9D;AA/ND;;GAEG;AACH;IAsBI;;;;;;;;;OASG;IACH,+EATW;QACN,SAAS,EAAE,kBAAkB,CAAC;QAC9B,KAAK,EAAE,OAAO,oBAAoB,EAAE,cAAc,CAAC;QACnD,OAAO,EAAE,OAAO,4BAA4B,EAAE,OAAO,CAAC;QACtD,YAAY,EAAE,OAAO,qBAAqB,EAAE,OAAO,CAAC;QACpD,UAAU,EAAE,OAAO,YAAY,EAAE,OAAO,CAAC;QACzC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;KACpC,EAqBH;IAED;;OAEG;IACH,YAFa,QAAQ,CAIpB;IAED;;;;;;;OAOG;IACH,mBAPW,OAAO,yBAAyB,EAAE,OAAO,EAAE,SAC3C,MAAM,UACN,OAAO,wBAAwB,EAAE,OAAO,eACxC,CAAC,SAAS,EAAE,KAAK,GAAG,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,iBACtD,OAAO,YACP,OAAO,sBAAsB,EAAE,OAAO,QAKhD;IAED;;;;OAIG;IACH,gBAJW,OAAO,6CAA6C,EAAE,OAAO,UAC7D,OAAO,wBAAwB,EAAE,OAAO,WACxC,OAAO,0BAA0B,EAAE,gBAAgB,QAI7D;;CAuHJ;iCArNY,YAAY,GAAG,UAAU;qBAJjB,gBAAgB"}