@genome-spy/core 0.73.0 → 0.75.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 +21266 -25938
- package/dist/bundle/index.js +367 -383
- package/dist/bundle/parquetRead-DG_-F5j5.js +1609 -0
- package/dist/schema.json +13421 -7210
- 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/dataUtils.d.ts +25 -0
- package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
- package/dist/src/data/sources/dataUtils.js +23 -0
- package/dist/src/data/sources/inlineSource.js +2 -2
- 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 +13 -5
- 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 +31 -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 +292 -59
- 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 +12 -14
- package/dist/src/gl/dataToVertices.d.ts.map +1 -1
- package/dist/src/gl/dataToVertices.js +121 -95
- package/dist/src/gl/glslScaleGenerator.d.ts +5 -2
- package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/gl/glslScaleGenerator.js +15 -15
- package/dist/src/gl/vertexRangeIndex.d.ts +23 -0
- package/dist/src/gl/vertexRangeIndex.d.ts.map +1 -0
- package/dist/src/gl/vertexRangeIndex.js +150 -0
- 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/expressionCompiler.d.ts +2 -1
- package/dist/src/paramRuntime/expressionCompiler.d.ts.map +1 -1
- package/dist/src/paramRuntime/expressionCompiler.js +3 -2
- package/dist/src/paramRuntime/expressionRef.d.ts +4 -1
- package/dist/src/paramRuntime/expressionRef.d.ts.map +1 -1
- package/dist/src/paramRuntime/expressionRef.js +10 -3
- package/dist/src/paramRuntime/graphRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/graphRuntime.js +15 -6
- package/dist/src/paramRuntime/paramRuntime.d.ts +8 -2
- package/dist/src/paramRuntime/paramRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/paramRuntime.js +10 -5
- package/dist/src/paramRuntime/types.d.ts +1 -0
- package/dist/src/paramRuntime/types.d.ts.map +1 -1
- package/dist/src/paramRuntime/types.js +1 -0
- package/dist/src/paramRuntime/viewParamRuntime.d.ts +24 -4
- package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
- package/dist/src/paramRuntime/viewParamRuntime.js +52 -6
- package/dist/src/scale/scale.d.ts.map +1 -1
- package/dist/src/scale/scale.js +14 -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 +82 -16
- package/dist/src/scales/domainPlanner.d.ts.map +1 -1
- package/dist/src/scales/domainPlanner.js +364 -131
- 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.map +1 -1
- package/dist/src/scales/scaleInstanceManager.js +7 -2
- 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 +5 -3
- package/dist/src/scales/scalePropsResolver.d.ts.map +1 -1
- package/dist/src/scales/scalePropsResolver.js +108 -8
- package/dist/src/scales/scaleResolution.d.ts +35 -1
- package/dist/src/scales/scaleResolution.d.ts.map +1 -1
- package/dist/src/scales/scaleResolution.js +381 -66
- 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/screenshotExport.d.ts +23 -0
- package/dist/src/screenshotExport.d.ts.map +1 -0
- package/dist/src/screenshotExport.js +44 -0
- package/dist/src/screenshotHarness.d.ts.map +1 -1
- package/dist/src/screenshotHarness.js +26 -25
- package/dist/src/spec/axis.d.ts +43 -32
- package/dist/src/spec/channel.d.ts +19 -13
- package/dist/src/spec/config.d.ts +264 -0
- package/dist/src/spec/data.d.ts +19 -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 +31 -14
- 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 +18 -10
- package/dist/src/utils/expression.d.ts.map +1 -1
- package/dist/src/utils/expression.js +354 -19
- 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.d.ts +1 -1
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +13 -9
- 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/resolutionPlanner.d.ts +9 -0
- package/dist/src/view/resolutionPlanner.d.ts.map +1 -0
- package/dist/src/view/resolutionPlanner.js +302 -0
- 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 +72 -169
- 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 +138 -48
- 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
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
isObject,
|
|
7
7
|
isRegExp,
|
|
8
8
|
isString,
|
|
9
|
+
ascending,
|
|
9
10
|
lerp,
|
|
11
|
+
span,
|
|
10
12
|
} from "vega-util";
|
|
11
13
|
import { format as d3format } from "d3-format";
|
|
12
14
|
import smoothstep from "./smoothstep.js";
|
|
@@ -15,12 +17,63 @@ import linearstep from "./linearstep.js";
|
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Some bits are adapted from https://github.com/vega/vega/blob/main/packages/vega-functions/src/codegen.js
|
|
20
|
+
*
|
|
21
|
+
* @param {unknown} value
|
|
22
|
+
* @returns {any}
|
|
23
|
+
*/
|
|
24
|
+
function array(value) {
|
|
25
|
+
return isArray(value) || ArrayBuffer.isView(value) ? value : null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {unknown} value
|
|
30
|
+
* @returns {any}
|
|
18
31
|
*/
|
|
32
|
+
function sequence(value) {
|
|
33
|
+
return array(value) || (isString(value) ? value : null);
|
|
34
|
+
}
|
|
35
|
+
|
|
19
36
|
const functionContext = {
|
|
20
37
|
clamp,
|
|
21
38
|
format(/** @type {number} */ value, /** @type {string} */ format) {
|
|
22
39
|
return d3format(format)(value);
|
|
23
40
|
},
|
|
41
|
+
/**
|
|
42
|
+
* Vega's expression docs list these as basic sequence helpers, but the
|
|
43
|
+
* bundled `vega-expression` version does not currently include them in the
|
|
44
|
+
* codegen whitelist. Implement them here so specs can rely on them.
|
|
45
|
+
*/
|
|
46
|
+
join(/** @type {any} */ seq, /** @type {string} */ separator) {
|
|
47
|
+
return array(seq).join(separator);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
indexof(
|
|
51
|
+
/** @type {any} */ seq,
|
|
52
|
+
/** @type {any} */ value,
|
|
53
|
+
/** @type {number | undefined} */ start
|
|
54
|
+
) {
|
|
55
|
+
return sequence(seq).indexOf(value, start);
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
lastindexof(
|
|
59
|
+
/** @type {any} */ seq,
|
|
60
|
+
/** @type {any} */ value,
|
|
61
|
+
/** @type {number | undefined} */ start
|
|
62
|
+
) {
|
|
63
|
+
return sequence(seq).lastIndexOf(value, start);
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
reverse(/** @type {any} */ seq) {
|
|
67
|
+
return array(seq).slice().reverse();
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
slice(
|
|
71
|
+
/** @type {any} */ seq,
|
|
72
|
+
/** @type {number} */ start,
|
|
73
|
+
/** @type {number | undefined} */ end
|
|
74
|
+
) {
|
|
75
|
+
return sequence(seq).slice(start, end);
|
|
76
|
+
},
|
|
24
77
|
mapHasKey(/** @type {Map<any, any>} */ map, /** @type {any} */ key) {
|
|
25
78
|
return map.has(key);
|
|
26
79
|
},
|
|
@@ -34,7 +87,6 @@ const functionContext = {
|
|
|
34
87
|
isRegExp,
|
|
35
88
|
isString,
|
|
36
89
|
isValid(/** @type {any} */ _) {
|
|
37
|
-
// eslint-disable-next-line no-self-compare
|
|
38
90
|
return _ != null && _ === _;
|
|
39
91
|
},
|
|
40
92
|
lerp,
|
|
@@ -46,46 +98,320 @@ const functionContext = {
|
|
|
46
98
|
) {
|
|
47
99
|
return String(str).replace(pattern, replace);
|
|
48
100
|
},
|
|
101
|
+
sort(/** @type {Array<any>} */ seq) {
|
|
102
|
+
return array(seq).slice().sort(ascending);
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Returns the midpoint of an ordered extent, such as [min, max].
|
|
106
|
+
* The helper uses the first and last elements and does not sort.
|
|
107
|
+
*/
|
|
108
|
+
center(/** @type {Array<any>} */ seq) {
|
|
109
|
+
const values = array(seq);
|
|
110
|
+
return (values[0] + values[values.length - 1]) / 2;
|
|
111
|
+
},
|
|
112
|
+
span(/** @type {Array<any>} */ seq) {
|
|
113
|
+
return span(seq);
|
|
114
|
+
},
|
|
49
115
|
smoothstep,
|
|
50
116
|
};
|
|
51
117
|
|
|
52
118
|
/**
|
|
53
119
|
* @param {typeof codegenExpression} codegen
|
|
120
|
+
* @param {ScaleHelperCompileContext} context
|
|
54
121
|
*/
|
|
55
|
-
function buildFunctions(codegen) {
|
|
56
|
-
const fn = functions(codegen);
|
|
57
|
-
// eslint-disable-next-line guard-for-in
|
|
122
|
+
function buildFunctions(codegen, context) {
|
|
123
|
+
const fn = /** @type {any} */ (functions(codegen));
|
|
58
124
|
for (const name in functionContext) {
|
|
59
125
|
fn[name] = `this.${name}`;
|
|
60
126
|
}
|
|
127
|
+
|
|
128
|
+
// Replace the public helper names with custom codegen hooks so we can bind
|
|
129
|
+
// a scale resolution once during compilation instead of looking it up for
|
|
130
|
+
// every datum.
|
|
131
|
+
for (const kind of /** @type {const} */ ([
|
|
132
|
+
"scale",
|
|
133
|
+
"invert",
|
|
134
|
+
"domain",
|
|
135
|
+
"range",
|
|
136
|
+
])) {
|
|
137
|
+
fn[kind] = (
|
|
138
|
+
/** @type {any[]} */
|
|
139
|
+
args
|
|
140
|
+
) => buildScaleHelperCall(codegen, context, kind, args);
|
|
141
|
+
}
|
|
142
|
+
|
|
61
143
|
return fn;
|
|
62
144
|
}
|
|
63
145
|
|
|
64
|
-
const cg = codegenExpression({
|
|
65
|
-
forbidden: [],
|
|
66
|
-
allowed: ["datum", "undefined"],
|
|
67
|
-
globalvar: "globalObject",
|
|
68
|
-
fieldvar: "datum",
|
|
69
|
-
functions: buildFunctions,
|
|
70
|
-
});
|
|
71
|
-
|
|
72
146
|
/**
|
|
73
147
|
* @typedef { object } ExpressionProps
|
|
74
148
|
* @prop { string[] } fields
|
|
75
149
|
* @prop { string[] } globals
|
|
76
150
|
* @prop { string } code
|
|
151
|
+
* @prop { import("../paramRuntime/types.js").ParamRef<any>[] } [scaleDependencies]
|
|
77
152
|
*
|
|
78
153
|
* @typedef { ((datum?: import("../data/flowNode.js").Datum) => any) & ExpressionProps } ExpressionFunction
|
|
79
154
|
*
|
|
155
|
+
* @typedef {object} ExpressionCompileContext
|
|
156
|
+
* @prop {(channel: string) => import("../scales/scaleResolution.js").default | undefined} [resolveScaleResolution]
|
|
157
|
+
*
|
|
158
|
+
* @typedef {ExpressionCompileContext & {
|
|
159
|
+
* globalvar: string,
|
|
160
|
+
* globalObject: Record<string, any>,
|
|
161
|
+
* getScaleHelper: (kind: "scale" | "invert" | "domain" | "range", channel: string, resolution: import("../scales/scaleResolution.js").default) => { codeName: string, dependency: import("../paramRuntime/types.js").ParamRef<any> }
|
|
162
|
+
* }} ScaleHelperCompileContext
|
|
163
|
+
*/
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @param {typeof codegenExpression} codegen
|
|
167
|
+
* @param {ScaleHelperCompileContext} context
|
|
168
|
+
* @param {"scale" | "invert" | "domain" | "range"} kind
|
|
169
|
+
* @param {any[]} args
|
|
170
|
+
* @returns {string}
|
|
171
|
+
*/
|
|
172
|
+
function buildScaleHelperCall(codegen, context, kind, args) {
|
|
173
|
+
if (args.length === 0) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
`Scale helper "${kind}" requires a literal channel name.`
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if ((kind === "scale" || kind === "invert") && args.length < 2) {
|
|
180
|
+
throw new Error(
|
|
181
|
+
`Scale helper "${kind}" requires a channel name and a value.`
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const channel = getLiteralString(args[0]);
|
|
186
|
+
if (!channel) {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`Scale helper "${kind}" requires a literal channel name.`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const resolution = context.resolveScaleResolution?.(channel);
|
|
193
|
+
if (!resolution) {
|
|
194
|
+
throw new Error(
|
|
195
|
+
`Unknown scale channel "${channel}" in expression helper "${kind}".`
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const helper = context.getScaleHelper(kind, channel, resolution);
|
|
200
|
+
const remainingArgs = args
|
|
201
|
+
.slice(1)
|
|
202
|
+
.map((arg) => codegen(arg))
|
|
203
|
+
.join(",");
|
|
204
|
+
return `${context.globalvar}["${helper.codeName}"](${remainingArgs})`;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @param {any} node
|
|
209
|
+
* @returns {string | undefined}
|
|
210
|
+
*/
|
|
211
|
+
function getLiteralString(node) {
|
|
212
|
+
return node?.type === "Literal" && typeof node.value === "string"
|
|
213
|
+
? node.value
|
|
214
|
+
: undefined;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @param {"scale" | "invert" | "domain" | "range"} kind
|
|
219
|
+
* @param {import("../scales/scaleResolution.js").default} resolution
|
|
220
|
+
* @returns {(...args: any[]) => any}
|
|
221
|
+
*/
|
|
222
|
+
function createScaleHelperFunction(kind, resolution) {
|
|
223
|
+
/** @type {(fn: () => any) => any} */
|
|
224
|
+
const run = (fn) => runWithActiveScaleResolution(resolution, kind, fn);
|
|
225
|
+
|
|
226
|
+
if (kind === "domain") {
|
|
227
|
+
// `vega-scale` returns a fresh array here. That is fine for
|
|
228
|
+
// batch-invariant expressions, but callers should avoid using it in a
|
|
229
|
+
// per-datum hot path unless they really need the full extent array.
|
|
230
|
+
return () => run(() => resolution.getDomain());
|
|
231
|
+
}
|
|
232
|
+
if (kind === "range") {
|
|
233
|
+
// Same allocation caveat as `domain()`: the underlying scale getter
|
|
234
|
+
// returns a copied array, so repeated per-row calls will allocate.
|
|
235
|
+
return () => run(() => resolution.getScale().range());
|
|
236
|
+
}
|
|
237
|
+
if (kind === "scale") {
|
|
238
|
+
return (value) => run(() => resolution.getScale()(value));
|
|
239
|
+
}
|
|
240
|
+
if (kind === "invert") {
|
|
241
|
+
return (value) =>
|
|
242
|
+
run(() => /** @type {any} */ (resolution.getScale()).invert(value));
|
|
243
|
+
}
|
|
244
|
+
throw new Error("Unknown scale helper: " + kind);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** @type {WeakSet<object>} */
|
|
248
|
+
const activeScaleHelperResolutions = new WeakSet();
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @template T
|
|
252
|
+
* @param {import("../scales/scaleResolution.js").default} resolution
|
|
253
|
+
* @param {"scale" | "invert" | "domain" | "range"} kind
|
|
254
|
+
* @param {() => T} fn
|
|
255
|
+
* @returns {T}
|
|
256
|
+
*/
|
|
257
|
+
function runWithActiveScaleResolution(resolution, kind, fn) {
|
|
258
|
+
if (activeScaleHelperResolutions.has(resolution)) {
|
|
259
|
+
throw new Error(
|
|
260
|
+
`Scale helper cycle detected while evaluating ${kind}("${resolution.channel}").`
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
activeScaleHelperResolutions.add(resolution);
|
|
265
|
+
try {
|
|
266
|
+
return fn();
|
|
267
|
+
} finally {
|
|
268
|
+
activeScaleHelperResolutions.delete(resolution);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @param {"scale" | "invert" | "domain" | "range"} kind
|
|
274
|
+
* @param {string} channel
|
|
275
|
+
* @param {import("../scales/scaleResolution.js").default} resolution
|
|
276
|
+
* @param {string} codeName
|
|
277
|
+
* @returns {import("../paramRuntime/types.js").ParamRef<any> & { rank: number }}
|
|
278
|
+
*/
|
|
279
|
+
function createScaleDependency(kind, channel, resolution, codeName) {
|
|
280
|
+
/** @type {Set<() => void>} */
|
|
281
|
+
const listeners = new Set();
|
|
282
|
+
|
|
283
|
+
const notify = () => {
|
|
284
|
+
for (const listener of listeners) {
|
|
285
|
+
listener();
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
const attach = () => {
|
|
290
|
+
if (kind === "domain") {
|
|
291
|
+
resolution.addEventListener("domain", notify);
|
|
292
|
+
} else if (kind === "range") {
|
|
293
|
+
resolution.addEventListener("range", notify);
|
|
294
|
+
} else {
|
|
295
|
+
resolution.addEventListener("domain", notify);
|
|
296
|
+
resolution.addEventListener("range", notify);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
const detach = () => {
|
|
301
|
+
if (kind === "domain") {
|
|
302
|
+
resolution.removeEventListener("domain", notify);
|
|
303
|
+
} else if (kind === "range") {
|
|
304
|
+
resolution.removeEventListener("range", notify);
|
|
305
|
+
} else {
|
|
306
|
+
resolution.removeEventListener("domain", notify);
|
|
307
|
+
resolution.removeEventListener("range", notify);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
return {
|
|
312
|
+
// The dependency is a lightweight invalidation token. It does not need
|
|
313
|
+
// to expose a separate scale value; the bound helper closure already
|
|
314
|
+
// closes over the actual resolution. The ref exists so the expression
|
|
315
|
+
// graph can subscribe to scale changes like any other reactive input.
|
|
316
|
+
id: `scale:${channel}:${codeName}`,
|
|
317
|
+
name: `scale(${channel})`,
|
|
318
|
+
kind: "derived",
|
|
319
|
+
rank: 0,
|
|
320
|
+
get() {
|
|
321
|
+
return resolution.getScale();
|
|
322
|
+
},
|
|
323
|
+
subscribe(listener) {
|
|
324
|
+
const wasEmpty = listeners.size === 0;
|
|
325
|
+
listeners.add(listener);
|
|
326
|
+
if (wasEmpty) {
|
|
327
|
+
attach();
|
|
328
|
+
}
|
|
329
|
+
return () => {
|
|
330
|
+
const removed = listeners.delete(listener);
|
|
331
|
+
if (removed && listeners.size === 0) {
|
|
332
|
+
detach();
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
80
340
|
* @param {string} expr
|
|
341
|
+
* @param {Record<string, any>} globalObject
|
|
342
|
+
* @param {ExpressionCompileContext} context
|
|
343
|
+
*
|
|
81
344
|
* @returns {ExpressionFunction}
|
|
82
345
|
*/
|
|
83
|
-
export default function createFunction(expr, globalObject = {}) {
|
|
346
|
+
export default function createFunction(expr, globalObject = {}, context = {}) {
|
|
84
347
|
try {
|
|
348
|
+
// Each scale helper call is rewritten once at compile time into a
|
|
349
|
+
// cached closure that targets a specific scale resolution.
|
|
350
|
+
/** @type {Map<string, import("../paramRuntime/types.js").ParamRef<any>>} */
|
|
351
|
+
const scaleDependenciesByChannel = new Map();
|
|
352
|
+
// A helper may appear multiple times in one expression. Cache both the
|
|
353
|
+
// generated closure and the synthetic dependency ref so repeated calls
|
|
354
|
+
// share the same reactive identity.
|
|
355
|
+
/** @type {Map<string, { codeName: string, dependency: import("../paramRuntime/types.js").ParamRef<any> }>} */
|
|
356
|
+
const helperEntries = new Map();
|
|
357
|
+
let nextScaleHelperId = 1;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @type {ExpressionCompileContext & {
|
|
361
|
+
* globalvar: string,
|
|
362
|
+
* globalObject: Record<string, any>,
|
|
363
|
+
* getScaleHelper: (kind: "scale" | "invert" | "domain" | "range", channel: string, resolution: import("../scales/scaleResolution.js").default) => { codeName: string, dependency: import("../paramRuntime/types.js").ParamRef<any> }
|
|
364
|
+
* }}
|
|
365
|
+
*/
|
|
366
|
+
const helperContext = {
|
|
367
|
+
...context,
|
|
368
|
+
globalvar: "globalObject",
|
|
369
|
+
globalObject,
|
|
370
|
+
getScaleHelper(kind, channel, resolution) {
|
|
371
|
+
// Helper instances are keyed by helper kind + channel so
|
|
372
|
+
// `domain("x")` and `scale("x", ...)` share the same
|
|
373
|
+
// resolution binding but keep separate generated closures.
|
|
374
|
+
const key = kind + ":" + channel;
|
|
375
|
+
const cached = helperEntries.get(key);
|
|
376
|
+
if (cached) {
|
|
377
|
+
return cached;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
let dependency = scaleDependenciesByChannel.get(channel);
|
|
381
|
+
if (!dependency) {
|
|
382
|
+
dependency = createScaleDependency(
|
|
383
|
+
kind,
|
|
384
|
+
channel,
|
|
385
|
+
resolution,
|
|
386
|
+
"__scale_dependency_" + nextScaleHelperId++
|
|
387
|
+
);
|
|
388
|
+
scaleDependenciesByChannel.set(channel, dependency);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const codeName = "__scale_helper_" + nextScaleHelperId++;
|
|
392
|
+
const entry = { codeName, dependency };
|
|
393
|
+
helperEntries.set(key, entry);
|
|
394
|
+
// Store the concrete helper implementation on the global object
|
|
395
|
+
// used by the generated expression function.
|
|
396
|
+
globalObject[codeName] = createScaleHelperFunction(
|
|
397
|
+
kind,
|
|
398
|
+
resolution
|
|
399
|
+
);
|
|
400
|
+
return entry;
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
const cg = codegenExpression({
|
|
405
|
+
forbidden: [],
|
|
406
|
+
allowed: ["datum", "undefined"],
|
|
407
|
+
globalvar: "globalObject",
|
|
408
|
+
fieldvar: "datum",
|
|
409
|
+
functions: (visitor) => buildFunctions(visitor, helperContext),
|
|
410
|
+
});
|
|
411
|
+
|
|
85
412
|
const parsed = parseExpression(expr);
|
|
86
413
|
const generatedCode = cg(parsed);
|
|
87
414
|
|
|
88
|
-
// eslint-disable-next-line no-new-func
|
|
89
415
|
const fn = Function(
|
|
90
416
|
"datum",
|
|
91
417
|
"globalObject",
|
|
@@ -105,10 +431,18 @@ export default function createFunction(expr, globalObject = {}) {
|
|
|
105
431
|
exprFunction.fields = generatedCode.fields;
|
|
106
432
|
exprFunction.globals = generatedCode.globals;
|
|
107
433
|
exprFunction.code = generatedCode.code;
|
|
434
|
+
// Reactive bookkeeping lives outside the generated expression body.
|
|
435
|
+
// The expression runtime subscribes to these refs and invalidates the
|
|
436
|
+
// compiled expression when the referenced scale changes.
|
|
437
|
+
exprFunction.scaleDependencies = Array.from(
|
|
438
|
+
scaleDependenciesByChannel.values()
|
|
439
|
+
);
|
|
108
440
|
|
|
109
441
|
return exprFunction;
|
|
110
442
|
} catch (e) {
|
|
111
|
-
throw new Error(`Invalid expression: ${expr}, ${e.message}
|
|
443
|
+
throw new Error(`Invalid expression: ${expr}, ${e.message}`, {
|
|
444
|
+
cause: e,
|
|
445
|
+
});
|
|
112
446
|
}
|
|
113
447
|
}
|
|
114
448
|
|
|
@@ -120,14 +454,13 @@ const eventFilterCg = codegenExpression({
|
|
|
120
454
|
|
|
121
455
|
/**
|
|
122
456
|
* @param {string} expr
|
|
123
|
-
* @returns {(event: UIEvent) => boolean}
|
|
457
|
+
* @returns {(event: UIEvent | import("./interactionEvent.js").WheelLikeEvent) => boolean}
|
|
124
458
|
*/
|
|
125
459
|
export function createEventFilterFunction(expr) {
|
|
126
460
|
try {
|
|
127
461
|
const parsed = parseExpression(expr);
|
|
128
462
|
const generatedCode = eventFilterCg(parsed);
|
|
129
463
|
|
|
130
|
-
// eslint-disable-next-line no-new-func
|
|
131
464
|
const fn = Function(
|
|
132
465
|
"event",
|
|
133
466
|
"globalObject",
|
|
@@ -141,10 +474,12 @@ export function createEventFilterFunction(expr) {
|
|
|
141
474
|
}`
|
|
142
475
|
);
|
|
143
476
|
|
|
144
|
-
return /** @type {(event: UIEvent) => boolean} */ (
|
|
477
|
+
return /** @type {(event: UIEvent | import("./interactionEvent.js").WheelLikeEvent) => boolean} */ (
|
|
145
478
|
/** @type {any} */ (fn)
|
|
146
479
|
);
|
|
147
480
|
} catch (e) {
|
|
148
|
-
throw new Error(`Invalid expression: ${expr}, ${e.message}
|
|
481
|
+
throw new Error(`Invalid expression: ${expr}, ${e.message}`, {
|
|
482
|
+
cause: e,
|
|
483
|
+
});
|
|
149
484
|
}
|
|
150
485
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/utils/field.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,iCAHW,MAAM,SACN,MAAM,
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/utils/field.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,iCAHW,MAAM,SACN,MAAM,uCA+BhB"}
|
package/dist/src/utils/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inertia.d.ts","sourceRoot":"","sources":["../../../src/utils/inertia.js"],"names":[],"mappings":"AAwEA;;;GAGG;AACH,kCAFa,CAAC,SADH,CAAC,
|
|
1
|
+
{"version":3,"file":"inertia.d.ts","sourceRoot":"","sources":["../../../src/utils/inertia.js"],"names":[],"mappings":"AAwEA;;;GAGG;AACH,kCAFa,CAAC,SADH,CAAC,iCAmBX;AAxFD;;GAEG;AACH;IACI;;;OAGG;IACH,sBAHW,OAAO,eAAe,EAAE,OAAO,aAC/B,OAAO,EA0BjB;IAvBG,0CAAwB;IACxB,kBAA0B;IAG1B,oBAAsB;IAEtB,oCAAoC;IACpC,UADW,CAAS,IAAM,EAAN,MAAM,KAAE,IAAI,CACZ;IAEpB,oBAAoB;IACpB,kBAAkB;IAElB;;;;MAUC;IAGL,eAQC;IAED;;;;OAIG;IACH,mBAHW,MAAM,YACN,CAAS,IAAM,EAAN,MAAM,KAAE,IAAI,QAkB/B;CACJ"}
|
|
@@ -80,7 +80,6 @@ export function makeEventTemplate(event) {
|
|
|
80
80
|
const acceptedTypes = ["string", "number", "boolean"];
|
|
81
81
|
const rejectedProps = ["wheelDelta", "wheelDeltaX", "wheelDeltaY"];
|
|
82
82
|
|
|
83
|
-
// eslint-disable-next-line guard-for-in
|
|
84
83
|
for (const key in event) {
|
|
85
84
|
const k = /** @type {keyof T} */ (key);
|
|
86
85
|
if (
|
|
@@ -9,5 +9,5 @@ export default function createBindingInputs(mediator: {
|
|
|
9
9
|
paramConfigs: ReadonlyMap<string, import("../spec/parameter.js").Parameter>;
|
|
10
10
|
setValue: (name: string, value: any) => void;
|
|
11
11
|
getValue: (name: string) => any;
|
|
12
|
-
}): import("lit-html").TemplateResult<
|
|
12
|
+
}): import("lit-html").TemplateResult<1 | 2 | 3>[];
|
|
13
13
|
//# sourceMappingURL=inputBinding.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal event object used by GenomeSpy's canvas interaction pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Interaction is deliberately smaller than DOM Event. It models the pieces
|
|
5
|
+
* that GenomeSpy needs for hierarchical pointer handling:
|
|
6
|
+
* - `point` is always in canvas coordinates
|
|
7
|
+
* - `uiEvent` is the original native or synthesized low-level event
|
|
8
|
+
* - `target` is the resolved deepest view target after propagation
|
|
9
|
+
* - `currentTarget` and `relatedTarget` are used by synthesized
|
|
10
|
+
* `mouseenter` / `mouseleave` delivery
|
|
11
|
+
*
|
|
12
|
+
* Runtime flow:
|
|
13
|
+
* 1. `InteractionController` converts native canvas events into Interaction
|
|
14
|
+
* instances and asks `InteractionDispatcher` to route them.
|
|
15
|
+
* 2. Container views route the interaction through the view hierarchy and may
|
|
16
|
+
* add policy on top, such as wheel claiming, zoom handling, or scrollbar
|
|
17
|
+
* dispatch.
|
|
18
|
+
* 3. `InteractionDispatcher` compares successive hover paths and synthesizes
|
|
19
|
+
* subtree-level `mouseenter` / `mouseleave` transitions.
|
|
20
|
+
*
|
|
21
|
+
* Differences from the DOM model:
|
|
22
|
+
* - propagation is view-driven rather than browser-driven
|
|
23
|
+
* - only the event types used by GenomeSpy are represented
|
|
24
|
+
* - there is only `stopPropagation()`, not stop-immediate semantics
|
|
25
|
+
* - mark picking is not encoded into `target`; mark hover lives separately in
|
|
26
|
+
* `InteractionController`
|
|
27
|
+
*
|
|
28
|
+
* Mouse and wheel helpers:
|
|
29
|
+
* - `mouseEvent` exposes the underlying MouseEvent for imperative handlers
|
|
30
|
+
* - `proxiedMouseEvent` exposes only primitive properties for places that
|
|
31
|
+
* must not retain live DOM objects
|
|
32
|
+
* - `wheelEvent` exposes the underlying wheel-like event, optionally with
|
|
33
|
+
* temporary delta overrides applied by `setWheelDeltas()`
|
|
34
|
+
*
|
|
35
|
+
* Special event types:
|
|
36
|
+
* - `wheelclaimprobe` asks pointed views whether they would consume wheel,
|
|
37
|
+
* without running the actual wheel side effects yet
|
|
38
|
+
* - `touchgesture` is a synthesized high-level gesture event derived from
|
|
39
|
+
* touch input
|
|
40
|
+
*/
|
|
41
|
+
export default class Interaction {
|
|
42
|
+
/**
|
|
43
|
+
* @param {import("../view/layout/point.js").default} point
|
|
44
|
+
* @param {import("./interactionEvent.js").InteractionUiEvent} uiEvent
|
|
45
|
+
* @param {string} [type]
|
|
46
|
+
*/
|
|
47
|
+
constructor(point: import("../view/layout/point.js").default, uiEvent: import("./interactionEvent.js").InteractionUiEvent, type?: string);
|
|
48
|
+
point: import("../view/layout/point.js").default;
|
|
49
|
+
stopped: boolean;
|
|
50
|
+
wheelClaimed: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The target is known only after the interaction has been resolved
|
|
53
|
+
* against the view hierarchy.
|
|
54
|
+
*
|
|
55
|
+
* @type {import("../view/view.js").default | undefined}
|
|
56
|
+
*/
|
|
57
|
+
target: import("../view/view.js").default | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Reserved for the new interaction dispatcher.
|
|
60
|
+
*
|
|
61
|
+
* @type {import("../view/view.js").default | undefined}
|
|
62
|
+
*/
|
|
63
|
+
currentTarget: import("../view/view.js").default | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Reserved for enter/leave-style transition events.
|
|
66
|
+
*
|
|
67
|
+
* @type {import("../view/view.js").default | undefined}
|
|
68
|
+
*/
|
|
69
|
+
relatedTarget: import("../view/view.js").default | undefined;
|
|
70
|
+
set uiEvent(value: import("./interactionEvent.js").InteractionUiEvent);
|
|
71
|
+
get uiEvent(): import("./interactionEvent.js").InteractionUiEvent;
|
|
72
|
+
stopPropagation(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Marks the current wheel interaction as claimed by the pointed view
|
|
75
|
+
* hierarchy.
|
|
76
|
+
*
|
|
77
|
+
* This is used both for real wheel events and for the synthetic
|
|
78
|
+
* `wheelclaimprobe` preflight. Controllers use the claimed state to decide
|
|
79
|
+
* whether the native wheel event should call `preventDefault()`.
|
|
80
|
+
*/
|
|
81
|
+
claimWheel(): void;
|
|
82
|
+
/**
|
|
83
|
+
* @param {number} deltaX
|
|
84
|
+
* @param {number} deltaY
|
|
85
|
+
*/
|
|
86
|
+
setWheelDeltas(deltaX: number, deltaY: number): void;
|
|
87
|
+
set type(value: string);
|
|
88
|
+
get type(): string;
|
|
89
|
+
/**
|
|
90
|
+
* Returns a primitive-only proxy of the underlying MouseEvent.
|
|
91
|
+
*
|
|
92
|
+
* This is intended for places such as expression evaluation, where the
|
|
93
|
+
* caller needs scalar event fields but should not receive a live DOM event
|
|
94
|
+
* object with methods, nested objects, or browser-specific prototypes.
|
|
95
|
+
*/
|
|
96
|
+
get proxiedMouseEvent(): MouseEvent;
|
|
97
|
+
get mouseEvent(): MouseEvent;
|
|
98
|
+
/**
|
|
99
|
+
* Returns a wheel-like event with any temporary delta overrides applied.
|
|
100
|
+
*
|
|
101
|
+
* The wrapped event keeps the original event identity for all properties
|
|
102
|
+
* except `deltaX` and `deltaY`, which allows intermediate handlers to
|
|
103
|
+
* consume part of the wheel interaction while keeping downstream wheel
|
|
104
|
+
* handling on the same event instance.
|
|
105
|
+
*/
|
|
106
|
+
get wheelEvent(): Pick<WheelEvent, "type" | "deltaX" | "deltaY" | "deltaMode" | "preventDefault" | "ctrlKey">;
|
|
107
|
+
#private;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../src/utils/interaction.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IAOI;;;;OAIG;IACH,mBAJW,OAAO,yBAAyB,EAAE,OAAO,WACzC,OAAO,uBAAuB,EAAE,kBAAkB,SAClD,MAAM,EA8BhB;IA3BG,iDAAkB;IAElB,iBAAoB;IACpB,sBAAyB;IAGzB;;;;;OAKG;IACH,QAFU,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAEhC;IAEvB;;;;OAIG;IACH,eAFU,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAEzB;IAE9B;;;;OAIG;IACH,eAFU,OAAO,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAEzB;IAclC,uEAKC;IATD,kEAEC;IASD,wBAEC;IAED;;;;;;;OAOG;IACH,mBAMC;IAED;;;OAGG;IACH,uBAHW,MAAM,UACN,MAAM,QAShB;IAMD,wBAEC;IAND,mBAEC;IAMD;;;;;;OAMG;IACH,oCAQC;IAED,6BAMC;IAED;;;;;;;OAOG;IACH,8GAkBC;;CACJ"}
|