@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,131 +1,120 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { j as
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var k = (y, t, e) => t in y ? _(y, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : y[t] = e;
|
|
3
|
+
var c = (y, t, e) => k(y, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { j as b } from "../node_modules/react/jsx-runtime.js";
|
|
5
|
+
import K from "../node_modules/@d3fc/d3fc-chart/src/cartesian.js";
|
|
6
|
+
import "../node_modules/@d3fc/d3fc-webgl/src/scale/scaleMapper.js";
|
|
7
|
+
import Y from "../node_modules/@d3fc/d3fc-webgl/src/style/fillColor.js";
|
|
8
|
+
import X from "../node_modules/@d3fc/d3fc-series/src/webgl/point.js";
|
|
9
|
+
import j from "../node_modules/@d3fc/d3fc-series/src/svg/multi.js";
|
|
10
|
+
import q from "../node_modules/@d3fc/d3fc-series/src/webgl/multi.js";
|
|
11
|
+
import $ from "../node_modules/d3-zoom/src/zoom.js";
|
|
12
|
+
import "../node_modules/d3-zoom/src/transform.js";
|
|
13
|
+
import { createRoot as Q } from "../node_modules/react-dom/client.js";
|
|
5
14
|
import { Error as J } from "../common/Error.js";
|
|
6
|
-
import { BLACK as
|
|
7
|
-
import { splitTextByWidth as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { getFilteredLabels as I, updateLabelsBBoxes as rt } from "../scatterplot/utils/getVisibleLabels.js";
|
|
14
|
-
import { isContinuousAes as U } from "../types/common.js";
|
|
15
|
+
import { BLACK as R, DEFAULT_HEIGHT as w, DEFAULT_WIDTH as D, TITLE_LINE_HEIGHT as Z, TITLE_MARGIN as tt } from "../constants.js";
|
|
16
|
+
import { splitTextByWidth as et } from "../discrete/utils/splitTextByWidth.js";
|
|
17
|
+
import { MIN_MARGIN as L, DEFAULT_DOT_AES as G } from "../scatterplot/constants.js";
|
|
18
|
+
import { createAesGetter as H } from "../scatterplot/utils/createAesGetter.js";
|
|
19
|
+
import { getTicksAndFormat as it } from "../scatterplot/utils/getTicksAndFormat.js";
|
|
20
|
+
import { createLabelPositioner as st } from "../scatterplot/utils/getVisibleLabels.js";
|
|
21
|
+
import { isContinuousAes as A } from "../types/common.js";
|
|
15
22
|
import "../types/discrete.js";
|
|
16
23
|
import "../types/scatterplot.js";
|
|
17
24
|
import "../types/heatmap.js";
|
|
18
25
|
import "../types/dendro.js";
|
|
19
26
|
import "../types/histogram.js";
|
|
20
27
|
import "../types/bubble.js";
|
|
21
|
-
import { getContinuousColorScale as
|
|
22
|
-
import { getContinuousLegendTicks as
|
|
23
|
-
import { TextMeasurer as
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import "../node_modules/
|
|
27
|
-
import
|
|
28
|
-
import "../
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
import { sqrt as xt } from "../node_modules/d3-scale/src/pow.js";
|
|
41
|
-
import { rgb as D } from "../node_modules/d3-color/src/color.js";
|
|
42
|
-
import Lt from "../node_modules/d3-quadtree/src/quadtree.js";
|
|
43
|
-
import bt from "../node_modules/d3-polygon/src/contains.js";
|
|
44
|
-
function V(h) {
|
|
45
|
-
return h / 2.35 * (h / 2.35) * 64;
|
|
46
|
-
}
|
|
47
|
-
function G(h, t) {
|
|
48
|
-
return h + (1 - h) * (1 - t);
|
|
28
|
+
import { getContinuousColorScale as ot } from "../utils/getContinuousColorScale.js";
|
|
29
|
+
import { getContinuousLegendTicks as at } from "../utils/getContinuousLegendTicks.js";
|
|
30
|
+
import { TextMeasurer as F } from "../utils/TextMeasurer/TextMeasurer.js";
|
|
31
|
+
import { SVGLayer as nt } from "./components/SVGLayer.js";
|
|
32
|
+
import { PADDINGS as W, TITLE_LINE as I, LEGEND_OFFSET as rt } from "./constants.js";
|
|
33
|
+
import lt from "../node_modules/@d3fc/d3fc-pointer/src/pointer.js";
|
|
34
|
+
import ht from "../node_modules/kdbush/index.js";
|
|
35
|
+
import { DataFrameProvider as ct } from "../common/useDataFrame.js";
|
|
36
|
+
import { arrangeLegendParts as dt } from "../utils/arrangeLegendParts.js";
|
|
37
|
+
import { stringToNumberRgba as M, getColorWithFakeOpacity as P, GET_BLACK as O } from "./colors.js";
|
|
38
|
+
import T from "../node_modules/d3-scale/src/linear.js";
|
|
39
|
+
import V from "../node_modules/d3-scale/src/log.js";
|
|
40
|
+
import N from "../node_modules/d3-selection/src/select.js";
|
|
41
|
+
import mt from "../node_modules/d3-scale/src/ordinal.js";
|
|
42
|
+
import pt from "../node_modules/d3-scale/src/symlog.js";
|
|
43
|
+
import { sqrt as gt } from "../node_modules/d3-scale/src/pow.js";
|
|
44
|
+
import ut from "../node_modules/d3-polygon/src/contains.js";
|
|
45
|
+
function B(y) {
|
|
46
|
+
return y / 2.35 * (y / 2.35) * 64;
|
|
49
47
|
}
|
|
50
|
-
function
|
|
51
|
-
return [
|
|
52
|
-
G(h.r / 255, t),
|
|
53
|
-
G(h.g / 255, t),
|
|
54
|
-
G(h.b / 255, t),
|
|
55
|
-
1
|
|
56
|
-
];
|
|
48
|
+
function E(y, t, e) {
|
|
49
|
+
return e.length === 0 ? !0 : e.some((i) => i.closed && i.points.length > 2 && ut(i.points, [y, t]));
|
|
57
50
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
function k(h, t) {
|
|
62
|
-
const e = t.find((c) => c.type === "dots"), i = t.find((c) => c.type === "curve");
|
|
51
|
+
function U(y, t, e) {
|
|
52
|
+
const i = e.find((o) => o.type === "dots"), r = e.find((o) => o.type === "curve");
|
|
63
53
|
return {
|
|
64
|
-
dotFill:
|
|
65
|
-
dotSize:
|
|
66
|
-
lineType:
|
|
54
|
+
dotFill: H(y, t, (i == null ? void 0 : i.aes.dotFill) ?? G.color, "dotFill"),
|
|
55
|
+
dotSize: H(y, t, (i == null ? void 0 : i.aes.dotSize) ?? G.size, "dotSize"),
|
|
56
|
+
lineType: H(y, t, (r == null ? void 0 : r.aes.lineShape) ?? "solid", "lineShape")
|
|
67
57
|
};
|
|
68
58
|
}
|
|
69
|
-
class
|
|
59
|
+
class oe {
|
|
70
60
|
constructor() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
c(this, "reactRoot", null);
|
|
62
|
+
c(this, "parentNode", null);
|
|
63
|
+
c(this, "rootNode", null);
|
|
64
|
+
c(this, "canvasNode", null);
|
|
65
|
+
c(this, "svgLayerElement", null);
|
|
66
|
+
c(this, "svgLayerComponent", /* @__PURE__ */ b.jsx(b.Fragment, {}));
|
|
67
|
+
c(this, "aesGetters", {
|
|
78
68
|
dotSize: () => 2,
|
|
79
|
-
dotFill: () =>
|
|
69
|
+
dotFill: () => R,
|
|
80
70
|
lineType: () => "solid"
|
|
81
71
|
});
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
c(this, "tools", null);
|
|
73
|
+
c(this, "margins", {
|
|
84
74
|
top: L,
|
|
85
75
|
bottom: L,
|
|
86
76
|
left: L,
|
|
87
77
|
right: L
|
|
88
78
|
});
|
|
89
|
-
|
|
90
|
-
chartWidth:
|
|
79
|
+
c(this, "chartSizes", {
|
|
80
|
+
chartWidth: D,
|
|
91
81
|
// width of single chart
|
|
92
|
-
chartHeight:
|
|
82
|
+
chartHeight: w,
|
|
93
83
|
// height of single chart
|
|
94
|
-
totalWidth:
|
|
84
|
+
totalWidth: D,
|
|
95
85
|
// width of all charts in charts row, plus left axis, plus legend
|
|
96
|
-
totalHeight:
|
|
86
|
+
totalHeight: w
|
|
97
87
|
// width of all charts in charts height, plus bottom axis, plus top title
|
|
98
88
|
});
|
|
99
|
-
|
|
100
|
-
x:
|
|
101
|
-
y:
|
|
102
|
-
xOriginal:
|
|
103
|
-
yOriginal:
|
|
89
|
+
c(this, "scales", {
|
|
90
|
+
x: T().domain([0, 10]).range([0, D]),
|
|
91
|
+
y: T().domain([0, 10]).range([w, 0]),
|
|
92
|
+
xOriginal: T().domain([0, 10]).range([0, D]),
|
|
93
|
+
yOriginal: T().domain([0, 10]).range([w, 0])
|
|
104
94
|
});
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
c(this, "polygons", []);
|
|
96
|
+
c(this, "onPolygonUpdateOutside", () => {
|
|
107
97
|
});
|
|
108
|
-
|
|
98
|
+
c(this, "onTooltipHintSwitch", () => {
|
|
109
99
|
});
|
|
110
|
-
|
|
100
|
+
c(this, "onLassoControlsStateUpdate", () => {
|
|
111
101
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
c(this, "zoomTransform", null);
|
|
103
|
+
c(this, "zoomStateKey", "");
|
|
104
|
+
c(this, "selectedDot", null);
|
|
105
|
+
c(this, "captionsSizes", {
|
|
116
106
|
xAxisCaptionsWidth: 30,
|
|
117
107
|
yAxisCaptionsWidth: 100
|
|
118
108
|
});
|
|
119
|
-
|
|
109
|
+
c(this, "mainTitle", []);
|
|
120
110
|
// can be multiline
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
l(this, "onPolygonUpdate", (t) => {
|
|
111
|
+
c(this, "legend", { width: 0, height: 0, items: [] });
|
|
112
|
+
c(this, "notCalculatedProps", {});
|
|
113
|
+
c(this, "allDots", []);
|
|
114
|
+
c(this, "visibleLabels", []);
|
|
115
|
+
c(this, "onPolygonUpdate", (t) => {
|
|
127
116
|
this.polygons = t, this.updateByLasso();
|
|
128
|
-
const e = this.allDots.filter((i) =>
|
|
117
|
+
const e = this.allDots.filter((i) => E(i.x, i.y, this.polygons)).map((i) => i.idx);
|
|
129
118
|
this.onPolygonUpdateOutside(e, t);
|
|
130
119
|
});
|
|
131
120
|
}
|
|
@@ -137,201 +126,202 @@ class de {
|
|
|
137
126
|
});
|
|
138
127
|
}
|
|
139
128
|
init(t) {
|
|
140
|
-
this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.canvasNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.parentNode.appendChild(this.canvasNode), this.reactRoot =
|
|
129
|
+
this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.canvasNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.parentNode.appendChild(this.canvasNode), this.reactRoot = Q(this.rootNode));
|
|
141
130
|
}
|
|
142
131
|
updateChartSizes(t) {
|
|
143
132
|
(t.width !== this.chartSizes.chartWidth || t.height !== this.chartSizes.chartHeight) && (this.chartSizes.chartWidth = t.width, this.chartSizes.chartHeight = t.height, this.scales.x.range([0, this.chartSizes.chartWidth]), this.scales.y.range([this.chartSizes.chartHeight, 0]));
|
|
144
133
|
}
|
|
145
134
|
updateViewport(t, e, i) {
|
|
146
|
-
const
|
|
147
|
-
let { minX:
|
|
148
|
-
if (t.lowerValue !== void 0 && (
|
|
135
|
+
const r = t.scale === "log" ? V() : T();
|
|
136
|
+
let { minX: o, minY: l, maxX: m, maxY: u } = i;
|
|
137
|
+
if (t.lowerValue !== void 0 && (o = Math.max(o, t.lowerValue)), t.upperValue !== void 0 && (m = Math.min(m, t.upperValue)), e.lowerValue !== void 0 && (l = Math.max(l, e.lowerValue)), e.upperValue !== void 0 && (u = Math.min(u, e.upperValue)), t.symmetricRange !== void 0) {
|
|
149
138
|
const a = t.symmetricRange;
|
|
150
|
-
if (a >=
|
|
151
|
-
const
|
|
152
|
-
|
|
139
|
+
if (a >= o && a <= m) {
|
|
140
|
+
const f = Math.max(a - o, m - a);
|
|
141
|
+
o = a - f, m = a + f;
|
|
153
142
|
}
|
|
154
143
|
}
|
|
155
144
|
if (typeof e.symmetricRange < "u") {
|
|
156
145
|
const a = e.symmetricRange;
|
|
157
|
-
if (a >=
|
|
158
|
-
const
|
|
159
|
-
|
|
146
|
+
if (a >= l && a <= u) {
|
|
147
|
+
const f = Math.max(a - l, u - a);
|
|
148
|
+
l = a - f, u = a + f;
|
|
160
149
|
}
|
|
161
150
|
}
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
const d = e.scale === "log" ?
|
|
165
|
-
d.domain([
|
|
151
|
+
const S = [0, this.chartSizes.chartWidth], x = r.copy().domain([o, m]).range([W.LEFT, this.chartSizes.chartWidth - W.RIGHT]);
|
|
152
|
+
r.domain([x.invert(0), x.invert(this.chartSizes.chartWidth)]).range(S).nice(), this.scales.x = r, this.scales.xOriginal = r.copy();
|
|
153
|
+
const d = e.scale === "log" ? V() : T(), h = [this.chartSizes.chartHeight, 0], g = d.copy().domain([l, u]).range([this.chartSizes.chartHeight - W.BOTTOM, W.TOP]);
|
|
154
|
+
d.domain([g.invert(this.chartSizes.chartHeight), g.invert(0)]).range(h).nice(), this.scales.y = d, this.scales.yOriginal = d.copy();
|
|
166
155
|
}
|
|
167
156
|
updateCaptionsSize() {
|
|
168
|
-
const t = new
|
|
169
|
-
function e(
|
|
170
|
-
return Math.max(...
|
|
157
|
+
const t = new F("600 14px Arial");
|
|
158
|
+
function e(l) {
|
|
159
|
+
return Math.max(...l.map((m) => t.getTextWidth(m)));
|
|
171
160
|
}
|
|
172
|
-
const { ticks: i, format:
|
|
161
|
+
const { ticks: i, format: r } = it(this.scales.y, !1), o = e(i.map(r));
|
|
173
162
|
this.captionsSizes = {
|
|
174
163
|
xAxisCaptionsWidth: 20,
|
|
175
|
-
yAxisCaptionsWidth:
|
|
164
|
+
yAxisCaptionsWidth: o
|
|
176
165
|
};
|
|
177
166
|
}
|
|
178
167
|
createMainTitle(t) {
|
|
179
|
-
this.mainTitle =
|
|
168
|
+
this.mainTitle = et(
|
|
180
169
|
t.name,
|
|
181
170
|
this.chartSizes.totalWidth - this.margins.left - this.margins.right,
|
|
182
171
|
20
|
|
183
172
|
);
|
|
184
173
|
}
|
|
185
174
|
updateMargins() {
|
|
186
|
-
const t = Z * this.mainTitle.length, e = t > 0 ? t +
|
|
175
|
+
const t = Z * this.mainTitle.length, e = t > 0 ? t + tt * 2 : 0;
|
|
187
176
|
this.margins = {
|
|
188
177
|
top: Math.max(e, L),
|
|
189
|
-
bottom: L + this.captionsSizes.xAxisCaptionsWidth +
|
|
190
|
-
left: L + this.captionsSizes.yAxisCaptionsWidth +
|
|
178
|
+
bottom: L + this.captionsSizes.xAxisCaptionsWidth + I,
|
|
179
|
+
left: L + this.captionsSizes.yAxisCaptionsWidth + I,
|
|
191
180
|
right: this.legend.width + L
|
|
192
|
-
}, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartHeight, this.legend.height) + this.margins.bottom,
|
|
181
|
+
}, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartHeight, this.legend.height) + this.margins.bottom, N(this.canvasNode).style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
|
|
193
182
|
}
|
|
194
|
-
updateLegendSize(t, e, i,
|
|
183
|
+
updateLegendSize(t, e, i, r) {
|
|
195
184
|
if (!t.show) {
|
|
196
185
|
this.legend = { width: 0, height: 0, items: [] };
|
|
197
186
|
return;
|
|
198
187
|
}
|
|
199
|
-
const
|
|
188
|
+
const o = [], l = { width: 0, height: 0, left: 0, top: 0 };
|
|
200
189
|
if (i.forEach((d) => {
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
return;
|
|
204
|
-
if (r.values.length > tt) {
|
|
205
|
-
console.warn(`Too many values for discrete legend (${r.values.length})`);
|
|
190
|
+
const h = e[d.value];
|
|
191
|
+
if (h.usedAes.length === 0 || !h.aesMap)
|
|
206
192
|
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var s, o;
|
|
212
|
-
S === "dotFill" && (u[g].color = ((s = r.aesMap[g]) == null ? void 0 : s[S]) ?? E), S === "dotSize" && (u[g].size = ((o = r.aesMap[g]) == null ? void 0 : o[S]) ?? 3);
|
|
193
|
+
const g = {};
|
|
194
|
+
h.values.forEach((p) => {
|
|
195
|
+
g[p] || (g[p] = { ...G }), h.usedAes.forEach((v) => {
|
|
196
|
+
v === "dotFill" && (g[p].color = h.aesMap(p, v) ?? R), v === "dotSize" && (g[p].size = Number(h.aesMap(p, v) ?? 3));
|
|
213
197
|
});
|
|
214
198
|
});
|
|
215
|
-
const a = d.label ?? d.value,
|
|
216
|
-
|
|
217
|
-
}),
|
|
218
|
-
if (d.type === "dots" &&
|
|
219
|
-
const { domain:
|
|
220
|
-
|
|
199
|
+
const a = d.label ?? d.value, f = mt().domain(h.values).range(h.values.map((p) => g[p]));
|
|
200
|
+
o.push({ ...l, id: d.value, type: "dots", title: a, scale: f, values: h.values, labels: h.labels });
|
|
201
|
+
}), r.forEach((d) => {
|
|
202
|
+
if (d.type === "dots" && A(d.aes.dotFill)) {
|
|
203
|
+
const { domain: h, range: g, columnName: a, type: f = "linear" } = d.aes.dotFill, p = a.label ?? a.value, v = ot(g, h, "linear"), s = (f === "log" ? pt() : T()).domain(h).range([this.chartSizes.chartHeight, 0]), n = at(s, h);
|
|
204
|
+
o.push({ ...l, id: "dotFill", type: "continuous", title: p, scale: v, tickPositionScale: s, values: n });
|
|
221
205
|
}
|
|
222
|
-
if (d.type === "dots" &&
|
|
223
|
-
const { columnName:
|
|
224
|
-
|
|
206
|
+
if (d.type === "dots" && A(d.aes.dotSize)) {
|
|
207
|
+
const { columnName: h, domain: g, range: a } = d.aes.dotSize, f = h.label ?? h.value, p = gt(g, a), v = p.ticks(3), s = p.tickFormat(3), n = v.reduce((C, z) => (C[String(z)] = s(z), C), {});
|
|
208
|
+
o.push({ ...l, id: h.value, type: "size", title: f, scale: p, values: v, labels: n });
|
|
225
209
|
}
|
|
226
|
-
}), !
|
|
210
|
+
}), !o.length) {
|
|
227
211
|
this.legend = { width: 0, height: 0, items: [] };
|
|
228
212
|
return;
|
|
229
213
|
}
|
|
230
|
-
const m =
|
|
214
|
+
const m = dt(o, this.chartSizes.chartHeight), u = m[m.length - 1], S = u.left + u.width + rt, x = this.chartSizes.chartHeight;
|
|
231
215
|
this.legend = {
|
|
232
|
-
width:
|
|
233
|
-
height:
|
|
216
|
+
width: S,
|
|
217
|
+
height: x,
|
|
234
218
|
items: m
|
|
235
219
|
};
|
|
236
220
|
}
|
|
237
|
-
initSettings(t, e, i,
|
|
238
|
-
const { xAxis:
|
|
239
|
-
this.updateChartSizes(
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
return
|
|
243
|
-
}),
|
|
221
|
+
initSettings(t, e, i, r, o, l, m) {
|
|
222
|
+
const { xAxis: u, yAxis: S, size: x, title: d, legend: h } = i;
|
|
223
|
+
this.updateChartSizes(x), this.updateViewport(u, S, r), this.updateCaptionsSize(), this.updateLegendSize(h, o, m, l), this.createMainTitle(d), this.updateMargins(), this.aesGetters = U(t, o, l);
|
|
224
|
+
const g = Y().data(e).value((s) => {
|
|
225
|
+
const n = M(this.aesGetters.dotFill(s.idx));
|
|
226
|
+
return n[3] = !s.dimmed && E(s.x, s.y, this.polygons) ? 1 : 0.4, P(n, n);
|
|
227
|
+
}), a = X().equals((s, n) => s === n).size((s) => B(this.aesGetters.dotSize(s.idx))).crossValue((s) => s.x).mainValue((s) => s.y).decorate((s) => g(s)), f = $().scaleExtent([0.1, 1e3]).filter((s) => s.type === "wheel" || s.metaKey || s.ctrlKey).on("start", () => {
|
|
244
228
|
this.selectedDot = null;
|
|
245
229
|
}).on("zoom", (s) => {
|
|
246
|
-
const
|
|
247
|
-
this.scales.x.domain(
|
|
230
|
+
const n = s.transform, C = n.rescaleX(this.scales.xOriginal), z = n.rescaleY(this.scales.yOriginal);
|
|
231
|
+
this.scales.x.domain(C.domain()), this.scales.y.domain(z.domain()), this.zoomTransform = n, this.zoomStateKey = `${n.x}_${n.y}_${n.k}`, this.updateLabelsPosition(this.visibleLabels), this.renderSvgLayer(t), this.renderWebglLayer();
|
|
248
232
|
}).on("end", () => {
|
|
249
|
-
this.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
o = (A = this.tools) == null ? void 0 : A.qt.find(X, Y, j);
|
|
258
|
-
}
|
|
259
|
-
const x = this.selectedDot && !o || !this.selectedDot && o || ((R = this.selectedDot) == null ? void 0 : R.id) !== (o == null ? void 0 : o.id);
|
|
260
|
-
this.selectedDot = o ?? null, x && this.renderSvgLayer();
|
|
261
|
-
}), S = mt({
|
|
233
|
+
this.visibleLabels = this.computeLabels(this.allDots), this.renderSvgLayer(t);
|
|
234
|
+
}), p = lt().on("point", ([s]) => {
|
|
235
|
+
var z;
|
|
236
|
+
let n;
|
|
237
|
+
s && (n = this.getClosestDot(s.x, s.y));
|
|
238
|
+
const C = this.selectedDot && !n || !this.selectedDot && n || ((z = this.selectedDot) == null ? void 0 : z.idx) !== (n == null ? void 0 : n.idx);
|
|
239
|
+
this.selectedDot = n ?? null, C && this.renderSvgLayer(t);
|
|
240
|
+
}), v = K({
|
|
262
241
|
xScale: this.scales.x,
|
|
263
242
|
yScale: this.scales.y
|
|
264
|
-
}).xAxisHeight(() => "0").yAxisWidth(() => "0").svgPlotArea(
|
|
243
|
+
}).xAxisHeight(() => "0").yAxisWidth(() => "0").svgPlotArea(j()).webglPlotArea(
|
|
265
244
|
// only render the point series on the WebGL layer
|
|
266
|
-
|
|
245
|
+
q().series([a]).mapping((s) => s)
|
|
267
246
|
).decorate((s) => {
|
|
268
|
-
const
|
|
269
|
-
|
|
247
|
+
const n = s.enter();
|
|
248
|
+
n && !this.svgLayerElement && (n.style("grid-template-columns", "0 auto 1fr auto 0"), n.style("grid-template-rows", "0 auto 1fr auto 0"), this.svgLayerElement = n.select(".svg-plot-area.plot-area svg").node()), n.select(".svg-plot-area.plot-area").attr("class", "svg-plot-area plot-area miplots-scatterplot-plot-area").call(f).call(p);
|
|
270
249
|
});
|
|
271
250
|
this.tools = {
|
|
272
|
-
webglChart:
|
|
273
|
-
zoom:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}, T(this.canvasNode).datum(t).style("position", "absolute").style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
|
|
251
|
+
webglChart: v,
|
|
252
|
+
zoom: f,
|
|
253
|
+
fillColor: g,
|
|
254
|
+
pointSeries: a
|
|
255
|
+
}, N(this.canvasNode).datum(e).style("position", "absolute").style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
|
|
278
256
|
}
|
|
279
|
-
updateAes(t, e) {
|
|
280
|
-
this.tools !== null && (this.aesGetters =
|
|
281
|
-
const
|
|
282
|
-
return
|
|
257
|
+
updateAes(t, e, i) {
|
|
258
|
+
this.tools !== null && (this.aesGetters = U(t, e, i), this.tools.fillColor.value((r) => {
|
|
259
|
+
const o = this.aesGetters.dotFill ?? O, l = M(o(r.idx));
|
|
260
|
+
return l[3] = !r.dimmed && E(r.x, r.y, this.polygons) ? 1 : 0.4, P(l, l);
|
|
283
261
|
}));
|
|
284
262
|
}
|
|
285
263
|
updatePointSize() {
|
|
286
|
-
this.tools !== null && (
|
|
264
|
+
this.tools !== null && (N(this.canvasNode).datum([...this.allDots]), this.tools.pointSeries.size((t) => B(this.aesGetters.dotSize(t.data))));
|
|
287
265
|
}
|
|
288
266
|
updateByLasso() {
|
|
289
267
|
var t;
|
|
290
268
|
this.tools !== null && ((t = this.tools) == null || t.fillColor.value((e) => {
|
|
291
|
-
const i = this.aesGetters.dotFill ??
|
|
292
|
-
return
|
|
269
|
+
const i = this.aesGetters.dotFill ?? O, r = M(i(e.idx));
|
|
270
|
+
return r[3] = !e.dimmed && E(e.x, e.y, this.polygons) ? 1 : 0.4, P(r, r);
|
|
293
271
|
}), this.renderWebglLayer());
|
|
294
272
|
}
|
|
295
273
|
createQuadtree(t) {
|
|
296
|
-
|
|
274
|
+
const e = new ht(t.length, 512);
|
|
275
|
+
for (let i = 0; i < t.length; i++)
|
|
276
|
+
e.add(t[i].x, t[i].y);
|
|
277
|
+
return e.finish();
|
|
297
278
|
}
|
|
298
|
-
|
|
299
|
-
|
|
279
|
+
getClosestDot(t, e) {
|
|
280
|
+
var a, f;
|
|
281
|
+
const i = (a = this.tools) == null ? void 0 : a.qt;
|
|
282
|
+
if (!i) return null;
|
|
283
|
+
const r = this.allDots, o = this.scales.x.invert(t), l = this.scales.y.invert(e), m = 1 / (((f = this.zoomTransform) == null ? void 0 : f.k) || 1), u = o - m, S = o + m, x = l - m, d = l + m, h = i.range(u, x, S, d), g = h.reduce((p, v) => {
|
|
284
|
+
const s = r[v], n = this.scales.x(s.x) - t, C = this.scales.y(s.y) - e, z = Math.hypot(n, C);
|
|
285
|
+
return (p === null || z < p.distance) && (p.index = v, p.distance = z), p;
|
|
286
|
+
}, {
|
|
287
|
+
index: -1,
|
|
288
|
+
distance: 1 / 0
|
|
289
|
+
});
|
|
290
|
+
return h.length === 0 || g.index === -1 ? null : r[g.index];
|
|
300
291
|
}
|
|
301
|
-
|
|
292
|
+
updateDots(t) {
|
|
293
|
+
this.tools !== null && (N(this.canvasNode).datum(t), this.tools.fillColor.data(t), this.tools.qt = this.createQuadtree(t), this.allDots = t);
|
|
294
|
+
}
|
|
295
|
+
render(t, e, i, r, o, l, m, u, S, x, d, h, g) {
|
|
302
296
|
if (this.tools === null)
|
|
303
297
|
this.initSettings(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
298
|
+
t,
|
|
299
|
+
o,
|
|
300
|
+
i,
|
|
301
|
+
l,
|
|
302
|
+
S,
|
|
303
|
+
u,
|
|
304
|
+
x
|
|
305
|
+
);
|
|
311
306
|
else {
|
|
312
|
-
const { title: a, legend:
|
|
313
|
-
this.updateChartSizes(
|
|
307
|
+
const { title: a, legend: f, size: p } = i;
|
|
308
|
+
this.updateChartSizes(p), this.updateLegendSize(f, S, x, u), this.createMainTitle(a), this.updateMargins(), this.updateAes(t, S, u);
|
|
314
309
|
}
|
|
315
|
-
this.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
layers: m
|
|
323
|
-
}, this.renderWebglLayer(), this.renderSvgLayer();
|
|
310
|
+
this.onPolygonUpdateOutside = d, this.onTooltipHintSwitch = h, this.onLassoControlsStateUpdate = g, this.allDots !== o && (this.updateDots(o), this.visibleLabels = this.computeLabels(o)), this.notCalculatedProps = {
|
|
311
|
+
settingsId: e,
|
|
312
|
+
chartSettings: i,
|
|
313
|
+
keyColumn: r,
|
|
314
|
+
dotsByGrouping: m,
|
|
315
|
+
layers: u
|
|
316
|
+
}, this.renderWebglLayer(), this.renderSvgLayer(t);
|
|
324
317
|
}
|
|
325
318
|
renderWebglLayer() {
|
|
326
319
|
var t, e;
|
|
327
|
-
(t = this.tools) != null && t.webglChart &&
|
|
320
|
+
(t = this.tools) != null && t.webglChart && N(this.canvasNode).call((e = this.tools) == null ? void 0 : e.webglChart);
|
|
328
321
|
}
|
|
329
|
-
renderSvgLayer() {
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
i.x = this.scales.x(i.dot.x), i.y = this.scales.y(i.dot.y);
|
|
333
|
-
}), rt(this.visibleLabels);
|
|
334
|
-
const t = {
|
|
322
|
+
renderSvgLayer(t) {
|
|
323
|
+
var i;
|
|
324
|
+
const e = {
|
|
335
325
|
settingsId: this.notCalculatedProps.settingsId,
|
|
336
326
|
chartSettings: this.notCalculatedProps.chartSettings,
|
|
337
327
|
keyColumn: this.notCalculatedProps.keyColumn,
|
|
@@ -353,14 +343,41 @@ class de {
|
|
|
353
343
|
onTooltipHintSwitch: this.onTooltipHintSwitch,
|
|
354
344
|
onLassoControlsStateUpdate: this.onLassoControlsStateUpdate
|
|
355
345
|
};
|
|
356
|
-
this.svgLayerComponent = /* @__PURE__ */
|
|
346
|
+
this.svgLayerComponent = /* @__PURE__ */ b.jsx(ct, { dataFrame: t, children: /* @__PURE__ */ b.jsx(nt, { ...e }) }), (i = this.reactRoot) == null || i.render(this.svgLayerComponent);
|
|
357
347
|
}
|
|
358
348
|
renderError(t) {
|
|
359
349
|
var e;
|
|
360
|
-
(e = this.reactRoot) == null || e.render(/* @__PURE__ */
|
|
350
|
+
(e = this.reactRoot) == null || e.render(/* @__PURE__ */ b.jsx(J, { message: t }));
|
|
351
|
+
}
|
|
352
|
+
computeLabels(t) {
|
|
353
|
+
const e = new F("16px Manrope"), i = st(this.chartSizes.chartWidth, this.chartSizes.chartHeight), r = [];
|
|
354
|
+
for (let o = 0; o < t.length; o++) {
|
|
355
|
+
const l = t[o];
|
|
356
|
+
if (l.label == null)
|
|
357
|
+
continue;
|
|
358
|
+
const m = String(l.label), u = e.getTextMetrics(m), S = this.scales.x(l.x), x = this.scales.y(l.y), d = u.width, h = u.actualBoundingBoxAscent + u.actualBoundingBoxDescent, g = 10, a = i(S, x, d, h, g);
|
|
359
|
+
a && r.push({
|
|
360
|
+
x: S,
|
|
361
|
+
y: x,
|
|
362
|
+
dot: l,
|
|
363
|
+
name: m,
|
|
364
|
+
width: d,
|
|
365
|
+
height: h,
|
|
366
|
+
padding: g,
|
|
367
|
+
xPosition: a[0],
|
|
368
|
+
yPosition: a[1]
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
return r;
|
|
372
|
+
}
|
|
373
|
+
updateLabelsPosition(t) {
|
|
374
|
+
for (let e = 0; e < t.length; e++) {
|
|
375
|
+
const i = t[e];
|
|
376
|
+
i.x = this.scales.x(i.dot.x), i.y = this.scales.y(i.dot.y);
|
|
377
|
+
}
|
|
361
378
|
}
|
|
362
379
|
}
|
|
363
380
|
export {
|
|
364
|
-
|
|
381
|
+
oe as default
|
|
365
382
|
};
|
|
366
383
|
//# sourceMappingURL=ChartRenderer.js.map
|