@milaboratories/graph-maker 1.1.137 → 1.1.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -24
- package/dist/GraphMaker/components/LassoControls/index.vue.js +15 -13
- package/dist/GraphMaker/components/LassoControls/index.vue.js.map +1 -1
- package/dist/GraphMaker/components/SettingsTabs/icons/AxesIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/AxesIcon.vue.js +1 -1
- package/dist/GraphMaker/components/SettingsTabs/icons/AxesIcon.vue.js.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/DeleteChartIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/DeleteChartIcon.vue.js +1 -1
- package/dist/GraphMaker/components/SettingsTabs/icons/DeleteChartIcon.vue.js.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/ExportIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/ExportIcon.vue.js +1 -1
- package/dist/GraphMaker/components/SettingsTabs/icons/ExportIcon.vue.js.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LayersIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LayersIcon.vue.js +1 -1
- package/dist/GraphMaker/components/SettingsTabs/icons/LayersIcon.vue.js.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LinkIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LinkIcon.vue.js +1 -1
- package/dist/GraphMaker/components/SettingsTabs/icons/LinkIcon.vue.js.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.d.ts +3 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.js +12 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.js.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue2.js +5 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue2.js.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/icons/SettingsIcon.vue.d.ts.map +1 -0
- package/dist/GraphMaker/components/SettingsTabs/index.vue.d.ts +2 -0
- package/dist/GraphMaker/components/SettingsTabs/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/SettingsTabs/index.vue.js +17 -15
- package/dist/GraphMaker/components/SettingsTabs/index.vue.js.map +1 -1
- package/dist/GraphMaker/forms/LogForm.vue.d.ts +19 -0
- package/dist/GraphMaker/forms/LogForm.vue.d.ts.map +1 -0
- package/dist/GraphMaker/forms/LogForm.vue.js +22 -0
- package/dist/GraphMaker/forms/LogForm.vue.js.map +1 -0
- package/dist/GraphMaker/forms/index.d.ts +22 -0
- package/dist/GraphMaker/forms/index.d.ts.map +1 -1
- package/dist/GraphMaker/forms/index.js +35 -28
- package/dist/GraphMaker/forms/index.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts +1 -0
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +146 -144
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/store.d.ts.map +1 -1
- package/dist/GraphMaker/store.js +71 -67
- package/dist/GraphMaker/store.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +9 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +17 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +13 -4
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +28 -7
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +6 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +16 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +14 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js +95 -72
- package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js +124 -122
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js +72 -91
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js +43 -41
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js +28 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js +94 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +42 -38
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Legend.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js +11 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js +20 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +181 -181
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js +2 -2
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js +45 -45
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js +27 -27
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Legend.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js +18 -18
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js +36 -36
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js +45 -41
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js +33 -33
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +90 -93
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +200 -199
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +17 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/BoxElement.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +102 -99
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js +31 -36
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js +62 -74
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js +52 -53
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js +32 -32
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js +7 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js +23 -23
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js +63 -63
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js +60 -64
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js +23 -23
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js +5 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js +13 -13
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +258 -256
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +45 -44
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +107 -106
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +18 -18
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +99 -95
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +30 -29
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js +143 -142
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/HistogramSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js +30 -30
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/ChartsGroup.js +7 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js +53 -54
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +59 -55
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/@d3fc/d3fc-axis/src/axisBase.js +7 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js +6 -12
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-shape/src/line.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js +148 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js +172 -168
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +26 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js +11 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js +30 -29
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js +135 -153
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js +35 -32
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js +27 -27
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/constants.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +24 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +11 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +57 -58
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js +85 -83
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js +20 -20
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +44 -37
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js +11 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js +46 -56
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +223 -205
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +22 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js +42 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js +84 -81
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/SVGLayer.js +11 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js +15 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +89 -114
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +3 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js +39 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js +101 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js +3 -3
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +1031 -1023
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/GraphMaker/icons/AxesIcon.vue.d.ts.map +0 -1
- package/dist/GraphMaker/icons/AxesIcon.vue.js.map +0 -1
- package/dist/GraphMaker/icons/DeleteChartIcon.vue.d.ts.map +0 -1
- package/dist/GraphMaker/icons/DeleteChartIcon.vue.js.map +0 -1
- package/dist/GraphMaker/icons/ExportIcon.vue.d.ts.map +0 -1
- package/dist/GraphMaker/icons/ExportIcon.vue.js.map +0 -1
- package/dist/GraphMaker/icons/LayersIcon.vue.d.ts.map +0 -1
- package/dist/GraphMaker/icons/LayersIcon.vue.js.map +0 -1
- package/dist/GraphMaker/icons/LinkIcon.vue.d.ts.map +0 -1
- package/dist/GraphMaker/icons/LinkIcon.vue.js.map +0 -1
- package/dist/GraphMaker/icons/SettingsIcon.vue.d.ts.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js +0 -91
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js +0 -30
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js +0 -29
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js +0 -12
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js +0 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js +0 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js +0 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js +0 -51
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js +0 -21
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js +0 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js +0 -12
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js +0 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js +0 -19
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js +0 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js +0 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js.map +0 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js +0 -24
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js.map +0 -1
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/AxesIcon.vue.d.ts +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/DeleteChartIcon.vue.d.ts +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/ExportIcon.vue.d.ts +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LayersIcon.vue.d.ts +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LinkIcon.vue.d.ts +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue.d.ts +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue.js +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue.js.map +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue2.js +0 -0
- /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue2.js.map +0 -0
|
@@ -1,94 +1,117 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import { exhaustive as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return "type" in
|
|
1
|
+
import { l as C } from "./node_modules/lodash/lodash.js";
|
|
2
|
+
import { exhaustive as c } from "./utils/index.js";
|
|
3
|
+
var f = Object.defineProperty, x = (s, e, t) => e in s ? f(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, u = (s, e, t) => x(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const d = Symbol("noGrouped");
|
|
5
|
+
function y(s) {
|
|
6
|
+
return "type" in s && s.type === "columns";
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
constructor(
|
|
10
|
-
u(this, "id"), u(this, "data"), u(this, "rowsCount"), u(this, "columnNames"), u(this, "
|
|
8
|
+
const p = new Uint16Array(0), w = class g {
|
|
9
|
+
constructor(e, t) {
|
|
10
|
+
u(this, "id"), u(this, "data"), u(this, "rowsCount"), u(this, "columnNames"), u(this, "rowIndexes"), u(this, "mapColumnCategories", /* @__PURE__ */ new Map()), u(this, "mapColumnCategoriesRowIndexes", /* @__PURE__ */ new Map()), u(this, "rowsGrouped"), this.id = e, this.data = t, this.columnNames = Object.keys(t), this.rowsCount = this.columnNames.length ? t[this.columnNames[0]].length : 0, this.rowIndexes = new Uint16Array(Array.from({ length: this.rowsCount }, (o, r) => r));
|
|
11
11
|
}
|
|
12
|
-
static from(
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
15
|
-
if (
|
|
16
|
-
return new
|
|
17
|
-
|
|
12
|
+
static from(e) {
|
|
13
|
+
if (e instanceof g)
|
|
14
|
+
return e;
|
|
15
|
+
if (y(e))
|
|
16
|
+
return new g(e.id, e.values);
|
|
17
|
+
c(e, "Unknown input data format");
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (let r = 0; r < this.rowsCount; r++)
|
|
22
|
-
t.push(
|
|
23
|
-
this.columnNames.reduce((e, s) => (e[s] = this.data[s][r], e), {})
|
|
24
|
-
);
|
|
25
|
-
return t;
|
|
19
|
+
getColumn(e) {
|
|
20
|
+
return this.data[e];
|
|
26
21
|
}
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
getColumnValue(e, t) {
|
|
23
|
+
var o;
|
|
24
|
+
return (o = this.data[e]) == null ? void 0 : o[t];
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
getColumnValueCategory(e, t) {
|
|
27
|
+
return g.toCategory(this.getColumnValue(e, t));
|
|
28
|
+
}
|
|
29
|
+
getColumnCategories(e, t = !0) {
|
|
30
|
+
this.mapColumnCategories.has(e) || this.computeColumnCategories(e);
|
|
31
|
+
const o = this.mapColumnCategories.get(e) ?? [];
|
|
32
|
+
return t && o && o.length > 0 && o[o.length - 1] === "null" ? o.slice(0, -1) : o;
|
|
33
|
+
}
|
|
34
|
+
getColumnCategoryRowIndex(e, t) {
|
|
35
|
+
var o;
|
|
36
|
+
const r = (o = this.mapColumnCategoriesRowIndexes.get(e)) == null ? void 0 : o.get(t);
|
|
37
|
+
if (r === void 0)
|
|
38
|
+
throw new Error(`Category ${t} not found in column ${e}`);
|
|
39
|
+
return r;
|
|
40
|
+
}
|
|
41
|
+
computeColumnCategories(e) {
|
|
42
|
+
if (!this.columnNames.includes(e))
|
|
43
|
+
throw new Error(`Column ${e} does not exist`);
|
|
44
|
+
const t = this.getColumn(e), o = /* @__PURE__ */ new Set(), r = [], i = /* @__PURE__ */ new Map();
|
|
45
|
+
let l = -1;
|
|
46
|
+
for (let n = 0; n < t.length; n++) {
|
|
47
|
+
const h = t[n];
|
|
48
|
+
if (o.has(h))
|
|
49
|
+
continue;
|
|
50
|
+
if (o.add(h), h === null) {
|
|
51
|
+
l = n;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const a = g.toCategory(h);
|
|
55
|
+
r.push(a), i.set(a, n);
|
|
37
56
|
}
|
|
38
|
-
|
|
57
|
+
l !== -1 && (r.push("null"), i.set("null", l)), this.mapColumnCategories.set(e, r), this.mapColumnCategoriesRowIndexes.set(e, i);
|
|
39
58
|
}
|
|
40
|
-
setGrouping(
|
|
41
|
-
const
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
[
|
|
49
|
-
|
|
59
|
+
setGrouping(e) {
|
|
60
|
+
const t = { grouped: {}, rowIndexes: this.rowIndexes };
|
|
61
|
+
let o = [t];
|
|
62
|
+
e.forEach((r) => {
|
|
63
|
+
const i = r === null ? [d] : this.getColumnCategories(r, !1), l = [];
|
|
64
|
+
o.forEach((n) => {
|
|
65
|
+
if (r === null)
|
|
66
|
+
n.grouped = {
|
|
67
|
+
[d]: {
|
|
68
|
+
rowIndexes: n.rowIndexes,
|
|
50
69
|
grouped: {}
|
|
51
70
|
}
|
|
52
|
-
},
|
|
71
|
+
}, l.push(n.grouped[d]);
|
|
53
72
|
else {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
const h = C.groupBy(n.rowIndexes, (a) => this.getColumnValueCategory(r, a));
|
|
74
|
+
n.grouped = i.reduce((a, m) => (a[m] = {
|
|
75
|
+
rowIndexes: new Uint16Array(h[m] ?? []),
|
|
57
76
|
grouped: {}
|
|
58
|
-
},
|
|
77
|
+
}, l.push(a[m]), a), {});
|
|
59
78
|
}
|
|
60
|
-
}),
|
|
61
|
-
}), this.rowsGrouped =
|
|
79
|
+
}), o = l;
|
|
80
|
+
}), this.rowsGrouped = t.grouped;
|
|
62
81
|
}
|
|
63
|
-
|
|
82
|
+
// TODO: fix all places where this method is used
|
|
83
|
+
getColumnByGrouping(e, t) {
|
|
64
84
|
if (!this.rowsGrouped)
|
|
65
85
|
return [];
|
|
66
|
-
if (!
|
|
67
|
-
return this.
|
|
68
|
-
let
|
|
69
|
-
return
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
86
|
+
if (!e.length)
|
|
87
|
+
return Array.from(this.rowIndexes).map((r) => Number(this.getColumnValue(t, r)));
|
|
88
|
+
let o = { grouped: this.rowsGrouped, rowIndexes: this.rowIndexes };
|
|
89
|
+
return e.forEach((r) => {
|
|
90
|
+
const i = o.grouped[r ?? "null"];
|
|
91
|
+
if (!i)
|
|
72
92
|
return [];
|
|
73
|
-
|
|
74
|
-
}),
|
|
93
|
+
o = i;
|
|
94
|
+
}), Array.from(o.rowIndexes).map((r) => Number(this.getColumnValue(t, r)));
|
|
75
95
|
}
|
|
76
|
-
|
|
96
|
+
// TODO: fix all places where this method is used
|
|
97
|
+
getRowsByGrouping(e) {
|
|
77
98
|
if (!this.rowsGrouped)
|
|
78
|
-
return
|
|
79
|
-
if (!
|
|
80
|
-
return this.
|
|
81
|
-
let
|
|
82
|
-
return
|
|
83
|
-
const
|
|
84
|
-
if (!
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
}),
|
|
99
|
+
return p;
|
|
100
|
+
if (!e.length)
|
|
101
|
+
return this.rowIndexes;
|
|
102
|
+
let t = { grouped: this.rowsGrouped, rowIndexes: this.rowIndexes };
|
|
103
|
+
return e.forEach((o) => {
|
|
104
|
+
const r = t.grouped[o];
|
|
105
|
+
if (!r)
|
|
106
|
+
return p;
|
|
107
|
+
t = r;
|
|
108
|
+
}), t.rowIndexes;
|
|
88
109
|
}
|
|
89
|
-
}
|
|
110
|
+
};
|
|
111
|
+
u(w, "toCategory", (s) => String(s));
|
|
112
|
+
let G = w;
|
|
90
113
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
114
|
+
G as DataFrame,
|
|
115
|
+
d as NO_GROUPED
|
|
93
116
|
};
|
|
94
117
|
//# sourceMappingURL=DataFrame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataFrame.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/DataFrame.ts"],"sourcesContent":["import { groupBy, uniq } from 'lodash';\nimport type { DataValue } from './types';\nimport { exhaustive } from './utils';\n\nexport type DataByColumns = {\n type: 'columns',\n values: Record<string, DataValue[]>,\n id: string\n}\nexport type DataSet = DataFrame | DataByColumns;\nexport const NO_GROUPED = Symbol('noGrouped');\nexport type GroupKey = string | typeof NO_GROUPED;\ntype Row = Record<string, DataValue>;\ntype RowsGroup = Record<\n GroupKey,\n {\n rows: Row[];\n grouped: RowsGroup;\n }\n>;\n\nfunction isDataByColumns (data:DataSet): data is DataByColumns {\n return 'type' in data && data.type === 'columns';\n}\n\nexport class DataFrame {\n readonly id: string;\n // input data grouped by columns\n readonly data: Record<string, DataValue[]>;\n readonly rowsCount: number;\n readonly columnNames: string[];\n readonly rows: Row[];\n\n readonly mapColumnCategories: Map<string, string[]> = new Map();\n\n rowsGrouped?: RowsGroup;\n\n static from (data: DataSet):DataFrame {\n if (data instanceof DataFrame) {\n return data;\n } else if (isDataByColumns(data)) {\n return new DataFrame(data.id, data.values);\n } else {\n exhaustive(data, 'Unknown input data format');\n }\n }\n\n constructor(id: string, data: Record<string, DataValue[]>) {\n this.id = id;\n this.data = data;\n this.columnNames = Object.keys(data);\n this.rowsCount = this.columnNames.length ? data[this.columnNames[0]].length : 0;\n this.rows = this.computeRows();\n }\n\n private computeRows() {\n const rows: Row[] = [];\n\n for (let i = 0; i < this.rowsCount; i++) {\n rows.push(\n this.columnNames.reduce((res: Record<string, DataValue>, key) => {\n res[key] = this.data[key][i];\n return res;\n }, {})\n );\n }\n\n return rows;\n }\n\n getColumn(key: string): DataValue[] {\n return this.data[key];\n }\n\n getColumnCategories(key: string, ignoreNull = true): string[] {\n if (!this.columnNames.includes(key)) {\n throw new Error(`Column ${key} does not exist`);\n }\n\n const fullKey = `${key}${ignoreNull ? '' : '_not_null'}`;\n\n if (!this.mapColumnCategories.has(fullKey)) {\n let columnData = this.getColumn(key);\n if (ignoreNull) columnData = columnData.filter((v) => v !== null);\n this.mapColumnCategories.set(fullKey, uniq(columnData.map(String)));\n }\n\n return this.mapColumnCategories.get(fullKey) ?? [];\n }\n\n setGrouping(groupingColumnIds: (string | null)[]) {\n const root = {grouped: {} as RowsGroup, rows: this.rows};\n let groups: RowsGroup[keyof RowsGroup][] = [root];\n groupingColumnIds.forEach(column => {\n const keys: GroupKey[] = column === null ? [NO_GROUPED] : this.getColumnCategories(column, false);\n const nextGroups: RowsGroup[keyof RowsGroup][] = [];\n groups.forEach(group => {\n if (column === null) {\n group.grouped = {\n [NO_GROUPED]: {\n rows: group.rows,\n grouped: {} as RowsGroup,\n },\n };\n nextGroups.push(group.grouped[NO_GROUPED]);\n } else {\n const groupedBy = groupBy(group.rows, row => String(row[column]));\n group.grouped = keys.reduce((res, key) => {\n res[key] = {\n rows: groupedBy[key as string] ?? [] as Row[],\n grouped: {} as RowsGroup,\n };\n nextGroups.push(res[key]);\n return res;\n }, {} as RowsGroup);\n }\n });\n groups = nextGroups;\n });\n this.rowsGrouped = root.grouped;\n }\n\n getColumnByGrouping(groupingKeys: GroupKey[], keyYColumn: string): number[] {\n if (!this.rowsGrouped) {\n return [];\n }\n if (!groupingKeys.length) {\n return this.rows.map(row => Number(row[keyYColumn]));\n }\n let result: {grouped: RowsGroup; rows: Row[]} = {grouped: this.rowsGrouped, rows: this.rows};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key ?? 'null'];\n if (!nextGroup) {\n return [];\n }\n result = nextGroup;\n });\n return result.rows.map(row => Number(row[keyYColumn]));\n }\n\n getRowsByGrouping(groupingKeys: GroupKey[]): Row[] {\n if (!this.rowsGrouped) {\n return [];\n }\n if (!groupingKeys.length) {\n return this.rows;\n }\n let result: {grouped: RowsGroup; rows: Row[]} = {grouped: this.rowsGrouped, rows: this.rows};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key];\n if (!nextGroup) {\n return [];\n }\n result = nextGroup;\n });\n return result.rows;\n }\n}\n"],"names":["NO_GROUPED","isDataByColumns","data","DataFrame","id","__publicField","exhaustive","rows","i","res","key","ignoreNull","fullKey","columnData","v","uniq","groupingColumnIds","root","groups","column","keys","nextGroups","group","groupedBy","groupBy","row","groupingKeys","keyYColumn","result","nextGroup"],"mappings":";;;AAUO,MAAMA,IAAa,OAAO,WAAW;AAW5C,SAASC,EAAiBC,GAAqC;AAC3D,SAAO,UAAUA,KAAQA,EAAK,SAAS;AAC3C;AAEO,MAAMC,EAAU;AAAA,EAsBnB,YAAYC,GAAYF,GAAmC;AArBlDG,MAAA,MAAA,IAAA,GAEAA,EAAA,MAAA,MAAA,GACAA,EAAA,MAAA,WAAA,GACAA,EAAA,MAAA,aAAA,GACAA,EAAA,MAAA,MAAA,GAEA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hB,MAAO;AACxB,YAAMmB,IAAYD,EAAO,QAAQlB,KAAO,MAAM;AAC9C,UAAI,CAACmB;AACD,eAAO,CAAA;AAEXD,MAAAA,IAASC;AAAAA,IACb,CAAC,GACMD,EAAO,KAAK,IAAI,CAAAH,MAAO,OAAOA,EAAIE,CAAU,CAAC,CAAC;AAAA,EACzD;AAAA,EAEA,kBAAkBD,GAAiC;AAC/C,QAAI,CAAC,KAAK;AACN,aAAO,CAAA;AAEX,QAAI,CAACA,EAAa;AACd,aAAO,KAAK;AAEhB,QAAIE,IAA4C,EAAC,SAAS,KAAK,aAAa,MAAM,KAAK,KAAA;AACvF,WAAAF,EAAa,QAAQ,CAAAhB,MAAO;AACxB,YAAMmB,IAAYD,EAAO,QAAQlB,CAAG;AACpC,UAAI,CAACmB;AACD,eAAO,CAAA;AAEXD,UAASC;AAAAA,IACb,CAAC,GACMD,EAAO;AAAA,EAClB;AACJ;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"DataFrame.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/DataFrame.ts"],"sourcesContent":["import { groupBy } from 'lodash';\nimport type { Category, DataValue } from './types';\nimport { exhaustive } from './utils';\n\nexport type DataByColumns = {\n type: 'columns',\n values: Record<string, DataValue[]>,\n id: string\n}\nexport type DataSet = DataFrame | DataByColumns;\nexport const NO_GROUPED = Symbol('noGrouped');\nexport type GroupKey = string | typeof NO_GROUPED;\nexport type RowIndex = number;\ntype RowsGroup = Record<\n GroupKey,\n {\n rowIndexes: Uint16Array;\n grouped: RowsGroup;\n }\n>;\n\nfunction isDataByColumns (data:DataSet): data is DataByColumns {\n return 'type' in data && data.type === 'columns';\n}\n\ntype ColumnName = string;\n\nconst EMPTY_INDEXES = new Uint16Array(0);\n\nexport class DataFrame {\n static toCategory = (value: DataValue): string => String(value);\n\n readonly id: string;\n // input data grouped by columns\n readonly data: Record<string, DataValue[]>;\n readonly rowsCount: number;\n readonly columnNames: ColumnName[];\n readonly rowIndexes: Uint16Array;\n\n readonly mapColumnCategories: Map<ColumnName, Category[]> = new Map();\n readonly mapColumnCategoriesRowIndexes: Map<ColumnName, Map<Category, number>> = new Map();\n\n rowsGrouped?: RowsGroup;\n\n static from (data: DataSet):DataFrame {\n if (data instanceof DataFrame) {\n return data;\n } else if (isDataByColumns(data)) {\n return new DataFrame(data.id, data.values);\n } else {\n exhaustive(data, 'Unknown input data format');\n }\n }\n\n constructor(id: string, data: Record<string, DataValue[]>) {\n this.id = id;\n this.data = data;\n this.columnNames = Object.keys(data);\n this.rowsCount = this.columnNames.length ? data[this.columnNames[0]].length : 0;\n this.rowIndexes = new Uint16Array(Array.from({length: this.rowsCount}, (_, i) => i));\n }\n\n getColumn(key: string): DataValue[] {\n return this.data[key];\n }\n\n getColumnValue(key: string, index: number): DataValue {\n return this.data[key]?.[index];\n }\n\n getColumnValueCategory(key: string, index: number): Category {\n return DataFrame.toCategory(this.getColumnValue(key, index));\n }\n\n getColumnCategories(key: string, ignoreNull = true): Category[] {\n if (!this.mapColumnCategories.has(key)) {\n this.computeColumnCategories(key);\n }\n\n const categories = this.mapColumnCategories.get(key) ?? [];\n return ignoreNull && categories && categories.length > 0 && categories[categories.length - 1] === 'null'\n ? categories.slice(0, -1) // full copy without null to heavy for large datasets\n : categories; \n }\n\n getColumnCategoryRowIndex(key: string, value: Category): RowIndex {\n const rowIndex = this.mapColumnCategoriesRowIndexes.get(key)?.get(value);\n \n if (rowIndex === undefined) {\n throw new Error(`Category ${value} not found in column ${key}`);\n }\n\n return rowIndex;\n }\n\n private computeColumnCategories(key: ColumnName) {\n if (!this.columnNames.includes(key)) {\n throw new Error(`Column ${key} does not exist`);\n }\n \n const columnData = this.getColumn(key);\n const uniqValues = new Set<DataValue>();\n const categories: string[] = [];\n const categoriesIndexes = new Map<string, number>();\n let nullIdx = -1;\n for (let i = 0; i < columnData.length; i++) {\n const value = columnData[i];\n if (uniqValues.has(value)) {\n continue;\n }\n uniqValues.add(value);\n if (value === null) {\n nullIdx = i;\n continue;\n }\n const category = DataFrame.toCategory(value);\n categories.push(category);\n categoriesIndexes.set(category, i);\n }\n if (nullIdx !== -1) {\n categories.push('null');\n categoriesIndexes.set('null', nullIdx);\n }\n\n this.mapColumnCategories.set(key, categories);\n this.mapColumnCategoriesRowIndexes.set(key, categoriesIndexes);\n }\n\n setGrouping(groupingColumnIds: (string | null)[]) {\n const root = {grouped: {} as RowsGroup, rowIndexes: this.rowIndexes};\n let groups: RowsGroup[keyof RowsGroup][] = [root];\n groupingColumnIds.forEach(column => {\n const keys: GroupKey[] = column === null ? [NO_GROUPED] : this.getColumnCategories(column, false);\n const nextGroups: RowsGroup[keyof RowsGroup][] = [];\n groups.forEach(group => {\n if (column === null) {\n group.grouped = {\n [NO_GROUPED]: {\n rowIndexes: group.rowIndexes,\n grouped: {} as RowsGroup,\n },\n };\n nextGroups.push(group.grouped[NO_GROUPED]);\n } else {\n const groupedBy = groupBy(group.rowIndexes, idx => this.getColumnValueCategory(column, idx));\n group.grouped = keys.reduce((res, key) => {\n res[key] = {\n rowIndexes: new Uint16Array(groupedBy[key as string] ?? []),\n grouped: {} as RowsGroup,\n };\n nextGroups.push(res[key]);\n return res;\n }, {} as RowsGroup);\n }\n });\n groups = nextGroups;\n });\n this.rowsGrouped = root.grouped;\n }\n\n // TODO: fix all places where this method is used\n getColumnByGrouping(groupingKeys: GroupKey[], keyYColumn: string): number[] {\n if (!this.rowsGrouped) {\n return [];\n }\n if (!groupingKeys.length) {\n return Array.from(this.rowIndexes).map(idx => Number(this.getColumnValue(keyYColumn, idx)));\n }\n let result: {grouped: RowsGroup; rowIndexes: Uint16Array} = {grouped: this.rowsGrouped, rowIndexes: this.rowIndexes};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key ?? 'null'];\n if (!nextGroup) {\n return [];\n }\n result = nextGroup;\n });\n return Array.from(result.rowIndexes).map(idx => Number(this.getColumnValue(keyYColumn, idx)));\n }\n\n // TODO: fix all places where this method is used\n getRowsByGrouping(groupingKeys: GroupKey[]): Uint16Array {\n if (!this.rowsGrouped) {\n return EMPTY_INDEXES;\n }\n if (!groupingKeys.length) {\n return this.rowIndexes;\n }\n let result: {grouped: RowsGroup; rowIndexes: Uint16Array} = {grouped: this.rowsGrouped, rowIndexes: this.rowIndexes};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key];\n if (!nextGroup) {\n return EMPTY_INDEXES;\n }\n result = nextGroup;\n });\n return result.rowIndexes;\n }\n}\n"],"names":["NO_GROUPED","isDataByColumns","data","EMPTY_INDEXES","_DataFrame","id","__publicField","_","i","exhaustive","key","index","_a","ignoreNull","categories","value","rowIndex","columnData","uniqValues","categoriesIndexes","nullIdx","category","groupingColumnIds","root","groups","column","keys","nextGroups","group","groupedBy","groupBy","idx","res","groupingKeys","keyYColumn","result","nextGroup","DataFrame"],"mappings":";;;AAUO,MAAMA,IAAa,OAAO,WAAW;AAW5C,SAASC,EAAiBC,GAAqC;AAC3D,SAAO,UAAUA,KAAQA,EAAK,SAAS;AAC3C;AAIA,MAAMC,IAAgB,IAAI,YAAY,CAAC,GAE1BC,IAAN,MAAMA,EAAU;AAAA,EAyBnB,YAAYC,GAAYH,GAAmC;AAtBlDI,IAAAA,EAAA,MAAA,IAAA,GAEAA,EAAA,MAAA,MAAA,GACAA,EAAA,MAAA,WAAA,GACAA,EAAA,MAAA,aAAA,GACAA,EAAA,MAAA,YAAA,GAEAA,EAAA,iDAAuD,IAAA,CAAA,GACvDA,EAAA,2DAA4E,IAAA,CAAA,GAErFA,EAAA,MAAA,aAAA,GAaI,KAAK,KAAKD,GACV,KAAK,OAAOH,GACZ,KAAK,cAAc,OAAO,KAAKA,CAAI,GACnC,KAAK,YAAY,KAAK,YAAY,SAASA,EAAK,KAAK,YAAY,CAAC,CAAC,EAAE,SAAS,GAC9E,KAAK,aAAa,IAAI,YAAY,MAAM,KAAK,EAAC,QAAQ,KAAK,UAAA,GAAY,CAACK,GAAGC,MAAMA,CAAC,CAAC;AAAA,EACvF;AA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AAMsB,IAANjC;","x_google_ignoreList":[0]}
|
|
@@ -7,7 +7,7 @@ import { ChartScatterplotUmap as f } from "./scatterplot-umap/index.js";
|
|
|
7
7
|
import { ChartBubble as d } from "./bubble/index.js";
|
|
8
8
|
import { DataFrame as i } from "./DataFrame.js";
|
|
9
9
|
import { exhaustive as l } from "./utils/index.js";
|
|
10
|
-
var
|
|
10
|
+
var C = Object.defineProperty, b = (o, t, r) => t in o ? C(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r, s = (o, t, r) => b(o, typeof t != "symbol" ? t + "" : t, r);
|
|
11
11
|
class h {
|
|
12
12
|
constructor(t) {
|
|
13
13
|
s(this, "node"), s(this, "chart"), this.chart = t;
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { j as L } from "../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { createRoot as W } from "../node_modules/react-dom/client.js";
|
|
3
|
+
import { Error as F } from "../common/Error.js";
|
|
4
|
+
import { DataFrameProvider as $ } from "../common/useDataFrame.js";
|
|
5
|
+
import { TITLE_LINE_HEIGHT as G, TITLE_MARGIN as K, DEFAULT_HEIGHT_SMALL as P, DEFAULT_HEIGHT as E, DEFAULT_WIDTH as M } from "../constants.js";
|
|
6
|
+
import { arrangeLegendParts as j } from "../utils/arrangeLegendParts.js";
|
|
7
|
+
import { getChartEdgeSides as k } from "../utils/getChartEdgeSides.js";
|
|
8
|
+
import { getContinuousLegendTicks as B } from "../utils/getContinuousLegendTicks.js";
|
|
9
|
+
import { TextMeasurer as U } from "../utils/TextMeasurer/TextMeasurer.js";
|
|
10
|
+
import { ChartsGroup as O } from "./components/ChartsGroup.js";
|
|
11
|
+
import { MIN_MARGIN as A, LEGEND_OFFSET as V, TITLE_LINE as I, CHART_SIDE_ELEMENTS as q, MIN_PADDING as X } from "./constants.js";
|
|
12
|
+
import { calculateChartSideElementSizes as J } from "./utils/calculateChartSideElementSizes.js";
|
|
13
|
+
import { calculateSideElementsBBoxes as Q } from "./utils/calculateSideElementsBBoxes.js";
|
|
14
|
+
import { calculateCaptionTails as Y } from "./utils/calculateCaptionTails.js";
|
|
14
15
|
import w from "../node_modules/d3-scale/src/ordinal.js";
|
|
15
16
|
import N from "../node_modules/d3-scale/src/linear.js";
|
|
16
17
|
import { sqrt as v } from "../node_modules/d3-scale/src/pow.js";
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
for (let
|
|
23
|
-
|
|
24
|
-
return
|
|
18
|
+
var Z = Object.defineProperty, tt = (r, t, e) => t in r ? Z(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, d = (r, t, e) => tt(r, typeof t != "symbol" ? t + "" : t, e);
|
|
19
|
+
const et = (r, t) => {
|
|
20
|
+
const e = Math.min(...t), s = Math.max(...t);
|
|
21
|
+
if (e === s) {
|
|
22
|
+
const o = r % 2 === 0 ? [] : [e];
|
|
23
|
+
for (let m = 1; m < r / 2 + 1; m++)
|
|
24
|
+
o.push(e + m), o.unshift(e - m);
|
|
25
|
+
return o;
|
|
25
26
|
}
|
|
26
|
-
if (
|
|
27
|
-
return [
|
|
28
|
-
const
|
|
29
|
-
for (let
|
|
30
|
-
|
|
31
|
-
return
|
|
27
|
+
if (r < 2)
|
|
28
|
+
return [e, s];
|
|
29
|
+
const h = (s - e) / (r - 1), i = [];
|
|
30
|
+
for (let o = 0; o < r - 1; o++)
|
|
31
|
+
i.push(e + h * o);
|
|
32
|
+
return i.push(s), i;
|
|
32
33
|
};
|
|
33
|
-
function st(
|
|
34
|
-
let
|
|
35
|
-
return
|
|
34
|
+
function st(r, t, e) {
|
|
35
|
+
let s = e;
|
|
36
|
+
return r && (r.colorRange && (s = r.colorRange), r.method === "standardScaling" && (s = [-2, 2]), r.method === "meanNormalization" && (s = [-0.75, 0.75])), et(t, s);
|
|
36
37
|
}
|
|
37
|
-
class
|
|
38
|
+
class zt {
|
|
38
39
|
constructor() {
|
|
39
|
-
d(this, "reactRoot", null), d(this, "parentNode", null), d(this, "rootNode", null), d(this, "component", /* @__PURE__ */
|
|
40
|
+
d(this, "reactRoot", null), d(this, "parentNode", null), d(this, "rootNode", null), d(this, "component", /* @__PURE__ */ L.jsx(L.Fragment, {})), d(this, "chartsDimensions", {}), d(this, "chartSizes", {
|
|
40
41
|
chartWidth: M,
|
|
41
42
|
// width of single chart
|
|
42
|
-
chartHeight:
|
|
43
|
+
chartHeight: E,
|
|
43
44
|
// height of single chart
|
|
44
45
|
chartsWidth: M,
|
|
45
46
|
// width of all charts in charts row
|
|
46
|
-
chartsHeight:
|
|
47
|
+
chartsHeight: E,
|
|
47
48
|
// width of all charts in charts column, without axes
|
|
48
49
|
totalWidth: M,
|
|
49
50
|
// width of all charts in charts row, plus left axis, plus legend
|
|
50
|
-
totalHeight:
|
|
51
|
+
totalHeight: E
|
|
51
52
|
// width of all charts in charts height, plus bottom axis, plus top title
|
|
52
53
|
}), d(this, "margins", {
|
|
53
54
|
top: A,
|
|
@@ -74,108 +75,108 @@ class ft {
|
|
|
74
75
|
clear() {
|
|
75
76
|
var t;
|
|
76
77
|
this.parentNode && this.rootNode && ((t = this.parentNode) == null || t.removeChild(this.rootNode), this.parentNode = null, this.rootNode = null), setTimeout(() => {
|
|
77
|
-
var
|
|
78
|
-
(
|
|
78
|
+
var e;
|
|
79
|
+
(e = this.reactRoot) == null || e.unmount(), this.reactRoot = null;
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
init(t) {
|
|
82
|
-
this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot =
|
|
83
|
+
this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = W(this.rootNode));
|
|
83
84
|
}
|
|
84
85
|
updateMargins(t) {
|
|
85
86
|
this.margins = {
|
|
86
|
-
top: t.show ?
|
|
87
|
+
top: t.show ? G + K * 2 : A,
|
|
87
88
|
bottom: A,
|
|
88
89
|
left: A,
|
|
89
90
|
right: this.legend.width
|
|
90
91
|
}, 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;
|
|
91
92
|
}
|
|
92
|
-
updateLegendSize(t,
|
|
93
|
+
updateLegendSize(t, e, s, h) {
|
|
93
94
|
if (!t.show) {
|
|
94
95
|
this.legend = { width: 0, height: 0, items: [] };
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
|
-
const
|
|
98
|
-
Math.max(this.chartSizes.chartHeight,
|
|
99
|
-
|
|
100
|
-
),
|
|
98
|
+
const i = [], o = Math.min(
|
|
99
|
+
Math.max(this.chartSizes.chartHeight, P),
|
|
100
|
+
E
|
|
101
|
+
), m = Math.max(this.chartSizes.chartHeight, o), g = { width: 0, height: 0, left: 0, top: 0 }, S = this.colorScale.domain(), x = B(this.colorScale, [
|
|
101
102
|
S[0],
|
|
102
103
|
S[S.length - 1]
|
|
103
|
-
]),
|
|
104
|
-
|
|
104
|
+
]), C = e.label ?? e.value, u = N([x[0], x[x.length - 1]], [o, 0]);
|
|
105
|
+
i.push({
|
|
105
106
|
id: "colorValue",
|
|
106
107
|
type: "continuous",
|
|
107
108
|
scale: this.colorScale,
|
|
108
|
-
tickPositionScale:
|
|
109
|
+
tickPositionScale: u,
|
|
109
110
|
values: x,
|
|
110
|
-
title:
|
|
111
|
+
title: C,
|
|
111
112
|
...g
|
|
112
113
|
});
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
114
|
+
const p = s.label ?? s.value, z = this.sizeScale.ticks(3), l = this.sizeScale.tickFormat(3), a = z.reduce((T, b) => (T[String(b)] = l(b), T), {});
|
|
115
|
+
if (i.push({
|
|
115
116
|
id: "sizeValue",
|
|
116
117
|
type: "size",
|
|
117
|
-
title:
|
|
118
|
+
title: p,
|
|
118
119
|
scale: this.sizeScale,
|
|
119
|
-
values:
|
|
120
|
-
labels:
|
|
120
|
+
values: z,
|
|
121
|
+
labels: a,
|
|
121
122
|
...g
|
|
122
|
-
}), !
|
|
123
|
+
}), !i.length) {
|
|
123
124
|
this.legend = { width: 0, height: 0, items: [] };
|
|
124
125
|
return;
|
|
125
126
|
}
|
|
126
|
-
const n =
|
|
127
|
+
const n = j(i, m, o), c = n[n.length - 1], y = c.left + c.width + 2 * V, f = this.chartsDimensions[h[0]].padding;
|
|
127
128
|
this.legend = {
|
|
128
129
|
width: y,
|
|
129
|
-
height:
|
|
130
|
+
height: m + f.top,
|
|
130
131
|
items: n
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
|
-
updateCaptionsSize(t,
|
|
134
|
-
const
|
|
134
|
+
updateCaptionsSize(t, e, s) {
|
|
135
|
+
const h = new U("bold 14px Arial"), { xKeys: i, yKeys: o, xLabels: m, yLabels: g } = t.meta;
|
|
135
136
|
this.labelAngles = {
|
|
136
|
-
xAxisLabels:
|
|
137
|
-
yAxisLabels:
|
|
137
|
+
xAxisLabels: e.axisLabelsAngle,
|
|
138
|
+
yAxisLabels: s.axisLabelsAngle
|
|
138
139
|
};
|
|
139
140
|
let S = 0, x = 0;
|
|
140
|
-
for (const
|
|
141
|
-
const
|
|
142
|
-
|
|
141
|
+
for (const l of i) {
|
|
142
|
+
const a = h.getTextWidth(m[l]);
|
|
143
|
+
a > S && (S = a);
|
|
143
144
|
}
|
|
144
|
-
for (const
|
|
145
|
-
const
|
|
146
|
-
|
|
145
|
+
for (const l of o) {
|
|
146
|
+
const a = h.getTextWidth(g[l]);
|
|
147
|
+
a > x && (x = a);
|
|
147
148
|
}
|
|
148
|
-
const { xCaptionTail:
|
|
149
|
+
const { xCaptionTail: C, yCaptionTail: u } = Y(
|
|
149
150
|
this.labelAngles,
|
|
150
151
|
this.step,
|
|
151
152
|
t,
|
|
152
|
-
|
|
153
|
-
),
|
|
153
|
+
h
|
|
154
|
+
), p = this.labelAngles.xAxisLabels / 180 * Math.PI, z = this.labelAngles.yAxisLabels / 180 * Math.PI;
|
|
154
155
|
this.captionsSizes = {
|
|
155
|
-
xCaptionTail:
|
|
156
|
-
yCaptionTail:
|
|
157
|
-
xAxisCaptions: S * Math.sin(
|
|
158
|
-
yAxisCaptions: x * Math.sin(
|
|
156
|
+
xCaptionTail: C,
|
|
157
|
+
yCaptionTail: u,
|
|
158
|
+
xAxisCaptions: S * Math.sin(p) || I,
|
|
159
|
+
yAxisCaptions: x * Math.sin(z) || I
|
|
159
160
|
};
|
|
160
161
|
}
|
|
161
|
-
updateChartDimensions(t,
|
|
162
|
-
const
|
|
163
|
-
this.columnsCount =
|
|
162
|
+
updateChartDimensions(t, e, s, h) {
|
|
163
|
+
const i = t.length, o = Math.min(e.nRows ?? i, i), m = Math.min(e.nCols ?? i, i);
|
|
164
|
+
this.columnsCount = e.nRows ? Math.ceil(i / o) : m, this.rowsCount = Math.ceil(i / this.columnsCount), this.chartsDimensions = {};
|
|
164
165
|
let g = 0, S = 0;
|
|
165
|
-
t.forEach((
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
t.forEach((u, p) => {
|
|
167
|
+
const z = p % this.columnsCount + 1, l = k(p, t.length, this.columnsCount, this.rowsCount), a = this.chartSizes.chartWidth, n = this.chartSizes.chartHeight, c = J(
|
|
168
|
+
s,
|
|
169
|
+
h,
|
|
169
170
|
this.captionsSizes,
|
|
170
|
-
|
|
171
|
+
l,
|
|
171
172
|
t,
|
|
172
173
|
this.step.x,
|
|
173
174
|
this.step.y
|
|
174
175
|
);
|
|
175
|
-
function y(
|
|
176
|
+
function y(D) {
|
|
176
177
|
return Math.max(
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
q[D].reduce((R, _) => R + c[D][_], 0),
|
|
179
|
+
X
|
|
179
180
|
);
|
|
180
181
|
}
|
|
181
182
|
const f = {
|
|
@@ -185,74 +186,75 @@ class ft {
|
|
|
185
186
|
bottom: y("bottom")
|
|
186
187
|
};
|
|
187
188
|
f.left < this.captionsSizes.xCaptionTail && (f.left = this.captionsSizes.xCaptionTail), f.bottom < this.captionsSizes.yCaptionTail && (f.bottom = this.captionsSizes.yCaptionTail);
|
|
188
|
-
const T =
|
|
189
|
-
this.chartsDimensions[
|
|
189
|
+
const T = Q(c, a, n), b = a + f.left + f.right, H = n + f.top + f.bottom;
|
|
190
|
+
this.chartsDimensions[u] = {
|
|
190
191
|
left: g,
|
|
191
192
|
top: S,
|
|
192
|
-
inner: { width:
|
|
193
|
+
inner: { width: a, height: n },
|
|
193
194
|
outer: { width: b, height: H },
|
|
194
195
|
padding: f,
|
|
195
196
|
sideElementBBoxes: T,
|
|
196
|
-
chartEdgeSides:
|
|
197
|
-
}, g += b,
|
|
197
|
+
chartEdgeSides: l
|
|
198
|
+
}, g += b, z === this.columnsCount && (g = 0, S += H);
|
|
198
199
|
});
|
|
199
|
-
const x = t.slice(0, this.columnsCount).reduce((
|
|
200
|
-
this.chartSizes.chartsWidth = x, this.chartSizes.chartsHeight =
|
|
200
|
+
const x = t.slice(0, this.columnsCount).reduce((u, p) => u + this.chartsDimensions[p].outer.width, 0), C = t.filter((u, p) => p % this.columnsCount === 0).reduce((u, p) => u + this.chartsDimensions[p].outer.height, 0);
|
|
201
|
+
this.chartSizes.chartsWidth = x, this.chartSizes.chartsHeight = C;
|
|
201
202
|
}
|
|
202
|
-
updateChartsSizes(t,
|
|
203
|
-
const { width:
|
|
204
|
-
|
|
203
|
+
updateChartsSizes(t, e) {
|
|
204
|
+
const { width: s, height: h, cellSize: i } = e;
|
|
205
|
+
i && (this.chartSizes.chartWidth = t.meta.xKeys.length * i, this.chartSizes.chartHeight = t.meta.yKeys.length * i), s && h && (this.chartSizes.chartWidth = s, this.chartSizes.chartHeight = h);
|
|
205
206
|
}
|
|
206
207
|
// update scales for cell positions, x and y for each facet
|
|
207
|
-
updateScales(t,
|
|
208
|
-
const { width:
|
|
209
|
-
(n,
|
|
210
|
-
), x = (
|
|
211
|
-
(n,
|
|
212
|
-
),
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
this.scales.x = w().domain(
|
|
208
|
+
updateScales(t, e, s, h) {
|
|
209
|
+
const { width: i, height: o, cellSize: m } = e, { meta: g } = t, S = (l, a = {}) => [...l].sort(
|
|
210
|
+
(n, c) => s.sorting === "asc" ? (a[n] ?? n).localeCompare(a[c] ?? c, "en", { numeric: !0 }) : (a[c] ?? c).localeCompare(a[n] ?? n, "en", { numeric: !0 })
|
|
211
|
+
), x = (l, a = {}) => [...l].sort(
|
|
212
|
+
(n, c) => h.sorting === "asc" ? (a[n] ?? n).localeCompare(a[c] ?? c, "en", { numeric: !0 }) : (a[c] ?? c).localeCompare(a[n] ?? n, "en", { numeric: !0 })
|
|
213
|
+
), C = S(g.xKeys, g.xLabels), u = x(g.yKeys, g.yLabels);
|
|
214
|
+
m ? (this.step.x = m, this.step.y = m) : i && o && (this.step.x = i / C.length, this.step.y = o / u.length);
|
|
215
|
+
const p = new Array(C.length).fill(null).map((l, a) => a * this.step.x), z = new Array(u.length).fill(null).map((l, a) => a * this.step.y);
|
|
216
|
+
this.scales.x = w().domain(C).range(p), this.scales.y = w().domain(u).range(z);
|
|
216
217
|
}
|
|
217
|
-
updateAesScale(t,
|
|
218
|
-
this.colorScale = N().domain(st(
|
|
218
|
+
updateAesScale(t, e, s, h) {
|
|
219
|
+
this.colorScale = N().domain(st(h, t.colorsList.length, s)).range(t.colorsList), this.sizeScale = v(e, [t.minRadius, t.maxRadius]);
|
|
219
220
|
}
|
|
220
|
-
render(t,
|
|
221
|
-
var
|
|
222
|
-
const { meta:
|
|
223
|
-
this.updateChartsSizes(
|
|
224
|
-
const
|
|
225
|
-
|
|
221
|
+
render(t, e, s, h, i, o, m, g, S, x, C) {
|
|
222
|
+
var u;
|
|
223
|
+
const { meta: p, facets: z, meta: { facetKeys: l } } = i, { valueExtentSize: a, valueExtentColor: n } = p, { xAxis: c, yAxis: y, title: f, size: T } = s;
|
|
224
|
+
this.updateChartsSizes(i, T), this.updateAesScale(S, a, n, g), this.updateScales(i, T, s.xAxis, s.yAxis), this.updateCaptionsSize(i, c, y), this.updateChartDimensions(l, h, c, y), this.updateLegendSize(s.legend, o, m, l), this.updateMargins(f);
|
|
225
|
+
const b = /* @__PURE__ */ L.jsx($, { dataFrame: t, children: /* @__PURE__ */ L.jsx(
|
|
226
|
+
O,
|
|
226
227
|
{
|
|
227
228
|
aes: S,
|
|
228
229
|
captionsSizes: this.captionsSizes,
|
|
229
|
-
cellsMeta:
|
|
230
|
+
cellsMeta: p,
|
|
230
231
|
columnsCount: this.columnsCount,
|
|
231
232
|
chartsDimensions: this.chartsDimensions,
|
|
232
233
|
chartSettings: s,
|
|
233
234
|
chartSizes: this.chartSizes,
|
|
234
235
|
sizeScale: this.sizeScale,
|
|
235
236
|
colorScale: this.colorScale,
|
|
236
|
-
facetKeys:
|
|
237
|
-
facetSettings:
|
|
238
|
-
groupedCells:
|
|
237
|
+
facetKeys: l,
|
|
238
|
+
facetSettings: h,
|
|
239
|
+
groupedCells: z,
|
|
239
240
|
labelAngles: this.labelAngles,
|
|
240
241
|
legend: this.legend,
|
|
241
242
|
margins: this.margins,
|
|
242
243
|
scales: this.scales,
|
|
243
|
-
settingsId:
|
|
244
|
+
settingsId: e,
|
|
244
245
|
step: this.step,
|
|
245
|
-
|
|
246
|
+
getCellTooltip: x,
|
|
247
|
+
onTooltipHintSwitch: C
|
|
246
248
|
}
|
|
247
|
-
);
|
|
248
|
-
this.component =
|
|
249
|
+
) });
|
|
250
|
+
this.component = b, (u = this.reactRoot) == null || u.render(b);
|
|
249
251
|
}
|
|
250
252
|
renderError(t) {
|
|
251
|
-
var
|
|
252
|
-
(
|
|
253
|
+
var e;
|
|
254
|
+
(e = this.reactRoot) == null || e.render(/* @__PURE__ */ L.jsx(F, { message: t }));
|
|
253
255
|
}
|
|
254
256
|
}
|
|
255
257
|
export {
|
|
256
|
-
|
|
258
|
+
zt as default
|
|
257
259
|
};
|
|
258
260
|
//# sourceMappingURL=ChartRenderer.js.map
|