@genome-spy/core 0.36.1 → 0.37.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/README.md +1 -0
- package/dist/{index.es.js → bundled/index.es.js} +2253 -2115
- package/dist/{index.js → bundled/index.js} +180 -44
- package/dist/src/data/collector.d.ts +36 -0
- package/dist/src/data/collector.d.ts.map +1 -0
- package/dist/src/data/collector.js +184 -0
- package/dist/src/data/collector.test.js +84 -0
- package/dist/src/data/dataFlow.d.ts +65 -0
- package/dist/src/data/dataFlow.d.ts.map +1 -0
- package/dist/src/data/dataFlow.js +142 -0
- package/dist/src/data/dataFlow.test.js +5 -0
- package/dist/src/data/facetNode.d.ts +17 -0
- package/dist/src/data/facetNode.d.ts.map +1 -0
- package/dist/src/data/facetNode.js +17 -0
- package/dist/src/data/flow.test.js +72 -0
- package/dist/src/data/flowNode.d.ts +136 -0
- package/dist/src/data/flowNode.d.ts.map +1 -0
- package/dist/src/data/flowNode.js +286 -0
- package/dist/src/data/flowNode.test.js +50 -0
- package/dist/src/data/flowOptimizer.d.ts +27 -0
- package/dist/src/data/flowOptimizer.d.ts.map +1 -0
- package/dist/src/data/flowOptimizer.js +133 -0
- package/dist/src/data/flowOptimizer.test.js +193 -0
- package/dist/src/data/flowTestUtils.d.ts +30 -0
- package/dist/src/data/flowTestUtils.d.ts.map +1 -0
- package/dist/src/data/flowTestUtils.js +63 -0
- package/dist/src/data/formats/fasta.d.ts +20 -0
- package/dist/src/data/formats/fasta.d.ts.map +1 -0
- package/dist/src/data/formats/fasta.js +32 -0
- package/dist/src/data/formats/fasta.test.js +27 -0
- package/dist/src/data/sources/dataSource.d.ts +12 -0
- package/dist/src/data/sources/dataSource.d.ts.map +1 -0
- package/dist/src/data/sources/dataSource.js +25 -0
- package/dist/src/data/sources/dataSourceFactory.d.ts +16 -0
- package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -0
- package/dist/src/data/sources/dataSourceFactory.js +127 -0
- package/dist/src/data/sources/dataUtils.d.ts +50 -0
- package/dist/src/data/sources/dataUtils.d.ts.map +1 -0
- package/dist/src/data/sources/dataUtils.js +83 -0
- package/dist/src/data/sources/dynamic/README.md +3 -0
- package/dist/src/data/sources/dynamic/axisGenomeSource.d.ts +13 -0
- package/dist/src/data/sources/dynamic/axisGenomeSource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/axisGenomeSource.js +19 -0
- package/dist/src/data/sources/dynamic/axisTickSource.d.ts +18 -0
- package/dist/src/data/sources/dynamic/axisTickSource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/axisTickSource.js +73 -0
- package/dist/src/data/sources/dynamic/bamSource.d.ts +46 -0
- package/dist/src/data/sources/dynamic/bamSource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/bamSource.js +115 -0
- package/dist/src/data/sources/dynamic/bigBedSource.d.ts +51 -0
- package/dist/src/data/sources/dynamic/bigBedSource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/bigBedSource.js +128 -0
- package/dist/src/data/sources/dynamic/bigWigSource.d.ts +58 -0
- package/dist/src/data/sources/dynamic/bigWigSource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/bigWigSource.js +166 -0
- package/dist/src/data/sources/dynamic/gff3Source.d.ts +8 -0
- package/dist/src/data/sources/dynamic/gff3Source.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/gff3Source.js +19 -0
- package/dist/src/data/sources/dynamic/indexedFastaSource.d.ts +30 -0
- package/dist/src/data/sources/dynamic/indexedFastaSource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/indexedFastaSource.js +86 -0
- package/dist/src/data/sources/dynamic/singleAxisLazySource.d.ts +42 -0
- package/dist/src/data/sources/dynamic/singleAxisLazySource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/singleAxisLazySource.js +129 -0
- package/dist/src/data/sources/dynamic/tabixSource.d.ts +54 -0
- package/dist/src/data/sources/dynamic/tabixSource.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/tabixSource.js +140 -0
- package/dist/src/data/sources/dynamic/windowedMixin.d.ts +32 -0
- package/dist/src/data/sources/dynamic/windowedMixin.d.ts.map +1 -0
- package/dist/src/data/sources/dynamic/windowedMixin.js +53 -0
- package/dist/src/data/sources/inlineSource.d.ts +16 -0
- package/dist/src/data/sources/inlineSource.d.ts.map +1 -0
- package/dist/src/data/sources/inlineSource.js +68 -0
- package/dist/src/data/sources/inlineSource.test.js +56 -0
- package/dist/src/data/sources/namedSource.d.ts +25 -0
- package/dist/src/data/sources/namedSource.d.ts.map +1 -0
- package/dist/src/data/sources/namedSource.js +80 -0
- package/dist/src/data/sources/sequenceSource.d.ts +17 -0
- package/dist/src/data/sources/sequenceSource.d.ts.map +1 -0
- package/dist/src/data/sources/sequenceSource.js +47 -0
- package/dist/src/data/sources/sequenceSource.test.js +46 -0
- package/dist/src/data/sources/urlSource.d.ts +16 -0
- package/dist/src/data/sources/urlSource.d.ts.map +1 -0
- package/dist/src/data/sources/urlSource.js +74 -0
- package/dist/src/data/transforms/aggregate.d.ts +18 -0
- package/dist/src/data/transforms/aggregate.d.ts.map +1 -0
- package/dist/src/data/transforms/aggregate.js +67 -0
- package/dist/src/data/transforms/clone.d.ts +15 -0
- package/dist/src/data/transforms/clone.d.ts.map +1 -0
- package/dist/src/data/transforms/clone.js +40 -0
- package/dist/src/data/transforms/clone.test.js +11 -0
- package/dist/src/data/transforms/coverage.d.ts +30 -0
- package/dist/src/data/transforms/coverage.d.ts.map +1 -0
- package/dist/src/data/transforms/coverage.js +183 -0
- package/dist/src/data/transforms/coverage.test.js +123 -0
- package/dist/src/data/transforms/filter.d.ts +12 -0
- package/dist/src/data/transforms/filter.d.ts.map +1 -0
- package/dist/src/data/transforms/filter.js +33 -0
- package/dist/src/data/transforms/filter.test.js +18 -0
- package/dist/src/data/transforms/filterScoredLabels.d.ts +29 -0
- package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -0
- package/dist/src/data/transforms/filterScoredLabels.js +134 -0
- package/dist/src/data/transforms/flatten.d.ts +10 -0
- package/dist/src/data/transforms/flatten.d.ts.map +1 -0
- package/dist/src/data/transforms/flatten.js +68 -0
- package/dist/src/data/transforms/flatten.test.js +93 -0
- package/dist/src/data/transforms/flattenCompressedExons.d.ts +19 -0
- package/dist/src/data/transforms/flattenCompressedExons.d.ts.map +1 -0
- package/dist/src/data/transforms/flattenCompressedExons.js +53 -0
- package/dist/src/data/transforms/flattenDelimited.d.ts +10 -0
- package/dist/src/data/transforms/flattenDelimited.d.ts.map +1 -0
- package/dist/src/data/transforms/flattenDelimited.js +66 -0
- package/dist/src/data/transforms/flattenDelimited.test.js +87 -0
- package/dist/src/data/transforms/flattenSequence.d.ts +11 -0
- package/dist/src/data/transforms/flattenSequence.d.ts.map +1 -0
- package/dist/src/data/transforms/flattenSequence.js +35 -0
- package/dist/src/data/transforms/flattenSequence.test.js +34 -0
- package/dist/src/data/transforms/formula.d.ts +13 -0
- package/dist/src/data/transforms/formula.d.ts.map +1 -0
- package/dist/src/data/transforms/formula.js +35 -0
- package/dist/src/data/transforms/formula.test.js +19 -0
- package/dist/src/data/transforms/identifier.d.ts +40 -0
- package/dist/src/data/transforms/identifier.d.ts.map +1 -0
- package/dist/src/data/transforms/identifier.js +106 -0
- package/dist/src/data/transforms/identifier.test.js +83 -0
- package/dist/src/data/transforms/linearizeGenomicCoordinate.d.ts +10 -0
- package/dist/src/data/transforms/linearizeGenomicCoordinate.d.ts.map +1 -0
- package/dist/src/data/transforms/linearizeGenomicCoordinate.js +97 -0
- package/dist/src/data/transforms/measureText.d.ts +18 -0
- package/dist/src/data/transforms/measureText.d.ts.map +1 -0
- package/dist/src/data/transforms/measureText.js +42 -0
- package/dist/src/data/transforms/pileup.d.ts +10 -0
- package/dist/src/data/transforms/pileup.d.ts.map +1 -0
- package/dist/src/data/transforms/pileup.js +126 -0
- package/dist/src/data/transforms/pileup.test.js +70 -0
- package/dist/src/data/transforms/project.d.ts +13 -0
- package/dist/src/data/transforms/project.d.ts.map +1 -0
- package/dist/src/data/transforms/project.js +38 -0
- package/dist/src/data/transforms/project.test.js +32 -0
- package/dist/src/data/transforms/regexExtract.d.ts +13 -0
- package/dist/src/data/transforms/regexExtract.d.ts.map +1 -0
- package/dist/src/data/transforms/regexExtract.js +57 -0
- package/dist/src/data/transforms/regexExtract.test.js +67 -0
- package/dist/src/data/transforms/regexFold.d.ts +14 -0
- package/dist/src/data/transforms/regexFold.d.ts.map +1 -0
- package/dist/src/data/transforms/regexFold.js +139 -0
- package/dist/src/data/transforms/regexFold.test.js +160 -0
- package/dist/src/data/transforms/sample.d.ts +42 -0
- package/dist/src/data/transforms/sample.d.ts.map +1 -0
- package/dist/src/data/transforms/sample.js +99 -0
- package/dist/src/data/transforms/sample.test.js +38 -0
- package/dist/src/data/transforms/stack.d.ts +11 -0
- package/dist/src/data/transforms/stack.d.ts.map +1 -0
- package/dist/src/data/transforms/stack.js +134 -0
- package/dist/src/data/transforms/stack.test.js +91 -0
- package/dist/src/data/transforms/transformFactory.d.ts +12 -0
- package/dist/src/data/transforms/transformFactory.d.ts.map +1 -0
- package/dist/src/data/transforms/transformFactory.js +59 -0
- package/dist/src/encoder/accessor.d.ts +15 -0
- package/dist/src/encoder/accessor.d.ts.map +1 -0
- package/dist/src/encoder/accessor.js +76 -0
- package/dist/src/encoder/accessor.test.js +47 -0
- package/dist/src/encoder/encoder.d.ts +144 -0
- package/dist/src/encoder/encoder.d.ts.map +1 -0
- package/dist/src/encoder/encoder.js +400 -0
- package/dist/src/encoder/encoder.test.js +98 -0
- package/dist/src/fonts/Lato-Regular.json +1267 -0
- package/dist/src/fonts/Lato-Regular.png +0 -0
- package/dist/src/fonts/OFL.txt +93 -0
- package/dist/src/fonts/README.md +3 -0
- package/dist/src/fonts/bmFontManager.d.ts +182 -0
- package/dist/src/fonts/bmFontManager.d.ts.map +1 -0
- package/dist/src/fonts/bmFontManager.js +359 -0
- package/dist/src/fonts/bmFontMetrics.d.ts +45 -0
- package/dist/src/fonts/bmFontMetrics.d.ts.map +1 -0
- package/dist/src/fonts/bmFontMetrics.js +108 -0
- package/dist/src/genome/genome.d.ts +172 -0
- package/dist/src/genome/genome.d.ts.map +1 -0
- package/dist/src/genome/genome.js +379 -0
- package/dist/src/genome/genome.test.js +226 -0
- package/dist/src/genome/genomeStore.d.ts +20 -0
- package/dist/src/genome/genomeStore.d.ts.map +1 -0
- package/dist/src/genome/genomeStore.js +54 -0
- package/dist/src/genome/locusFormat.d.ts +14 -0
- package/dist/src/genome/locusFormat.d.ts.map +1 -0
- package/dist/src/genome/locusFormat.js +37 -0
- package/dist/src/genome/scaleIndex.d.ts +6 -0
- package/dist/src/genome/scaleIndex.d.ts.map +1 -0
- package/dist/src/genome/scaleIndex.js +165 -0
- package/dist/src/genome/scaleIndex.test.js +78 -0
- package/dist/src/genome/scaleLocus.d.ts +3 -0
- package/dist/src/genome/scaleLocus.d.ts.map +1 -0
- package/dist/src/genome/scaleLocus.js +101 -0
- package/dist/src/genome/scaleLocus.test.js +4 -0
- package/dist/src/genomeSpy.d.ts +141 -0
- package/dist/src/genomeSpy.d.ts.map +1 -0
- package/dist/src/genomeSpy.js +788 -0
- package/dist/src/gl/arrayBuilder.d.ts +71 -0
- package/dist/src/gl/arrayBuilder.d.ts.map +1 -0
- package/dist/src/gl/arrayBuilder.js +199 -0
- package/dist/src/gl/dataToVertices.d.ts +194 -0
- package/dist/src/gl/dataToVertices.d.ts.map +1 -0
- package/dist/src/gl/dataToVertices.js +639 -0
- package/dist/src/gl/includes/common.glsl.js +2 -0
- package/dist/src/gl/includes/picking.fragment.glsl.js +2 -0
- package/dist/src/gl/includes/picking.vertex.glsl.js +2 -0
- package/dist/src/gl/includes/sampleFacet.glsl.js +2 -0
- package/dist/src/gl/includes/scales.glsl.js +2 -0
- package/dist/src/gl/link.fragment.glsl.js +2 -0
- package/dist/src/gl/link.vertex.glsl.js +2 -0
- package/dist/src/gl/point.fragment.glsl.js +2 -0
- package/dist/src/gl/point.vertex.glsl.js +2 -0
- package/dist/src/gl/rect.fragment.glsl.js +2 -0
- package/dist/src/gl/rect.vertex.glsl.js +2 -0
- package/dist/src/gl/rule.fragment.glsl.js +2 -0
- package/dist/src/gl/rule.vertex.glsl.js +2 -0
- package/dist/src/gl/text.fragment.glsl.js +2 -0
- package/dist/src/gl/text.vertex.glsl.js +2 -0
- package/dist/src/gl/webGLHelper.d.ts +118 -0
- package/dist/src/gl/webGLHelper.d.ts.map +1 -0
- package/dist/src/gl/webGLHelper.js +513 -0
- package/dist/src/img/bowtie.svg +1 -0
- package/dist/src/img/genomespy-favicon.svg +34 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.html +11 -0
- package/dist/src/index.js +129 -0
- package/dist/src/marks/link.d.ts +11 -0
- package/dist/src/marks/link.d.ts.map +1 -0
- package/dist/src/marks/link.js +175 -0
- package/dist/src/marks/mark.d.ts +226 -0
- package/dist/src/marks/mark.d.ts.map +1 -0
- package/dist/src/marks/mark.js +1004 -0
- package/dist/src/marks/markUtils.d.ts +23 -0
- package/dist/src/marks/markUtils.d.ts.map +1 -0
- package/dist/src/marks/markUtils.js +125 -0
- package/dist/src/marks/pointMark.d.ts +11 -0
- package/dist/src/marks/pointMark.d.ts.map +1 -0
- package/dist/src/marks/pointMark.js +251 -0
- package/dist/src/marks/rectMark.d.ts +18 -0
- package/dist/src/marks/rectMark.d.ts.map +1 -0
- package/dist/src/marks/rectMark.js +255 -0
- package/dist/src/marks/rule.d.ts +6 -0
- package/dist/src/marks/rule.d.ts.map +1 -0
- package/dist/src/marks/rule.js +250 -0
- package/dist/src/marks/text.d.ts +13 -0
- package/dist/src/marks/text.d.ts.map +1 -0
- package/dist/src/marks/text.js +279 -0
- package/dist/src/scale/colorUtils.d.ts +34 -0
- package/dist/src/scale/colorUtils.d.ts.map +1 -0
- package/dist/src/scale/colorUtils.js +184 -0
- package/dist/src/scale/glslScaleGenerator.d.ts +45 -0
- package/dist/src/scale/glslScaleGenerator.d.ts.map +1 -0
- package/dist/src/scale/glslScaleGenerator.js +506 -0
- package/dist/src/scale/scale.d.ts +10 -0
- package/dist/src/scale/scale.d.ts.map +1 -0
- package/dist/src/scale/scale.js +456 -0
- package/dist/src/scale/scale.test.js +324 -0
- package/dist/src/scale/ticks.d.ts +47 -0
- package/dist/src/scale/ticks.d.ts.map +1 -0
- package/dist/src/scale/ticks.js +203 -0
- package/dist/src/scale/ticks.test.js +40 -0
- package/dist/src/singlePageApp.d.ts +2 -0
- package/dist/src/singlePageApp.d.ts.map +1 -0
- package/dist/src/singlePageApp.js +13 -0
- package/dist/src/spec/axis.d.ts +402 -0
- package/dist/src/spec/channel.d.ts +440 -0
- package/dist/src/spec/data.d.ts +370 -0
- package/dist/src/spec/font.d.ts +15 -0
- package/dist/src/spec/genome.d.ts +35 -0
- package/dist/src/spec/mark.d.ts +435 -0
- package/dist/src/spec/root.d.ts +22 -0
- package/dist/src/spec/sampleView.d.ts +185 -0
- package/dist/src/spec/scale.d.ts +273 -0
- package/dist/src/spec/title.d.ts +102 -0
- package/dist/src/spec/tooltip.d.ts +9 -0
- package/dist/src/spec/transform.d.ts +504 -0
- package/dist/src/spec/view.d.ts +214 -0
- package/dist/src/styles/genome-spy.css.d.ts +3 -0
- package/dist/src/styles/genome-spy.css.d.ts.map +1 -0
- package/dist/src/styles/genome-spy.css.js +114 -0
- package/dist/src/styles/genome-spy.scss +153 -0
- package/dist/src/tooltip/dataTooltipHandler.d.ts +2 -0
- package/dist/src/tooltip/dataTooltipHandler.d.ts.map +1 -0
- package/dist/src/tooltip/dataTooltipHandler.js +64 -0
- package/dist/src/tooltip/refseqGeneTooltipHandler.d.ts +2 -0
- package/dist/src/tooltip/refseqGeneTooltipHandler.d.ts.map +1 -0
- package/dist/src/tooltip/refseqGeneTooltipHandler.js +78 -0
- package/dist/src/tooltip/tooltipHandler.d.ts +9 -0
- package/dist/src/tooltip/tooltipHandler.d.ts.map +1 -0
- package/dist/src/tooltip/tooltipHandler.ts +12 -0
- package/dist/src/types/bmFont.d.ts +58 -0
- package/dist/src/types/embedApi.d.ts +67 -0
- package/dist/src/types/encoder.d.ts +84 -0
- package/dist/src/types/flowBatch.d.ts +40 -0
- package/dist/src/types/rendering.d.ts +65 -0
- package/dist/src/types/scaleResolutionApi.d.ts +40 -0
- package/dist/src/types/viewContext.d.ts +85 -0
- package/dist/src/utils/addBaseUrl.d.ts +6 -0
- package/dist/src/utils/addBaseUrl.d.ts.map +1 -0
- package/dist/src/utils/addBaseUrl.js +19 -0
- package/dist/src/utils/addBaseUrl.test.js +22 -0
- package/dist/src/utils/animator.d.ts +41 -0
- package/dist/src/utils/animator.d.ts.map +1 -0
- package/dist/src/utils/animator.js +83 -0
- package/dist/src/utils/arrayUtils.d.ts +34 -0
- package/dist/src/utils/arrayUtils.d.ts.map +1 -0
- package/dist/src/utils/arrayUtils.js +61 -0
- package/dist/src/utils/binnedIndex.d.ts +23 -0
- package/dist/src/utils/binnedIndex.d.ts.map +1 -0
- package/dist/src/utils/binnedIndex.js +167 -0
- package/dist/src/utils/binnedIndex.test.js +155 -0
- package/dist/src/utils/clamp.d.ts +7 -0
- package/dist/src/utils/clamp.d.ts.map +1 -0
- package/dist/src/utils/clamp.js +8 -0
- package/dist/src/utils/cloner.d.ts +16 -0
- package/dist/src/utils/cloner.d.ts.map +1 -0
- package/dist/src/utils/cloner.js +34 -0
- package/dist/src/utils/cloner.test.js +24 -0
- package/dist/src/utils/coalesce.d.ts +6 -0
- package/dist/src/utils/coalesce.d.ts.map +1 -0
- package/dist/src/utils/coalesce.js +11 -0
- package/dist/src/utils/coalesce.test.js +16 -0
- package/dist/src/utils/concatIterables.d.ts +8 -0
- package/dist/src/utils/concatIterables.d.ts.map +1 -0
- package/dist/src/utils/concatIterables.js +26 -0
- package/dist/src/utils/concatIterables.test.js +8 -0
- package/dist/src/utils/debounce.d.ts +8 -0
- package/dist/src/utils/debounce.d.ts.map +1 -0
- package/dist/src/utils/debounce.js +37 -0
- package/dist/src/utils/domainArray.d.ts +61 -0
- package/dist/src/utils/domainArray.d.ts.map +1 -0
- package/dist/src/utils/domainArray.js +216 -0
- package/dist/src/utils/domainArray.test.js +130 -0
- package/dist/src/utils/eerp.d.ts +12 -0
- package/dist/src/utils/eerp.d.ts.map +1 -0
- package/dist/src/utils/eerp.js +13 -0
- package/dist/src/utils/expression.d.ts +9 -0
- package/dist/src/utils/expression.d.ts.map +1 -0
- package/dist/src/utils/expression.js +32 -0
- package/dist/src/utils/field.d.ts +17 -0
- package/dist/src/utils/field.d.ts.map +1 -0
- package/dist/src/utils/field.js +28 -0
- package/dist/src/utils/formatObject.d.ts +7 -0
- package/dist/src/utils/formatObject.d.ts.map +1 -0
- package/dist/src/utils/formatObject.js +37 -0
- package/dist/src/utils/indexer.d.ts +16 -0
- package/dist/src/utils/indexer.d.ts.map +1 -0
- package/dist/src/utils/indexer.js +43 -0
- package/dist/src/utils/indexer.test.js +47 -0
- package/dist/src/utils/inertia.d.ts +42 -0
- package/dist/src/utils/inertia.d.ts.map +1 -0
- package/dist/src/utils/inertia.js +124 -0
- package/dist/src/utils/interactionEvent.d.ts +26 -0
- package/dist/src/utils/interactionEvent.d.ts.map +1 -0
- package/dist/src/utils/interactionEvent.js +33 -0
- package/dist/src/utils/iterateNestedMaps.d.ts +11 -0
- package/dist/src/utils/iterateNestedMaps.d.ts.map +1 -0
- package/dist/src/utils/iterateNestedMaps.js +21 -0
- package/dist/src/utils/iterateNestedMaps.test.js +33 -0
- package/dist/src/utils/kWayMerge.d.ts +9 -0
- package/dist/src/utils/kWayMerge.d.ts.map +1 -0
- package/dist/src/utils/kWayMerge.js +42 -0
- package/dist/src/utils/kWayMerge.test.js +26 -0
- package/dist/src/utils/layout/flexLayout.d.ts +182 -0
- package/dist/src/utils/layout/flexLayout.d.ts.map +1 -0
- package/dist/src/utils/layout/flexLayout.js +381 -0
- package/dist/src/utils/layout/flexLayout.test.js +323 -0
- package/dist/src/utils/layout/grid.d.ts +29 -0
- package/dist/src/utils/layout/grid.d.ts.map +1 -0
- package/dist/src/utils/layout/grid.js +95 -0
- package/dist/src/utils/layout/grid.test.js +71 -0
- package/dist/src/utils/layout/padding.d.ts +83 -0
- package/dist/src/utils/layout/padding.d.ts.map +1 -0
- package/dist/src/utils/layout/padding.js +155 -0
- package/dist/src/utils/layout/point.d.ts +16 -0
- package/dist/src/utils/layout/point.d.ts.map +1 -0
- package/dist/src/utils/layout/point.js +23 -0
- package/dist/src/utils/layout/rectangle.d.ts +142 -0
- package/dist/src/utils/layout/rectangle.d.ts.map +1 -0
- package/dist/src/utils/layout/rectangle.js +296 -0
- package/dist/src/utils/layout/rectangle.test.js +172 -0
- package/dist/src/utils/mergeObjects.d.ts +15 -0
- package/dist/src/utils/mergeObjects.d.ts.map +1 -0
- package/dist/src/utils/mergeObjects.js +99 -0
- package/dist/src/utils/mergeObjects.test.js +42 -0
- package/dist/src/utils/numberExtractor.d.ts +9 -0
- package/dist/src/utils/numberExtractor.d.ts.map +1 -0
- package/dist/src/utils/numberExtractor.js +24 -0
- package/dist/src/utils/numberExtractor.test.js +6 -0
- package/dist/src/utils/point.d.ts +9 -0
- package/dist/src/utils/point.d.ts.map +1 -0
- package/dist/src/utils/point.js +14 -0
- package/dist/src/utils/propertyCacher.d.ts +30 -0
- package/dist/src/utils/propertyCacher.d.ts.map +1 -0
- package/dist/src/utils/propertyCacher.js +70 -0
- package/dist/src/utils/propertyCacher.test.js +85 -0
- package/dist/src/utils/propertyCoalescer.d.ts +15 -0
- package/dist/src/utils/propertyCoalescer.d.ts.map +1 -0
- package/dist/src/utils/propertyCoalescer.js +42 -0
- package/dist/src/utils/propertyCoalescer.test.js +22 -0
- package/dist/src/utils/reservationMap.d.ts +42 -0
- package/dist/src/utils/reservationMap.d.ts.map +1 -0
- package/dist/src/utils/reservationMap.js +103 -0
- package/dist/src/utils/reservationMap.test.js +20 -0
- package/dist/src/utils/scaleNull.d.ts +13 -0
- package/dist/src/utils/scaleNull.d.ts.map +1 -0
- package/dist/src/utils/scaleNull.js +21 -0
- package/dist/src/utils/setOperations.d.ts +31 -0
- package/dist/src/utils/setOperations.d.ts.map +1 -0
- package/dist/src/utils/setOperations.js +75 -0
- package/dist/src/utils/smoothstep.d.ts +7 -0
- package/dist/src/utils/smoothstep.d.ts.map +1 -0
- package/dist/src/utils/smoothstep.js +10 -0
- package/dist/src/utils/throttle.d.ts +8 -0
- package/dist/src/utils/throttle.d.ts.map +1 -0
- package/dist/src/utils/throttle.js +34 -0
- package/dist/src/utils/topK.d.ts +22 -0
- package/dist/src/utils/topK.d.ts.map +1 -0
- package/dist/src/utils/topK.js +76 -0
- package/dist/src/utils/topK.test.js +64 -0
- package/dist/src/utils/transition.d.ts +44 -0
- package/dist/src/utils/transition.d.ts.map +1 -0
- package/dist/src/utils/transition.js +74 -0
- package/dist/src/utils/trees.d.ts +56 -0
- package/dist/src/utils/trees.d.ts.map +1 -0
- package/dist/src/utils/trees.js +92 -0
- package/dist/src/utils/trees.test.js +130 -0
- package/dist/src/utils/ui/tooltip.d.ts +50 -0
- package/dist/src/utils/ui/tooltip.d.ts.map +1 -0
- package/dist/src/utils/ui/tooltip.js +189 -0
- package/dist/src/utils/url.d.ts +9 -0
- package/dist/src/utils/url.d.ts.map +1 -0
- package/dist/src/utils/url.js +22 -0
- package/dist/src/utils/variableTools.d.ts +14 -0
- package/dist/src/utils/variableTools.d.ts.map +1 -0
- package/dist/src/utils/variableTools.js +24 -0
- package/dist/src/utils/variableTools.test.js +13 -0
- package/dist/src/view/axisGridView.d.ts +39 -0
- package/dist/src/view/axisGridView.d.ts.map +1 -0
- package/dist/src/view/axisGridView.js +246 -0
- package/dist/src/view/axisResolution.d.ts +24 -0
- package/dist/src/view/axisResolution.d.ts.map +1 -0
- package/dist/src/view/axisResolution.js +141 -0
- package/dist/src/view/axisResolution.test.js +201 -0
- package/dist/src/view/axisView.d.ts +49 -0
- package/dist/src/view/axisView.d.ts.map +1 -0
- package/dist/src/view/axisView.js +629 -0
- package/dist/src/view/concatView.d.ts +16 -0
- package/dist/src/view/concatView.d.ts.map +1 -0
- package/dist/src/view/concatView.js +84 -0
- package/dist/src/view/containerView.d.ts +43 -0
- package/dist/src/view/containerView.d.ts.map +1 -0
- package/dist/src/view/containerView.js +137 -0
- package/dist/src/view/facetView.d.ts +71 -0
- package/dist/src/view/facetView.d.ts.map +1 -0
- package/dist/src/view/facetView.js +492 -0
- package/dist/src/view/flowBuilder.d.ts +37 -0
- package/dist/src/view/flowBuilder.d.ts.map +1 -0
- package/dist/src/view/flowBuilder.js +383 -0
- package/dist/src/view/flowBuilder.test.js +125 -0
- package/dist/src/view/gridView.d.ts +111 -0
- package/dist/src/view/gridView.d.ts.map +1 -0
- package/dist/src/view/gridView.js +1086 -0
- package/dist/src/view/implicitRootView.d.ts +9 -0
- package/dist/src/view/implicitRootView.d.ts.map +1 -0
- package/dist/src/view/implicitRootView.js +23 -0
- package/dist/src/view/importView.d.ts +17 -0
- package/dist/src/view/importView.d.ts.map +1 -0
- package/dist/src/view/importView.js +22 -0
- package/dist/src/view/layerView.d.ts +25 -0
- package/dist/src/view/layerView.d.ts.map +1 -0
- package/dist/src/view/layerView.js +77 -0
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts +30 -0
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -0
- package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +175 -0
- package/dist/src/view/renderingContext/compositeViewRenderingContext.d.ts +14 -0
- package/dist/src/view/renderingContext/compositeViewRenderingContext.d.ts.map +1 -0
- package/dist/src/view/renderingContext/compositeViewRenderingContext.js +51 -0
- package/dist/src/view/renderingContext/debuggingViewRenderingContext.d.ts +51 -0
- package/dist/src/view/renderingContext/debuggingViewRenderingContext.d.ts.map +1 -0
- package/dist/src/view/renderingContext/debuggingViewRenderingContext.js +94 -0
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts +60 -0
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.d.ts.map +1 -0
- package/dist/src/view/renderingContext/layoutRecorderViewRenderingContext.js +128 -0
- package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts +19 -0
- package/dist/src/view/renderingContext/simpleViewRenderingContext.d.ts.map +1 -0
- package/dist/src/view/renderingContext/simpleViewRenderingContext.js +64 -0
- package/dist/src/view/renderingContext/svgViewRenderingContext.d.ts +22 -0
- package/dist/src/view/renderingContext/svgViewRenderingContext.d.ts.map +1 -0
- package/dist/src/view/renderingContext/svgViewRenderingContext.js +125 -0
- package/dist/src/view/renderingContext/viewRenderingContext.d.ts +33 -0
- package/dist/src/view/renderingContext/viewRenderingContext.d.ts.map +1 -0
- package/dist/src/view/renderingContext/viewRenderingContext.js +41 -0
- package/dist/src/view/scaleResolution.d.ts +170 -0
- package/dist/src/view/scaleResolution.d.ts.map +1 -0
- package/dist/src/view/scaleResolution.js +874 -0
- package/dist/src/view/scaleResolution.test.js +658 -0
- package/dist/src/view/testUtils.d.ts +30 -0
- package/dist/src/view/testUtils.d.ts.map +1 -0
- package/dist/src/view/testUtils.js +101 -0
- package/dist/src/view/title.d.ts +6 -0
- package/dist/src/view/title.d.ts.map +1 -0
- package/dist/src/view/title.js +165 -0
- package/dist/src/view/unitView.d.ts +93 -0
- package/dist/src/view/unitView.d.ts.map +1 -0
- package/dist/src/view/unitView.js +345 -0
- package/dist/src/view/view.d.ts +291 -0
- package/dist/src/view/view.d.ts.map +1 -0
- package/dist/src/view/view.js +691 -0
- package/dist/src/view/view.test.js +214 -0
- package/dist/src/view/viewFactory.d.ts +76 -0
- package/dist/src/view/viewFactory.d.ts.map +1 -0
- package/dist/src/view/viewFactory.js +178 -0
- package/dist/src/view/viewFactory.test.js +17 -0
- package/dist/src/view/viewUtils.d.ts +90 -0
- package/dist/src/view/viewUtils.d.ts.map +1 -0
- package/dist/src/view/viewUtils.js +326 -0
- package/dist/src/view/zoom.d.ts +23 -0
- package/dist/src/view/zoom.d.ts.map +1 -0
- package/dist/src/view/zoom.js +89 -0
- package/package.json +15 -12
- package/dist/style.css +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Rendering context that doesn't render anything. It creates a hierarchy
|
|
3
|
+
* of view coordinates, including faceted views that are repeated multiple times.
|
|
4
|
+
* The coordinates can be used for mouse events / interactions, for example.
|
|
5
|
+
*
|
|
6
|
+
* @typedef {import("../view").default} View
|
|
7
|
+
* @typedef {import("../../utils/layout/rectangle").default} Rectangle
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export default class LayoutRecorderViewRenderingContext extends ViewRenderingContext {
|
|
11
|
+
/** @type {ViewCoords} */
|
|
12
|
+
root: ViewCoords;
|
|
13
|
+
/** @type {ViewCoords[]} */
|
|
14
|
+
stack: ViewCoords[];
|
|
15
|
+
/** @type {ViewCoords} */
|
|
16
|
+
lastAddition: ViewCoords;
|
|
17
|
+
getLayout(): ViewCoords;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A Rendering context that doesn't render anything. It creates a hierarchy
|
|
21
|
+
* of view coordinates, including faceted views that are repeated multiple times.
|
|
22
|
+
* The coordinates can be used for mouse events / interactions, for example.
|
|
23
|
+
*/
|
|
24
|
+
export type View = import("../view").default;
|
|
25
|
+
/**
|
|
26
|
+
* A Rendering context that doesn't render anything. It creates a hierarchy
|
|
27
|
+
* of view coordinates, including faceted views that are repeated multiple times.
|
|
28
|
+
* The coordinates can be used for mouse events / interactions, for example.
|
|
29
|
+
*/
|
|
30
|
+
export type Rectangle = import("../../utils/layout/rectangle").default;
|
|
31
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
32
|
+
/**
|
|
33
|
+
* Represents coordinates of view instances. Faceted views objects may have
|
|
34
|
+
* been rendered at multiple locations.
|
|
35
|
+
*/
|
|
36
|
+
declare class ViewCoords {
|
|
37
|
+
/**
|
|
38
|
+
* @param {View} view
|
|
39
|
+
* @param {Rectangle} coords
|
|
40
|
+
*/
|
|
41
|
+
constructor(view: View, coords: Rectangle);
|
|
42
|
+
view: import("../view").default;
|
|
43
|
+
coords: import("../../utils/layout/rectangle").default;
|
|
44
|
+
/** @type {ViewCoords[]} */
|
|
45
|
+
children: ViewCoords[];
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param {ViewCoords} viewCoords
|
|
49
|
+
*/
|
|
50
|
+
addChild(viewCoords: ViewCoords): void;
|
|
51
|
+
/**
|
|
52
|
+
* Broadcasts a message to views that include the given (x, y) point.
|
|
53
|
+
* This is mainly intended for mouse events.
|
|
54
|
+
*
|
|
55
|
+
* @param {import("../../utils/interactionEvent").default} event
|
|
56
|
+
*/
|
|
57
|
+
dispatchInteractionEvent(event: import("../../utils/interactionEvent").default): void;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=layoutRecorderViewRenderingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layoutRecorderViewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/layoutRecorderViewRenderingContext.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH;IAOQ,yBAAyB;IACzB,MADW,UAAU,CACA;IAErB,2BAA2B;IAC3B,OADW,UAAU,EAAE,CACR;IAEf,yBAAyB;IACzB,cADW,UAAU,CACQ;IAgCjC,wBAEC;CACJ;;;;;;mBArDY,OAAO,SAAS,EAAE,OAAO;;;;;;wBACzB,OAAO,8BAA8B,EAAE,OAAO;iCAR1B,wBAAwB;AA8DzD;;;GAGG;AACH;IACI;;;OAGG;IACH,kBAHW,IAAI,UACJ,SAAS,EAOnB;IAJG,gCAAgB;IAChB,uDAAoB;IACpB,2BAA2B;IAC3B,UADW,UAAU,EAAE,CACL;IAGtB;;;OAGG;IACH,qBAFW,UAAU,QAcpB;IAED;;;;;OAKG;IACH,gCAFW,OAAO,8BAA8B,EAAE,OAAO,QAyBxD;CACJ"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { peek } from "../../utils/arrayUtils";
|
|
2
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A Rendering context that doesn't render anything. It creates a hierarchy
|
|
6
|
+
* of view coordinates, including faceted views that are repeated multiple times.
|
|
7
|
+
* The coordinates can be used for mouse events / interactions, for example.
|
|
8
|
+
*
|
|
9
|
+
* @typedef {import("../view").default} View
|
|
10
|
+
* @typedef {import("../../utils/layout/rectangle").default} Rectangle
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export default class LayoutRecorderViewRenderingContext extends ViewRenderingContext {
|
|
14
|
+
/**
|
|
15
|
+
* @param {import("../../types/rendering").GlobalRenderingOptions} globalOptions
|
|
16
|
+
*/
|
|
17
|
+
constructor(globalOptions) {
|
|
18
|
+
super(globalOptions);
|
|
19
|
+
|
|
20
|
+
/** @type {ViewCoords} */
|
|
21
|
+
this.root = undefined;
|
|
22
|
+
|
|
23
|
+
/** @type {ViewCoords[]} */
|
|
24
|
+
this.stack = [];
|
|
25
|
+
|
|
26
|
+
/** @type {ViewCoords} */
|
|
27
|
+
this.lastAddition = undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Must be called when a view's render() method is entered
|
|
32
|
+
*
|
|
33
|
+
* @param {View} view
|
|
34
|
+
* @param {Rectangle} coords View coordinates
|
|
35
|
+
* inside the padding.
|
|
36
|
+
*/
|
|
37
|
+
pushView(view, coords) {
|
|
38
|
+
// TODO: Facet id
|
|
39
|
+
|
|
40
|
+
const viewCoords = new ViewCoords(view, coords);
|
|
41
|
+
|
|
42
|
+
if (!this.root) {
|
|
43
|
+
this.root = viewCoords;
|
|
44
|
+
} else {
|
|
45
|
+
peek(this.stack).addChild(viewCoords);
|
|
46
|
+
}
|
|
47
|
+
this.stack.push(viewCoords);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Must be called when a view's render() method is being exited
|
|
52
|
+
*
|
|
53
|
+
* @param {View} view
|
|
54
|
+
*/
|
|
55
|
+
popView(view) {
|
|
56
|
+
this.stack.pop();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
getLayout() {
|
|
60
|
+
return this.root;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Represents coordinates of view instances. Faceted views objects may have
|
|
66
|
+
* been rendered at multiple locations.
|
|
67
|
+
*/
|
|
68
|
+
class ViewCoords {
|
|
69
|
+
/**
|
|
70
|
+
* @param {View} view
|
|
71
|
+
* @param {Rectangle} coords
|
|
72
|
+
*/
|
|
73
|
+
constructor(view, coords) {
|
|
74
|
+
this.view = view;
|
|
75
|
+
this.coords = coords;
|
|
76
|
+
/** @type {ViewCoords[]} */
|
|
77
|
+
this.children = [];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param {ViewCoords} viewCoords
|
|
83
|
+
*/
|
|
84
|
+
addChild(viewCoords) {
|
|
85
|
+
const last = peek(this.children);
|
|
86
|
+
if (
|
|
87
|
+
last &&
|
|
88
|
+
viewCoords.view === last.view &&
|
|
89
|
+
viewCoords.coords.equals(last.coords)
|
|
90
|
+
) {
|
|
91
|
+
// Skip extra copies of sample facets. They all have the same coords.
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
this.children.push(viewCoords);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Broadcasts a message to views that include the given (x, y) point.
|
|
100
|
+
* This is mainly intended for mouse events.
|
|
101
|
+
*
|
|
102
|
+
* @param {import("../../utils/interactionEvent").default} event
|
|
103
|
+
*/
|
|
104
|
+
dispatchInteractionEvent(event) {
|
|
105
|
+
if (this.coords.containsPoint(event.point.x, event.point.y)) {
|
|
106
|
+
this.view.handleInteractionEvent(this.coords, event, true);
|
|
107
|
+
if (event.stopped) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (this.children.length == 0) {
|
|
112
|
+
event.target = this.view;
|
|
113
|
+
} else {
|
|
114
|
+
for (const child of this.children) {
|
|
115
|
+
child.dispatchInteractionEvent(event);
|
|
116
|
+
if (event.target) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
if (event.stopped) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
this.view.handleInteractionEvent(this.coords, event, false);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class is mainly for illustrative purpose, i.e., how the rendering
|
|
3
|
+
* would be performed in the most straightforward, unoptimized way.
|
|
4
|
+
*
|
|
5
|
+
* @typedef {import("../view").default} View
|
|
6
|
+
*/
|
|
7
|
+
export default class SimpleViewRenderingContext extends ViewRenderingContext {
|
|
8
|
+
/** @type {import("../../utils/layout/rectangle").default} */
|
|
9
|
+
coords: import("../../utils/layout/rectangle").default;
|
|
10
|
+
/** @type {Set<import("../view").default>} */
|
|
11
|
+
views: Set<import("../view").default>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This class is mainly for illustrative purpose, i.e., how the rendering
|
|
15
|
+
* would be performed in the most straightforward, unoptimized way.
|
|
16
|
+
*/
|
|
17
|
+
export type View = import("../view").default;
|
|
18
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
19
|
+
//# sourceMappingURL=simpleViewRenderingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simpleViewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/simpleViewRenderingContext.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IAMQ,6DAA6D;IAC7D,QADW,OAAO,8BAA8B,EAAE,OAAO,CAClC;IAEvB,6CAA6C;IAC7C,OADW,IAAI,OAAO,SAAS,EAAE,OAAO,CAAC,CACnB;CA6C7B;;;;;mBAzDY,OAAO,SAAS,EAAE,OAAO;iCANL,wBAAwB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This class is mainly for illustrative purpose, i.e., how the rendering
|
|
5
|
+
* would be performed in the most straightforward, unoptimized way.
|
|
6
|
+
*
|
|
7
|
+
* @typedef {import("../view").default} View
|
|
8
|
+
*/
|
|
9
|
+
export default class SimpleViewRenderingContext extends ViewRenderingContext {
|
|
10
|
+
/**
|
|
11
|
+
* @param {import("../../types/rendering").GlobalRenderingOptions} globalOptions
|
|
12
|
+
*/
|
|
13
|
+
constructor(globalOptions) {
|
|
14
|
+
super(globalOptions);
|
|
15
|
+
/** @type {import("../../utils/layout/rectangle").default} */
|
|
16
|
+
this.coords = undefined;
|
|
17
|
+
|
|
18
|
+
/** @type {Set<import("../view").default>} */
|
|
19
|
+
this.views = new Set();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Must be called when a view's render() method is entered
|
|
24
|
+
*
|
|
25
|
+
* @param {View} view
|
|
26
|
+
* @param {import("../../utils/layout/rectangle").default} coords View coordinates
|
|
27
|
+
* inside the padding.
|
|
28
|
+
*/
|
|
29
|
+
pushView(view, coords) {
|
|
30
|
+
if (!this.views.has(view)) {
|
|
31
|
+
// Ensure that the method is called only once, even when rendering facets.
|
|
32
|
+
view.onBeforeRender();
|
|
33
|
+
this.views.add(view);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
this.coords = coords;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Must be called when a view's render() method is being exited
|
|
41
|
+
*
|
|
42
|
+
* @param {View} view
|
|
43
|
+
*/
|
|
44
|
+
popView(view) {
|
|
45
|
+
//
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @param {import("../../marks/mark").default} mark
|
|
51
|
+
* @param {import("../../types/rendering").RenderingOptions} options
|
|
52
|
+
*/
|
|
53
|
+
renderMark(mark, options) {
|
|
54
|
+
if (this.globalOptions.picking && !mark.isPickingParticipant()) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
for (const op of mark.prepareRender(this.globalOptions)) {
|
|
59
|
+
op();
|
|
60
|
+
}
|
|
61
|
+
mark.setViewport(this.coords, options.clipRect);
|
|
62
|
+
mark.render(options)();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A trivial proof-of-concept SVG rendering context. Doesn't render any
|
|
3
|
+
* marks at this point, only placeholders.
|
|
4
|
+
*
|
|
5
|
+
* @typedef {import("../view").default} View
|
|
6
|
+
*/
|
|
7
|
+
export default class SvgViewRenderingContext extends ViewRenderingContext {
|
|
8
|
+
/** @type {import("../../utils/layout/rectangle").default} */
|
|
9
|
+
coords: import("../../utils/layout/rectangle").default;
|
|
10
|
+
svg: SVGSVGElement;
|
|
11
|
+
/** @type {SVGElement[]} */
|
|
12
|
+
nodeStack: SVGElement[];
|
|
13
|
+
getSvg(): SVGSVGElement;
|
|
14
|
+
get _currentNode(): SVGElement;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A trivial proof-of-concept SVG rendering context. Doesn't render any
|
|
18
|
+
* marks at this point, only placeholders.
|
|
19
|
+
*/
|
|
20
|
+
export type View = import("../view").default;
|
|
21
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
22
|
+
//# sourceMappingURL=svgViewRenderingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svgViewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/svgViewRenderingContext.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH;IAQQ,6DAA6D;IAC7D,QADW,OAAO,8BAA8B,EAAE,OAAO,CAClC;IAEvB,mBAGC;IAED,2BAA2B;IAC3B,WADW,UAAU,EAAE,CACI;IAwE/B,wBAEC;IAED,+BAEC;CACJ;;;;;mBAlGY,OAAO,SAAS,EAAE,OAAO;iCANL,wBAAwB"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { peek } from "../../utils/arrayUtils";
|
|
2
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A trivial proof-of-concept SVG rendering context. Doesn't render any
|
|
6
|
+
* marks at this point, only placeholders.
|
|
7
|
+
*
|
|
8
|
+
* @typedef {import("../view").default} View
|
|
9
|
+
*/
|
|
10
|
+
export default class SvgViewRenderingContext extends ViewRenderingContext {
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param {import("../../types/rendering").GlobalRenderingOptions} globalOptions
|
|
14
|
+
*/
|
|
15
|
+
constructor(globalOptions) {
|
|
16
|
+
super(globalOptions);
|
|
17
|
+
|
|
18
|
+
/** @type {import("../../utils/layout/rectangle").default} */
|
|
19
|
+
this.coords = undefined;
|
|
20
|
+
|
|
21
|
+
this.svg = document.createElementNS(
|
|
22
|
+
"http://www.w3.org/2000/svg",
|
|
23
|
+
"svg"
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/** @type {SVGElement[]} */
|
|
27
|
+
this.nodeStack = [this.svg];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Must be called when a view's render() method is entered
|
|
32
|
+
*
|
|
33
|
+
* @param {View} view
|
|
34
|
+
* @param {import("../../utils/layout/rectangle").default} coords View coordinates
|
|
35
|
+
* inside the padding.
|
|
36
|
+
*/
|
|
37
|
+
pushView(view, coords) {
|
|
38
|
+
view.onBeforeRender();
|
|
39
|
+
this.coords = coords;
|
|
40
|
+
|
|
41
|
+
if (this._currentNode === this.svg) {
|
|
42
|
+
const viewBox = coords.expand(view.getPadding());
|
|
43
|
+
this.svg.setAttributeNS(
|
|
44
|
+
null,
|
|
45
|
+
"viewBox",
|
|
46
|
+
[viewBox.x, viewBox.y, viewBox.width, viewBox.height].join(" ")
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const group = createNode("g");
|
|
51
|
+
const title = createNode("title");
|
|
52
|
+
title.textContent = view.name;
|
|
53
|
+
group.appendChild(title);
|
|
54
|
+
|
|
55
|
+
this._currentNode.appendChild(group);
|
|
56
|
+
this.nodeStack.push(group);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Must be called when a view's render() method is being exited
|
|
61
|
+
*
|
|
62
|
+
* @param {View} view
|
|
63
|
+
*/
|
|
64
|
+
popView(view) {
|
|
65
|
+
this.nodeStack.pop();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param {import("../../marks/mark").default} mark
|
|
71
|
+
* @param {import("../../types/rendering").RenderingOptions} options
|
|
72
|
+
*/
|
|
73
|
+
renderMark(mark, options) {
|
|
74
|
+
const current = this._currentNode;
|
|
75
|
+
|
|
76
|
+
const rect = createNode("rect", {
|
|
77
|
+
x: this.coords.x,
|
|
78
|
+
y: this.coords.y,
|
|
79
|
+
width: this.coords.width,
|
|
80
|
+
height: this.coords.height,
|
|
81
|
+
fill: "transparent",
|
|
82
|
+
stroke: "black",
|
|
83
|
+
"stroke-width": 1,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const name = createNode("text", {
|
|
87
|
+
x: this.coords.x + this.coords.width / 2,
|
|
88
|
+
y: this.coords.y + this.coords.height / 2,
|
|
89
|
+
"dominant-baseline": "middle",
|
|
90
|
+
"text-anchor": "middle",
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
name.textContent = mark.getType();
|
|
94
|
+
|
|
95
|
+
current.appendChild(rect);
|
|
96
|
+
current.appendChild(name);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
getSvg() {
|
|
100
|
+
return this.svg;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
get _currentNode() {
|
|
104
|
+
return peek(this.nodeStack);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Adapted from: https://stackoverflow.com/a/37411738/1547896
|
|
110
|
+
*
|
|
111
|
+
* @param {string} name
|
|
112
|
+
* @param {Record<string, any>} [attributes]
|
|
113
|
+
*/
|
|
114
|
+
function createNode(name, attributes) {
|
|
115
|
+
const element = document.createElementNS(
|
|
116
|
+
"http://www.w3.org/2000/svg",
|
|
117
|
+
name
|
|
118
|
+
);
|
|
119
|
+
if (attributes) {
|
|
120
|
+
for (const [k, v] of Object.entries(attributes)) {
|
|
121
|
+
element.setAttributeNS(null, k, v);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return element;
|
|
125
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../view").default} View
|
|
3
|
+
*/
|
|
4
|
+
export default class ViewRenderingContext {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {import("../../types/rendering").GlobalRenderingOptions} globalOptions
|
|
8
|
+
*/
|
|
9
|
+
constructor(globalOptions: import("../../types/rendering").GlobalRenderingOptions);
|
|
10
|
+
globalOptions: import("../../types/rendering").GlobalRenderingOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Must be called when a view's render() method is entered
|
|
13
|
+
*
|
|
14
|
+
* @param {View} view
|
|
15
|
+
* @param {import("../../utils/layout/rectangle").default} coords View coordinates
|
|
16
|
+
* inside the padding.
|
|
17
|
+
*/
|
|
18
|
+
pushView(view: View, coords: import("../../utils/layout/rectangle").default): void;
|
|
19
|
+
/**
|
|
20
|
+
* Must be called when a view's render() method is being exited
|
|
21
|
+
*
|
|
22
|
+
* @param {View} view
|
|
23
|
+
*/
|
|
24
|
+
popView(view: View): void;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param {import("../../marks/mark").default} mark
|
|
28
|
+
* @param {import("../../types/rendering").RenderingOptions} options
|
|
29
|
+
*/
|
|
30
|
+
renderMark(mark: import("../../marks/mark").default, options: import("../../types/rendering").RenderingOptions): void;
|
|
31
|
+
}
|
|
32
|
+
export type View = import("../view").default;
|
|
33
|
+
//# sourceMappingURL=viewRenderingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/viewRenderingContext.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IACI;;;OAGG;IACH,2BAFW,OAAO,uBAAuB,EAAE,sBAAsB,EAIhE;IADG,sEAAkC;IAGtC;;;;;;OAMG;IACH,eAJW,IAAI,UACJ,OAAO,8BAA8B,EAAE,OAAO,QAKxD;IAED;;;;OAIG;IACH,cAFW,IAAI,QAId;IAED;;;;OAIG;IACH,iBAHW,OAAO,kBAAkB,EAAE,OAAO,WAClC,OAAO,uBAAuB,EAAE,gBAAgB,QAI1D;CACJ;mBAvCY,OAAO,SAAS,EAAE,OAAO"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../view").default} View
|
|
3
|
+
*/
|
|
4
|
+
export default class ViewRenderingContext {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {import("../../types/rendering").GlobalRenderingOptions} globalOptions
|
|
8
|
+
*/
|
|
9
|
+
constructor(globalOptions) {
|
|
10
|
+
this.globalOptions = globalOptions;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Must be called when a view's render() method is entered
|
|
15
|
+
*
|
|
16
|
+
* @param {View} view
|
|
17
|
+
* @param {import("../../utils/layout/rectangle").default} coords View coordinates
|
|
18
|
+
* inside the padding.
|
|
19
|
+
*/
|
|
20
|
+
pushView(view, coords) {
|
|
21
|
+
//
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Must be called when a view's render() method is being exited
|
|
26
|
+
*
|
|
27
|
+
* @param {View} view
|
|
28
|
+
*/
|
|
29
|
+
popView(view) {
|
|
30
|
+
//
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {import("../../marks/mark").default} mark
|
|
36
|
+
* @param {import("../../types/rendering").RenderingOptions} options
|
|
37
|
+
*/
|
|
38
|
+
renderMark(mark, options) {
|
|
39
|
+
//
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reconfigures scales, starting from the given view.
|
|
3
|
+
*
|
|
4
|
+
* TODO: This should be made unnecessary. Collectors should trigger the reconfiguration
|
|
5
|
+
* for those views that get their data from the collector.
|
|
6
|
+
*
|
|
7
|
+
* TODO: This may reconfigure channels that are not affected by the change.
|
|
8
|
+
* Causes performance issues with domains that are extracted from data.
|
|
9
|
+
*
|
|
10
|
+
* @param {import("./view").default | import("./view").default[]} fromViews
|
|
11
|
+
*/
|
|
12
|
+
export function reconfigureScales(fromViews: import("./view").default | import("./view").default[]): void;
|
|
13
|
+
export const QUANTITATIVE: "quantitative";
|
|
14
|
+
export const ORDINAL: "ordinal";
|
|
15
|
+
export const NOMINAL: "nominal";
|
|
16
|
+
export const LOCUS: "locus";
|
|
17
|
+
export const INDEX: "index";
|
|
18
|
+
/**
|
|
19
|
+
* @template {ChannelWithScale}[T=ChannelWithScale]
|
|
20
|
+
* @typedef {{view: import("./unitView").default, channel: T}} ResolutionMember
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Resolution takes care of merging domains and scales from multiple views.
|
|
25
|
+
* This class also provides some utility methods for zooming the scales etc..
|
|
26
|
+
*
|
|
27
|
+
* TODO: This has grown a bit too fat. Consider splitting.
|
|
28
|
+
*
|
|
29
|
+
* @implements {ScaleResolutionApi}
|
|
30
|
+
*/
|
|
31
|
+
export default class ScaleResolution implements ScaleResolutionApi {
|
|
32
|
+
/**
|
|
33
|
+
* @param {Channel} channel
|
|
34
|
+
*/
|
|
35
|
+
constructor(channel: import("../spec/channel").Channel);
|
|
36
|
+
channel: import("../spec/channel").Channel;
|
|
37
|
+
/** @type {ResolutionMember[]} The involved views */
|
|
38
|
+
members: ResolutionMember<import("../spec/channel").ChannelWithScale>[];
|
|
39
|
+
/** @type {string} Data type (quantitative, nominal, etc...) */
|
|
40
|
+
type: string;
|
|
41
|
+
/** @type {string} An optional unique identifier for the scale */
|
|
42
|
+
name: string;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a listener that is called when the scale domain is changed,
|
|
45
|
+
* e.g., zoomed. The call is synchronous and happens before the views
|
|
46
|
+
* are rendered.
|
|
47
|
+
*
|
|
48
|
+
* @param {"domain"} type
|
|
49
|
+
* @param {ScaleResolutionListener} listener function
|
|
50
|
+
*/
|
|
51
|
+
addEventListener(type: "domain", listener: import("../types/scaleResolutionApi").ScaleResolutionListener): void;
|
|
52
|
+
/**
|
|
53
|
+
* @param {"domain"} type
|
|
54
|
+
* @param {ScaleResolutionListener} listener function
|
|
55
|
+
*/
|
|
56
|
+
removeEventListener(type: "domain", listener: import("../types/scaleResolutionApi").ScaleResolutionListener): void;
|
|
57
|
+
/**
|
|
58
|
+
* Add a view to this resolution.
|
|
59
|
+
* N.B. This is expected to be called in depth-first order
|
|
60
|
+
*
|
|
61
|
+
* @param {UnitView} view
|
|
62
|
+
* @param {ChannelWithScale} channel
|
|
63
|
+
*/
|
|
64
|
+
pushUnitView(view: import("./unitView").default, channel: import("../spec/channel").ChannelWithScale): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns true if the domain has been defined explicitly, i.e. not extracted from the data.
|
|
67
|
+
*/
|
|
68
|
+
isExplicitDomain(): boolean;
|
|
69
|
+
isDomainInitialized(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the merged scale properties supplemented with inferred properties
|
|
72
|
+
* and domain.
|
|
73
|
+
*
|
|
74
|
+
* @returns {import("../spec/scale").Scale}
|
|
75
|
+
*/
|
|
76
|
+
getScaleProps(): import("../spec/scale").Scale;
|
|
77
|
+
/**
|
|
78
|
+
* Unions the configured domains of all participating views.
|
|
79
|
+
*
|
|
80
|
+
* @return { DomainArray }
|
|
81
|
+
*/
|
|
82
|
+
getConfiguredDomain(): import("../utils/domainArray").DomainArray;
|
|
83
|
+
/**
|
|
84
|
+
* Extracts and unions the data domains of all participating views.
|
|
85
|
+
*
|
|
86
|
+
* @return { DomainArray }
|
|
87
|
+
*/
|
|
88
|
+
getDataDomain(): import("../utils/domainArray").DomainArray;
|
|
89
|
+
/**
|
|
90
|
+
* Reconfigures the scale: updates domain and other settings
|
|
91
|
+
*/
|
|
92
|
+
reconfigure(): void;
|
|
93
|
+
/**
|
|
94
|
+
* @returns {VegaScale}
|
|
95
|
+
*/
|
|
96
|
+
getScale(): import("../types/encoder").VegaScale;
|
|
97
|
+
getDomain(): any[];
|
|
98
|
+
/**
|
|
99
|
+
* @returns {NumericDomain | ComplexDomain}
|
|
100
|
+
*/
|
|
101
|
+
getComplexDomain(): import("../spec/scale").NumericDomain | import("../spec/scale").ComplexDomain;
|
|
102
|
+
/**
|
|
103
|
+
* Return true if the scale is zoomable and the current domain differs from the initial domain.
|
|
104
|
+
*
|
|
105
|
+
* @returns true if zoomed
|
|
106
|
+
*/
|
|
107
|
+
isZoomed(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Returns true if zooming is supported and allowed in view spec.
|
|
110
|
+
*/
|
|
111
|
+
isZoomable(): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Pans (translates) and zooms using a specified scale factor.
|
|
114
|
+
*
|
|
115
|
+
* @param {number} scaleFactor
|
|
116
|
+
* @param {number} scaleAnchor
|
|
117
|
+
* @param {number} pan
|
|
118
|
+
* @returns {boolean} true if the scale was zoomed
|
|
119
|
+
*/
|
|
120
|
+
zoom(scaleFactor: number, scaleAnchor: number, pan: number): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Immediately zooms to the given interval.
|
|
123
|
+
*
|
|
124
|
+
* @param {NumericDomain | ComplexDomain} domain
|
|
125
|
+
* @param {boolean | number} [duration] an approximate duration for transition.
|
|
126
|
+
* Zero duration zooms immediately. Boolean `true` indicates a default duration.
|
|
127
|
+
*/
|
|
128
|
+
zoomTo(domain: import("../spec/scale").NumericDomain | import("../spec/scale").ComplexDomain, duration?: boolean | number): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Resets the current domain to the initial one
|
|
131
|
+
*
|
|
132
|
+
* @returns true if the domain was changed
|
|
133
|
+
*/
|
|
134
|
+
resetZoom(): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Returns the zoom level with respect to the reference domain span (the original domain).
|
|
137
|
+
*
|
|
138
|
+
* In principle, this is highly specific to positional channels. However, zooming can
|
|
139
|
+
* be generalized to other quantitative channels such as color, opacity, size, etc.
|
|
140
|
+
*/
|
|
141
|
+
getZoomLevel(): number;
|
|
142
|
+
getGenome(): import("../genome/genome").default;
|
|
143
|
+
/**
|
|
144
|
+
* Inverts a value in range to a value on domain. Returns an object in
|
|
145
|
+
* case of locus scale.
|
|
146
|
+
*
|
|
147
|
+
* @param {number} value
|
|
148
|
+
*/
|
|
149
|
+
invertToComplex(value: number): number | import("../spec/genome").ChromosomalLocus;
|
|
150
|
+
/**
|
|
151
|
+
* @param {number} value
|
|
152
|
+
*/
|
|
153
|
+
toComplex(value: number): number | import("../spec/genome").ChromosomalLocus;
|
|
154
|
+
/**
|
|
155
|
+
* @param {number | ChromosomalLocus} complex
|
|
156
|
+
* @returns {number}
|
|
157
|
+
*/
|
|
158
|
+
fromComplex(complex: number | import("../spec/genome").ChromosomalLocus): number;
|
|
159
|
+
/**
|
|
160
|
+
* @param {ScalarDomain | ComplexDomain} interval
|
|
161
|
+
* @returns {number[]}
|
|
162
|
+
*/
|
|
163
|
+
fromComplexInterval(interval: import("../spec/scale").ScalarDomain | import("../spec/scale").ComplexDomain): number[];
|
|
164
|
+
#private;
|
|
165
|
+
}
|
|
166
|
+
export type ResolutionMember<T extends import("../spec/channel").ChannelWithScale = import("../spec/channel").ChannelWithScale> = {
|
|
167
|
+
view: import("./unitView").default;
|
|
168
|
+
channel: T;
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=scaleResolution.d.ts.map
|