@genome-spy/core 0.68.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 +12108 -10682
- package/dist/bundle/index.js +119 -119
- package/dist/schema.json +6224 -6319
- package/dist/src/data/dataFlow.d.ts.map +1 -1
- package/dist/src/data/dataFlow.js +10 -0
- package/dist/src/data/flowNode.d.ts +25 -10
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +66 -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/sources/dataSource.js +2 -2
- 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/singleAxisWindowedSource.js +1 -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 +41 -11
- 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/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 +8 -4
- package/dist/src/encoder/accessor.d.ts.map +1 -1
- package/dist/src/encoder/accessor.js +10 -10
- package/dist/src/encoder/encoder.js +5 -5
- 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/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.js +1 -1
- package/dist/src/gl/glslScaleGenerator.js +1 -1
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +22 -30
- 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/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/scaleResolution.d.ts +1 -0
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +7 -1
- package/dist/src/selection/selection.js +1 -1
- package/dist/src/spec/coreSchemaRoot.d.ts +53 -0
- package/dist/src/spec/root.d.ts +1 -1
- package/dist/src/spec/view.d.ts +114 -33
- 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 +1 -1
- 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/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +12 -3
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +8 -3
- 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 +3 -20
- package/dist/src/view/layerView.d.ts.map +1 -1
- package/dist/src/view/layerView.js +4 -2
- 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/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +10 -4
- package/dist/src/view/view.d.ts +5 -4
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +205 -28
- 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 +35 -24
- 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.map +1 -1
- package/dist/src/view/viewSelectors.js +8 -5
- package/package.json +3 -3
- package/dist/src/spec/sampleView.d.ts +0 -197
- package/dist/src/view/paramMediator.d.ts +0 -168
- package/dist/src/view/paramMediator.d.ts.map +0 -1
- package/dist/src/view/paramMediator.js +0 -545
- package/dist/src/view/paramMediator.test.d.ts +0 -2
- package/dist/src/view/paramMediator.test.d.ts.map +0 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {
|
|
2
|
+
* @param {{
|
|
3
|
+
* paramConfigs: ReadonlyMap<string, import("../spec/parameter.js").Parameter>,
|
|
4
|
+
* setValue: (name: string, value: any) => void,
|
|
5
|
+
* getValue: (name: string) => any
|
|
6
|
+
* }} mediator
|
|
3
7
|
*/
|
|
4
|
-
export default function createBindingInputs(mediator:
|
|
8
|
+
export default function createBindingInputs(mediator: {
|
|
9
|
+
paramConfigs: ReadonlyMap<string, import("../spec/parameter.js").Parameter>;
|
|
10
|
+
setValue: (name: string, value: any) => void;
|
|
11
|
+
getValue: (name: string) => any;
|
|
12
|
+
}): import("lit-html").TemplateResult<2 | 1 | 3>[];
|
|
5
13
|
//# sourceMappingURL=inputBinding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputBinding.d.ts","sourceRoot":"","sources":["../../../src/utils/inputBinding.js"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"inputBinding.d.ts","sourceRoot":"","sources":["../../../src/utils/inputBinding.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,sDANW;IACN,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,sBAAsB,EAAE,SAAS,CAAC,CAAC;IAC5E,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAA;CAChC,kDA+IH"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import { debounce } from "./debounce.js";
|
|
3
3
|
import { tickStep } from "d3-array";
|
|
4
|
-
import { isVariableParameter } from "../
|
|
4
|
+
import { isVariableParameter } from "../paramRuntime/paramUtils.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {{
|
|
8
|
+
* paramConfigs: ReadonlyMap<string, import("../spec/parameter.js").Parameter>,
|
|
9
|
+
* setValue: (name: string, value: any) => void,
|
|
10
|
+
* getValue: (name: string) => any
|
|
11
|
+
* }} mediator
|
|
8
12
|
*/
|
|
9
13
|
export default function createBindingInputs(mediator) {
|
|
10
14
|
const random = Math.floor(Math.random() * 0xffffff).toString(16);
|
|
@@ -22,7 +26,12 @@ export default function createBindingInputs(mediator) {
|
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
const name = param.name;
|
|
25
|
-
const setter =
|
|
29
|
+
const setter = (
|
|
30
|
+
/** @type {any} */
|
|
31
|
+
value
|
|
32
|
+
) => {
|
|
33
|
+
mediator.setValue(name, value);
|
|
34
|
+
};
|
|
26
35
|
const value = mediator.getValue(name);
|
|
27
36
|
const label = bind.name ?? name;
|
|
28
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowBuilder.d.ts","sourceRoot":"","sources":["../../../src/view/flowBuilder.js"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,gFALW,QAAQ,eAER,CAAC,IAAI,6BAAM,KAAK,OAAO,gCACvB,CAAC,IAAI,6BAAM,KAAK,OAAO,YAoPjC;AAuBD;;;;;;GAMG;AACH,2CAFW,OAAO,eAAe,EAAE,OAAO;;;
|
|
1
|
+
{"version":3,"file":"flowBuilder.d.ts","sourceRoot":"","sources":["../../../src/view/flowBuilder.js"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,gFALW,QAAQ,eAER,CAAC,IAAI,6BAAM,KAAK,OAAO,gCACvB,CAAC,IAAI,6BAAM,KAAK,OAAO,YAoPjC;AAuBD;;;;;;GAMG;AACH,2CAFW,OAAO,eAAe,EAAE,OAAO;;;IAoH5B;;;OAGG;;EAYhB;AAgCD;;;;;;GAMG;AACH,4BAFwB,CAAC,SAAZ,qCAAU,cAFZ,CAAC,iBACA,uCAAW;;;0BAwBG,OAAO,CAAC,QAAQ,CAAC,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAC;EAkB/E;qBAxfoB,qBAAqB;sBAPpB,sBAAsB"}
|
|
@@ -316,10 +316,11 @@ export function linearizeLocusAccess(view) {
|
|
|
316
316
|
const rewrittenEncoding = {};
|
|
317
317
|
|
|
318
318
|
// Use mark.encoding so we see the same channel defs that encoders consume,
|
|
319
|
-
// including inherited channels and mark defaults.
|
|
320
|
-
//
|
|
321
|
-
//
|
|
319
|
+
// including inherited channels and mark defaults. Keep the configured
|
|
320
|
+
// encoding too so we can avoid rewriting synthesized channels (e.g., x2
|
|
321
|
+
// introduced by mark defaults/fixups).
|
|
322
322
|
const encoding = view.mark.encoding;
|
|
323
|
+
const configuredEncoding = view.getEncoding();
|
|
323
324
|
|
|
324
325
|
/** @type {{ channel: Channel, chromPosDef: import("../spec/channel.js").ChromPosDef}[]} */
|
|
325
326
|
const channelsAndChromPosDefs = [];
|
|
@@ -328,6 +329,13 @@ export function linearizeLocusAccess(view) {
|
|
|
328
329
|
// that share the chromosome field and channel.
|
|
329
330
|
for (const [c, channelDef] of Object.entries(encoding)) {
|
|
330
331
|
const channel = /** @type {Channel} */ (c);
|
|
332
|
+
if (
|
|
333
|
+
getPrimaryChannel(channel) !== channel &&
|
|
334
|
+
!(channel in configuredEncoding)
|
|
335
|
+
) {
|
|
336
|
+
continue;
|
|
337
|
+
}
|
|
338
|
+
|
|
331
339
|
if (
|
|
332
340
|
isPositionalChannel(channel) &&
|
|
333
341
|
!Array.isArray(channelDef) &&
|
|
@@ -369,6 +377,7 @@ export function linearizeLocusAccess(view) {
|
|
|
369
377
|
/** @type {any} */
|
|
370
378
|
const newFieldDef = {
|
|
371
379
|
...(view.spec.encoding?.[channel] ??
|
|
380
|
+
configuredEncoding[channel] ??
|
|
372
381
|
encoding[channel] ??
|
|
373
382
|
{}),
|
|
374
383
|
field: linearizedField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridChild.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridChild.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gridChild.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridChild.js"],"names":[],"mappings":"AAysBA;;;GAGG;AACH,iDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA8BjD;AAED;;;GAGG;AACH,uDAHW,OAAO,oBAAoB,EAAE,cAAc,GACzC,OAAO,oBAAoB,EAAE,QAAQ,CA6CjD;AAtwBD;IACI;;;;;;OAMG;IAEH;;;;OAIG;IACH,kBAJW,OAAO,YAAY,EAAE,OAAO,gBAC5B,OAAO,qBAAqB,EAAE,OAAO,UACrC,MAAM,EAgGhB;IA7FG,oDAAgC;IAChC,mCAAgB;IAChB,eAAoB;IAEpB,uBAAuB;IACvB,YADW,QAAQ,CACQ;IAE3B,uBAAuB;IACvB,kBADW,QAAQ,CACc;IAEjC,sFAAsF;IACtF,MADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAC/D;IAEd,+FAA+F;IAC/F,WADW,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAC9D;IAEnB,mFAAmF;IACnF,YADW,OAAO,CAAC,MAAM,CAAC,OAAO,gBAAgB,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAC3D;IAEpB,4BAA4B;IAC5B,eADW,aAAa,CACM;IAE9B,uBAAuB;IACvB,OADW,QAAQ,CACG;IAEtB,wBAAwB;IACxB,QADW,SAAS,CACQ;IAgahC,sEAiBC;IAED;;OAEG;IACH,4BAwKC;IAED;;OAEG;IACH,yBAWC;IAED,uBAqBC;IAED,iCAEC;;CACJ;qBAxrBoB,gBAAgB;qBANK,gBAAgB;yBADjC,oBAAoB;sBASvB,gBAAgB;0BACZ,oBAAoB;sBALxB,wBAAwB;oBAF1B,sBAAsB"}
|
|
@@ -137,7 +137,7 @@ export default class GridChild {
|
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
// TODO: If the child is a LayerView, selection params should be pulled from its children as well
|
|
140
|
-
for (const [name, param] of view.
|
|
140
|
+
for (const [name, param] of view.paramRuntime.paramConfigs) {
|
|
141
141
|
if (!("select" in param)) {
|
|
142
142
|
continue;
|
|
143
143
|
}
|
|
@@ -199,8 +199,13 @@ export default class GridChild {
|
|
|
199
199
|
])
|
|
200
200
|
);
|
|
201
201
|
|
|
202
|
-
const selectionExpr = view.
|
|
203
|
-
const setter =
|
|
202
|
+
const selectionExpr = view.paramRuntime.createExpression(name);
|
|
203
|
+
const setter = (
|
|
204
|
+
/** @type {import("../../types/selectionTypes.js").IntervalSelection} */
|
|
205
|
+
selection
|
|
206
|
+
) => {
|
|
207
|
+
view.paramRuntime.setValue(name, selection);
|
|
208
|
+
};
|
|
204
209
|
|
|
205
210
|
if (param.value) {
|
|
206
211
|
setter({ type: "interval", intervals: param.value });
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
export default class SelectionRect extends LayerView {
|
|
2
|
-
/**
|
|
3
|
-
* @param {import("./gridChild.js").default} gridChild
|
|
4
|
-
* @param {import("../paramMediator.js").ExprRefFunction} selectionExpr
|
|
5
|
-
* @param {import("../../spec/parameter.js").BrushConfig} [brushConfig]
|
|
6
|
-
*/
|
|
7
|
-
constructor(gridChild: import("./gridChild.js").default, selectionExpr: import("../paramMediator.js").ExprRefFunction, brushConfig?: import("../../spec/parameter.js").BrushConfig);
|
|
8
2
|
/**
|
|
9
3
|
* @typedef {import("../../spec/channel.js").PrimaryPositionalChannel} PrimaryPositionalChannel
|
|
10
4
|
* @typedef {import("../../types/selectionTypes.js").IntervalSelection} IntervalSelection
|
|
11
5
|
*/
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param {import("./gridChild.js").default} gridChild
|
|
8
|
+
* @param {import("../../paramRuntime/types.js").ExprRefFunction} selectionExpr
|
|
9
|
+
* @param {import("../../spec/parameter.js").BrushConfig} [brushConfig]
|
|
10
|
+
*/
|
|
11
|
+
constructor(gridChild: import("./gridChild.js").default, selectionExpr: import("../../paramRuntime/types.js").ExprRefFunction, brushConfig?: import("../../spec/parameter.js").BrushConfig);
|
|
16
12
|
}
|
|
17
13
|
import LayerView from "../layerView.js";
|
|
18
14
|
//# sourceMappingURL=selectionRect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectionRect.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/selectionRect.js"],"names":[],"mappings":"AAIA;
|
|
1
|
+
{"version":3,"file":"selectionRect.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/selectionRect.js"],"names":[],"mappings":"AAIA;IACI;;;OAGG;IAEH;;;;OAIG;IACH,uBAJW,OAAO,gBAAgB,EAAE,OAAO,iBAChC,OAAO,6BAA6B,EAAE,eAAe,gBACrD,OAAO,yBAAyB,EAAE,WAAW,EAgKvD;CACJ;sBA7KqB,iBAAiB"}
|
|
@@ -8,15 +8,9 @@ export default class SelectionRect extends LayerView {
|
|
|
8
8
|
* @typedef {import("../../types/selectionTypes.js").IntervalSelection} IntervalSelection
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
/** @type {import("../paramMediator.js").ExprRefFunction} */
|
|
12
|
-
_selectionExpr;
|
|
13
|
-
|
|
14
|
-
/** @type {() => void} */
|
|
15
|
-
_selectionListener;
|
|
16
|
-
|
|
17
11
|
/**
|
|
18
12
|
* @param {import("./gridChild.js").default} gridChild
|
|
19
|
-
* @param {import("
|
|
13
|
+
* @param {import("../../paramRuntime/types.js").ExprRefFunction} selectionExpr
|
|
20
14
|
* @param {import("../../spec/parameter.js").BrushConfig} [brushConfig]
|
|
21
15
|
*/
|
|
22
16
|
constructor(gridChild, selectionExpr, brushConfig = {}) {
|
|
@@ -156,10 +150,7 @@ export default class SelectionRect extends LayerView {
|
|
|
156
150
|
|
|
157
151
|
markViewAsNonAddressable(this, { skipSubtree: true });
|
|
158
152
|
|
|
159
|
-
|
|
160
|
-
this._selectionExpr = selectionExpr;
|
|
161
|
-
|
|
162
|
-
this._selectionListener = () => {
|
|
153
|
+
const selectionListener = () => {
|
|
163
154
|
const selection =
|
|
164
155
|
/** @type {import("../../types/selectionTypes.js").IntervalSelection} */ (
|
|
165
156
|
selectionExpr()
|
|
@@ -179,15 +170,7 @@ export default class SelectionRect extends LayerView {
|
|
|
179
170
|
datasource.updateDynamicData(selectionToData(selection));
|
|
180
171
|
};
|
|
181
172
|
|
|
182
|
-
selectionExpr.
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @override
|
|
187
|
-
*/
|
|
188
|
-
dispose() {
|
|
189
|
-
this._selectionExpr.removeListener(this._selectionListener);
|
|
190
|
-
super.dispose();
|
|
173
|
+
this.registerDisposer(selectionExpr.subscribe(selectionListener));
|
|
191
174
|
}
|
|
192
175
|
}
|
|
193
176
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerView.d.ts","sourceRoot":"","sources":["../../../src/view/layerView.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layerView.d.ts","sourceRoot":"","sources":["../../../src/view/layerView.js"],"names":[],"mappings":"AAMA;IAQI;;;;;;;;OAQG;IACH,kBAPW,OAAO,iBAAiB,EAAE,SAAS,WACnC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,aAAa,cACb,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAWzC;IAHG,0CAAgB;IAqCpB;;;;;;OAMG;IACH,wBAJW,OAAO,iBAAiB,EAAE,SAAS,GAAG,OAAO,iBAAiB,EAAE,QAAQ,GAAG,OAAO,iBAAiB,EAAE,UAAU,UAC/G,MAAM,GACJ,OAAO,CAAC,SAAS,GAAG,OAAO,eAAe,EAAE,OAAO,CAAC,CAMhE;IAED;;;;OAIG;IACH,qBAFW,MAAM,iBAIhB;IA6CD,gEAEC;;CA6CJ;0BAjLyB,oBAAoB"}
|
|
@@ -2,6 +2,7 @@ import { isLayerSpec, isUnitSpec } from "./viewFactory.js";
|
|
|
2
2
|
import ContainerView from "./containerView.js";
|
|
3
3
|
import ViewError from "./viewError.js";
|
|
4
4
|
import ContainerMutationHelper from "./containerMutationHelper.js";
|
|
5
|
+
import { isMultiscaleSpec } from "./multiscale.js";
|
|
5
6
|
|
|
6
7
|
export default class LayerView extends ContainerView {
|
|
7
8
|
/**
|
|
@@ -47,10 +48,11 @@ export default class LayerView extends ContainerView {
|
|
|
47
48
|
(importedSpec) => {
|
|
48
49
|
if (
|
|
49
50
|
!isLayerSpec(importedSpec) &&
|
|
50
|
-
!isUnitSpec(importedSpec)
|
|
51
|
+
!isUnitSpec(importedSpec) &&
|
|
52
|
+
!isMultiscaleSpec(importedSpec)
|
|
51
53
|
) {
|
|
52
54
|
throw new ViewError(
|
|
53
|
-
"LayerView accepts only unit or
|
|
55
|
+
"LayerView accepts only unit, layer, or multiscale specs as children!",
|
|
54
56
|
this
|
|
55
57
|
);
|
|
56
58
|
// TODO: Add view to exception
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {"unitsPerPixel"} MultiscaleMetric
|
|
3
|
+
* @typedef {"x" | "y" | "auto"} MultiscaleChannel
|
|
4
|
+
* @typedef {number | import("../spec/parameter.js").ExprRef} StopValue
|
|
5
|
+
*
|
|
6
|
+
* @typedef {{
|
|
7
|
+
* metric: MultiscaleMetric;
|
|
8
|
+
* values: StopValue[];
|
|
9
|
+
* channel: MultiscaleChannel;
|
|
10
|
+
* fade: number;
|
|
11
|
+
* }} ParsedStops
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @param {object} spec
|
|
15
|
+
* @returns {spec is import("../spec/view.js").MultiscaleSpec}
|
|
16
|
+
*/
|
|
17
|
+
export function isMultiscaleSpec(spec: object): spec is import("../spec/view.js").MultiscaleSpec;
|
|
18
|
+
/**
|
|
19
|
+
* Converts a multiscale spec into a regular layer spec by wrapping each stage
|
|
20
|
+
* into a generated opacity layer.
|
|
21
|
+
*
|
|
22
|
+
* @param {import("../spec/view.js").MultiscaleSpec} spec
|
|
23
|
+
* @returns {import("../spec/view.js").LayerSpec}
|
|
24
|
+
*/
|
|
25
|
+
export function normalizeMultiscaleSpec(spec: import("../spec/view.js").MultiscaleSpec): import("../spec/view.js").LayerSpec;
|
|
26
|
+
export type MultiscaleMetric = "unitsPerPixel";
|
|
27
|
+
export type MultiscaleChannel = "x" | "y" | "auto";
|
|
28
|
+
export type StopValue = number | import("../spec/parameter.js").ExprRef;
|
|
29
|
+
export type ParsedStops = {
|
|
30
|
+
metric: MultiscaleMetric;
|
|
31
|
+
values: StopValue[];
|
|
32
|
+
channel: MultiscaleChannel;
|
|
33
|
+
fade: number;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=multiscale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiscale.d.ts","sourceRoot":"","sources":["../../../src/view/multiscale.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,uCAHW,MAAM,GACJ,IAAI,IAAI,OAAO,iBAAiB,EAAE,cAAc,CAI5D;AAED;;;;;;GAMG;AACH,8CAHW,OAAO,iBAAiB,EAAE,cAAc,GACtC,OAAO,iBAAiB,EAAE,SAAS,CA6B/C;+BAtDY,eAAe;gCACf,GAAG,GAAG,GAAG,GAAG,MAAM;wBAClB,MAAM,GAAG,OAAO,sBAAsB,EAAE,OAAO;0BAE/C;IACN,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { isArray, isObject } from "vega-util";
|
|
2
|
+
import { isExprRef } from "../paramRuntime/paramUtils.js";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_FADE = 0.5;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {"unitsPerPixel"} MultiscaleMetric
|
|
8
|
+
* @typedef {"x" | "y" | "auto"} MultiscaleChannel
|
|
9
|
+
* @typedef {number | import("../spec/parameter.js").ExprRef} StopValue
|
|
10
|
+
*
|
|
11
|
+
* @typedef {{
|
|
12
|
+
* metric: MultiscaleMetric;
|
|
13
|
+
* values: StopValue[];
|
|
14
|
+
* channel: MultiscaleChannel;
|
|
15
|
+
* fade: number;
|
|
16
|
+
* }} ParsedStops
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {object} spec
|
|
21
|
+
* @returns {spec is import("../spec/view.js").MultiscaleSpec}
|
|
22
|
+
*/
|
|
23
|
+
export function isMultiscaleSpec(spec) {
|
|
24
|
+
return "multiscale" in spec && isArray(spec.multiscale);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Converts a multiscale spec into a regular layer spec by wrapping each stage
|
|
29
|
+
* into a generated opacity layer.
|
|
30
|
+
*
|
|
31
|
+
* @param {import("../spec/view.js").MultiscaleSpec} spec
|
|
32
|
+
* @returns {import("../spec/view.js").LayerSpec}
|
|
33
|
+
*/
|
|
34
|
+
export function normalizeMultiscaleSpec(spec) {
|
|
35
|
+
if (!spec.multiscale.length) {
|
|
36
|
+
throw new Error('"multiscale" must contain at least one child view.');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const parsedStops = parseStops(spec.stops, spec.multiscale.length);
|
|
40
|
+
|
|
41
|
+
/** @type {import("../spec/view.js").LayerSpec["layer"]} */
|
|
42
|
+
const layer = spec.multiscale.map((child, i) => {
|
|
43
|
+
if (spec.multiscale.length === 1) {
|
|
44
|
+
return child;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
opacity: createStageOpacity(i, spec.multiscale.length, parsedStops),
|
|
49
|
+
layer: [child],
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const passThrough = { ...spec };
|
|
54
|
+
delete passThrough.multiscale;
|
|
55
|
+
delete passThrough.stops;
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
...passThrough,
|
|
59
|
+
layer,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {import("../spec/view.js").MultiscaleStopsDef} stops
|
|
65
|
+
* @param {number} stageCount
|
|
66
|
+
* @returns {ParsedStops}
|
|
67
|
+
*/
|
|
68
|
+
function parseStops(stops, stageCount) {
|
|
69
|
+
/** @type {MultiscaleMetric} */
|
|
70
|
+
let metric = "unitsPerPixel";
|
|
71
|
+
/** @type {StopValue[]} */
|
|
72
|
+
let values;
|
|
73
|
+
/** @type {MultiscaleChannel} */
|
|
74
|
+
let channel = "auto";
|
|
75
|
+
let fade = DEFAULT_FADE;
|
|
76
|
+
|
|
77
|
+
if (isArray(stops)) {
|
|
78
|
+
values = parseStopValues(stops, stageCount, "stops");
|
|
79
|
+
} else if (isObject(stops)) {
|
|
80
|
+
metric = stops.metric ?? "unitsPerPixel";
|
|
81
|
+
values = parseStopValues(stops.values, stageCount, "stops.values");
|
|
82
|
+
channel = stops.channel ?? "auto";
|
|
83
|
+
fade = stops.fade ?? DEFAULT_FADE;
|
|
84
|
+
} else {
|
|
85
|
+
throw new Error('"stops" must be an array or an object with "values".');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (metric !== "unitsPerPixel") {
|
|
89
|
+
throw new Error(
|
|
90
|
+
'Only "unitsPerPixel" is supported for "stops.metric" in multiscale.'
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!["x", "y", "auto"].includes(channel)) {
|
|
95
|
+
throw new Error('"stops.channel" must be one of "x", "y", or "auto".');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (!Number.isFinite(fade) || fade < 0 || fade > 0.5) {
|
|
99
|
+
throw new Error(
|
|
100
|
+
'"stops.fade" must be a finite number in range [0, 0.5].'
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
values.forEach((value, index) => {
|
|
105
|
+
if (!isExprRef(value) && (!Number.isFinite(value) || value <= 0)) {
|
|
106
|
+
throw new Error(
|
|
107
|
+
"Invalid stop value at index " +
|
|
108
|
+
index +
|
|
109
|
+
". Stop values must be positive finite numbers."
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
if (!values.some(isExprRef)) {
|
|
115
|
+
const numericValues = /** @type {number[]} */ (values);
|
|
116
|
+
|
|
117
|
+
for (let i = 1; i < numericValues.length; i++) {
|
|
118
|
+
if (numericValues[i - 1] <= numericValues[i]) {
|
|
119
|
+
throw new Error(
|
|
120
|
+
'"stops.values" must be strictly decreasing for "unitsPerPixel".'
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
for (let i = 0; i < numericValues.length - 1; i++) {
|
|
126
|
+
const leftLower = numericValues[i] * (1 - fade);
|
|
127
|
+
const rightUpper = numericValues[i + 1] * (1 + fade);
|
|
128
|
+
if (leftLower <= rightUpper) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
"Adjacent transitions overlap. Reduce fade or increase stop spacing."
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
metric,
|
|
138
|
+
values,
|
|
139
|
+
channel,
|
|
140
|
+
fade,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @param {unknown} rawValues
|
|
146
|
+
* @param {number} stageCount
|
|
147
|
+
* @param {string} path
|
|
148
|
+
* @returns {StopValue[]}
|
|
149
|
+
*/
|
|
150
|
+
function parseStopValues(rawValues, stageCount, path) {
|
|
151
|
+
if (!isArray(rawValues)) {
|
|
152
|
+
throw new Error(
|
|
153
|
+
'"' + path + '" must be an array of numbers or ExprRefs.'
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const expectedStopCount = stageCount - 1;
|
|
158
|
+
if (rawValues.length !== expectedStopCount) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
"Invalid stop count for multiscale. Expected " +
|
|
161
|
+
expectedStopCount +
|
|
162
|
+
", got " +
|
|
163
|
+
rawValues.length +
|
|
164
|
+
"."
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
for (const value of rawValues) {
|
|
169
|
+
if (!isExprRef(value) && !Number.isFinite(value)) {
|
|
170
|
+
throw new Error(
|
|
171
|
+
'"' + path + '" must contain only numbers or ExprRefs.'
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return /** @type {StopValue[]} */ (rawValues);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @param {number} stageIndex
|
|
181
|
+
* @param {number} stageCount
|
|
182
|
+
* @param {ParsedStops} stops
|
|
183
|
+
* @returns {import("../spec/view.js").DynamicOpacity}
|
|
184
|
+
*/
|
|
185
|
+
function createStageOpacity(stageIndex, stageCount, stops) {
|
|
186
|
+
/** @type {StopValue[]} */
|
|
187
|
+
let unitsPerPixel;
|
|
188
|
+
/** @type {number[]} */
|
|
189
|
+
let values;
|
|
190
|
+
const transitions = stops.values.map((stop) => ({
|
|
191
|
+
hi: scaleStop(stop, 1 + stops.fade),
|
|
192
|
+
lo: scaleStop(stop, 1 - stops.fade),
|
|
193
|
+
}));
|
|
194
|
+
|
|
195
|
+
if (stageIndex === 0) {
|
|
196
|
+
unitsPerPixel = [transitions[0].hi, transitions[0].lo];
|
|
197
|
+
} else if (stageIndex === stageCount - 1) {
|
|
198
|
+
const last = transitions.at(-1);
|
|
199
|
+
unitsPerPixel = [last.hi, last.lo];
|
|
200
|
+
} else {
|
|
201
|
+
const previous = transitions[stageIndex - 1];
|
|
202
|
+
const next = transitions[stageIndex];
|
|
203
|
+
|
|
204
|
+
unitsPerPixel = [previous.hi, previous.lo, next.hi, next.lo];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (stageIndex === 0) {
|
|
208
|
+
values = [1, 0];
|
|
209
|
+
} else if (stageIndex === stageCount - 1) {
|
|
210
|
+
values = [0, 1];
|
|
211
|
+
} else {
|
|
212
|
+
values = [0, 1, 1, 0];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return {
|
|
216
|
+
channel: stops.channel,
|
|
217
|
+
unitsPerPixel,
|
|
218
|
+
values,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @param {StopValue} stop
|
|
224
|
+
* @param {number} factor
|
|
225
|
+
* @returns {StopValue}
|
|
226
|
+
*/
|
|
227
|
+
function scaleStop(stop, factor) {
|
|
228
|
+
if (isExprRef(stop)) {
|
|
229
|
+
return { expr: "(" + stop.expr + ") * " + factor };
|
|
230
|
+
} else {
|
|
231
|
+
return stop * factor;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiscale.test.d.ts","sourceRoot":"","sources":["../../../src/view/multiscale.test.js"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unitView.d.ts","sourceRoot":"","sources":["../../../src/view/unitView.js"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,wBAHU,MAAM,CAAC,OAAO,iBAAiB,EAAE,QAAQ,EAAE,cAAc,kBAAkB,EAAE,OAAO,CAAC,CAc7F;AAEF;IAwBI;;;;;;;;OAQG;IACH,kBAPW,OAAO,iBAAiB,EAAE,QAAQ,WAClC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAyCzC;IApCG,yCAAgB;IAIZ,iDAAiD;IACjD,MADW,OAAO,kBAAkB,EAAE,OAAO,CACnB;
|
|
1
|
+
{"version":3,"file":"unitView.d.ts","sourceRoot":"","sources":["../../../src/view/unitView.js"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,wBAHU,MAAM,CAAC,OAAO,iBAAiB,EAAE,QAAQ,EAAE,cAAc,kBAAkB,EAAE,OAAO,CAAC,CAc7F;AAEF;IAwBI;;;;;;;;OAQG;IACH,kBAPW,OAAO,iBAAiB,EAAE,QAAQ,WAClC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAyCzC;IApCG,yCAAgB;IAIZ,iDAAiD;IACjD,MADW,OAAO,kBAAkB,EAAE,OAAO,CACnB;IAyKlC,2DAIC;IAoBD;;;;;OAKG;IAEH,iEAqJC;IAUD;;;;;OAKG;IACH,4IAMC;IAED;;;;OAIG;IACH,sBAFa,OAAO,WAAW,EAAE,UAAU,EAAE,CAS5C;IAkBD;;OAEG;IACH,uDAEC;IAED;;OAEG;IACH,oCA0EC;IAED,uBAQC;IAgBD;;;;OAIG;IACH,8BAJW,MAAM,+DAEJ,OAAO,iBAAiB,EAAE,kBAAkB,CAKxD;;CACJ;iBAllBgB,WAAW"}
|
|
@@ -95,7 +95,7 @@ export default class UnitView extends View {
|
|
|
95
95
|
|
|
96
96
|
this.resolve();
|
|
97
97
|
|
|
98
|
-
this.#zoomLevelSetter = this.
|
|
98
|
+
this.#zoomLevelSetter = this.paramRuntime.allocateSetter(
|
|
99
99
|
"zoomLevel",
|
|
100
100
|
1.0
|
|
101
101
|
);
|
|
@@ -122,7 +122,7 @@ export default class UnitView extends View {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
#setupPointSelection() {
|
|
125
|
-
for (const [name, param] of this.
|
|
125
|
+
for (const [name, param] of this.paramRuntime.paramConfigs) {
|
|
126
126
|
if (!("select" in param)) {
|
|
127
127
|
continue;
|
|
128
128
|
}
|
|
@@ -145,7 +145,12 @@ export default class UnitView extends View {
|
|
|
145
145
|
const none = 0;
|
|
146
146
|
let lastId = none;
|
|
147
147
|
|
|
148
|
-
const setter =
|
|
148
|
+
const setter = (
|
|
149
|
+
/** @type {any} */
|
|
150
|
+
selection
|
|
151
|
+
) => {
|
|
152
|
+
this.paramRuntime.setValue(name, selection);
|
|
153
|
+
};
|
|
149
154
|
|
|
150
155
|
const getHoveredDatum = () => {
|
|
151
156
|
const h = this.context.getCurrentHover();
|
|
@@ -175,7 +180,7 @@ export default class UnitView extends View {
|
|
|
175
180
|
if (toggle) {
|
|
176
181
|
if (datum) {
|
|
177
182
|
const previousSelection =
|
|
178
|
-
this.
|
|
183
|
+
this.paramRuntime.getValue(name);
|
|
179
184
|
selection = updateMultiPointSelection(
|
|
180
185
|
previousSelection,
|
|
181
186
|
{
|
|
@@ -426,6 +431,7 @@ export default class UnitView extends View {
|
|
|
426
431
|
unregister() &&
|
|
427
432
|
view.resolutions[type][targetChannel] === resolution
|
|
428
433
|
) {
|
|
434
|
+
resolution.dispose();
|
|
429
435
|
delete view.resolutions[type][targetChannel];
|
|
430
436
|
}
|
|
431
437
|
});
|
package/dist/src/view/view.d.ts
CHANGED
|
@@ -91,8 +91,8 @@ export default class View {
|
|
|
91
91
|
* @type {Record<import("../spec/channel.js").PrimaryPositionalChannel, boolean>}
|
|
92
92
|
*/
|
|
93
93
|
needsAxes: Record<import("../spec/channel.js").PrimaryPositionalChannel, boolean>;
|
|
94
|
-
/** @type {
|
|
95
|
-
|
|
94
|
+
/** @type {ViewParamRuntime} */
|
|
95
|
+
paramRuntime: ViewParamRuntime;
|
|
96
96
|
/**
|
|
97
97
|
* Effective view name. Equals the explicit name (`spec.name`) when provided,
|
|
98
98
|
* otherwise falls back to an auto-generated default name.
|
|
@@ -198,8 +198,9 @@ export default class View {
|
|
|
198
198
|
*
|
|
199
199
|
* @param {string} type
|
|
200
200
|
* @param {function(BroadcastMessage):void} handler
|
|
201
|
+
* @returns {() => void}
|
|
201
202
|
*/
|
|
202
|
-
_addBroadcastHandler(type: string, handler: (arg0: BroadcastMessage) => void): void;
|
|
203
|
+
_addBroadcastHandler(type: string, handler: (arg0: BroadcastMessage) => void): () => void;
|
|
203
204
|
/**
|
|
204
205
|
* Handles an interactionEvent
|
|
205
206
|
*
|
|
@@ -391,7 +392,7 @@ export type ViewOptions = {
|
|
|
391
392
|
*/
|
|
392
393
|
layersChildren?: boolean;
|
|
393
394
|
};
|
|
394
|
-
import
|
|
395
|
+
import ViewParamRuntime from "../paramRuntime/viewParamRuntime.js";
|
|
395
396
|
import Padding from "./layout/padding.js";
|
|
396
397
|
import { FlexDimensions } from "./layout/flexLayout.js";
|
|
397
398
|
//# sourceMappingURL=view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/view.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/view.js"],"names":[],"mappings":"AA4BA,oBAAoB;AACpB,yBAA0B,YAAY,CAAC;AACvC,0BAA0B;AAC1B,yBAA0B,YAAY,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IA6CI;;;;;;;;;OASG;IACH,kBARW,OAAO,iBAAiB,EAAE,QAAQ,WAClC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,YACN,WAAW,EAsErB;IApGD;;OAEG;IACH,iBAFU,CAAS,IAAM,EAAN,MAAM,KAAE,MAAM,CAEQ;IAYzC;;;;;OAKG;IACH,aAFU,GAAG,CAAC,GAAG,EAAE,OAAO,uBAAuB,EAAE,OAAO,CAAC,CAEX;IAiB5C,mDAAsB;IACtB,mDAAgC;IAChC,iBAA4B;IAE5B,yCAAgB;IAEhB;QACI;;;WAGG;eADO,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,gBAAgB,EAAE,OAAO,8BAA8B,EAAE,OAAO,CAAC,CAAC;QAGxH;;;WAGG;cADO,OAAO,CAAC,MAAM,CAAC,OAAO,oBAAoB,EAAE,wBAAwB,EAAE,OAAO,6BAA6B,EAAE,OAAO,CAAC,CAAC;MAGlI;IAID;;;;kCAvFE,OAAO;;;;;yBAEP,OAAO;M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