@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { RootConfig } from "./root.js";
|
|
2
|
+
import {
|
|
3
|
+
ConcatSpec as CoreConcatSpec,
|
|
4
|
+
HConcatSpec as CoreHConcatSpec,
|
|
5
|
+
ImportSpec,
|
|
6
|
+
LayerSpec as CoreLayerSpec,
|
|
7
|
+
MultiscaleSpec as CoreMultiscaleSpec,
|
|
8
|
+
UnitSpec as CoreUnitSpec,
|
|
9
|
+
VConcatSpec as CoreVConcatSpec,
|
|
10
|
+
} from "./view.js";
|
|
11
|
+
|
|
12
|
+
interface SchemaViewConfig {
|
|
13
|
+
templates?: Record<string, ViewSpec>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface UnitSpec extends Omit<CoreUnitSpec, "templates">, SchemaViewConfig {}
|
|
17
|
+
|
|
18
|
+
interface LayerSpec
|
|
19
|
+
extends Omit<CoreLayerSpec, "templates" | "layer">, SchemaViewConfig {
|
|
20
|
+
layer: (LayerSpec | UnitSpec | MultiscaleSpec | ImportSpec)[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface MultiscaleSpec
|
|
24
|
+
extends
|
|
25
|
+
Omit<CoreMultiscaleSpec, "templates" | "multiscale">,
|
|
26
|
+
SchemaViewConfig {
|
|
27
|
+
multiscale: (LayerSpec | UnitSpec | MultiscaleSpec | ImportSpec)[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface VConcatSpec
|
|
31
|
+
extends Omit<CoreVConcatSpec, "templates" | "vconcat">, SchemaViewConfig {
|
|
32
|
+
vconcat: (ViewSpec | ImportSpec)[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface HConcatSpec
|
|
36
|
+
extends Omit<CoreHConcatSpec, "templates" | "hconcat">, SchemaViewConfig {
|
|
37
|
+
hconcat: (ViewSpec | ImportSpec)[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface ConcatSpec
|
|
41
|
+
extends Omit<CoreConcatSpec, "templates" | "concat">, SchemaViewConfig {
|
|
42
|
+
concat: (ViewSpec | ImportSpec)[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type ViewSpec =
|
|
46
|
+
| UnitSpec
|
|
47
|
+
| LayerSpec
|
|
48
|
+
| MultiscaleSpec
|
|
49
|
+
| VConcatSpec
|
|
50
|
+
| HConcatSpec
|
|
51
|
+
| ConcatSpec;
|
|
52
|
+
|
|
53
|
+
export type CoreRootSpec = ViewSpec & RootConfig;
|
package/dist/src/spec/data.d.ts
CHANGED
|
@@ -20,9 +20,22 @@ export interface ParameterBase {
|
|
|
20
20
|
push?: "outer";
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export interface PersistedParameter {
|
|
24
|
+
/**
|
|
25
|
+
* Whether the parameter should be persisted in bookmarks and provenance.
|
|
26
|
+
*
|
|
27
|
+
* This primarily affects GenomeSpy App behavior.
|
|
28
|
+
* Set to `false` for ephemeral params (e.g., hover selections) or when the
|
|
29
|
+
* selection cannot be persisted due to missing `encoding.key`.
|
|
30
|
+
*
|
|
31
|
+
* __Default value:__ `true`
|
|
32
|
+
*/
|
|
33
|
+
persist?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
23
36
|
// Adapted from: https://github.com/vega/vega-lite/blob/main/src/parameter.ts
|
|
24
37
|
|
|
25
|
-
export interface VariableParameter extends ParameterBase {
|
|
38
|
+
export interface VariableParameter extends ParameterBase, PersistedParameter {
|
|
26
39
|
/**
|
|
27
40
|
* The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.
|
|
28
41
|
*
|
|
@@ -219,17 +232,9 @@ export interface PointSelectionConfig extends BaseSelectionConfig<"point"> {
|
|
|
219
232
|
* __Default value:__ `true`
|
|
220
233
|
*/
|
|
221
234
|
toggle?: boolean;
|
|
222
|
-
/**
|
|
223
|
-
* A set of fields that uniquely identify a tuple. Used for bookmarking point selections
|
|
224
|
-
* in the GenomeSpy App. Still work in progress.
|
|
225
|
-
*
|
|
226
|
-
* TODO: Or maybe use the `key` channel? https://vega.github.io/vega-lite/docs/encoding.html#key
|
|
227
|
-
*/
|
|
228
|
-
//keyFields?: string[];
|
|
229
235
|
}
|
|
230
236
|
|
|
231
|
-
export interface IntervalSelectionConfig
|
|
232
|
-
extends BaseSelectionConfig<"interval"> {
|
|
237
|
+
export interface IntervalSelectionConfig extends BaseSelectionConfig<"interval"> {
|
|
233
238
|
type: "interval";
|
|
234
239
|
|
|
235
240
|
/**
|
|
@@ -294,7 +299,7 @@ export interface BrushConfig extends ShadowProps {
|
|
|
294
299
|
}
|
|
295
300
|
|
|
296
301
|
export interface SelectionParameter<T extends SelectionType = SelectionType>
|
|
297
|
-
extends ParameterBase {
|
|
302
|
+
extends ParameterBase, PersistedParameter {
|
|
298
303
|
/**
|
|
299
304
|
* Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:
|
|
300
305
|
*
|
package/dist/src/spec/root.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PrimaryPositionalChannel = import("./channel.js").PrimaryPositionalChannel;
|
|
2
|
+
export type Datum = import("../data/flowNode.js").Datum;
|
|
3
|
+
/**
|
|
4
|
+
* Testing-only lazy data source parameters.
|
|
5
|
+
*/
|
|
6
|
+
export type MockLazyData = {
|
|
7
|
+
type: "mockLazy";
|
|
8
|
+
channel?: PrimaryPositionalChannel;
|
|
9
|
+
delay?: number;
|
|
10
|
+
data?: Datum[];
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/spec/testing.js"],"names":[],"mappings":"uCAKa,OAAO,cAAc,EAAE,wBAAwB;oBAC/C,OAAO,qBAAqB,EAAE,KAAK;;;;;UAOtC,UAAU;cACV,wBAAwB;YACxB,MAAM;WACN,KAAK,EAAE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only spec typings for internal helpers and fixtures.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import("./channel.js").PrimaryPositionalChannel} PrimaryPositionalChannel
|
|
7
|
+
* @typedef {import("../data/flowNode.js").Datum} Datum
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Testing-only lazy data source parameters.
|
|
12
|
+
*
|
|
13
|
+
* @typedef {object} MockLazyData
|
|
14
|
+
* @prop {"mockLazy"} type
|
|
15
|
+
* @prop {PrimaryPositionalChannel} [channel]
|
|
16
|
+
* @prop {number} [delay]
|
|
17
|
+
* @prop {Datum[]} [data]
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export {};
|
package/dist/src/spec/view.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
MarkProps,
|
|
12
12
|
MarkType,
|
|
13
13
|
RectProps,
|
|
14
|
+
RuleProps,
|
|
14
15
|
ShadowProps,
|
|
15
16
|
} from "./mark.js";
|
|
16
17
|
import { ExprRef } from "./parameter.js";
|
|
17
18
|
import { Title } from "./title.js";
|
|
18
|
-
import { SampleSpec } from "./sampleView.js";
|
|
19
19
|
import { Parameter } from "./parameter.js";
|
|
20
20
|
|
|
21
21
|
export interface SizeDef {
|
|
@@ -45,19 +45,33 @@ export interface FacetMapping {
|
|
|
45
45
|
* The opacity is interpolated between the specified stops.
|
|
46
46
|
*/
|
|
47
47
|
export interface DynamicOpacity {
|
|
48
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The positional channel whose scale domain controls the opacity.
|
|
50
|
+
* If set to `"auto"`, both `x` and `y` scales may contribute.
|
|
51
|
+
*
|
|
52
|
+
* If omitted, `x` is used when available and `y` is used as a fallback.
|
|
53
|
+
*/
|
|
54
|
+
channel?: PrimaryPositionalChannel | "auto";
|
|
49
55
|
|
|
50
56
|
/**
|
|
51
|
-
*
|
|
57
|
+
* Opacity stops expressed as units (base pairs, for example) per pixel.
|
|
58
|
+
* The values must be positive.
|
|
59
|
+
*
|
|
60
|
+
* Each stop is paired with an opacity in `values` at the same index.
|
|
61
|
+
* Stops can be constants or expression references.
|
|
52
62
|
*/
|
|
53
|
-
unitsPerPixel:
|
|
63
|
+
unitsPerPixel: NumericStopDef[];
|
|
54
64
|
|
|
55
65
|
/**
|
|
56
|
-
* Opacity values that match the given stops.
|
|
66
|
+
* Opacity values that match the given `unitsPerPixel` stops.
|
|
67
|
+
*
|
|
68
|
+
* Values outside the stop range are clamped to the nearest stop.
|
|
57
69
|
*/
|
|
58
70
|
values: number[];
|
|
59
71
|
}
|
|
60
72
|
|
|
73
|
+
export type NumericStopDef = number | ExprRef;
|
|
74
|
+
|
|
61
75
|
export type ViewOpacityDef = number | DynamicOpacity | ExprRef;
|
|
62
76
|
|
|
63
77
|
export interface Step {
|
|
@@ -83,10 +97,24 @@ export type ViewBackground = Pick<
|
|
|
83
97
|
> &
|
|
84
98
|
ShadowProps;
|
|
85
99
|
|
|
100
|
+
export interface SeparatorProps extends Omit<RuleProps, "type"> {
|
|
101
|
+
type?: "rule";
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Whether separators extend into the plot margin (axes/padding) around
|
|
105
|
+
* the grid.
|
|
106
|
+
*
|
|
107
|
+
* __Default value:__ `true`
|
|
108
|
+
*/
|
|
109
|
+
includePlotMargin?: boolean;
|
|
110
|
+
}
|
|
111
|
+
|
|
86
112
|
export interface ViewSpecBase extends ResolveSpec {
|
|
87
113
|
/**
|
|
88
|
-
* An
|
|
89
|
-
*
|
|
114
|
+
* An explicit name used to address the view. It is recommended to keep
|
|
115
|
+
* names unique among siblings. In the App (where view state is
|
|
116
|
+
* bookmarkable), the name must be unique within its import scope for
|
|
117
|
+
* views with configurable visibility, etc.
|
|
90
118
|
*/
|
|
91
119
|
name?: string;
|
|
92
120
|
|
|
@@ -162,6 +190,16 @@ export interface ViewSpecBase extends ResolveSpec {
|
|
|
162
190
|
*/
|
|
163
191
|
encoding?: Encoding;
|
|
164
192
|
|
|
193
|
+
/**
|
|
194
|
+
* If true, this view and its descendants do not contribute to scale domains.
|
|
195
|
+
* Child views inherit this flag automatically.
|
|
196
|
+
*
|
|
197
|
+
* **Default value:** `false`
|
|
198
|
+
*
|
|
199
|
+
* @internal
|
|
200
|
+
*/
|
|
201
|
+
domainInert?: boolean;
|
|
202
|
+
|
|
165
203
|
/**
|
|
166
204
|
* View title.
|
|
167
205
|
* N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to
|
|
@@ -199,7 +237,7 @@ export interface ViewSpecBase extends ResolveSpec {
|
|
|
199
237
|
* Is the visibility configurable interactively from the [GenomeSpy
|
|
200
238
|
* App](https://genomespy.app/docs/sample-collections/).
|
|
201
239
|
* Configurability requires that the view has an explicitly specified name
|
|
202
|
-
* that is
|
|
240
|
+
* that is unique within its import scope.
|
|
203
241
|
*
|
|
204
242
|
* **Default:** `false` for children of `layer`, `true` for others.
|
|
205
243
|
*/
|
|
@@ -214,20 +252,35 @@ export interface ViewSpecBase extends ResolveSpec {
|
|
|
214
252
|
|
|
215
253
|
export interface DynamicOpacitySpec {
|
|
216
254
|
/**
|
|
217
|
-
* Opacity of the view and all its children.
|
|
218
|
-
* zooming where the layers are faded in and out as the user zooms in and out.
|
|
255
|
+
* Opacity of the view and all its children.
|
|
219
256
|
*
|
|
220
|
-
*
|
|
257
|
+
* This can be:
|
|
221
258
|
*
|
|
222
|
-
*
|
|
259
|
+
* - a fixed number between `0` and `1`
|
|
260
|
+
* - an expression reference (`ExprRef`)
|
|
261
|
+
* - a `DynamicOpacity` definition for zoom-dependent opacity
|
|
262
|
+
*
|
|
263
|
+
* Dynamic opacity is useful for semantic zooming where layers are faded in
|
|
264
|
+
* and out as the user zooms.
|
|
265
|
+
*
|
|
266
|
+
* Example:
|
|
267
|
+
*
|
|
268
|
+
* ```json
|
|
269
|
+
* "opacity": {
|
|
270
|
+
* "unitsPerPixel": [100000, 40000],
|
|
271
|
+
* "values": [0, 1]
|
|
272
|
+
* }
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* In this example, the view fades in while zooming in from 100 000 to
|
|
276
|
+
* 40 000 units per pixel.
|
|
277
|
+
*
|
|
278
|
+
* __Default value:__ `1.0`
|
|
223
279
|
*/
|
|
224
280
|
opacity?: ViewOpacityDef;
|
|
225
281
|
}
|
|
226
282
|
|
|
227
|
-
export interface UnitSpec
|
|
228
|
-
extends ViewSpecBase,
|
|
229
|
-
DynamicOpacitySpec,
|
|
230
|
-
AggregateSamplesSpec {
|
|
283
|
+
export interface UnitSpec extends ViewSpecBase, DynamicOpacitySpec {
|
|
231
284
|
/**
|
|
232
285
|
* The background of the view, including fill, stroke, and stroke width.
|
|
233
286
|
*/
|
|
@@ -239,22 +292,66 @@ export interface UnitSpec
|
|
|
239
292
|
mark: MarkType | MarkProps;
|
|
240
293
|
}
|
|
241
294
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
295
|
+
export interface LayerSpec extends ViewSpecBase, DynamicOpacitySpec {
|
|
296
|
+
view?: ViewBackground;
|
|
297
|
+
layer: (LayerSpec | UnitSpec | MultiscaleSpec | ImportSpec)[];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface MultiscaleStops {
|
|
301
|
+
/**
|
|
302
|
+
* The metric used to evaluate zoom stops.
|
|
303
|
+
*
|
|
304
|
+
* __Default value:__ `"unitsPerPixel"`
|
|
305
|
+
*/
|
|
306
|
+
metric?: "unitsPerPixel";
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Stop values in descending order.
|
|
310
|
+
*/
|
|
311
|
+
values: NumericStopDef[];
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Which positional channel controls the stop metric.
|
|
315
|
+
*
|
|
316
|
+
* - `"auto"` averages `x` and `y` when both are available.
|
|
317
|
+
* - `"x"` uses only the `x` channel.
|
|
318
|
+
* - `"y"` uses only the `y` channel.
|
|
319
|
+
*
|
|
320
|
+
* __Default value:__ `"auto"`
|
|
321
|
+
*/
|
|
322
|
+
channel?: PrimaryPositionalChannel | "auto";
|
|
323
|
+
|
|
245
324
|
/**
|
|
246
|
-
*
|
|
247
|
-
*
|
|
325
|
+
* Relative transition width around each stop.
|
|
326
|
+
*
|
|
327
|
+
* For each stop value `s`, the fade transition is evaluated in the range:
|
|
328
|
+
*
|
|
329
|
+
* - upper edge: `s * (1 + fade)`
|
|
330
|
+
* - lower edge: `s * (1 - fade)`
|
|
331
|
+
*
|
|
332
|
+
* __Default value:__ `0.5`
|
|
248
333
|
*/
|
|
249
|
-
|
|
334
|
+
fade?: number;
|
|
250
335
|
}
|
|
251
336
|
|
|
252
|
-
export
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
AggregateSamplesSpec {
|
|
337
|
+
export type MultiscaleStopsDef = NumericStopDef[] | MultiscaleStops;
|
|
338
|
+
|
|
339
|
+
export interface MultiscaleSpec extends ViewSpecBase, DynamicOpacitySpec {
|
|
256
340
|
view?: ViewBackground;
|
|
257
|
-
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Child views ordered from zoomed-out to zoomed-in detail levels.
|
|
344
|
+
*/
|
|
345
|
+
multiscale: (LayerSpec | UnitSpec | MultiscaleSpec | ImportSpec)[];
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Stop definition that controls transitions between the multiscale levels.
|
|
349
|
+
*
|
|
350
|
+
* - `number[]` is shorthand for `{ metric: "unitsPerPixel", values: ... }`
|
|
351
|
+
* - `(number | ExprRef)[]` supports mixed constants and expressions
|
|
352
|
+
* - Object form allows configuring metric, channel, and fade.
|
|
353
|
+
*/
|
|
354
|
+
stops: MultiscaleStopsDef;
|
|
258
355
|
}
|
|
259
356
|
|
|
260
357
|
export interface FacetSpec extends ViewSpecBase {
|
|
@@ -292,25 +389,23 @@ export interface ResolveSpec {
|
|
|
292
389
|
>;
|
|
293
390
|
}
|
|
294
391
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
| VConcatSpec
|
|
300
|
-
| HConcatSpec
|
|
301
|
-
| ConcatSpec
|
|
302
|
-
| UnitSpec
|
|
303
|
-
) &
|
|
304
|
-
ResolveSpec;
|
|
392
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
393
|
+
export interface ViewSpecExtensions {}
|
|
394
|
+
|
|
395
|
+
export type ViewSpecExtension = ViewSpecExtensions[keyof ViewSpecExtensions];
|
|
305
396
|
|
|
306
|
-
export type
|
|
397
|
+
export type CoreViewSpec =
|
|
307
398
|
| UnitSpec
|
|
308
399
|
| LayerSpec
|
|
400
|
+
| MultiscaleSpec
|
|
309
401
|
// | FacetSpec
|
|
310
402
|
| VConcatSpec
|
|
311
403
|
| HConcatSpec
|
|
312
|
-
| ConcatSpec
|
|
313
|
-
|
|
404
|
+
| ConcatSpec;
|
|
405
|
+
|
|
406
|
+
export type ContainerSpec = (CoreViewSpec | ViewSpecExtension) & ResolveSpec;
|
|
407
|
+
|
|
408
|
+
export type ViewSpec = CoreViewSpec | ViewSpecExtension;
|
|
314
409
|
|
|
315
410
|
export interface UrlImport {
|
|
316
411
|
/**
|
|
@@ -330,7 +425,8 @@ export interface TemplateImport {
|
|
|
330
425
|
export interface ImportSpec {
|
|
331
426
|
/**
|
|
332
427
|
* The name given to the imported view. This property overrides the name
|
|
333
|
-
* specified in the imported specification
|
|
428
|
+
* specified in the imported specification and defines an import scope that
|
|
429
|
+
* is used for bookmarkable view visibility and parameter addressing.
|
|
334
430
|
*/
|
|
335
431
|
name?: string;
|
|
336
432
|
|
|
@@ -340,6 +436,13 @@ export interface ImportSpec {
|
|
|
340
436
|
*/
|
|
341
437
|
params?: Parameter[] | Record<string, any>;
|
|
342
438
|
|
|
439
|
+
/**
|
|
440
|
+
* Overrides the visibility of the imported view.
|
|
441
|
+
*
|
|
442
|
+
* If not specified, the imported specification's `visible` property is used.
|
|
443
|
+
*/
|
|
444
|
+
visible?: boolean;
|
|
445
|
+
|
|
343
446
|
/**
|
|
344
447
|
* The method to import a specification.
|
|
345
448
|
*/
|
|
@@ -351,6 +454,19 @@ export interface ConcatBase extends ViewSpecBase {
|
|
|
351
454
|
* The gap between the views, in pixels.
|
|
352
455
|
*/
|
|
353
456
|
spacing?: number;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Draws separator rules between visible child views. The separators are
|
|
460
|
+
* centered within the spacing gaps and do not affect layout.
|
|
461
|
+
*
|
|
462
|
+
* If `true`, the defaults are equivalent to:
|
|
463
|
+
* `{"type":"rule","size":1,"color":"#ccc","opacity":1,"strokeDash":[4,4],"strokeCap":"butt"}`
|
|
464
|
+
* Use `includePlotMargin` to control whether the separators extend into the
|
|
465
|
+
* plot margin.
|
|
466
|
+
*
|
|
467
|
+
* __Default value:__ `false`
|
|
468
|
+
*/
|
|
469
|
+
separator?: boolean | SeparatorProps;
|
|
354
470
|
}
|
|
355
471
|
|
|
356
472
|
export interface VConcatSpec extends ConcatBase {
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--genome-spy-basic-spacing: 10px;
|
|
3
|
-
--genome-spy-font-family:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@keyframes genome-spy-blinker {
|
|
8
|
-
50% {
|
|
9
|
-
opacity: 0;
|
|
10
|
-
}
|
|
3
|
+
--genome-spy-font-family:
|
|
4
|
+
system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
|
|
5
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
11
6
|
}
|
|
12
7
|
|
|
13
8
|
.genome-spy {
|
|
@@ -38,34 +33,11 @@
|
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
35
|
|
|
41
|
-
.loading-message {
|
|
42
|
-
position: absolute;
|
|
43
|
-
inset: 0;
|
|
44
|
-
display: flex;
|
|
45
|
-
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
|
|
49
|
-
.message {
|
|
50
|
-
color: #666;
|
|
51
|
-
opacity: 0;
|
|
52
|
-
transition: opacity 0.7s;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
36
|
.loading {
|
|
57
37
|
> canvas {
|
|
58
38
|
transform: scale(0.95, 0.95);
|
|
59
39
|
opacity: 0;
|
|
60
40
|
}
|
|
61
|
-
|
|
62
|
-
> .loading-message .message {
|
|
63
|
-
opacity: 1;
|
|
64
|
-
|
|
65
|
-
.ellipsis {
|
|
66
|
-
animation: genome-spy-blinker 1s linear infinite;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
41
|
}
|
|
70
42
|
|
|
71
43
|
.loading-indicators {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export default css;
|
|
2
|
-
declare const css: "\n:root {\n--genome-spy-basic-spacing: 10px;\n--genome-spy-font-family: system-ui, \"Segoe UI\", Roboto, Helvetica, Arial,\nsans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n}\n\n
|
|
2
|
+
declare const css: "\n:root {\n--genome-spy-basic-spacing: 10px;\n--genome-spy-font-family: system-ui, \"Segoe UI\", Roboto, Helvetica, Arial,\nsans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n}\n\n.genome-spy {\nfont-family: var(--genome-spy-font-family);\n\nposition: relative;\n\ndisplay: flex;\nflex-direction: column;\n\n.canvas-wrapper {\nposition: relative;\nflex-grow: 1;\noverflow: hidden;\n}\n\ncanvas {\ndisplay: block;\ntransform: scale(1, 1);\nopacity: 1;\ntransition:\ntransform 0.6s,\nopacity 0.6s;\n\n&:focus,\n&:focus-visible {\noutline: none;\n}\n}\n\n.loading {\n> canvas {\ntransform: scale(0.95, 0.95);\nopacity: 0;\n}\n}\n\n.loading-indicators {\nposition: absolute;\ninset: 0;\n\nuser-select: none;\npointer-events: none;\n\ndiv {\nposition: absolute;\ndisplay: flex;\nalign-items: center;\njustify-content: center;\n\n> div {\nfont-size: 11px;\ntransition: opacity 0.2s;\nbackground: white;\npadding: 2px 5px;\ndisplay: flex;\nborder-radius: 3px;\ngap: 0.5em;\nopacity: 0;\n\n&.loading {\nopacity: 0.5;\n}\n\n&.error {\nopacity: 0.8;\ncolor: firebrick;\n}\n\n> * {\ndisplay: block;\n}\n\nimg {\nwidth: 1.5em;\nheight: 1.5em;\n}\n}\n}\n}\n\n.tooltip {\nposition: absolute;\n\nmax-width: 450px;\noverflow: hidden;\n\n--background-color: #f6f6f6;\nbackground: var(--background-color);\npadding: var(--genome-spy-basic-spacing);\n\n--font-size: 12px;\nfont-size: var(--font-size);\n\nbox-shadow: 0px 3px 15px 0px rgba(0, 0, 0, 0.21);\n\n&:not(.sticky) {\npointer-events: none;\n}\n\ntransition:\noutline-color 0.3s ease-in-out,\nbox-shadow 0.3s ease-in-out;\n\noutline: 0px solid transparent;\n&.sticky {\noutline: 2px solid black;\nbox-shadow: 0px 3px 18px 0px rgba(0, 0, 0, 0.3);\n}\n\nz-index: 100;\n\n> :last-child {\nmargin-bottom: 0;\n}\n\n> .title {\npadding-bottom: calc(var(--genome-spy-basic-spacing) / 2);\nmargin-bottom: calc(var(--genome-spy-basic-spacing) / 2);\nborder-bottom: 1px dashed var(--background-color);\nborder-bottom: 1px dashed\ncolor-mix(in srgb, black 25%, var(--background-color));\n}\n\n.summary {\nfont-size: 12px;\n}\n\ntable {\n&:first-child {\nmargin-top: 0;\n}\n\nborder-collapse: collapse;\n\nth,\ntd {\npadding: 2px 0.4em;\nvertical-align: top;\nfont-size: var(--font-size);\n\n&:first-child {\npadding-left: 0;\n}\n}\n\nth {\ntext-align: left;\nfont-weight: bold;\n}\n}\n\n.color-legend {\ndisplay: inline-block;\nwidth: 0.8em;\nheight: 0.8em;\nmargin-left: 0.4em;\nbox-shadow: 0px 0px 3px 1px white;\n}\n\n.attributes {\n.hovered {\nbackground-color: #e0e0e0;\n}\n}\n\n.na {\ncolor: #aaa;\nfont-style: italic;\nfont-size: 80%;\n}\n}\n\n.gene-track-tooltip {\n.summary {\nfont-size: 90%;\n}\n}\n\n.message-box {\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nposition: absolute;\ntop: 0;\nheight: 100%;\nwidth: 100%;\n\n> div {\nborder: 1px solid red;\npadding: 10px;\nbackground: #fff0f0;\n}\n}\n}\n\n.gs-input-binding {\ndisplay: grid;\ngrid-template-columns: max-content max-content;\ncolumn-gap: 1em;\nrow-gap: 0.3em;\njustify-items: start;\n\n> select,\n> input:not([type=\"checkbox\"]) {\nwidth: 100%;\n}\n\ninput[type=\"range\"] + span {\ndisplay: inline-block;\nmargin-left: 0.3em;\nmin-width: 2.2em;\nfont-variant-numeric: tabular-nums;\n}\n\ninput[type=\"range\"],\ninput[type=\"radio\"] {\nvertical-align: text-bottom;\n}\n\n.radio-group {\ndisplay: flex;\nalign-items: center;\n}\n\n.description {\nmax-width: 26em;\ngrid-column: 1 / -1;\ncolor: #777;\nfont-size: 90%;\nmargin-top: -0.5em;\n}\n}\n\n.gs-input-bindings {\nflex-basis: content;\nfont-size: 14px;\npadding: var(--genome-spy-basic-spacing);\n}\n";
|
|
3
3
|
//# sourceMappingURL=genome-spy.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genome-spy.css.d.ts","sourceRoot":"","sources":["../../../src/styles/genome-spy.css.js"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"genome-spy.css.d.ts","sourceRoot":"","sources":["../../../src/styles/genome-spy.css.js"],"names":[],"mappings":";AAAA,0iHAoPE"}
|
|
@@ -5,12 +5,6 @@ const css = `
|
|
|
5
5
|
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
@keyframes genome-spy-blinker {
|
|
9
|
-
50% {
|
|
10
|
-
opacity: 0;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
8
|
.genome-spy {
|
|
15
9
|
font-family: var(--genome-spy-font-family);
|
|
16
10
|
|
|
@@ -39,34 +33,11 @@ outline: none;
|
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
|
|
42
|
-
.loading-message {
|
|
43
|
-
position: absolute;
|
|
44
|
-
inset: 0;
|
|
45
|
-
display: flex;
|
|
46
|
-
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
|
|
50
|
-
.message {
|
|
51
|
-
color: #666;
|
|
52
|
-
opacity: 0;
|
|
53
|
-
transition: opacity 0.7s;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
36
|
.loading {
|
|
58
37
|
> canvas {
|
|
59
38
|
transform: scale(0.95, 0.95);
|
|
60
39
|
opacity: 0;
|
|
61
40
|
}
|
|
62
|
-
|
|
63
|
-
> .loading-message .message {
|
|
64
|
-
opacity: 1;
|
|
65
|
-
|
|
66
|
-
.ellipsis {
|
|
67
|
-
animation: genome-spy-blinker 1s linear infinite;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
41
|
}
|
|
71
42
|
|
|
72
43
|
.loading-indicators {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default function dataTooltipHandler(datum: Record<string, any>, mark: import("../marks/mark.js").default, params?:
|
|
1
|
+
export default function dataTooltipHandler(datum: Record<string, any>, mark: import("../marks/mark.js").default, params?: import("./tooltipHandler.js").TooltipHandlerParams, context?: import("./tooltipHandler.js").TooltipContext): Promise<string | import("lit-html").TemplateResult | HTMLElement>;
|
|
2
2
|
//# sourceMappingURL=dataTooltipHandler.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
2
|
import formatObject from "../utils/formatObject.js";
|
|
3
|
+
import { flattenDatumRows } from "./flattenDatumRows.js";
|
|
4
|
+
import createTooltipContext from "./tooltipContext.js";
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* @type {import("./tooltipHandler.js").TooltipHandler}
|
|
6
8
|
*/
|
|
7
|
-
export default async function dataTooltipHandler(datum, mark, params) {
|
|
9
|
+
export default async function dataTooltipHandler(datum, mark, params, context) {
|
|
8
10
|
/**
|
|
9
11
|
* @param {string} key
|
|
10
12
|
* @param {object} datum
|
|
@@ -30,41 +32,30 @@ export default async function dataTooltipHandler(datum, mark, params) {
|
|
|
30
32
|
return "";
|
|
31
33
|
};
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const entriesToHtml = (entries, prefix) => {
|
|
40
|
-
const strippedEntries = entries.filter(
|
|
41
|
-
([key, _value]) => !key.startsWith("_")
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
if (strippedEntries.length === 0) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
35
|
+
const tooltipContext = context ?? createTooltipContext(datum, mark, params);
|
|
36
|
+
const rawRows = tooltipContext.flattenDatumRows
|
|
37
|
+
? tooltipContext.flattenDatumRows()
|
|
38
|
+
: flattenDatumRows(datum);
|
|
39
|
+
const genomicRows = tooltipContext.genomicRows ?? [];
|
|
40
|
+
const hiddenRowKeys = new Set(tooltipContext.hiddenRowKeys ?? []);
|
|
47
41
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Object.entries(value),
|
|
52
|
-
(prefix ? prefix : "") + key + "."
|
|
53
|
-
)}`
|
|
54
|
-
: html`
|
|
55
|
-
<tr>
|
|
56
|
-
<th>${prefix}${key}</th>
|
|
57
|
-
<td>${formatObject(value)} ${legend(key, datum)}</td>
|
|
58
|
-
</tr>
|
|
59
|
-
`
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const tableContents = entriesToHtml(Object.entries(datum));
|
|
64
|
-
if (!tableContents) {
|
|
42
|
+
const visibleRawRows = rawRows.filter((row) => !hiddenRowKeys.has(row.key));
|
|
43
|
+
const orderedRows = [...genomicRows, ...visibleRawRows];
|
|
44
|
+
if (!orderedRows.length) {
|
|
65
45
|
return;
|
|
66
46
|
}
|
|
67
47
|
|
|
48
|
+
const tableContents = orderedRows.map((row) => {
|
|
49
|
+
const value = formatObject(row.value);
|
|
50
|
+
const valueLegend = legend(row.key, datum);
|
|
51
|
+
return html`
|
|
52
|
+
<tr>
|
|
53
|
+
<th>${row.key}</th>
|
|
54
|
+
<td>${value} ${valueLegend}</td>
|
|
55
|
+
</tr>
|
|
56
|
+
`;
|
|
57
|
+
});
|
|
58
|
+
|
|
68
59
|
const table = html`
|
|
69
60
|
<table class="attributes">
|
|
70
61
|
${tableContents}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataTooltipHandler.test.d.ts","sourceRoot":"","sources":["../../../src/tooltip/dataTooltipHandler.test.js"],"names":[],"mappings":""}
|