@milaboratories/miplots4 1.0.129 → 1.0.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataFrame.d.ts +15 -9
- package/dist/DataFrame.d.ts.map +1 -1
- package/dist/DataFrame.js +105 -81
- package/dist/DataFrame.js.map +1 -1
- package/dist/bubble/ChartRenderer.d.ts +6 -5
- package/dist/bubble/ChartRenderer.d.ts.map +1 -1
- package/dist/bubble/ChartRenderer.js +123 -121
- package/dist/bubble/ChartRenderer.js.map +1 -1
- package/dist/bubble/components/Chart.d.ts +3 -2
- package/dist/bubble/components/Chart.d.ts.map +1 -1
- package/dist/bubble/components/Chart.js +78 -97
- package/dist/bubble/components/Chart.js.map +1 -1
- package/dist/bubble/components/ChartsGroup.d.ts +6 -5
- package/dist/bubble/components/ChartsGroup.d.ts.map +1 -1
- package/dist/bubble/components/ChartsGroup.js +39 -37
- package/dist/bubble/components/ChartsGroup.js.map +1 -1
- package/dist/bubble/getCellTooltip.d.ts +5 -0
- package/dist/bubble/getCellTooltip.d.ts.map +1 -0
- package/dist/bubble/getCellTooltip.js +28 -0
- package/dist/bubble/getCellTooltip.js.map +1 -0
- package/dist/bubble/{getCells.d.ts → getGroupedCellsData.d.ts} +4 -4
- package/dist/bubble/getGroupedCellsData.d.ts.map +1 -0
- package/dist/bubble/getGroupedCellsData.js +94 -0
- package/dist/bubble/getGroupedCellsData.js.map +1 -0
- package/dist/bubble/index.d.ts +4 -4
- package/dist/bubble/index.d.ts.map +1 -1
- package/dist/bubble/index.js +47 -42
- package/dist/bubble/index.js.map +1 -1
- package/dist/bubble/utils/calculateCaptionTails.d.ts +2 -2
- package/dist/bubble/utils/calculateCaptionTails.d.ts.map +1 -1
- package/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
- package/dist/common/Legend.d.ts.map +1 -1
- package/dist/common/Legend.js.map +1 -1
- package/dist/common/Tooltip.js +1 -1
- package/dist/common/Tooltip.js.map +1 -1
- package/dist/common/types.d.ts +1 -1
- package/dist/common/types.d.ts.map +1 -1
- package/dist/common/useDataFrame.d.ts +11 -0
- package/dist/common/useDataFrame.d.ts.map +1 -0
- package/dist/common/useDataFrame.js +20 -0
- package/dist/common/useDataFrame.js.map +1 -0
- package/dist/dendro/ChartRenderer.d.ts +9 -8
- package/dist/dendro/ChartRenderer.d.ts.map +1 -1
- package/dist/dendro/ChartRenderer.js +187 -187
- package/dist/dendro/ChartRenderer.js.map +1 -1
- package/dist/dendro/components/Chart.d.ts +8 -8
- package/dist/dendro/components/Chart.d.ts.map +1 -1
- package/dist/dendro/components/Chart.js +35 -35
- package/dist/dendro/components/Chart.js.map +1 -1
- package/dist/dendro/components/Heatmap.d.ts +3 -3
- package/dist/dendro/components/Heatmap.d.ts.map +1 -1
- package/dist/dendro/components/Heatmap.js +23 -23
- package/dist/dendro/components/Heatmap.js.map +1 -1
- package/dist/dendro/components/Legend.d.ts.map +1 -1
- package/dist/dendro/components/Legend.js.map +1 -1
- package/dist/dendro/components/LinksGroup.d.ts +6 -6
- package/dist/dendro/components/LinksGroup.d.ts.map +1 -1
- package/dist/dendro/components/LinksGroup.js +17 -17
- package/dist/dendro/components/LinksGroup.js.map +1 -1
- package/dist/dendro/components/NodesGroup.d.ts +7 -7
- package/dist/dendro/components/NodesGroup.d.ts.map +1 -1
- package/dist/dendro/components/NodesGroup.js +29 -29
- package/dist/dendro/components/NodesGroup.js.map +1 -1
- package/dist/dendro/components/types.d.ts +2 -2
- package/dist/dendro/components/types.d.ts.map +1 -1
- package/dist/dendro/getHeatmapData.d.ts +2 -2
- package/dist/dendro/getHeatmapData.d.ts.map +1 -1
- package/dist/dendro/getHeatmapData.js +48 -44
- package/dist/dendro/getHeatmapData.js.map +1 -1
- package/dist/dendro/getHierarchyData.d.ts +3 -3
- package/dist/dendro/getHierarchyData.d.ts.map +1 -1
- package/dist/dendro/getHierarchyData.js +31 -31
- package/dist/dendro/getHierarchyData.js.map +1 -1
- package/dist/dendro/index.d.ts +5 -5
- package/dist/dendro/index.d.ts.map +1 -1
- package/dist/dendro/index.js +86 -89
- package/dist/dendro/index.js.map +1 -1
- package/dist/discrete/ChartRenderer.d.ts +6 -6
- package/dist/discrete/ChartRenderer.d.ts.map +1 -1
- package/dist/discrete/ChartRenderer.js +197 -196
- package/dist/discrete/ChartRenderer.js.map +1 -1
- package/dist/discrete/DiscreteSettingsImpl.d.ts +3 -3
- package/dist/discrete/DiscreteSettingsImpl.d.ts.map +1 -1
- package/dist/discrete/DiscreteSettingsImpl.js +8 -8
- package/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
- package/dist/discrete/components/layers/BoxElement.js.map +1 -1
- package/dist/discrete/index.d.ts +1 -1
- package/dist/discrete/index.d.ts.map +1 -1
- package/dist/discrete/index.js +109 -106
- package/dist/discrete/index.js.map +1 -1
- package/dist/discrete/layers/bar.d.ts +2 -2
- package/dist/discrete/layers/bar.d.ts.map +1 -1
- package/dist/discrete/layers/bar.js +32 -37
- package/dist/discrete/layers/bar.js.map +1 -1
- package/dist/discrete/layers/binnedDots.d.ts +3 -3
- package/dist/discrete/layers/binnedDots.d.ts.map +1 -1
- package/dist/discrete/layers/binnedDots.js +66 -78
- package/dist/discrete/layers/binnedDots.js.map +1 -1
- package/dist/discrete/layers/boxes.d.ts +3 -4
- package/dist/discrete/layers/boxes.d.ts.map +1 -1
- package/dist/discrete/layers/boxes.js +59 -60
- package/dist/discrete/layers/boxes.js.map +1 -1
- package/dist/discrete/layers/dots.d.ts +2 -3
- package/dist/discrete/layers/dots.d.ts.map +1 -1
- package/dist/discrete/layers/dots.js +30 -30
- package/dist/discrete/layers/dots.js.map +1 -1
- package/dist/discrete/layers/lines.js +11 -10
- package/dist/discrete/layers/lines.js.map +1 -1
- package/dist/discrete/layers/logo.d.ts +2 -2
- package/dist/discrete/layers/logo.d.ts.map +1 -1
- package/dist/discrete/layers/logo.js +21 -21
- package/dist/discrete/layers/logo.js.map +1 -1
- package/dist/discrete/layers/pairedPoints.d.ts +2 -2
- package/dist/discrete/layers/pairedPoints.d.ts.map +1 -1
- package/dist/discrete/layers/pairedPoints.js +62 -62
- package/dist/discrete/layers/pairedPoints.js.map +1 -1
- package/dist/discrete/layers/sina.d.ts +3 -4
- package/dist/discrete/layers/sina.d.ts.map +1 -1
- package/dist/discrete/layers/sina.js +67 -71
- package/dist/discrete/layers/sina.js.map +1 -1
- package/dist/discrete/layers/stackedBar.d.ts +1 -1
- package/dist/discrete/layers/stackedBar.d.ts.map +1 -1
- package/dist/discrete/layers/stackedBar.js +25 -25
- package/dist/discrete/layers/stackedBar.js.map +1 -1
- package/dist/discrete/layers/violins.js +13 -13
- package/dist/discrete/utils/getOutliersBounds.d.ts +1 -1
- package/dist/discrete/utils/getOutliersBounds.d.ts.map +1 -1
- package/dist/discrete/utils/getOutliersBounds.js +5 -5
- package/dist/discrete/utils/getOutliersBounds.js.map +1 -1
- package/dist/discrete/utils/splitTextByWidth.js +1 -1
- package/dist/discrete/utils/splitTextByWidth.js.map +1 -1
- package/dist/heatmap/ChartRenderer.d.ts +7 -6
- package/dist/heatmap/ChartRenderer.d.ts.map +1 -1
- package/dist/heatmap/ChartRenderer.js +232 -230
- package/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/heatmap/HeatmapSettingsImpl.d.ts +2 -2
- package/dist/heatmap/HeatmapSettingsImpl.d.ts.map +1 -1
- package/dist/heatmap/HeatmapSettingsImpl.js +1 -1
- package/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.js +40 -39
- package/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/heatmap/components/Chart.d.ts.map +1 -1
- package/dist/heatmap/components/Chart.js +90 -89
- package/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/heatmap/components/ChartsGroup.d.ts +2 -2
- package/dist/heatmap/components/ChartsGroup.d.ts.map +1 -1
- package/dist/heatmap/components/ChartsGroup.js +14 -14
- package/dist/heatmap/components/ChartsGroup.js.map +1 -1
- package/dist/heatmap/components/types.d.ts +3 -2
- package/dist/heatmap/components/types.d.ts.map +1 -1
- package/dist/heatmap/getCells.d.ts +3 -2
- package/dist/heatmap/getCells.d.ts.map +1 -1
- package/dist/heatmap/getCells.js +97 -93
- package/dist/heatmap/getCells.js.map +1 -1
- package/dist/heatmap/index.d.ts +3 -3
- package/dist/heatmap/index.d.ts.map +1 -1
- package/dist/heatmap/index.js +13 -12
- package/dist/heatmap/index.js.map +1 -1
- package/dist/heatmap/utils/calculateAnnotationTitleSizes.d.ts.map +1 -1
- package/dist/heatmap/utils/calculateAnnotationTitleSizes.js +1 -1
- package/dist/heatmap/utils/calculateAnnotationTitleSizes.js.map +1 -1
- package/dist/heatmap/utils/calculateCaptionTails.d.ts +1 -1
- package/dist/heatmap/utils/calculateCaptionTails.d.ts.map +1 -1
- package/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
- package/dist/histogram/ChartRenderer.d.ts +6 -5
- package/dist/histogram/ChartRenderer.d.ts.map +1 -1
- package/dist/histogram/ChartRenderer.js +154 -153
- package/dist/histogram/ChartRenderer.js.map +1 -1
- package/dist/histogram/HistogramSettingsImpl.d.ts +2 -2
- package/dist/histogram/HistogramSettingsImpl.d.ts.map +1 -1
- package/dist/histogram/HistogramSettingsImpl.js.map +1 -1
- package/dist/histogram/components/Chart.js +48 -48
- package/dist/histogram/components/Chart.js.map +1 -1
- package/dist/histogram/components/types.d.ts +4 -3
- package/dist/histogram/components/types.d.ts.map +1 -1
- package/dist/histogram/getHistogramData.d.ts +7 -7
- package/dist/histogram/getHistogramData.d.ts.map +1 -1
- package/dist/histogram/getHistogramData.js +52 -53
- package/dist/histogram/getHistogramData.js.map +1 -1
- package/dist/histogram/index.d.ts +3 -3
- package/dist/histogram/index.d.ts.map +1 -1
- package/dist/histogram/index.js +49 -45
- package/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/@d3fc/d3fc-axis/src/axisBase.js +10 -10
- package/dist/node_modules/d3-array/src/min.js +5 -11
- package/dist/node_modules/d3-array/src/min.js.map +1 -1
- package/dist/node_modules/d3-shape/src/area.js +30 -30
- package/dist/node_modules/d3-shape/src/line.js +6 -6
- package/dist/node_modules/d3-shape/src/line.js.map +1 -1
- package/dist/node_modules/kdbush/index.js +148 -0
- package/dist/node_modules/kdbush/index.js.map +1 -0
- package/dist/scatterplot/ChartRenderer.d.ts +7 -6
- package/dist/scatterplot/ChartRenderer.d.ts.map +1 -1
- package/dist/scatterplot/ChartRenderer.js +213 -209
- package/dist/scatterplot/ChartRenderer.js.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +2 -2
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.js +28 -28
- package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/scatterplot/components/ChartAxisTitles.d.ts.map +1 -1
- package/dist/scatterplot/components/ChartAxisTitles.js +31 -30
- package/dist/scatterplot/components/ChartAxisTitles.js.map +1 -1
- package/dist/scatterplot/components/ChartLayersData.d.ts.map +1 -1
- package/dist/scatterplot/components/ChartLayersData.js +138 -156
- package/dist/scatterplot/components/ChartLayersData.js.map +1 -1
- package/dist/scatterplot/components/ChartTooltip.d.ts.map +1 -1
- package/dist/scatterplot/components/ChartTooltip.js +41 -38
- package/dist/scatterplot/components/ChartTooltip.js.map +1 -1
- package/dist/scatterplot/components/ChartTrendsData.js +21 -21
- package/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
- package/dist/scatterplot/components/types.d.ts +7 -7
- package/dist/scatterplot/components/types.d.ts.map +1 -1
- package/dist/scatterplot/constants.d.ts +1 -1
- package/dist/scatterplot/constants.d.ts.map +1 -1
- package/dist/scatterplot/constants.js.map +1 -1
- package/dist/scatterplot/dots.d.ts +2 -2
- package/dist/scatterplot/dots.d.ts.map +1 -1
- package/dist/scatterplot/dots.js +27 -25
- package/dist/scatterplot/dots.js.map +1 -1
- package/dist/scatterplot/getLayersData.d.ts +3 -3
- package/dist/scatterplot/getLayersData.d.ts.map +1 -1
- package/dist/scatterplot/getLayersData.js +12 -15
- package/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/scatterplot/index.d.ts +4 -4
- package/dist/scatterplot/index.d.ts.map +1 -1
- package/dist/scatterplot/index.js +71 -72
- package/dist/scatterplot/index.js.map +1 -1
- package/dist/scatterplot/linearRegression.d.ts +5 -4
- package/dist/scatterplot/linearRegression.d.ts.map +1 -1
- package/dist/scatterplot/linearRegression.js +88 -86
- package/dist/scatterplot/linearRegression.js.map +1 -1
- package/dist/scatterplot/utils/createAesGetter.d.ts +3 -2
- package/dist/scatterplot/utils/createAesGetter.d.ts.map +1 -1
- package/dist/scatterplot/utils/createAesGetter.js +21 -21
- package/dist/scatterplot/utils/createAesGetter.js.map +1 -1
- package/dist/scatterplot/utils/createLegendInfo.d.ts +2 -10
- package/dist/scatterplot/utils/createLegendInfo.d.ts.map +1 -1
- package/dist/scatterplot/utils/createLegendInfo.js +44 -37
- package/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/scatterplot/utils/formatColumnValue.d.ts +5 -0
- package/dist/scatterplot/utils/formatColumnValue.d.ts.map +1 -0
- package/dist/scatterplot/utils/formatColumnValue.js +11 -0
- package/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
- package/dist/scatterplot/utils/getVisibleLabels.d.ts +6 -9
- package/dist/scatterplot/utils/getVisibleLabels.d.ts.map +1 -1
- package/dist/scatterplot/utils/getVisibleLabels.js +46 -56
- package/dist/scatterplot/utils/getVisibleLabels.js.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.d.ts +18 -15
- package/dist/scatterplot-umap/ChartRenderer.d.ts.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.js +231 -214
- package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/dist/scatterplot-umap/SettingsImpl.d.ts +2 -2
- package/dist/scatterplot-umap/SettingsImpl.d.ts.map +1 -1
- package/dist/scatterplot-umap/SettingsImpl.js +25 -25
- package/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/scatterplot-umap/colors.d.ts +6 -0
- package/dist/scatterplot-umap/colors.d.ts.map +1 -0
- package/dist/scatterplot-umap/colors.js +42 -0
- package/dist/scatterplot-umap/colors.js.map +1 -0
- package/dist/scatterplot-umap/components/LowerSVG.d.ts +2 -2
- package/dist/scatterplot-umap/components/LowerSVG.d.ts.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.js +97 -94
- package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/scatterplot-umap/components/UpperSVG.d.ts.map +1 -1
- package/dist/scatterplot-umap/components/UpperSVG.js +20 -19
- package/dist/scatterplot-umap/components/UpperSVG.js.map +1 -1
- package/dist/scatterplot-umap/index.d.ts +0 -2
- package/dist/scatterplot-umap/index.d.ts.map +1 -1
- package/dist/scatterplot-umap/index.js +77 -102
- package/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/scatterplot-umap/types.d.ts +7 -10
- package/dist/scatterplot-umap/types.d.ts.map +1 -1
- package/dist/types/bubble.d.ts +44 -12
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/common.d.ts +22 -3
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +3 -1
- package/dist/types/common.js.map +1 -1
- package/dist/types/dendro.d.ts +113 -10
- package/dist/types/dendro.d.ts.map +1 -1
- package/dist/types/dendro.js +1 -1
- package/dist/types/dendro.js.map +1 -1
- package/dist/types/discrete.d.ts +99 -22
- package/dist/types/discrete.d.ts.map +1 -1
- package/dist/types/discrete.js +3 -3
- package/dist/types/discrete.js.map +1 -1
- package/dist/types/heatmap.d.ts +187 -28
- package/dist/types/heatmap.d.ts.map +1 -1
- package/dist/types/heatmap.js +1 -1
- package/dist/types/heatmap.js.map +1 -1
- package/dist/types/histogram.d.ts +30 -8
- package/dist/types/histogram.d.ts.map +1 -1
- package/dist/types/histogram.js +1 -1
- package/dist/types/histogram.js.map +1 -1
- package/dist/types/scatterplot-umap.d.ts +149 -15
- package/dist/types/scatterplot-umap.d.ts.map +1 -1
- package/dist/types/scatterplot-umap.js +9 -9
- package/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/types/scatterplot.d.ts +164 -12
- package/dist/types/scatterplot.d.ts.map +1 -1
- package/dist/types/scatterplot.js +1 -1
- package/dist/types/scatterplot.js.map +1 -1
- package/dist/utils/TextMeasurer/TextMeasurer.d.ts +7 -0
- package/dist/utils/TextMeasurer/TextMeasurer.d.ts.map +1 -0
- package/dist/utils/TextMeasurer/TextMeasurer.js +42 -0
- package/dist/utils/TextMeasurer/TextMeasurer.js.map +1 -0
- package/dist/utils/TextMeasurer/charToWidth.json.js +155 -0
- package/dist/utils/TextMeasurer/charToWidth.json.js.map +1 -0
- package/dist/utils/arrangeLegendParts.js +1 -1
- package/dist/utils/arrangeLegendParts.js.map +1 -1
- package/dist/utils/getChartEdgeSides.d.ts +1 -1
- package/dist/utils/getLegendWidth.d.ts.map +1 -1
- package/dist/utils/getLegendWidth.js +1 -1
- package/dist/utils/getLegendWidth.js.map +1 -1
- package/package.json +5 -3
- package/dist/bubble/getCells.d.ts.map +0 -1
- package/dist/bubble/getCells.js +0 -91
- package/dist/bubble/getCells.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/add.js +0 -30
- package/dist/node_modules/d3-quadtree/src/add.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/cover.js +0 -29
- package/dist/node_modules/d3-quadtree/src/cover.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/data.js +0 -12
- package/dist/node_modules/d3-quadtree/src/data.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/extent.js +0 -7
- package/dist/node_modules/d3-quadtree/src/extent.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/find.js +0 -26
- package/dist/node_modules/d3-quadtree/src/find.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/quad.js +0 -7
- package/dist/node_modules/d3-quadtree/src/quad.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/quadtree.js +0 -51
- package/dist/node_modules/d3-quadtree/src/quadtree.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/remove.js +0 -21
- package/dist/node_modules/d3-quadtree/src/remove.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/root.js +0 -7
- package/dist/node_modules/d3-quadtree/src/root.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/size.js +0 -12
- package/dist/node_modules/d3-quadtree/src/size.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/visit.js +0 -14
- package/dist/node_modules/d3-quadtree/src/visit.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/visitAfter.js +0 -19
- package/dist/node_modules/d3-quadtree/src/visitAfter.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/x.js +0 -11
- package/dist/node_modules/d3-quadtree/src/x.js.map +0 -1
- package/dist/node_modules/d3-quadtree/src/y.js +0 -11
- package/dist/node_modules/d3-quadtree/src/y.js.map +0 -1
- package/dist/utils/TextMeasurer.d.ts +0 -8
- package/dist/utils/TextMeasurer.d.ts.map +0 -1
- package/dist/utils/TextMeasurer.js +0 -27
- package/dist/utils/TextMeasurer.js.map +0 -1
|
@@ -1,103 +1,104 @@
|
|
|
1
1
|
var Y = Object.defineProperty;
|
|
2
|
-
var k = (
|
|
3
|
-
var
|
|
4
|
-
import { j as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
var k = (x, i, t) => i in x ? Y(x, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : x[i] = t;
|
|
3
|
+
var C = (x, i, t) => k(x, typeof i != "symbol" ? i + "" : i, t);
|
|
4
|
+
import { j as w } from "../node_modules/react/jsx-runtime.js";
|
|
5
|
+
import V from "../node_modules/lodash/lodash.js";
|
|
6
|
+
import { createRoot as Z } from "../node_modules/react-dom/client.js";
|
|
7
|
+
import { Error as $ } from "../common/Error.js";
|
|
8
|
+
import { DataFrameProvider as q } from "../common/useDataFrame.js";
|
|
9
|
+
import { DEFAULT_HEIGHT as P, DEFAULT_WIDTH as I, TITLE_LINE_HEIGHT as J, TITLE_MARGIN as Q } from "../constants.js";
|
|
10
|
+
import { DEFAULT_COMMON_AES as R, DEFAULT_TICKS_SIZE as v } from "../scatterplot/constants.js";
|
|
11
|
+
import { arrangeLegendParts as y } from "../utils/arrangeLegendParts.js";
|
|
12
|
+
import { TextMeasurer as G } from "../utils/TextMeasurer/TextMeasurer.js";
|
|
13
|
+
import { ChartsGroup as K } from "./components/ChartsGroup.js";
|
|
14
|
+
import { DEFAULT_AES as O, CAPTION_LINE_HEIGHT as W, LEGEND_OFFSET as tt, TICK_OFFSET as B, TITLE_LINE as z, MIN_PADDING as H, FACET_TITLE_OFFSET as it, FACET_TITLE_LINE as st } from "./constants.js";
|
|
13
15
|
import { getChartStatsPadding as X } from "./utils/getChartStatsPadding.js";
|
|
14
|
-
import { splitTextByWidth as
|
|
15
|
-
import { arrangeLegendParts as it } from "../utils/arrangeLegendParts.js";
|
|
16
|
+
import { splitTextByWidth as D } from "./utils/splitTextByWidth.js";
|
|
16
17
|
import S from "../node_modules/d3-scale/src/ordinal.js";
|
|
17
18
|
import j from "../node_modules/d3-scale/src/linear.js";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
function
|
|
19
|
+
import _ from "../node_modules/d3-scale/src/band.js";
|
|
20
|
+
import et from "../node_modules/d3-scale/src/log.js";
|
|
21
|
+
function ot(x, i, t, s) {
|
|
21
22
|
const e = [];
|
|
22
|
-
return
|
|
23
|
+
return x % t === t - 1 && e.push("right"), x % t === 0 && e.push("left"), x < t && e.push("top"), (Math.ceil((x + 1) / t) === s || Math.ceil((x + 1) / t) === s - 1 && x % t > (i - 1) % t) && e.push("bottom"), e;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
const T =
|
|
25
|
+
function nt(x, i, t, s, e, r, p, o, c, d, u) {
|
|
26
|
+
const T = x === "vertical", m = p.includes("left") || T && !(o != null && o.sharedY) || !T && !(o != null && o.sharedX), M = p.includes("left") && t.title !== "", f = p.includes("bottom") || T && !(o != null && o.sharedX) || !T && !(o != null && o.sharedY), l = p.includes("bottom") && i.title !== "", h = s.yAxisCaptionsWidth, n = (t.showTicks ? v : 0) + (t.hiddenLabels ? 0 : B), a = M ? z : 0, g = s.xAxisCaptionsWidthByRows[T ? c : d], A = (i.showTicks ? v : 0) + (i.hiddenLabels ? 0 : B), L = l ? z : 0, N = T ? h + n + a : g + A + L, F = T ? A + g + L : n + 2 * z, b = Math.max(...e.map((E) => r[E].length));
|
|
26
27
|
return {
|
|
27
|
-
left: m ?
|
|
28
|
-
top: b === 0 ? 0 :
|
|
29
|
-
bottom:
|
|
30
|
-
right:
|
|
28
|
+
left: m ? N : H,
|
|
29
|
+
top: b === 0 ? 0 : it * 2 + b * st,
|
|
30
|
+
bottom: f ? F : H,
|
|
31
|
+
right: u ? 0 : H
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function at(x, i, t) {
|
|
34
35
|
const s = new Array(t).fill(null).map(() => []);
|
|
35
36
|
for (let e = 0; e < t; e++)
|
|
36
|
-
for (let
|
|
37
|
-
|
|
37
|
+
for (let r = 0; r < i; r++)
|
|
38
|
+
r * t + e < x.length && s[e].push(x[r * t + e]);
|
|
38
39
|
return s;
|
|
39
40
|
}
|
|
40
|
-
function U(
|
|
41
|
+
function U(x, i, t) {
|
|
41
42
|
const s = [];
|
|
42
43
|
for (let e = 0; e < i; e++)
|
|
43
|
-
s.push(
|
|
44
|
+
s.push(x.slice(e * t, e * t + t));
|
|
44
45
|
return s;
|
|
45
46
|
}
|
|
46
|
-
function ht(
|
|
47
|
-
const t = Math.floor(
|
|
47
|
+
function ht(x, i) {
|
|
48
|
+
const t = Math.floor(x / i), s = x - t * i;
|
|
48
49
|
return [t, s];
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
return typeof
|
|
51
|
+
function rt(x) {
|
|
52
|
+
return typeof x == "object" && "type" in x;
|
|
52
53
|
}
|
|
53
|
-
class
|
|
54
|
+
class Nt {
|
|
54
55
|
constructor() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
chartWidth:
|
|
56
|
+
C(this, "reactRoot", null);
|
|
57
|
+
C(this, "parentNode", null);
|
|
58
|
+
C(this, "rootNode", null);
|
|
59
|
+
C(this, "component", /* @__PURE__ */ w.jsx(w.Fragment, {}));
|
|
60
|
+
C(this, "chartsDimensions", {});
|
|
61
|
+
C(this, "chartSizes", {
|
|
62
|
+
chartWidth: I,
|
|
62
63
|
// width of single chart
|
|
63
|
-
chartHeight:
|
|
64
|
+
chartHeight: P,
|
|
64
65
|
// height of single chart
|
|
65
|
-
chartsWidth:
|
|
66
|
+
chartsWidth: I,
|
|
66
67
|
// width of all charts in charts row
|
|
67
|
-
chartsHeight:
|
|
68
|
+
chartsHeight: P,
|
|
68
69
|
// width of all charts in charts column, without axes
|
|
69
|
-
totalWidth:
|
|
70
|
+
totalWidth: I,
|
|
70
71
|
// width of all charts in charts row, plus left axis, plus legend
|
|
71
|
-
totalHeight:
|
|
72
|
+
totalHeight: P
|
|
72
73
|
// width of all charts in charts height, plus bottom axis, plus top title
|
|
73
74
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
C(this, "columnsCount", 1);
|
|
76
|
+
C(this, "rowsCount", 1);
|
|
77
|
+
C(this, "scales", {
|
|
77
78
|
// Scale from primary grouping categories to every category x coordinate
|
|
78
|
-
xPrimary: { null:
|
|
79
|
+
xPrimary: { null: _().range([0, I]).domain(["1"]) },
|
|
79
80
|
// Scale from secondary grouping categories to x shift inside corresponding primary group
|
|
80
|
-
xSecondary: { null:
|
|
81
|
+
xSecondary: { null: _().range([0, I]).domain(["1"]) },
|
|
81
82
|
// Scale from y value to y coordinate, by facet
|
|
82
|
-
y: { null: j().domain([0, 10]).range([
|
|
83
|
+
y: { null: j().domain([0, 10]).range([P, 0]).nice() },
|
|
83
84
|
// Scale for link primary grouping category and aesthetics
|
|
84
|
-
xPrimaryAes: S().unknown(
|
|
85
|
+
xPrimaryAes: S().unknown(O),
|
|
85
86
|
// Scale for link secondary grouping category and aesthetics
|
|
86
|
-
xSecondaryAes: S().unknown(
|
|
87
|
+
xSecondaryAes: S().unknown(O)
|
|
87
88
|
});
|
|
88
|
-
|
|
89
|
+
C(this, "facetTitles", {});
|
|
89
90
|
// can be multiline
|
|
90
|
-
|
|
91
|
+
C(this, "mainTitle", []);
|
|
91
92
|
// can be multiline
|
|
92
|
-
|
|
93
|
+
C(this, "axisLabelsX", {});
|
|
93
94
|
// can be multiline
|
|
94
|
-
|
|
95
|
+
C(this, "captionsSizes", {
|
|
95
96
|
xAxisCaptionsWidthByRows: [],
|
|
96
97
|
xCaptionsTail: 0,
|
|
97
98
|
yAxisCaptionsWidth: 100
|
|
98
99
|
});
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
C(this, "legend", { width: 0, height: 0, items: [] });
|
|
101
|
+
C(this, "margins", { left: 0, right: 0, top: 0, bottom: 0 });
|
|
101
102
|
}
|
|
102
103
|
clear() {
|
|
103
104
|
var i;
|
|
@@ -107,185 +108,185 @@ class wt {
|
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
init(i) {
|
|
110
|
-
this.parentNode === null && (this.parentNode = i, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot =
|
|
111
|
+
this.parentNode === null && (this.parentNode = i, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = Z(this.rootNode));
|
|
111
112
|
}
|
|
112
|
-
updateChartSize(i, t, s, e,
|
|
113
|
-
const
|
|
114
|
-
this.columnsCount = s != null && s.nRows ? Math.ceil(
|
|
115
|
-
let { width:
|
|
116
|
-
|
|
113
|
+
updateChartSize(i, t, s, e, r, p) {
|
|
114
|
+
const o = i.innerOffset, c = i.innerOffset, d = X(p, e, i.innerOffset), u = t.length, T = Math.min((s == null ? void 0 : s.nRows) ?? u, u), m = Math.min((s == null ? void 0 : s.nCols) ?? u, u);
|
|
115
|
+
this.columnsCount = s != null && s.nRows ? Math.ceil(u / T) : m, this.rowsCount = Math.ceil(u / this.columnsCount);
|
|
116
|
+
let { width: M, height: f } = i;
|
|
117
|
+
r === "vertical" && d > o && (f += d), r === "horizontal" && d > c && (M += d), this.chartSizes.chartWidth = M, this.chartSizes.chartHeight = f;
|
|
117
118
|
}
|
|
118
|
-
updateChartDimensions(i, t, s, e,
|
|
119
|
-
const { chartWidth:
|
|
120
|
-
let
|
|
121
|
-
this.chartsDimensions = i.reduce((m,
|
|
122
|
-
const [
|
|
119
|
+
updateChartDimensions(i, t, s, e, r) {
|
|
120
|
+
const { chartWidth: p, chartHeight: o } = this.chartSizes;
|
|
121
|
+
let c = 0, d = 0;
|
|
122
|
+
this.chartsDimensions = i.reduce((m, M, f) => {
|
|
123
|
+
const [l, h] = ht(f, this.columnsCount), n = ot(f, i.length, this.columnsCount, this.rowsCount), a = nt(
|
|
123
124
|
s,
|
|
124
125
|
e,
|
|
125
|
-
|
|
126
|
+
r,
|
|
126
127
|
this.captionsSizes,
|
|
127
|
-
U(i, this.rowsCount, this.columnsCount)[
|
|
128
|
+
U(i, this.rowsCount, this.columnsCount)[l],
|
|
128
129
|
this.facetTitles,
|
|
129
|
-
|
|
130
|
+
n,
|
|
130
131
|
t,
|
|
131
|
-
|
|
132
|
+
l,
|
|
132
133
|
h,
|
|
133
134
|
h === this.columnsCount - 1
|
|
134
|
-
),
|
|
135
|
-
return m[
|
|
136
|
-
left:
|
|
137
|
-
top:
|
|
138
|
-
chartEdgeSides:
|
|
139
|
-
padding:
|
|
140
|
-
inner: { width:
|
|
141
|
-
outer: { width:
|
|
142
|
-
},
|
|
135
|
+
), g = p + a.left + a.right, A = o + a.top + a.bottom;
|
|
136
|
+
return m[M] = {
|
|
137
|
+
left: c,
|
|
138
|
+
top: d,
|
|
139
|
+
chartEdgeSides: n,
|
|
140
|
+
padding: a,
|
|
141
|
+
inner: { width: p, height: o },
|
|
142
|
+
outer: { width: g, height: A }
|
|
143
|
+
}, c += g, h === this.columnsCount - 1 && (c = 0, d += A), m;
|
|
143
144
|
}, {});
|
|
144
|
-
const
|
|
145
|
+
const u = Math.max(
|
|
145
146
|
...i.map((m) => this.chartsDimensions[m].outer.width + this.chartsDimensions[m].left)
|
|
146
147
|
), T = Math.max(
|
|
147
148
|
...i.map((m) => this.chartsDimensions[m].outer.height + this.chartsDimensions[m].top)
|
|
148
149
|
);
|
|
149
|
-
this.chartSizes.chartsWidth =
|
|
150
|
+
this.chartSizes.chartsWidth = u, this.chartSizes.chartsHeight = T;
|
|
150
151
|
}
|
|
151
|
-
updateViewport(i, t, s, e,
|
|
152
|
-
const T =
|
|
153
|
-
e.forEach((
|
|
154
|
-
const
|
|
155
|
-
m ? [h - T,
|
|
152
|
+
updateViewport(i, t, s, e, r, p, o, c, d, u) {
|
|
153
|
+
const T = d.innerOffset, m = i === "vertical", M = X(c, t, d.innerOffset), f = r === null || r.sharedX, l = r === null || r.sharedY, { chartHeight: h, chartWidth: n } = this.chartSizes;
|
|
154
|
+
e.forEach((a) => {
|
|
155
|
+
const g = p.scale === "log" ? et() : j(), A = Math.min(...l ? o.map(({ meta: b }) => b.minY) : o.map(({ geoms: b }) => Math.min(...b[a].map(({ boundsY: E }) => E.min)))), L = Math.max(...l ? o.map(({ meta: b }) => b.maxY) : o.map(({ geoms: b }) => Math.max(...b[a].map(({ boundsY: E }) => E.max)))), N = g.copy().domain([A, L]).range(
|
|
156
|
+
m ? [h - T, M] : [T, n - M]
|
|
156
157
|
);
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
this.scales.xPrimary[
|
|
158
|
+
g.domain([N.invert(m ? h : 0), N.invert(m ? 0 : n)]).range(m ? [h, 0] : [0, n]), this.scales.y[a] = g;
|
|
159
|
+
const F = f ? t : u[a];
|
|
160
|
+
this.scales.xPrimary[a] = _().domain(F).range(m ? [0, n] : [h, 0]), this.scales.xSecondary[a] = _().domain(s).range([0, this.scales.xPrimary[a].bandwidth()]);
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
163
|
createFacetTitles(i, t) {
|
|
163
|
-
this.facetTitles = i.reduce((s, e,
|
|
164
|
+
this.facetTitles = i.reduce((s, e, r) => (t[r].length === 1 && t[r][0] === "null" ? s[e] = [] : s[e] = D(t[r].join(", "), this.chartSizes.chartWidth, 14), s), {});
|
|
164
165
|
}
|
|
165
166
|
createMainTitle(i, t) {
|
|
166
167
|
const s = this.chartsDimensions[i[0]], e = this.chartsDimensions[i[i.length - 1]];
|
|
167
|
-
this.mainTitle =
|
|
168
|
+
this.mainTitle = D(
|
|
168
169
|
t.name,
|
|
169
170
|
this.chartSizes.chartsWidth - s.padding.left - e.padding.right,
|
|
170
171
|
20
|
|
171
172
|
);
|
|
172
173
|
}
|
|
173
174
|
createAxisLabels(i, t, s, e) {
|
|
174
|
-
const
|
|
175
|
+
const r = {
|
|
175
176
|
center: 120,
|
|
176
177
|
"45deg": 256,
|
|
177
178
|
"90deg": 320
|
|
178
|
-
},
|
|
179
|
-
function
|
|
180
|
-
return
|
|
179
|
+
}, p = e === "vertical";
|
|
180
|
+
function o(c, d) {
|
|
181
|
+
return c === "center" ? 1 / 0 : Math.floor(c === "45deg" ? d * Math.sin(Math.PI / 4) / W : d / W);
|
|
181
182
|
}
|
|
182
|
-
this.axisLabelsX = i.reduce((
|
|
183
|
-
const
|
|
184
|
-
return
|
|
183
|
+
this.axisLabelsX = i.reduce((c, d) => {
|
|
184
|
+
const u = this.scales.xPrimary[d], T = u.bandwidth(), m = r[t.labelsPosition], M = t.labelsPosition === "center" ? Math.min(m, T) : m, f = s.valueLabels;
|
|
185
|
+
return c[d] = u.domain().reduce((l, h) => {
|
|
185
186
|
if (t.hiddenLabels)
|
|
186
|
-
return
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
189
|
-
|
|
187
|
+
return l[h] = [], l;
|
|
188
|
+
const n = f[h];
|
|
189
|
+
if (!p)
|
|
190
|
+
l[h] = [n];
|
|
190
191
|
else {
|
|
191
|
-
const
|
|
192
|
-
|
|
192
|
+
const a = o(t.labelsPosition, T), g = D(n, M, 14);
|
|
193
|
+
l[h] = g.length > a ? [n] : g;
|
|
193
194
|
}
|
|
194
|
-
return
|
|
195
|
-
}, {}),
|
|
195
|
+
return l;
|
|
196
|
+
}, {}), c;
|
|
196
197
|
}, {});
|
|
197
198
|
}
|
|
198
199
|
updateAesScales(i, t) {
|
|
199
200
|
if (i.inheritedAes) {
|
|
200
201
|
const { inheritedAes: s, keys: e } = i;
|
|
201
|
-
this.scales.xPrimaryAes.domain(e).range(e.map((
|
|
202
|
+
this.scales.xPrimaryAes.domain(e).range(e.map((r) => s[r] ?? R));
|
|
202
203
|
} else
|
|
203
204
|
this.scales.xPrimaryAes.domain([]).range([]);
|
|
204
205
|
if (t.inheritedAes) {
|
|
205
206
|
const { inheritedAes: s, keys: e } = t;
|
|
206
|
-
this.scales.xSecondaryAes.domain(e).range(e.map((
|
|
207
|
+
this.scales.xSecondaryAes.domain(e).range(e.map((r) => s[r] ?? R));
|
|
207
208
|
} else
|
|
208
209
|
this.scales.xSecondaryAes.domain([]).range([]);
|
|
209
210
|
}
|
|
210
211
|
updateCaptionsSize(i, t, s, e) {
|
|
211
|
-
const
|
|
212
|
-
function
|
|
213
|
-
return h.length ? Math.max(...h.map((
|
|
212
|
+
const p = new G("600 14px Manrope"), o = i === "vertical";
|
|
213
|
+
function c(h) {
|
|
214
|
+
return h.length ? Math.max(...h.map((n) => p.getTextWidth(n))) : 0;
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
-
return h.length ? Math.max(...h.map(
|
|
216
|
+
function d(h) {
|
|
217
|
+
return h.length ? Math.max(...h.map(c)) : 0;
|
|
217
218
|
}
|
|
218
|
-
let
|
|
219
|
-
const m = U(t, this.rowsCount, this.columnsCount),
|
|
220
|
-
if (!
|
|
221
|
-
|
|
219
|
+
let u = [], T = 0;
|
|
220
|
+
const m = U(t, this.rowsCount, this.columnsCount), M = at(t, this.rowsCount, this.columnsCount);
|
|
221
|
+
if (!o)
|
|
222
|
+
u = M.map(
|
|
222
223
|
(h) => Math.max(
|
|
223
224
|
...h.map(
|
|
224
|
-
(
|
|
225
|
-
this.scales.xPrimary[
|
|
225
|
+
(n) => d(
|
|
226
|
+
this.scales.xPrimary[n].domain().map((a) => this.axisLabelsX[n][a])
|
|
226
227
|
)
|
|
227
228
|
)
|
|
228
229
|
)
|
|
229
230
|
);
|
|
230
231
|
else {
|
|
231
|
-
if (s.labelsPosition === "center" && (
|
|
232
|
+
if (s.labelsPosition === "center" && (u = m.map(
|
|
232
233
|
(h) => Math.max(
|
|
233
234
|
...h.map(
|
|
234
|
-
(
|
|
235
|
-
...this.scales.xPrimary[
|
|
236
|
-
(
|
|
235
|
+
(n) => Math.max(
|
|
236
|
+
...this.scales.xPrimary[n].domain().map(
|
|
237
|
+
(a) => a ? this.axisLabelsX[n][a].length * W : 0
|
|
237
238
|
)
|
|
238
239
|
)
|
|
239
240
|
)
|
|
240
241
|
)
|
|
241
242
|
)), s.labelsPosition === "45deg") {
|
|
242
243
|
const h = Math.sin(Math.PI / 4);
|
|
243
|
-
|
|
244
|
-
...
|
|
245
|
-
const
|
|
244
|
+
u = m.map((n) => Math.max(
|
|
245
|
+
...n.map((a) => {
|
|
246
|
+
const g = this.scales.xPrimary[a].domain().map((L) => this.axisLabelsX[a][L]), A = d(g);
|
|
246
247
|
return A > 0 ? A * h + 14 : 0;
|
|
247
248
|
})
|
|
248
249
|
)), T = Math.max(
|
|
249
|
-
...
|
|
250
|
-
const
|
|
250
|
+
...M[0].map((n) => {
|
|
251
|
+
const a = this.scales.xPrimary[n].domain(), g = this.axisLabelsX[n][a[0]];
|
|
251
252
|
return Math.max(
|
|
252
|
-
|
|
253
|
+
c(g) * h - this.scales.xPrimary[n].bandwidth() / 2 + 14,
|
|
253
254
|
0
|
|
254
255
|
);
|
|
255
256
|
})
|
|
256
257
|
);
|
|
257
258
|
}
|
|
258
|
-
s.labelsPosition === "90deg" && (
|
|
259
|
+
s.labelsPosition === "90deg" && (u = m.map(
|
|
259
260
|
(h) => Math.max(
|
|
260
261
|
...h.map(
|
|
261
|
-
(
|
|
262
|
-
this.scales.xPrimary[
|
|
262
|
+
(n) => d(
|
|
263
|
+
this.scales.xPrimary[n].domain().map((a) => this.axisLabelsX[n][a])
|
|
263
264
|
)
|
|
264
265
|
)
|
|
265
266
|
)
|
|
266
267
|
));
|
|
267
268
|
}
|
|
268
|
-
const
|
|
269
|
+
const f = V.flatten(
|
|
269
270
|
t.map((h) => {
|
|
270
271
|
if (e.hiddenLabels)
|
|
271
272
|
return [];
|
|
272
|
-
const
|
|
273
|
-
return
|
|
273
|
+
const n = this.scales.y[h], a = n.ticks(), g = a.some((L) => Math.abs(L) < 1e-4 && L !== 0 || L > 1e4) ? ",e" : ",f", A = n.tickFormat(10, g);
|
|
274
|
+
return a.map(A);
|
|
274
275
|
})
|
|
275
|
-
),
|
|
276
|
+
), l = c(f);
|
|
276
277
|
this.captionsSizes = {
|
|
277
278
|
xCaptionsTail: T,
|
|
278
|
-
xAxisCaptionsWidthByRows:
|
|
279
|
-
yAxisCaptionsWidth:
|
|
279
|
+
xAxisCaptionsWidthByRows: u,
|
|
280
|
+
yAxisCaptionsWidth: l
|
|
280
281
|
};
|
|
281
282
|
}
|
|
282
283
|
updateMargins(i, t, s) {
|
|
283
|
-
const e = this.chartsDimensions[t[0]],
|
|
284
|
+
const e = this.chartsDimensions[t[0]], r = this.chartsDimensions[t[t.length - 1]], p = i === "vertical", o = this.mainTitle.length ? J * this.mainTitle.length + Q * 2 : 0, c = s.outerOffset;
|
|
284
285
|
this.margins = {
|
|
285
|
-
left: Math.max(
|
|
286
|
-
right: this.legend.width +
|
|
287
|
-
top: Math.max(
|
|
288
|
-
bottom: Math.max(
|
|
286
|
+
left: Math.max(c, p ? this.captionsSizes.xCaptionsTail - e.padding.left : 0),
|
|
287
|
+
right: this.legend.width + c,
|
|
288
|
+
top: Math.max(o, c),
|
|
289
|
+
bottom: Math.max(c, p ? 0 : this.captionsSizes.xCaptionsTail - r.padding.bottom)
|
|
289
290
|
}, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartsHeight, this.legend.height) + this.margins.bottom;
|
|
290
291
|
}
|
|
291
292
|
updateLegendSize(i, t, s, e) {
|
|
@@ -293,33 +294,33 @@ class wt {
|
|
|
293
294
|
this.legend = { width: 0, height: 0, items: [] };
|
|
294
295
|
return;
|
|
295
296
|
}
|
|
296
|
-
const
|
|
297
|
-
function l
|
|
298
|
-
return e.some((
|
|
299
|
-
const
|
|
300
|
-
return
|
|
297
|
+
const r = this.chartSizes.chartHeight, p = { width: 0, height: 0, left: 0, top: 0 }, o = [];
|
|
298
|
+
function c(l, h) {
|
|
299
|
+
return e.some((n) => {
|
|
300
|
+
const a = n.aes[h];
|
|
301
|
+
return a && rt(a) && a.type === l;
|
|
301
302
|
});
|
|
302
303
|
}
|
|
303
|
-
function
|
|
304
|
+
function d(l) {
|
|
304
305
|
return {
|
|
305
|
-
dotFill: l
|
|
306
|
-
fillColor: l
|
|
307
|
-
lineColor: l
|
|
308
|
-
dotShape: l
|
|
309
|
-
lineShape: l
|
|
306
|
+
dotFill: c(l, "dotFill"),
|
|
307
|
+
fillColor: c(l, "fillColor"),
|
|
308
|
+
lineColor: c(l, "lineColor"),
|
|
309
|
+
dotShape: c(l, "dotShape"),
|
|
310
|
+
lineShape: c(l, "lineShape")
|
|
310
311
|
};
|
|
311
312
|
}
|
|
312
|
-
const
|
|
313
|
-
if (Object.values(
|
|
313
|
+
const u = d("primaryGrouping"), T = d("secondaryGrouping");
|
|
314
|
+
if (Object.values(u).some((l) => l) && t.inheritedAes && o.push({
|
|
314
315
|
type: "discreteMulti",
|
|
315
316
|
id: "primary",
|
|
316
317
|
title: t.label,
|
|
317
318
|
scale: this.scales.xPrimaryAes,
|
|
318
319
|
values: t.keys,
|
|
319
320
|
labels: t.valueLabels,
|
|
320
|
-
usedAes:
|
|
321
|
-
...
|
|
322
|
-
}), Object.values(T).some((
|
|
321
|
+
usedAes: u,
|
|
322
|
+
...p
|
|
323
|
+
}), Object.values(T).some((l) => l) && s.inheritedAes && o.push({
|
|
323
324
|
type: "discreteMulti",
|
|
324
325
|
id: "secondary",
|
|
325
326
|
title: s.label,
|
|
@@ -327,65 +328,65 @@ class wt {
|
|
|
327
328
|
values: s.keys,
|
|
328
329
|
labels: s.valueLabels,
|
|
329
330
|
usedAes: T,
|
|
330
|
-
...
|
|
331
|
-
}), !
|
|
331
|
+
...p
|
|
332
|
+
}), !o.length) {
|
|
332
333
|
this.legend = { width: 0, height: 0, items: [] };
|
|
333
334
|
return;
|
|
334
335
|
}
|
|
335
|
-
const m =
|
|
336
|
+
const m = y(o, this.chartSizes.chartHeight), M = m[m.length - 1], f = M.left + M.width + tt;
|
|
336
337
|
this.legend = {
|
|
337
|
-
width:
|
|
338
|
-
height:
|
|
338
|
+
width: f,
|
|
339
|
+
height: r,
|
|
339
340
|
items: m
|
|
340
341
|
};
|
|
341
342
|
}
|
|
342
|
-
render(i, t, s, e,
|
|
343
|
-
var
|
|
344
|
-
const { orientation:
|
|
345
|
-
this.updateChartSize(
|
|
346
|
-
g,
|
|
347
|
-
s.keys,
|
|
348
|
-
e.keys,
|
|
349
|
-
c,
|
|
350
|
-
a,
|
|
351
|
-
h,
|
|
343
|
+
render(i, t, s, e, r, p, o, c, d, u, T, m, M, f) {
|
|
344
|
+
var A;
|
|
345
|
+
const { orientation: l, xAxis: h, yAxis: n, size: a } = s;
|
|
346
|
+
this.updateChartSize(a, o, p, e.keys, l, u), this.updateViewport(
|
|
352
347
|
l,
|
|
353
|
-
|
|
348
|
+
e.keys,
|
|
349
|
+
r.keys,
|
|
354
350
|
o,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
351
|
+
p,
|
|
352
|
+
n,
|
|
353
|
+
d,
|
|
354
|
+
u,
|
|
355
|
+
a,
|
|
356
|
+
m
|
|
357
|
+
), this.createAxisLabels(o, h, e, l), this.createFacetTitles(o, c), this.updateCaptionsSize(l, o, h, n), this.updateChartDimensions(o, p, l, h, n), this.updateLegendSize(s.legend, e, r, d), this.createMainTitle(o, s.title), this.updateMargins(l, o, a), this.updateAesScales(e, r);
|
|
358
|
+
const g = /* @__PURE__ */ w.jsx(q, { dataFrame: i, children: /* @__PURE__ */ w.jsx(
|
|
359
|
+
K,
|
|
359
360
|
{
|
|
360
|
-
settingsId:
|
|
361
|
-
chartSettings:
|
|
362
|
-
facetKeys:
|
|
363
|
-
facetSettings:
|
|
361
|
+
settingsId: t,
|
|
362
|
+
chartSettings: s,
|
|
363
|
+
facetKeys: o,
|
|
364
|
+
facetSettings: p,
|
|
364
365
|
facetTitles: this.facetTitles,
|
|
365
366
|
chartSizes: this.chartSizes,
|
|
366
367
|
chartsDimensions: this.chartsDimensions,
|
|
367
368
|
scales: this.scales,
|
|
368
|
-
layersData:
|
|
369
|
+
layersData: d,
|
|
369
370
|
statsData: u,
|
|
370
371
|
legendData: this.legend,
|
|
371
372
|
margins: this.margins,
|
|
372
373
|
columnsCount: this.columnsCount,
|
|
373
|
-
keyColumn:
|
|
374
|
+
keyColumn: T,
|
|
374
375
|
xLabels: this.axisLabelsX,
|
|
375
376
|
chartTitle: this.mainTitle,
|
|
376
|
-
onlyPositive:
|
|
377
|
-
secondaryGrouping:
|
|
378
|
-
onTooltipHintSwitch:
|
|
377
|
+
onlyPositive: M,
|
|
378
|
+
secondaryGrouping: r,
|
|
379
|
+
onTooltipHintSwitch: f
|
|
379
380
|
}
|
|
380
|
-
);
|
|
381
|
-
this.component =
|
|
381
|
+
) });
|
|
382
|
+
this.component = g, (A = this.reactRoot) == null || A.render(g);
|
|
382
383
|
}
|
|
383
384
|
renderError(i) {
|
|
384
385
|
var t;
|
|
385
|
-
(t = this.reactRoot) == null || t.render(/* @__PURE__ */
|
|
386
|
+
(t = this.reactRoot) == null || t.render(/* @__PURE__ */ w.jsx($, { message: i }));
|
|
386
387
|
}
|
|
387
388
|
}
|
|
388
389
|
export {
|
|
389
|
-
|
|
390
|
+
Nt as default
|
|
390
391
|
};
|
|
391
392
|
//# sourceMappingURL=ChartRenderer.js.map
|