@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,9 @@
|
|
|
1
|
+
export default class ImplicitRootView extends GridView {
|
|
2
|
+
/**
|
|
3
|
+
* @param {import("../types/viewContext").default} context
|
|
4
|
+
* @param {import("./view").default} view
|
|
5
|
+
*/
|
|
6
|
+
constructor(context: import("../types/viewContext").default, view: import("./view").default);
|
|
7
|
+
}
|
|
8
|
+
import GridView from "./gridView";
|
|
9
|
+
//# sourceMappingURL=implicitRootView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implicitRootView.d.ts","sourceRoot":"","sources":["../../../src/view/implicitRootView.js"],"names":[],"mappings":"AAEA;IACI;;;OAGG;IACH,qBAHW,OAAO,sBAAsB,EAAE,OAAO,QACtC,OAAO,QAAQ,EAAE,OAAO,EAgBlC;CACJ;qBAtBoB,YAAY"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import GridView from "./gridView";
|
|
2
|
+
|
|
3
|
+
export default class ImplicitRootView extends GridView {
|
|
4
|
+
/**
|
|
5
|
+
* @param {import("../types/viewContext").default} context
|
|
6
|
+
* @param {import("./view").default} view
|
|
7
|
+
*/
|
|
8
|
+
constructor(context, view) {
|
|
9
|
+
super(
|
|
10
|
+
{ vconcat: [] },
|
|
11
|
+
context,
|
|
12
|
+
undefined,
|
|
13
|
+
undefined,
|
|
14
|
+
"implicitRoot",
|
|
15
|
+
1
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
view.layoutParent = this;
|
|
19
|
+
view.dataParent = this;
|
|
20
|
+
|
|
21
|
+
this.appendChild(view);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is just a placeholder for custom tracks that are imported by name.
|
|
3
|
+
*/
|
|
4
|
+
export default class ImportView extends View {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {import("../spec/view").ImportSpec} spec
|
|
8
|
+
* @param {import("../types/viewContext").default} context
|
|
9
|
+
* @param {import("./containerView").default} layoutParent
|
|
10
|
+
* @param {import("./view").default} dataParent
|
|
11
|
+
* @param {string} name
|
|
12
|
+
*/
|
|
13
|
+
constructor(spec: import("../spec/view").ImportSpec, context: import("../types/viewContext").default, layoutParent: import("./containerView").default, dataParent: import("./view").default, name: string);
|
|
14
|
+
spec: import("../spec/view").ImportSpec;
|
|
15
|
+
}
|
|
16
|
+
import View from "./view";
|
|
17
|
+
//# sourceMappingURL=importView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importView.d.ts","sourceRoot":"","sources":["../../../src/view/importView.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH;IACI;;;;;;;OAOG;IACH,kBANW,OAAO,cAAc,EAAE,UAAU,WACjC,OAAO,sBAAsB,EAAE,OAAO,gBACtC,OAAO,iBAAiB,EAAE,OAAO,cACjC,OAAO,QAAQ,EAAE,OAAO,QACxB,MAAM,EAOhB;IADG,wCAAgB;CAEvB;iBArBgB,QAAQ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import View from "./view";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is just a placeholder for custom tracks that are imported by name.
|
|
5
|
+
*/
|
|
6
|
+
// @ts-expect-error TODO: Fix typing
|
|
7
|
+
export default class ImportView extends View {
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {import("../spec/view").ImportSpec} spec
|
|
11
|
+
* @param {import("../types/viewContext").default} context
|
|
12
|
+
* @param {import("./containerView").default} layoutParent
|
|
13
|
+
* @param {import("./view").default} dataParent
|
|
14
|
+
* @param {string} name
|
|
15
|
+
*/
|
|
16
|
+
constructor(spec, context, layoutParent, dataParent, name) {
|
|
17
|
+
// @ts-expect-error TODO: Fix typing
|
|
18
|
+
super(spec, context, layoutParent, dataParent, name);
|
|
19
|
+
|
|
20
|
+
this.spec = spec; // Set here again to keep types happy
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default class LayerView extends ContainerView {
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import("./view").default} View
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {import("../spec/view").LayerSpec} spec
|
|
8
|
+
* @param {import("../types/viewContext").default} context
|
|
9
|
+
* @param {ContainerView} layoutParent
|
|
10
|
+
* @param {import("./view").default} dataParent
|
|
11
|
+
* @param {string} name
|
|
12
|
+
*/
|
|
13
|
+
constructor(spec: import("../spec/view").LayerSpec, context: import("../types/viewContext").default, layoutParent: ContainerView, dataParent: import("./view").default, name: string);
|
|
14
|
+
spec: import("../spec/view").LayerSpec;
|
|
15
|
+
/** @type {(LayerView | import("./unitView").default)[]} */
|
|
16
|
+
children: (LayerView | import("./unitView").default)[];
|
|
17
|
+
/**
|
|
18
|
+
* @param {import("./renderingContext/viewRenderingContext").default} context
|
|
19
|
+
* @param {import("../utils/layout/rectangle").default} coords
|
|
20
|
+
* @param {import("../types/rendering").RenderingOptions} [options]
|
|
21
|
+
*/
|
|
22
|
+
render(context: import("./renderingContext/viewRenderingContext").default, coords: import("../utils/layout/rectangle").default, options?: import("../types/rendering").RenderingOptions): void;
|
|
23
|
+
}
|
|
24
|
+
import ContainerView from "./containerView";
|
|
25
|
+
//# sourceMappingURL=layerView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layerView.d.ts","sourceRoot":"","sources":["../../../src/view/layerView.js"],"names":[],"mappings":"AAGA;IACI;;OAEG;IACH;;;;;;;OAOG;IACH,kBANW,OAAO,cAAc,EAAE,SAAS,WAChC,OAAO,sBAAsB,EAAE,OAAO,gBACtC,aAAa,cACb,OAAO,QAAQ,EAAE,OAAO,QACxB,MAAM,EAoBhB;IAfG,uCAAgB;IAEhB,2DAA2D;IAE3D,UAFW,CAAC,SAAS,GAAG,OAAO,YAAY,EAAE,OAAO,CAAC,EAAE,CAUrD;IAcN;;;;OAIG;IACH,gBAJW,OAAO,yCAAyC,EAAE,OAAO,UACzD,OAAO,2BAA2B,EAAE,OAAO,YAC3C,OAAO,oBAAoB,EAAE,gBAAgB,QAcvD;CAeJ;0BA3EyB,iBAAiB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { isLayerSpec, isUnitSpec } from "./viewFactory";
|
|
2
|
+
import ContainerView from "./containerView";
|
|
3
|
+
|
|
4
|
+
export default class LayerView extends ContainerView {
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import("./view").default} View
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {import("../spec/view").LayerSpec} spec
|
|
11
|
+
* @param {import("../types/viewContext").default} context
|
|
12
|
+
* @param {ContainerView} layoutParent
|
|
13
|
+
* @param {import("./view").default} dataParent
|
|
14
|
+
* @param {string} name
|
|
15
|
+
*/
|
|
16
|
+
constructor(spec, context, layoutParent, dataParent, name) {
|
|
17
|
+
super(spec, context, layoutParent, dataParent, name);
|
|
18
|
+
|
|
19
|
+
this.spec = spec;
|
|
20
|
+
|
|
21
|
+
/** @type {(LayerView | import("./unitView").default)[]} */
|
|
22
|
+
// @ts-expect-error TODO: Fix typing
|
|
23
|
+
this.children = (spec.layer || []).map((childSpec, i) => {
|
|
24
|
+
if (isLayerSpec(childSpec) || isUnitSpec(childSpec)) {
|
|
25
|
+
return context.createView(childSpec, this, this, "layer" + i);
|
|
26
|
+
} else {
|
|
27
|
+
throw new Error(
|
|
28
|
+
"LayerView accepts only unit or layer specs as children!"
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
this.needsAxes = { x: true, y: true };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @returns {IterableIterator<View>}
|
|
38
|
+
*/
|
|
39
|
+
*[Symbol.iterator]() {
|
|
40
|
+
for (const child of this.children) {
|
|
41
|
+
yield child;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {import("./renderingContext/viewRenderingContext").default} context
|
|
47
|
+
* @param {import("../utils/layout/rectangle").default} coords
|
|
48
|
+
* @param {import("../types/rendering").RenderingOptions} [options]
|
|
49
|
+
*/
|
|
50
|
+
render(context, coords, options = {}) {
|
|
51
|
+
if (!this.isConfiguredVisible()) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
context.pushView(this, coords);
|
|
56
|
+
|
|
57
|
+
for (const child of this.children) {
|
|
58
|
+
child.render(context, coords, options);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
context.popView(this);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @param {import("../utils/interactionEvent").default} event
|
|
66
|
+
*/
|
|
67
|
+
propagateInteractionEvent(event) {
|
|
68
|
+
this.handleInteractionEvent(undefined, event, true);
|
|
69
|
+
for (let i = this.children.length - 1; i >= 0; i--) {
|
|
70
|
+
this.children[i].propagateInteractionEvent(event);
|
|
71
|
+
if (event.stopped) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
this.handleInteractionEvent(undefined, event, false);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default class BufferedViewRenderingContext extends ViewRenderingContext {
|
|
2
|
+
/**
|
|
3
|
+
* @param {import("../../types/rendering").GlobalRenderingOptions} globalOptions
|
|
4
|
+
* @param {import("../../gl/webGLHelper").default} webGLHelper
|
|
5
|
+
*/
|
|
6
|
+
constructor(globalOptions: import("../../types/rendering").GlobalRenderingOptions, webGLHelper: import("../../gl/webGLHelper").default);
|
|
7
|
+
webGLHelper: import("../../gl/webGLHelper").default;
|
|
8
|
+
/**
|
|
9
|
+
* @type {import("../../types/rendering").BufferedRenderingRequest[]}
|
|
10
|
+
*/
|
|
11
|
+
buffer: import("../../types/rendering").BufferedRenderingRequest[];
|
|
12
|
+
/** @type {import("../../utils/layout/rectangle").default} */
|
|
13
|
+
coords: import("../../utils/layout/rectangle").default;
|
|
14
|
+
/** @type {Set<import("../view").default>} */
|
|
15
|
+
views: Set<import("../view").default>;
|
|
16
|
+
/**
|
|
17
|
+
* Renders marks in an optimized order, minimizing the number of WebGL state
|
|
18
|
+
* changes.
|
|
19
|
+
*/
|
|
20
|
+
render(): void;
|
|
21
|
+
_buildBatch(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Store the operations as a sequence of commands for cheap subsequent rendering.
|
|
24
|
+
*
|
|
25
|
+
* @type {(function():void)[]}
|
|
26
|
+
*/
|
|
27
|
+
batch: (() => void)[];
|
|
28
|
+
}
|
|
29
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
30
|
+
//# sourceMappingURL=bufferedViewRenderingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferedViewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/bufferedViewRenderingContext.js"],"names":[],"mappings":"AAIA;IACI;;;OAGG;IACH,2BAHW,OAAO,uBAAuB,EAAE,sBAAsB,eACtD,OAAO,sBAAsB,EAAE,OAAO,EAiBhD;IAZG,oDAA8B;IAE9B;;OAEG;IACH,QAFU,OAAO,uBAAuB,EAAE,wBAAwB,EAAE,CAEpD;IAEhB,6DAA6D;IAC7D,QADW,OAAO,8BAA8B,EAAE,OAAO,CAClC;IAEvB,6CAA6C;IAC7C,OADW,IAAI,OAAO,SAAS,EAAE,OAAO,CAAC,CACnB;IAsC1B;;;OAGG;IACH,eA+BC;IAED,oBA2EC;IA1EG;;;;OAIG;IACH,cAFsB,IAAI,IAEX;CAsEtB;iCA5KgC,wBAAwB"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { group } from "d3-array";
|
|
2
|
+
|
|
3
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
4
|
+
|
|
5
|
+
export default class BufferedViewRenderingContext extends ViewRenderingContext {
|
|
6
|
+
/**
|
|
7
|
+
* @param {import("../../types/rendering").GlobalRenderingOptions} globalOptions
|
|
8
|
+
* @param {import("../../gl/webGLHelper").default} webGLHelper
|
|
9
|
+
*/
|
|
10
|
+
constructor(globalOptions, webGLHelper) {
|
|
11
|
+
super(globalOptions);
|
|
12
|
+
|
|
13
|
+
this.webGLHelper = webGLHelper;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @type {import("../../types/rendering").BufferedRenderingRequest[]}
|
|
17
|
+
*/
|
|
18
|
+
this.buffer = [];
|
|
19
|
+
|
|
20
|
+
/** @type {import("../../utils/layout/rectangle").default} */
|
|
21
|
+
this.coords = undefined;
|
|
22
|
+
|
|
23
|
+
/** @type {Set<import("../view").default>} */
|
|
24
|
+
this.views = new Set();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Must be called when a view's render() method is entered
|
|
29
|
+
*
|
|
30
|
+
* @param {import("../view").default} view
|
|
31
|
+
* @param {import("../../utils/layout/rectangle").default} coords View coordinates
|
|
32
|
+
* inside the padding.
|
|
33
|
+
* @override
|
|
34
|
+
*/
|
|
35
|
+
pushView(view, coords) {
|
|
36
|
+
this.views.add(view);
|
|
37
|
+
this.coords = coords;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {import("../../marks/mark").default} mark
|
|
43
|
+
* @param {import("../../types/rendering").RenderingOptions} options
|
|
44
|
+
* @override
|
|
45
|
+
*/
|
|
46
|
+
renderMark(mark, options) {
|
|
47
|
+
if (this.globalOptions.picking && !mark.isPickingParticipant()) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const callback = mark.render(options);
|
|
52
|
+
if (callback) {
|
|
53
|
+
this.buffer.push({
|
|
54
|
+
mark,
|
|
55
|
+
callback,
|
|
56
|
+
coords: this.coords,
|
|
57
|
+
clipRect: options.clipRect,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Renders marks in an optimized order, minimizing the number of WebGL state
|
|
64
|
+
* changes.
|
|
65
|
+
*/
|
|
66
|
+
render() {
|
|
67
|
+
if (!this.batch) {
|
|
68
|
+
this._buildBatch();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (this.batch.length == 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const gl = this.webGLHelper.gl;
|
|
76
|
+
const picking = this.globalOptions.picking;
|
|
77
|
+
|
|
78
|
+
gl.bindFramebuffer(
|
|
79
|
+
gl.FRAMEBUFFER,
|
|
80
|
+
picking ? this.webGLHelper._pickingBufferInfo.framebuffer : null
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
this.webGLHelper.clearAll();
|
|
84
|
+
|
|
85
|
+
for (const view of this.views) {
|
|
86
|
+
view.onBeforeRender();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Execute the batch
|
|
90
|
+
for (const op of this.batch) {
|
|
91
|
+
op();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (picking) {
|
|
95
|
+
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_buildBatch() {
|
|
100
|
+
/**
|
|
101
|
+
* Store the operations as a sequence of commands for cheap subsequent rendering.
|
|
102
|
+
*
|
|
103
|
+
* @type {(function():void)[]}
|
|
104
|
+
*/
|
|
105
|
+
this.batch = [];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Is drawing enabled or not. As an optimization this is toggled off for invisible views.
|
|
109
|
+
*/
|
|
110
|
+
let enabled = true;
|
|
111
|
+
|
|
112
|
+
let viewportVisible = true;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @type {function(function():void):(function():void)}
|
|
116
|
+
*/
|
|
117
|
+
const ifEnabled = (op) => () => {
|
|
118
|
+
if (enabled) op();
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @type {function(function():void):(function():void)}
|
|
123
|
+
*/
|
|
124
|
+
const ifEnabledAndVisible = (op) => () => {
|
|
125
|
+
if (enabled && viewportVisible) op();
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// We group by marks in order to minimize program changes.
|
|
129
|
+
// Note: by reversing the buffer, we ensure ensure that the last instance
|
|
130
|
+
// of a mark determines the order of the groups.
|
|
131
|
+
const requestByMark = group(
|
|
132
|
+
this.buffer.reverse(),
|
|
133
|
+
(request) => request.mark
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
// And reversing again to restore the original order
|
|
137
|
+
for (const [mark, requests] of [...requestByMark.entries()].reverse()) {
|
|
138
|
+
if (!mark.isReady()) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// eslint-disable-next-line no-loop-func
|
|
143
|
+
this.batch.push(() => {
|
|
144
|
+
enabled = mark.unitView.getEffectiveOpacity() > 0;
|
|
145
|
+
});
|
|
146
|
+
// Change program, set common uniforms (mark properties, shared domains)
|
|
147
|
+
this.batch.push(
|
|
148
|
+
...mark
|
|
149
|
+
.prepareRender(this.globalOptions)
|
|
150
|
+
.map((op) => ifEnabled(op))
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
/** @type {import("../../utils/layout/rectangle").default} */
|
|
154
|
+
let previousCoords;
|
|
155
|
+
for (const request of requests) {
|
|
156
|
+
const coords = request.coords;
|
|
157
|
+
// Render each facet
|
|
158
|
+
if (!coords.equals(previousCoords)) {
|
|
159
|
+
this.batch.push(
|
|
160
|
+
// eslint-disable-next-line no-loop-func
|
|
161
|
+
ifEnabled(() => {
|
|
162
|
+
// Suppress rendering if viewport is outside the clipRect
|
|
163
|
+
viewportVisible = mark.setViewport(
|
|
164
|
+
coords,
|
|
165
|
+
request.clipRect
|
|
166
|
+
);
|
|
167
|
+
})
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
this.batch.push(ifEnabledAndVisible(request.callback));
|
|
171
|
+
previousCoords = request.coords;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../view").default} View
|
|
3
|
+
*/
|
|
4
|
+
export default class CompositeViewRenderingContext extends ViewRenderingContext {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {...ViewRenderingContext} contexts
|
|
8
|
+
*/
|
|
9
|
+
constructor(...contexts: ViewRenderingContext[]);
|
|
10
|
+
contexts: ViewRenderingContext[];
|
|
11
|
+
}
|
|
12
|
+
export type View = import("../view").default;
|
|
13
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
14
|
+
//# sourceMappingURL=compositeViewRenderingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compositeViewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/compositeViewRenderingContext.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IACI;;;OAGG;IACH,yBAFe,oBAAoB,IAMlC;IADG,iCAAwB;CAqC/B;mBA/CY,OAAO,SAAS,EAAE,OAAO;iCAHL,wBAAwB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import("../view").default} View
|
|
5
|
+
*/
|
|
6
|
+
export default class CompositeViewRenderingContext extends ViewRenderingContext {
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {...ViewRenderingContext} contexts
|
|
10
|
+
*/
|
|
11
|
+
constructor(...contexts) {
|
|
12
|
+
super({});
|
|
13
|
+
|
|
14
|
+
this.contexts = contexts;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Must be called when a view's render() method is entered
|
|
19
|
+
*
|
|
20
|
+
* @param {View} view
|
|
21
|
+
* @param {import("../../utils/layout/rectangle").default} coords View coordinates
|
|
22
|
+
* inside the padding.
|
|
23
|
+
*/
|
|
24
|
+
pushView(view, coords) {
|
|
25
|
+
for (const context of this.contexts) {
|
|
26
|
+
context.pushView(view, coords);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Must be called when a view's render() method is being exited
|
|
32
|
+
*
|
|
33
|
+
* @param {View} view
|
|
34
|
+
*/
|
|
35
|
+
popView(view) {
|
|
36
|
+
for (const context of this.contexts) {
|
|
37
|
+
context.popView(view);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param {import("../../marks/mark").default} mark
|
|
44
|
+
* @param {import("../../types/rendering").RenderingOptions} options
|
|
45
|
+
*/
|
|
46
|
+
renderMark(mark, options) {
|
|
47
|
+
for (const context of this.contexts) {
|
|
48
|
+
context.renderMark(mark, options);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 debugging or testing of the layout engine.
|
|
5
|
+
*
|
|
6
|
+
* @typedef {import("../view").default} View
|
|
7
|
+
* @typedef {import("../../utils/layout/rectangle").default} Rectangle
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export default class DebugginViewRenderingContext extends ViewRenderingContext {
|
|
11
|
+
/** @type {ViewCoords} */
|
|
12
|
+
root: ViewCoords;
|
|
13
|
+
/** @type {ViewCoords[]} */
|
|
14
|
+
stack: ViewCoords[];
|
|
15
|
+
getLayout(): ViewCoords;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A Rendering context that doesn't render anything. It creates a hierarchy
|
|
19
|
+
* of view coordinates, including faceted views that are repeated multiple times.
|
|
20
|
+
* The coordinates can be used for debugging or testing of the layout engine.
|
|
21
|
+
*/
|
|
22
|
+
export type View = import("../view").default;
|
|
23
|
+
/**
|
|
24
|
+
* A Rendering context that doesn't render anything. It creates a hierarchy
|
|
25
|
+
* of view coordinates, including faceted views that are repeated multiple times.
|
|
26
|
+
* The coordinates can be used for debugging or testing of the layout engine.
|
|
27
|
+
*/
|
|
28
|
+
export type Rectangle = import("../../utils/layout/rectangle").default;
|
|
29
|
+
import ViewRenderingContext from "./viewRenderingContext";
|
|
30
|
+
/**
|
|
31
|
+
* Represents coordinates of view instances. Faceted views objects may have
|
|
32
|
+
* been rendered at multiple locations.
|
|
33
|
+
*/
|
|
34
|
+
declare class ViewCoords {
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} viewName
|
|
37
|
+
* @param {Rectangle} coords
|
|
38
|
+
*/
|
|
39
|
+
constructor(viewName: string, coords: Rectangle);
|
|
40
|
+
viewName: string;
|
|
41
|
+
coords: string;
|
|
42
|
+
/** @type {ViewCoords[]} */
|
|
43
|
+
children: ViewCoords[];
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param {ViewCoords} viewCoords
|
|
47
|
+
*/
|
|
48
|
+
addChild(viewCoords: ViewCoords): void;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=debuggingViewRenderingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debuggingViewRenderingContext.d.ts","sourceRoot":"","sources":["../../../../src/view/renderingContext/debuggingViewRenderingContext.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH;IAOQ,yBAAyB;IACzB,MADW,UAAU,CACA;IAErB,2BAA2B;IAC3B,OADW,UAAU,EAAE,CACR;IAgCnB,wBAEC;CACJ;;;;;;mBAlDY,OAAO,SAAS,EAAE,OAAO;;;;;;wBACzB,OAAO,8BAA8B,EAAE,OAAO;iCAR1B,wBAAwB;AA2DzD;;;GAGG;AACH;IACI;;;OAGG;IACH,sBAHW,MAAM,UACN,SAAS,EAOnB;IAJG,iBAAwB;IACxB,eAAsC;IACtC,2BAA2B;IAC3B,UADW,UAAU,EAAE,CACL;IAGtB;;;OAGG;IACH,qBAFW,UAAU,QAcpB;CACJ"}
|
|
@@ -0,0 +1,94 @@
|
|
|
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 debugging or testing of the layout engine.
|
|
8
|
+
*
|
|
9
|
+
* @typedef {import("../view").default} View
|
|
10
|
+
* @typedef {import("../../utils/layout/rectangle").default} Rectangle
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export default class DebugginViewRenderingContext 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
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Must be called when a view's render() method is entered
|
|
29
|
+
*
|
|
30
|
+
* @param {View} view
|
|
31
|
+
* @param {Rectangle} coords View coordinates
|
|
32
|
+
* inside the padding.
|
|
33
|
+
*/
|
|
34
|
+
pushView(view, coords) {
|
|
35
|
+
// TODO: Facet id
|
|
36
|
+
|
|
37
|
+
const viewCoords = new ViewCoords(view.name, coords);
|
|
38
|
+
|
|
39
|
+
if (!this.root) {
|
|
40
|
+
this.root = viewCoords;
|
|
41
|
+
} else {
|
|
42
|
+
peek(this.stack).addChild(viewCoords);
|
|
43
|
+
}
|
|
44
|
+
this.stack.push(viewCoords);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Must be called when a view's render() method is being exited
|
|
49
|
+
*
|
|
50
|
+
* @param {View} view
|
|
51
|
+
*/
|
|
52
|
+
popView(view) {
|
|
53
|
+
this.stack.pop();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getLayout() {
|
|
57
|
+
return this.root;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Represents coordinates of view instances. Faceted views objects may have
|
|
63
|
+
* been rendered at multiple locations.
|
|
64
|
+
*/
|
|
65
|
+
class ViewCoords {
|
|
66
|
+
/**
|
|
67
|
+
* @param {string} viewName
|
|
68
|
+
* @param {Rectangle} coords
|
|
69
|
+
*/
|
|
70
|
+
constructor(viewName, coords) {
|
|
71
|
+
this.viewName = viewName;
|
|
72
|
+
this.coords = coords.toRoundedString();
|
|
73
|
+
/** @type {ViewCoords[]} */
|
|
74
|
+
this.children = [];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @param {ViewCoords} viewCoords
|
|
80
|
+
*/
|
|
81
|
+
addChild(viewCoords) {
|
|
82
|
+
const last = peek(this.children);
|
|
83
|
+
if (
|
|
84
|
+
last &&
|
|
85
|
+
viewCoords.viewName == last.viewName &&
|
|
86
|
+
viewCoords.coords == last.coords
|
|
87
|
+
) {
|
|
88
|
+
// Skip extra copies of sample facets. They all have the same coords.
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
this.children.push(viewCoords);
|
|
93
|
+
}
|
|
94
|
+
}
|