@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,80 +1,81 @@
|
|
|
1
1
|
var $ = Object.defineProperty;
|
|
2
|
-
var J = (
|
|
3
|
-
var
|
|
4
|
-
import { j as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
var J = (r, t, i) => t in r ? $(r, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[t] = i;
|
|
3
|
+
var C = (r, t, i) => J(r, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
import { j as F } from "../node_modules/react/jsx-runtime.js";
|
|
5
|
+
import { createRoot as k } from "../node_modules/react-dom/client.js";
|
|
6
|
+
import { Error as K } from "../common/Error.js";
|
|
7
|
+
import { DataFrameProvider as y } from "../common/useDataFrame.js";
|
|
8
|
+
import { DEFAULT_HEIGHT as X, DEFAULT_WIDTH as G, TITLE_LINE_HEIGHT as tt, MAX_SHOWN_UNIQUE_VALUES_IN_LABELS as it, BLACK as Z, TITLE_MARGIN as et } from "../constants.js";
|
|
9
|
+
import { FACET_TITLE_LINE as st } from "../discrete/constants.js";
|
|
8
10
|
import { splitTextByWidth as U } from "../discrete/utils/splitTextByWidth.js";
|
|
9
|
-
import {
|
|
10
|
-
import { createAesGetter as _ } from "./utils/createAesGetter.js";
|
|
11
|
-
import { getTicksAndFormat as ot } from "./utils/getTicksAndFormat.js";
|
|
12
|
-
import { isContinuousAes as q } from "../types/common.js";
|
|
11
|
+
import { isContinuousAes as j } from "../types/common.js";
|
|
13
12
|
import "../types/discrete.js";
|
|
14
13
|
import "../types/scatterplot.js";
|
|
15
14
|
import "../types/heatmap.js";
|
|
16
15
|
import "../types/dendro.js";
|
|
17
16
|
import "../types/histogram.js";
|
|
18
17
|
import "../types/bubble.js";
|
|
18
|
+
import { arrangeLegendParts as ot } from "../utils/arrangeLegendParts.js";
|
|
19
19
|
import { getContinuousColorScale as nt } from "../utils/getContinuousColorScale.js";
|
|
20
20
|
import { getContinuousLegendTicks as at } from "../utils/getContinuousLegendTicks.js";
|
|
21
|
-
import { TextMeasurer as ht } from "../utils/TextMeasurer.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
21
|
+
import { TextMeasurer as ht } from "../utils/TextMeasurer/TextMeasurer.js";
|
|
22
|
+
import { ChartsGroup as rt } from "./components/ChartsGroup.js";
|
|
23
|
+
import { MIN_MARGIN as v, PADDINGS as B, DEFAULT_DOT_AES as D, LEGEND_OFFSET as lt, TICK_OFFSET as O, DEFAULT_TICKS_SIZE as P, MIN_PADDING as b, FACET_TITLE_OFFSET as ct, FACET_AXIS_OFFSET as V, TITLE_LINE as q } from "./constants.js";
|
|
24
|
+
import { createAesGetter as _ } from "./utils/createAesGetter.js";
|
|
25
|
+
import { getTicksAndFormat as mt } from "./utils/getTicksAndFormat.js";
|
|
26
|
+
import L from "../node_modules/d3-scale/src/linear.js";
|
|
26
27
|
import Q from "../node_modules/d3-scale/src/log.js";
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { sqrt as
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
return
|
|
28
|
+
import dt from "../node_modules/d3-scale/src/ordinal.js";
|
|
29
|
+
import pt from "../node_modules/d3-scale/src/symlog.js";
|
|
30
|
+
import { sqrt as ut } from "../node_modules/d3-scale/src/pow.js";
|
|
31
|
+
function gt(r, t, i, s) {
|
|
32
|
+
const e = [];
|
|
33
|
+
return r % i === i - 1 && e.push("right"), r % i === 0 && e.push("left"), r < i && e.push("top"), (Math.ceil((r + 1) / i) === s || Math.ceil((r + 1) / i) === s - 1 && r % i > (t - 1) % i) && e.push("bottom"), e;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
35
|
+
function ft(r, t, i, s, e, o, c) {
|
|
36
|
+
const g = o.includes("left") || !(c != null && c.sharedY), N = o.includes("left") && t.title !== "", W = o.includes("bottom") || !(c != null && c.sharedX), w = o.includes("bottom") && r.title !== "", a = i.yAxisCaptionsWidth + 2 * O, n = (t.showTicks ? P : 0) + O, d = N ? q + b : 0, S = i.xAxisCaptionsWidth + 2 * O, E = r.showTicks ? P : 0, m = w ? q + b : 0, l = a + n + d + V, f = S + E + m + V, z = Math.max(...s.map((p) => e[p].length));
|
|
36
37
|
return {
|
|
37
|
-
left:
|
|
38
|
-
top:
|
|
39
|
-
bottom:
|
|
40
|
-
right:
|
|
38
|
+
left: g ? l : b,
|
|
39
|
+
top: z === 0 ? 0 : ct * 2 + z * st,
|
|
40
|
+
bottom: W ? f + 8 : b,
|
|
41
|
+
right: b
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
for (let
|
|
46
|
-
|
|
47
|
-
return
|
|
44
|
+
function Tt(r, t, i) {
|
|
45
|
+
const s = [];
|
|
46
|
+
for (let e = 0; e < t; e++)
|
|
47
|
+
s.push(r.slice(e * i, e * i + i));
|
|
48
|
+
return s;
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
return [
|
|
50
|
+
function St(r, t) {
|
|
51
|
+
const i = Math.floor(r / t), s = r - i * t;
|
|
52
|
+
return [i, s];
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
const e = i.find((
|
|
54
|
+
function xt(r, t, i, s) {
|
|
55
|
+
const e = i.find((c) => c.type === "dots"), o = i.find((c) => c.type === "curve");
|
|
55
56
|
return {
|
|
56
|
-
dotShape: _(
|
|
57
|
-
dotColor: _(
|
|
58
|
-
dotSize: _(
|
|
59
|
-
lineShape: _(
|
|
60
|
-
lineColor: _(
|
|
61
|
-
trendColor: _(
|
|
57
|
+
dotShape: _(r, t, (e == null ? void 0 : e.aes.dotShape) ?? D.shape, "dotShape"),
|
|
58
|
+
dotColor: _(r, t, (e == null ? void 0 : e.aes.dotFill) ?? D.color, "dotFill"),
|
|
59
|
+
dotSize: _(r, t, (e == null ? void 0 : e.aes.dotSize) ?? D.size, "dotSize"),
|
|
60
|
+
lineShape: _(r, t, (o == null ? void 0 : o.aes.lineShape) ?? "solid", "lineShape"),
|
|
61
|
+
lineColor: _(r, t, (o == null ? void 0 : o.aes.lineColor) ?? Z, "lineColor"),
|
|
62
|
+
trendColor: _(r, t, (s == null ? void 0 : s.color) ?? D.color, "fillColor")
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
|
-
class
|
|
65
|
+
class Zt {
|
|
65
66
|
constructor() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
top:
|
|
72
|
-
bottom:
|
|
73
|
-
left:
|
|
74
|
-
right:
|
|
67
|
+
C(this, "reactRoot", null);
|
|
68
|
+
C(this, "parentNode", null);
|
|
69
|
+
C(this, "rootNode", null);
|
|
70
|
+
C(this, "component", /* @__PURE__ */ F.jsx(F.Fragment, {}));
|
|
71
|
+
C(this, "margins", {
|
|
72
|
+
top: v,
|
|
73
|
+
bottom: v,
|
|
74
|
+
left: v,
|
|
75
|
+
right: v
|
|
75
76
|
});
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
C(this, "chartsDimensions", {});
|
|
78
|
+
C(this, "chartSizes", {
|
|
78
79
|
chartWidth: G,
|
|
79
80
|
// width of single chart
|
|
80
81
|
chartHeight: X,
|
|
@@ -88,236 +89,239 @@ class qt {
|
|
|
88
89
|
totalHeight: X
|
|
89
90
|
// width of all charts in charts height, plus bottom axis, plus top title
|
|
90
91
|
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
x: { null:
|
|
95
|
-
y: { null:
|
|
92
|
+
C(this, "columnsCount", 1);
|
|
93
|
+
C(this, "rowsCount", 1);
|
|
94
|
+
C(this, "scales", {
|
|
95
|
+
x: { null: L().domain([0, 10]).range([0, G]) },
|
|
96
|
+
y: { null: L().domain([0, 10]).range([X, 0]) }
|
|
96
97
|
});
|
|
97
|
-
|
|
98
|
+
C(this, "captionsSizes", {
|
|
98
99
|
xAxisCaptionsWidth: 30,
|
|
99
100
|
yAxisCaptionsWidth: 100
|
|
100
101
|
});
|
|
101
|
-
|
|
102
|
+
C(this, "facetTitles", {});
|
|
102
103
|
// can be multiline
|
|
103
|
-
|
|
104
|
+
C(this, "mainTitle", []);
|
|
104
105
|
// can be multiline
|
|
105
|
-
|
|
106
|
+
C(this, "legend", { width: 0, height: 0, items: [] });
|
|
106
107
|
}
|
|
107
108
|
clear() {
|
|
108
|
-
var
|
|
109
|
-
this.parentNode && this.rootNode && ((
|
|
110
|
-
var
|
|
111
|
-
(
|
|
109
|
+
var t;
|
|
110
|
+
this.parentNode && this.rootNode && ((t = this.parentNode) == null || t.removeChild(this.rootNode), this.parentNode = null, this.rootNode = null), setTimeout(() => {
|
|
111
|
+
var i;
|
|
112
|
+
(i = this.reactRoot) == null || i.unmount(), this.reactRoot = null;
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
|
-
init(
|
|
115
|
-
this.parentNode === null && (this.parentNode =
|
|
115
|
+
init(t) {
|
|
116
|
+
this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = k(this.rootNode));
|
|
116
117
|
}
|
|
117
|
-
updateChartSizes(
|
|
118
|
-
this.chartSizes.chartWidth =
|
|
118
|
+
updateChartSizes(t) {
|
|
119
|
+
this.chartSizes.chartWidth = t.width, this.chartSizes.chartHeight = t.height;
|
|
119
120
|
}
|
|
120
|
-
updateChartDimensions(i,
|
|
121
|
-
const { chartWidth:
|
|
122
|
-
let
|
|
123
|
-
this.chartsDimensions =
|
|
124
|
-
const [
|
|
125
|
-
e,
|
|
121
|
+
updateChartDimensions(t, i, s, e) {
|
|
122
|
+
const { chartWidth: o, chartHeight: c } = this.chartSizes;
|
|
123
|
+
let g = 0, N = 0;
|
|
124
|
+
this.chartsDimensions = t.reduce((a, n, d) => {
|
|
125
|
+
const [S, E] = St(d, this.columnsCount), m = gt(d, t.length, this.columnsCount, this.rowsCount), l = ft(
|
|
126
126
|
s,
|
|
127
|
+
e,
|
|
127
128
|
this.captionsSizes,
|
|
128
|
-
|
|
129
|
+
Tt(t, this.rowsCount, this.columnsCount)[S],
|
|
129
130
|
this.facetTitles,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
), f =
|
|
133
|
-
return
|
|
134
|
-
left:
|
|
135
|
-
top:
|
|
136
|
-
chartEdgeSides:
|
|
137
|
-
padding:
|
|
138
|
-
inner: { width:
|
|
139
|
-
outer: { width: f, height:
|
|
140
|
-
},
|
|
131
|
+
m,
|
|
132
|
+
i
|
|
133
|
+
), f = o + l.left + l.right, z = c + l.top + l.bottom;
|
|
134
|
+
return a[n] = {
|
|
135
|
+
left: g,
|
|
136
|
+
top: N,
|
|
137
|
+
chartEdgeSides: m,
|
|
138
|
+
padding: l,
|
|
139
|
+
inner: { width: o, height: c },
|
|
140
|
+
outer: { width: f, height: z }
|
|
141
|
+
}, g += f, E === this.columnsCount - 1 && (g = 0, N += z), a;
|
|
141
142
|
}, {});
|
|
142
|
-
const
|
|
143
|
-
...
|
|
144
|
-
),
|
|
145
|
-
...
|
|
143
|
+
const W = Math.max(
|
|
144
|
+
...t.map((a) => this.chartsDimensions[a].outer.width + this.chartsDimensions[a].left)
|
|
145
|
+
), w = Math.max(
|
|
146
|
+
...t.map((a) => this.chartsDimensions[a].outer.height + this.chartsDimensions[a].top)
|
|
146
147
|
);
|
|
147
|
-
this.chartSizes.chartsWidth =
|
|
148
|
+
this.chartSizes.chartsWidth = W, this.chartSizes.chartsHeight = w;
|
|
148
149
|
}
|
|
149
|
-
updateViewport(i,
|
|
150
|
-
const
|
|
151
|
-
this.columnsCount =
|
|
152
|
-
let [
|
|
153
|
-
const
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
}, {}),
|
|
157
|
-
let
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
let
|
|
161
|
-
if (typeof
|
|
162
|
-
const M =
|
|
163
|
-
if (M >=
|
|
164
|
-
const
|
|
165
|
-
|
|
150
|
+
updateViewport(t, i, s, e, o, c) {
|
|
151
|
+
const g = t.length, N = Math.min(i.nRows ?? g, g), W = Math.min(i.nCols ?? g, g);
|
|
152
|
+
this.columnsCount = i.nRows ? Math.ceil(g / N) : W, this.rowsCount = Math.ceil(g / this.columnsCount);
|
|
153
|
+
let [w, a] = [1 / 0, -1 / 0], [n, d] = [1 / 0, -1 / 0];
|
|
154
|
+
const S = t.reduce((p, h) => {
|
|
155
|
+
const Y = o[h], { minX: u, minY: T, maxX: A, maxY: I } = Y;
|
|
156
|
+
return w = Math.min(w, u), n = Math.min(n, T), a = Math.max(a, A), d = Math.max(d, I), p[h] = { minX: u, maxX: A, minY: T, maxY: I }, p;
|
|
157
|
+
}, {}), E = {}, m = {};
|
|
158
|
+
let l = !1, f = !1;
|
|
159
|
+
t.forEach((p) => {
|
|
160
|
+
const h = s.scale === "log" ? Q() : L(), Y = S[p];
|
|
161
|
+
let u = s.lowerValue ? Number(s.lowerValue) : i.sharedX ? w : Y.minX, T = s.upperValue ? Number(s.upperValue) : i.sharedX ? a : Y.maxX;
|
|
162
|
+
if (typeof s.symmetricRange < "u") {
|
|
163
|
+
const M = s.symmetricRange;
|
|
164
|
+
if (M >= u && M <= T) {
|
|
165
|
+
const x = Math.max(M - u, T - M);
|
|
166
|
+
u = M - x, T = M + x;
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
const A = [0, this.chartSizes.chartWidth], I = h.copy().domain([u, T]).range([B.LEFT, this.chartSizes.chartWidth - B.RIGHT]);
|
|
170
|
+
h.domain([I.invert(0), I.invert(this.chartSizes.chartWidth)]).range(A).nice();
|
|
171
|
+
const H = this.scales.x[p];
|
|
172
|
+
if (H === void 0)
|
|
173
|
+
l = !0;
|
|
174
|
+
else if (!l) {
|
|
175
|
+
const M = H.domain(), x = H.range();
|
|
176
|
+
(M[0] !== h.domain()[0] || M[1] !== h.domain()[1] || x[0] !== h.range()[0] || x[1] !== h.range()[1]) && (l = !0);
|
|
174
177
|
}
|
|
175
|
-
|
|
178
|
+
E[p] = h;
|
|
176
179
|
});
|
|
177
|
-
const
|
|
178
|
-
const
|
|
179
|
-
return
|
|
180
|
-
(
|
|
181
|
-
const
|
|
182
|
-
return
|
|
180
|
+
const z = t.reduce((p, h) => {
|
|
181
|
+
const Y = c ? c[h] : [];
|
|
182
|
+
return p[h] = Y.reduce(
|
|
183
|
+
(u, T) => {
|
|
184
|
+
const A = T.bounded ? T.xBounds : this.scales.x[h].domain(), I = T.getInterval(A[0]), H = T.getInterval(A[1]);
|
|
185
|
+
return u.minY = Math.min(u.minY, isNaN(I.left) ? u.minY : I.left, isNaN(H.left) ? u.minY : H.left), u.maxY = Math.max(u.maxY, isNaN(I.right) ? u.maxY : I.right, isNaN(H.right) ? u.maxY : H.right), u;
|
|
183
186
|
},
|
|
184
187
|
{ minY: 1 / 0, maxY: -1 / 0 }
|
|
185
|
-
),
|
|
188
|
+
), n = Math.min(n, p[h].minY), d = Math.max(d, p[h].maxY), p;
|
|
186
189
|
}, {});
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
let T =
|
|
190
|
-
if (typeof
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
T =
|
|
190
|
+
t.forEach((p) => {
|
|
191
|
+
const h = e.scale === "log" ? Q() : L(), Y = S[p], u = z[p];
|
|
192
|
+
let T = e.lowerValue ? Number(e.lowerValue) : i.sharedY ? n : Math.min(Y.minY, u.minY), A = e.upperValue ? Number(e.upperValue) : i.sharedY ? d : Math.max(Y.maxY, u.maxY);
|
|
193
|
+
if (typeof e.symmetricRange < "u") {
|
|
194
|
+
const x = e.symmetricRange;
|
|
195
|
+
if (x >= T && x <= A) {
|
|
196
|
+
const R = Math.max(x - T, A - x);
|
|
197
|
+
T = x - R, A = x + R;
|
|
195
198
|
}
|
|
196
199
|
}
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
const M = this.scales.y[
|
|
200
|
-
if (M
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
const I = [this.chartSizes.chartHeight, 0], H = h.copy().domain([T, A]).range([this.chartSizes.chartHeight - B.BOTTOM, B.TOP]);
|
|
201
|
+
h.domain([H.invert(this.chartSizes.chartHeight), H.invert(0)]).range(I).nice();
|
|
202
|
+
const M = this.scales.y[p];
|
|
203
|
+
if (M === void 0)
|
|
204
|
+
f = !0;
|
|
205
|
+
else if (!f) {
|
|
206
|
+
const x = M.domain(), R = M.range();
|
|
207
|
+
(x[0] !== h.domain()[0] || x[1] !== h.domain()[1] || R[0] !== h.range()[0] || R[1] !== h.range()[1]) && (f = !0);
|
|
203
208
|
}
|
|
204
|
-
|
|
205
|
-
}),
|
|
209
|
+
m[p] = h;
|
|
210
|
+
}), l && (this.scales.x = E), f && (this.scales.y = m);
|
|
206
211
|
}
|
|
207
|
-
updateCaptionsSize(
|
|
208
|
-
const
|
|
209
|
-
let
|
|
210
|
-
function
|
|
211
|
-
return Math.max(...
|
|
212
|
+
updateCaptionsSize(t) {
|
|
213
|
+
const i = new ht("600 14px Arial");
|
|
214
|
+
let s = 0;
|
|
215
|
+
function e(o) {
|
|
216
|
+
return Math.max(...o.map((c) => i.getTextWidth(c)));
|
|
212
217
|
}
|
|
213
|
-
Object.values(this.scales.y).forEach((
|
|
214
|
-
const { ticks:
|
|
215
|
-
|
|
218
|
+
Object.values(this.scales.y).forEach((o) => {
|
|
219
|
+
const { ticks: c, format: g } = mt(o, t);
|
|
220
|
+
s = Math.max(s, e(c.map(g)));
|
|
216
221
|
}), this.captionsSizes = {
|
|
217
222
|
xAxisCaptionsWidth: 20,
|
|
218
|
-
yAxisCaptionsWidth:
|
|
223
|
+
yAxisCaptionsWidth: s
|
|
219
224
|
};
|
|
220
225
|
}
|
|
221
|
-
createMainTitle(
|
|
222
|
-
const
|
|
226
|
+
createMainTitle(t, i) {
|
|
227
|
+
const s = this.chartsDimensions[t[0]], e = this.chartsDimensions[t[t.length - 1]];
|
|
223
228
|
this.mainTitle = U(
|
|
224
|
-
|
|
225
|
-
this.chartSizes.chartsWidth -
|
|
229
|
+
i.name,
|
|
230
|
+
this.chartSizes.chartsWidth - s.padding.left - e.padding.right,
|
|
226
231
|
20
|
|
227
232
|
);
|
|
228
233
|
}
|
|
229
|
-
createFacetTitles(
|
|
230
|
-
this.facetTitles =
|
|
234
|
+
createFacetTitles(t, i) {
|
|
235
|
+
this.facetTitles = t.reduce((s, e, o) => (i[o].length === 1 && i[o][0] === "null" ? s[e] = [] : s[e] = U(i[o].join(", "), this.chartSizes.chartWidth, 14), s), {});
|
|
231
236
|
}
|
|
232
237
|
updateMargins() {
|
|
233
|
-
const
|
|
238
|
+
const t = tt * this.mainTitle.length, i = t > 0 ? t + et * 2 : 0;
|
|
234
239
|
this.margins = {
|
|
235
|
-
top: Math.max(
|
|
236
|
-
bottom:
|
|
237
|
-
left:
|
|
238
|
-
right: this.legend.width +
|
|
240
|
+
top: Math.max(i, v),
|
|
241
|
+
bottom: v,
|
|
242
|
+
left: v,
|
|
243
|
+
right: this.legend.width + v
|
|
239
244
|
}, 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;
|
|
240
245
|
}
|
|
241
|
-
updateLegendSize(i,
|
|
242
|
-
if (!
|
|
246
|
+
updateLegendSize(t, i, s, e) {
|
|
247
|
+
if (!t.show) {
|
|
243
248
|
this.legend = { width: 0, height: 0, items: [] };
|
|
244
249
|
return;
|
|
245
250
|
}
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
251
|
+
const o = [], c = { width: 0, height: 0, left: 0, top: 0 };
|
|
252
|
+
if (s.forEach((a) => {
|
|
253
|
+
const n = i[a.value];
|
|
254
|
+
if (n.usedAes.length === 0 || !n.aesMap)
|
|
250
255
|
return;
|
|
251
|
-
if (
|
|
252
|
-
console.warn(`Too many values for discrete legend (${
|
|
256
|
+
if (n.values.length > it) {
|
|
257
|
+
console.warn(`Too many values for discrete legend (${n.values.length})`);
|
|
253
258
|
return;
|
|
254
259
|
}
|
|
255
260
|
const d = {};
|
|
256
|
-
|
|
257
|
-
d[
|
|
258
|
-
|
|
259
|
-
(c === "dotFill" || c === "lineColor") && (d[l].color = ((f = o.aesMap[l]) == null ? void 0 : f[c]) ?? Z), c === "dotShape" && (d[l].shape = ((S = o.aesMap[l]) == null ? void 0 : S[c]) ?? "21"), c === "dotSize" && (d[l].size = ((m = o.aesMap[l]) == null ? void 0 : m[c]) ?? 3);
|
|
261
|
+
n.values.forEach((m) => {
|
|
262
|
+
d[m] || (d[m] = { ...D }), n.usedAes.forEach((l) => {
|
|
263
|
+
(l === "dotFill" || l === "lineColor") && (d[m].color = n.aesMap(m, l) ?? Z), l === "dotShape" && (d[m].shape = n.aesMap(m, l) ?? "21"), l === "dotSize" && (d[m].size = n.aesMap(m, l) ?? 3);
|
|
260
264
|
});
|
|
261
265
|
});
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
}),
|
|
265
|
-
if (
|
|
266
|
-
const { domain:
|
|
267
|
-
|
|
266
|
+
const S = a.label ?? a.value, E = dt().domain(n.values).range(n.values.map((m) => d[m])).unknown(D);
|
|
267
|
+
o.push({ ...c, id: a.value, type: "dots", title: S, scale: E, values: n.values, labels: n.labels });
|
|
268
|
+
}), e.forEach((a) => {
|
|
269
|
+
if (a.type === "dots" && j(a.aes.dotFill)) {
|
|
270
|
+
const { domain: n, range: d, columnName: S, type: E = "linear" } = a.aes.dotFill, m = S.label ?? S.value, l = nt(d, n, "linear"), f = (E === "log" ? pt() : L()).domain(n).range([this.chartSizes.chartHeight, 0]), z = at(f, n);
|
|
271
|
+
o.push({ ...c, id: "dotFill", type: "continuous", title: m, scale: l, tickPositionScale: f, values: z });
|
|
268
272
|
}
|
|
269
|
-
if (
|
|
270
|
-
const { columnName:
|
|
271
|
-
|
|
273
|
+
if (a.type === "dots" && j(a.aes.dotSize)) {
|
|
274
|
+
const { columnName: n, domain: d, range: S } = a.aes.dotSize, E = n.label ?? n.value, m = ut(d, S), l = m.ticks(3), f = m.tickFormat(3), z = l.reduce((p, h) => (p[String(h)] = f(h), p), {});
|
|
275
|
+
o.push({ ...c, id: n.value, type: "size", title: E, scale: m, values: l, labels: z });
|
|
272
276
|
}
|
|
273
|
-
}), !
|
|
277
|
+
}), !o.length) {
|
|
274
278
|
this.legend = { width: 0, height: 0, items: [] };
|
|
275
279
|
return;
|
|
276
280
|
}
|
|
277
|
-
const
|
|
281
|
+
const g = ot(o, this.chartSizes.chartHeight), N = g[g.length - 1], W = N.left + N.width + lt, w = this.chartSizes.chartHeight;
|
|
278
282
|
this.legend = {
|
|
279
|
-
width:
|
|
280
|
-
height:
|
|
281
|
-
items:
|
|
283
|
+
width: W,
|
|
284
|
+
height: w,
|
|
285
|
+
items: g
|
|
282
286
|
};
|
|
283
287
|
}
|
|
284
|
-
render(i,
|
|
285
|
-
var
|
|
286
|
-
const { xAxis: l, yAxis:
|
|
287
|
-
this.updateChartSizes(
|
|
288
|
-
const
|
|
289
|
-
|
|
288
|
+
render(t, i, s, e, o, c, g, N, W, w, a, n, d, S, E, m) {
|
|
289
|
+
var u;
|
|
290
|
+
const { xAxis: l, yAxis: f, size: z, title: p, legend: h } = s;
|
|
291
|
+
this.updateChartSizes(z), this.updateViewport(o, e, l, f, g, N), this.updateCaptionsSize(w.y), this.createFacetTitles(o, c), this.updateChartDimensions(o, e, l, f), this.updateLegendSize(h, a, d, S), this.createMainTitle(o, p), this.updateMargins();
|
|
292
|
+
const Y = /* @__PURE__ */ F.jsx(y, { dataFrame: t, children: /* @__PURE__ */ F.jsx(
|
|
293
|
+
rt,
|
|
290
294
|
{
|
|
291
295
|
settingsId: i,
|
|
292
|
-
chartSettings:
|
|
293
|
-
facetKeys:
|
|
296
|
+
chartSettings: s,
|
|
297
|
+
facetKeys: o,
|
|
294
298
|
facetSettings: e,
|
|
295
299
|
chartSizes: this.chartSizes,
|
|
296
300
|
chartsDimensions: this.chartsDimensions,
|
|
297
301
|
scales: this.scales,
|
|
298
|
-
groupedDots:
|
|
299
|
-
trendsData:
|
|
302
|
+
groupedDots: g,
|
|
303
|
+
trendsData: N,
|
|
300
304
|
legendData: this.legend,
|
|
301
305
|
columnsCount: this.columnsCount,
|
|
302
306
|
margins: this.margins,
|
|
303
|
-
keyColumn:
|
|
307
|
+
keyColumn: W,
|
|
304
308
|
mainTitle: this.mainTitle,
|
|
305
309
|
facetTitles: this.facetTitles,
|
|
306
310
|
captionsSizes: this.captionsSizes,
|
|
307
|
-
onlyPositive:
|
|
308
|
-
layersData:
|
|
309
|
-
aesGetters:
|
|
310
|
-
onTooltipHintSwitch:
|
|
311
|
+
onlyPositive: w,
|
|
312
|
+
layersData: n,
|
|
313
|
+
aesGetters: xt(t, a, S, E),
|
|
314
|
+
onTooltipHintSwitch: m
|
|
311
315
|
}
|
|
312
|
-
);
|
|
313
|
-
this.component =
|
|
316
|
+
) });
|
|
317
|
+
this.component = Y, (u = this.reactRoot) == null || u.render(Y);
|
|
314
318
|
}
|
|
315
|
-
renderError(
|
|
316
|
-
var
|
|
317
|
-
(
|
|
319
|
+
renderError(t) {
|
|
320
|
+
var i;
|
|
321
|
+
(i = this.reactRoot) == null || i.render(/* @__PURE__ */ F.jsx(K, { message: t }));
|
|
318
322
|
}
|
|
319
323
|
}
|
|
320
324
|
export {
|
|
321
|
-
|
|
325
|
+
Zt as default
|
|
322
326
|
};
|
|
323
327
|
//# sourceMappingURL=ChartRenderer.js.map
|