@genome-spy/core 0.37.4 → 0.39.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/__vite-browser-external-ENoMJThg.js +8 -0
- package/dist/bundle/_commonjsHelpers-QtkX90xp.js +30 -0
- package/dist/bundle/index-1QVesMzU.js +1074 -0
- package/dist/bundle/index-Cbz74kpR.js +638 -0
- package/dist/bundle/index-LD6yPc3X.js +515 -0
- package/dist/bundle/index-Pv3tKJ1W.js +2190 -0
- package/dist/bundle/index-UyrC0vvF.js +72 -0
- package/dist/bundle/index-Y-LdHNIz.js +501 -0
- package/dist/bundle/index-gn8bhQ8w.js +4050 -0
- package/dist/bundle/index-lmJu1tfP.js +1372 -0
- package/dist/bundle/index-z4Cs62EO.js +279 -0
- package/dist/bundle/index.es.js +6467 -20590
- package/dist/bundle/index.js +92 -123
- package/dist/bundle/long-Veu0zKh9.js +2382 -0
- package/dist/bundle/remoteFile-Ur-gRKsH.js +96 -0
- package/dist/schema.json +524 -122
- package/dist/src/data/collector.d.ts +11 -11
- package/dist/src/data/collector.d.ts.map +1 -1
- package/dist/src/data/collector.js +8 -8
- package/dist/src/data/dataFlow.d.ts +18 -18
- package/dist/src/data/dataFlow.d.ts.map +1 -1
- package/dist/src/data/dataFlow.js +7 -7
- package/dist/src/data/flowNode.d.ts +9 -9
- package/dist/src/data/flowNode.d.ts.map +1 -1
- package/dist/src/data/flowNode.js +5 -5
- package/dist/src/data/flowOptimizer.d.ts +11 -11
- package/dist/src/data/flowOptimizer.d.ts.map +1 -1
- package/dist/src/data/flowOptimizer.js +7 -7
- package/dist/src/data/flowTestUtils.d.ts +2 -2
- package/dist/src/data/flowTestUtils.d.ts.map +1 -1
- package/dist/src/data/flowTestUtils.js +1 -1
- package/dist/src/data/sources/dataSource.js +1 -1
- package/dist/src/data/sources/dataSourceFactory.d.ts +3 -3
- package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
- package/dist/src/data/sources/dataSourceFactory.js +20 -20
- package/dist/src/data/sources/dataUtils.d.ts +20 -20
- package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
- package/dist/src/data/sources/dataUtils.js +11 -11
- package/dist/src/data/sources/dynamic/axisGenomeSource.d.ts +3 -3
- package/dist/src/data/sources/dynamic/axisGenomeSource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/axisGenomeSource.js +2 -2
- package/dist/src/data/sources/dynamic/axisTickSource.d.ts +6 -6
- package/dist/src/data/sources/dynamic/axisTickSource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/axisTickSource.js +4 -4
- package/dist/src/data/sources/dynamic/bamSource.d.ts +7 -13
- package/dist/src/data/sources/dynamic/bamSource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/bamSource.js +35 -27
- package/dist/src/data/sources/dynamic/bigBedSource.d.ts +9 -9
- package/dist/src/data/sources/dynamic/bigBedSource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/bigBedSource.js +31 -18
- package/dist/src/data/sources/dynamic/bigWigSource.d.ts +7 -7
- package/dist/src/data/sources/dynamic/bigWigSource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/bigWigSource.js +33 -26
- package/dist/src/data/sources/dynamic/gff3Source.d.ts +9 -0
- package/dist/src/data/sources/dynamic/gff3Source.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/gff3Source.js +17 -2
- package/dist/src/data/sources/dynamic/indexedFastaSource.d.ts +6 -9
- package/dist/src/data/sources/dynamic/indexedFastaSource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/indexedFastaSource.js +28 -18
- package/dist/src/data/sources/dynamic/singleAxisLazySource.d.ts +10 -10
- package/dist/src/data/sources/dynamic/singleAxisLazySource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/singleAxisLazySource.js +6 -6
- package/dist/src/data/sources/dynamic/tabixSource.d.ts +11 -8
- package/dist/src/data/sources/dynamic/tabixSource.d.ts.map +1 -1
- package/dist/src/data/sources/dynamic/tabixSource.js +31 -17
- package/dist/src/data/sources/inlineSource.d.ts +7 -7
- package/dist/src/data/sources/inlineSource.d.ts.map +1 -1
- package/dist/src/data/sources/inlineSource.js +5 -5
- package/dist/src/data/sources/namedSource.d.ts +9 -9
- package/dist/src/data/sources/namedSource.d.ts.map +1 -1
- package/dist/src/data/sources/namedSource.js +6 -6
- package/dist/src/data/sources/sequenceSource.d.ts +7 -7
- package/dist/src/data/sources/sequenceSource.d.ts.map +1 -1
- package/dist/src/data/sources/sequenceSource.js +4 -4
- package/dist/src/data/sources/urlSource.d.ts +7 -7
- package/dist/src/data/sources/urlSource.d.ts.map +1 -1
- package/dist/src/data/sources/urlSource.js +4 -4
- package/dist/src/data/transforms/aggregate.d.ts +3 -3
- package/dist/src/data/transforms/aggregate.d.ts.map +1 -1
- package/dist/src/data/transforms/aggregate.js +2 -2
- package/dist/src/data/transforms/clone.d.ts +2 -2
- package/dist/src/data/transforms/clone.d.ts.map +1 -1
- package/dist/src/data/transforms/clone.js +1 -1
- package/dist/src/data/transforms/coverage.d.ts +3 -3
- package/dist/src/data/transforms/coverage.d.ts.map +1 -1
- package/dist/src/data/transforms/coverage.js +1 -1
- package/dist/src/data/transforms/coverage.test.js +1 -1
- package/dist/src/data/transforms/filter.d.ts +3 -3
- package/dist/src/data/transforms/filter.d.ts.map +1 -1
- package/dist/src/data/transforms/filter.js +2 -2
- package/dist/src/data/transforms/filter.test.js +1 -1
- package/dist/src/data/transforms/filterScoredLabels.d.ts +4 -4
- package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
- package/dist/src/data/transforms/filterScoredLabels.js +3 -3
- package/dist/src/data/transforms/flatten.d.ts +2 -2
- package/dist/src/data/transforms/flatten.d.ts.map +1 -1
- package/dist/src/data/transforms/flatten.js +3 -3
- package/dist/src/data/transforms/flatten.test.js +6 -6
- package/dist/src/data/transforms/flattenCompressedExons.d.ts +2 -2
- package/dist/src/data/transforms/flattenCompressedExons.d.ts.map +1 -1
- package/dist/src/data/transforms/flattenCompressedExons.js +1 -1
- package/dist/src/data/transforms/flattenDelimited.d.ts +2 -2
- package/dist/src/data/transforms/flattenDelimited.d.ts.map +1 -1
- package/dist/src/data/transforms/flattenDelimited.js +2 -2
- package/dist/src/data/transforms/flattenDelimited.test.js +5 -5
- package/dist/src/data/transforms/flattenSequence.d.ts +2 -2
- package/dist/src/data/transforms/flattenSequence.d.ts.map +1 -1
- package/dist/src/data/transforms/flattenSequence.js +1 -1
- package/dist/src/data/transforms/flattenSequence.test.js +1 -1
- package/dist/src/data/transforms/formula.d.ts +3 -3
- package/dist/src/data/transforms/formula.d.ts.map +1 -1
- package/dist/src/data/transforms/formula.js +2 -2
- package/dist/src/data/transforms/identifier.d.ts +3 -3
- package/dist/src/data/transforms/identifier.d.ts.map +1 -1
- package/dist/src/data/transforms/identifier.js +2 -2
- package/dist/src/data/transforms/linearizeGenomicCoordinate.d.ts +3 -3
- package/dist/src/data/transforms/linearizeGenomicCoordinate.d.ts.map +1 -1
- package/dist/src/data/transforms/linearizeGenomicCoordinate.js +2 -2
- package/dist/src/data/transforms/measureText.d.ts +2 -2
- package/dist/src/data/transforms/measureText.d.ts.map +1 -1
- package/dist/src/data/transforms/measureText.js +1 -1
- package/dist/src/data/transforms/pileup.d.ts +3 -3
- package/dist/src/data/transforms/pileup.d.ts.map +1 -1
- package/dist/src/data/transforms/pileup.js +1 -1
- package/dist/src/data/transforms/pileup.test.js +1 -1
- package/dist/src/data/transforms/project.d.ts +2 -2
- package/dist/src/data/transforms/project.d.ts.map +1 -1
- package/dist/src/data/transforms/project.js +1 -1
- package/dist/src/data/transforms/project.test.js +1 -1
- package/dist/src/data/transforms/regexExtract.d.ts +2 -2
- package/dist/src/data/transforms/regexExtract.d.ts.map +1 -1
- package/dist/src/data/transforms/regexExtract.js +1 -1
- package/dist/src/data/transforms/regexExtract.test.js +3 -3
- package/dist/src/data/transforms/regexFold.d.ts +2 -2
- package/dist/src/data/transforms/regexFold.d.ts.map +1 -1
- package/dist/src/data/transforms/regexFold.js +2 -2
- package/dist/src/data/transforms/regexFold.test.js +3 -3
- package/dist/src/data/transforms/sample.d.ts +2 -2
- package/dist/src/data/transforms/sample.d.ts.map +1 -1
- package/dist/src/data/transforms/sample.js +2 -2
- package/dist/src/data/transforms/stack.d.ts +3 -3
- package/dist/src/data/transforms/stack.d.ts.map +1 -1
- package/dist/src/data/transforms/stack.js +2 -2
- package/dist/src/data/transforms/stack.test.js +2 -2
- package/dist/src/data/transforms/transformFactory.d.ts +5 -5
- package/dist/src/data/transforms/transformFactory.d.ts.map +1 -1
- package/dist/src/data/transforms/transformFactory.js +3 -3
- package/dist/src/encoder/accessor.d.ts +6 -6
- package/dist/src/encoder/accessor.d.ts.map +1 -1
- package/dist/src/encoder/accessor.js +4 -4
- package/dist/src/encoder/encoder.d.ts +59 -59
- package/dist/src/encoder/encoder.d.ts.map +1 -1
- package/dist/src/encoder/encoder.js +47 -42
- package/dist/src/encoder/encoder.test.js +4 -4
- package/dist/src/fonts/bmFontManager.d.ts +7 -7
- package/dist/src/fonts/bmFontManager.d.ts.map +1 -1
- package/dist/src/fonts/bmFontManager.js +3 -3
- package/dist/src/fonts/bmFontMetrics.d.ts +6 -6
- package/dist/src/fonts/bmFontMetrics.d.ts.map +1 -1
- package/dist/src/fonts/bmFontMetrics.js +4 -4
- package/dist/src/genome/genome.d.ts +7 -7
- package/dist/src/genome/genome.d.ts.map +1 -1
- package/dist/src/genome/genome.js +2 -2
- package/dist/src/genome/genomeStore.d.ts +2 -2
- package/dist/src/genome/genomeStore.d.ts.map +1 -1
- package/dist/src/genome/genomeStore.js +1 -1
- package/dist/src/genome/locusFormat.d.ts +7 -7
- package/dist/src/genome/locusFormat.d.ts.map +1 -1
- package/dist/src/genome/locusFormat.js +4 -4
- package/dist/src/genome/scaleIndex.d.ts +1 -1
- package/dist/src/genome/scaleIndex.d.ts.map +1 -1
- package/dist/src/genome/scaleIndex.js +1 -1
- package/dist/src/genome/scaleLocus.d.ts +2 -2
- package/dist/src/genome/scaleLocus.d.ts.map +1 -1
- package/dist/src/genome/scaleLocus.js +3 -3
- package/dist/src/genomeSpy.d.ts +12 -12
- package/dist/src/genomeSpy.d.ts.map +1 -1
- package/dist/src/genomeSpy.js +51 -34
- package/dist/src/gl/arrayBuilder.d.ts.map +1 -1
- package/dist/src/gl/dataToVertices.d.ts +19 -19
- package/dist/src/gl/dataToVertices.d.ts.map +1 -1
- package/dist/src/gl/dataToVertices.js +11 -11
- package/dist/src/gl/link.vertex.glsl.js +1 -1
- package/dist/src/gl/point.fragment.glsl.js +1 -1
- package/dist/src/gl/point.vertex.glsl.js +1 -1
- package/dist/src/gl/webGLHelper.d.ts +4 -4
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/marks/link.d.ts.map +1 -1
- package/dist/src/marks/link.js +35 -14
- package/dist/src/marks/mark.d.ts +35 -32
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +26 -23
- package/dist/src/marks/markUtils.d.ts +10 -10
- package/dist/src/marks/markUtils.d.ts.map +1 -1
- package/dist/src/marks/markUtils.js +5 -5
- package/dist/src/marks/pointMark.d.ts +1 -1
- package/dist/src/marks/pointMark.d.ts.map +1 -1
- package/dist/src/marks/pointMark.js +7 -7
- package/dist/src/marks/rectMark.d.ts +2 -2
- package/dist/src/marks/rectMark.d.ts.map +1 -1
- package/dist/src/marks/rectMark.js +7 -7
- package/dist/src/marks/rule.js +6 -6
- package/dist/src/marks/text.d.ts +1 -1
- package/dist/src/marks/text.d.ts.map +1 -1
- package/dist/src/marks/text.js +6 -6
- package/dist/src/scale/colorUtils.d.ts +4 -4
- package/dist/src/scale/colorUtils.d.ts.map +1 -1
- package/dist/src/scale/colorUtils.js +2 -2
- package/dist/src/scale/glslScaleGenerator.d.ts +3 -3
- package/dist/src/scale/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/scale/glslScaleGenerator.js +2 -2
- package/dist/src/scale/scale.d.ts +3 -3
- package/dist/src/scale/scale.d.ts.map +1 -1
- package/dist/src/scale/scale.js +2 -2
- package/dist/src/scale/ticks.d.ts +4 -4
- package/dist/src/scale/ticks.js +4 -4
- package/dist/src/spec/axis.d.ts +1 -1
- package/dist/src/spec/channel.d.ts +2 -2
- package/dist/src/spec/data.d.ts +2 -2
- package/dist/src/spec/mark.d.ts +36 -14
- package/dist/src/spec/root.d.ts +2 -2
- package/dist/src/spec/sampleView.d.ts +5 -5
- package/dist/src/spec/scale.d.ts +1 -1
- package/dist/src/spec/title.d.ts +1 -1
- package/dist/src/spec/view.d.ts +36 -9
- package/dist/src/tooltip/dataTooltipHandler.js +1 -1
- package/dist/src/tooltip/refseqGeneTooltipHandler.d.ts.map +1 -1
- package/dist/src/tooltip/refseqGeneTooltipHandler.js +1 -1
- package/dist/src/tooltip/tooltipHandler.d.ts +1 -1
- package/dist/src/tooltip/tooltipHandler.d.ts.map +1 -1
- package/dist/src/tooltip/tooltipHandler.ts +1 -1
- package/dist/src/types/embedApi.d.ts +3 -3
- package/dist/src/types/encoder.d.ts +4 -4
- package/dist/src/types/flowBatch.d.ts +1 -1
- package/dist/src/types/rendering.d.ts +3 -3
- package/dist/src/types/scaleResolutionApi.d.ts +2 -2
- package/dist/src/types/viewContext.d.ts +41 -12
- package/dist/src/utils/animator.d.ts +2 -2
- package/dist/src/utils/animator.d.ts.map +1 -1
- package/dist/src/utils/animator.js +1 -1
- package/dist/src/utils/inertia.d.ts +3 -3
- package/dist/src/utils/inertia.d.ts.map +1 -1
- package/dist/src/utils/inertia.js +1 -1
- package/dist/src/utils/interactionEvent.d.ts +5 -5
- package/dist/src/utils/interactionEvent.d.ts.map +1 -1
- package/dist/src/utils/interactionEvent.js +2 -2
- package/dist/src/utils/trees.js +1 -1
- package/dist/src/view/axisGridView.d.ts +17 -16
- package/dist/src/view/axisGridView.d.ts.map +1 -1
- package/dist/src/view/axisGridView.js +24 -20
- package/dist/src/view/axisResolution.d.ts +10 -10
- package/dist/src/view/axisResolution.d.ts.map +1 -1
- package/dist/src/view/axisResolution.js +6 -6
- package/dist/src/view/axisResolution.test.js +1 -1
- package/dist/src/view/axisView.d.ts +18 -17
- package/dist/src/view/axisView.d.ts.map +1 -1
- package/dist/src/view/axisView.js +39 -35
- package/dist/src/view/concatView.d.ts +5 -5
- package/dist/src/view/concatView.d.ts.map +1 -1
- package/dist/src/view/concatView.js +23 -23
- package/dist/src/view/containerView.d.ts +10 -8
- package/dist/src/view/containerView.d.ts.map +1 -1
- package/dist/src/view/containerView.js +18 -13
- package/dist/src/view/facetView.d.ts +12 -12
- package/dist/src/view/facetView.d.ts.map +1 -1
- package/dist/src/view/facetView.js +19 -19
- package/dist/src/view/flowBuilder.d.ts +4 -4
- package/dist/src/view/flowBuilder.d.ts.map +1 -1
- package/dist/src/view/flowBuilder.js +13 -13
- package/dist/src/view/flowBuilder.test.js +7 -7
- package/dist/src/view/gridView.d.ts +63 -35
- package/dist/src/view/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView.js +400 -113
- package/dist/src/view/layerView.d.ts +12 -14
- package/dist/src/view/layerView.d.ts.map +1 -1
- package/dist/src/view/layerView.js +55 -26
- package/dist/src/{utils → view}/layout/flexLayout.d.ts +6 -6
- package/dist/src/view/layout/flexLayout.d.ts.map +1 -0
- package/dist/src/{utils → view}/layout/flexLayout.js +4 -4
- package/dist/src/view/layout/grid.d.ts.map +1 -0
- package/dist/src/{utils → view}/layout/padding.d.ts +4 -4
- package/dist/src/view/layout/padding.d.ts.map +1 -0
- package/dist/src/{utils → view}/layout/padding.js +2 -2
- package/dist/src/view/layout/point.d.ts.map +1 -0
- package/dist/src/{utils → view}/layout/rectangle.d.ts +8 -2
- package/dist/src/view/layout/rectangle.d.ts.map +1 -0
- package/dist/src/{utils → view}/layout/rectangle.js +22 -2
- package/dist/src/{utils → view}/layout/rectangle.test.js +8 -0
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts +10 -10
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +10 -10
- package/dist/src/view/renderingContext/compositeViewRenderingContext.d.ts +2 -2
- package/dist/src/view/renderingContext/compositeViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/compositeViewRenderingContext.js +4 -4
- package/dist/src/view/renderingContext/debuggingViewRenderingContext.d.ts +4 -4
- package/dist/src/view/renderingContext/debuggingViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/debuggingViewRenderingContext.js +3 -3
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts +8 -8
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.js +4 -4
- package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts +6 -6
- package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/simpleViewRenderingContext.js +7 -7
- package/dist/src/view/renderingContext/svgViewRenderingContext.d.ts +4 -4
- package/dist/src/view/renderingContext/svgViewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/svgViewRenderingContext.js +6 -6
- package/dist/src/view/renderingContext/viewRenderingContext.d.ts +10 -10
- package/dist/src/view/renderingContext/viewRenderingContext.d.ts.map +1 -1
- package/dist/src/view/renderingContext/viewRenderingContext.js +5 -5
- package/dist/src/view/scaleResolution.d.ts +21 -17
- package/dist/src/view/scaleResolution.d.ts.map +1 -1
- package/dist/src/view/scaleResolution.js +33 -26
- package/dist/src/view/scaleResolution.test.js +57 -72
- package/dist/src/view/testUtils.d.ts +6 -15
- package/dist/src/view/testUtils.d.ts.map +1 -1
- package/dist/src/view/testUtils.js +40 -44
- package/dist/src/view/title.d.ts +3 -3
- package/dist/src/view/title.d.ts.map +1 -1
- package/dist/src/view/title.js +12 -12
- package/dist/src/view/unitView.d.ts +31 -30
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +30 -22
- package/dist/src/view/view.d.ts +86 -57
- package/dist/src/view/view.d.ts.map +1 -1
- package/dist/src/view/view.js +148 -103
- package/dist/src/view/view.test.js +9 -8
- package/dist/src/view/viewError.d.ts +9 -0
- package/dist/src/view/viewError.d.ts.map +1 -0
- package/dist/src/view/viewError.js +11 -0
- package/dist/src/view/viewFactory.d.ts +53 -20
- package/dist/src/view/viewFactory.d.ts.map +1 -1
- package/dist/src/view/viewFactory.js +148 -33
- package/dist/src/view/viewFactory.test.js +8 -0
- package/dist/src/view/viewUtils.d.ts +14 -12
- package/dist/src/view/viewUtils.d.ts.map +1 -1
- package/dist/src/view/viewUtils.js +10 -63
- package/dist/src/view/zoom.d.ts +4 -4
- package/dist/src/view/zoom.d.ts.map +1 -1
- package/dist/src/view/zoom.js +3 -3
- package/package.json +7 -5
- package/dist/src/utils/layout/flexLayout.d.ts.map +0 -1
- package/dist/src/utils/layout/grid.d.ts.map +0 -1
- package/dist/src/utils/layout/padding.d.ts.map +0 -1
- package/dist/src/utils/layout/point.d.ts.map +0 -1
- package/dist/src/utils/layout/rectangle.d.ts.map +0 -1
- package/dist/src/view/implicitRootView.d.ts +0 -9
- package/dist/src/view/implicitRootView.d.ts.map +0 -1
- package/dist/src/view/implicitRootView.js +0 -23
- package/dist/src/view/importView.d.ts +0 -17
- package/dist/src/view/importView.d.ts.map +0 -1
- package/dist/src/view/importView.js +0 -22
- /package/dist/src/{utils → view}/layout/flexLayout.test.js +0 -0
- /package/dist/src/{utils → view}/layout/grid.d.ts +0 -0
- /package/dist/src/{utils → view}/layout/grid.js +0 -0
- /package/dist/src/{utils → view}/layout/grid.test.js +0 -0
- /package/dist/src/{utils → view}/layout/point.d.ts +0 -0
- /package/dist/src/{utils → view}/layout/point.js +0 -0
|
@@ -7,14 +7,14 @@ import UnitView from "./unitView.js";
|
|
|
7
7
|
import { primaryPositionalChannels } from "../encoder/encoder.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @typedef {import("../spec/channel").Channel} Channel
|
|
10
|
+
* @typedef {import("../spec/channel.js").Channel} Channel
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
// NOTE: The most of these tests don't actually test scaleResolution but the resolution algorithm.
|
|
14
14
|
|
|
15
15
|
describe("Scale resolution", () => {
|
|
16
16
|
test("Channels with just values (no fields or scales) do not resolve", async () => {
|
|
17
|
-
/** @type {import("../spec/view").LayerSpec} */
|
|
17
|
+
/** @type {import("../spec/view.js").LayerSpec} */
|
|
18
18
|
const spec = {
|
|
19
19
|
data: { values: [] },
|
|
20
20
|
|
|
@@ -43,7 +43,7 @@ describe("Scale resolution", () => {
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
test("Deeply shared scales are shared", async () => {
|
|
46
|
-
/** @type {import("../spec/view").LayerSpec} */
|
|
46
|
+
/** @type {import("../spec/view.js").LayerSpec} */
|
|
47
47
|
const spec = {
|
|
48
48
|
data: { values: [] },
|
|
49
49
|
encoding: {
|
|
@@ -72,7 +72,7 @@ describe("Scale resolution", () => {
|
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
test("Shared branches under an independent branch works as expected", async () => {
|
|
75
|
-
/** @type {import("../spec/view").LayerSpec} */
|
|
75
|
+
/** @type {import("../spec/view.js").LayerSpec} */
|
|
76
76
|
const spec = {
|
|
77
77
|
data: { values: [] },
|
|
78
78
|
encoding: {
|
|
@@ -111,7 +111,7 @@ describe("Scale resolution", () => {
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
test("Independent branches under a shared branch works as expected", async () => {
|
|
114
|
-
/** @type {import("../spec/view").LayerSpec} */
|
|
114
|
+
/** @type {import("../spec/view.js").LayerSpec} */
|
|
115
115
|
const spec = {
|
|
116
116
|
data: { values: [] },
|
|
117
117
|
encoding: {
|
|
@@ -159,7 +159,7 @@ describe("Scale resolution", () => {
|
|
|
159
159
|
});
|
|
160
160
|
|
|
161
161
|
test("Excluded resolution is not pushed towards the root but collects from children.", async () => {
|
|
162
|
-
/** @type {import("../spec/view").LayerSpec} */
|
|
162
|
+
/** @type {import("../spec/view.js").LayerSpec} */
|
|
163
163
|
const spec = {
|
|
164
164
|
data: { values: [] },
|
|
165
165
|
encoding: {
|
|
@@ -202,7 +202,7 @@ describe("Scale resolution", () => {
|
|
|
202
202
|
// TODO: Add test for "forced" resolution
|
|
203
203
|
|
|
204
204
|
test("Default resolution is configurable", async () => {
|
|
205
|
-
/** @type {import("../spec/view").LayerSpec} */
|
|
205
|
+
/** @type {import("../spec/view.js").LayerSpec} */
|
|
206
206
|
const spec = {
|
|
207
207
|
data: { values: [] },
|
|
208
208
|
encoding: {
|
|
@@ -237,85 +237,67 @@ describe("Scale resolution", () => {
|
|
|
237
237
|
});
|
|
238
238
|
|
|
239
239
|
describe("Vertical and horizontal concatenations defaults resolutions for positional channels", async () => {
|
|
240
|
-
const makeTrack = (
|
|
241
|
-
/** @type {"x" | "y"} */ channel,
|
|
242
|
-
/** @type {"locus" | "index"} */ type
|
|
243
|
-
) => ({
|
|
244
|
-
mark: "point",
|
|
245
|
-
encoding: { [channel]: { field: "foo", type, axis: null } },
|
|
246
|
-
});
|
|
247
|
-
|
|
248
240
|
const create = async (
|
|
249
|
-
/** @type {"vconcat" | "hconcat"} */ viewType
|
|
250
|
-
/** @type {import("../spec/channel").Type[]} */ types
|
|
241
|
+
/** @type {"vconcat" | "hconcat" | "concat"} */ viewType
|
|
251
242
|
) => {
|
|
252
243
|
return await createAndInitialize(
|
|
253
244
|
{
|
|
254
245
|
data: { values: [] },
|
|
255
|
-
[viewType]:
|
|
256
|
-
|
|
257
|
-
|
|
246
|
+
[viewType]: [
|
|
247
|
+
{
|
|
248
|
+
mark: "point",
|
|
249
|
+
encoding: {
|
|
250
|
+
x: {
|
|
251
|
+
field: "foo",
|
|
252
|
+
type: "quantitative",
|
|
253
|
+
axis: null,
|
|
254
|
+
},
|
|
255
|
+
y: {
|
|
256
|
+
field: "foo",
|
|
257
|
+
type: "quantitative",
|
|
258
|
+
axis: null,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
],
|
|
258
263
|
},
|
|
259
264
|
ConcatView
|
|
260
265
|
);
|
|
261
266
|
};
|
|
262
267
|
|
|
263
|
-
|
|
264
|
-
expect(
|
|
265
|
-
(await create("vconcat", ["locus"])).getDefaultResolution(
|
|
266
|
-
"x",
|
|
267
|
-
"scale"
|
|
268
|
-
)
|
|
269
|
-
).toBe("shared");
|
|
270
|
-
});
|
|
268
|
+
const vconcat = await create("vconcat");
|
|
271
269
|
|
|
272
|
-
test('
|
|
273
|
-
expect(
|
|
274
|
-
(
|
|
275
|
-
await create("vconcat", ["locus", "locus"])
|
|
276
|
-
).getDefaultResolution("x", "scale")
|
|
277
|
-
).toBe("shared");
|
|
270
|
+
test('"x" of "vconcat" defaults to "shared"', () => {
|
|
271
|
+
expect(vconcat.getDefaultResolution("x", "scale")).toBe("shared");
|
|
278
272
|
});
|
|
279
273
|
|
|
280
|
-
test('
|
|
281
|
-
expect(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
"scale"
|
|
285
|
-
)
|
|
286
|
-
).toBe("shared");
|
|
274
|
+
test('"y" of "vconcat" defaults to "independent"', () => {
|
|
275
|
+
expect(vconcat.getDefaultResolution("y", "scale")).toBe(
|
|
276
|
+
"independent"
|
|
277
|
+
);
|
|
287
278
|
});
|
|
288
279
|
|
|
289
|
-
|
|
290
|
-
expect(
|
|
291
|
-
(
|
|
292
|
-
await create("vconcat", ["locus", "index"])
|
|
293
|
-
).getDefaultResolution("x", "scale")
|
|
294
|
-
).toBe("independent");
|
|
295
|
-
});
|
|
280
|
+
const hconcat = await create("hconcat");
|
|
296
281
|
|
|
297
|
-
test('
|
|
298
|
-
expect(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
).getDefaultResolution("x", "scale")
|
|
302
|
-
).toBe("independent");
|
|
282
|
+
test('"x" of "hconcat" defaults to "independent"', () => {
|
|
283
|
+
expect(hconcat.getDefaultResolution("x", "scale")).toBe(
|
|
284
|
+
"independent"
|
|
285
|
+
);
|
|
303
286
|
});
|
|
304
287
|
|
|
305
|
-
test('
|
|
306
|
-
expect(
|
|
307
|
-
(
|
|
308
|
-
await create("hconcat", ["quantitative", "quantitative"])
|
|
309
|
-
).getDefaultResolution("y", "scale")
|
|
310
|
-
).toBe("independent");
|
|
288
|
+
test('"y" of "hconcat" defaults to "shared"', () => {
|
|
289
|
+
expect(hconcat.getDefaultResolution("y", "scale")).toBe("shared");
|
|
311
290
|
});
|
|
312
291
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
)
|
|
292
|
+
const concat = await create("concat");
|
|
293
|
+
|
|
294
|
+
test('"x" and "y" of "concat" defaults to "independent"', () => {
|
|
295
|
+
expect(concat.getDefaultResolution("x", "scale")).toBe(
|
|
296
|
+
"independent"
|
|
297
|
+
);
|
|
298
|
+
expect(concat.getDefaultResolution("y", "scale")).toBe(
|
|
299
|
+
"independent"
|
|
300
|
+
);
|
|
319
301
|
});
|
|
320
302
|
});
|
|
321
303
|
});
|
|
@@ -352,7 +334,7 @@ describe("Domain handling", () => {
|
|
|
352
334
|
LayerView
|
|
353
335
|
);
|
|
354
336
|
|
|
355
|
-
/** @param {import("./view").default} view */
|
|
337
|
+
/** @param {import("./view.js").default} view */
|
|
356
338
|
const d = (view) => view.getScaleResolution("y").getScale().domain();
|
|
357
339
|
|
|
358
340
|
expect(r(d(view))).toEqual([1, 5]);
|
|
@@ -388,7 +370,7 @@ describe("Domain handling", () => {
|
|
|
388
370
|
LayerView
|
|
389
371
|
);
|
|
390
372
|
|
|
391
|
-
/** @param {import("./view").default} view */
|
|
373
|
+
/** @param {import("./view.js").default} view */
|
|
392
374
|
const d = (view) => view.getScaleResolution("y").getScale().domain();
|
|
393
375
|
|
|
394
376
|
expect(r(d(view))).toEqual([1, 5]);
|
|
@@ -420,7 +402,7 @@ describe("Domain handling", () => {
|
|
|
420
402
|
UnitView
|
|
421
403
|
);
|
|
422
404
|
|
|
423
|
-
/** @param {import("./view").default} view */
|
|
405
|
+
/** @param {import("./view.js").default} view */
|
|
424
406
|
const d = (view) => view.getScaleResolution("y").getScale().domain();
|
|
425
407
|
|
|
426
408
|
// FAILS!!!!!!! TODO: FIX!!
|
|
@@ -459,7 +441,7 @@ describe("Domain handling", () => {
|
|
|
459
441
|
LayerView
|
|
460
442
|
);
|
|
461
443
|
|
|
462
|
-
/** @param {import("./view").default} view */
|
|
444
|
+
/** @param {import("./view.js").default} view */
|
|
463
445
|
const d = (view) => view.getScaleResolution("y").getScale().domain();
|
|
464
446
|
|
|
465
447
|
expect(r(d(view))).toEqual([1, 5]);
|
|
@@ -485,7 +467,7 @@ describe("Domain handling", () => {
|
|
|
485
467
|
view.getScaleResolution(channel).reconfigure();
|
|
486
468
|
}
|
|
487
469
|
|
|
488
|
-
const d = /** @param {import("../spec/channel").Channel} channel*/ (
|
|
470
|
+
const d = /** @param {import("../spec/channel.js").Channel} channel*/ (
|
|
489
471
|
channel
|
|
490
472
|
) => view.getScaleResolution(channel).getScale().domain();
|
|
491
473
|
|
|
@@ -626,7 +608,10 @@ describe("Named scales", () => {
|
|
|
626
608
|
return expect(
|
|
627
609
|
createAndInitialize(
|
|
628
610
|
{
|
|
629
|
-
resolve: {
|
|
611
|
+
resolve: {
|
|
612
|
+
scale: { x: "independent" },
|
|
613
|
+
axis: { x: "independent" },
|
|
614
|
+
},
|
|
630
615
|
data: { values: [1, 2] },
|
|
631
616
|
layer: [
|
|
632
617
|
{
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {Partial<ViewContext>} partialContext
|
|
2
|
+
* @param {import("./viewFactory.js").ViewFactoryOptions} [viewFactoryOptions]
|
|
4
3
|
* @returns
|
|
5
4
|
*/
|
|
6
|
-
export function createTestViewContext(
|
|
7
|
-
export function create<V extends
|
|
8
|
-
export function createAndInitialize<V extends
|
|
5
|
+
export function createTestViewContext(viewFactoryOptions?: import("./viewFactory.js").ViewFactoryOptions): import("../types/viewContext.js").default;
|
|
6
|
+
export function create<V extends import("./view.js").default>(spec: ViewSpec, viewClass: new (...args: any[]) => V, ViewFactoryOptions?: import("./viewFactory.js").ViewFactoryOptions): Promise<V>;
|
|
7
|
+
export function createAndInitialize<V extends import("./view.js").default>(spec: ViewSpec, viewClass: new (...args: any[]) => V, context?: ViewContext, options?: {
|
|
9
8
|
noData: boolean;
|
|
10
9
|
implicitRoot: boolean;
|
|
11
10
|
}): Promise<V>;
|
|
12
|
-
/**
|
|
13
|
-
* Creates a view and wraps it in an implicit root view if needed.
|
|
14
|
-
* Does not initialize data.
|
|
15
|
-
*
|
|
16
|
-
* @param {ViewSpec} spec
|
|
17
|
-
*/
|
|
18
|
-
export function createAndWrap(spec: ViewSpec): Promise<View>;
|
|
19
11
|
/**
|
|
20
12
|
* Utils for Jest tests
|
|
21
13
|
* TODO: Find a better place and convention
|
|
22
14
|
*/
|
|
23
|
-
export type ViewSpec = import("../spec/view").ViewSpec;
|
|
15
|
+
export type ViewSpec = import("../spec/view.js").ViewSpec;
|
|
24
16
|
/**
|
|
25
17
|
* Utils for Jest tests
|
|
26
18
|
* TODO: Find a better place and convention
|
|
27
19
|
*/
|
|
28
|
-
export type ViewContext = import("../types/viewContext").default;
|
|
29
|
-
import View from "./view.js";
|
|
20
|
+
export type ViewContext = import("../types/viewContext.js").default;
|
|
30
21
|
//# sourceMappingURL=testUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testUtils.d.ts","sourceRoot":"","sources":["../../../src/view/testUtils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testUtils.d.ts","sourceRoot":"","sources":["../../../src/view/testUtils.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH,2DAHW,OAAO,kBAAkB,EAAE,kBAAkB,6CAqDvD;AAGS,oEAA8C,QAAQ,2BAA4B,GAAG,EAAE,6BAA6B,OAAO,kBAAkB,EAAE,kBAAkB,cAAe;AAgBhL,iFAA8C,QAAQ,2BAA4B,GAAG,EAAE,kBAAkB,WAAW,YAAY;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAC,cAAe;;;;;uBApFpL,OAAO,iBAAiB,EAAE,QAAQ;;;;;0BAClC,OAAO,yBAAyB,EAAE,OAAO"}
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
* Utils for Jest tests
|
|
3
3
|
* TODO: Find a better place and convention
|
|
4
4
|
*
|
|
5
|
-
* @typedef {import("../spec/view").ViewSpec} ViewSpec
|
|
6
|
-
* @typedef {import("../types/viewContext").default} ViewContext
|
|
5
|
+
* @typedef {import("../spec/view.js").ViewSpec} ViewSpec
|
|
6
|
+
* @typedef {import("../types/viewContext.js").default} ViewContext
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { checkForDuplicateScaleNames, initializeData } from "./viewUtils.js";
|
|
10
10
|
import AccessorFactory from "../encoder/accessor.js";
|
|
11
11
|
import DataFlow from "../data/dataFlow.js";
|
|
12
|
-
import { ViewFactory } from "./viewFactory.js";
|
|
12
|
+
import { VIEW_ROOT_NAME, ViewFactory } from "./viewFactory.js";
|
|
13
13
|
import GenomeStore from "../genome/genomeStore.js";
|
|
14
|
-
import ImplicitRootView from "./implicitRootView.js";
|
|
15
|
-
import View from "./view.js";
|
|
16
14
|
import BmFontManager from "../fonts/bmFontManager.js";
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param {Partial<ViewContext>} partialContext
|
|
17
|
+
* @param {import("./viewFactory.js").ViewFactoryOptions} [viewFactoryOptions]
|
|
21
18
|
* @returns
|
|
22
19
|
*/
|
|
23
|
-
export function createTestViewContext(
|
|
24
|
-
const
|
|
20
|
+
export function createTestViewContext(viewFactoryOptions = {}) {
|
|
21
|
+
const viewFactory = new ViewFactory({
|
|
22
|
+
allowImport: false,
|
|
23
|
+
wrapRoot: false,
|
|
24
|
+
...viewFactoryOptions,
|
|
25
|
+
});
|
|
25
26
|
|
|
26
27
|
const genomeStore = new GenomeStore(".");
|
|
27
28
|
genomeStore.initialize({
|
|
@@ -32,11 +33,27 @@ export function createTestViewContext(partialContext = {}) {
|
|
|
32
33
|
],
|
|
33
34
|
});
|
|
34
35
|
|
|
36
|
+
// @ts-expect-error
|
|
35
37
|
const c = /** @type {ViewContext} */ ({
|
|
36
38
|
accessorFactory: new AccessorFactory(),
|
|
37
39
|
|
|
38
40
|
createView: function (spec, parent, defaultName) {
|
|
39
|
-
|
|
41
|
+
throw new Error("Not implemented: createView");
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
createOrImportView: async function (
|
|
45
|
+
spec,
|
|
46
|
+
parent,
|
|
47
|
+
dataParent,
|
|
48
|
+
defaultName
|
|
49
|
+
) {
|
|
50
|
+
return viewFactory.createOrImportView(
|
|
51
|
+
spec,
|
|
52
|
+
this,
|
|
53
|
+
parent,
|
|
54
|
+
dataParent,
|
|
55
|
+
defaultName
|
|
56
|
+
);
|
|
40
57
|
},
|
|
41
58
|
|
|
42
59
|
dataFlow: new DataFlow(),
|
|
@@ -46,16 +63,18 @@ export function createTestViewContext(partialContext = {}) {
|
|
|
46
63
|
|
|
47
64
|
isViewConfiguredVisible: () => true,
|
|
48
65
|
|
|
49
|
-
|
|
66
|
+
//...partialContext,
|
|
50
67
|
});
|
|
51
68
|
|
|
52
69
|
return c;
|
|
53
70
|
}
|
|
54
71
|
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
/**
|
|
73
|
+
* @type {<V extends import("./view.js").default>(spec: ViewSpec, viewClass: { new(...args: any[]): V }, ViewFactoryOptions?: import("./viewFactory.js").ViewFactoryOptions) => Promise<V>}
|
|
74
|
+
*/
|
|
75
|
+
export async function create(spec, viewClass, viewFactoryOptions = {}) {
|
|
76
|
+
const c = createTestViewContext(viewFactoryOptions);
|
|
77
|
+
const view = await c.createOrImportView(spec, null, null, VIEW_ROOT_NAME);
|
|
59
78
|
|
|
60
79
|
if (!(view instanceof viewClass)) {
|
|
61
80
|
throw new Error("ViewClass and the spec do not match!");
|
|
@@ -67,35 +86,12 @@ export function create(spec, viewClass, context = undefined) {
|
|
|
67
86
|
/**
|
|
68
87
|
* Creates a view and initializes its data. Does not wrap it in an implicit root view.
|
|
69
88
|
*
|
|
70
|
-
* @type {<V extends
|
|
89
|
+
* @type {<V extends import("./view.js").default>(spec: ViewSpec, viewClass: { new(...args: any[]): V }, context?: ViewContext, options?: {noData: boolean, implicitRoot: boolean}) => Promise<V>}
|
|
71
90
|
*/
|
|
72
|
-
export async function createAndInitialize(
|
|
73
|
-
spec,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
options = { noData: false, implicitRoot: false }
|
|
77
|
-
) {
|
|
78
|
-
const view = create(spec, viewClass, context);
|
|
79
|
-
|
|
80
|
-
resolveScalesAndAxes(view);
|
|
91
|
+
export async function createAndInitialize(spec, viewClass) {
|
|
92
|
+
const view = await create(spec, viewClass);
|
|
93
|
+
|
|
94
|
+
checkForDuplicateScaleNames(view);
|
|
81
95
|
await initializeData(view, view.context.dataFlow);
|
|
82
96
|
return view;
|
|
83
97
|
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Creates a view and wraps it in an implicit root view if needed.
|
|
87
|
-
* Does not initialize data.
|
|
88
|
-
*
|
|
89
|
-
* @param {ViewSpec} spec
|
|
90
|
-
*/
|
|
91
|
-
export async function createAndWrap(spec) {
|
|
92
|
-
const view = create(spec, View);
|
|
93
|
-
|
|
94
|
-
const root =
|
|
95
|
-
view.needsAxes.x || view.needsAxes.y
|
|
96
|
-
? new ImplicitRootView(view.context, view)
|
|
97
|
-
: view;
|
|
98
|
-
|
|
99
|
-
resolveScalesAndAxes(root);
|
|
100
|
-
return root;
|
|
101
|
-
}
|
package/dist/src/view/title.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {string | import("../spec/title").Title} title
|
|
3
|
-
* @returns {import("../spec/view").UnitSpec}
|
|
2
|
+
* @param {string | import("../spec/title.js").Title} title
|
|
3
|
+
* @returns {import("../spec/view.js").UnitSpec}
|
|
4
4
|
*/
|
|
5
|
-
export default function createTitle(title: string | import("../spec/title").Title): import("../spec/view").UnitSpec;
|
|
5
|
+
export default function createTitle(title: string | import("../spec/title.js").Title): import("../spec/view.js").UnitSpec;
|
|
6
6
|
//# sourceMappingURL=title.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../src/view/title.js"],"names":[],"mappings":"AAuDA;;;GAGG;AACH,2CAHW,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../src/view/title.js"],"names":[],"mappings":"AAuDA;;;GAGG;AACH,2CAHW,MAAM,GAAG,OAAO,kBAAkB,EAAE,KAAK,GACvC,OAAO,iBAAiB,EAAE,QAAQ,CA2G9C"}
|
package/dist/src/view/title.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isString } from "vega-util";
|
|
2
2
|
|
|
3
|
-
/** @type {Omit<Required<import("../spec/title").Title>, "text" | "style">} */
|
|
3
|
+
/** @type {Omit<Required<import("../spec/title.js").Title>, "text" | "style">} */
|
|
4
4
|
const BASE_TITLE_STYLE = {
|
|
5
5
|
anchor: "middle",
|
|
6
6
|
frame: "group",
|
|
@@ -18,7 +18,7 @@ const BASE_TITLE_STYLE = {
|
|
|
18
18
|
fontWeight: "normal",
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
/** @type {Partial<import("../spec/title").Title>} */
|
|
21
|
+
/** @type {Partial<import("../spec/title.js").Title>} */
|
|
22
22
|
const TRACK_TITLE_STYLE = {
|
|
23
23
|
orient: "left",
|
|
24
24
|
anchor: "middle",
|
|
@@ -28,7 +28,7 @@ const TRACK_TITLE_STYLE = {
|
|
|
28
28
|
fontSize: 12,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
/** @type {Partial<import("../spec/title").Title>} */
|
|
31
|
+
/** @type {Partial<import("../spec/title.js").Title>} */
|
|
32
32
|
const OVERLAY_TITLE_STYLE = {
|
|
33
33
|
orient: "top",
|
|
34
34
|
anchor: "start",
|
|
@@ -39,14 +39,14 @@ const OVERLAY_TITLE_STYLE = {
|
|
|
39
39
|
fontSize: 12,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
/** @type {Record<import("../spec/title").TitleAnchor, number>} */
|
|
42
|
+
/** @type {Record<import("../spec/title.js").TitleAnchor, number>} */
|
|
43
43
|
const ANCHORS = {
|
|
44
44
|
start: 0,
|
|
45
45
|
middle: 0.5,
|
|
46
46
|
end: 1,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
/** @type {Record<import("../spec/title").TitleAnchor, import("../spec/font").Align>} */
|
|
49
|
+
/** @type {Record<import("../spec/title.js").TitleAnchor, import("../spec/font.js").Align>} */
|
|
50
50
|
const ANCHOR_TO_ALIGN = {
|
|
51
51
|
start: "left",
|
|
52
52
|
middle: "center",
|
|
@@ -54,15 +54,15 @@ const ANCHOR_TO_ALIGN = {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* @param {string | import("../spec/title").Title} title
|
|
58
|
-
* @returns {import("../spec/view").UnitSpec}
|
|
57
|
+
* @param {string | import("../spec/title.js").Title} title
|
|
58
|
+
* @returns {import("../spec/view.js").UnitSpec}
|
|
59
59
|
*/
|
|
60
60
|
export default function createTitle(title) {
|
|
61
61
|
if (!title) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
/** @type {import("../spec/title").Title} */
|
|
65
|
+
/** @type {import("../spec/title.js").Title} */
|
|
66
66
|
const titleSpec = isString(title) ? { text: title } : title;
|
|
67
67
|
|
|
68
68
|
if (!titleSpec.text || titleSpec.orient == "none") {
|
|
@@ -70,7 +70,7 @@ export default function createTitle(title) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
// TODO: Make these configurable
|
|
73
|
-
/** @type {Partial<import("../spec/title").Title>} */
|
|
73
|
+
/** @type {Partial<import("../spec/title.js").Title>} */
|
|
74
74
|
const config =
|
|
75
75
|
{
|
|
76
76
|
"track-title": TRACK_TITLE_STYLE,
|
|
@@ -79,14 +79,14 @@ export default function createTitle(title) {
|
|
|
79
79
|
|
|
80
80
|
// TODO: frame prop
|
|
81
81
|
|
|
82
|
-
/** @type {import("../spec/title").Title} */
|
|
82
|
+
/** @type {import("../spec/title.js").Title} */
|
|
83
83
|
const preliminarySpec = {
|
|
84
84
|
...BASE_TITLE_STYLE,
|
|
85
85
|
...config,
|
|
86
86
|
...titleSpec,
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
/** @type {Partial<import("../spec/title").Title>} */
|
|
89
|
+
/** @type {Partial<import("../spec/title.js").Title>} */
|
|
90
90
|
let orientConfig = {};
|
|
91
91
|
let xy = { x: 0, y: 0 };
|
|
92
92
|
|
|
@@ -112,7 +112,7 @@ export default function createTitle(title) {
|
|
|
112
112
|
default:
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
/** @type {import("../spec/title").Title} */
|
|
115
|
+
/** @type {import("../spec/title.js").Title} */
|
|
116
116
|
const spec = {
|
|
117
117
|
...BASE_TITLE_STYLE,
|
|
118
118
|
...orientConfig,
|
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* @type {Object.<string, typeof import("../marks/mark").default>}
|
|
3
|
+
* @type {Object.<string, typeof import("../marks/mark.js").default>}
|
|
4
4
|
* TODO: Find a proper place, make extendible
|
|
5
5
|
*/
|
|
6
6
|
export const markTypes: {
|
|
7
|
-
[x: string]: typeof import("../marks/mark").default;
|
|
7
|
+
[x: string]: typeof import("../marks/mark.js").default;
|
|
8
8
|
};
|
|
9
9
|
export default class UnitView extends ContainerView {
|
|
10
10
|
/**
|
|
11
|
-
* @typedef {import("../spec/channel").Channel} Channel
|
|
12
|
-
* @typedef {import("./view").default} View
|
|
13
|
-
* @typedef {import("./layerView").default} LayerView
|
|
14
|
-
* @typedef {import("../utils/domainArray").DomainArray} DomainArray
|
|
15
|
-
* @typedef {import("../spec/view").ResolutionTarget} ResolutionTarget
|
|
11
|
+
* @typedef {import("../spec/channel.js").Channel} Channel
|
|
12
|
+
* @typedef {import("./view.js").default} View
|
|
13
|
+
* @typedef {import("./layerView.js").default} LayerView
|
|
14
|
+
* @typedef {import("../utils/domainArray.js").DomainArray} DomainArray
|
|
15
|
+
* @typedef {import("../spec/view.js").ResolutionTarget} ResolutionTarget
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
/**
|
|
19
19
|
*
|
|
20
|
-
* @param {import("../spec/view").UnitSpec} spec
|
|
21
|
-
* @param {import("../types/viewContext").default} context
|
|
22
|
-
* @param {import("./containerView").default} layoutParent
|
|
23
|
-
* @param {import("./view").default} dataParent
|
|
20
|
+
* @param {import("../spec/view.js").UnitSpec} spec
|
|
21
|
+
* @param {import("../types/viewContext.js").default} context
|
|
22
|
+
* @param {import("./containerView.js").default} layoutParent
|
|
23
|
+
* @param {import("./view.js").default} dataParent
|
|
24
24
|
* @param {string} name
|
|
25
|
+
* @param {import("./view.js").ViewOptions} [options]
|
|
25
26
|
*/
|
|
26
|
-
constructor(spec: import("../spec/view").UnitSpec, context: import("../types/viewContext").default, layoutParent: import("./containerView").default, dataParent: import("./view").default, name: string);
|
|
27
|
-
spec: import("../spec/view").UnitSpec;
|
|
28
|
-
/** @type {import("../marks/mark").default} */
|
|
29
|
-
mark: import("../marks/mark").default;
|
|
27
|
+
constructor(spec: import("../spec/view.js").UnitSpec, context: import("../types/viewContext.js").default, layoutParent: import("./containerView.js").default, dataParent: import("./view.js").default, name: string, options?: import("./view.js").ViewOptions);
|
|
28
|
+
spec: import("../spec/view.js").UnitSpec;
|
|
29
|
+
/** @type {import("../marks/mark.js").default} */
|
|
30
|
+
mark: import("../marks/mark.js").default;
|
|
30
31
|
/**
|
|
31
32
|
* Not nice! Inconsistent when faceting!
|
|
32
33
|
* TODO: Something. Maybe store only width/height
|
|
33
|
-
* @type {import("
|
|
34
|
+
* @type {import("./layout/rectangle.js").default}
|
|
34
35
|
*/
|
|
35
|
-
coords: import("
|
|
36
|
+
coords: import("./layout/rectangle.js").default;
|
|
36
37
|
/**
|
|
37
|
-
* @param {import("./renderingContext/viewRenderingContext").default} context
|
|
38
|
-
* @param {import("
|
|
39
|
-
* @param {import("../types/rendering").RenderingOptions} [options]
|
|
38
|
+
* @param {import("./renderingContext/viewRenderingContext.js").default} context
|
|
39
|
+
* @param {import("./layout/rectangle.js").default} coords
|
|
40
|
+
* @param {import("../types/rendering.js").RenderingOptions} [options]
|
|
40
41
|
*/
|
|
41
|
-
render(context: import("./renderingContext/viewRenderingContext").default, coords: import("
|
|
42
|
+
render(context: import("./renderingContext/viewRenderingContext.js").default, coords: import("./layout/rectangle.js").default, options?: import("../types/rendering.js").RenderingOptions): void;
|
|
42
43
|
getMarkType(): import("../spec/mark.js").MarkType;
|
|
43
44
|
/**
|
|
44
45
|
* Pulls scales and axes up in the view hierarcy according to the resolution rules, using dataParents.
|
|
45
46
|
* TODO: legends
|
|
46
47
|
*
|
|
47
|
-
* @param {ResolutionTarget} type
|
|
48
|
+
* @param {ResolutionTarget} [type] If not specified, both scales and axes are resolved.
|
|
48
49
|
*/
|
|
49
|
-
resolve(type
|
|
50
|
+
resolve(type?: import("../spec/view.js").ResolutionTarget): void;
|
|
50
51
|
/**
|
|
51
52
|
*
|
|
52
53
|
* @param {Channel} channel
|
|
53
54
|
*/
|
|
54
|
-
getAccessor(channel: import("../spec/channel").Channel): import("../types/encoder.js").Accessor;
|
|
55
|
+
getAccessor(channel: import("../spec/channel.js").Channel): import("../types/encoder.js").Accessor;
|
|
55
56
|
/**
|
|
56
57
|
* Returns a collector that is associated with this view.
|
|
57
58
|
*/
|
|
@@ -59,14 +60,14 @@ export default class UnitView extends ContainerView {
|
|
|
59
60
|
/**
|
|
60
61
|
* @param {Channel} channel A primary channel
|
|
61
62
|
*/
|
|
62
|
-
_validateDomainQuery(channel: import("../spec/channel").Channel): import("../spec/channel").ChromPosDef | import("../spec/channel").PositionDatumDef | import("../spec/channel").MarkPropExprDef<import("../spec/channel").Type> | import("../spec/channel").MarkPropDatumDef<import("../spec/channel").Type> | import("../spec/channel").MarkPropDatumDef<import("../spec/channel").TypeForShape> | import("../spec/channel").PositionFieldDef<string> | import("../spec/channel").MarkPropFieldDef<string, import("../spec/channel").Type> | import("../spec/channel").MarkPropFieldDef<string, import("../spec/channel").TypeForShape>;
|
|
63
|
+
_validateDomainQuery(channel: import("../spec/channel.js").Channel): import("../spec/channel.js").ChromPosDef | import("../spec/channel.js").PositionDatumDef | import("../spec/channel.js").MarkPropExprDef<import("../spec/channel.js").Type> | import("../spec/channel.js").MarkPropDatumDef<import("../spec/channel.js").Type> | import("../spec/channel.js").MarkPropDatumDef<import("../spec/channel.js").TypeForShape> | import("../spec/channel.js").PositionFieldDef<string> | import("../spec/channel.js").MarkPropFieldDef<string, import("../spec/channel.js").Type> | import("../spec/channel.js").MarkPropFieldDef<string, import("../spec/channel.js").TypeForShape>;
|
|
63
64
|
/**
|
|
64
65
|
* Returns the domain of the specified channel of this domain/mark.
|
|
65
66
|
*
|
|
66
|
-
* @param {import("../spec/channel").ChannelWithScale} channel A primary channel
|
|
67
|
+
* @param {import("../spec/channel.js").ChannelWithScale} channel A primary channel
|
|
67
68
|
* @returns {DomainArray}
|
|
68
69
|
*/
|
|
69
|
-
getConfiguredDomain(channel: import("../spec/channel").ChannelWithScale): import("../utils/domainArray.js").DomainArray;
|
|
70
|
+
getConfiguredDomain(channel: import("../spec/channel.js").ChannelWithScale): import("../utils/domainArray.js").DomainArray;
|
|
70
71
|
/**
|
|
71
72
|
* Extracts the domain from the data.
|
|
72
73
|
*
|
|
@@ -80,14 +81,14 @@ export default class UnitView extends ContainerView {
|
|
|
80
81
|
* @param {Channel} channel
|
|
81
82
|
* @returns {DomainArray}
|
|
82
83
|
*/
|
|
83
|
-
extractDataDomain(channel: import("../spec/channel").Channel): import("../utils/domainArray.js").DomainArray;
|
|
84
|
+
extractDataDomain(channel: import("../spec/channel.js").Channel): import("../utils/domainArray.js").DomainArray;
|
|
84
85
|
getZoomLevel(): number;
|
|
85
86
|
/**
|
|
86
87
|
* @param {string} channel
|
|
87
88
|
* @param {ResolutionTarget} resolutionType
|
|
88
|
-
* @returns {import("../spec/view").ResolutionBehavior}
|
|
89
|
+
* @returns {import("../spec/view.js").ResolutionBehavior}
|
|
89
90
|
*/
|
|
90
|
-
getDefaultResolution(channel: string, resolutionType: import("../spec/view").ResolutionTarget): import("../spec/view").ResolutionBehavior;
|
|
91
|
+
getDefaultResolution(channel: string, resolutionType: import("../spec/view.js").ResolutionTarget): import("../spec/view.js").ResolutionBehavior;
|
|
91
92
|
}
|
|
92
93
|
import ContainerView from "./containerView.js";
|
|
93
94
|
//# sourceMappingURL=unitView.d.ts.map
|