@genome-spy/core 0.66.1 → 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 +7669 -6115
- package/dist/bundle/index.js +114 -133
- 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/flowHandle.d.ts +2 -0
- package/dist/src/data/flowHandle.d.ts.map +1 -1
- package/dist/src/data/flowHandle.js +1 -0
- package/dist/src/data/flowInit.d.ts +12 -4
- package/dist/src/data/flowInit.d.ts.map +1 -1
- package/dist/src/data/flowInit.js +115 -17
- 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 +10 -0
- package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewDataInit.js +166 -2
- package/dist/src/genomeSpy/viewDataInit.test.d.ts +2 -0
- package/dist/src/genomeSpy/viewDataInit.test.d.ts.map +1 -0
- package/dist/src/genomeSpy.d.ts +1 -2
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +69 -27
- package/dist/src/gl/dataToVertices.d.ts.map +1 -1
- package/dist/src/gl/dataToVertices.js +16 -4
- 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} +8 -5
- package/dist/src/scales/domainPlanner.d.ts.map +1 -0
- package/dist/src/scales/domainPlanner.js +285 -0
- 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/scaleInstanceManager.d.ts.map +1 -1
- package/dist/src/scales/scaleInstanceManager.js +8 -4
- 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 -16
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +255 -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/domainArray.d.ts.map +1 -1
- package/dist/src/utils/domainArray.js +3 -0
- package/dist/src/utils/indexer.d.ts +3 -0
- package/dist/src/utils/indexer.d.ts.map +1 -1
- package/dist/src/utils/indexer.js +3 -0
- 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.d.ts.map +1 -1
- package/dist/src/view/containerMutationHelper.js +6 -2
- 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 +5 -3
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +74 -7
- 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 +11 -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 +127 -43
- package/dist/src/view/view.d.ts +34 -14
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +119 -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.js +0 -162
- package/dist/src/scales/scaleDomainAggregator.test.d.ts +0 -2
- package/dist/src/scales/scaleDomainAggregator.test.d.ts.map +0 -1
package/dist/src/view/view.d.ts
CHANGED
|
@@ -27,9 +27,6 @@ export const VISIT_STOP: "VISIT_STOP";
|
|
|
27
27
|
* @typedef {object} ViewOptions
|
|
28
28
|
* @prop {boolean} [blockEncodingInheritance]
|
|
29
29
|
* Don't inherit encodings from parent. Default: false.
|
|
30
|
-
* @prop {boolean} [contributesToScaleDomain]
|
|
31
|
-
* Whether ScaleResolution should include this view or its children in the
|
|
32
|
-
* domain. Default: true
|
|
33
30
|
* @prop {boolean} [layersChildren]
|
|
34
31
|
* View's children are layered on top of each other and they have the same
|
|
35
32
|
* coordinates as their parent.
|
|
@@ -60,7 +57,6 @@ export default class View {
|
|
|
60
57
|
context: import("../types/viewContext.js").default;
|
|
61
58
|
layoutParent: import("./containerView.js").default;
|
|
62
59
|
dataParent: View;
|
|
63
|
-
name: string;
|
|
64
60
|
spec: import("../spec/view.js").ViewSpec;
|
|
65
61
|
resolutions: {
|
|
66
62
|
/**
|
|
@@ -79,11 +75,6 @@ export default class View {
|
|
|
79
75
|
* Don't inherit encodings from parent. Default: false.
|
|
80
76
|
*/
|
|
81
77
|
blockEncodingInheritance: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Whether ScaleResolution should include this view or its children in the
|
|
84
|
-
* domain. Default: true
|
|
85
|
-
*/
|
|
86
|
-
contributesToScaleDomain: boolean;
|
|
87
78
|
/**
|
|
88
79
|
* View's children are layered on top of each other and they have the same
|
|
89
80
|
* coordinates as their parent.
|
|
@@ -102,6 +93,20 @@ export default class View {
|
|
|
102
93
|
needsAxes: Record<import("../spec/channel.js").PrimaryPositionalChannel, boolean>;
|
|
103
94
|
/** @type {ParamMediator} */
|
|
104
95
|
paramMediator: ParamMediator;
|
|
96
|
+
/**
|
|
97
|
+
* Effective view name. Equals the explicit name (`spec.name`) when provided,
|
|
98
|
+
* otherwise falls back to an auto-generated default name.
|
|
99
|
+
*/
|
|
100
|
+
get name(): string;
|
|
101
|
+
/**
|
|
102
|
+
* The explicit name from the spec (`spec.name`), if any.
|
|
103
|
+
*/
|
|
104
|
+
get explicitName(): string;
|
|
105
|
+
/**
|
|
106
|
+
* The auto-generated default name that was assigned by the parent/factory.
|
|
107
|
+
* Intended for debugging only.
|
|
108
|
+
*/
|
|
109
|
+
get defaultName(): string;
|
|
105
110
|
/**
|
|
106
111
|
* Returns the coords of the view. If view has been faceted, returns the coords
|
|
107
112
|
* of an arbitrary facet. If all or specific facet coords are needed, use `facetCoords`.
|
|
@@ -134,6 +139,7 @@ export default class View {
|
|
|
134
139
|
* @returns {FlexDimensions}
|
|
135
140
|
*/
|
|
136
141
|
getViewportSize(): FlexDimensions;
|
|
142
|
+
registerStepSizeInvalidation(): void;
|
|
137
143
|
isConfiguredVisible(): boolean;
|
|
138
144
|
isVisibleInSpec(): boolean;
|
|
139
145
|
/**
|
|
@@ -146,6 +152,24 @@ export default class View {
|
|
|
146
152
|
* @returns {boolean}
|
|
147
153
|
*/
|
|
148
154
|
isVisible(): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Returns true if this view or any ancestor is marked as domain inert.
|
|
157
|
+
*
|
|
158
|
+
* @returns {boolean}
|
|
159
|
+
*/
|
|
160
|
+
isDomainInert(): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* @returns {"none" | "pending" | "ready"}
|
|
163
|
+
*/
|
|
164
|
+
getDataInitializationState(): "none" | "pending" | "ready";
|
|
165
|
+
/**
|
|
166
|
+
* Internal hook for lazy dataflow initialization.
|
|
167
|
+
* Use only from flow initialization helpers to avoid inconsistent state.
|
|
168
|
+
*
|
|
169
|
+
* @param {"none" | "pending" | "ready"} state
|
|
170
|
+
*/
|
|
171
|
+
_setDataInitializationState(state: "none" | "pending" | "ready"): void;
|
|
172
|
+
isDataInitialized(): boolean;
|
|
149
173
|
/**
|
|
150
174
|
* Returns the effective opacity of this view, e.g., view's opacity multiplied
|
|
151
175
|
* by opacities of its ancestors.
|
|
@@ -238,6 +262,7 @@ export default class View {
|
|
|
238
262
|
* pass. The order is depth first, pre order.
|
|
239
263
|
*/
|
|
240
264
|
onBeforeRender(): void;
|
|
265
|
+
hasRendered(): boolean;
|
|
241
266
|
render(context: import("./renderingContext/viewRenderingContext.js").default, coords: import("./layout/rectangle.js").default, options?: import("../types/rendering.js").RenderingOptions): void;
|
|
242
267
|
/**
|
|
243
268
|
* Returns the encodings specified in this view combined with the inherited
|
|
@@ -360,11 +385,6 @@ export type ViewOptions = {
|
|
|
360
385
|
* Don't inherit encodings from parent. Default: false.
|
|
361
386
|
*/
|
|
362
387
|
blockEncodingInheritance?: boolean;
|
|
363
|
-
/**
|
|
364
|
-
* Whether ScaleResolution should include this view or its children in the
|
|
365
|
-
* domain. Default: true
|
|
366
|
-
*/
|
|
367
|
-
contributesToScaleDomain?: boolean;
|
|
368
388
|
/**
|
|
369
389
|
* View's children are layered on top of each other and they have the same
|
|
370
390
|
* coordinates as their parent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/view.js"],"names":[],"mappings":"AA2BA,oBAAoB;AACpB,yBAA0B,YAAY,CAAC;AACvC,0BAA0B;AAC1B,yBAA0B,YAAY,CAAC;AAKvC
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/view.js"],"names":[],"mappings":"AA2BA,oBAAoB;AACpB,yBAA0B,YAAY,CAAC;AACvC,0BAA0B;AAC1B,yBAA0B,YAAY,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IA6CI;;;;;;;;;OASG;IACH,kBARW,OAAO,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AAO,SAEvC,OAAO,8BAA8B,EAAE,OAAO;;;;;+BAG/C,OAAO;;;;;qBAEP,OAAO;;0BA1CwB,oBAAoB;oBAbzC,qBAAqB;+BADlC,wBAAwB"}
|
package/dist/src/view/view.js
CHANGED
|
@@ -58,14 +58,14 @@ const defaultOpacityFunction = (parentOpacity) => parentOpacity;
|
|
|
58
58
|
* @typedef {object} ViewOptions
|
|
59
59
|
* @prop {boolean} [blockEncodingInheritance]
|
|
60
60
|
* Don't inherit encodings from parent. Default: false.
|
|
61
|
-
* @prop {boolean} [contributesToScaleDomain]
|
|
62
|
-
* Whether ScaleResolution should include this view or its children in the
|
|
63
|
-
* domain. Default: true
|
|
64
61
|
* @prop {boolean} [layersChildren]
|
|
65
62
|
* View's children are layered on top of each other and they have the same
|
|
66
63
|
* coordinates as their parent.
|
|
67
64
|
*/
|
|
68
65
|
export default class View {
|
|
66
|
+
/** @type {string | undefined} */
|
|
67
|
+
#defaultName;
|
|
68
|
+
|
|
69
69
|
/** @type {Record<string, (function(BroadcastMessage):void)[]>} */
|
|
70
70
|
#broadcastHandlers = {};
|
|
71
71
|
|
|
@@ -81,6 +81,9 @@ export default class View {
|
|
|
81
81
|
/** @type {(value: number) => void} */
|
|
82
82
|
#heightSetter;
|
|
83
83
|
|
|
84
|
+
/** @type {boolean} */
|
|
85
|
+
#hasRendered = false;
|
|
86
|
+
|
|
84
87
|
/**
|
|
85
88
|
* @type {function(number):number}
|
|
86
89
|
*/
|
|
@@ -91,6 +94,11 @@ export default class View {
|
|
|
91
94
|
*/
|
|
92
95
|
#disposers = [];
|
|
93
96
|
|
|
97
|
+
/**
|
|
98
|
+
* @type {"none" | "pending" | "ready"}
|
|
99
|
+
*/
|
|
100
|
+
#dataInitializationState = "none";
|
|
101
|
+
|
|
94
102
|
/**
|
|
95
103
|
* Coords of the view for each facet, recorded during the last layout rendering pass.
|
|
96
104
|
* Most views have only one facet, so the map is usually of size 1.
|
|
@@ -117,7 +125,7 @@ export default class View {
|
|
|
117
125
|
this.context = context;
|
|
118
126
|
this.layoutParent = layoutParent;
|
|
119
127
|
this.dataParent = dataParent;
|
|
120
|
-
this
|
|
128
|
+
this.#defaultName = name;
|
|
121
129
|
this.spec = spec;
|
|
122
130
|
|
|
123
131
|
this.resolutions = {
|
|
@@ -137,7 +145,6 @@ export default class View {
|
|
|
137
145
|
|
|
138
146
|
this.options = {
|
|
139
147
|
blockEncodingInheritance: false,
|
|
140
|
-
contributesToScaleDomain: true,
|
|
141
148
|
...options,
|
|
142
149
|
};
|
|
143
150
|
|
|
@@ -179,6 +186,29 @@ export default class View {
|
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Effective view name. Equals the explicit name (`spec.name`) when provided,
|
|
191
|
+
* otherwise falls back to an auto-generated default name.
|
|
192
|
+
*/
|
|
193
|
+
get name() {
|
|
194
|
+
return this.spec.name ?? this.#defaultName;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* The explicit name from the spec (`spec.name`), if any.
|
|
199
|
+
*/
|
|
200
|
+
get explicitName() {
|
|
201
|
+
return this.spec.name;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The auto-generated default name that was assigned by the parent/factory.
|
|
206
|
+
* Intended for debugging only.
|
|
207
|
+
*/
|
|
208
|
+
get defaultName() {
|
|
209
|
+
return this.#defaultName;
|
|
210
|
+
}
|
|
211
|
+
|
|
182
212
|
/**
|
|
183
213
|
* Returns the coords of the view. If view has been faceted, returns the coords
|
|
184
214
|
* of an arbitrary facet. If all or specific facet coords are needed, use `facetCoords`.
|
|
@@ -260,11 +290,12 @@ export default class View {
|
|
|
260
290
|
*/
|
|
261
291
|
#getDimensionSize(dimension) {
|
|
262
292
|
let value = this.spec[dimension];
|
|
293
|
+
const needsStepInvalidation = isStepSize(value);
|
|
263
294
|
|
|
264
295
|
const viewport =
|
|
265
296
|
dimension == "viewportWidth" || dimension == "viewportHeight";
|
|
266
297
|
|
|
267
|
-
if (
|
|
298
|
+
if (needsStepInvalidation) {
|
|
268
299
|
if (viewport) {
|
|
269
300
|
throw new ViewError(
|
|
270
301
|
`Cannot use step-based size with "${dimension}"!`,
|
|
@@ -308,7 +339,7 @@ export default class View {
|
|
|
308
339
|
return { px: steps * stepSize, grow: 0 };
|
|
309
340
|
} else {
|
|
310
341
|
throw new ViewError(
|
|
311
|
-
|
|
342
|
+
`Cannot use step-based size with "${dimension}"!`,
|
|
312
343
|
this
|
|
313
344
|
);
|
|
314
345
|
}
|
|
@@ -320,6 +351,36 @@ export default class View {
|
|
|
320
351
|
}
|
|
321
352
|
}
|
|
322
353
|
|
|
354
|
+
registerStepSizeInvalidation() {
|
|
355
|
+
this.#registerStepSizeInvalidationFor("width", "x");
|
|
356
|
+
this.#registerStepSizeInvalidationFor("height", "y");
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @param {"width" | "height"} dimension
|
|
361
|
+
* @param {import("../spec/channel.js").PrimaryPositionalChannel} channel
|
|
362
|
+
*/
|
|
363
|
+
#registerStepSizeInvalidationFor(dimension, channel) {
|
|
364
|
+
const value = this.spec[dimension];
|
|
365
|
+
if (!isStepSize(value)) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const resolution = this.getScaleResolution(channel);
|
|
370
|
+
if (!resolution) {
|
|
371
|
+
throw new ViewError(
|
|
372
|
+
"Cannot use 'step' size without a scale!",
|
|
373
|
+
this
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const listener = () => this.invalidateSizeCache();
|
|
378
|
+
resolution.addEventListener("domain", listener);
|
|
379
|
+
this.registerDisposer(() =>
|
|
380
|
+
resolution.removeEventListener("domain", listener)
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
|
|
323
384
|
isConfiguredVisible() {
|
|
324
385
|
return this.context.isViewConfiguredVisible(this);
|
|
325
386
|
}
|
|
@@ -343,6 +404,45 @@ export default class View {
|
|
|
343
404
|
);
|
|
344
405
|
}
|
|
345
406
|
|
|
407
|
+
/**
|
|
408
|
+
* Returns true if this view or any ancestor is marked as domain inert.
|
|
409
|
+
*
|
|
410
|
+
* @returns {boolean}
|
|
411
|
+
*/
|
|
412
|
+
isDomainInert() {
|
|
413
|
+
if (this.spec.domainInert) {
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
const parent = this.dataParent;
|
|
418
|
+
if (!parent) {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return parent.isDomainInert();
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* @returns {"none" | "pending" | "ready"}
|
|
427
|
+
*/
|
|
428
|
+
getDataInitializationState() {
|
|
429
|
+
return this.#dataInitializationState;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Internal hook for lazy dataflow initialization.
|
|
434
|
+
* Use only from flow initialization helpers to avoid inconsistent state.
|
|
435
|
+
*
|
|
436
|
+
* @param {"none" | "pending" | "ready"} state
|
|
437
|
+
*/
|
|
438
|
+
_setDataInitializationState(state) {
|
|
439
|
+
this.#dataInitializationState = state;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
isDataInitialized() {
|
|
443
|
+
return this.#dataInitializationState === "ready";
|
|
444
|
+
}
|
|
445
|
+
|
|
346
446
|
/**
|
|
347
447
|
* Returns the effective opacity of this view, e.g., view's opacity multiplied
|
|
348
448
|
* by opacities of its ancestors.
|
|
@@ -542,6 +642,8 @@ export default class View {
|
|
|
542
642
|
this.context.dataFlow.removeDataSource(handle.dataSource);
|
|
543
643
|
}
|
|
544
644
|
|
|
645
|
+
this.context.dataFlow.loadingStatusRegistry.delete(this);
|
|
646
|
+
|
|
545
647
|
this.flowHandle = undefined;
|
|
546
648
|
}
|
|
547
649
|
|
|
@@ -583,7 +685,13 @@ export default class View {
|
|
|
583
685
|
* pass. The order is depth first, pre order.
|
|
584
686
|
*/
|
|
585
687
|
onBeforeRender() {
|
|
586
|
-
|
|
688
|
+
if (!this.#hasRendered) {
|
|
689
|
+
this.#hasRendered = true;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
hasRendered() {
|
|
694
|
+
return this.#hasRendered;
|
|
587
695
|
}
|
|
588
696
|
|
|
589
697
|
/**
|
|
@@ -806,7 +914,9 @@ export default class View {
|
|
|
806
914
|
}
|
|
807
915
|
|
|
808
916
|
invalidateSizeCache() {
|
|
809
|
-
|
|
917
|
+
// Clear both "size" and "size/*" cache keys.
|
|
918
|
+
invalidatePrefix(this, "size");
|
|
919
|
+
this._invalidateCacheByPrefix("size", "ancestors");
|
|
810
920
|
}
|
|
811
921
|
|
|
812
922
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewFactory.d.ts","sourceRoot":"","sources":["../../../src/view/viewFactory.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"viewFactory.d.ts","sourceRoot":"","sources":["../../../src/view/viewFactory.js"],"names":[],"mappings":"AA+SA;;;;GAIG;AACH,sEAFa,IAAI,sCAAY,CAI5B;AAED;;;;GAIG;AACH,uEAFa,IAAI,uCAAa,CAI7B;AAED;;;;GAIG;AACH,uEAFa,IAAI,uCAAa,CAS7B;AAED;;;;GAIG;AACH,kFAFa,IAAI,IAAI,OAAO,iBAAiB,EAAE,oBAAoB,CAQlE;AAED;;;;GAIG;AACH,mCAHW,MAAM,GACJ,IAAI,IAAI,OAAO,iBAAiB,EAAE,UAAU,CAIxD;AAED;;;;GAIG;AACH,yEAFa,IAAI,yCAAe,CAI/B;AAED;;;;GAIG;AACH,yEAFa,IAAI,IAAI,WAAW,CAI/B;AAED;;;;GAIG;AACH,wEAFa,IAAI,wCAAc,CAI9B;AAED;;;;GAIG;AACH,wEAFa,IAAI,8CAAc,CAS9B;AA3XD,6BAA8B,UAAU,CAAC;AAEzC;;;;GAIG;AAEH;;GAEG;AACH;IAiBI;;OAEG;IACH,sBAFW,kBAAkB,EAoC5B;IAjCG,2CAA2C;IAC3C,SADW,QAAQ,CAAC,kBAAkB,CAAC,CAKtC;IA8BL;;;OAGG;IACH,qEAlDiC,OAAO,yHAC2B,OAAO,oBAAoB,EAAE,OAAO,eAAe,OAAO,WAAW,EAAE,OAAO,gBAAgB,MAAM,KAAK,IAAI,QAmD/K;IAED;;;;;;OAMG;IACH,wHAJW,OAAO,oBAAoB,EAAE,OAAO,eACpC,OAAO,WAAW,EAAE,OAAO,gBAC3B,MAAM,QAmBhB;IAED;;;;OAIG;IACH,sDAFa,IAAI,sCAAY,CAU5B;IAED;;;;;;;;;;OAUG;IACH,yBAPW,qCAAW,OAAO,iBAAiB,EAAE,UAAU,qEAE/C,OAAO,oBAAoB,EAAE,OAAO,eACpC,OAAO,WAAW,EAAE,OAAO,gBAC3B,MAAM,cACN,CAAC,IAAI,oCAAU,KAAK,IAAI,iBAgGlC;;CACJ;;;;;kBA1Na,OAAO;eACP,OAAO;;iBArBJ,WAAW"}
|
|
@@ -10,6 +10,10 @@ import ContainerView from "./containerView.js";
|
|
|
10
10
|
import ViewError from "./viewError.js";
|
|
11
11
|
import { isSelectionParameter } from "./paramMediator.js";
|
|
12
12
|
import { asSelectionConfig } from "../selection/selection.js";
|
|
13
|
+
import {
|
|
14
|
+
markViewAsNonAddressable,
|
|
15
|
+
registerImportInstance,
|
|
16
|
+
} from "./viewSelectors.js";
|
|
13
17
|
|
|
14
18
|
export const VIEW_ROOT_NAME = "viewRoot";
|
|
15
19
|
|
|
@@ -60,7 +64,7 @@ export class ViewFactory {
|
|
|
60
64
|
context,
|
|
61
65
|
layoutParent,
|
|
62
66
|
dataParent,
|
|
63
|
-
|
|
67
|
+
defaultName
|
|
64
68
|
)
|
|
65
69
|
);
|
|
66
70
|
|
|
@@ -148,6 +152,9 @@ export class ViewFactory {
|
|
|
148
152
|
) {
|
|
149
153
|
/** @type {ViewSpec} */
|
|
150
154
|
let viewSpec;
|
|
155
|
+
const importScopeName = isImportSpec(spec)
|
|
156
|
+
? (spec.name ?? null)
|
|
157
|
+
: undefined;
|
|
151
158
|
|
|
152
159
|
if (isImportSpec(spec)) {
|
|
153
160
|
/** @type {ViewSpec} */
|
|
@@ -190,6 +197,7 @@ export class ViewFactory {
|
|
|
190
197
|
);
|
|
191
198
|
|
|
192
199
|
// Wrap a unit spec at root into a grid view to get axes, etc.
|
|
200
|
+
let isImplicitRoot = false;
|
|
193
201
|
if (
|
|
194
202
|
!dataParent &&
|
|
195
203
|
this.options.wrapRoot &&
|
|
@@ -202,6 +210,7 @@ export class ViewFactory {
|
|
|
202
210
|
name: "implicitRoot",
|
|
203
211
|
vconcat: [viewSpec],
|
|
204
212
|
};
|
|
213
|
+
isImplicitRoot = true;
|
|
205
214
|
}
|
|
206
215
|
|
|
207
216
|
const view = this.createView(
|
|
@@ -212,10 +221,20 @@ export class ViewFactory {
|
|
|
212
221
|
defaultName
|
|
213
222
|
);
|
|
214
223
|
|
|
224
|
+
if (importScopeName !== undefined) {
|
|
225
|
+
registerImportInstance(view, importScopeName);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (isImplicitRoot) {
|
|
229
|
+
markViewAsNonAddressable(view);
|
|
230
|
+
}
|
|
231
|
+
|
|
215
232
|
if (view instanceof ContainerView) {
|
|
216
233
|
await view.initializeChildren();
|
|
217
234
|
}
|
|
218
235
|
|
|
236
|
+
view.registerStepSizeInvalidation();
|
|
237
|
+
|
|
219
238
|
return view;
|
|
220
239
|
}
|
|
221
240
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks a view as the root of an import scope.
|
|
3
|
+
*
|
|
4
|
+
* @param {import("./view.js").default} view
|
|
5
|
+
* @param {string | null} scopeName
|
|
6
|
+
*/
|
|
7
|
+
export function registerImportInstance(view: import("./view.js").default, scopeName: string | null): void;
|
|
8
|
+
/**
|
|
9
|
+
* Returns import scope info for a view, if it is an import root.
|
|
10
|
+
*
|
|
11
|
+
* @param {import("./view.js").default} view
|
|
12
|
+
* @returns {ImportScopeInfo | undefined}
|
|
13
|
+
*/
|
|
14
|
+
export function getImportScopeInfo(view: import("./view.js").default): ImportScopeInfo | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Marks a view as non-addressable for selector resolution.
|
|
17
|
+
*
|
|
18
|
+
* @param {import("./view.js").default} view
|
|
19
|
+
* @param {AddressableOptions} [options]
|
|
20
|
+
*/
|
|
21
|
+
export function markViewAsNonAddressable(view: import("./view.js").default, options?: AddressableOptions): void;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the import scope chain for a view, using named import instances.
|
|
24
|
+
*
|
|
25
|
+
* @param {import("./view.js").default} view
|
|
26
|
+
* @returns {string[]}
|
|
27
|
+
*/
|
|
28
|
+
export function getViewScopeChain(view: import("./view.js").default): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Returns a view selector for a view with an explicit name.
|
|
31
|
+
*
|
|
32
|
+
* @param {import("./view.js").default} view
|
|
33
|
+
* @returns {ViewSelector}
|
|
34
|
+
*/
|
|
35
|
+
export function getViewSelector(view: import("./view.js").default): ViewSelector;
|
|
36
|
+
/**
|
|
37
|
+
* Returns a parameter selector for a parameter registered in a view.
|
|
38
|
+
*
|
|
39
|
+
* @param {import("./view.js").default} view
|
|
40
|
+
* @param {string} paramName
|
|
41
|
+
* @returns {ParamSelector}
|
|
42
|
+
*/
|
|
43
|
+
export function getParamSelector(view: import("./view.js").default, paramName: string): ParamSelector;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a stable key for a parameter selector.
|
|
46
|
+
*
|
|
47
|
+
* @param {ParamSelector} selector
|
|
48
|
+
* @returns {string}
|
|
49
|
+
*/
|
|
50
|
+
export function makeParamSelectorKey(selector: ParamSelector): string;
|
|
51
|
+
/**
|
|
52
|
+
* Enumerates views that can be addressed by selectors.
|
|
53
|
+
*
|
|
54
|
+
* @param {import("./view.js").default} root
|
|
55
|
+
* @returns {import("./view.js").default[]}
|
|
56
|
+
*/
|
|
57
|
+
export function getAddressableViews(root: import("./view.js").default): import("./view.js").default[];
|
|
58
|
+
/**
|
|
59
|
+
* Visits all addressable views in the hierarchy.
|
|
60
|
+
*
|
|
61
|
+
* @param {import("./view.js").default} root
|
|
62
|
+
* @param {import("./view.js").Visitor} visitor
|
|
63
|
+
*/
|
|
64
|
+
export function visitAddressableViews(root: import("./view.js").default, visitor: import("./view.js").Visitor): void;
|
|
65
|
+
/**
|
|
66
|
+
* Resolves a view selector to a unique view within the matching scope.
|
|
67
|
+
*
|
|
68
|
+
* @param {import("./view.js").default} root
|
|
69
|
+
* @param {ViewSelector} selector
|
|
70
|
+
* @returns {import("./view.js").default | undefined}
|
|
71
|
+
*/
|
|
72
|
+
export function resolveViewSelector(root: import("./view.js").default, selector: ViewSelector): import("./view.js").default | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Resolves a parameter selector to a unique bookmarkable parameter.
|
|
75
|
+
*
|
|
76
|
+
* @param {import("./view.js").default} root
|
|
77
|
+
* @param {ParamSelector} selector
|
|
78
|
+
* @returns {ResolvedParam | undefined}
|
|
79
|
+
*/
|
|
80
|
+
export function resolveParamSelector(root: import("./view.js").default, selector: ParamSelector): ResolvedParam | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Visits bookmarkable parameters in the view hierarchy.
|
|
83
|
+
*
|
|
84
|
+
* @param {import("./view.js").default} root
|
|
85
|
+
* @param {(entry: BookmarkableParamEntry) => void} visitor
|
|
86
|
+
*/
|
|
87
|
+
export function visitBookmarkableParams(root: import("./view.js").default, visitor: (entry: BookmarkableParamEntry) => void): void;
|
|
88
|
+
/**
|
|
89
|
+
* Returns bookmarkable parameters in the view hierarchy.
|
|
90
|
+
*
|
|
91
|
+
* @param {import("./view.js").default} root
|
|
92
|
+
* @returns {BookmarkableParamEntry[]}
|
|
93
|
+
*/
|
|
94
|
+
export function getBookmarkableParams(root: import("./view.js").default): BookmarkableParamEntry[];
|
|
95
|
+
/**
|
|
96
|
+
* Validates naming and scoping constraints for addressable views and parameters.
|
|
97
|
+
*
|
|
98
|
+
* @param {import("./view.js").default} root
|
|
99
|
+
* @returns {SelectorValidationIssue[]}
|
|
100
|
+
*/
|
|
101
|
+
export function validateSelectorConstraints(root: import("./view.js").default): SelectorValidationIssue[];
|
|
102
|
+
/**
|
|
103
|
+
* Selectors identify views and parameters in a way that stays stable when the
|
|
104
|
+
* same template/import is instantiated multiple times. They combine a chain of
|
|
105
|
+
* named import instances (scope) with an explicit view or parameter name so
|
|
106
|
+
* bookmarkable state and visibility toggles do not rely on globally-unique
|
|
107
|
+
* names or runtime-only nodes.
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* @typedef {{ scope: string[], view: string }} ViewSelector
|
|
111
|
+
* @typedef {{ scope: string[], param: string }} ParamSelector
|
|
112
|
+
* @typedef {{ view: import("./view.js").default, param: import("../spec/parameter.js").Parameter, selector: ParamSelector }} BookmarkableParamEntry
|
|
113
|
+
* @typedef {{ message: string, scope: string[] }} SelectorValidationIssue
|
|
114
|
+
* @typedef {{ name: string | null }} ImportScopeInfo
|
|
115
|
+
* @typedef {"exclude" | "excludeSubtree"} AddressableOverride
|
|
116
|
+
* @typedef {{ skipSubtree?: boolean }} AddressableOptions
|
|
117
|
+
* @typedef {{ view: import("./view.js").default, param: import("../spec/parameter.js").Parameter }} ResolvedParam
|
|
118
|
+
*/
|
|
119
|
+
export const PARAM_SELECTOR_KEY_PREFIX: "p:";
|
|
120
|
+
export type ViewSelector = {
|
|
121
|
+
scope: string[];
|
|
122
|
+
view: string;
|
|
123
|
+
};
|
|
124
|
+
export type ParamSelector = {
|
|
125
|
+
scope: string[];
|
|
126
|
+
param: string;
|
|
127
|
+
};
|
|
128
|
+
export type BookmarkableParamEntry = {
|
|
129
|
+
view: import("./view.js").default;
|
|
130
|
+
param: import("../spec/parameter.js").Parameter;
|
|
131
|
+
selector: ParamSelector;
|
|
132
|
+
};
|
|
133
|
+
export type SelectorValidationIssue = {
|
|
134
|
+
message: string;
|
|
135
|
+
scope: string[];
|
|
136
|
+
};
|
|
137
|
+
export type ImportScopeInfo = {
|
|
138
|
+
name: string | null;
|
|
139
|
+
};
|
|
140
|
+
export type AddressableOverride = "exclude" | "excludeSubtree";
|
|
141
|
+
export type AddressableOptions = {
|
|
142
|
+
skipSubtree?: boolean;
|
|
143
|
+
};
|
|
144
|
+
export type ResolvedParam = {
|
|
145
|
+
view: import("./view.js").default;
|
|
146
|
+
param: import("../spec/parameter.js").Parameter;
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=viewSelectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewSelectors.d.ts","sourceRoot":"","sources":["../../../src/view/viewSelectors.js"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,6CAHW,OAAO,WAAW,EAAE,OAAO,aAC3B,MAAM,GAAG,IAAI,QAQvB;AAED;;;;;GAKG;AACH,yCAHW,OAAO,WAAW,EAAE,OAAO,GACzB,eAAe,GAAG,SAAS,CAIvC;AAED;;;;;GAKG;AACH,+CAHW,OAAO,WAAW,EAAE,OAAO,YAC3B,kBAAkB,QAM5B;AAED;;;;;GAKG;AACH,wCAHW,OAAO,WAAW,EAAE,OAAO,GACzB,MAAM,EAAE,CAgBpB;AAED;;;;;GAKG;AACH,sCAHW,OAAO,WAAW,EAAE,OAAO,GACzB,YAAY,CAYxB;AAED;;;;;;GAMG;AACH,uCAJW,OAAO,WAAW,EAAE,OAAO,aAC3B,MAAM,GACJ,aAAa,CAazB;AAED;;;;;GAKG;AACH,+CAHW,aAAa,GACX,MAAM,CAQlB;AAED;;;;;GAKG;AACH,0CAHW,OAAO,WAAW,EAAE,OAAO,GACzB,OAAO,WAAW,EAAE,OAAO,EAAE,CAWzC;AAED;;;;;GAKG;AACH,4CAHW,OAAO,WAAW,EAAE,OAAO,WAC3B,OAAO,WAAW,EAAE,OAAO,QAerC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