@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
|
@@ -3,6 +3,7 @@ import { isContinuous } from "vega-scale";
|
|
|
3
3
|
|
|
4
4
|
import { LOCUS } from "./scaleResolutionConstants.js";
|
|
5
5
|
import createDomain from "../utils/domainArray.js";
|
|
6
|
+
import { getAccessorDomainKey, isScaleAccessor } from "../encoder/accessor.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @typedef {import("../utils/domainArray.js").DomainArray} DomainArray
|
|
@@ -11,10 +12,13 @@ import createDomain from "../utils/domainArray.js";
|
|
|
11
12
|
* @typedef {import("./scaleResolution.js").ScaleResolutionMember} ScaleResolutionMember
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
|
-
export default class
|
|
15
|
+
export default class DomainPlanner {
|
|
15
16
|
/** @type {() => Set<ScaleResolutionMember>} */
|
|
16
17
|
#getMembers;
|
|
17
18
|
|
|
19
|
+
/** @type {() => Set<ScaleResolutionMember>} */
|
|
20
|
+
#getDataMembers;
|
|
21
|
+
|
|
18
22
|
/** @type {() => import("../spec/channel.js").Type} */
|
|
19
23
|
#getType;
|
|
20
24
|
|
|
@@ -27,15 +31,31 @@ export default class ScaleDomainAggregator {
|
|
|
27
31
|
/** @type {any[]} */
|
|
28
32
|
#initialDomain;
|
|
29
33
|
|
|
34
|
+
/** @type {DomainArray | undefined} */
|
|
35
|
+
#configuredDomain;
|
|
36
|
+
|
|
37
|
+
#configuredDomainDirty = true;
|
|
38
|
+
|
|
39
|
+
/** @type {WeakMap<ScaleResolutionMember, import("../types/encoder.js").ScaleAccessor[]>} */
|
|
40
|
+
#accessorsByMember = new WeakMap();
|
|
41
|
+
|
|
30
42
|
/**
|
|
31
43
|
* @param {object} options
|
|
32
44
|
* @param {() => Set<ScaleResolutionMember>} options.getMembers
|
|
45
|
+
* @param {() => Set<ScaleResolutionMember>} [options.getDataMembers]
|
|
33
46
|
* @param {() => import("../spec/channel.js").Type} options.getType
|
|
34
47
|
* @param {() => number[]} options.getLocusExtent
|
|
35
48
|
* @param {(interval: ScalarDomain | ComplexDomain) => number[]} options.fromComplexInterval
|
|
36
49
|
*/
|
|
37
|
-
constructor({
|
|
50
|
+
constructor({
|
|
51
|
+
getMembers,
|
|
52
|
+
getDataMembers,
|
|
53
|
+
getType,
|
|
54
|
+
getLocusExtent,
|
|
55
|
+
fromComplexInterval,
|
|
56
|
+
}) {
|
|
38
57
|
this.#getMembers = getMembers;
|
|
58
|
+
this.#getDataMembers = getDataMembers ?? getMembers;
|
|
39
59
|
this.#getType = getType;
|
|
40
60
|
this.#getLocusExtent = getLocusExtent;
|
|
41
61
|
this.#fromComplexInterval = fromComplexInterval;
|
|
@@ -52,6 +72,10 @@ export default class ScaleDomainAggregator {
|
|
|
52
72
|
return !!this.getConfiguredDomain();
|
|
53
73
|
}
|
|
54
74
|
|
|
75
|
+
invalidateConfiguredDomain() {
|
|
76
|
+
this.#configuredDomainDirty = true;
|
|
77
|
+
}
|
|
78
|
+
|
|
55
79
|
/**
|
|
56
80
|
* Returns the configured domain or a data-derived/default domain.
|
|
57
81
|
*
|
|
@@ -76,10 +100,17 @@ export default class ScaleDomainAggregator {
|
|
|
76
100
|
* @return {DomainArray}
|
|
77
101
|
*/
|
|
78
102
|
getConfiguredDomain() {
|
|
79
|
-
|
|
103
|
+
if (!this.#configuredDomainDirty) {
|
|
104
|
+
return this.#configuredDomain;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const domain = resolveConfiguredDomain(
|
|
80
108
|
this.#getMembers(),
|
|
81
109
|
this.#fromComplexInterval
|
|
82
110
|
);
|
|
111
|
+
this.#configuredDomain = domain;
|
|
112
|
+
this.#configuredDomainDirty = false;
|
|
113
|
+
return domain;
|
|
83
114
|
}
|
|
84
115
|
|
|
85
116
|
/**
|
|
@@ -88,7 +119,11 @@ export default class ScaleDomainAggregator {
|
|
|
88
119
|
* @return {DomainArray | undefined}
|
|
89
120
|
*/
|
|
90
121
|
getDataDomain() {
|
|
91
|
-
return resolveDataDomain(
|
|
122
|
+
return resolveDataDomain(
|
|
123
|
+
this.#getDataMembers(),
|
|
124
|
+
this.#getType,
|
|
125
|
+
(member) => this.#getMemberAccessors(member)
|
|
126
|
+
);
|
|
92
127
|
}
|
|
93
128
|
|
|
94
129
|
/**
|
|
@@ -111,6 +146,39 @@ export default class ScaleDomainAggregator {
|
|
|
111
146
|
|
|
112
147
|
return false;
|
|
113
148
|
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @param {ScaleResolutionMember} member
|
|
152
|
+
* @returns {import("../types/encoder.js").ScaleAccessor[]}
|
|
153
|
+
*/
|
|
154
|
+
#getMemberAccessors(member) {
|
|
155
|
+
const cached = this.#accessorsByMember.get(member);
|
|
156
|
+
if (cached) {
|
|
157
|
+
return cached;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const encoders = member.view.mark.encoders;
|
|
161
|
+
if (!encoders) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const encoder = encoders[member.channel];
|
|
166
|
+
if (!encoder) {
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const accessors = encoder.accessors ?? [];
|
|
171
|
+
if (accessors.length === 0) {
|
|
172
|
+
return [];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const scaleAccessors = accessors
|
|
176
|
+
.filter(isScaleAccessor)
|
|
177
|
+
.filter((accessor) => !accessor.channelDef.domainInert);
|
|
178
|
+
|
|
179
|
+
this.#accessorsByMember.set(member, scaleAccessors);
|
|
180
|
+
return scaleAccessors;
|
|
181
|
+
}
|
|
114
182
|
}
|
|
115
183
|
|
|
116
184
|
/**
|
|
@@ -120,6 +188,7 @@ export default class ScaleDomainAggregator {
|
|
|
120
188
|
*/
|
|
121
189
|
function resolveConfiguredDomain(members, fromComplexInterval) {
|
|
122
190
|
const domains = Array.from(members)
|
|
191
|
+
.filter((member) => member.contributesToDomain)
|
|
123
192
|
.map((member) => member.channelDef)
|
|
124
193
|
.filter((channelDef) => channelDef.scale?.domain)
|
|
125
194
|
.map((channelDef) =>
|
|
@@ -139,18 +208,67 @@ function resolveConfiguredDomain(members, fromComplexInterval) {
|
|
|
139
208
|
/**
|
|
140
209
|
* @param {Set<ScaleResolutionMember>} members
|
|
141
210
|
* @param {() => import("../spec/channel.js").Type} getType
|
|
211
|
+
* @param {(member: ScaleResolutionMember) => import("../types/encoder.js").ScaleAccessor[]} getAccessorsForMember
|
|
142
212
|
* @returns {DomainArray | undefined}
|
|
143
213
|
*/
|
|
144
|
-
function resolveDataDomain(members, getType) {
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
214
|
+
function resolveDataDomain(members, getType, getAccessorsForMember) {
|
|
215
|
+
const type = getType();
|
|
216
|
+
|
|
217
|
+
/** @type {Map<import("../data/collector.js").default | null, Map<string, DomainArray>>} */
|
|
218
|
+
const domainsByCollector = new Map();
|
|
219
|
+
|
|
220
|
+
for (const member of members) {
|
|
221
|
+
if (!member.contributesToDomain) {
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const accessors = getAccessorsForMember(member);
|
|
226
|
+
if (accessors.length === 0) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const collector = member.view.getCollector();
|
|
231
|
+
|
|
232
|
+
for (const accessor of accessors) {
|
|
233
|
+
const domainKey = getAccessorDomainKey(accessor, type);
|
|
234
|
+
|
|
235
|
+
const collectorKey = collector ?? null;
|
|
236
|
+
let domainsForCollector = domainsByCollector.get(collectorKey);
|
|
237
|
+
if (!domainsForCollector) {
|
|
238
|
+
domainsForCollector = new Map();
|
|
239
|
+
domainsByCollector.set(collectorKey, domainsForCollector);
|
|
240
|
+
}
|
|
148
241
|
|
|
149
|
-
|
|
242
|
+
if (domainsForCollector.has(domainKey)) {
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
let domain;
|
|
247
|
+
if (collector) {
|
|
248
|
+
domain = collector.getDomain(domainKey, type, accessor);
|
|
249
|
+
} else if (accessor.constant) {
|
|
250
|
+
domain = createDomain(type);
|
|
251
|
+
domain.extend(accessor({}));
|
|
252
|
+
} else {
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
domainsForCollector.set(domainKey, domain);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (domainsByCollector.size === 0) {
|
|
150
261
|
return undefined;
|
|
151
262
|
}
|
|
152
263
|
|
|
153
|
-
|
|
264
|
+
const domain = createDomain(type);
|
|
265
|
+
for (const domainsForCollector of domainsByCollector.values()) {
|
|
266
|
+
for (const memberDomain of domainsForCollector.values()) {
|
|
267
|
+
domain.extendAll(memberDomain);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return domain;
|
|
154
272
|
}
|
|
155
273
|
|
|
156
274
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domainPlanner.test.d.ts","sourceRoot":"","sources":["../../../src/scales/domainPlanner.test.js"],"names":[],"mappings":""}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export default class ScaleInstanceManager {
|
|
2
2
|
/**
|
|
3
3
|
* @param {object} options
|
|
4
|
-
* @param {() => import("../
|
|
4
|
+
* @param {() => { createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction }} options.getParamRuntime
|
|
5
5
|
* @param {() => void} options.onRangeChange
|
|
6
6
|
* @param {() => void} [options.onDomainChange]
|
|
7
7
|
* @param {() => import("../genome/genomeStore.js").default | undefined} [options.getGenomeStore]
|
|
8
8
|
*/
|
|
9
|
-
constructor({
|
|
10
|
-
|
|
9
|
+
constructor({ getParamRuntime, onRangeChange, onDomainChange, getGenomeStore, }: {
|
|
10
|
+
getParamRuntime: () => {
|
|
11
|
+
createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction;
|
|
12
|
+
};
|
|
11
13
|
onRangeChange: () => void;
|
|
12
14
|
onDomainChange?: () => void;
|
|
13
15
|
getGenomeStore?: () => import("../genome/genomeStore.js").default | undefined;
|
|
@@ -35,6 +37,7 @@ export default class ScaleInstanceManager {
|
|
|
35
37
|
* @returns {void}
|
|
36
38
|
*/
|
|
37
39
|
withDomainNotificationsSuppressed(callback: () => void): void;
|
|
40
|
+
dispose(): void;
|
|
38
41
|
#private;
|
|
39
42
|
}
|
|
40
43
|
//# sourceMappingURL=scaleInstanceManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleInstanceManager.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleInstanceManager.js"],"names":[],"mappings":"AAMA;IA0BI;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"scaleInstanceManager.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleInstanceManager.js"],"names":[],"mappings":"AAMA;IA0BI;;;;;;OAMG;IACH,iFALG;QAAkH,eAAe,EAAzH,MAAM;YAAE,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,0BAA0B,EAAE,eAAe,CAAA;SAAE;QAC5E,aAAa,EAAjC,MAAM,IAAI;QACW,cAAc,GAAnC,MAAM,IAAI;QAC6D,cAAc,GAArF,MAAM,OAAO,0BAA0B,EAAE,OAAO,GAAG,SAAS;KAA0B,EAYhG;IAED;eA1CkC,OAAO,kBAAkB,EAAE,KAAK;MA4CjE;IAED;;OAEG;IACH,kBAFa,OAAO,qBAAqB,EAAE,OAAO,CASjD;IAED;;;OAGG;IACH,mBAHW,OAAO,kBAAkB,EAAE,KAAK;eA3DT,OAAO,kBAAkB,EAAE,KAAK;MAgFjE;IAoBD;;OAEG;IACH,wBAFW,OAAO,kBAAkB,EAAE,KAAK,QAc1C;IAED;;;OAGG;IACH,4CAHW,MAAM,IAAI,GACR,IAAI,CAShB;IAmFD,gBAGC;;CACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isArray } from "vega-util";
|
|
2
2
|
|
|
3
3
|
import createScale, { configureScale } from "../scale/scale.js";
|
|
4
|
-
import { isExprRef } from "../
|
|
4
|
+
import { isExprRef } from "../paramRuntime/paramUtils.js";
|
|
5
5
|
import { isScaleLocus } from "../genome/scaleLocus.js";
|
|
6
6
|
|
|
7
7
|
export default class ScaleInstanceManager {
|
|
@@ -13,11 +13,11 @@ export default class ScaleInstanceManager {
|
|
|
13
13
|
/** @type {ScaleWithProps | undefined} */
|
|
14
14
|
#scale;
|
|
15
15
|
|
|
16
|
-
/** @type {Set<import("../
|
|
16
|
+
/** @type {Set<import("../paramRuntime/types.js").ExprRefFunction>} */
|
|
17
17
|
#rangeExprRefListeners = new Set();
|
|
18
18
|
|
|
19
|
-
/** @type {() => import("../
|
|
20
|
-
#
|
|
19
|
+
/** @type {() => { createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction }} */
|
|
20
|
+
#getParamRuntime;
|
|
21
21
|
|
|
22
22
|
/** @type {() => void} */
|
|
23
23
|
#onRangeChange;
|
|
@@ -32,18 +32,18 @@ export default class ScaleInstanceManager {
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @param {object} options
|
|
35
|
-
* @param {() => import("../
|
|
35
|
+
* @param {() => { createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction }} options.getParamRuntime
|
|
36
36
|
* @param {() => void} options.onRangeChange
|
|
37
37
|
* @param {() => void} [options.onDomainChange]
|
|
38
38
|
* @param {() => import("../genome/genomeStore.js").default | undefined} [options.getGenomeStore]
|
|
39
39
|
*/
|
|
40
40
|
constructor({
|
|
41
|
-
|
|
41
|
+
getParamRuntime,
|
|
42
42
|
onRangeChange,
|
|
43
43
|
onDomainChange,
|
|
44
44
|
getGenomeStore,
|
|
45
45
|
}) {
|
|
46
|
-
this.#
|
|
46
|
+
this.#getParamRuntime = getParamRuntime;
|
|
47
47
|
this.#onRangeChange = onRangeChange;
|
|
48
48
|
this.#onDomainChange = onDomainChange;
|
|
49
49
|
this.#getGenomeStore = getGenomeStore;
|
|
@@ -167,12 +167,13 @@ export default class ScaleInstanceManager {
|
|
|
167
167
|
|
|
168
168
|
const props = scale.props;
|
|
169
169
|
this.#rangeExprRefListeners.forEach((fn) => fn.invalidate());
|
|
170
|
+
this.#rangeExprRefListeners.clear();
|
|
170
171
|
|
|
171
172
|
const resolved = resolveRange({
|
|
172
173
|
range: props.range,
|
|
173
174
|
reverse: props.reverse,
|
|
174
175
|
createExpression: (expr) =>
|
|
175
|
-
this.#
|
|
176
|
+
this.#getParamRuntime().createExpression(expr),
|
|
176
177
|
registerExpr: (fn) => this.#rangeExprRefListeners.add(fn),
|
|
177
178
|
});
|
|
178
179
|
|
|
@@ -216,6 +217,11 @@ export default class ScaleInstanceManager {
|
|
|
216
217
|
|
|
217
218
|
notifyRange();
|
|
218
219
|
}
|
|
220
|
+
|
|
221
|
+
dispose() {
|
|
222
|
+
this.#rangeExprRefListeners.forEach((fn) => fn.invalidate());
|
|
223
|
+
this.#rangeExprRefListeners.clear();
|
|
224
|
+
}
|
|
219
225
|
}
|
|
220
226
|
|
|
221
227
|
/**
|
|
@@ -261,8 +267,8 @@ function withScaleInterceptors(
|
|
|
261
267
|
* @param {object} options
|
|
262
268
|
* @param {import("../spec/scale.js").Scale["range"]} options.range
|
|
263
269
|
* @param {boolean | undefined} options.reverse
|
|
264
|
-
* @param {(expr: string) => import("../
|
|
265
|
-
* @param {(fn: import("../
|
|
270
|
+
* @param {(expr: string) => import("../paramRuntime/types.js").ExprRefFunction} options.createExpression
|
|
271
|
+
* @param {(fn: import("../paramRuntime/types.js").ExprRefFunction) => void} options.registerExpr
|
|
266
272
|
* @returns {{
|
|
267
273
|
* dynamic: true,
|
|
268
274
|
* evaluate: () => any[],
|
|
@@ -299,7 +305,7 @@ function resolveRange({ range, reverse, createExpression, registerExpr }) {
|
|
|
299
305
|
expressions = range.map((elem) => {
|
|
300
306
|
if (isExprRef(elem)) {
|
|
301
307
|
const fn = createExpression(elem.expr);
|
|
302
|
-
fn.
|
|
308
|
+
fn.subscribe(listener);
|
|
303
309
|
registerExpr(fn);
|
|
304
310
|
return () => fn(null);
|
|
305
311
|
}
|
|
@@ -27,6 +27,12 @@ export default class ScaleInteractionController {
|
|
|
27
27
|
getZoomExtent(): number[];
|
|
28
28
|
isZoomable(): boolean;
|
|
29
29
|
isZoomingSupported(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @param {number[]} previousDomain
|
|
32
|
+
* @param {number[]} newDomain
|
|
33
|
+
* @returns {"restore" | "animate" | "notify" | "none"}
|
|
34
|
+
*/
|
|
35
|
+
getDomainChangeAction(previousDomain: number[], newDomain: number[]): "restore" | "animate" | "notify" | "none";
|
|
30
36
|
/**
|
|
31
37
|
* Return true if the scale is zoomable and the current domain differs from the initial domain.
|
|
32
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleInteractionController.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleInteractionController.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaleInteractionController.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleInteractionController.js"],"names":[],"mappings":"AAoBA;;;;;;;GAOG;AAEH;IAsBI;;;;;;;;OAQG;IACH,wHAPG;QAAsC,QAAQ,EAAtC,MAAM,cAAc;QACkC,WAAW,EAAjE,MAAM,OAAO,sBAAsB,EAAE,OAAO;QACpB,wBAAwB,EAAhD,MAAM,MAAM,EAAE;QACU,cAAc,EAAtC,MAAM,MAAM,EAAE;QAC8C,mBAAmB,EAA/E,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,KAAK,MAAM,EAAE;QAC1B,eAAe,EAAvC,MAAM,MAAM,EAAE;KACxB,EAeA;IAED,0BAUC;IAED,sBAEC;IAED,8BAGC;IAED;;;;OAIG;IACH,sCAJW,MAAM,EAAE,aACR,MAAM,EAAE,GACN,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAarD;IAED;;;;OAIG;IACH,oBAQC;IAED;;;;;;;OAOG;IACH,kBALW,MAAM,eACN,MAAM,OACN,MAAM,GACJ,OAAO,CA2BnB;IAED;;;;;;OAMG;IACH,eAJW,aAAa,GAAG,aAAa,aAC7B,OAAO,GAAG,MAAM,iBA+D1B;IASD;;;;OAIG;IACH,qBAcC;IAED;;OAEG;IACH,uBAOC;;CACJ;4BA5PY,OAAO,kBAAkB,EAAE,aAAa;2BACxC,OAAO,kBAAkB,EAAE,YAAY;4BACvC,OAAO,kBAAkB,EAAE,aAAa;yBACxC,OAAO,kBAAkB,EAAE,UAAU;wBACrC,OAAO,qBAAqB,EAAE,SAAS;6BACvC,SAAS,GAAG;IAAE,KAAK,EAAE,OAAO,kBAAkB,EAAE,KAAK,CAAA;CAAE"}
|
|
@@ -11,11 +11,12 @@ import {
|
|
|
11
11
|
zoomLog,
|
|
12
12
|
zoomPow,
|
|
13
13
|
} from "vega-util";
|
|
14
|
-
import { isContinuous } from "vega-scale";
|
|
14
|
+
import { isContinuous, isDiscrete } from "vega-scale";
|
|
15
15
|
import { easeCubicInOut } from "d3-ease";
|
|
16
16
|
|
|
17
17
|
import eerp from "../utils/eerp.js";
|
|
18
18
|
import { shallowArrayEquals } from "../utils/arrayUtils.js";
|
|
19
|
+
import { createCancelToken } from "../utils/transition.js";
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @typedef {import("../spec/scale.js").NumericDomain} NumericDomain
|
|
@@ -45,6 +46,9 @@ export default class ScaleInteractionController {
|
|
|
45
46
|
/** @type {() => number[]} */
|
|
46
47
|
#getGenomeExtent;
|
|
47
48
|
|
|
49
|
+
/** @type {{ canceled: boolean } | null} */
|
|
50
|
+
#zoomTransitionToken = null;
|
|
51
|
+
|
|
48
52
|
/**
|
|
49
53
|
* @param {object} options
|
|
50
54
|
* @param {() => ScaleWithProps} options.getScale
|
|
@@ -87,7 +91,26 @@ export default class ScaleInteractionController {
|
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
isZoomingSupported() {
|
|
90
|
-
|
|
94
|
+
const type = this.#getScale().type;
|
|
95
|
+
return isContinuous(type) && !isDiscrete(type);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @param {number[]} previousDomain
|
|
100
|
+
* @param {number[]} newDomain
|
|
101
|
+
* @returns {"restore" | "animate" | "notify" | "none"}
|
|
102
|
+
*/
|
|
103
|
+
getDomainChangeAction(previousDomain, newDomain) {
|
|
104
|
+
if (shallowArrayEquals(newDomain, previousDomain)) {
|
|
105
|
+
return "none";
|
|
106
|
+
}
|
|
107
|
+
if (this.isZoomable()) {
|
|
108
|
+
return "restore";
|
|
109
|
+
}
|
|
110
|
+
if (this.isZoomingSupported()) {
|
|
111
|
+
return "animate";
|
|
112
|
+
}
|
|
113
|
+
return "notify";
|
|
91
114
|
}
|
|
92
115
|
|
|
93
116
|
/**
|
|
@@ -178,10 +201,14 @@ export default class ScaleInteractionController {
|
|
|
178
201
|
const ac = from[0] == to[0];
|
|
179
202
|
const bc = from[1] == to[1];
|
|
180
203
|
|
|
181
|
-
|
|
204
|
+
this.#cancelZoomTransition();
|
|
205
|
+
const cancelToken = createCancelToken();
|
|
206
|
+
this.#zoomTransitionToken = cancelToken;
|
|
207
|
+
|
|
182
208
|
await animator.transition({
|
|
183
209
|
duration,
|
|
184
210
|
easingFunction: easeCubicInOut,
|
|
211
|
+
cancelToken,
|
|
185
212
|
onUpdate: (t) => {
|
|
186
213
|
const w = eerp(fw, tw, t);
|
|
187
214
|
const wt = fw == tw ? t : (fw - w) / (fw - tw);
|
|
@@ -194,13 +221,24 @@ export default class ScaleInteractionController {
|
|
|
194
221
|
},
|
|
195
222
|
});
|
|
196
223
|
|
|
224
|
+
if (this.#zoomTransitionToken === cancelToken) {
|
|
225
|
+
this.#zoomTransitionToken = null;
|
|
226
|
+
}
|
|
197
227
|
scale.domain(to);
|
|
198
228
|
} else {
|
|
229
|
+
this.#cancelZoomTransition();
|
|
199
230
|
scale.domain(to);
|
|
200
231
|
animator?.requestRender();
|
|
201
232
|
}
|
|
202
233
|
}
|
|
203
234
|
|
|
235
|
+
#cancelZoomTransition() {
|
|
236
|
+
if (this.#zoomTransitionToken) {
|
|
237
|
+
this.#zoomTransitionToken.canceled = true;
|
|
238
|
+
this.#zoomTransitionToken = null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
204
242
|
/**
|
|
205
243
|
* Resets the current domain to the initial one
|
|
206
244
|
*
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reconfigures scale domains for resolutions used by the given view(s).
|
|
3
|
-
*
|
|
4
|
-
* Use this for data-driven updates where only domains need refreshing.
|
|
5
|
-
*
|
|
6
|
-
* TODO: This should be made unnecessary. Collectors should trigger the reconfiguration
|
|
7
|
-
* for those views that get their data from the collector.
|
|
8
|
-
*
|
|
9
|
-
* TODO: This may reconfigure channels that are not affected by the change.
|
|
10
|
-
* Causes performance issues with domains that are extracted from data.
|
|
11
|
-
*
|
|
12
|
-
* @param {import("../view/view.js").default | import("../view/view.js").default[]} fromViews
|
|
13
|
-
* @param {(view: import("../view/view.js").default) => boolean} [viewFilter]
|
|
14
|
-
*/
|
|
15
|
-
export function reconfigureScaleDomains(fromViews: import("../view/view.js").default | import("../view/view.js").default[], viewFilter?: (view: import("../view/view.js").default) => boolean): void;
|
|
16
1
|
/**
|
|
17
2
|
* @template {ChannelWithScale}[T=ChannelWithScale]
|
|
18
3
|
*
|
|
@@ -20,7 +5,7 @@ export function reconfigureScaleDomains(fromViews: import("../view/view.js").def
|
|
|
20
5
|
* @prop {import("../view/unitView.js").default} view TODO: Get rid of the view reference
|
|
21
6
|
* @prop {T} channel
|
|
22
7
|
* @prop {import("../spec/channel.js").ChannelDefWithScale} channelDef
|
|
23
|
-
* @prop {
|
|
8
|
+
* @prop {boolean} contributesToDomain
|
|
24
9
|
*/
|
|
25
10
|
/**
|
|
26
11
|
* Resolves a shared scale for a channel by merging scale properties and domains
|
|
@@ -29,6 +14,16 @@ export function reconfigureScaleDomains(fromViews: import("../view/view.js").def
|
|
|
29
14
|
* notifications, while delegating domain aggregation, scale instance setup, and
|
|
30
15
|
* interaction logic to focused helpers.
|
|
31
16
|
*
|
|
17
|
+
* Documentation overview of current concerns this class (and its helpers) deal with:
|
|
18
|
+
* - Resolution membership and rules (shared/independent/forced/excluded, visibility, registration).
|
|
19
|
+
* - Scale property aggregation (merge props, channel overrides, unique scale names).
|
|
20
|
+
* - Domain computation and caching (configured/data unions, defaults, indexer stability, subscriptions).
|
|
21
|
+
* - Scale instance lifecycle (create, reconfigure props, apply domains, notify changes).
|
|
22
|
+
* - Interaction and zoom (zoom/pan/reset coordination, snapshots, zoom extents).
|
|
23
|
+
* - Rendering integration (range textures, axis sizing/positioning).
|
|
24
|
+
* - Locus-specific conversions (complex intervals, genome extent bindings).
|
|
25
|
+
* - Diagnostics and edge cases (ordinal unknown, nice/zero/padding, log warnings).
|
|
26
|
+
*
|
|
32
27
|
* @implements {ScaleResolutionApi}
|
|
33
28
|
*/
|
|
34
29
|
export default class ScaleResolution implements ScaleResolutionApi {
|
|
@@ -61,6 +56,13 @@ export default class ScaleResolution implements ScaleResolutionApi {
|
|
|
61
56
|
* @returns {() => boolean}
|
|
62
57
|
*/
|
|
63
58
|
registerMember(member: ScaleResolutionMember): () => boolean;
|
|
59
|
+
dispose(): void;
|
|
60
|
+
/**
|
|
61
|
+
* @param {import("../data/collector.js").default} collector
|
|
62
|
+
* @param {Iterable<import("../types/encoder.js").ScaleAccessor>} accessors
|
|
63
|
+
* @returns {() => void}
|
|
64
|
+
*/
|
|
65
|
+
registerCollectorSubscriptions(collector: import("../data/collector.js").default, accessors: Iterable<import("../types/encoder.js").ScaleAccessor>): () => void;
|
|
64
66
|
/**
|
|
65
67
|
* Reconfigures the scale: updates domain and other settings.
|
|
66
68
|
*
|
|
@@ -72,6 +74,7 @@ export default class ScaleResolution implements ScaleResolutionApi {
|
|
|
72
74
|
* Reconfigures only the effective domain (configured + data-derived).
|
|
73
75
|
*
|
|
74
76
|
* Use this when data changes but the scale membership and properties are stable.
|
|
77
|
+
*
|
|
75
78
|
*/
|
|
76
79
|
reconfigureDomain(): void;
|
|
77
80
|
/**
|
|
@@ -188,7 +191,7 @@ export type ScaleResolutionMember<T extends import("../spec/channel.js").Channel
|
|
|
188
191
|
view: import("../view/unitView.js").default;
|
|
189
192
|
channel: T;
|
|
190
193
|
channelDef: import("../spec/channel.js").ChannelDefWithScale;
|
|
191
|
-
|
|
194
|
+
contributesToDomain: boolean;
|
|
192
195
|
};
|
|
193
196
|
import { INDEX } from "./scaleResolutionConstants.js";
|
|
194
197
|
import { LOCUS } from "./scaleResolutionConstants.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleResolution.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleResolution.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaleResolution.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleResolution.js"],"names":[],"mappings":"AAuCA;;;;;;;;GAQG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH;IA8CI;;OAEG;IACH,2DAkCC;IAjCG,8CAAsB;IACtB,0FAA0F;IAC1F,MADW,OAAO,oBAAoB,EAAE,IAAI,CAC5B;IAEhB,iEAAiE;IACjE,MADW,MAAM,CACI;IAoEzB,2BASC;IAqBD;;;;;;;OAOG;IACH,4KAEC;IAED;;;OAGG;IACH,+KAEC;IA6ED;;;OAGG;IACH,uBAHW,qBAAqB,GACnB,MAAM,OAAO,CAYzB;IAED,gBAIC;IAWD;;;;OAIG;IACH,0CAJW,OAAO,sBAAsB,EAAE,OAAO,aACtC,QAAQ,CAAC,OAAO,qBAAqB,EAAE,aAAa,CAAC,GACnD,MAAM,IAAI,CAkCtB;IA4HD;;;;;OAKG;IACH,oBAUC;IAED;;;;;OAKG;IACH,0BAuBC;IAuGD;;OAEG;IACH;eAlkBkC,OAAO,kBAAkB,EAAE,KAAK;MAykBjE;IAED;;;;;;OAMG;IACH;eAllBkC,OAAO,kBAAkB,EAAE,KAAK;MAolBjE;IAED;;;;OAIG;IACH;eA3lBkC,OAAO,kBAAkB,EAAE,KAAK;MAomBjE;IAED,mBAEC;IAED;;;;OAIG;IACH,+DAEC;IAED;;OAEG;IACH,oBAFa,mFAA6B,CAMzC;IAED;;;;OAIG;IACH,oBAEC;IAED;;OAEG;IACH,sBAGC;IAED;;;;;;;OAOG;IACH,kBALW,MAAM,eACN,MAAM,OACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;OAMG;IACH,eAJW,mFAA6B,aAC7B,OAAO,GAAG,MAAM,iBAK1B;IAED;;;;OAIG;IACH,qBAEC;IAED;;;;;OAKG;IACH,uBAEC;IAED;;;;;;;OAOG;IACH,wBAoBC;IAED;;;;;OAKG;IACH,uBAFW,MAAM,yDAUhB;IAED;;OAEG;IACH,iBAFW,MAAM,yDAIhB;IAED;;;OAGG;IACH,qBAHW,MAAM,+CAAmB,GACvB,MAAM,CAIlB;IAED;;;OAGG;IACH,8BAHW,kFAA4B,GAC1B,MAAM,EAAE,CAOpB;;CACJ;kCAxyB+B,CAAC,SAApB,6CAAkB;;;;UAGrB,OAAO,qBAAqB,EAAE,OAAO;aACrC,CAAC;gBACD,OAAO,oBAAoB,EAAE,mBAAmB;yBAChD,OAAO;;sBAvBV,+BAA+B;sBAA/B,+BAA+B;wBAA/B,+BAA+B;wBAA/B,+BAA+B;6BAA/B,+BAA+B"}
|