@genome-spy/core 0.73.0 → 0.74.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/AbortablePromiseCache-3gHJdF3E.js +96 -0
- package/dist/bundle/browser-BTgw5ieH.js +126 -0
- package/dist/bundle/chunk-DmhlhrBa.js +11 -0
- package/dist/bundle/esm-BDFRLEuD.js +1248 -0
- package/dist/bundle/esm-BygJiwh0.js +573 -0
- package/dist/bundle/esm-CGX-qz1d.js +155 -0
- package/dist/bundle/esm-CgfVIRJ-.js +121 -0
- package/dist/bundle/esm-CuMSzCHy.js +298 -0
- package/dist/bundle/esm-DMXpJXM4.js +369 -0
- package/dist/bundle/esm-DQiq2Zhd.js +1426 -0
- package/dist/bundle/esm-DtE8VqAv.js +1015 -0
- package/dist/bundle/esm-sIoQYZ21.js +461 -0
- package/dist/bundle/index.es.js +21071 -25935
- package/dist/bundle/index.js +363 -379
- package/dist/bundle/parquetRead-DG_-F5j5.js +1609 -0
- package/dist/schema.json +13098 -7095
- package/dist/src/config/axisConfig.d.ts +16 -0
- package/dist/src/config/axisConfig.d.ts.map +1 -0
- package/dist/src/config/axisConfig.js +84 -0
- package/dist/src/config/defaultConfig.d.ts +3 -0
- package/dist/src/config/defaultConfig.d.ts.map +1 -0
- package/dist/src/config/defaultConfig.js +38 -0
- package/dist/src/config/defaults/axisDefaults.d.ts +5 -0
- package/dist/src/config/defaults/axisDefaults.d.ts.map +1 -0
- package/dist/src/config/defaults/axisDefaults.js +72 -0
- package/dist/src/config/defaults/markDefaults.d.ts +15 -0
- package/dist/src/config/defaults/markDefaults.d.ts.map +1 -0
- package/dist/src/config/defaults/markDefaults.js +121 -0
- package/dist/src/config/defaults/scaleDefaults.d.ts +5 -0
- package/dist/src/config/defaults/scaleDefaults.d.ts.map +1 -0
- package/dist/src/config/defaults/scaleDefaults.js +18 -0
- package/dist/src/config/defaults/titleDefaults.d.ts +5 -0
- package/dist/src/config/defaults/titleDefaults.d.ts.map +1 -0
- package/dist/src/config/defaults/titleDefaults.js +47 -0
- package/dist/src/config/defaults/viewDefaults.d.ts +3 -0
- package/dist/src/config/defaults/viewDefaults.d.ts.map +1 -0
- package/dist/src/config/defaults/viewDefaults.js +2 -0
- package/dist/src/config/markConfig.d.ts +8 -0
- package/dist/src/config/markConfig.d.ts.map +1 -0
- package/dist/src/config/markConfig.js +27 -0
- package/dist/src/config/mergeConfig.d.ts +8 -0
- package/dist/src/config/mergeConfig.d.ts.map +1 -0
- package/dist/src/config/mergeConfig.js +81 -0
- package/dist/src/config/resolveConfig.d.ts +22 -0
- package/dist/src/config/resolveConfig.d.ts.map +1 -0
- package/dist/src/config/resolveConfig.js +32 -0
- package/dist/src/config/scaleConfig.d.ts +40 -0
- package/dist/src/config/scaleConfig.d.ts.map +1 -0
- package/dist/src/config/scaleConfig.js +220 -0
- package/dist/src/config/styleUtils.d.ts +6 -0
- package/dist/src/config/styleUtils.d.ts.map +1 -0
- package/dist/src/config/styleUtils.js +10 -0
- package/dist/src/config/themes.d.ts +15 -0
- package/dist/src/config/themes.d.ts.map +1 -0
- package/dist/src/config/themes.js +293 -0
- package/dist/src/config/titleConfig.d.ts +12 -0
- package/dist/src/config/titleConfig.d.ts.map +1 -0
- package/dist/src/config/titleConfig.js +42 -0
- package/dist/src/config/viewConfig.d.ts +7 -0
- package/dist/src/config/viewConfig.d.ts.map +1 -0
- package/dist/src/config/viewConfig.js +29 -0
- package/dist/src/data/flowNode.d.ts +22 -1
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +37 -1
- package/dist/src/data/formats/bed.d.ts.map +1 -1
- package/dist/src/data/formats/bed.js +6 -1
- package/dist/src/data/formats/bedpe.d.ts.map +1 -1
- package/dist/src/data/formats/bedpe.js +4 -0
- package/dist/src/data/formats/fasta.d.ts.map +1 -1
- package/dist/src/data/formats/fasta.js +4 -0
- package/dist/src/data/formats/parquet.d.ts.map +1 -1
- package/dist/src/data/formats/parquet.js +4 -0
- package/dist/src/data/sources/dataSourceFactory.d.ts +2 -13
- package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
- package/dist/src/data/sources/dataSourceFactory.js +5 -141
- package/dist/src/data/sources/lazy/axisGenomeSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/axisGenomeSource.js +11 -0
- package/dist/src/data/sources/lazy/axisTickSource.d.ts +1 -1
- package/dist/src/data/sources/lazy/axisTickSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/axisTickSource.js +19 -8
- package/dist/src/data/sources/lazy/bamSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bamSource.js +11 -0
- package/dist/src/data/sources/lazy/bigBedSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigBedSource.js +12 -1
- package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/bigWigSource.js +11 -0
- package/dist/src/data/sources/lazy/gff3Source.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/gff3Source.js +12 -1
- package/dist/src/data/sources/lazy/indexedFastaSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/indexedFastaSource.js +11 -0
- package/dist/src/data/sources/lazy/lazyDataSourceRegistry.d.ts +27 -0
- package/dist/src/data/sources/lazy/lazyDataSourceRegistry.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/lazyDataSourceRegistry.js +65 -0
- package/dist/src/data/sources/lazy/registerBuiltInLazySources.d.ts +2 -0
- package/dist/src/data/sources/lazy/registerBuiltInLazySources.d.ts.map +1 -0
- package/dist/src/data/sources/lazy/registerBuiltInLazySources.js +8 -0
- package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/singleAxisLazySource.js +11 -2
- package/dist/src/data/sources/lazy/vcfSource.d.ts.map +1 -1
- package/dist/src/data/sources/lazy/vcfSource.js +11 -0
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +5 -2
- package/dist/src/data/transforms/aggregate.d.ts +1 -0
- package/dist/src/data/transforms/aggregate.d.ts.map +1 -1
- package/dist/src/data/transforms/aggregate.js +30 -8
- package/dist/src/data/transforms/aggregateOps.d.ts.map +1 -1
- package/dist/src/data/transforms/aggregateOps.js +12 -1
- package/dist/src/data/transforms/coverage.js +2 -2
- package/dist/src/data/transforms/filter.js +1 -1
- package/dist/src/data/transforms/filterScoredLabels.d.ts +6 -0
- package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
- package/dist/src/data/transforms/filterScoredLabels.js +9 -0
- package/dist/src/data/transforms/measureText.d.ts +1 -0
- package/dist/src/data/transforms/measureText.d.ts.map +1 -1
- package/dist/src/data/transforms/measureText.js +14 -5
- package/dist/src/data/transforms/pileup.d.ts.map +1 -1
- package/dist/src/data/transforms/pileup.js +1 -2
- package/dist/src/data/transforms/regexFold.d.ts.map +1 -1
- package/dist/src/data/transforms/regexFold.js +0 -1
- package/dist/src/embedFactory.d.ts +13 -0
- package/dist/src/embedFactory.d.ts.map +1 -0
- package/dist/src/embedFactory.js +127 -0
- package/dist/src/encoder/accessor.d.ts +3 -12
- package/dist/src/encoder/accessor.d.ts.map +1 -1
- package/dist/src/encoder/accessor.js +10 -65
- package/dist/src/encoder/encoder.d.ts +51 -8
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +179 -55
- package/dist/src/fonts/bmFontManager.js +1 -1
- package/dist/src/full.d.ts +2 -0
- package/dist/src/full.d.ts.map +1 -0
- package/dist/src/full.js +2 -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 -2
- package/dist/src/genome/genomeStore.js +1 -1
- package/dist/src/genome/rootGenomeConfig.d.ts.map +1 -1
- package/dist/src/genome/rootGenomeConfig.js +6 -2
- package/dist/src/genome/scaleLocus.d.ts.map +1 -1
- package/dist/src/genome/scaleLocus.js +26 -7
- package/dist/src/genomeSpy/cursorManager.d.ts +69 -0
- package/dist/src/genomeSpy/cursorManager.d.ts.map +1 -0
- package/dist/src/genomeSpy/cursorManager.js +131 -0
- package/dist/src/genomeSpy/headlessBootstrap.d.ts +113 -0
- package/dist/src/genomeSpy/headlessBootstrap.d.ts.map +1 -0
- package/dist/src/genomeSpy/headlessBootstrap.js +246 -0
- package/dist/src/genomeSpy/interactionController.d.ts +5 -0
- package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
- package/dist/src/genomeSpy/interactionController.js +212 -19
- package/dist/src/genomeSpy/interactionDispatcher.d.ts +50 -0
- package/dist/src/genomeSpy/interactionDispatcher.d.ts.map +1 -0
- package/dist/src/genomeSpy/interactionDispatcher.js +203 -0
- package/dist/src/genomeSpy/viewContextFactory.d.ts +4 -2
- package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewContextFactory.js +12 -4
- package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
- package/dist/src/genomeSpy/viewDataInit.js +7 -3
- package/dist/src/genomeSpy.d.ts +1 -124
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +7 -688
- package/dist/src/genomeSpyBase.d.ts +133 -0
- package/dist/src/genomeSpyBase.d.ts.map +1 -0
- package/dist/src/genomeSpyBase.js +719 -0
- package/dist/src/gl/arrayBuilder.d.ts.map +1 -1
- package/dist/src/gl/arrayBuilder.js +0 -3
- package/dist/src/gl/colorUtils.d.ts.map +1 -1
- package/dist/src/gl/colorUtils.js +3 -0
- package/dist/src/gl/dataToVertices.d.ts.map +1 -1
- package/dist/src/gl/dataToVertices.js +13 -8
- package/dist/src/gl/glslScaleGenerator.d.ts +2 -2
- package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/gl/glslScaleGenerator.js +5 -7
- package/dist/src/index.d.ts +3 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -114
- package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +4462 -0
- package/dist/src/marks/link.d.ts.map +1 -1
- package/dist/src/marks/link.js +0 -23
- package/dist/src/marks/mark.d.ts +8 -1
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +61 -20
- package/dist/src/marks/markUtils.d.ts +18 -1
- package/dist/src/marks/markUtils.d.ts.map +1 -1
- package/dist/src/marks/markUtils.js +52 -4
- package/dist/src/marks/point.d.ts.map +1 -1
- package/dist/src/marks/point.js +6 -26
- package/dist/src/marks/rect.d.ts.map +1 -1
- package/dist/src/marks/rect.js +13 -21
- package/dist/src/marks/rule.d.ts +7 -2
- package/dist/src/marks/rule.d.ts.map +1 -1
- package/dist/src/marks/rule.js +125 -16
- package/dist/src/marks/text.d.ts.map +1 -1
- package/dist/src/marks/text.js +5 -47
- package/dist/src/minimal.d.ts +8 -0
- package/dist/src/minimal.d.ts.map +1 -0
- package/dist/src/minimal.js +21 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts +19 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/viewParamRuntime.js +35 -0
- package/dist/src/scale/scale.d.ts.map +1 -1
- package/dist/src/scale/scale.js +13 -7
- package/dist/src/scales/axisResolution.d.ts.map +1 -1
- package/dist/src/scales/axisResolution.js +9 -5
- package/dist/src/scales/domainPlanner.d.ts +28 -8
- package/dist/src/scales/domainPlanner.d.ts.map +1 -1
- package/dist/src/scales/domainPlanner.js +207 -73
- package/dist/src/scales/indexLikeDomainUtils.d.ts +29 -0
- package/dist/src/scales/indexLikeDomainUtils.d.ts.map +1 -0
- package/dist/src/scales/indexLikeDomainUtils.js +67 -0
- package/dist/src/scales/resolutionMemberOrder.d.ts +15 -0
- package/dist/src/scales/resolutionMemberOrder.d.ts.map +1 -0
- package/dist/src/scales/resolutionMemberOrder.js +22 -0
- package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
- package/dist/src/scales/scaleInteractionController.js +43 -4
- package/dist/src/scales/scalePropsResolver.d.ts +3 -1
- package/dist/src/scales/scalePropsResolver.d.ts.map +1 -1
- package/dist/src/scales/scalePropsResolver.js +83 -6
- package/dist/src/scales/scaleResolution.d.ts +23 -0
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +220 -58
- package/dist/src/scales/scaleResolutionTestUtils.d.ts.map +1 -1
- package/dist/src/scales/scaleResolutionTestUtils.js +6 -2
- package/dist/src/scales/scaleRules.d.ts.map +1 -1
- package/dist/src/scales/scaleRules.js +16 -2
- package/dist/src/scales/selectionDomainUtils.d.ts +30 -0
- package/dist/src/scales/selectionDomainUtils.d.ts.map +1 -1
- package/dist/src/scales/selectionDomainUtils.js +116 -1
- package/dist/src/screenshotHarness.js +3 -4
- package/dist/src/spec/axis.d.ts +41 -30
- package/dist/src/spec/channel.d.ts +15 -9
- package/dist/src/spec/config.d.ts +264 -0
- package/dist/src/spec/data.d.ts +7 -0
- package/dist/src/spec/decoration.d.ts +51 -0
- package/dist/src/spec/exampleFiles.d.ts +12 -0
- package/dist/src/spec/exampleFiles.d.ts.map +1 -0
- package/dist/src/spec/exampleFiles.js +52 -0
- package/dist/src/spec/font.d.ts +1 -1
- package/dist/src/spec/mark.d.ts +97 -13
- package/dist/src/spec/parameter.d.ts +30 -10
- package/dist/src/spec/root.d.ts +14 -0
- package/dist/src/spec/scale.d.ts +18 -13
- package/dist/src/spec/title.d.ts +13 -2
- package/dist/src/spec/tooltip.d.ts +1 -1
- package/dist/src/spec/transform.d.ts +39 -4
- package/dist/src/spec/view.d.ts +67 -19
- package/dist/src/styles/genome-spy.css +55 -55
- 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 +23 -22
- package/dist/src/testSetup.d.ts +2 -0
- package/dist/src/testSetup.d.ts.map +1 -0
- package/dist/src/testSetup.js +5 -0
- package/dist/src/tooltip/dataTooltipHandler.js +8 -2
- package/dist/src/tooltip/tooltipContext.d.ts.map +1 -1
- package/dist/src/tooltip/tooltipContext.js +3 -2
- package/dist/src/types/embedApi.d.ts +7 -0
- package/dist/src/types/encoder.d.ts +17 -15
- package/dist/src/types/scaleResolutionApi.d.ts +20 -0
- package/dist/src/types/viewContext.d.ts +23 -1
- package/dist/src/utils/expression.d.ts +2 -2
- package/dist/src/utils/expression.d.ts.map +1 -1
- package/dist/src/utils/expression.js +63 -8
- package/dist/src/utils/field.d.ts.map +1 -1
- package/dist/src/utils/field.js +0 -1
- package/dist/src/utils/inertia.d.ts.map +1 -1
- package/dist/src/utils/inertia.js +0 -1
- package/dist/src/utils/inputBinding.d.ts +1 -1
- package/dist/src/utils/interaction.d.ts +109 -0
- package/dist/src/utils/interaction.d.ts.map +1 -0
- package/dist/src/utils/interaction.js +200 -0
- package/dist/src/utils/interactionEvent.d.ts +21 -42
- package/dist/src/utils/interactionEvent.d.ts.map +1 -1
- package/dist/src/utils/interactionEvent.js +43 -66
- package/dist/src/utils/kWayMerge.js +1 -1
- package/dist/src/utils/mergeObjects.d.ts.map +1 -1
- package/dist/src/utils/mergeObjects.js +0 -2
- package/dist/src/utils/radixSort.d.ts.map +1 -1
- package/dist/src/utils/radixSort.js +0 -2
- package/dist/src/utils/throttle.d.ts.map +1 -1
- package/dist/src/utils/throttle.js +0 -2
- package/dist/src/utils/ui/tooltip.d.ts +1 -0
- package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
- package/dist/src/utils/ui/tooltip.js +1 -0
- package/dist/src/utils/url.js +1 -1
- package/dist/src/view/axisGridView.d.ts +1 -1
- package/dist/src/view/axisGridView.d.ts.map +1 -1
- package/dist/src/view/axisGridView.js +2 -47
- package/dist/src/view/axisView.d.ts +2 -3
- package/dist/src/view/axisView.d.ts.map +1 -1
- package/dist/src/view/axisView.js +251 -106
- package/dist/src/view/concatView.d.ts +2 -1
- package/dist/src/view/concatView.d.ts.map +1 -1
- package/dist/src/view/concatView.js +4 -2
- package/dist/src/view/containerMutationHelper.d.ts +3 -0
- package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
- package/dist/src/view/containerMutationHelper.js +4 -1
- package/dist/src/view/facetView.d.ts +1 -1
- package/dist/src/view/facetView.js +3 -3
- package/dist/src/view/flowBuilder.js +2 -2
- package/dist/src/view/gridView/gridChild.d.ts +6 -0
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +72 -43
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +255 -101
- package/dist/src/view/gridView/keyboardZoomController.d.ts +2 -2
- package/dist/src/view/gridView/keyboardZoomController.d.ts.map +1 -1
- package/dist/src/view/gridView/keyboardZoomController.js +1 -1
- package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
- package/dist/src/view/gridView/scrollbar.js +4 -2
- package/dist/src/view/gridView/selectionRect.d.ts +4 -0
- package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
- package/dist/src/view/gridView/selectionRect.js +20 -1
- package/dist/src/view/gridView/separatorView.d.ts +1 -0
- package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
- package/dist/src/view/gridView/separatorView.js +9 -0
- package/dist/src/view/interactionRouting.d.ts +20 -0
- package/dist/src/view/interactionRouting.d.ts.map +1 -0
- package/dist/src/view/interactionRouting.js +53 -0
- package/dist/src/view/layerView.d.ts.map +1 -1
- package/dist/src/view/layerView.js +12 -9
- package/dist/src/view/layout/grid.js +1 -1
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +0 -2
- package/dist/src/view/testUtils.d.ts +17 -3
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +62 -69
- package/dist/src/view/title.d.ts +8 -1
- package/dist/src/view/title.d.ts.map +1 -1
- package/dist/src/view/title.js +66 -76
- package/dist/src/view/unitView.d.ts +1 -1
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +67 -17
- package/dist/src/view/view.d.ts +76 -30
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +136 -47
- package/dist/src/view/viewFactory.d.ts +11 -3
- package/dist/src/view/viewFactory.d.ts.map +1 -1
- package/dist/src/view/viewFactory.js +37 -11
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +41 -5
- package/dist/src/view/zoom.d.ts +2 -2
- package/dist/src/view/zoom.d.ts.map +1 -1
- package/dist/src/view/zoom.js +21 -23
- package/package.json +18 -10
- package/dist/bundle/AbortablePromiseCache-Dj0vzLnp.js +0 -149
- package/dist/bundle/browser-0iNU5Wit.js +0 -138
- package/dist/bundle/index-BYsZN7b0.js +0 -1597
- package/dist/bundle/index-C3kClAEN.js +0 -1771
- package/dist/bundle/index-C7wOh6y1.js +0 -657
- package/dist/bundle/index-CRaQAuki.js +0 -326
- package/dist/bundle/index-D9v1PCj9.js +0 -507
- package/dist/bundle/index-GDOuv_D5.js +0 -266
- package/dist/bundle/index-Gt44EOIH.js +0 -628
- package/dist/bundle/inflate-GtwLkvSP.js +0 -1048
- package/dist/bundle/parquetRead-BnAGCa4_.js +0 -1663
- package/dist/bundle/unzip-Bac01w6X.js +0 -1492
- package/dist/src/config/scaleDefaults.d.ts +0 -8
- package/dist/src/config/scaleDefaults.d.ts.map +0 -1
- package/dist/src/config/scaleDefaults.js +0 -45
|
@@ -31,12 +31,14 @@ import {
|
|
|
31
31
|
import { NominalDomain } from "../utils/domainArray.js";
|
|
32
32
|
import { shallowArrayEquals } from "../utils/arrayUtils.js";
|
|
33
33
|
import createIndexer from "../utils/indexer.js";
|
|
34
|
+
import { getCachedOrCall, invalidate } from "../utils/propertyCacher.js";
|
|
34
35
|
import { resolveUrl } from "../utils/url.js";
|
|
35
36
|
import {
|
|
37
|
+
findIntervalSelectionBindingOwners,
|
|
36
38
|
normalizeIntervalForSelection,
|
|
37
39
|
requireIntervalSelection,
|
|
38
|
-
requireParamRuntime,
|
|
39
40
|
} from "./selectionDomainUtils.js";
|
|
41
|
+
import { toExternalIndexLikeInterval } from "./indexLikeDomainUtils.js";
|
|
40
42
|
|
|
41
43
|
// Register scaleLocus to Vega-Scale.
|
|
42
44
|
// Loci are discrete but the scale's domain can be adjusted in a continuous manner.
|
|
@@ -125,6 +127,11 @@ export default class ScaleResolution {
|
|
|
125
127
|
|
|
126
128
|
#selectionReverseSyncSuppressionDepth = 0;
|
|
127
129
|
|
|
130
|
+
#ignoreSelectionInitial = false;
|
|
131
|
+
|
|
132
|
+
/** @type {[number, number] | null | undefined} */
|
|
133
|
+
#lastLinkedSelectionInterval = undefined;
|
|
134
|
+
|
|
128
135
|
/**
|
|
129
136
|
* @param {Channel} channel
|
|
130
137
|
*/
|
|
@@ -138,6 +145,7 @@ export default class ScaleResolution {
|
|
|
138
145
|
|
|
139
146
|
this.#domainAggregator = new DomainPlanner({
|
|
140
147
|
getMembers: () => this.#getActiveMembers(),
|
|
148
|
+
getAllMembers: () => this.#members,
|
|
141
149
|
getDataMembers: () =>
|
|
142
150
|
this.#getActiveMembers(this.#dataDomainMembers),
|
|
143
151
|
getType: () => this.type,
|
|
@@ -157,8 +165,7 @@ export default class ScaleResolution {
|
|
|
157
165
|
getAnimator: () => this.#viewContext.animator,
|
|
158
166
|
getInitialDomainSnapshot: () =>
|
|
159
167
|
this.#domainAggregator.initialDomainSnapshot,
|
|
160
|
-
getResetDomain: () =>
|
|
161
|
-
this.#domainAggregator.getConfiguredOrDefaultDomain(),
|
|
168
|
+
getResetDomain: () => this.#getConfiguredOrDefaultDomain(),
|
|
162
169
|
fromComplexInterval: this.fromComplexInterval.bind(this),
|
|
163
170
|
getGenomeExtent: () => this.#getLocusExtent(),
|
|
164
171
|
});
|
|
@@ -263,7 +270,7 @@ export default class ScaleResolution {
|
|
|
263
270
|
type === "domain" &&
|
|
264
271
|
this.#selectionReverseSyncSuppressionDepth === 0
|
|
265
272
|
) {
|
|
266
|
-
this
|
|
273
|
+
this.syncLinkedSelectionFromDomain();
|
|
267
274
|
}
|
|
268
275
|
|
|
269
276
|
for (const listener of this.#listeners[type].values()) {
|
|
@@ -286,27 +293,15 @@ export default class ScaleResolution {
|
|
|
286
293
|
}
|
|
287
294
|
}
|
|
288
295
|
|
|
289
|
-
|
|
296
|
+
syncLinkedSelectionFromDomain() {
|
|
290
297
|
const linkInfo =
|
|
291
|
-
this.#domainAggregator.
|
|
292
|
-
if (!linkInfo) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const shouldReverseSync =
|
|
297
|
-
linkInfo.sync === "twoWay" ||
|
|
298
|
-
(linkInfo.sync === "auto" && this.isZoomable());
|
|
299
|
-
if (!shouldReverseSync) {
|
|
298
|
+
this.#domainAggregator.getSelectionConfiguredDomainBindingInfo();
|
|
299
|
+
if (!linkInfo || !this.isZoomable()) {
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
const runtime = requireParamRuntime(
|
|
304
|
-
this.#firstMemberView.paramRuntime,
|
|
305
|
-
linkInfo.param
|
|
306
|
-
);
|
|
307
|
-
|
|
308
303
|
const selection = requireIntervalSelection(
|
|
309
|
-
runtime.getValue(linkInfo.param),
|
|
304
|
+
linkInfo.runtime.getValue(linkInfo.param),
|
|
310
305
|
linkInfo.param
|
|
311
306
|
);
|
|
312
307
|
|
|
@@ -332,7 +327,7 @@ export default class ScaleResolution {
|
|
|
332
327
|
return;
|
|
333
328
|
}
|
|
334
329
|
|
|
335
|
-
runtime.setValue(linkInfo.param, {
|
|
330
|
+
linkInfo.runtime.setValue(linkInfo.param, {
|
|
336
331
|
...selection,
|
|
337
332
|
type: "interval",
|
|
338
333
|
intervals: {
|
|
@@ -350,6 +345,65 @@ export default class ScaleResolution {
|
|
|
350
345
|
return normalizeIntervalForSelection(domain, this.zoomExtent);
|
|
351
346
|
}
|
|
352
347
|
|
|
348
|
+
#getLinkedSelectionInfo() {
|
|
349
|
+
return this.#domainAggregator.getSelectionConfiguredDomainBindingInfo();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
#shouldIncludeSelectionInitial() {
|
|
353
|
+
return !this.#ignoreSelectionInitial;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @param {boolean} [extractDataDomain]
|
|
358
|
+
* @param {import("../spec/scale.js").Scale["assembly"]} [locusAssembly]
|
|
359
|
+
* @returns {any[]}
|
|
360
|
+
*/
|
|
361
|
+
#getConfiguredOrDefaultDomain(extractDataDomain = false, locusAssembly) {
|
|
362
|
+
return this.#domainAggregator.getConfiguredOrDefaultDomain(
|
|
363
|
+
extractDataDomain,
|
|
364
|
+
locusAssembly,
|
|
365
|
+
{
|
|
366
|
+
includeSelectionInitial: this.#shouldIncludeSelectionInitial(),
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* @returns {boolean}
|
|
373
|
+
*/
|
|
374
|
+
#hasConfiguredDomain() {
|
|
375
|
+
return this.#domainAggregator.hasConfiguredDomain({
|
|
376
|
+
includeSelectionInitial: this.#shouldIncludeSelectionInitial(),
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @param {import("./domainPlanner.js").SelectionDomainLinkInfo} linkInfo
|
|
382
|
+
* @returns {[number, number] | null}
|
|
383
|
+
*/
|
|
384
|
+
#getCurrentLinkedSelectionInterval(linkInfo) {
|
|
385
|
+
const selection = requireIntervalSelection(
|
|
386
|
+
linkInfo.runtime.getValue(linkInfo.param),
|
|
387
|
+
linkInfo.param
|
|
388
|
+
);
|
|
389
|
+
const interval = selection.intervals[linkInfo.encoding];
|
|
390
|
+
return interval && interval.length === 2
|
|
391
|
+
? /** @type {[number, number]} */ (interval)
|
|
392
|
+
: null;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @param {[number, number] | null} previousInterval
|
|
397
|
+
* @param {[number, number] | null} nextInterval
|
|
398
|
+
*/
|
|
399
|
+
#updateSelectionInitialBypass(previousInterval, nextInterval) {
|
|
400
|
+
if (nextInterval) {
|
|
401
|
+
this.#ignoreSelectionInitial = false;
|
|
402
|
+
} else if (previousInterval) {
|
|
403
|
+
this.#ignoreSelectionInitial = true;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
353
407
|
/**
|
|
354
408
|
* Add a view to this resolution.
|
|
355
409
|
* N.B. This is expected to be called in depth-first order
|
|
@@ -413,12 +467,16 @@ export default class ScaleResolution {
|
|
|
413
467
|
if (!this.type) {
|
|
414
468
|
this.type = type;
|
|
415
469
|
} else if (type !== this.type && !isSecondaryChannel(channel)) {
|
|
470
|
+
// TODO: Revisit shared discrete positional scales when
|
|
471
|
+
// implementing Vega-Lite-like band-vs-point inference.
|
|
472
|
+
// Nominal/ordinal members should be able to share a scale even
|
|
473
|
+
// if one member wants "point" and another wants "band"; the
|
|
474
|
+
// merged result should resolve to "band". Explicit
|
|
475
|
+
// user-specified incompatible scale types should still error.
|
|
416
476
|
// TODO: Include a reference to the layer
|
|
417
477
|
throw new Error(
|
|
418
478
|
`Can not use shared scale for different data types: ${this.type} vs. ${type}. Use "resolve: independent" for channel ${this.channel}`
|
|
419
479
|
);
|
|
420
|
-
// Actually, point scale could be changed into band scale
|
|
421
|
-
// TODO: Use the same merging logic as in: https://github.com/vega/vega-lite/blob/master/src/scale.ts
|
|
422
480
|
}
|
|
423
481
|
}
|
|
424
482
|
|
|
@@ -426,7 +484,7 @@ export default class ScaleResolution {
|
|
|
426
484
|
if (member.contributesToDomain) {
|
|
427
485
|
this.#dataDomainMembers.add(member);
|
|
428
486
|
}
|
|
429
|
-
this.#
|
|
487
|
+
this.#invalidateConfiguredDomain();
|
|
430
488
|
this.#refreshSelectionDomainParamSubscriptions();
|
|
431
489
|
return member;
|
|
432
490
|
}
|
|
@@ -441,7 +499,7 @@ export default class ScaleResolution {
|
|
|
441
499
|
const removed = this.#members.delete(registeredMember);
|
|
442
500
|
if (removed) {
|
|
443
501
|
this.#dataDomainMembers.delete(registeredMember);
|
|
444
|
-
this.#
|
|
502
|
+
this.#invalidateConfiguredDomain();
|
|
445
503
|
this.#refreshSelectionDomainParamSubscriptions();
|
|
446
504
|
}
|
|
447
505
|
return removed && this.#members.size === 0;
|
|
@@ -460,6 +518,7 @@ export default class ScaleResolution {
|
|
|
460
518
|
unsubscribe();
|
|
461
519
|
}
|
|
462
520
|
this.#selectionDomainParamUnsubscribers = [];
|
|
521
|
+
this.#lastLinkedSelectionInterval = undefined;
|
|
463
522
|
}
|
|
464
523
|
|
|
465
524
|
#refreshSelectionDomainParamSubscriptions() {
|
|
@@ -469,20 +528,25 @@ export default class ScaleResolution {
|
|
|
469
528
|
return;
|
|
470
529
|
}
|
|
471
530
|
|
|
472
|
-
const linkInfo =
|
|
473
|
-
this.#domainAggregator.getSelectionConfiguredDomainInfo();
|
|
531
|
+
const linkInfo = this.#getLinkedSelectionInfo();
|
|
474
532
|
if (!linkInfo) {
|
|
475
533
|
return;
|
|
476
534
|
}
|
|
477
535
|
|
|
478
|
-
|
|
479
|
-
this.#
|
|
480
|
-
linkInfo.param
|
|
481
|
-
);
|
|
536
|
+
this.#lastLinkedSelectionInterval =
|
|
537
|
+
this.#getCurrentLinkedSelectionInterval(linkInfo);
|
|
482
538
|
|
|
483
539
|
this.#selectionDomainParamUnsubscribers.push(
|
|
484
|
-
runtime.subscribe(linkInfo.param, () => {
|
|
485
|
-
this.#
|
|
540
|
+
linkInfo.runtime.subscribe(linkInfo.param, () => {
|
|
541
|
+
const previousInterval = this.#lastLinkedSelectionInterval;
|
|
542
|
+
const currentInterval =
|
|
543
|
+
this.#getCurrentLinkedSelectionInterval(linkInfo);
|
|
544
|
+
this.#updateSelectionInitialBypass(
|
|
545
|
+
previousInterval,
|
|
546
|
+
currentInterval
|
|
547
|
+
);
|
|
548
|
+
this.#lastLinkedSelectionInterval = currentInterval;
|
|
549
|
+
this.#invalidateConfiguredDomain();
|
|
486
550
|
this.reconfigureDomain();
|
|
487
551
|
})
|
|
488
552
|
);
|
|
@@ -539,11 +603,11 @@ export default class ScaleResolution {
|
|
|
539
603
|
/**
|
|
540
604
|
* Returns true if the domain has been defined explicitly, i.e. not extracted from the data.
|
|
541
605
|
*/
|
|
542
|
-
|
|
543
|
-
return this.#
|
|
606
|
+
isDomainDefinedExplicitly() {
|
|
607
|
+
return this.#hasConfiguredDomain();
|
|
544
608
|
}
|
|
545
609
|
|
|
546
|
-
|
|
610
|
+
isDomainInitialized() {
|
|
547
611
|
const s = this.#scaleManager.scale;
|
|
548
612
|
if (!s) {
|
|
549
613
|
return false;
|
|
@@ -569,14 +633,48 @@ export default class ScaleResolution {
|
|
|
569
633
|
* @returns {import("../spec/scale.js").Scale}
|
|
570
634
|
*/
|
|
571
635
|
#getMergedScaleProps() {
|
|
572
|
-
return
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
636
|
+
return getCachedOrCall(this, "mergedScaleProps", () => {
|
|
637
|
+
const props = resolveScalePropsBase({
|
|
638
|
+
channel: this.channel,
|
|
639
|
+
dataType: this.type,
|
|
640
|
+
members: this.#members,
|
|
641
|
+
isExplicitDomain: this.isDomainDefinedExplicitly(),
|
|
642
|
+
configScopes: this.#firstMemberView.getConfigScopes(),
|
|
643
|
+
});
|
|
644
|
+
this.#validateLinkedSelectionConfiguration(props);
|
|
645
|
+
return props;
|
|
577
646
|
});
|
|
578
647
|
}
|
|
579
648
|
|
|
649
|
+
#invalidateMergedScaleProps() {
|
|
650
|
+
invalidate(this, "mergedScaleProps");
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
#invalidateConfiguredDomain() {
|
|
654
|
+
this.#domainAggregator.invalidateConfiguredDomain();
|
|
655
|
+
this.#invalidateMergedScaleProps();
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* @param {import("../spec/scale.js").Scale} props
|
|
660
|
+
*/
|
|
661
|
+
#validateLinkedSelectionConfiguration(props) {
|
|
662
|
+
const linkInfo = this.#getLinkedSelectionInfo();
|
|
663
|
+
if (!linkInfo || props === null || props.type === "null") {
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
const isZoomable =
|
|
668
|
+
isContinuous(props.type) && !isDiscrete(props.type) && !!props.zoom;
|
|
669
|
+
|
|
670
|
+
if (linkInfo.hasInitial && !isZoomable) {
|
|
671
|
+
throw new Error(
|
|
672
|
+
`Selection domain reference "${linkInfo.param}.${linkInfo.encoding}" cannot use "initial" with a non-zoomable ${this.channel} scale. ` +
|
|
673
|
+
`Enable zoom on the linked scale or remove "initial".`
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
580
678
|
/**
|
|
581
679
|
* Returns locus assembly requirements without initializing the scale.
|
|
582
680
|
*
|
|
@@ -604,6 +702,23 @@ export default class ScaleResolution {
|
|
|
604
702
|
};
|
|
605
703
|
}
|
|
606
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Returns the resolved scale type without instantiating the scale.
|
|
707
|
+
*
|
|
708
|
+
* Useful during view construction, before assembly preflight has loaded
|
|
709
|
+
* URL-backed locus genomes.
|
|
710
|
+
*
|
|
711
|
+
* @returns {import("../spec/scale.js").Scale["type"] | undefined}
|
|
712
|
+
*/
|
|
713
|
+
getResolvedScaleType() {
|
|
714
|
+
const props = this.#getMergedScaleProps();
|
|
715
|
+
if (props === null || props.type === "null") {
|
|
716
|
+
return undefined;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
return props.type;
|
|
720
|
+
}
|
|
721
|
+
|
|
607
722
|
/**
|
|
608
723
|
* Returns the merged scale properties supplemented with inferred properties
|
|
609
724
|
* and domain.
|
|
@@ -619,13 +734,15 @@ export default class ScaleResolution {
|
|
|
619
734
|
return { type: "null" };
|
|
620
735
|
}
|
|
621
736
|
|
|
622
|
-
const
|
|
737
|
+
const resolvedProps = { ...props };
|
|
738
|
+
|
|
739
|
+
const domain = this.#getConfiguredOrDefaultDomain(
|
|
623
740
|
extractDataDomain,
|
|
624
|
-
|
|
741
|
+
resolvedProps.type === LOCUS ? resolvedProps.assembly : undefined
|
|
625
742
|
);
|
|
626
743
|
|
|
627
|
-
if (isDiscrete(
|
|
628
|
-
const isExplicit = this
|
|
744
|
+
if (isDiscrete(resolvedProps.type)) {
|
|
745
|
+
const isExplicit = this.isDomainDefinedExplicitly();
|
|
629
746
|
const indexer = this.#getCategoricalIndexer(isExplicit);
|
|
630
747
|
if (domain != null) {
|
|
631
748
|
if (
|
|
@@ -641,7 +758,7 @@ export default class ScaleResolution {
|
|
|
641
758
|
const indexedDomain = indexer
|
|
642
759
|
.domain()
|
|
643
760
|
.filter((value) => active.has(value));
|
|
644
|
-
|
|
761
|
+
resolvedProps.domain =
|
|
645
762
|
indexedDomain.length > 0
|
|
646
763
|
? /** @type {import("../spec/scale.js").ScalarDomain} */ (
|
|
647
764
|
indexedDomain
|
|
@@ -649,7 +766,7 @@ export default class ScaleResolution {
|
|
|
649
766
|
: new NominalDomain();
|
|
650
767
|
} else {
|
|
651
768
|
const indexedDomain = indexer.domain();
|
|
652
|
-
|
|
769
|
+
resolvedProps.domain =
|
|
653
770
|
indexedDomain.length > 0
|
|
654
771
|
? /** @type {import("../spec/scale.js").ScalarDomain} */ (
|
|
655
772
|
indexedDomain
|
|
@@ -657,18 +774,21 @@ export default class ScaleResolution {
|
|
|
657
774
|
: new NominalDomain();
|
|
658
775
|
}
|
|
659
776
|
// Scale props are spec-shaped; keep the indexer off the public type.
|
|
660
|
-
/** @type {any} */ (
|
|
777
|
+
/** @type {any} */ (resolvedProps).domainIndexer = indexer;
|
|
661
778
|
} else if (domain && domain.length > 0) {
|
|
662
|
-
|
|
779
|
+
resolvedProps.domain = domain;
|
|
663
780
|
}
|
|
664
781
|
|
|
665
|
-
if (!
|
|
782
|
+
if (!resolvedProps.domain && resolvedProps.domainMid !== undefined) {
|
|
666
783
|
// Initialize with a bogus domain so that scale.js can inject the domainMid.
|
|
667
784
|
// The number of domain elements must be know before the glsl scale is generated.
|
|
668
|
-
|
|
785
|
+
resolvedProps.domain = [
|
|
786
|
+
resolvedProps.domainMin ?? 0,
|
|
787
|
+
resolvedProps.domainMax ?? 1,
|
|
788
|
+
];
|
|
669
789
|
}
|
|
670
790
|
|
|
671
|
-
return
|
|
791
|
+
return resolvedProps;
|
|
672
792
|
}
|
|
673
793
|
|
|
674
794
|
/**
|
|
@@ -693,7 +813,7 @@ export default class ScaleResolution {
|
|
|
693
813
|
*/
|
|
694
814
|
reconfigure() {
|
|
695
815
|
this.#withSelectionReverseSyncSuppressed(() => {
|
|
696
|
-
this.#
|
|
816
|
+
this.#invalidateConfiguredDomain();
|
|
697
817
|
const state = this.#computeScaleState(true);
|
|
698
818
|
if (!state) {
|
|
699
819
|
return;
|
|
@@ -713,6 +833,7 @@ export default class ScaleResolution {
|
|
|
713
833
|
*/
|
|
714
834
|
reconfigureDomain() {
|
|
715
835
|
this.#withSelectionReverseSyncSuppressed(() => {
|
|
836
|
+
this.#invalidateMergedScaleProps();
|
|
716
837
|
const state = this.#computeScaleState(true, true);
|
|
717
838
|
if (!state) {
|
|
718
839
|
return;
|
|
@@ -735,6 +856,7 @@ export default class ScaleResolution {
|
|
|
735
856
|
});
|
|
736
857
|
}
|
|
737
858
|
this.#finalizeReconfigure(state);
|
|
859
|
+
this.syncLinkedSelectionFromDomain();
|
|
738
860
|
});
|
|
739
861
|
}
|
|
740
862
|
|
|
@@ -762,7 +884,7 @@ export default class ScaleResolution {
|
|
|
762
884
|
scale,
|
|
763
885
|
props: this.#getScaleProps(extractDataDomain),
|
|
764
886
|
previousDomain: scale.domain(),
|
|
765
|
-
domainWasInitialized: this
|
|
887
|
+
domainWasInitialized: this.isDomainInitialized(),
|
|
766
888
|
hasSelectionConfiguredDomain:
|
|
767
889
|
this.#domainAggregator.hasSelectionConfiguredDomain(),
|
|
768
890
|
};
|
|
@@ -808,10 +930,15 @@ export default class ScaleResolution {
|
|
|
808
930
|
hasSelectionConfiguredDomain,
|
|
809
931
|
} = inputs;
|
|
810
932
|
|
|
933
|
+
const initialDomainSnapshot = hasSelectionConfiguredDomain
|
|
934
|
+
? this.#domainAggregator.getDefaultDomain(true)
|
|
935
|
+
: undefined;
|
|
936
|
+
|
|
811
937
|
if (
|
|
812
938
|
this.#domainAggregator.captureInitialDomain(
|
|
813
939
|
scale,
|
|
814
|
-
domainWasInitialized
|
|
940
|
+
domainWasInitialized,
|
|
941
|
+
initialDomainSnapshot
|
|
815
942
|
)
|
|
816
943
|
) {
|
|
817
944
|
// Domain changes were suppressed during reconfigure; notify explicitly.
|
|
@@ -915,10 +1042,39 @@ export default class ScaleResolution {
|
|
|
915
1042
|
*/
|
|
916
1043
|
getComplexDomain() {
|
|
917
1044
|
return /** @type {NumericDomain | ComplexDomain} */ (
|
|
918
|
-
toComplexInterval(
|
|
1045
|
+
toComplexInterval(
|
|
1046
|
+
this.#getGenomeSource(),
|
|
1047
|
+
toExternalIndexLikeInterval(this.type, this.getDomain())
|
|
1048
|
+
)
|
|
919
1049
|
);
|
|
920
1050
|
}
|
|
921
1051
|
|
|
1052
|
+
/**
|
|
1053
|
+
* Returns metadata about a selection-linked domain, if present.
|
|
1054
|
+
*/
|
|
1055
|
+
getLinkedSelectionDomainInfo() {
|
|
1056
|
+
const linkInfo = this.#getLinkedSelectionInfo();
|
|
1057
|
+
if (!linkInfo) {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
const root = this.#firstMemberView.getLayoutAncestors().at(-1);
|
|
1062
|
+
const persist = root
|
|
1063
|
+
? findIntervalSelectionBindingOwners(
|
|
1064
|
+
root,
|
|
1065
|
+
linkInfo.runtime,
|
|
1066
|
+
linkInfo.param,
|
|
1067
|
+
linkInfo.encoding
|
|
1068
|
+
).some((owner) => owner.param.persist !== false)
|
|
1069
|
+
: false;
|
|
1070
|
+
|
|
1071
|
+
return {
|
|
1072
|
+
param: linkInfo.param,
|
|
1073
|
+
encoding: linkInfo.encoding,
|
|
1074
|
+
persist,
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
|
|
922
1078
|
/**
|
|
923
1079
|
* Return true if the scale is zoomable and the current domain differs from the initial domain.
|
|
924
1080
|
*
|
|
@@ -932,8 +1088,14 @@ export default class ScaleResolution {
|
|
|
932
1088
|
* Returns true if zooming is supported and allowed in view spec.
|
|
933
1089
|
*/
|
|
934
1090
|
isZoomable() {
|
|
935
|
-
|
|
936
|
-
|
|
1091
|
+
const props = this.#getMergedScaleProps();
|
|
1092
|
+
if (props === null || props.type === "null") {
|
|
1093
|
+
return false;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
return (
|
|
1097
|
+
isContinuous(props.type) && !isDiscrete(props.type) && !!props.zoom
|
|
1098
|
+
);
|
|
937
1099
|
}
|
|
938
1100
|
|
|
939
1101
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleResolutionTestUtils.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleResolutionTestUtils.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,+BAJW,OAAO,iBAAiB,EAAE,QAAQ,aAClC;IAAE,KAAI,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,iBAAiB,EAAE,OAAO,CAAA;CAAE,GACxD,OAAO,CAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"scaleResolutionTestUtils.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleResolutionTestUtils.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,+BAJW,OAAO,iBAAiB,EAAE,QAAQ,aAClC;IAAE,KAAI,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,iBAAiB,EAAE,OAAO,CAAA;CAAE,GACxD,OAAO,CAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC,CAQtD;AAED;;;;GAIG;AACH,iDAJW,OAAO,iBAAiB,EAAE,OAAO,WACjC,OAAO,oBAAoB,EAAE,gBAAgB,GAC3C,OAAO,sBAAsB,EAAE,OAAO,CAQlD;AAED;;;;GAIG;AACH,qCAJW,OAAO,iBAAiB,EAAE,OAAO,WACjC,OAAO,oBAAoB,EAAE,gBAAgB,GAC3C,GAAG,EAAE,CAIjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createHeadlessEngine } from "../genomeSpy/headlessBootstrap.js";
|
|
2
2
|
import UnitView from "../view/unitView.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -7,7 +7,11 @@ import UnitView from "../view/unitView.js";
|
|
|
7
7
|
* @returns {Promise<import("../view/view.js").default>}
|
|
8
8
|
*/
|
|
9
9
|
export async function initView(spec, viewType = UnitView) {
|
|
10
|
-
|
|
10
|
+
const { view } = await createHeadlessEngine(spec);
|
|
11
|
+
if (!(view instanceof viewType)) {
|
|
12
|
+
throw new Error("ViewClass and the spec do not match!");
|
|
13
|
+
}
|
|
14
|
+
return view;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaleRules.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleRules.js"],"names":[],"mappings":"AAcA;;GAEG;AAEH;;;;GAIG;AACH,6CAJW,OAAO,YACP,OAAO,oBAAoB,EAAE,IAAI,GAC/B,OAAO,kBAAkB,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"scaleRules.d.ts","sourceRoot":"","sources":["../../../src/scales/scaleRules.js"],"names":[],"mappings":"AAcA;;GAEG;AAEH;;;;GAIG;AACH,6CAJW,OAAO,YACP,OAAO,oBAAoB,EAAE,IAAI,GAC/B,OAAO,kBAAkB,EAAE,SAAS,CA2EhD;AAED;;;GAGG;AACH,6CAHW,OAAO,kBAAkB,EAAE,KAAK,WAChC,OAAO,QAgBjB;sBArGY,OAAO,oBAAoB,EAAE,OAAO"}
|
|
@@ -22,6 +22,15 @@ import {
|
|
|
22
22
|
* @returns {import("../spec/scale.js").ScaleType}
|
|
23
23
|
*/
|
|
24
24
|
export function getDefaultScaleType(channel, dataType) {
|
|
25
|
+
// TODO: Follow up with Vega-Lite-like discrete positional scale inference.
|
|
26
|
+
// For nominal/ordinal x/y channels, the default should not always be "band".
|
|
27
|
+
// The choice should depend on resolved mark usage and related signals:
|
|
28
|
+
// - rect/bar/rule/tick-like coverage -> "band"
|
|
29
|
+
// - point/text/link-like centered positions -> "point"
|
|
30
|
+
// - explicit relative band sizing / axis tickBand / nested offsets -> "band"
|
|
31
|
+
// This requires passing richer context than just channel + dataType.
|
|
32
|
+
//
|
|
33
|
+
// Keep the current behavior in this branch to avoid changing existing specs.
|
|
25
34
|
// TODO: Band scale, Bin-Quantitative
|
|
26
35
|
|
|
27
36
|
if (dataType == INDEX || dataType == LOCUS) {
|
|
@@ -93,11 +102,16 @@ export function getDefaultScaleType(channel, dataType) {
|
|
|
93
102
|
*/
|
|
94
103
|
export function applyLockedProperties(props, channel) {
|
|
95
104
|
if (isPositionalChannel(channel) && props.type !== "ordinal") {
|
|
96
|
-
//
|
|
105
|
+
// Positional scales currently operate in unit coordinates.
|
|
106
|
+
// Keep this invariant until pixel ranges are adopted.
|
|
97
107
|
props.range = [0, 1];
|
|
98
108
|
}
|
|
99
109
|
|
|
100
|
-
if (
|
|
110
|
+
if (
|
|
111
|
+
channel == "opacity" &&
|
|
112
|
+
isContinuous(props.type) &&
|
|
113
|
+
props.clamp === undefined
|
|
114
|
+
) {
|
|
101
115
|
props.clamp = true;
|
|
102
116
|
}
|
|
103
117
|
}
|
|
@@ -10,6 +10,36 @@ export function requireParamRuntime(paramRuntime: {
|
|
|
10
10
|
* @param {string} paramName
|
|
11
11
|
*/
|
|
12
12
|
export function requireIntervalSelection(selection: any, paramName: string): import("../types/selectionTypes.js").IntervalSelection;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the runtime-backed interval selection binding used by a linked
|
|
15
|
+
* domain. Matching is based on the actual resolved runtime slot instead of
|
|
16
|
+
* parameter name alone, so scoped params with the same name remain distinct.
|
|
17
|
+
*
|
|
18
|
+
* @param {import("../view/view.js").default} view
|
|
19
|
+
* @param {string} paramName
|
|
20
|
+
* @param {"x" | "y"} encoding
|
|
21
|
+
*/
|
|
22
|
+
export function resolveIntervalSelectionBinding(view: import("../view/view.js").default, paramName: string, encoding: "x" | "y"): {
|
|
23
|
+
runtime: any;
|
|
24
|
+
selection: import("../types/selectionTypes.js").IntervalSelection;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @param {import("../view/view.js").default} root
|
|
28
|
+
* @param {any} runtime
|
|
29
|
+
* @param {string} paramName
|
|
30
|
+
* @param {"x" | "y"} encoding
|
|
31
|
+
*/
|
|
32
|
+
export function findIntervalSelectionBindingOwners(root: import("../view/view.js").default, runtime: any, paramName: string, encoding: "x" | "y"): {
|
|
33
|
+
view: import("../view/view.js").default;
|
|
34
|
+
param: import("../spec/parameter.js").SelectionParameter;
|
|
35
|
+
}[];
|
|
36
|
+
/**
|
|
37
|
+
* @param {import("../view/view.js").default} view
|
|
38
|
+
* @param {any} runtime
|
|
39
|
+
* @param {string} paramName
|
|
40
|
+
* @param {"x" | "y"} encoding
|
|
41
|
+
*/
|
|
42
|
+
export function hasIntervalSelectionBindingInScope(view: import("../view/view.js").default, runtime: any, paramName: string, encoding: "x" | "y"): boolean;
|
|
13
43
|
/**
|
|
14
44
|
* @param {number[]} interval
|
|
15
45
|
* @param {number[]} zoomExtent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectionDomainUtils.d.ts","sourceRoot":"","sources":["../../../src/scales/selectionDomainUtils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selectionDomainUtils.d.ts","sourceRoot":"","sources":["../../../src/scales/selectionDomainUtils.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,kDAHW;IAAE,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAA;CAAE,aAC9C,MAAM,OAUhB;AAED;;;GAGG;AACH,oDAHW,GAAG,aACH,MAAM,0DAgBhB;AAED;;;;;;;;GAQG;AACH,sDAJW,OAAO,iBAAiB,EAAE,OAAO,aACjC,MAAM,YACN,GAAG,GAAG,GAAG;;;EAiBnB;AAED;;;;;GAKG;AACH,yDALW,OAAO,iBAAiB,EAAE,OAAO,WACjC,GAAG,aACH,MAAM,YACN,GAAG,GAAG,GAAG;UAGG,OAAO,iBAAiB,EAAE,OAAO;WAAS,OAAO,sBAAsB,EAAE,kBAAkB;IAuBjH;AAED;;;;;GAKG;AACH,yDALW,OAAO,iBAAiB,EAAE,OAAO,WACjC,GAAG,aACH,MAAM,YACN,GAAG,GAAG,GAAG,WA8CnB;AAED;;;;;GAKG;AACH,wDALW,MAAM,EAAE,cACR,MAAM,EAAE,YACR;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3B,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAsCxC"}
|