@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,5 +1,5 @@
|
|
|
1
1
|
import { read } from "vega-loader";
|
|
2
|
-
import { getFormat, responseType } from "./dataUtils.js";
|
|
2
|
+
import { getFormat, hasGzipExtension, responseType } from "./dataUtils.js";
|
|
3
3
|
import DataSource from "./dataSource.js";
|
|
4
4
|
import {
|
|
5
5
|
activateExprRefProps,
|
|
@@ -7,14 +7,13 @@ import {
|
|
|
7
7
|
} from "../../paramRuntime/paramUtils.js";
|
|
8
8
|
import { concatUrl } from "../../utils/url.js";
|
|
9
9
|
|
|
10
|
+
const gzipMimeTypes = new Set(["application/gzip", "application/x-gzip"]);
|
|
11
|
+
const textDecoder = new TextDecoder();
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
14
|
+
* Loads eager data from URLs and transparently decompresses gzip-compatible
|
|
15
|
+
* payloads before handing them to the registered format reader.
|
|
13
16
|
*/
|
|
14
|
-
export function isUrlData(data) {
|
|
15
|
-
return "url" in data;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
17
|
export default class UrlSource extends DataSource {
|
|
19
18
|
/**
|
|
20
19
|
* @param {import("../../spec/data.js").UrlData} params
|
|
@@ -48,6 +47,7 @@ export default class UrlSource extends DataSource {
|
|
|
48
47
|
*/
|
|
49
48
|
async #loadUrlsFromFile(props) {
|
|
50
49
|
const listUrl = concatUrl(this.baseUrl, props.urlsFromFile);
|
|
50
|
+
const format = { type: props.type ?? "tsv" };
|
|
51
51
|
|
|
52
52
|
const result = await fetch(listUrl);
|
|
53
53
|
|
|
@@ -56,10 +56,14 @@ export default class UrlSource extends DataSource {
|
|
|
56
56
|
`Cannot load "${listUrl}": ${result.status} ${result.statusText}`
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const content = await readResponseBody(
|
|
60
|
+
result,
|
|
61
|
+
listUrl,
|
|
62
|
+
responseType(format.type)
|
|
63
|
+
);
|
|
60
64
|
|
|
61
65
|
const files = /** @type {string[] | {url: string}[]} */ (
|
|
62
|
-
read(
|
|
66
|
+
read(content, format)
|
|
63
67
|
)
|
|
64
68
|
.map((u) => (typeof u === "string" ? u : u.url))
|
|
65
69
|
.map((u) => concatUrl(listUrl, u));
|
|
@@ -94,14 +98,11 @@ export default class UrlSource extends DataSource {
|
|
|
94
98
|
if (!result.ok) {
|
|
95
99
|
throw new Error(`${result.status} ${result.statusText}`);
|
|
96
100
|
}
|
|
97
|
-
|
|
98
|
-
return typeof result[type] == "function"
|
|
99
|
-
? // @ts-ignore
|
|
100
|
-
result[type]()
|
|
101
|
-
: result.text();
|
|
101
|
+
return await readResponseBody(result, url, type);
|
|
102
102
|
} catch (e) {
|
|
103
103
|
throw new Error(
|
|
104
|
-
`Could not load data: ${url}. Reason: ${e.message}
|
|
104
|
+
`Could not load data: ${url}. Reason: ${e.message}`,
|
|
105
|
+
{ cause: e }
|
|
105
106
|
);
|
|
106
107
|
}
|
|
107
108
|
};
|
|
@@ -124,7 +125,9 @@ export default class UrlSource extends DataSource {
|
|
|
124
125
|
}
|
|
125
126
|
} catch (e) {
|
|
126
127
|
console.warn(e);
|
|
127
|
-
throw new Error(`Cannot parse: ${url}: ${e.message}
|
|
128
|
+
throw new Error(`Cannot parse: ${url}: ${e.message}`, {
|
|
129
|
+
cause: e,
|
|
130
|
+
});
|
|
128
131
|
}
|
|
129
132
|
};
|
|
130
133
|
|
|
@@ -140,3 +143,122 @@ export default class UrlSource extends DataSource {
|
|
|
140
143
|
this.complete();
|
|
141
144
|
}
|
|
142
145
|
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @param {Partial<import("../../spec/data.js").Data>} data
|
|
149
|
+
* @returns {data is import("../../spec/data.js").UrlData}
|
|
150
|
+
*/
|
|
151
|
+
export function isUrlData(data) {
|
|
152
|
+
return "url" in data;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @param {Uint8Array} bytes
|
|
157
|
+
*/
|
|
158
|
+
function hasGzipMagic(bytes) {
|
|
159
|
+
return (
|
|
160
|
+
bytes.length >= 10 &&
|
|
161
|
+
bytes[0] == 0x1f &&
|
|
162
|
+
bytes[1] == 0x8b &&
|
|
163
|
+
bytes[2] == 0x08 &&
|
|
164
|
+
(bytes[3] & 0xe0) == 0
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @param {string | null} contentType
|
|
170
|
+
*/
|
|
171
|
+
function isGzipMimeType(contentType) {
|
|
172
|
+
if (!contentType) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return gzipMimeTypes.has(contentType.split(";")[0].trim().toLowerCase());
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @param {string | null} contentEncoding
|
|
181
|
+
*/
|
|
182
|
+
function hasGzipContentEncoding(contentEncoding) {
|
|
183
|
+
if (!contentEncoding) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return contentEncoding
|
|
188
|
+
.toLowerCase()
|
|
189
|
+
.split(",")
|
|
190
|
+
.some((encoding) => encoding.trim() == "gzip");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @param {Uint8Array} bytes
|
|
195
|
+
* @returns {ArrayBuffer}
|
|
196
|
+
*/
|
|
197
|
+
function toArrayBuffer(bytes) {
|
|
198
|
+
return new Uint8Array(bytes).buffer;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @param {Uint8Array} bytes
|
|
203
|
+
*/
|
|
204
|
+
async function decompressGzip(bytes) {
|
|
205
|
+
if (typeof DecompressionStream != "function") {
|
|
206
|
+
throw new Error(
|
|
207
|
+
"Gzip-compressed URL data requires DecompressionStream support."
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const body = new Response(toArrayBuffer(bytes)).body;
|
|
212
|
+
if (!body) {
|
|
213
|
+
throw new Error(
|
|
214
|
+
"Cannot create a readable stream for gzip decompression."
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const stream = body.pipeThrough(new DecompressionStream("gzip"));
|
|
219
|
+
return new Uint8Array(await new Response(stream).arrayBuffer());
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @param {Response} response
|
|
224
|
+
* @param {string} url
|
|
225
|
+
* @param {string} type
|
|
226
|
+
*/
|
|
227
|
+
async function readResponseBody(response, url, type) {
|
|
228
|
+
const gzipHint =
|
|
229
|
+
hasGzipExtension(url) ||
|
|
230
|
+
isGzipMimeType(response.headers.get("content-type")) ||
|
|
231
|
+
hasGzipContentEncoding(response.headers.get("content-encoding"));
|
|
232
|
+
|
|
233
|
+
if (!gzipHint) {
|
|
234
|
+
return readResponseUsingType(response, type);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
238
|
+
const bodyBytes = hasGzipMagic(bytes) ? await decompressGzip(bytes) : bytes;
|
|
239
|
+
return deserializeBytes(bodyBytes, type);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* @param {Response} response
|
|
244
|
+
* @param {string} type
|
|
245
|
+
*/
|
|
246
|
+
function readResponseUsingType(response, type) {
|
|
247
|
+
// @ts-ignore
|
|
248
|
+
return typeof response[type] == "function"
|
|
249
|
+
? // @ts-ignore
|
|
250
|
+
response[type]()
|
|
251
|
+
: response.text();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @param {Uint8Array} bytes
|
|
256
|
+
* @param {string} type
|
|
257
|
+
*/
|
|
258
|
+
function deserializeBytes(bytes, type) {
|
|
259
|
+
if (type == "arrayBuffer") {
|
|
260
|
+
return toArrayBuffer(bytes);
|
|
261
|
+
} else {
|
|
262
|
+
return textDecoder.decode(bytes);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregate.js"],"names":[],"mappings":"AAOA;IAKI;;;;OAIG;IACH,oBAJW,OAAO,yBAAyB,EAAE,eAAe,EA6C3D;IAvCG,0DAAoB;IAEpB,oBAAoB;IACpB,QADW,GAAG,EAAE,CACA;IAEhB;;OAEG;IACH,KAFU,CAAC,CAAC,GAAG,EAAE,gCAAO,KAAK,MAAM,CAAC,EAAE,CAEzB;IACb;;OAEG;IACH,IAFU,MAAM,EAAE,CAEN;
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregate.js"],"names":[],"mappings":"AAOA;IAKI;;;;OAIG;IACH,oBAJW,OAAO,yBAAyB,EAAE,eAAe,EA6C3D;IAvCG,0DAAoB;IAEpB,oBAAoB;IACpB,QADW,GAAG,EAAE,CACA;IAEhB;;OAEG;IACH,KAFU,CAAC,CAAC,GAAG,EAAE,gCAAO,KAAK,MAAM,CAAC,EAAE,CAEzB;IACb;;OAEG;IACH,IAFU,MAAM,EAAE,CAEN;;CAuGnB;sBAlIqB,gBAAgB"}
|
|
@@ -64,16 +64,10 @@ export default class AggregateTransform extends Transform {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
* @param {import("../flowNode.js").Datum} datum
|
|
67
|
+
* Propagate the current buffer as one aggregated batch.
|
|
69
68
|
*/
|
|
70
|
-
|
|
71
|
-
this.buffer.push(datum);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
complete() {
|
|
69
|
+
#flushBuffer() {
|
|
75
70
|
const params = this.params;
|
|
76
|
-
|
|
77
71
|
const groupby = params?.groupby;
|
|
78
72
|
|
|
79
73
|
if (groupby?.length > 0) {
|
|
@@ -107,6 +101,34 @@ export default class AggregateTransform extends Transform {
|
|
|
107
101
|
|
|
108
102
|
this._propagate(datum);
|
|
109
103
|
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @param {import("../flowNode.js").Datum} datum
|
|
109
|
+
*/
|
|
110
|
+
handle(datum) {
|
|
111
|
+
this.buffer.push(datum);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Flush the current batch before downstream nodes switch to a new facet.
|
|
116
|
+
*
|
|
117
|
+
* @param {import("../../types/flowBatch.js").FlowBatch} flowBatch
|
|
118
|
+
*/
|
|
119
|
+
beginBatch(flowBatch) {
|
|
120
|
+
if (this.buffer.length > 0) {
|
|
121
|
+
this.#flushBuffer();
|
|
122
|
+
this.buffer = [];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
super.beginBatch(flowBatch);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
complete() {
|
|
129
|
+
if (this.buffer.length > 0) {
|
|
130
|
+
this.#flushBuffer();
|
|
131
|
+
}
|
|
110
132
|
|
|
111
133
|
super.complete();
|
|
112
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregateOps.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregateOps.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"aggregateOps.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregateOps.js"],"names":[],"mappings":";AAWA;;GAEG;AACH,6BAFU,MAAM,CAAC,OAAO,yBAAyB,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,KAAK,MAAM,CAAC,CAaxH"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
count,
|
|
3
|
+
max,
|
|
4
|
+
mean,
|
|
5
|
+
median,
|
|
6
|
+
min,
|
|
7
|
+
quantile,
|
|
8
|
+
sum,
|
|
9
|
+
variance,
|
|
10
|
+
} from "d3-array";
|
|
2
11
|
|
|
3
12
|
/**
|
|
4
13
|
* @type {Record<import("../../spec/transform.js").AggregateOp, (arr: any[], accessor?: (datum: any) => number) => number>}
|
|
@@ -10,7 +19,9 @@ const AGGREGATE_OPS = {
|
|
|
10
19
|
min,
|
|
11
20
|
max,
|
|
12
21
|
mean,
|
|
22
|
+
q1: (arr, accessor) => quantile(arr, 0.25, accessor),
|
|
13
23
|
median,
|
|
24
|
+
q3: (arr, accessor) => quantile(arr, 0.75, accessor),
|
|
14
25
|
variance,
|
|
15
26
|
};
|
|
16
27
|
|
|
@@ -147,7 +147,7 @@ export default class CoverageTransform extends Transform {
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
const flushQueue = () => {
|
|
150
|
-
let edge
|
|
150
|
+
let edge;
|
|
151
151
|
while ((edge = ends.peekValue()) !== undefined) {
|
|
152
152
|
pushSegment(prevEdge, edge, coverage);
|
|
153
153
|
prevEdge = edge;
|
|
@@ -166,7 +166,7 @@ export default class CoverageTransform extends Transform {
|
|
|
166
166
|
this.handle = (datum) => {
|
|
167
167
|
const start = startAccessor(datum);
|
|
168
168
|
|
|
169
|
-
let edge
|
|
169
|
+
let edge;
|
|
170
170
|
while ((edge = ends.peekValue()) !== undefined && edge < start) {
|
|
171
171
|
pushSegment(prevEdge, edge, coverage);
|
|
172
172
|
prevEdge = edge;
|
|
@@ -5,6 +5,12 @@ export default class FilterScoredLabelsTransform extends Transform {
|
|
|
5
5
|
* @param {import("../../view/view.js").default} view
|
|
6
6
|
*/
|
|
7
7
|
constructor(params: import("../../spec/transform.js").FilterScoredLabelsParams, view: import("../../view/view.js").default);
|
|
8
|
+
/**
|
|
9
|
+
* The transform emits only labels that fit in the current visible interval,
|
|
10
|
+
* so downstream x/y values derived from its output must not feed back into
|
|
11
|
+
* shared-domain resolution.
|
|
12
|
+
*/
|
|
13
|
+
get domainSensitiveScaleChannels(): ("x" | "y")[];
|
|
8
14
|
params: import("../../spec/transform.js").FilterScoredLabelsParams;
|
|
9
15
|
/** @type {any[]} */
|
|
10
16
|
_data: any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterScoredLabels.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/filterScoredLabels.js"],"names":[],"mappings":"AAOA;
|
|
1
|
+
{"version":3,"file":"filterScoredLabels.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/filterScoredLabels.js"],"names":[],"mappings":"AAOA;IAcI;;;;OAIG;IACH,oBAHW,OAAO,yBAAyB,EAAE,wBAAwB,QAC1D,OAAO,oBAAoB,EAAE,OAAO,EAkD9C;IA9DD;;;;OAIG;IACH,kDAEC;IAUG,mEAAoB;IAEpB,oBAAoB;IACpB,OADW,GAAG,EAAE,CACD;IAEf,mBAAoC;IAMpC,sDAA8C;IAC9C,oDAAgE;IAChE,wDAAuD;IACvD,sDAAmD;IACnD,mDAA6C;IAC7C,mDAA6C;IAC7C,gCAAgC;IAChC,cADW,CAAS,IAAG,EAAH,GAAG,KAAE,GAAG,CAGd;IACd,gBAAuC;IAEvC,uCAAuC;IACvC,iBADW,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CACH;IAEhC,8DAAuD;IAIvD,qBAAuE;IA8B3E,4BAsEC;IAKG,sBAAuB;CAU9B;sBAzKqB,gBAAgB;2BAFX,+BAA+B"}
|
|
@@ -10,6 +10,15 @@ export default class FilterScoredLabelsTransform extends Transform {
|
|
|
10
10
|
return BEHAVIOR_COLLECTS;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* The transform emits only labels that fit in the current visible interval,
|
|
15
|
+
* so downstream x/y values derived from its output must not feed back into
|
|
16
|
+
* shared-domain resolution.
|
|
17
|
+
*/
|
|
18
|
+
get domainSensitiveScaleChannels() {
|
|
19
|
+
return [this.channel];
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
/**
|
|
14
23
|
*
|
|
15
24
|
* @param {import("../../spec/transform.js").FilterScoredLabelsParams} params
|
|
@@ -14,6 +14,7 @@ export default class MeasureTextTransform extends Transform {
|
|
|
14
14
|
* @param {any} datum
|
|
15
15
|
*/
|
|
16
16
|
handle: (datum: any) => void;
|
|
17
|
+
font: import("../../fonts/bmFontManager.js").FontEntry;
|
|
17
18
|
}
|
|
18
19
|
import Transform from "./transform.js";
|
|
19
20
|
//# sourceMappingURL=measureText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measureText.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/measureText.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"measureText.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/measureText.js"],"names":[],"mappings":"AAKA;;GAEG;AACH;IAKI;;;;OAIG;IACH,oBAHW,OAAO,yBAAyB,EAAE,iBAAiB,wBACnD,OAAO,gBAAgB,EAAE,oBAAoB,EA4CvD;IAvCG,4DAAoB;IA0BpB;;;OAGG;IACH,gBAFW,GAAG,UAUb;IAOD,uDAMkC;CAEzC;sBAxEqB,gBAAgB"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { BEHAVIOR_MODIFIES } from "../flowNode.js";
|
|
2
|
-
import fontMetadata from "../../fonts/Lato-Regular.json" with { type: "json" };
|
|
3
|
-
import getMetrics from "../../fonts/bmFontMetrics.js";
|
|
4
2
|
import { field } from "../../utils/field.js";
|
|
5
3
|
import Transform from "./transform.js";
|
|
6
4
|
import { isExprRef } from "../../paramRuntime/paramUtils.js";
|
|
@@ -23,10 +21,8 @@ export default class MeasureTextTransform extends Transform {
|
|
|
23
21
|
|
|
24
22
|
this.params = params;
|
|
25
23
|
|
|
26
|
-
const metrics = getMetrics(fontMetadata);
|
|
27
24
|
const accessor = field(params.field);
|
|
28
25
|
const as = params.as;
|
|
29
|
-
// TODO: Support custom fonts.
|
|
30
26
|
|
|
31
27
|
let size = 0;
|
|
32
28
|
|
|
@@ -56,11 +52,24 @@ export default class MeasureTextTransform extends Transform {
|
|
|
56
52
|
this.handle = (datum) => {
|
|
57
53
|
const text = accessor(datum);
|
|
58
54
|
if (text !== undefined) {
|
|
59
|
-
datum[as] = metrics.measureWidth(text, size);
|
|
55
|
+
datum[as] = this.font.metrics.measureWidth(text, size);
|
|
60
56
|
} else {
|
|
61
57
|
datum[as] = 0;
|
|
62
58
|
}
|
|
63
59
|
this._propagate(datum);
|
|
64
60
|
};
|
|
65
61
|
}
|
|
62
|
+
|
|
63
|
+
initialize() {
|
|
64
|
+
const fontManager = this.paramRuntimeProvider.context.fontManager;
|
|
65
|
+
// Resolve the font during flow initialization so viewDataInit's global
|
|
66
|
+
// font wait also covers measureText before any rows are propagated.
|
|
67
|
+
this.font = this.params.font
|
|
68
|
+
? fontManager.getFont(
|
|
69
|
+
this.params.font,
|
|
70
|
+
this.params.fontStyle,
|
|
71
|
+
this.params.fontWeight
|
|
72
|
+
)
|
|
73
|
+
: fontManager.getDefaultFont();
|
|
74
|
+
}
|
|
66
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pileup.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/pileup.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pileup.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/pileup.js"],"names":[],"mappings":"AAQA;IAKI;;;OAGG;IACH,oBAFW,OAAO,yBAAyB,EAAE,YAAY,EAMxD;IADG,uDAAoB;CAyG3B;sBAzHqB,gBAAgB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-unmodified-loop-condition */
|
|
2
1
|
import FlatQueue from "flatqueue";
|
|
3
2
|
import { isNumber } from "vega-util";
|
|
4
3
|
import { field } from "../../utils/field.js";
|
|
@@ -68,7 +67,7 @@ export default class PileupTransform extends Transform {
|
|
|
68
67
|
const preferredLane = preferredOrder.indexOf(
|
|
69
68
|
preferenceAccessor(datum)
|
|
70
69
|
);
|
|
71
|
-
let lane
|
|
70
|
+
let lane;
|
|
72
71
|
if (preferredLane >= 0 && freeLaneMap[preferredLane] < start) {
|
|
73
72
|
lane = preferredLane;
|
|
74
73
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regexFold.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/regexFold.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IAKI;;OAEG;IACH,oBAFW,OAAO,yBAAyB,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"regexFold.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/regexFold.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IAKI;;OAEG;IACH,oBAFW,OAAO,yBAAyB,EAAE,eAAe,EA4I3D;IAvIG,0DAAoB;IAwHhB,gBALO,GAAG,UAKe;CAgBpC;sBA1JqB,gBAAgB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {new (container: HTMLElement, spec: import("./spec/root.js").RootSpec, options?: import("./types/embedApi.js").EmbedOptions) => import("./genomeSpy.js").default} GenomeSpy
|
|
3
|
+
* @returns {(el: HTMLElement | string, spec: import("./spec/root.js").RootSpec | string, options?: import("./types/embedApi.js").EmbedOptions) => Promise<import("./types/embedApi.js").EmbedResult>}
|
|
4
|
+
*/
|
|
5
|
+
export function createEmbed(GenomeSpy: new (container: HTMLElement, spec: import("./spec/root.js").RootSpec, options?: import("./types/embedApi.js").EmbedOptions) => import("./genomeSpy.js").default): (el: HTMLElement | string, spec: import("./spec/root.js").RootSpec | string, options?: import("./types/embedApi.js").EmbedOptions) => Promise<import("./types/embedApi.js").EmbedResult>;
|
|
6
|
+
/**
|
|
7
|
+
* Loads the spec from the given url and sets the baseUrl if it is not
|
|
8
|
+
* defined in the spec.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} url
|
|
11
|
+
*/
|
|
12
|
+
export function loadSpec(url: string): Promise<any>;
|
|
13
|
+
//# sourceMappingURL=embedFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedFactory.d.ts","sourceRoot":"","sources":["../../src/embedFactory.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH,uCAHW,KAAK,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,qBAAqB,EAAE,YAAY,KAAK,OAAO,gBAAgB,EAAE,OAAO,GAC7J,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,EAAE,IAAI,EAAE,OAAO,gBAAgB,EAAE,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,qBAAqB,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,qBAAqB,EAAE,WAAW,CAAC,CAmFpM;AAaD;;;;;GAKG;AACH,8BAFW,MAAM,gBAmBhB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { isObject, isString } from "vega-util";
|
|
2
|
+
|
|
3
|
+
import { fetchJson } from "./utils/fetchUtils.js";
|
|
4
|
+
import inferSpecBaseUrl from "./utils/inferSpecBaseUrl.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {new (container: HTMLElement, spec: import("./spec/root.js").RootSpec, options?: import("./types/embedApi.js").EmbedOptions) => import("./genomeSpy.js").default} GenomeSpy
|
|
8
|
+
* @returns {(el: HTMLElement | string, spec: import("./spec/root.js").RootSpec | string, options?: import("./types/embedApi.js").EmbedOptions) => Promise<import("./types/embedApi.js").EmbedResult>}
|
|
9
|
+
*/
|
|
10
|
+
export function createEmbed(GenomeSpy) {
|
|
11
|
+
/**
|
|
12
|
+
* Embeds GenomeSpy into the DOM
|
|
13
|
+
*
|
|
14
|
+
* @param {HTMLElement | string} el
|
|
15
|
+
* @param {import("./spec/root.js").RootSpec | string} spec
|
|
16
|
+
* @param {import("./types/embedApi.js").EmbedOptions} [options]
|
|
17
|
+
* @returns {Promise<import("./types/embedApi.js").EmbedResult>}
|
|
18
|
+
*/
|
|
19
|
+
return async function embed(el, spec, options = {}) {
|
|
20
|
+
/** @type {HTMLElement} */
|
|
21
|
+
let element;
|
|
22
|
+
|
|
23
|
+
if (isString(el)) {
|
|
24
|
+
element = document.querySelector(el);
|
|
25
|
+
if (!element) {
|
|
26
|
+
throw new Error(`No such element: ${el}`);
|
|
27
|
+
}
|
|
28
|
+
} else if (el instanceof HTMLElement) {
|
|
29
|
+
element = el;
|
|
30
|
+
} else {
|
|
31
|
+
throw new Error(`Invalid element: ${el}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** @type {InstanceType<typeof GenomeSpy> | undefined} */
|
|
35
|
+
let genomeSpy;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const specObject = isObject(spec) ? spec : await loadSpec(spec);
|
|
39
|
+
|
|
40
|
+
specObject.baseUrl ??= "";
|
|
41
|
+
specObject.width ??= "container";
|
|
42
|
+
specObject.padding ??= 10;
|
|
43
|
+
|
|
44
|
+
if (element == document.body) {
|
|
45
|
+
// Need to add a wrapper to make sizing behavior more stable
|
|
46
|
+
const wrapper = document.createElement("div");
|
|
47
|
+
wrapper.style.position = "fixed";
|
|
48
|
+
wrapper.style.inset = "0";
|
|
49
|
+
wrapper.style.overflow = "hidden";
|
|
50
|
+
element.appendChild(wrapper);
|
|
51
|
+
element = wrapper;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
genomeSpy = new GenomeSpy(element, specObject, options);
|
|
55
|
+
applyOptions(genomeSpy, options);
|
|
56
|
+
await genomeSpy.launch();
|
|
57
|
+
} catch (e) {
|
|
58
|
+
element.innerText = e.toString();
|
|
59
|
+
console.error(e);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
finalize() {
|
|
64
|
+
genomeSpy.destroy();
|
|
65
|
+
while (element.firstChild) {
|
|
66
|
+
element.firstChild.remove();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
addEventListener(type, listener) {
|
|
71
|
+
genomeSpy.addEventListener(type, listener);
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
removeEventListener(type, listener) {
|
|
75
|
+
genomeSpy.removeEventListener(type, listener);
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
getScaleResolutionByName(name) {
|
|
79
|
+
return genomeSpy.getNamedScaleResolutions().get(name);
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
awaitVisibleLazyData:
|
|
83
|
+
genomeSpy.awaitVisibleLazyData.bind(genomeSpy),
|
|
84
|
+
getRenderedBounds: genomeSpy.getRenderedBounds.bind(genomeSpy),
|
|
85
|
+
updateNamedData: genomeSpy.updateNamedData.bind(genomeSpy),
|
|
86
|
+
getLogicalCanvasSize:
|
|
87
|
+
genomeSpy.getLogicalCanvasSize.bind(genomeSpy),
|
|
88
|
+
exportCanvas: genomeSpy.exportCanvas.bind(genomeSpy),
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @param {import("./genomeSpy.js").default} genomeSpy
|
|
96
|
+
* @param {import("./types/embedApi.js").EmbedOptions} options options
|
|
97
|
+
*/
|
|
98
|
+
function applyOptions(genomeSpy, options) {
|
|
99
|
+
if (options.namedDataProvider) {
|
|
100
|
+
genomeSpy.registerNamedDataProvider(options.namedDataProvider);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Loads the spec from the given url and sets the baseUrl if it is not
|
|
106
|
+
* defined in the spec.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} url
|
|
109
|
+
*/
|
|
110
|
+
export async function loadSpec(url) {
|
|
111
|
+
let spec;
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
spec = /** @type {any} */ (await fetchJson(url));
|
|
115
|
+
} catch (e) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
`Could not load or parse configuration: ${url}, reason: ${e.message}`,
|
|
118
|
+
{ cause: e }
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!spec.baseUrl) {
|
|
123
|
+
spec.baseUrl = inferSpecBaseUrl(url);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return spec;
|
|
127
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Creates a raw accessor for a single channel definition branch and attaches
|
|
3
|
+
* metadata used by scale resolution and equality checks.
|
|
4
|
+
*
|
|
2
5
|
* @param {import("../spec/channel.js").Channel} channel
|
|
3
6
|
* @param {import("../spec/channel.js").ChannelDef | import("../spec/channel.js").Conditional<import("../spec/channel.js").ChannelDef>} channelDef
|
|
4
7
|
* @param {{ createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction }} paramRuntime
|
|
@@ -7,18 +10,6 @@
|
|
|
7
10
|
export function createAccessor(channel: import("../spec/channel.js").Channel, channelDef: import("../spec/channel.js").ChannelDef | import("../spec/channel.js").Conditional<import("../spec/channel.js").ChannelDef>, paramRuntime: {
|
|
8
11
|
createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction;
|
|
9
12
|
}): import("../types/encoder.js").Accessor;
|
|
10
|
-
/**
|
|
11
|
-
* Returns an array of acessors and their predicates. A returned array with
|
|
12
|
-
* a single element indicates that no conditions are present.
|
|
13
|
-
* The default accessor is always the last element in the array.
|
|
14
|
-
*
|
|
15
|
-
* @param {import("../spec/channel.js").Channel} channel
|
|
16
|
-
* @param {import("../spec/channel.js").ChannelDef} channelDef
|
|
17
|
-
* @param {{ createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction }} paramRuntime
|
|
18
|
-
*/
|
|
19
|
-
export function createConditionalAccessors(channel: import("../spec/channel.js").Channel, channelDef: import("../spec/channel.js").ChannelDef, paramRuntime: {
|
|
20
|
-
createExpression: (expr: string) => import("../paramRuntime/types.js").ExprRefFunction;
|
|
21
|
-
}): import("../types/encoder.js").Accessor<import("../spec/channel.js").Scalar>[];
|
|
22
13
|
/**
|
|
23
14
|
* @param {import("../types/encoder.js").Accessor} accessor
|
|
24
15
|
* @returns {accessor is import("../types/encoder.js").ScaleAccessor}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessor.d.ts","sourceRoot":"","sources":["../../../src/encoder/accessor.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accessor.d.ts","sourceRoot":"","sources":["../../../src/encoder/accessor.js"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,wCALW,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,oBAAoB,EAAE,UAAU,GAAG,OAAO,oBAAoB,EAAE,WAAW,CAAC,OAAO,oBAAoB,EAAE,UAAU,CAAC,gBAC3H;IAAE,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,0BAA0B,EAAE,eAAe,CAAA;CAAE,GACxF,OAAO,qBAAqB,EAAE,QAAQ,CAoGlD;AAED;;;GAGG;AACH,0CAHW,OAAO,qBAAqB,EAAE,QAAQ,GACpC,QAAQ,IAAI,OAAO,qBAAqB,EAAE,aAAa,CAInE;AA6DD;;;;;;;;;;GAUG;AACH,+DALG;IAA+D,YAAY,EAAnE,OAAO,oBAAoB,EAAE,gBAAgB;IACpB,MAAM,EAA/B,eAAe;IAC6B,IAAI,GAAhD,OAAO,oBAAoB,EAAE,IAAI;CACzC,GAAU;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAYzD;AAED;;;;GAIG;AACH,+CAJW,OAAO,qBAAqB,EAAE,aAAa,QAC3C,OAAO,oBAAoB,EAAE,IAAI,GAC/B,MAAM,CAgBlB;8BApGY;IACN,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,GAAG;IACA,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB,GAAG;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,oBAAoB,EAAE,MAAM,GAAG,OAAO,sBAAsB,EAAE,OAAO,CAAC;CACvF,GAAG;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,oBAAoB,EAAE,MAAM,GAAG,OAAO,sBAAsB,EAAE,OAAO,CAAC;CACvF"}
|