@jbrowse/plugin-variants 3.7.0 → 4.0.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/esm/ChordVariantDisplay/components/ChordVariantDisplay.d.ts +11 -0
- package/esm/ChordVariantDisplay/components/ChordVariantDisplay.js +16 -0
- package/esm/ChordVariantDisplay/components/DisplayError.d.ts +9 -0
- package/esm/ChordVariantDisplay/components/DisplayError.js +7 -0
- package/esm/ChordVariantDisplay/components/Loading.d.ts +8 -0
- package/esm/ChordVariantDisplay/components/Loading.js +28 -0
- package/esm/ChordVariantDisplay/index.js +4 -4
- package/esm/ChordVariantDisplay/models/configSchema.d.ts +4 -5
- package/esm/ChordVariantDisplay/models/configSchema.js +10 -5
- package/esm/ChordVariantDisplay/models/renderReaction.d.ts +30 -0
- package/esm/ChordVariantDisplay/models/renderReaction.js +48 -0
- package/esm/ChordVariantDisplay/models/renderSvg.d.ts +6 -0
- package/esm/ChordVariantDisplay/models/renderSvg.js +12 -0
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +535 -46
- package/esm/ChordVariantDisplay/models/stateModelFactory.js +146 -8
- package/esm/LinearVariantDisplay/configSchema.d.ts +5 -5
- package/esm/LinearVariantDisplay/configSchema.js +2 -2
- package/esm/LinearVariantDisplay/index.js +6 -4
- package/esm/LinearVariantDisplay/model.d.ts +1086 -103
- package/esm/LinearVariantDisplay/model.js +10 -26
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +1 -1
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +8 -18
- package/esm/MultiLinearVariantDisplay/configSchema.d.ts +6 -44
- package/esm/MultiLinearVariantDisplay/configSchema.js +2 -2
- package/esm/MultiLinearVariantDisplay/index.js +4 -3
- package/esm/MultiLinearVariantDisplay/model.d.ts +1031 -125
- package/esm/MultiLinearVariantDisplay/model.js +3 -23
- package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +1 -1
- package/esm/MultiLinearVariantDisplay/renderSvg.js +4 -4
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +8 -2
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +26 -23
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +9 -20
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.d.ts +6 -6
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/index.js +5 -4
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +1110 -131
- package/esm/MultiLinearVariantMatrixDisplay/model.js +22 -48
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +3 -3
- package/esm/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.d.ts +4 -35
- package/esm/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.js +19 -33
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +12 -1
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +48 -22
- package/esm/MultiLinearVariantMatrixRenderer/configSchema.d.ts +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +10 -2
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +155 -135
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -14
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +3 -60
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +9 -18
- package/esm/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.d.ts +7 -6
- package/esm/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.js +30 -26
- package/esm/MultiLinearVariantRenderer/configSchema.d.ts +1 -1
- package/esm/MultiLinearVariantRenderer/index.js +4 -4
- package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +14 -11
- package/esm/MultiLinearVariantRenderer/makeImageData.js +127 -110
- package/esm/MultiLinearVariantRenderer/types.d.ts +3 -20
- package/esm/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +1 -1
- package/esm/SplitVcfTabixAdapter/configSchema.d.ts +2 -2
- package/esm/SplitVcfTabixAdapter/index.d.ts +1 -1
- package/esm/SplitVcfTabixAdapter/index.js +3 -3
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +1 -1
- package/esm/StructuralVariantChordRenderer/Chord.js +41 -58
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +3 -3
- package/esm/StructuralVariantChordRenderer/configSchema.d.ts +2 -2
- package/esm/StructuralVariantChordRenderer/index.js +3 -3
- package/esm/Tooltip.js +2 -2
- package/esm/VariantFeatureWidget/AltFormatter.js +1 -1
- package/esm/VariantFeatureWidget/Formatter.js +2 -2
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakpointSplitViewChoiceDialog.d.ts +1 -0
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakpointSplitViewChoiceDialog.js +1 -0
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.d.ts +1 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.js +8 -23
- package/esm/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGrid.js +1 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +16 -29
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +5 -2
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +68 -59
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleFilters.js +13 -2
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +1 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +72 -30
- package/esm/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.d.ts +2 -2
- package/esm/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.js +49 -26
- package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +3 -5
- package/esm/VariantFeatureWidget/configSchema.d.ts +1 -1
- package/esm/VariantFeatureWidget/index.js +3 -3
- package/esm/VariantFeatureWidget/stateModelFactory.d.ts +39 -39
- package/esm/VariantFeatureWidget/stateModelFactory.js +1 -1
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -7
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +3 -14
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +4 -2
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +2 -5
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +2 -2
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +34 -19
- package/esm/VariantRPC/MultiVariantGetSources.js +2 -6
- package/esm/VariantRPC/executeClusterGenotypeMatrix.d.ts +22 -0
- package/esm/VariantRPC/executeClusterGenotypeMatrix.js +19 -0
- package/esm/VariantRPC/getGenotypeMatrix.d.ts +18 -3
- package/esm/VariantRPC/getGenotypeMatrix.js +23 -40
- package/esm/VariantRPC/types.d.ts +10 -24
- package/esm/VariantTrack/configSchema.d.ts +16 -11
- package/esm/VariantTrack/index.js +13 -2
- package/esm/VariantTrack/saveTrackFormats/vcf.d.ts +4 -0
- package/esm/VariantTrack/saveTrackFormats/vcf.js +15 -0
- package/esm/VcfAdapter/VcfAdapter.d.ts +6 -3
- package/esm/VcfAdapter/VcfAdapter.js +36 -24
- package/esm/VcfAdapter/configSchema.d.ts +2 -2
- package/esm/VcfAdapter/index.js +3 -2
- package/esm/VcfExtensionPoints/index.d.ts +2 -0
- package/esm/{extensionPoints.js → VcfExtensionPoints/index.js} +1 -1
- package/esm/VcfFeature/index.js +20 -8
- package/esm/VcfFeature/util.d.ts +0 -1
- package/esm/VcfFeature/util.js +70 -188
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +2 -0
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +28 -3
- package/esm/VcfTabixAdapter/configSchema.d.ts +5 -5
- package/esm/VcfTabixAdapter/configSchema.js +1 -1
- package/esm/VcfTabixAdapter/index.d.ts +1 -1
- package/esm/VcfTabixAdapter/index.js +4 -3
- package/esm/d3-hierarchy2/accessors.d.ts +2 -0
- package/esm/d3-hierarchy2/accessors.js +8 -0
- package/esm/d3-hierarchy2/array.d.ts +2 -0
- package/esm/d3-hierarchy2/array.js +15 -0
- package/esm/d3-hierarchy2/cluster.d.ts +8 -0
- package/esm/d3-hierarchy2/cluster.js +63 -0
- package/esm/d3-hierarchy2/constant.d.ts +2 -0
- package/esm/d3-hierarchy2/constant.js +8 -0
- package/esm/d3-hierarchy2/hierarchy/ancestors.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/ancestors.js +7 -0
- package/esm/d3-hierarchy2/hierarchy/count.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/count.js +12 -0
- package/esm/d3-hierarchy2/hierarchy/descendants.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/descendants.js +3 -0
- package/esm/d3-hierarchy2/hierarchy/each.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/each.js +7 -0
- package/esm/d3-hierarchy2/hierarchy/eachAfter.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/eachAfter.js +15 -0
- package/esm/d3-hierarchy2/hierarchy/eachBefore.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/eachBefore.js +12 -0
- package/esm/d3-hierarchy2/hierarchy/find.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/find.js +8 -0
- package/esm/d3-hierarchy2/hierarchy/index.d.ts +3 -0
- package/esm/d3-hierarchy2/hierarchy/index.js +78 -0
- package/esm/d3-hierarchy2/hierarchy/iterator.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/iterator.js +14 -0
- package/esm/d3-hierarchy2/hierarchy/leaves.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/leaves.js +9 -0
- package/esm/d3-hierarchy2/hierarchy/links.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/links.js +9 -0
- package/esm/d3-hierarchy2/hierarchy/path.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/path.js +26 -0
- package/esm/d3-hierarchy2/hierarchy/sort.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/sort.js +7 -0
- package/esm/d3-hierarchy2/hierarchy/sum.d.ts +1 -0
- package/esm/d3-hierarchy2/hierarchy/sum.js +8 -0
- package/esm/d3-hierarchy2/index.d.ts +15 -0
- package/esm/d3-hierarchy2/index.js +15 -0
- package/esm/d3-hierarchy2/lcg.d.ts +1 -0
- package/esm/d3-hierarchy2/lcg.js +7 -0
- package/esm/d3-hierarchy2/pack/enclose.d.ts +10 -0
- package/esm/d3-hierarchy2/pack/enclose.js +84 -0
- package/esm/d3-hierarchy2/pack/index.d.ts +7 -0
- package/esm/d3-hierarchy2/pack/index.js +68 -0
- package/esm/d3-hierarchy2/pack/siblings.d.ts +2 -0
- package/esm/d3-hierarchy2/pack/siblings.js +94 -0
- package/esm/d3-hierarchy2/partition.d.ts +6 -0
- package/esm/d3-hierarchy2/partition.js +42 -0
- package/esm/d3-hierarchy2/stratify.d.ts +9 -0
- package/esm/d3-hierarchy2/stratify.js +115 -0
- package/esm/d3-hierarchy2/tree.d.ts +8 -0
- package/esm/d3-hierarchy2/tree.js +153 -0
- package/esm/d3-hierarchy2/treemap/binary.d.ts +1 -0
- package/esm/d3-hierarchy2/treemap/binary.js +36 -0
- package/esm/d3-hierarchy2/treemap/dice.d.ts +1 -0
- package/esm/d3-hierarchy2/treemap/dice.js +7 -0
- package/esm/d3-hierarchy2/treemap/index.d.ts +17 -0
- package/esm/d3-hierarchy2/treemap/index.js +72 -0
- package/esm/d3-hierarchy2/treemap/resquarify.d.ts +5 -0
- package/esm/d3-hierarchy2/treemap/resquarify.js +28 -0
- package/esm/d3-hierarchy2/treemap/round.d.ts +1 -0
- package/esm/d3-hierarchy2/treemap/round.js +6 -0
- package/esm/d3-hierarchy2/treemap/slice.d.ts +1 -0
- package/esm/d3-hierarchy2/treemap/slice.js +7 -0
- package/esm/d3-hierarchy2/treemap/sliceDice.d.ts +1 -0
- package/esm/d3-hierarchy2/treemap/sliceDice.js +5 -0
- package/esm/d3-hierarchy2/treemap/squarify.d.ts +11 -0
- package/esm/d3-hierarchy2/treemap/squarify.js +46 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +19 -22
- package/esm/shared/MultiVariantBaseModel.d.ts +1103 -117
- package/esm/shared/MultiVariantBaseModel.js +231 -65
- package/esm/shared/SharedVariantConfigSchema.d.ts +2 -40
- package/esm/shared/SharedVariantConfigSchema.js +1 -46
- package/esm/shared/components/AddFiltersDialog.d.ts +2 -3
- package/esm/shared/components/AddFiltersDialog.js +20 -28
- package/esm/shared/components/{ui/SetColorDialog.d.ts → BaseSetColorDialog.d.ts} +2 -1
- package/esm/shared/components/BaseSetColorDialog.js +61 -0
- package/esm/shared/components/ClearTreeWarningDialog.d.ts +4 -0
- package/esm/shared/components/ClearTreeWarningDialog.js +9 -0
- package/esm/shared/components/MAFFilterDialog.d.ts +2 -3
- package/esm/shared/components/MAFFilterDialog.js +4 -8
- package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +1 -1
- package/esm/shared/components/MultiVariantBaseDisplayComponent.js +8 -17
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +1 -1
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.js +3 -3
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +1 -1
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +9 -14
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +1 -1
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +11 -15
- package/esm/shared/components/MultiVariantClusterDialog/types.d.ts +3 -2
- package/esm/shared/components/MultiVariantColorLegend.d.ts +1 -1
- package/esm/shared/components/MultiVariantColorLegend.js +22 -12
- package/esm/shared/components/MultiVariantCrosshairs.d.ts +4 -2
- package/esm/shared/components/MultiVariantCrosshairs.js +31 -23
- package/esm/shared/components/MultiVariantLegendBar.d.ts +4 -4
- package/esm/shared/components/MultiVariantLegendBar.js +24 -22
- package/esm/shared/components/MultiVariantLegendBarWrapper.d.ts +7 -0
- package/esm/shared/components/MultiVariantLegendBarWrapper.js +18 -0
- package/esm/shared/components/MultiVariantTooltip.d.ts +5 -6
- package/esm/shared/components/MultiVariantTooltip.js +35 -17
- package/esm/shared/components/ScrollableVariantContainer.d.ts +8 -0
- package/esm/shared/components/ScrollableVariantContainer.js +23 -0
- package/esm/shared/components/SetColorDialog.d.ts +3 -2
- package/esm/shared/components/SetColorDialog.js +2 -2
- package/esm/shared/components/SetColorDialogBulkEditPanel.d.ts +7 -8
- package/esm/shared/components/SetColorDialogBulkEditPanel.js +24 -54
- package/esm/shared/components/SetColorDialogRowPalettizer.js +13 -23
- package/esm/shared/components/SetRowHeightDialog.d.ts +2 -3
- package/esm/shared/components/SourcesDataGrid.d.ts +1 -1
- package/esm/shared/components/SourcesDataGrid.js +1 -1
- package/esm/shared/components/SourcesGrid.d.ts +1 -1
- package/esm/shared/components/SourcesGrid.js +2 -2
- package/esm/shared/components/SourcesGridHeader.d.ts +1 -1
- package/esm/shared/components/SourcesGridHeader.js +1 -1
- package/esm/shared/components/SvgTree.d.ts +5 -0
- package/esm/shared/components/SvgTree.js +19 -0
- package/esm/shared/components/TreeSidebar.d.ts +5 -0
- package/esm/shared/components/TreeSidebar.js +121 -0
- package/esm/shared/components/types.d.ts +43 -0
- package/esm/shared/components/types.js +1 -0
- package/esm/shared/constants.d.ts +8 -2
- package/esm/shared/constants.js +11 -2
- package/esm/shared/drawAlleleCount.d.ts +2 -1
- package/esm/shared/drawAlleleCount.js +50 -16
- package/esm/shared/drawPhased.js +11 -12
- package/{dist → esm/shared}/getMultiVariantFeaturesAutorun.d.ts +5 -4
- package/esm/{getMultiVariantFeaturesAutorun.js → shared/getMultiVariantFeaturesAutorun.js} +9 -2
- package/esm/{getMultiVariantSourcesAutorun.d.ts → shared/getMultiVariantSourcesAutorun.d.ts} +4 -3
- package/esm/{getMultiVariantSourcesAutorun.js → shared/getMultiVariantSourcesAutorun.js} +10 -2
- package/esm/shared/getSources.d.ts +1 -1
- package/esm/shared/getSources.js +2 -2
- package/esm/shared/hooks/useMouseTracking.d.ts +6 -0
- package/esm/shared/hooks/useMouseTracking.js +34 -0
- package/esm/shared/makeSidebarSvg.d.ts +9 -0
- package/esm/shared/makeSidebarSvg.js +9 -0
- package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -5
- package/esm/shared/minorAlleleFrequencyUtils.js +37 -38
- package/esm/shared/setupMultiVariantAutoruns.d.ts +2 -0
- package/esm/shared/setupMultiVariantAutoruns.js +8 -0
- package/esm/shared/treeDrawingAutorun.d.ts +16 -0
- package/esm/shared/treeDrawingAutorun.js +71 -0
- package/esm/shared/types.d.ts +15 -0
- package/package.json +38 -39
- package/dist/ChordVariantDisplay/index.d.ts +0 -2
- package/dist/ChordVariantDisplay/index.js +0 -25
- package/dist/ChordVariantDisplay/models/configSchema.d.ts +0 -12
- package/dist/ChordVariantDisplay/models/configSchema.js +0 -15
- package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +0 -115
- package/dist/ChordVariantDisplay/models/stateModelFactory.js +0 -35
- package/dist/LinearVariantDisplay/configSchema.d.ts +0 -34
- package/dist/LinearVariantDisplay/configSchema.js +0 -12
- package/dist/LinearVariantDisplay/index.d.ts +0 -2
- package/dist/LinearVariantDisplay/index.js +0 -24
- package/dist/LinearVariantDisplay/model.d.ts +0 -278
- package/dist/LinearVariantDisplay/model.js +0 -37
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +0 -5
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +0 -29
- package/dist/MultiLinearVariantDisplay/configSchema.d.ts +0 -80
- package/dist/MultiLinearVariantDisplay/configSchema.js +0 -30
- package/dist/MultiLinearVariantDisplay/index.d.ts +0 -2
- package/dist/MultiLinearVariantDisplay/index.js +0 -57
- package/dist/MultiLinearVariantDisplay/model.d.ts +0 -422
- package/dist/MultiLinearVariantDisplay/model.js +0 -82
- package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +0 -3
- package/dist/MultiLinearVariantDisplay/renderSvg.js +0 -15
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +0 -6
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +0 -83
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +0 -5
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +0 -31
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.d.ts +0 -37
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.js +0 -22
- package/dist/MultiLinearVariantMatrixDisplay/index.d.ts +0 -2
- package/dist/MultiLinearVariantMatrixDisplay/index.js +0 -24
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +0 -431
- package/dist/MultiLinearVariantMatrixDisplay/model.js +0 -125
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +0 -3
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +0 -17
- package/dist/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.d.ts +0 -37
- package/dist/MultiLinearVariantMatrixRenderer/MultiLinearVariantMatrixRenderer.js +0 -87
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +0 -8
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +0 -41
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.d.ts +0 -2
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.js +0 -6
- package/dist/MultiLinearVariantMatrixRenderer/index.d.ts +0 -2
- package/dist/MultiLinearVariantMatrixRenderer/index.js +0 -20
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +0 -14
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +0 -154
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +0 -14
- package/dist/MultiLinearVariantMatrixRenderer/types.js +0 -2
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +0 -63
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +0 -79
- package/dist/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.d.ts +0 -33
- package/dist/MultiLinearVariantRenderer/components/MultiLinearVariantRendering.js +0 -67
- package/dist/MultiLinearVariantRenderer/components/util.d.ts +0 -1
- package/dist/MultiLinearVariantRenderer/components/util.js +0 -15
- package/dist/MultiLinearVariantRenderer/configSchema.d.ts +0 -2
- package/dist/MultiLinearVariantRenderer/configSchema.js +0 -8
- package/dist/MultiLinearVariantRenderer/index.d.ts +0 -2
- package/dist/MultiLinearVariantRenderer/index.js +0 -19
- package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +0 -14
- package/dist/MultiLinearVariantRenderer/makeImageData.js +0 -140
- package/dist/MultiLinearVariantRenderer/types.d.ts +0 -21
- package/dist/MultiLinearVariantRenderer/types.js +0 -2
- package/dist/MultiVariantBaseRenderer.d.ts +0 -46
- package/dist/MultiVariantBaseRenderer.js +0 -39
- package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.d.ts +0 -18
- package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +0 -92
- package/dist/SplitVcfTabixAdapter/configSchema.d.ts +0 -23
- package/dist/SplitVcfTabixAdapter/configSchema.js +0 -29
- package/dist/SplitVcfTabixAdapter/index.d.ts +0 -3
- package/dist/SplitVcfTabixAdapter/index.js +0 -52
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +0 -13
- package/dist/StructuralVariantChordRenderer/Chord.js +0 -82
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +0 -16
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +0 -30
- package/dist/StructuralVariantChordRenderer/configSchema.d.ts +0 -21
- package/dist/StructuralVariantChordRenderer/configSchema.js +0 -25
- package/dist/StructuralVariantChordRenderer/index.d.ts +0 -2
- package/dist/StructuralVariantChordRenderer/index.js +0 -18
- package/dist/StructuralVariantChordRenderer/types.d.ts +0 -17
- package/dist/StructuralVariantChordRenderer/types.js +0 -2
- package/dist/Tooltip.d.ts +0 -19
- package/dist/Tooltip.js +0 -32
- package/dist/VariantFeatureWidget/AltFormatter.d.ts +0 -4
- package/dist/VariantFeatureWidget/AltFormatter.js +0 -13
- package/dist/VariantFeatureWidget/Checkbox2.d.ts +0 -6
- package/dist/VariantFeatureWidget/Checkbox2.js +0 -8
- package/dist/VariantFeatureWidget/Formatter.d.ts +0 -3
- package/dist/VariantFeatureWidget/Formatter.js +0 -23
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.d.ts +0 -1
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.js +0 -5
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.d.ts +0 -1
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.js +0 -5
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.d.ts +0 -7
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendPanel.js +0 -111
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.d.ts +0 -4
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.js +0 -60
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/index.d.ts +0 -1
- package/dist/VariantFeatureWidget/LaunchBreakendPanel/index.js +0 -8
- package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGrid.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGrid.js +0 -15
- package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGridWrapper.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantConsequence/VariantConsequenceDataGridWrapper.js +0 -18
- package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +0 -103
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +0 -4
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +0 -80
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleFilters.d.ts +0 -9
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleFilters.js +0 -10
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +0 -6
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +0 -54
- package/dist/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantSampleGrid/getSampleGridRows.js +0 -51
- package/dist/VariantFeatureWidget/VariantSampleGrid/index.d.ts +0 -1
- package/dist/VariantFeatureWidget/VariantSampleGrid/index.js +0 -8
- package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +0 -21
- package/dist/VariantFeatureWidget/VariantSampleGrid/types.js +0 -2
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +0 -1
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +0 -14
- package/dist/VariantFeatureWidget/configSchema.d.ts +0 -1
- package/dist/VariantFeatureWidget/configSchema.js +0 -5
- package/dist/VariantFeatureWidget/index.d.ts +0 -2
- package/dist/VariantFeatureWidget/index.js +0 -52
- package/dist/VariantFeatureWidget/stateModelFactory.d.ts +0 -104
- package/dist/VariantFeatureWidget/stateModelFactory.js +0 -12
- package/dist/VariantFeatureWidget/types.d.ts +0 -16
- package/dist/VariantFeatureWidget/types.js +0 -2
- package/dist/VariantFeatureWidget/variantFieldDescriptions.d.ts +0 -9
- package/dist/VariantFeatureWidget/variantFieldDescriptions.js +0 -12
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +0 -14
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +0 -30
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +0 -6
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +0 -21
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +0 -19
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +0 -58
- package/dist/VariantRPC/MultiVariantGetSources.d.ts +0 -14
- package/dist/VariantRPC/MultiVariantGetSources.js +0 -22
- package/dist/VariantRPC/getGenotypeMatrix.d.ts +0 -6
- package/dist/VariantRPC/getGenotypeMatrix.js +0 -68
- package/dist/VariantRPC/types.d.ts +0 -36
- package/dist/VariantRPC/types.js +0 -2
- package/dist/VariantTrack/configSchema.d.ts +0 -79
- package/dist/VariantTrack/configSchema.js +0 -10
- package/dist/VariantTrack/index.d.ts +0 -2
- package/dist/VariantTrack/index.js +0 -20
- package/dist/VcfAdapter/VcfAdapter.d.ts +0 -35
- package/dist/VcfAdapter/VcfAdapter.js +0 -119
- package/dist/VcfAdapter/configSchema.d.ts +0 -18
- package/dist/VcfAdapter/configSchema.js +0 -35
- package/dist/VcfAdapter/index.d.ts +0 -2
- package/dist/VcfAdapter/index.js +0 -49
- package/dist/VcfAdapter/vcfParser.d.ts +0 -7
- package/dist/VcfAdapter/vcfParser.js +0 -26
- package/dist/VcfFeature/index.d.ts +0 -19
- package/dist/VcfFeature/index.js +0 -80
- package/dist/VcfFeature/util.d.ts +0 -6
- package/dist/VcfFeature/util.js +0 -227
- package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +0 -25
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +0 -117
- package/dist/VcfTabixAdapter/configSchema.d.ts +0 -32
- package/dist/VcfTabixAdapter/configSchema.js +0 -56
- package/dist/VcfTabixAdapter/index.d.ts +0 -3
- package/dist/VcfTabixAdapter/index.js +0 -52
- package/dist/extensionPoints.d.ts +0 -2
- package/dist/extensionPoints.js +0 -39
- package/dist/getMultiVariantFeaturesAutorun.js +0 -48
- package/dist/getMultiVariantSourcesAutorun.d.ts +0 -11
- package/dist/getMultiVariantSourcesAutorun.js +0 -38
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -52
- package/dist/shared/MultiVariantBaseModel.d.ts +0 -413
- package/dist/shared/MultiVariantBaseModel.js +0 -373
- package/dist/shared/SharedVariantConfigSchema.d.ts +0 -66
- package/dist/shared/SharedVariantConfigSchema.js +0 -56
- package/dist/shared/SharedVariantMixin.d.ts +0 -325
- package/dist/shared/SharedVariantMixin.js +0 -58
- package/dist/shared/components/AddFiltersDialog.d.ts +0 -9
- package/dist/shared/components/AddFiltersDialog.js +0 -61
- package/dist/shared/components/MAFFilterDialog.d.ts +0 -8
- package/dist/shared/components/MAFFilterDialog.js +0 -28
- package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +0 -5
- package/dist/shared/components/MultiVariantBaseDisplayComponent.js +0 -29
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.d.ts +0 -6
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.js +0 -29
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +0 -7
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +0 -74
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +0 -7
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +0 -145
- package/dist/shared/components/MultiVariantClusterDialog/types.d.ts +0 -10
- package/dist/shared/components/MultiVariantClusterDialog/types.js +0 -2
- package/dist/shared/components/MultiVariantColorLegend.d.ts +0 -10
- package/dist/shared/components/MultiVariantColorLegend.js +0 -24
- package/dist/shared/components/MultiVariantCrosshairs.d.ts +0 -7
- package/dist/shared/components/MultiVariantCrosshairs.js +0 -40
- package/dist/shared/components/MultiVariantLegendBar.d.ts +0 -7
- package/dist/shared/components/MultiVariantLegendBar.js +0 -32
- package/dist/shared/components/MultiVariantTooltip.d.ts +0 -10
- package/dist/shared/components/MultiVariantTooltip.js +0 -24
- package/dist/shared/components/RectBg.d.ts +0 -8
- package/dist/shared/components/RectBg.js +0 -10
- package/dist/shared/components/SetColorDialog.d.ts +0 -11
- package/dist/shared/components/SetColorDialog.js +0 -12
- package/dist/shared/components/SetColorDialogBulkEditPanel.d.ts +0 -10
- package/dist/shared/components/SetColorDialogBulkEditPanel.js +0 -84
- package/dist/shared/components/SetColorDialogHelpfulTips.d.ts +0 -1
- package/dist/shared/components/SetColorDialogHelpfulTips.js +0 -7
- package/dist/shared/components/SetColorDialogRowPalettizer.d.ts +0 -10
- package/dist/shared/components/SetColorDialogRowPalettizer.js +0 -41
- package/dist/shared/components/SetMinMaxDialog.d.ts +0 -10
- package/dist/shared/components/SetMinMaxDialog.js +0 -26
- package/dist/shared/components/SetRowHeightDialog.d.ts +0 -8
- package/dist/shared/components/SetRowHeightDialog.js +0 -18
- package/dist/shared/components/SourcesDataGrid.d.ts +0 -7
- package/dist/shared/components/SourcesDataGrid.js +0 -68
- package/dist/shared/components/SourcesGrid.d.ts +0 -7
- package/dist/shared/components/SourcesGrid.js +0 -14
- package/dist/shared/components/SourcesGridHeader.d.ts +0 -8
- package/dist/shared/components/SourcesGridHeader.js +0 -41
- package/dist/shared/components/ui/SetColorDialog.d.ts +0 -31
- package/dist/shared/components/ui/SetColorDialog.js +0 -51
- package/dist/shared/components/ui/SetColorDialogBulkEditPanel.d.ts +0 -10
- package/dist/shared/components/ui/SetColorDialogBulkEditPanel.js +0 -84
- package/dist/shared/components/ui/SetColorDialogHelpfulTips.d.ts +0 -1
- package/dist/shared/components/ui/SetColorDialogHelpfulTips.js +0 -7
- package/dist/shared/components/ui/SetColorDialogRowPalettizer.d.ts +0 -10
- package/dist/shared/components/ui/SetColorDialogRowPalettizer.js +0 -41
- package/dist/shared/constants.d.ts +0 -2
- package/dist/shared/constants.js +0 -5
- package/dist/shared/drawAlleleCount.d.ts +0 -2
- package/dist/shared/drawAlleleCount.js +0 -50
- package/dist/shared/drawPhased.d.ts +0 -1
- package/dist/shared/drawPhased.js +0 -25
- package/dist/shared/findSecondLargestNumber.d.ts +0 -0
- package/dist/shared/findSecondLargestNumber.js +0 -1
- package/dist/shared/getSources.d.ts +0 -15
- package/dist/shared/getSources.js +0 -34
- package/dist/shared/minorAlleleFrequencyUtils.d.ts +0 -14
- package/dist/shared/minorAlleleFrequencyUtils.js +0 -72
- package/dist/shared/sourcesGridUtils.d.ts +0 -11
- package/dist/shared/sourcesGridUtils.js +0 -32
- package/dist/shared/types.d.ts +0 -14
- package/dist/shared/types.js +0 -2
- package/dist/shared/util.d.ts +0 -2
- package/dist/shared/util.js +0 -21
- package/dist/util.d.ts +0 -0
- package/dist/util.js +0 -1
- package/esm/MultiVariantBaseRenderer.d.ts +0 -46
- package/esm/MultiVariantBaseRenderer.js +0 -33
- package/esm/VariantFeatureWidget/Checkbox2.d.ts +0 -6
- package/esm/VariantFeatureWidget/Checkbox2.js +0 -5
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.d.ts +0 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendMultiLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.d.ts +0 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/BreakendSingleLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.d.ts +0 -4
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/LaunchBreakendWidgetArea.js +0 -24
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/index.d.ts +0 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel/index.js +0 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid/index.d.ts +0 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid/index.js +0 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +0 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +0 -11
- package/esm/extensionPoints.d.ts +0 -2
- package/esm/getMultiVariantFeaturesAutorun.d.ts +0 -18
- package/esm/shared/SharedVariantMixin.d.ts +0 -325
- package/esm/shared/SharedVariantMixin.js +0 -55
- package/esm/shared/components/ui/SetColorDialog.js +0 -45
- package/esm/shared/components/ui/SetColorDialogBulkEditPanel.d.ts +0 -10
- package/esm/shared/components/ui/SetColorDialogBulkEditPanel.js +0 -81
- package/esm/shared/components/ui/SetColorDialogHelpfulTips.d.ts +0 -1
- package/esm/shared/components/ui/SetColorDialogHelpfulTips.js +0 -4
- package/esm/shared/components/ui/SetColorDialogRowPalettizer.d.ts +0 -10
- package/esm/shared/components/ui/SetColorDialogRowPalettizer.js +0 -38
- package/esm/shared/findSecondLargestNumber.d.ts +0 -0
- package/esm/shared/findSecondLargestNumber.js +0 -1
- package/esm/shared/util.d.ts +0 -2
- package/esm/shared/util.js +0 -17
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import array from "../array.js";
|
|
2
|
+
import lcg from "../lcg.js";
|
|
3
|
+
import { packEncloseRandom } from "./enclose.js";
|
|
4
|
+
function place(b, a, c) {
|
|
5
|
+
var dx = b.x - a.x, x, a2, dy = b.y - a.y, y, b2, d2 = dx * dx + dy * dy;
|
|
6
|
+
if (d2) {
|
|
7
|
+
a2 = a.r + c.r, a2 *= a2;
|
|
8
|
+
b2 = b.r + c.r, b2 *= b2;
|
|
9
|
+
if (a2 > b2) {
|
|
10
|
+
x = (d2 + b2 - a2) / (2 * d2);
|
|
11
|
+
y = Math.sqrt(Math.max(0, b2 / d2 - x * x));
|
|
12
|
+
c.x = b.x - x * dx - y * dy;
|
|
13
|
+
c.y = b.y - x * dy + y * dx;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
x = (d2 + a2 - b2) / (2 * d2);
|
|
17
|
+
y = Math.sqrt(Math.max(0, a2 / d2 - x * x));
|
|
18
|
+
c.x = a.x + x * dx - y * dy;
|
|
19
|
+
c.y = a.y + x * dy + y * dx;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
c.x = a.x + c.r;
|
|
24
|
+
c.y = a.y;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function intersects(a, b) {
|
|
28
|
+
var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;
|
|
29
|
+
return dr > 0 && dr * dr > dx * dx + dy * dy;
|
|
30
|
+
}
|
|
31
|
+
function score(node) {
|
|
32
|
+
var a = node._, b = node.next._, ab = a.r + b.r, dx = (a.x * b.r + b.x * a.r) / ab, dy = (a.y * b.r + b.y * a.r) / ab;
|
|
33
|
+
return dx * dx + dy * dy;
|
|
34
|
+
}
|
|
35
|
+
function Node(circle) {
|
|
36
|
+
this._ = circle;
|
|
37
|
+
this.next = null;
|
|
38
|
+
this.previous = null;
|
|
39
|
+
}
|
|
40
|
+
export function packSiblingsRandom(circles, random) {
|
|
41
|
+
if (!(n = (circles = array(circles)).length))
|
|
42
|
+
return 0;
|
|
43
|
+
var a, b, c, n, aa, ca, i, j, k, sj, sk;
|
|
44
|
+
a = circles[0], a.x = 0, a.y = 0;
|
|
45
|
+
if (!(n > 1))
|
|
46
|
+
return a.r;
|
|
47
|
+
b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;
|
|
48
|
+
if (!(n > 2))
|
|
49
|
+
return a.r + b.r;
|
|
50
|
+
place(b, a, c = circles[2]);
|
|
51
|
+
a = new Node(a), b = new Node(b), c = new Node(c);
|
|
52
|
+
a.next = c.previous = b;
|
|
53
|
+
b.next = a.previous = c;
|
|
54
|
+
c.next = b.previous = a;
|
|
55
|
+
pack: for (i = 3; i < n; ++i) {
|
|
56
|
+
place(a._, b._, c = circles[i]), c = new Node(c);
|
|
57
|
+
j = b.next, k = a.previous, sj = b._.r, sk = a._.r;
|
|
58
|
+
do {
|
|
59
|
+
if (sj <= sk) {
|
|
60
|
+
if (intersects(j._, c._)) {
|
|
61
|
+
b = j, a.next = b, b.previous = a, --i;
|
|
62
|
+
continue pack;
|
|
63
|
+
}
|
|
64
|
+
sj += j._.r, j = j.next;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if (intersects(k._, c._)) {
|
|
68
|
+
a = k, a.next = b, b.previous = a, --i;
|
|
69
|
+
continue pack;
|
|
70
|
+
}
|
|
71
|
+
sk += k._.r, k = k.previous;
|
|
72
|
+
}
|
|
73
|
+
} while (j !== k.next);
|
|
74
|
+
c.previous = a, c.next = b, a.next = b.previous = b = c;
|
|
75
|
+
aa = score(a);
|
|
76
|
+
while ((c = c.next) !== b) {
|
|
77
|
+
if ((ca = score(c)) < aa) {
|
|
78
|
+
a = c, aa = ca;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
b = a.next;
|
|
82
|
+
}
|
|
83
|
+
a = [b._], c = b;
|
|
84
|
+
while ((c = c.next) !== b)
|
|
85
|
+
a.push(c._);
|
|
86
|
+
c = packEncloseRandom(a, random);
|
|
87
|
+
for (i = 0; i < n; ++i)
|
|
88
|
+
a = circles[i], a.x -= c.x, a.y -= c.y;
|
|
89
|
+
return c.r;
|
|
90
|
+
}
|
|
91
|
+
export default function (circles) {
|
|
92
|
+
packSiblingsRandom(circles, lcg());
|
|
93
|
+
return circles;
|
|
94
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import roundNode from "./treemap/round.js";
|
|
2
|
+
import treemapDice from "./treemap/dice.js";
|
|
3
|
+
export default function () {
|
|
4
|
+
var dx = 1, dy = 1, padding = 0, round = false;
|
|
5
|
+
function partition(root) {
|
|
6
|
+
var n = root.height + 1;
|
|
7
|
+
root.x0 =
|
|
8
|
+
root.y0 = padding;
|
|
9
|
+
root.x1 = dx;
|
|
10
|
+
root.y1 = dy / n;
|
|
11
|
+
root.eachBefore(positionNode(dy, n));
|
|
12
|
+
if (round)
|
|
13
|
+
root.eachBefore(roundNode);
|
|
14
|
+
return root;
|
|
15
|
+
}
|
|
16
|
+
function positionNode(dy, n) {
|
|
17
|
+
return function (node) {
|
|
18
|
+
if (node.children) {
|
|
19
|
+
treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);
|
|
20
|
+
}
|
|
21
|
+
var x0 = node.x0, y0 = node.y0, x1 = node.x1 - padding, y1 = node.y1 - padding;
|
|
22
|
+
if (x1 < x0)
|
|
23
|
+
x0 = x1 = (x0 + x1) / 2;
|
|
24
|
+
if (y1 < y0)
|
|
25
|
+
y0 = y1 = (y0 + y1) / 2;
|
|
26
|
+
node.x0 = x0;
|
|
27
|
+
node.y0 = y0;
|
|
28
|
+
node.x1 = x1;
|
|
29
|
+
node.y1 = y1;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
partition.round = function (x) {
|
|
33
|
+
return arguments.length ? (round = !!x, partition) : round;
|
|
34
|
+
};
|
|
35
|
+
partition.size = function (x) {
|
|
36
|
+
return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];
|
|
37
|
+
};
|
|
38
|
+
partition.padding = function (x) {
|
|
39
|
+
return arguments.length ? (padding = +x, partition) : padding;
|
|
40
|
+
};
|
|
41
|
+
return partition;
|
|
42
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { optional } from "./accessors.js";
|
|
2
|
+
import { Node, computeHeight } from "./hierarchy/index.js";
|
|
3
|
+
var preroot = { depth: -1 }, ambiguous = {}, imputed = {};
|
|
4
|
+
function defaultId(d) {
|
|
5
|
+
return d.id;
|
|
6
|
+
}
|
|
7
|
+
function defaultParentId(d) {
|
|
8
|
+
return d.parentId;
|
|
9
|
+
}
|
|
10
|
+
export default function () {
|
|
11
|
+
var id = defaultId, parentId = defaultParentId, path;
|
|
12
|
+
function stratify(data) {
|
|
13
|
+
var nodes = Array.from(data), currentId = id, currentParentId = parentId, n, d, i, root, parent, node, nodeId, nodeKey, nodeByKey = new Map;
|
|
14
|
+
if (path != null) {
|
|
15
|
+
const I = nodes.map((d, i) => normalize(path(d, i, data)));
|
|
16
|
+
const P = I.map(parentof);
|
|
17
|
+
const S = new Set(I).add("");
|
|
18
|
+
for (const i of P) {
|
|
19
|
+
if (!S.has(i)) {
|
|
20
|
+
S.add(i);
|
|
21
|
+
I.push(i);
|
|
22
|
+
P.push(parentof(i));
|
|
23
|
+
nodes.push(imputed);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
currentId = (_, i) => I[i];
|
|
27
|
+
currentParentId = (_, i) => P[i];
|
|
28
|
+
}
|
|
29
|
+
for (i = 0, n = nodes.length; i < n; ++i) {
|
|
30
|
+
d = nodes[i], node = nodes[i] = new Node(d);
|
|
31
|
+
if ((nodeId = currentId(d, i, data)) != null && (nodeId += "")) {
|
|
32
|
+
nodeKey = node.id = nodeId;
|
|
33
|
+
nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);
|
|
34
|
+
}
|
|
35
|
+
if ((nodeId = currentParentId(d, i, data)) != null && (nodeId += "")) {
|
|
36
|
+
node.parent = nodeId;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
for (i = 0; i < n; ++i) {
|
|
40
|
+
node = nodes[i];
|
|
41
|
+
if (nodeId = node.parent) {
|
|
42
|
+
parent = nodeByKey.get(nodeId);
|
|
43
|
+
if (!parent)
|
|
44
|
+
throw new Error("missing: " + nodeId);
|
|
45
|
+
if (parent === ambiguous)
|
|
46
|
+
throw new Error("ambiguous: " + nodeId);
|
|
47
|
+
if (parent.children)
|
|
48
|
+
parent.children.push(node);
|
|
49
|
+
else
|
|
50
|
+
parent.children = [node];
|
|
51
|
+
node.parent = parent;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (root)
|
|
55
|
+
throw new Error("multiple roots");
|
|
56
|
+
root = node;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (!root)
|
|
60
|
+
throw new Error("no root");
|
|
61
|
+
if (path != null) {
|
|
62
|
+
while (root.data === imputed && root.children.length === 1) {
|
|
63
|
+
root = root.children[0], --n;
|
|
64
|
+
}
|
|
65
|
+
for (let i = nodes.length - 1; i >= 0; --i) {
|
|
66
|
+
node = nodes[i];
|
|
67
|
+
if (node.data !== imputed)
|
|
68
|
+
break;
|
|
69
|
+
node.data = null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
root.parent = preroot;
|
|
73
|
+
root.eachBefore(function (node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);
|
|
74
|
+
root.parent = null;
|
|
75
|
+
if (n > 0)
|
|
76
|
+
throw new Error("cycle");
|
|
77
|
+
return root;
|
|
78
|
+
}
|
|
79
|
+
stratify.id = function (x) {
|
|
80
|
+
return arguments.length ? (id = optional(x), stratify) : id;
|
|
81
|
+
};
|
|
82
|
+
stratify.parentId = function (x) {
|
|
83
|
+
return arguments.length ? (parentId = optional(x), stratify) : parentId;
|
|
84
|
+
};
|
|
85
|
+
stratify.path = function (x) {
|
|
86
|
+
return arguments.length ? (path = optional(x), stratify) : path;
|
|
87
|
+
};
|
|
88
|
+
return stratify;
|
|
89
|
+
}
|
|
90
|
+
function normalize(path) {
|
|
91
|
+
path = `${path}`;
|
|
92
|
+
let i = path.length;
|
|
93
|
+
if (slash(path, i - 1) && !slash(path, i - 2))
|
|
94
|
+
path = path.slice(0, -1);
|
|
95
|
+
return path[0] === "/" ? path : `/${path}`;
|
|
96
|
+
}
|
|
97
|
+
function parentof(path) {
|
|
98
|
+
let i = path.length;
|
|
99
|
+
if (i < 2)
|
|
100
|
+
return "";
|
|
101
|
+
while (--i > 1)
|
|
102
|
+
if (slash(path, i))
|
|
103
|
+
break;
|
|
104
|
+
return path.slice(0, i);
|
|
105
|
+
}
|
|
106
|
+
function slash(path, i) {
|
|
107
|
+
if (path[i] === "/") {
|
|
108
|
+
let k = 0;
|
|
109
|
+
while (i > 0 && path[--i] === "\\")
|
|
110
|
+
++k;
|
|
111
|
+
if ((k & 1) === 0)
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Node } from "./hierarchy/index.js";
|
|
2
|
+
function defaultSeparation(a, b) {
|
|
3
|
+
return a.parent === b.parent ? 1 : 2;
|
|
4
|
+
}
|
|
5
|
+
function nextLeft(v) {
|
|
6
|
+
var children = v.children;
|
|
7
|
+
return children ? children[0] : v.t;
|
|
8
|
+
}
|
|
9
|
+
function nextRight(v) {
|
|
10
|
+
var children = v.children;
|
|
11
|
+
return children ? children[children.length - 1] : v.t;
|
|
12
|
+
}
|
|
13
|
+
function moveSubtree(wm, wp, shift) {
|
|
14
|
+
var change = shift / (wp.i - wm.i);
|
|
15
|
+
wp.c -= change;
|
|
16
|
+
wp.s += shift;
|
|
17
|
+
wm.c += change;
|
|
18
|
+
wp.z += shift;
|
|
19
|
+
wp.m += shift;
|
|
20
|
+
}
|
|
21
|
+
function executeShifts(v) {
|
|
22
|
+
var shift = 0, change = 0, children = v.children, i = children.length, w;
|
|
23
|
+
while (--i >= 0) {
|
|
24
|
+
w = children[i];
|
|
25
|
+
w.z += shift;
|
|
26
|
+
w.m += shift;
|
|
27
|
+
shift += w.s + (change += w.c);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function nextAncestor(vim, v, ancestor) {
|
|
31
|
+
return vim.a.parent === v.parent ? vim.a : ancestor;
|
|
32
|
+
}
|
|
33
|
+
function TreeNode(node, i) {
|
|
34
|
+
this._ = node;
|
|
35
|
+
this.parent = null;
|
|
36
|
+
this.children = null;
|
|
37
|
+
this.A = null;
|
|
38
|
+
this.a = this;
|
|
39
|
+
this.z = 0;
|
|
40
|
+
this.m = 0;
|
|
41
|
+
this.c = 0;
|
|
42
|
+
this.s = 0;
|
|
43
|
+
this.t = null;
|
|
44
|
+
this.i = i;
|
|
45
|
+
}
|
|
46
|
+
TreeNode.prototype = Object.create(Node.prototype);
|
|
47
|
+
function treeRoot(root) {
|
|
48
|
+
var tree = new TreeNode(root, 0), node, nodes = [tree], child, children, i, n;
|
|
49
|
+
while (node = nodes.pop()) {
|
|
50
|
+
if (children = node._.children) {
|
|
51
|
+
node.children = new Array(n = children.length);
|
|
52
|
+
for (i = n - 1; i >= 0; --i) {
|
|
53
|
+
nodes.push(child = node.children[i] = new TreeNode(children[i], i));
|
|
54
|
+
child.parent = node;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
(tree.parent = new TreeNode(null, 0)).children = [tree];
|
|
59
|
+
return tree;
|
|
60
|
+
}
|
|
61
|
+
export default function () {
|
|
62
|
+
var separation = defaultSeparation, dx = 1, dy = 1, nodeSize = null;
|
|
63
|
+
function tree(root) {
|
|
64
|
+
var t = treeRoot(root);
|
|
65
|
+
t.eachAfter(firstWalk), t.parent.m = -t.z;
|
|
66
|
+
t.eachBefore(secondWalk);
|
|
67
|
+
if (nodeSize)
|
|
68
|
+
root.eachBefore(sizeNode);
|
|
69
|
+
else {
|
|
70
|
+
var left = root, right = root, bottom = root;
|
|
71
|
+
root.eachBefore(function (node) {
|
|
72
|
+
if (node.x < left.x)
|
|
73
|
+
left = node;
|
|
74
|
+
if (node.x > right.x)
|
|
75
|
+
right = node;
|
|
76
|
+
if (node.depth > bottom.depth)
|
|
77
|
+
bottom = node;
|
|
78
|
+
});
|
|
79
|
+
var s = left === right ? 1 : separation(left, right) / 2, tx = s - left.x, kx = dx / (right.x + s + tx), ky = dy / (bottom.depth || 1);
|
|
80
|
+
root.eachBefore(function (node) {
|
|
81
|
+
node.x = (node.x + tx) * kx;
|
|
82
|
+
node.y = node.depth * ky;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return root;
|
|
86
|
+
}
|
|
87
|
+
function firstWalk(v) {
|
|
88
|
+
var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
|
|
89
|
+
if (children) {
|
|
90
|
+
executeShifts(v);
|
|
91
|
+
var midpoint = (children[0].z + children[children.length - 1].z) / 2;
|
|
92
|
+
if (w) {
|
|
93
|
+
v.z = w.z + separation(v._, w._);
|
|
94
|
+
v.m = v.z - midpoint;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
v.z = midpoint;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else if (w) {
|
|
101
|
+
v.z = w.z + separation(v._, w._);
|
|
102
|
+
}
|
|
103
|
+
v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
|
|
104
|
+
}
|
|
105
|
+
function secondWalk(v) {
|
|
106
|
+
v._.x = v.z + v.parent.m;
|
|
107
|
+
v.m += v.parent.m;
|
|
108
|
+
}
|
|
109
|
+
function apportion(v, w, ancestor) {
|
|
110
|
+
if (w) {
|
|
111
|
+
var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
|
|
112
|
+
while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
|
|
113
|
+
vom = nextLeft(vom);
|
|
114
|
+
vop = nextRight(vop);
|
|
115
|
+
vop.a = v;
|
|
116
|
+
shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
|
|
117
|
+
if (shift > 0) {
|
|
118
|
+
moveSubtree(nextAncestor(vim, v, ancestor), v, shift);
|
|
119
|
+
sip += shift;
|
|
120
|
+
sop += shift;
|
|
121
|
+
}
|
|
122
|
+
sim += vim.m;
|
|
123
|
+
sip += vip.m;
|
|
124
|
+
som += vom.m;
|
|
125
|
+
sop += vop.m;
|
|
126
|
+
}
|
|
127
|
+
if (vim && !nextRight(vop)) {
|
|
128
|
+
vop.t = vim;
|
|
129
|
+
vop.m += sim - sop;
|
|
130
|
+
}
|
|
131
|
+
if (vip && !nextLeft(vom)) {
|
|
132
|
+
vom.t = vip;
|
|
133
|
+
vom.m += sip - som;
|
|
134
|
+
ancestor = v;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return ancestor;
|
|
138
|
+
}
|
|
139
|
+
function sizeNode(node) {
|
|
140
|
+
node.x *= dx;
|
|
141
|
+
node.y = node.depth * dy;
|
|
142
|
+
}
|
|
143
|
+
tree.separation = function (x) {
|
|
144
|
+
return arguments.length ? (separation = x, tree) : separation;
|
|
145
|
+
};
|
|
146
|
+
tree.size = function (x) {
|
|
147
|
+
return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);
|
|
148
|
+
};
|
|
149
|
+
tree.nodeSize = function (x) {
|
|
150
|
+
return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);
|
|
151
|
+
};
|
|
152
|
+
return tree;
|
|
153
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (parent: any, x0: any, y0: any, x1: any, y1: any): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default function (parent, x0, y0, x1, y1) {
|
|
2
|
+
var nodes = parent.children, i, n = nodes.length, sum, sums = new Array(n + 1);
|
|
3
|
+
for (sums[0] = sum = i = 0; i < n; ++i) {
|
|
4
|
+
sums[i + 1] = sum += nodes[i].value;
|
|
5
|
+
}
|
|
6
|
+
partition(0, n, parent.value, x0, y0, x1, y1);
|
|
7
|
+
function partition(i, j, value, x0, y0, x1, y1) {
|
|
8
|
+
if (i >= j - 1) {
|
|
9
|
+
var node = nodes[i];
|
|
10
|
+
node.x0 = x0, node.y0 = y0;
|
|
11
|
+
node.x1 = x1, node.y1 = y1;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
var valueOffset = sums[i], valueTarget = (value / 2) + valueOffset, k = i + 1, hi = j - 1;
|
|
15
|
+
while (k < hi) {
|
|
16
|
+
var mid = k + hi >>> 1;
|
|
17
|
+
if (sums[mid] < valueTarget)
|
|
18
|
+
k = mid + 1;
|
|
19
|
+
else
|
|
20
|
+
hi = mid;
|
|
21
|
+
}
|
|
22
|
+
if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k)
|
|
23
|
+
--k;
|
|
24
|
+
var valueLeft = sums[k] - valueOffset, valueRight = value - valueLeft;
|
|
25
|
+
if ((x1 - x0) > (y1 - y0)) {
|
|
26
|
+
var xk = value ? (x0 * valueRight + x1 * valueLeft) / value : x1;
|
|
27
|
+
partition(i, k, valueLeft, x0, y0, xk, y1);
|
|
28
|
+
partition(k, j, valueRight, xk, y0, x1, y1);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
var yk = value ? (y0 * valueRight + y1 * valueLeft) / value : y1;
|
|
32
|
+
partition(i, k, valueLeft, x0, y0, x1, yk);
|
|
33
|
+
partition(k, j, valueRight, x0, yk, x1, y1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (parent: any, x0: any, y0: any, x1: any, y1: any): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default function (parent, x0, y0, x1, y1) {
|
|
2
|
+
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
|
|
3
|
+
while (++i < n) {
|
|
4
|
+
node = nodes[i], node.y0 = y0, node.y1 = y1;
|
|
5
|
+
node.x0 = x0, node.x1 = x0 += node.value * k;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { constantZero } from "../constant.ts";
|
|
2
|
+
export default function (): {
|
|
3
|
+
(root: any): any;
|
|
4
|
+
round(x: any): boolean | any;
|
|
5
|
+
size(x: any): number[] | any;
|
|
6
|
+
tile(x: any): {
|
|
7
|
+
(parent: any, x0: any, y0: any, x1: any, y1: any): void;
|
|
8
|
+
ratio(x: any): any;
|
|
9
|
+
} | any;
|
|
10
|
+
padding(x: any): any;
|
|
11
|
+
paddingInner(x: any): typeof constantZero | any;
|
|
12
|
+
paddingOuter(x: any): any;
|
|
13
|
+
paddingTop(x: any): typeof constantZero | any;
|
|
14
|
+
paddingRight(x: any): typeof constantZero | any;
|
|
15
|
+
paddingBottom(x: any): typeof constantZero | any;
|
|
16
|
+
paddingLeft(x: any): typeof constantZero | any;
|
|
17
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import roundNode from "./round.js";
|
|
2
|
+
import squarify from "./squarify.js";
|
|
3
|
+
import { required } from "../accessors.js";
|
|
4
|
+
import constant, { constantZero } from "../constant.js";
|
|
5
|
+
export default function () {
|
|
6
|
+
var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
|
|
7
|
+
function treemap(root) {
|
|
8
|
+
root.x0 =
|
|
9
|
+
root.y0 = 0;
|
|
10
|
+
root.x1 = dx;
|
|
11
|
+
root.y1 = dy;
|
|
12
|
+
root.eachBefore(positionNode);
|
|
13
|
+
paddingStack = [0];
|
|
14
|
+
if (round)
|
|
15
|
+
root.eachBefore(roundNode);
|
|
16
|
+
return root;
|
|
17
|
+
}
|
|
18
|
+
function positionNode(node) {
|
|
19
|
+
var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
|
|
20
|
+
if (x1 < x0)
|
|
21
|
+
x0 = x1 = (x0 + x1) / 2;
|
|
22
|
+
if (y1 < y0)
|
|
23
|
+
y0 = y1 = (y0 + y1) / 2;
|
|
24
|
+
node.x0 = x0;
|
|
25
|
+
node.y0 = y0;
|
|
26
|
+
node.x1 = x1;
|
|
27
|
+
node.y1 = y1;
|
|
28
|
+
if (node.children) {
|
|
29
|
+
p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
|
|
30
|
+
x0 += paddingLeft(node) - p;
|
|
31
|
+
y0 += paddingTop(node) - p;
|
|
32
|
+
x1 -= paddingRight(node) - p;
|
|
33
|
+
y1 -= paddingBottom(node) - p;
|
|
34
|
+
if (x1 < x0)
|
|
35
|
+
x0 = x1 = (x0 + x1) / 2;
|
|
36
|
+
if (y1 < y0)
|
|
37
|
+
y0 = y1 = (y0 + y1) / 2;
|
|
38
|
+
tile(node, x0, y0, x1, y1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
treemap.round = function (x) {
|
|
42
|
+
return arguments.length ? (round = !!x, treemap) : round;
|
|
43
|
+
};
|
|
44
|
+
treemap.size = function (x) {
|
|
45
|
+
return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
|
|
46
|
+
};
|
|
47
|
+
treemap.tile = function (x) {
|
|
48
|
+
return arguments.length ? (tile = required(x), treemap) : tile;
|
|
49
|
+
};
|
|
50
|
+
treemap.padding = function (x) {
|
|
51
|
+
return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
|
|
52
|
+
};
|
|
53
|
+
treemap.paddingInner = function (x) {
|
|
54
|
+
return arguments.length ? (paddingInner = typeof x === "function" ? x : constant(+x), treemap) : paddingInner;
|
|
55
|
+
};
|
|
56
|
+
treemap.paddingOuter = function (x) {
|
|
57
|
+
return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
|
|
58
|
+
};
|
|
59
|
+
treemap.paddingTop = function (x) {
|
|
60
|
+
return arguments.length ? (paddingTop = typeof x === "function" ? x : constant(+x), treemap) : paddingTop;
|
|
61
|
+
};
|
|
62
|
+
treemap.paddingRight = function (x) {
|
|
63
|
+
return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap) : paddingRight;
|
|
64
|
+
};
|
|
65
|
+
treemap.paddingBottom = function (x) {
|
|
66
|
+
return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap) : paddingBottom;
|
|
67
|
+
};
|
|
68
|
+
treemap.paddingLeft = function (x) {
|
|
69
|
+
return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap) : paddingLeft;
|
|
70
|
+
};
|
|
71
|
+
return treemap;
|
|
72
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import treemapDice from "./dice.js";
|
|
2
|
+
import treemapSlice from "./slice.js";
|
|
3
|
+
import { phi, squarifyRatio } from "./squarify.js";
|
|
4
|
+
export default (function custom(ratio) {
|
|
5
|
+
function resquarify(parent, x0, y0, x1, y1) {
|
|
6
|
+
if ((rows = parent._squarify) && (rows.ratio === ratio)) {
|
|
7
|
+
var rows, row, nodes, i, j = -1, n, m = rows.length, value = parent.value;
|
|
8
|
+
while (++j < m) {
|
|
9
|
+
row = rows[j], nodes = row.children;
|
|
10
|
+
for (i = row.value = 0, n = nodes.length; i < n; ++i)
|
|
11
|
+
row.value += nodes[i].value;
|
|
12
|
+
if (row.dice)
|
|
13
|
+
treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);
|
|
14
|
+
else
|
|
15
|
+
treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);
|
|
16
|
+
value -= row.value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
|
21
|
+
rows.ratio = ratio;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
resquarify.ratio = function (x) {
|
|
25
|
+
return custom((x = +x) > 1 ? x : 1);
|
|
26
|
+
};
|
|
27
|
+
return resquarify;
|
|
28
|
+
})(phi);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (node: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (parent: any, x0: any, y0: any, x1: any, y1: any): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default function (parent, x0, y0, x1, y1) {
|
|
2
|
+
var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
|
|
3
|
+
while (++i < n) {
|
|
4
|
+
node = nodes[i], node.x0 = x0, node.x1 = x1;
|
|
5
|
+
node.y0 = y0, node.y1 = y0 += node.value * k;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (parent: any, x0: any, y0: any, x1: any, y1: any): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare var phi: number;
|
|
2
|
+
export declare function squarifyRatio(ratio: any, parent: any, x0: any, y0: any, x1: any, y1: any): {
|
|
3
|
+
value: any;
|
|
4
|
+
dice: boolean;
|
|
5
|
+
children: any;
|
|
6
|
+
}[];
|
|
7
|
+
declare const _default: {
|
|
8
|
+
(parent: any, x0: any, y0: any, x1: any, y1: any): void;
|
|
9
|
+
ratio(x: any): any;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|