@genome-spy/core 0.72.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/LICENSE +1 -1
- 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 +21078 -24556
- package/dist/bundle/index.js +379 -383
- package/dist/bundle/parquetRead-DG_-F5j5.js +1609 -0
- package/dist/schema.json +13349 -7082
- 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 +8 -0
- package/dist/src/data/formats/bed.d.ts.map +1 -0
- package/dist/src/data/formats/bed.js +58 -0
- package/dist/src/data/formats/bedpe.d.ts +8 -0
- package/dist/src/data/formats/bedpe.d.ts.map +1 -0
- package/dist/src/data/formats/bedpe.js +164 -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/dataUtils.d.ts +16 -0
- package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
- package/dist/src/data/sources/dataUtils.js +53 -3
- 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 +4 -0
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +138 -16
- 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/assemblyPreflight.d.ts +31 -0
- package/dist/src/genome/assemblyPreflight.d.ts.map +1 -0
- package/dist/src/genome/assemblyPreflight.js +99 -0
- package/dist/src/genome/genome.d.ts +10 -2
- package/dist/src/genome/genome.d.ts.map +1 -1
- package/dist/src/genome/genome.js +20 -2
- package/dist/src/genome/genomeStore.d.ts +34 -3
- package/dist/src/genome/genomeStore.d.ts.map +1 -1
- package/dist/src/genome/genomeStore.js +409 -18
- package/dist/src/genome/rootGenomeConfig.d.ts +26 -0
- package/dist/src/genome/rootGenomeConfig.d.ts.map +1 -0
- package/dist/src/genome/rootGenomeConfig.js +98 -0
- 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 +10 -1
- package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
- package/dist/src/genomeSpy/interactionController.js +448 -40
- 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/renderCoordinator.js +1 -1
- 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 -114
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +7 -614
- 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/canvasSizeHelper.d.ts +74 -0
- package/dist/src/gl/canvasSizeHelper.d.ts.map +1 -0
- package/dist/src/gl/canvasSizeHelper.js +203 -0
- 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/gl/webGLHelper.d.ts +25 -11
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +59 -33
- package/dist/src/index.d.ts +3 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -111
- 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 +5 -26
- 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 +67 -21
- 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 +58 -7
- package/dist/src/scales/domainPlanner.d.ts.map +1 -1
- package/dist/src/scales/domainPlanner.js +395 -40
- 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/scaleInstanceManager.d.ts +2 -1
- package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
- package/dist/src/scales/scaleInstanceManager.js +10 -11
- package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
- package/dist/src/scales/scaleInteractionController.js +59 -18
- 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 +39 -0
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +504 -82
- package/dist/src/scales/scaleResolutionTestUtils.d.ts +21 -0
- package/dist/src/scales/scaleResolutionTestUtils.d.ts.map +1 -0
- package/dist/src/scales/scaleResolutionTestUtils.js +37 -0
- 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 +52 -0
- package/dist/src/scales/selectionDomainUtils.d.ts.map +1 -0
- package/dist/src/scales/selectionDomainUtils.js +194 -0
- package/dist/src/scales/zoomDomainUtils.d.ts +18 -0
- package/dist/src/scales/zoomDomainUtils.d.ts.map +1 -0
- package/dist/src/scales/zoomDomainUtils.js +69 -0
- package/dist/src/screenshotHarness.d.ts +16 -0
- package/dist/src/screenshotHarness.d.ts.map +1 -0
- package/dist/src/screenshotHarness.js +241 -0
- package/dist/src/singlePageApp.js +1 -1
- 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 +30 -3
- 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/genome.d.ts +22 -2
- package/dist/src/spec/mark.d.ts +97 -13
- package/dist/src/spec/parameter.d.ts +62 -5
- package/dist/src/spec/root.d.ts +34 -1
- package/dist/src/spec/scale.d.ts +46 -5
- 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 +63 -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 +31 -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 +66 -11
- 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 +26 -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/inferSpecBaseUrl.d.ts +14 -0
- package/dist/src/utils/inferSpecBaseUrl.d.ts.map +1 -0
- package/dist/src/utils/inferSpecBaseUrl.js +73 -0
- 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 +62 -33
- package/dist/src/utils/interactionEvent.d.ts.map +1 -1
- package/dist/src/utils/interactionEvent.js +86 -48
- 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 +12 -1
- package/dist/src/view/dataReadiness.d.ts +2 -2
- package/dist/src/view/dataReadiness.d.ts.map +1 -1
- package/dist/src/view/dataReadiness.js +63 -58
- package/dist/src/view/facetView.d.ts +1 -1
- package/dist/src/view/facetView.js +4 -4
- package/dist/src/view/flowBuilder.js +2 -2
- package/dist/src/view/gridView/gridChild.d.ts +13 -0
- package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
- package/dist/src/view/gridView/gridChild.js +247 -49
- package/dist/src/view/gridView/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView/gridView.js +296 -99
- 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 +15 -3
- package/dist/src/view/zoom.d.ts.map +1 -1
- package/dist/src/view/zoom.js +375 -80
- package/package.json +20 -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
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import { isContinuous } from "vega-scale";
|
|
2
2
|
import {
|
|
3
|
+
asEventConfig,
|
|
3
4
|
asSelectionConfig,
|
|
4
5
|
createIntervalSelection,
|
|
5
6
|
isActiveIntervalSelection,
|
|
6
7
|
isIntervalSelectionConfig,
|
|
7
8
|
selectionContainsPoint,
|
|
8
9
|
} from "../../selection/selection.js";
|
|
10
|
+
import { createPrimitiveEventProxy } from "../../utils/interactionEvent.js";
|
|
9
11
|
import AxisGridView from "../axisGridView.js";
|
|
10
12
|
import AxisView, { CHANNEL_ORIENTS } from "../axisView.js";
|
|
11
13
|
import LayerView from "../layerView.js";
|
|
12
14
|
import Padding from "../layout/padding.js";
|
|
13
15
|
import Point from "../layout/point.js";
|
|
14
16
|
import Rectangle from "../layout/rectangle.js";
|
|
15
|
-
import createTitle from "../title.js";
|
|
17
|
+
import createTitle, { resolveTitleSpec } from "../title.js";
|
|
16
18
|
import UnitView from "../unitView.js";
|
|
17
19
|
import { markViewAsNonAddressable } from "../viewSelectors.js";
|
|
18
20
|
import Scrollbar from "./scrollbar.js";
|
|
19
|
-
import SelectionRect from "./selectionRect.js";
|
|
21
|
+
import SelectionRect, { INTERVAL_DRAG_ACTIVE_PARAM } from "./selectionRect.js";
|
|
22
|
+
import { normalizeIntervalForSelection } from "../../scales/selectionDomainUtils.js";
|
|
23
|
+
import { zoomDomainByScaleType } from "../../scales/zoomDomainUtils.js";
|
|
24
|
+
import { createEventFilterFunction } from "../../utils/expression.js";
|
|
25
|
+
import { getConfiguredViewBackground } from "../../config/viewConfig.js";
|
|
26
|
+
import { getConfiguredAxisDefaults } from "../../config/axisConfig.js";
|
|
20
27
|
|
|
21
28
|
export default class GridChild {
|
|
22
29
|
/**
|
|
@@ -58,12 +65,26 @@ export default class GridChild {
|
|
|
58
65
|
/** @type {UnitView} */
|
|
59
66
|
this.title = undefined;
|
|
60
67
|
|
|
68
|
+
/** @type {number} */
|
|
69
|
+
this.backgroundZindex = 0;
|
|
70
|
+
|
|
71
|
+
/** @type {number | undefined} */
|
|
72
|
+
this.backgroundStrokeZindex = undefined;
|
|
73
|
+
|
|
74
|
+
/** @type {number} */
|
|
75
|
+
this.titleZindex = 1;
|
|
76
|
+
|
|
61
77
|
/** @type {Rectangle} */
|
|
62
78
|
this.coords = Rectangle.ZERO;
|
|
63
79
|
|
|
64
80
|
if (view.needsAxes.x || view.needsAxes.y) {
|
|
65
81
|
const spec = view.spec;
|
|
66
|
-
const viewBackground =
|
|
82
|
+
const viewBackground = getConfiguredViewBackground(
|
|
83
|
+
view.getConfigScopes(),
|
|
84
|
+
"view" in spec ? spec.view : undefined
|
|
85
|
+
);
|
|
86
|
+
this.backgroundZindex = viewBackground?.zindex ?? 0;
|
|
87
|
+
this.backgroundStrokeZindex = viewBackground?.strokeZindex;
|
|
67
88
|
|
|
68
89
|
const backgroundSpec = createBackground(viewBackground);
|
|
69
90
|
if (backgroundSpec) {
|
|
@@ -99,7 +120,12 @@ export default class GridChild {
|
|
|
99
120
|
});
|
|
100
121
|
}
|
|
101
122
|
|
|
102
|
-
const
|
|
123
|
+
const titleSpec = resolveTitleSpec(
|
|
124
|
+
view.spec.title,
|
|
125
|
+
view.getConfigScopes()
|
|
126
|
+
);
|
|
127
|
+
this.titleZindex = titleSpec?.zindex ?? 1;
|
|
128
|
+
const title = createTitle(titleSpec);
|
|
103
129
|
if (title) {
|
|
104
130
|
const unitView = new UnitView(
|
|
105
131
|
title,
|
|
@@ -131,11 +157,6 @@ export default class GridChild {
|
|
|
131
157
|
#setupIntervalSelection() {
|
|
132
158
|
const view = this.view;
|
|
133
159
|
|
|
134
|
-
// TODO: Move to context
|
|
135
|
-
const setCursor = (/** @type {string} */ cursor) => {
|
|
136
|
-
this.view.context.glHelper.canvas.style.cursor = cursor;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
160
|
// TODO: If the child is a LayerView, selection params should be pulled from its children as well
|
|
140
161
|
for (const [name, param] of view.paramRuntime.paramConfigs) {
|
|
141
162
|
if (!("select" in param)) {
|
|
@@ -153,17 +174,53 @@ export default class GridChild {
|
|
|
153
174
|
const scaleResolutions = Object.fromEntries(
|
|
154
175
|
channels.map((channel) => {
|
|
155
176
|
const resolution = this.view.getScaleResolution(channel);
|
|
156
|
-
const
|
|
177
|
+
const scaleType = resolution?.getResolvedScaleType();
|
|
157
178
|
|
|
158
|
-
if (!
|
|
179
|
+
if (!resolution || !scaleType || !isContinuous(scaleType)) {
|
|
159
180
|
throw new Error(
|
|
160
|
-
`No continuous scale found for interval selection param "${name}" on channel "${channel}"! Scale type is "${
|
|
181
|
+
`No continuous scale found for interval selection param "${name}" on channel "${channel}"! Scale type is "${scaleType ?? "none"}".`
|
|
161
182
|
);
|
|
162
183
|
}
|
|
163
184
|
return [channel, resolution];
|
|
164
185
|
})
|
|
165
186
|
);
|
|
166
187
|
|
|
188
|
+
const requiresShiftToBrush = channels.some((channel) =>
|
|
189
|
+
scaleResolutions[channel].isZoomable()
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
const eventConfig =
|
|
193
|
+
/** @type {import("../../spec/parameter.js").EventConfig} */ (
|
|
194
|
+
select.on ??
|
|
195
|
+
(requiresShiftToBrush
|
|
196
|
+
? {
|
|
197
|
+
type: "mousedown",
|
|
198
|
+
filter: "event.shiftKey",
|
|
199
|
+
}
|
|
200
|
+
: {
|
|
201
|
+
type: "mousedown",
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
if (eventConfig.type !== "mousedown") {
|
|
206
|
+
throw new Error(
|
|
207
|
+
`Interval selection param "${name}" currently supports only "mousedown" in "on".`
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const eventPredicate = eventConfig.filter
|
|
212
|
+
? createEventFilterFunction(eventConfig.filter)
|
|
213
|
+
: () => true;
|
|
214
|
+
|
|
215
|
+
const zoomEventConfig = resolveIntervalZoomEventConfig(
|
|
216
|
+
select.zoom,
|
|
217
|
+
requiresShiftToBrush,
|
|
218
|
+
name
|
|
219
|
+
);
|
|
220
|
+
const zoomEventPredicate = zoomEventConfig?.filter
|
|
221
|
+
? createEventFilterFunction(zoomEventConfig.filter)
|
|
222
|
+
: () => true;
|
|
223
|
+
|
|
167
224
|
if (this.selectionRect) {
|
|
168
225
|
throw new Error(
|
|
169
226
|
"Only one interval selection per container is currently allowed!"
|
|
@@ -213,7 +270,6 @@ export default class GridChild {
|
|
|
213
270
|
|
|
214
271
|
const clearSelection = () => {
|
|
215
272
|
setter(createIntervalSelection(channels));
|
|
216
|
-
setCursor(null);
|
|
217
273
|
};
|
|
218
274
|
|
|
219
275
|
this.selectionRect = new SelectionRect(
|
|
@@ -221,6 +277,12 @@ export default class GridChild {
|
|
|
221
277
|
selectionExpr,
|
|
222
278
|
select.mark
|
|
223
279
|
);
|
|
280
|
+
const setIntervalDragActive = (/** @type {boolean} */ active) => {
|
|
281
|
+
this.selectionRect.paramRuntime.setValue(
|
|
282
|
+
INTERVAL_DRAG_ACTIVE_PARAM,
|
|
283
|
+
active
|
|
284
|
+
);
|
|
285
|
+
};
|
|
224
286
|
|
|
225
287
|
// WARNING! The following is an async method! Seems to work (by chance).
|
|
226
288
|
// TODO: Should be called and awaited in a sensible place. Maybe provide some
|
|
@@ -277,7 +339,7 @@ export default class GridChild {
|
|
|
277
339
|
return Rectangle.create(a.x, a.y, b.x - a.x, b.y - a.y);
|
|
278
340
|
};
|
|
279
341
|
|
|
280
|
-
view.
|
|
342
|
+
view.addInteractionListener("mousedown", (event) => {
|
|
281
343
|
if (event.mouseEvent.button != 0) {
|
|
282
344
|
return;
|
|
283
345
|
}
|
|
@@ -291,7 +353,7 @@ export default class GridChild {
|
|
|
291
353
|
|
|
292
354
|
if (translatedRectangle) {
|
|
293
355
|
// Started dragging an existing selection
|
|
294
|
-
|
|
356
|
+
setIntervalDragActive(true);
|
|
295
357
|
// Start of dragging should prevent click propagation so that
|
|
296
358
|
// no other selections or events are triggered.
|
|
297
359
|
preventNextClickPropagation = true;
|
|
@@ -304,7 +366,9 @@ export default class GridChild {
|
|
|
304
366
|
preventNextClickPropagation = true;
|
|
305
367
|
}
|
|
306
368
|
|
|
307
|
-
const startSelection =
|
|
369
|
+
const startSelection = eventPredicate(
|
|
370
|
+
event.proxiedMouseEvent
|
|
371
|
+
);
|
|
308
372
|
|
|
309
373
|
if (startSelection) {
|
|
310
374
|
clearSelection();
|
|
@@ -312,12 +376,9 @@ export default class GridChild {
|
|
|
312
376
|
} else if (isActiveIntervalSelection(selectionExpr())) {
|
|
313
377
|
// If mouse button is released and there was a selection,
|
|
314
378
|
// it should be cleared unless the viewport was panned by dragging.
|
|
315
|
-
/** @type {import("../view.js").
|
|
316
|
-
const listener = (
|
|
317
|
-
view.
|
|
318
|
-
"mouseup",
|
|
319
|
-
listener
|
|
320
|
-
);
|
|
379
|
+
/** @type {import("../view.js").InteractionListener} */
|
|
380
|
+
const listener = (event) => {
|
|
381
|
+
view.removeInteractionListener("mouseup", listener);
|
|
321
382
|
const mouseUpPoint = event.point;
|
|
322
383
|
|
|
323
384
|
// Retain selection if the viewport is panned by dragging
|
|
@@ -329,7 +390,7 @@ export default class GridChild {
|
|
|
329
390
|
clearSelection();
|
|
330
391
|
}
|
|
331
392
|
};
|
|
332
|
-
view.
|
|
393
|
+
view.addInteractionListener("mouseup", listener);
|
|
333
394
|
return;
|
|
334
395
|
} else {
|
|
335
396
|
return;
|
|
@@ -338,6 +399,7 @@ export default class GridChild {
|
|
|
338
399
|
|
|
339
400
|
// Prevent panning interaction
|
|
340
401
|
event.stopPropagation();
|
|
402
|
+
view.context.suspendHoverTracking();
|
|
341
403
|
|
|
342
404
|
const start = event.point;
|
|
343
405
|
const viewOffset = Point.fromMouseEvent(
|
|
@@ -373,15 +435,9 @@ export default class GridChild {
|
|
|
373
435
|
|
|
374
436
|
for (const channel of channels) {
|
|
375
437
|
const scaleResolution = scaleResolutions[channel];
|
|
376
|
-
const { zoomExtent
|
|
438
|
+
const { zoomExtent } = scaleResolution;
|
|
377
439
|
const interval = intervals[channel];
|
|
378
440
|
|
|
379
|
-
if (["index", "locus"].includes(scale.type)) {
|
|
380
|
-
// These scales use integer values. Need to round them.
|
|
381
|
-
interval[0] = Math.ceil(interval[0]);
|
|
382
|
-
interval[1] = Math.ceil(interval[1]);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
441
|
if (translatedRectangle) {
|
|
386
442
|
// When dragging, clamp the interval so that the size stays the same and the interval doesn't exceed zoomExtent
|
|
387
443
|
const size = interval[1] - interval[0];
|
|
@@ -398,37 +454,47 @@ export default class GridChild {
|
|
|
398
454
|
interval[1] = max;
|
|
399
455
|
interval[0] = max - size;
|
|
400
456
|
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
const normalized = normalizeIntervalForChannel(
|
|
460
|
+
scaleResolution,
|
|
461
|
+
interval
|
|
462
|
+
);
|
|
463
|
+
|
|
464
|
+
if (!normalized) {
|
|
465
|
+
interval[0] = zoomExtent[0];
|
|
466
|
+
interval[1] = zoomExtent[0];
|
|
401
467
|
} else {
|
|
402
|
-
interval[0] =
|
|
403
|
-
interval[1] =
|
|
468
|
+
interval[0] = normalized[0];
|
|
469
|
+
interval[1] = normalized[1];
|
|
404
470
|
}
|
|
405
|
-
interval[1] = Math.min(zoomExtent[1], interval[1]);
|
|
406
471
|
}
|
|
407
472
|
|
|
408
473
|
setter({ type: "interval", intervals });
|
|
409
474
|
};
|
|
410
475
|
|
|
411
|
-
const mouseUpListener = () => {
|
|
476
|
+
const mouseUpListener = (/** @type {MouseEvent} */ upEvent) => {
|
|
412
477
|
document.removeEventListener(
|
|
413
478
|
"mousemove",
|
|
414
479
|
mouseMoveListener
|
|
415
480
|
);
|
|
416
481
|
document.removeEventListener("mouseup", mouseUpListener);
|
|
417
482
|
|
|
483
|
+
setIntervalDragActive(false);
|
|
418
484
|
nowBrushing = false;
|
|
419
485
|
if (translatedRectangle) {
|
|
420
|
-
setCursor("move");
|
|
421
486
|
translatedRectangle = null;
|
|
422
487
|
}
|
|
488
|
+
view.context.resumeHoverTracking(upEvent);
|
|
423
489
|
};
|
|
424
490
|
document.addEventListener("mousemove", mouseMoveListener);
|
|
425
491
|
|
|
426
492
|
document.addEventListener("mouseup", mouseUpListener);
|
|
427
493
|
});
|
|
428
494
|
|
|
429
|
-
view.
|
|
495
|
+
view.addInteractionListener(
|
|
430
496
|
"click",
|
|
431
|
-
(
|
|
497
|
+
(event) => {
|
|
432
498
|
if (event.mouseEvent.button == 0) {
|
|
433
499
|
if (preventNextClickPropagation) {
|
|
434
500
|
event.stopPropagation();
|
|
@@ -443,9 +509,9 @@ export default class GridChild {
|
|
|
443
509
|
selectionContainsPoint(selectionExpr(), invertPoint(point));
|
|
444
510
|
|
|
445
511
|
// TODO: Make behavior configurable
|
|
446
|
-
view.
|
|
512
|
+
view.addInteractionListener(
|
|
447
513
|
"dblclick",
|
|
448
|
-
(
|
|
514
|
+
(event) => {
|
|
449
515
|
if (isPointInsideSelection(event.point)) {
|
|
450
516
|
clearSelection();
|
|
451
517
|
event.stopPropagation();
|
|
@@ -454,22 +520,92 @@ export default class GridChild {
|
|
|
454
520
|
true
|
|
455
521
|
);
|
|
456
522
|
|
|
523
|
+
view.addInteractionListener("wheel", (event) => {
|
|
524
|
+
const wheelEvent = event.wheelEvent;
|
|
525
|
+
|
|
526
|
+
if (
|
|
527
|
+
!zoomEventConfig ||
|
|
528
|
+
!zoomEventPredicate(createPrimitiveEventProxy(wheelEvent))
|
|
529
|
+
) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (
|
|
534
|
+
Math.abs(wheelEvent.deltaX) >= Math.abs(wheelEvent.deltaY)
|
|
535
|
+
) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
if (!isPointInsideSelection(event.point)) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const selection = selectionExpr();
|
|
543
|
+
if (!isActiveIntervalSelection(selection)) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
const wheelMultiplier = wheelEvent.deltaMode ? 120 : 1;
|
|
548
|
+
const scaleFactor =
|
|
549
|
+
2 ** ((wheelEvent.deltaY * wheelMultiplier) / 300);
|
|
550
|
+
|
|
551
|
+
const anchor = invertPoint(event.point);
|
|
552
|
+
/** @type {typeof selection.intervals} */
|
|
553
|
+
const intervals = { ...selection.intervals };
|
|
554
|
+
let changed = false;
|
|
555
|
+
|
|
556
|
+
for (const channel of channels) {
|
|
557
|
+
const currentInterval = intervals[channel];
|
|
558
|
+
if (!currentInterval || currentInterval.length !== 2) {
|
|
559
|
+
continue;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const scaleResolution = scaleResolutions[channel];
|
|
563
|
+
const scale = scaleResolution.getScale();
|
|
564
|
+
const zoomed = zoomDomainByScaleType(
|
|
565
|
+
scale,
|
|
566
|
+
/** @type {[number, number]} */ ([...currentInterval]),
|
|
567
|
+
anchor[channel],
|
|
568
|
+
scaleFactor,
|
|
569
|
+
{ onUnsupported: "identity" }
|
|
570
|
+
);
|
|
571
|
+
|
|
572
|
+
const normalized = normalizeIntervalForChannel(
|
|
573
|
+
scaleResolution,
|
|
574
|
+
zoomed
|
|
575
|
+
);
|
|
576
|
+
if (!normalized) {
|
|
577
|
+
continue;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
if (
|
|
581
|
+
normalized[0] !== currentInterval[0] ||
|
|
582
|
+
normalized[1] !== currentInterval[1]
|
|
583
|
+
) {
|
|
584
|
+
intervals[channel] = normalized;
|
|
585
|
+
changed = true;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
if (changed) {
|
|
590
|
+
setter({
|
|
591
|
+
...selection,
|
|
592
|
+
type: "interval",
|
|
593
|
+
intervals,
|
|
594
|
+
});
|
|
595
|
+
wheelEvent.preventDefault();
|
|
596
|
+
event.stopPropagation();
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
|
|
457
600
|
// Handle mouse cursor changes
|
|
458
|
-
view.
|
|
601
|
+
view.addInteractionListener("mousemove", (event) => {
|
|
459
602
|
if (isPointInsideSelection(event.point)) {
|
|
460
603
|
// Brushing and translating the existing brush are different actions.
|
|
461
604
|
if (!nowBrushing) {
|
|
462
605
|
mouseOver = true;
|
|
463
|
-
// When translation is active, the cursor shows a grabbing hand.
|
|
464
|
-
if (!translatedRectangle) {
|
|
465
|
-
setCursor("move");
|
|
466
|
-
}
|
|
467
606
|
}
|
|
468
607
|
} else {
|
|
469
608
|
mouseOver = false;
|
|
470
|
-
if (!translatedRectangle) {
|
|
471
|
-
setCursor(null);
|
|
472
|
-
}
|
|
473
609
|
}
|
|
474
610
|
});
|
|
475
611
|
}
|
|
@@ -577,10 +713,29 @@ export default class GridChild {
|
|
|
577
713
|
*/
|
|
578
714
|
const createAxisGrid = async (r, channel, axisParent) => {
|
|
579
715
|
const props = getAxisPropsWithDefaults(r, channel);
|
|
716
|
+
if (!props) {
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
const defaults = getConfiguredAxisDefaults(
|
|
721
|
+
axisParent.getConfigScopes(),
|
|
722
|
+
{
|
|
723
|
+
channel,
|
|
724
|
+
orient: props.orient,
|
|
725
|
+
type: /** @type {import("../../spec/channel.js").Type} */ (
|
|
726
|
+
r.scaleResolution.type
|
|
727
|
+
),
|
|
728
|
+
style: props.style,
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
const effectiveProps = {
|
|
732
|
+
...defaults,
|
|
733
|
+
...props,
|
|
734
|
+
};
|
|
580
735
|
|
|
581
|
-
if (
|
|
736
|
+
if (effectiveProps.grid || effectiveProps.chromGrid) {
|
|
582
737
|
const axisGridView = new AxisGridView(
|
|
583
|
-
|
|
738
|
+
effectiveProps,
|
|
584
739
|
r.scaleResolution.type,
|
|
585
740
|
this.layoutParent.context,
|
|
586
741
|
this.layoutParent,
|
|
@@ -711,6 +866,49 @@ export default class GridChild {
|
|
|
711
866
|
}
|
|
712
867
|
}
|
|
713
868
|
|
|
869
|
+
/**
|
|
870
|
+
* @param {import("../../spec/parameter.js").IntervalSelectionConfig["zoom"]} zoom
|
|
871
|
+
* @param {boolean} hasZoomableChannel
|
|
872
|
+
* @param {string} paramName
|
|
873
|
+
* @returns {import("../../spec/parameter.js").EventConfig | undefined}
|
|
874
|
+
*/
|
|
875
|
+
export function resolveIntervalZoomEventConfig(
|
|
876
|
+
zoom,
|
|
877
|
+
hasZoomableChannel,
|
|
878
|
+
paramName
|
|
879
|
+
) {
|
|
880
|
+
const defaultEnabled = !hasZoomableChannel;
|
|
881
|
+
const resolved = zoom === undefined ? defaultEnabled : zoom;
|
|
882
|
+
if (resolved === false) {
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
if (resolved === true) {
|
|
887
|
+
return { type: "wheel" };
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
const eventConfig = asEventConfig(resolved);
|
|
891
|
+
if (eventConfig.type !== "wheel") {
|
|
892
|
+
throw new Error(
|
|
893
|
+
`Interval selection param "${paramName}" currently supports only "wheel" in "zoom".`
|
|
894
|
+
);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
return eventConfig;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* @param {import("../../scales/scaleResolution.js").default} scaleResolution
|
|
902
|
+
* @param {[number, number]} interval
|
|
903
|
+
* @returns {[number, number] | undefined}
|
|
904
|
+
*/
|
|
905
|
+
function normalizeIntervalForChannel(scaleResolution, interval) {
|
|
906
|
+
const scale = scaleResolution.getScale();
|
|
907
|
+
return normalizeIntervalForSelection(interval, scaleResolution.zoomExtent, {
|
|
908
|
+
roundToIntegers: scale.type === "index" || scale.type === "locus",
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
|
|
714
912
|
/**
|
|
715
913
|
* @param {import("../../spec/view.js").ViewBackground} viewBackground
|
|
716
914
|
* @returns {import("../../spec/view.js").UnitSpec}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridView.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridView.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gridView.d.ts","sourceRoot":"","sources":["../../../../src/view/gridView/gridView.js"],"names":[],"mappings":"AAmmCA;;GAEG;AACH,sHAUC;AA4DD;;;;;GAKG;AACH,4CAJW,OAAO,wBAAwB,EAAE,OAAO,UACxC,OAAO,oBAAoB,EAAE,UAAU,YACvC,QAAQ,aAmBlB;AAtpCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,8BAH2D,KAAK,SAAnD,OAAQ,oBAAoB,EAAE,aAAc;IA6CrD;;;;;;;;;OASG;IACH,kBARW,KAAK,WACL,OAAO,4BAA4B,EAAE,OAAO,gBAC5C,aAAa,yFAEb,MAAM,WACN,MAAM,YACN,OAAO,YAAY,EAAE,WAAW,EAyC1C;IAtBG,uBAA0B;IAwB9B;;OAEG;IACH,6FAEC;IAED;;;;;;OAMG;IACH,4FAFa,SAAS,CAIrB;IAED;;;;;;;OAOG;IACH,oGAHW,MAAM,GACJ,SAAS,CASrB;IAED;;;;;OAKG;IACH,iGAQC;IAED;;;;;OAKG;IACH,qBAFW,MAAM,QAUhB;IAeD;;OAEG;IACH,mBAFW,qEAAM,QAWhB;IAYD;;OAEG;IACH,sFAEC;IAED,yBAEC;IAED;;OAEG;IACH,sCAKC;IAED;;;;OAIG;IACH,gCAqCC;;CA6xBJ;qBAtlC0D,gBAAgB;sBADrD,wBAAwB;0BAEpB,qBAAqB;sBAQzB,gBAAgB"}
|