@genome-spy/core 0.67.0 → 0.69.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 +15884 -13130
- package/dist/bundle/index.js +130 -149
- package/dist/schema.json +6498 -6191
- 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 +20 -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 +33 -10
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +84 -13
- package/dist/src/data/flowTestUtils.d.ts +2 -2
- package/dist/src/data/flowTestUtils.d.ts.map +1 -1
- package/dist/src/data/flowTestUtils.js +5 -4
- 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 +7 -3
- 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/bigBedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigBedSource.js +11 -10
- package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +11 -10
- 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 +16 -1
- package/dist/src/data/sources/lazy/tabixSource.d.ts +0 -1
- package/dist/src/data/sources/lazy/tabixSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/tabixSource.js +56 -16
- package/dist/src/data/sources/sequenceSource.d.ts.map +1 -1
- package/dist/src/data/sources/sequenceSource.js +5 -3
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +7 -3
- package/dist/src/data/transforms/filter.d.ts +4 -4
- package/dist/src/data/transforms/filter.d.ts.map +1 -1
- package/dist/src/data/transforms/filter.js +13 -7
- package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
- package/dist/src/data/transforms/filterScoredLabels.js +11 -6
- package/dist/src/data/transforms/filterScoredLabels.test.d.ts +2 -0
- package/dist/src/data/transforms/filterScoredLabels.test.d.ts.map +1 -0
- package/dist/src/data/transforms/formula.d.ts +4 -4
- package/dist/src/data/transforms/formula.d.ts.map +1 -1
- package/dist/src/data/transforms/formula.js +12 -6
- package/dist/src/data/transforms/measureText.d.ts +2 -2
- package/dist/src/data/transforms/measureText.d.ts.map +1 -1
- package/dist/src/data/transforms/measureText.js +16 -12
- package/dist/src/data/transforms/stack.d.ts.map +1 -1
- package/dist/src/data/transforms/stack.js +1 -0
- package/dist/src/data/transforms/transform.d.ts +2 -2
- package/dist/src/data/transforms/transform.d.ts.map +1 -1
- package/dist/src/data/transforms/transform.js +3 -3
- package/dist/src/encoder/accessor.d.ts +51 -4
- package/dist/src/encoder/accessor.d.ts.map +1 -1
- package/dist/src/encoder/accessor.js +174 -10
- 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 +29 -9
- 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/genome.d.ts +8 -0
- package/dist/src/genome/genome.d.ts.map +1 -1
- package/dist/src/genome/genome.js +16 -1
- 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/inputBindingManager.js +1 -1
- package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
- package/dist/src/genomeSpy/interactionController.js +7 -1
- 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 +47 -27
- package/dist/src/gl/glslScaleGenerator.js +1 -1
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +40 -41
- package/dist/src/marks/markUtils.js +1 -1
- package/dist/src/marks/point.d.ts.map +1 -1
- package/dist/src/marks/point.js +4 -6
- package/dist/src/paramRuntime/expressionCompiler.d.ts +7 -0
- package/dist/src/paramRuntime/expressionCompiler.d.ts.map +1 -0
- package/dist/src/paramRuntime/expressionCompiler.js +10 -0
- package/dist/src/paramRuntime/expressionRef.d.ts +20 -0
- package/dist/src/paramRuntime/expressionRef.d.ts.map +1 -0
- package/dist/src/paramRuntime/expressionRef.js +95 -0
- package/dist/src/paramRuntime/expressionRef.test.d.ts +2 -0
- package/dist/src/paramRuntime/expressionRef.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/graphRuntime.d.ts +176 -0
- package/dist/src/paramRuntime/graphRuntime.d.ts.map +1 -0
- package/dist/src/paramRuntime/graphRuntime.js +628 -0
- package/dist/src/paramRuntime/graphRuntime.test.d.ts +2 -0
- package/dist/src/paramRuntime/graphRuntime.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/index.d.ts +9 -0
- package/dist/src/paramRuntime/index.d.ts.map +1 -0
- package/dist/src/paramRuntime/index.js +8 -0
- package/dist/src/paramRuntime/lifecycleRegistry.d.ts +27 -0
- package/dist/src/paramRuntime/lifecycleRegistry.d.ts.map +1 -0
- package/dist/src/paramRuntime/lifecycleRegistry.js +54 -0
- package/dist/src/paramRuntime/paramRuntime.d.ts +165 -0
- package/dist/src/paramRuntime/paramRuntime.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramRuntime.js +222 -0
- package/dist/src/paramRuntime/paramRuntime.test.d.ts +2 -0
- package/dist/src/paramRuntime/paramRuntime.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramStore.d.ts +68 -0
- package/dist/src/paramRuntime/paramStore.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramStore.js +148 -0
- package/dist/src/paramRuntime/paramStore.test.d.ts +2 -0
- package/dist/src/paramRuntime/paramStore.test.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramUtils.d.ts +86 -0
- package/dist/src/paramRuntime/paramUtils.d.ts.map +1 -0
- package/dist/src/paramRuntime/paramUtils.js +272 -0
- package/dist/src/paramRuntime/selectionStore.d.ts +6 -0
- package/dist/src/paramRuntime/selectionStore.d.ts.map +1 -0
- package/dist/src/paramRuntime/selectionStore.js +13 -0
- package/dist/src/paramRuntime/types.d.ts +16 -0
- package/dist/src/paramRuntime/types.d.ts.map +1 -0
- package/dist/src/paramRuntime/types.js +25 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts +164 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -0
- package/dist/src/paramRuntime/viewParamRuntime.js +443 -0
- 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/scaleInstanceManager.d.ts +6 -3
- package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
- package/dist/src/scales/scaleInstanceManager.js +17 -11
- 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 +20 -17
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +188 -71
- 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 +83 -1
- package/dist/src/spec/channel.d.ts +52 -15
- package/dist/src/spec/coreSchemaRoot.d.ts +53 -0
- package/dist/src/spec/data.d.ts +4 -0
- package/dist/src/spec/parameter.d.ts +16 -11
- package/dist/src/spec/root.d.ts +1 -1
- 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 +157 -41
- 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/tooltip/dataTooltipHandler.d.ts +1 -1
- package/dist/src/tooltip/dataTooltipHandler.js +23 -32
- package/dist/src/tooltip/dataTooltipHandler.test.d.ts +2 -0
- package/dist/src/tooltip/dataTooltipHandler.test.d.ts.map +1 -0
- package/dist/src/tooltip/flattenDatumRows.d.ts +13 -0
- package/dist/src/tooltip/flattenDatumRows.d.ts.map +1 -0
- package/dist/src/tooltip/flattenDatumRows.js +47 -0
- package/dist/src/tooltip/flattenDatumRows.test.d.ts +2 -0
- package/dist/src/tooltip/flattenDatumRows.test.d.ts.map +1 -0
- package/dist/src/tooltip/refseqGeneTooltipHandler.d.ts +1 -1
- package/dist/src/tooltip/refseqGeneTooltipHandler.js +7 -1
- package/dist/src/tooltip/tooltipContext.d.ts +13 -0
- package/dist/src/tooltip/tooltipContext.d.ts.map +1 -0
- package/dist/src/tooltip/tooltipContext.js +543 -0
- package/dist/src/tooltip/tooltipContext.test.d.ts +2 -0
- package/dist/src/tooltip/tooltipContext.test.d.ts.map +1 -0
- package/dist/src/tooltip/tooltipHandler.d.ts +40 -1
- package/dist/src/tooltip/tooltipHandler.d.ts.map +1 -1
- package/dist/src/tooltip/tooltipHandler.ts +62 -1
- package/dist/src/types/encoder.d.ts +38 -3
- package/dist/src/types/rendering.d.ts +4 -3
- package/dist/src/types/viewContext.d.ts +0 -14
- package/dist/src/utils/inputBinding.d.ts +10 -2
- package/dist/src/utils/inputBinding.d.ts.map +1 -1
- package/dist/src/utils/inputBinding.js +12 -3
- 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 +17 -4
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +16 -3
- 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 +6 -10
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +22 -24
- 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.d.ts.map +1 -1
- package/dist/src/view/layerView.js +7 -5
- 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/multiscale.d.ts +35 -0
- package/dist/src/view/multiscale.d.ts.map +1 -0
- package/dist/src/view/multiscale.js +233 -0
- package/dist/src/view/multiscale.test.d.ts +2 -0
- package/dist/src/view/multiscale.test.d.ts.map +1 -0
- 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 +120 -45
- package/dist/src/view/view.d.ts +27 -18
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +298 -37
- package/dist/src/view/viewFactory.d.ts +0 -12
- package/dist/src/view/viewFactory.d.ts.map +1 -1
- package/dist/src/view/viewFactory.js +55 -25
- package/dist/src/view/viewParamRuntime.test.d.ts +2 -0
- package/dist/src/view/viewParamRuntime.test.d.ts.map +1 -0
- 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 +776 -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 +4 -4
- 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
- package/dist/src/spec/sampleView.d.ts +0 -197
- package/dist/src/view/paramMediator.d.ts +0 -149
- package/dist/src/view/paramMediator.d.ts.map +0 -1
- package/dist/src/view/paramMediator.js +0 -478
- package/dist/src/view/paramMediator.test.d.ts +0 -2
- package/dist/src/view/paramMediator.test.d.ts.map +0 -1
|
@@ -8,8 +8,13 @@ import { isArray, isObject, isString } from "vega-util";
|
|
|
8
8
|
import { loadExternalViewSpec } from "./viewUtils.js";
|
|
9
9
|
import ContainerView from "./containerView.js";
|
|
10
10
|
import ViewError from "./viewError.js";
|
|
11
|
-
import { isSelectionParameter } from "
|
|
11
|
+
import { isSelectionParameter } from "../paramRuntime/paramUtils.js";
|
|
12
12
|
import { asSelectionConfig } from "../selection/selection.js";
|
|
13
|
+
import {
|
|
14
|
+
markViewAsNonAddressable,
|
|
15
|
+
registerImportInstance,
|
|
16
|
+
} from "./viewSelectors.js";
|
|
17
|
+
import { isMultiscaleSpec, normalizeMultiscaleSpec } from "./multiscale.js";
|
|
13
18
|
|
|
14
19
|
export const VIEW_ROOT_NAME = "viewRoot";
|
|
15
20
|
|
|
@@ -28,9 +33,9 @@ export class ViewFactory {
|
|
|
28
33
|
* @typedef {import("../spec/view.js").UnitSpec} UnitSpec
|
|
29
34
|
* @typedef {import("../spec/view.js").ViewSpec} ViewSpec
|
|
30
35
|
* @typedef {import("../spec/view.js").LayerSpec} LayerSpec
|
|
36
|
+
* @typedef {import("../spec/view.js").MultiscaleSpec} MultiscaleSpec
|
|
31
37
|
* @typedef {import("../spec/view.js").VConcatSpec} VConcatSpec
|
|
32
38
|
* @typedef {import("../spec/view.js").ConcatSpec} ConcatSpec
|
|
33
|
-
* @typedef {import("../spec/sampleView.js").SampleSpec} SampleSpec
|
|
34
39
|
*
|
|
35
40
|
* @typedef {(spec: ViewSpec) => boolean} SpecGuard
|
|
36
41
|
* @typedef {(spec: ViewSpec, context: ViewContext, layoutParent?: import("./containerView.js").default, dataParent?: import("./view.js").default, defaultName?: string) => View} Factory
|
|
@@ -60,22 +65,35 @@ export class ViewFactory {
|
|
|
60
65
|
context,
|
|
61
66
|
layoutParent,
|
|
62
67
|
dataParent,
|
|
63
|
-
|
|
68
|
+
defaultName
|
|
64
69
|
)
|
|
65
70
|
);
|
|
66
71
|
|
|
67
72
|
this.addViewType(isLayerSpec, makeDefaultFactory(LayerView));
|
|
73
|
+
this.addViewType(
|
|
74
|
+
isMultiscaleSpec,
|
|
75
|
+
/** @type {Factory} */ (
|
|
76
|
+
(spec, context, layoutParent, dataParent, defaultName) =>
|
|
77
|
+
/** @type {View} */ (
|
|
78
|
+
new LayerView(
|
|
79
|
+
normalizeMultiscaleSpec(
|
|
80
|
+
/** @type {import("../spec/view.js").MultiscaleSpec} */ (
|
|
81
|
+
spec
|
|
82
|
+
)
|
|
83
|
+
),
|
|
84
|
+
context,
|
|
85
|
+
layoutParent,
|
|
86
|
+
dataParent,
|
|
87
|
+
defaultName
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
);
|
|
68
92
|
this.addViewType(isUnitSpec, makeDefaultFactory(UnitView));
|
|
69
93
|
this.addViewType(isVConcatSpec, makeDefaultFactory(ConcatView));
|
|
70
94
|
this.addViewType(isHConcatSpec, makeDefaultFactory(ConcatView));
|
|
71
95
|
this.addViewType(isConcatSpec, makeDefaultFactory(ConcatView));
|
|
72
96
|
//this.addViewType(isFacetSpec, makeDefaultFactory(FacetView));
|
|
73
|
-
|
|
74
|
-
this.addViewType(isSampleSpec, () => {
|
|
75
|
-
throw new Error(
|
|
76
|
-
"SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!"
|
|
77
|
-
);
|
|
78
|
-
});
|
|
79
97
|
}
|
|
80
98
|
|
|
81
99
|
/**
|
|
@@ -106,6 +124,12 @@ export class ViewFactory {
|
|
|
106
124
|
}
|
|
107
125
|
}
|
|
108
126
|
|
|
127
|
+
if (isSampleSpec(spec)) {
|
|
128
|
+
throw new Error(
|
|
129
|
+
"SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!"
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
109
133
|
throw new Error(
|
|
110
134
|
"Invalid spec, cannot figure out the view type from the properties: " +
|
|
111
135
|
JSON.stringify([...Object.keys(spec)])
|
|
@@ -148,6 +172,9 @@ export class ViewFactory {
|
|
|
148
172
|
) {
|
|
149
173
|
/** @type {ViewSpec} */
|
|
150
174
|
let viewSpec;
|
|
175
|
+
const importScopeName = isImportSpec(spec)
|
|
176
|
+
? (spec.name ?? null)
|
|
177
|
+
: undefined;
|
|
151
178
|
|
|
152
179
|
if (isImportSpec(spec)) {
|
|
153
180
|
/** @type {ViewSpec} */
|
|
@@ -190,11 +217,13 @@ export class ViewFactory {
|
|
|
190
217
|
);
|
|
191
218
|
|
|
192
219
|
// Wrap a unit spec at root into a grid view to get axes, etc.
|
|
220
|
+
let isImplicitRoot = false;
|
|
193
221
|
if (
|
|
194
222
|
!dataParent &&
|
|
195
223
|
this.options.wrapRoot &&
|
|
196
224
|
(isUnitSpec(viewSpec) ||
|
|
197
225
|
isLayerSpec(viewSpec) ||
|
|
226
|
+
isMultiscaleSpec(viewSpec) ||
|
|
198
227
|
hasIntervalSelection(viewSpec)) &&
|
|
199
228
|
defaultName === VIEW_ROOT_NAME
|
|
200
229
|
) {
|
|
@@ -202,6 +231,7 @@ export class ViewFactory {
|
|
|
202
231
|
name: "implicitRoot",
|
|
203
232
|
vconcat: [viewSpec],
|
|
204
233
|
};
|
|
234
|
+
isImplicitRoot = true;
|
|
205
235
|
}
|
|
206
236
|
|
|
207
237
|
const view = this.createView(
|
|
@@ -212,10 +242,20 @@ export class ViewFactory {
|
|
|
212
242
|
defaultName
|
|
213
243
|
);
|
|
214
244
|
|
|
245
|
+
if (importScopeName !== undefined) {
|
|
246
|
+
registerImportInstance(view, importScopeName);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (isImplicitRoot) {
|
|
250
|
+
markViewAsNonAddressable(view);
|
|
251
|
+
}
|
|
252
|
+
|
|
215
253
|
if (view instanceof ContainerView) {
|
|
216
254
|
await view.initializeChildren();
|
|
217
255
|
}
|
|
218
256
|
|
|
257
|
+
view.registerStepSizeInvalidation();
|
|
258
|
+
|
|
219
259
|
return view;
|
|
220
260
|
}
|
|
221
261
|
}
|
|
@@ -249,6 +289,10 @@ function applyParamsToImportedSpec(importedSpec, importSpec) {
|
|
|
249
289
|
importedSpec.name = importSpec.name;
|
|
250
290
|
}
|
|
251
291
|
|
|
292
|
+
if (importSpec.visible != null) {
|
|
293
|
+
importedSpec.visible = importSpec.visible;
|
|
294
|
+
}
|
|
295
|
+
|
|
252
296
|
const params = isArray(importSpec.params)
|
|
253
297
|
? importSpec.params
|
|
254
298
|
: isObject(importSpec.params)
|
|
@@ -314,19 +358,6 @@ export function isFacetSpec(spec) {
|
|
|
314
358
|
);
|
|
315
359
|
}
|
|
316
360
|
|
|
317
|
-
/**
|
|
318
|
-
*
|
|
319
|
-
* @param {ViewSpec} spec
|
|
320
|
-
* @returns {spec is import("../spec/view.js").AggregateSamplesSpec}
|
|
321
|
-
*/
|
|
322
|
-
export function isAggregateSamplesSpec(spec) {
|
|
323
|
-
return (
|
|
324
|
-
spec &&
|
|
325
|
-
(isUnitSpec(spec) || isLayerSpec(spec)) &&
|
|
326
|
-
"aggregateSamples" in spec
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
361
|
/**
|
|
331
362
|
*
|
|
332
363
|
* @param {object} spec
|
|
@@ -365,10 +396,9 @@ export function isConcatSpec(spec) {
|
|
|
365
396
|
|
|
366
397
|
/**
|
|
367
398
|
*
|
|
368
|
-
* @param {
|
|
369
|
-
* @returns {spec is SampleSpec}
|
|
399
|
+
* @param {object} spec
|
|
370
400
|
*/
|
|
371
|
-
|
|
401
|
+
function isSampleSpec(spec) {
|
|
372
402
|
return (
|
|
373
403
|
"samples" in spec &&
|
|
374
404
|
isObject(spec.samples) &&
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewParamRuntime.test.d.ts","sourceRoot":"","sources":["../../../src/view/viewParamRuntime.test.js"],"names":[],"mappings":""}
|
|
@@ -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":"AAiCA;;;;;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;AAED;;;;;;GAMG;AACH,0CAJW,OAAO,WAAW,EAAE,OAAO,YAC3B,YAAY,GACV,OAAO,WAAW,EAAE,OAAO,GAAG,SAAS,CAmCnD;AAED;;;;;;GAMG;AACH,2CAJW,OAAO,WAAW,EAAE,OAAO,YAC3B,aAAa,GACX,aAAa,GAAG,SAAS,CAuCrC;AAED;;;;;GAKG;AACH,8CAHW,OAAO,WAAW,EAAE,OAAO,WAC3B,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,QAyBjD;AAED;;;;;GAKG;AACH,4CAHW,OAAO,WAAW,EAAE,OAAO,GACzB,sBAAsB,EAAE,CAOpC;AAED;;;;;GAKG;AACH,kDAHW,OAAO,WAAW,EAAE,OAAO,GACzB,uBAAuB,EAAE,CAcrC;AArUD;;;;;;GAMG;AAEH;;;;;;;;;GASG;AAEH,wCAAyC,IAAI,CAAC;2BAVjC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;4BACjC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;qCAClC;IAAE,IAAI,EAAE,OAAO,WAAW,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,sBAAsB,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAE;sCAC/G;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE;8BACpC;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE;kCACvB,SAAS,GAAG,gBAAgB;iCAC5B;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE;4BACzB;IAAE,IAAI,EAAE,OAAO,WAAW,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,sBAAsB,EAAE,SAAS,CAAA;CAAE"}
|