@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.
- package/dist/bundle/index.es.js +7641 -6313
- package/dist/bundle/index.js +115 -134
- package/dist/schema.json +534 -132
- package/dist/src/data/collector.d.ts +20 -0
- package/dist/src/data/collector.d.ts.map +1 -1
- package/dist/src/data/collector.js +148 -0
- package/dist/src/data/dataFlow.d.ts +6 -0
- package/dist/src/data/dataFlow.d.ts.map +1 -1
- package/dist/src/data/dataFlow.js +10 -0
- package/dist/src/data/flowInit.d.ts.map +1 -1
- package/dist/src/data/flowInit.js +2 -3
- package/dist/src/data/flowNode.d.ts +8 -0
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +18 -0
- package/dist/src/data/keyIndex.d.ts +18 -0
- package/dist/src/data/keyIndex.d.ts.map +1 -0
- package/dist/src/data/keyIndex.js +241 -0
- package/dist/src/data/keyIndex.test.d.ts +2 -0
- package/dist/src/data/keyIndex.test.d.ts.map +1 -0
- package/dist/src/data/sources/dataSource.d.ts.map +1 -1
- package/dist/src/data/sources/dataSource.js +5 -1
- package/dist/src/data/sources/dataSourceFactory.d.ts +14 -12
- package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
- package/dist/src/data/sources/dataSourceFactory.js +52 -16
- package/dist/src/data/sources/lazy/mockLazySource.d.ts +29 -0
- package/dist/src/data/sources/lazy/mockLazySource.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/mockLazySource.js +44 -0
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts +22 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.js +34 -2
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisWindowedSource.js +15 -0
- package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/tabixSource.js +15 -5
- package/dist/src/data/transforms/stack.d.ts.map +1 -1
- package/dist/src/data/transforms/stack.js +1 -0
- package/dist/src/encoder/accessor.d.ts +43 -0
- package/dist/src/encoder/accessor.d.ts.map +1 -1
- package/dist/src/encoder/accessor.js +164 -0
- package/dist/src/encoder/encoder.d.ts +11 -2
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +24 -4
- package/dist/src/encoder/metadataChannels.d.ts +15 -0
- package/dist/src/encoder/metadataChannels.d.ts.map +1 -0
- package/dist/src/encoder/metadataChannels.js +65 -0
- package/dist/src/encoder/metadataChannels.test.d.ts +2 -0
- package/dist/src/encoder/metadataChannels.test.d.ts.map +1 -0
- package/dist/src/genome/scaleLocus.d.ts.map +1 -1
- package/dist/src/genome/scaleLocus.js +14 -1
- package/dist/src/genomeSpy/containerUi.d.ts +0 -1
- package/dist/src/genomeSpy/containerUi.d.ts.map +1 -1
- package/dist/src/genomeSpy/containerUi.js +0 -14
- package/dist/src/genomeSpy/loadingIndicatorManager.d.ts +3 -7
- package/dist/src/genomeSpy/loadingIndicatorManager.d.ts.map +1 -1
- package/dist/src/genomeSpy/loadingIndicatorManager.js +68 -20
- package/dist/src/genomeSpy/loadingStatusRegistry.d.ts +52 -0
- package/dist/src/genomeSpy/loadingStatusRegistry.d.ts.map +1 -0
- package/dist/src/genomeSpy/loadingStatusRegistry.js +86 -0
- package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewContextFactory.js +0 -1
- package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewDataInit.js +56 -11
- package/dist/src/genomeSpy.d.ts +0 -2
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +46 -26
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +18 -11
- package/dist/src/marks/markUtils.js +1 -1
- package/dist/src/scale/scale.d.ts +6 -1
- package/dist/src/scale/scale.d.ts.map +1 -1
- package/dist/src/scale/scale.js +83 -23
- package/dist/src/scales/axisResolution.d.ts.map +1 -1
- package/dist/src/scales/axisResolution.js +10 -0
- package/dist/src/scales/{scaleDomainAggregator.d.ts → domainPlanner.d.ts} +6 -3
- package/dist/src/scales/domainPlanner.d.ts.map +1 -0
- package/dist/src/scales/{scaleDomainAggregator.js → domainPlanner.js} +128 -10
- package/dist/src/scales/domainPlanner.test.d.ts +2 -0
- package/dist/src/scales/domainPlanner.test.d.ts.map +1 -0
- package/dist/src/scales/scaleInteractionController.d.ts +6 -0
- package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
- package/dist/src/scales/scaleInteractionController.js +41 -3
- package/dist/src/scales/scaleResolution.d.ts +19 -17
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +181 -70
- package/dist/src/scales/scaleResolution.test.d.ts.map +1 -1
- package/dist/src/selection/selection.d.ts +21 -0
- package/dist/src/selection/selection.d.ts.map +1 -1
- package/dist/src/selection/selection.js +82 -0
- package/dist/src/spec/channel.d.ts +52 -15
- package/dist/src/spec/data.d.ts +4 -0
- package/dist/src/spec/parameter.d.ts +16 -11
- package/dist/src/spec/testing.d.ts +12 -0
- package/dist/src/spec/testing.d.ts.map +1 -0
- package/dist/src/spec/testing.js +20 -0
- package/dist/src/spec/view.d.ts +45 -10
- package/dist/src/styles/genome-spy.css +3 -31
- package/dist/src/styles/genome-spy.css.d.ts +1 -1
- package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
- package/dist/src/styles/genome-spy.css.js +0 -29
- package/dist/src/types/encoder.d.ts +37 -2
- package/dist/src/types/rendering.d.ts +4 -3
- package/dist/src/types/viewContext.d.ts +0 -14
- package/dist/src/utils/throttle.d.ts +4 -1
- package/dist/src/utils/throttle.d.ts.map +1 -1
- package/dist/src/utils/throttle.js +54 -23
- package/dist/src/utils/throttle.test.d.ts +2 -0
- package/dist/src/utils/throttle.test.d.ts.map +1 -0
- package/dist/src/utils/transition.d.ts +21 -0
- package/dist/src/utils/transition.d.ts.map +1 -1
- package/dist/src/utils/transition.js +28 -0
- package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
- package/dist/src/utils/ui/tooltip.js +7 -1
- package/dist/src/utils/ui/tooltip.test.d.ts +2 -0
- package/dist/src/utils/ui/tooltip.test.d.ts.map +1 -0
- package/dist/src/view/axisGridView.d.ts.map +1 -1
- package/dist/src/view/axisGridView.js +22 -5
- package/dist/src/view/axisView.d.ts.map +1 -1
- package/dist/src/view/axisView.js +20 -5
- package/dist/src/view/concatView.js +3 -3
- package/dist/src/view/containerMutationHelper.js +1 -1
- package/dist/src/view/containerView.d.ts +9 -5
- package/dist/src/view/containerView.d.ts.map +1 -1
- package/dist/src/view/containerView.js +34 -9
- package/dist/src/view/dataReadiness.d.ts +46 -0
- package/dist/src/view/dataReadiness.d.ts.map +1 -0
- package/dist/src/view/dataReadiness.js +267 -0
- package/dist/src/view/dataReadiness.test.d.ts +2 -0
- package/dist/src/view/dataReadiness.test.d.ts.map +1 -0
- package/dist/src/view/facetView.d.ts.map +1 -1
- package/dist/src/view/facetView.js +7 -5
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +5 -1
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +8 -0
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +119 -2
- package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
- package/dist/src/view/gridView/scrollbar.js +3 -0
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +20 -5
- package/dist/src/view/gridView/separatorView.d.ts +51 -0
- package/dist/src/view/gridView/separatorView.d.ts.map +1 -0
- package/dist/src/view/gridView/separatorView.js +275 -0
- package/dist/src/view/layerView.js +3 -3
- package/dist/src/view/layout/flexLayout.d.ts +0 -30
- package/dist/src/view/layout/flexLayout.d.ts.map +1 -1
- package/dist/src/view/layout/flexLayout.js +0 -86
- package/dist/src/view/paramMediator.d.ts +19 -0
- package/dist/src/view/paramMediator.d.ts.map +1 -1
- package/dist/src/view/paramMediator.js +86 -19
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +6 -1
- package/dist/src/view/unitView.d.ts +8 -13
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +110 -41
- package/dist/src/view/view.d.ts +22 -14
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +93 -9
- package/dist/src/view/viewFactory.d.ts.map +1 -1
- package/dist/src/view/viewFactory.js +20 -1
- package/dist/src/view/viewSelectors.d.ts +148 -0
- package/dist/src/view/viewSelectors.d.ts.map +1 -0
- package/dist/src/view/viewSelectors.js +773 -0
- package/dist/src/view/viewSelectors.test.d.ts +2 -0
- package/dist/src/view/viewSelectors.test.d.ts.map +1 -0
- package/dist/src/view/viewUtils.d.ts +0 -8
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +1 -21
- package/package.json +3 -3
- package/dist/src/scales/scaleDomainAggregator.d.ts.map +0 -1
- package/dist/src/scales/scaleDomainAggregator.test.d.ts +0 -2
- 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
|
-
|
|
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;;;
|
|
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 (
|
|
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":"
|
|
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":"
|
|
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
|
|
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
|
-
|
|
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":"
|
|
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":"
|
|
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 = {
|
|
50
|
-
|
|
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 = {
|
|
54
|
-
|
|
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"}
|