@milaboratories/graph-maker 1.1.138 → 1.1.140
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/GraphMaker/components/Chart.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/Chart.vue.js +1 -0
- package/dist/GraphMaker/components/Chart.vue.js.map +1 -1
- package/dist/GraphMaker/components/LassoControls/index.vue.js +15 -13
- package/dist/GraphMaker/components/LassoControls/index.vue.js.map +1 -1
- package/dist/GraphMaker/dataBindAes.d.ts +5 -5
- package/dist/GraphMaker/dataBindAes.d.ts.map +1 -1
- package/dist/GraphMaker/dataBindAes.js +52 -49
- package/dist/GraphMaker/dataBindAes.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js +14 -14
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +125 -124
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/types.d.ts +1 -1
- package/dist/GraphMaker/types.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +6 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts +4 -8
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +15 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +12 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +21 -0
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +10 -6
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +31 -13
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +56 -62
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +29 -13
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +20 -19
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +57 -54
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js +5 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js.map +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 +8 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js.map +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 +38 -34
- 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/Error.js +4 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.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 +199 -198
- 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 +81 -79
- 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 +140 -134
- 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 +17 -17
- 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 +32 -31
- 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 +62 -58
- 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 +28 -28
- 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 -25
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +13 -13
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +69 -76
- 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 +50 -38
- 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/utils/sortDotsByGrouping.js +18 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
- 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 +26 -26
- 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 +97 -118
- 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 +23 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +25 -19
- 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/arraysAreDifferent.js +7 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js.map +1 -0
- 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 +1111 -1097
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/package.json +3 -3
- 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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
class
|
|
3
|
-
constructor(
|
|
4
|
-
|
|
1
|
+
var s = Object.defineProperty, l = (e, r, t) => r in e ? s(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, a = (e, r, t) => l(e, typeof r != "symbol" ? r + "" : r, t);
|
|
2
|
+
class c {
|
|
3
|
+
constructor(r, t) {
|
|
4
|
+
a(this, "hasError", !1), a(this, "calculatedData", null), this.data = r, this.settings = t;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
c as AbstractChart
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=AbstractChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractChart.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/AbstractChart.ts"],"sourcesContent":["import type {DataFrame, DataSet} from './DataFrame';\nimport type {Settings, SettingsInterface} from './types';\n\nexport interface ChartInterface {\n calculatedData: Record<string, unknown> | null,\n mount: (node: HTMLElement) => void,\n unmount: () => void,\n updateSettingsAndData: (data: DataSet, settings: Settings) => void,\n updateChartState: (field: string, value: unknown) => void,\n export: () => string\n}\n\nexport abstract class AbstractChart implements ChartInterface {\n calculatedData = null as Record<string, unknown> | null;\n\n protected constructor(public data: DataFrame, public settings:SettingsInterface) {\n }\n\n abstract mount(node: HTMLElement): void;\n\n abstract unmount(): void;\n\n abstract updateSettingsAndData(data: DataSet, settings: Settings): void;\n\n abstract updateChartState(field: string, value: unknown): void;\n\n abstract export():string;\n}\n"],"names":["AbstractChart","data","settings","__publicField"],"mappings":";
|
|
1
|
+
{"version":3,"file":"AbstractChart.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/AbstractChart.ts"],"sourcesContent":["import type {DataFrame, DataSet} from './DataFrame';\nimport type {Settings, SettingsInterface} from './types';\n\nexport interface ChartInterface {\n hasError: boolean,\n calculatedData: Record<string, unknown> | null,\n mount: (node: HTMLElement) => void,\n unmount: () => void,\n updateSettingsAndData: (data: DataSet, settings: Settings) => void,\n updateChartState: (field: string, value: unknown) => void,\n export: () => string\n}\n\nexport abstract class AbstractChart implements ChartInterface {\n hasError = false;\n calculatedData = null as Record<string, unknown> | null;\n\n protected constructor(public data: DataFrame, public settings:SettingsInterface) {\n }\n\n abstract mount(node: HTMLElement): void;\n\n abstract unmount(): void;\n\n abstract updateSettingsAndData(data: DataSet, settings: Settings): void;\n\n abstract updateChartState(field: string, value: unknown): void;\n\n abstract export():string;\n}\n"],"names":["AbstractChart","data","settings","__publicField"],"mappings":";AAaO,MAAeA,EAAwC;AAAA,EAIhD,YAAmBC,GAAwBC,GAA4B;AAHjFC,IAAAA,EAAA,MAAA,YAAW,EAAA,GACXA,EAAA,MAAA,kBAAiB,IAAA,GAEY,KAAA,OAAAF,GAAwB,KAAA,WAAAC;AAAAA,EACrD;AAWJ;","x_google_ignoreList":[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":";;;A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AAK;AAAA,EAC5B;AAAA,EAEA,oBAAoBS,GAA0BC,GAA8B;AACxE,QAAI,CAAC,KAAK;AACN,aAAO,CAAA;AAEX,QAAI,CAACD,EAAa;AACd,aAAO,KAAK,KAAK,IAAI,CAAAD,MAAO,OAAOA,EAAIE,CAAU,CAAC,CAAC;AAEvD,QAAIC,IAA4C,EAAC,SAAS,KAAK,aAAa,MAAM,KAAK,KAAA;AACvF,WAAAF,EAAa,QAAQ,CAAAhB,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,EA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,EAAC,SAAS,KAAK,aAAa,YAAY,KAAK,WAAA;AACzG,WAAAF,EAAa,QAAQ,CAAAvB,MAAO;AACxB,YAAM0B,IAAYD,EAAO,QAAQzB,CAAG;AACpC,UAAI,CAAC0B;AACD,eAAOjC;AAEXgC,UAASC;AAAAA,IACb,CAAC,GACMD,EAAO;AAAA,EAClB;AACJ;AAvKI7B,EADSF,GACF,cAAa,CAACW,MAA6B,OAAOA,CAAK,CAAA;AAD3D,IAAMsB,IAANjC;","x_google_ignoreList":[0]}
|
|
@@ -5,12 +5,12 @@ import { ChartHistogram as m } from "./histogram/index.js";
|
|
|
5
5
|
import { ChartScatterplot as p } from "./scatterplot/index.js";
|
|
6
6
|
import { ChartScatterplotUmap as f } from "./scatterplot-umap/index.js";
|
|
7
7
|
import { ChartBubble as d } from "./bubble/index.js";
|
|
8
|
-
import { DataFrame as
|
|
8
|
+
import { DataFrame as s } 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, i = (o, t, r) => b(o, typeof t != "symbol" ? t + "" : t, r);
|
|
11
11
|
class h {
|
|
12
12
|
constructor(t) {
|
|
13
|
-
|
|
13
|
+
i(this, "node"), i(this, "chart"), this.chart = t;
|
|
14
14
|
}
|
|
15
15
|
static createChart(t, r, e) {
|
|
16
16
|
const { type: a } = r;
|
|
@@ -31,12 +31,15 @@ class h {
|
|
|
31
31
|
l(a, `Unknown chart type: ${a}`);
|
|
32
32
|
}
|
|
33
33
|
static newPlot(t, r, e) {
|
|
34
|
-
const a =
|
|
34
|
+
const a = s.from(t);
|
|
35
35
|
return new this(h.createChart(a, r, e));
|
|
36
36
|
}
|
|
37
37
|
get calculatedData() {
|
|
38
38
|
return this.chart.calculatedData;
|
|
39
39
|
}
|
|
40
|
+
get hasError() {
|
|
41
|
+
return this.chart.hasError;
|
|
42
|
+
}
|
|
40
43
|
mount(t) {
|
|
41
44
|
this.node = t, this.chart.mount(t);
|
|
42
45
|
}
|
|
@@ -48,7 +51,7 @@ class h {
|
|
|
48
51
|
const e = h.createChart(this.chart.data, r);
|
|
49
52
|
this.node ? (this.chart.unmount(), this.chart = e, this.chart.mount(this.node)) : this.chart = e;
|
|
50
53
|
} else
|
|
51
|
-
this.chart.updateSettingsAndData(
|
|
54
|
+
this.chart.updateSettingsAndData(s.from(t), r);
|
|
52
55
|
}
|
|
53
56
|
updateChartState(t, r) {
|
|
54
57
|
this.chart.updateChartState(t, r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiPlots.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/MiPlots.ts"],"sourcesContent":["import type {AbstractChart, ChartInterface} from './AbstractChart';\nimport {ChartDendro} from './dendro';\nimport {ChartDiscrete} from './discrete';\nimport {ChartHeatmap} from './heatmap';\nimport {ChartHistogram} from './histogram';\nimport {ChartScatterplot} from './scatterplot';\nimport {ChartScatterplotUmap} from './scatterplot-umap';\nimport {ChartBubble} from './bubble';\nimport {DataFrame} from './DataFrame';\nimport type {\n BubbleEventHandlers,\n ChartEventHandlers,\n DendroEventHandlers,\n DiscreteEventHandlers,\n HeatmapEventHandlers,\n HistogramEventHandlers,\n ScatterplotEventHandlers,\n Settings,\n} from './types';\nimport {exhaustive} from './utils';\nimport type {DataSet} from './DataFrame';\n\nexport class MiPlots implements ChartInterface {\n node?: HTMLElement;\n chart: AbstractChart;\n\n private static createChart(\n data: DataFrame,\n settings: Settings,\n eventHandlers?: ChartEventHandlers<unknown>\n ): AbstractChart {\n const {type} = settings;\n\n if (type === 'discrete') {\n return new ChartDiscrete(data, settings, eventHandlers as DiscreteEventHandlers);\n }\n\n if (type === 'dendro') {\n return new ChartDendro(data, settings, eventHandlers as DendroEventHandlers);\n }\n\n if (type === 'scatterplot') {\n return new ChartScatterplot(data, settings, eventHandlers as ScatterplotEventHandlers);\n }\n\n if (type === 'scatterplot-umap') {\n return new ChartScatterplotUmap(data, settings, eventHandlers as ScatterplotEventHandlers);\n }\n\n if (type === 'heatmap') {\n return new ChartHeatmap(data, settings, eventHandlers as HeatmapEventHandlers);\n }\n\n if (type === 'histogram') {\n return new ChartHistogram(data, settings, eventHandlers as HistogramEventHandlers);\n }\n\n if (type === 'bubble') {\n return new ChartBubble(data, settings, eventHandlers as BubbleEventHandlers);\n }\n\n exhaustive(type, `Unknown chart type: ${type}`);\n }\n\n static newPlot(data: DataSet, settings: Settings, eventHandlers?: ChartEventHandlers<unknown>): MiPlots {\n const dataFrame = DataFrame.from(data);\n return new this(MiPlots.createChart(dataFrame, settings, eventHandlers));\n }\n\n constructor(chart: AbstractChart) {\n this.chart = chart;\n }\n\n get calculatedData() {\n return this.chart.calculatedData;\n }\n\n mount(node: HTMLElement) {\n this.node = node;\n this.chart.mount(node);\n }\n\n unmount() {\n delete this.node;\n this.chart.unmount();\n }\n\n updateSettingsAndData(data: DataSet, settings: Settings) {\n if (settings.type !== this.chart.settings.type) {\n const newChart = MiPlots.createChart(this.chart.data, settings);\n\n if (this.node) {\n this.chart.unmount();\n this.chart = newChart;\n this.chart.mount(this.node);\n } else {\n this.chart = newChart;\n }\n } else {\n this.chart.updateSettingsAndData(DataFrame.from(data), settings);\n }\n }\n\n updateChartState(field: string, value: unknown) {\n this.chart.updateChartState(field, value);\n }\n\n export() {\n return this.chart.export();\n }\n}\n"],"names":["MiPlots","chart","__publicField","data","settings","eventHandlers","type","ChartDiscrete","ChartDendro","ChartScatterplot","ChartScatterplotUmap","ChartHeatmap","ChartHistogram","ChartBubble","exhaustive","dataFrame","DataFrame","node","newChart","field","value"],"mappings":";;;;;;;;;;AAsBO,MAAMA,EAAkC;AAAA,EA+C3C,YAAYC,GAAsB;AA9ClCC,IAAAA,EAAA,MAAA,MAAA,GACAA,EAAA,MAAA,OAAA,GA8CI,KAAK,QAAQD;AAAAA,EACjB;AAAA,EA7CA,OAAe,YACXE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AAQA;AAAAA,IAErB;AACI,WAAK,MAAM,sBAAsBF,EAAU,KAAKb,CAAI,GAAGC,CAAQ;AAAA,EAEvE;AAAA,EAEA,iBAAiBe,GAAeC,GAAgB;AAC5C,SAAK,MAAM,iBAAiBD,GAAOC,CAAK;AAAA,EAC5C;AAAA,EAEA,SAAS;AACL,WAAO,KAAK,MAAM,OAAA;AAAA,EACtB;AACJ;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"MiPlots.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/MiPlots.ts"],"sourcesContent":["import type {AbstractChart, ChartInterface} from './AbstractChart';\nimport {ChartDendro} from './dendro';\nimport {ChartDiscrete} from './discrete';\nimport {ChartHeatmap} from './heatmap';\nimport {ChartHistogram} from './histogram';\nimport {ChartScatterplot} from './scatterplot';\nimport {ChartScatterplotUmap} from './scatterplot-umap';\nimport {ChartBubble} from './bubble';\nimport {DataFrame} from './DataFrame';\nimport type {\n BubbleEventHandlers,\n ChartEventHandlers,\n DendroEventHandlers,\n DiscreteEventHandlers,\n HeatmapEventHandlers,\n HistogramEventHandlers,\n ScatterplotEventHandlers,\n Settings,\n} from './types';\nimport {exhaustive} from './utils';\nimport type {DataSet} from './DataFrame';\n\nexport class MiPlots implements ChartInterface {\n node?: HTMLElement;\n chart: AbstractChart;\n\n private static createChart(\n data: DataFrame,\n settings: Settings,\n eventHandlers?: ChartEventHandlers<unknown>\n ): AbstractChart {\n const {type} = settings;\n\n if (type === 'discrete') {\n return new ChartDiscrete(data, settings, eventHandlers as DiscreteEventHandlers);\n }\n\n if (type === 'dendro') {\n return new ChartDendro(data, settings, eventHandlers as DendroEventHandlers);\n }\n\n if (type === 'scatterplot') {\n return new ChartScatterplot(data, settings, eventHandlers as ScatterplotEventHandlers);\n }\n\n if (type === 'scatterplot-umap') {\n return new ChartScatterplotUmap(data, settings, eventHandlers as ScatterplotEventHandlers);\n }\n\n if (type === 'heatmap') {\n return new ChartHeatmap(data, settings, eventHandlers as HeatmapEventHandlers);\n }\n\n if (type === 'histogram') {\n return new ChartHistogram(data, settings, eventHandlers as HistogramEventHandlers);\n }\n\n if (type === 'bubble') {\n return new ChartBubble(data, settings, eventHandlers as BubbleEventHandlers);\n }\n\n exhaustive(type, `Unknown chart type: ${type}`);\n }\n\n static newPlot(data: DataSet, settings: Settings, eventHandlers?: ChartEventHandlers<unknown>): MiPlots {\n const dataFrame = DataFrame.from(data);\n return new this(MiPlots.createChart(dataFrame, settings, eventHandlers));\n }\n\n constructor(chart: AbstractChart) {\n this.chart = chart;\n }\n\n get calculatedData() {\n return this.chart.calculatedData;\n }\n\n get hasError() {\n return this.chart.hasError;\n }\n\n mount(node: HTMLElement) {\n this.node = node;\n this.chart.mount(node);\n }\n\n unmount() {\n delete this.node;\n this.chart.unmount();\n }\n\n updateSettingsAndData(data: DataSet, settings: Settings) {\n if (settings.type !== this.chart.settings.type) {\n const newChart = MiPlots.createChart(this.chart.data, settings);\n\n if (this.node) {\n this.chart.unmount();\n this.chart = newChart;\n this.chart.mount(this.node);\n } else {\n this.chart = newChart;\n }\n } else {\n this.chart.updateSettingsAndData(DataFrame.from(data), settings);\n }\n }\n\n updateChartState(field: string, value: unknown) {\n this.chart.updateChartState(field, value);\n }\n\n export() {\n return this.chart.export();\n }\n}\n"],"names":["MiPlots","chart","__publicField","data","settings","eventHandlers","type","ChartDiscrete","ChartDendro","ChartScatterplot","ChartScatterplotUmap","ChartHeatmap","ChartHistogram","ChartBubble","exhaustive","dataFrame","DataFrame","node","newChart","field","value"],"mappings":";;;;;;;;;;AAsBO,MAAMA,EAAkC;AAAA,EA+C3C,YAAYC,GAAsB;AA9ClCC,IAAAA,EAAA,MAAA,MAAA,GACAA,EAAA,MAAA,OAAA,GA8CI,KAAK,QAAQD;AAAAA,EACjB;AAAA,EA7CA,OAAe,YACXE,GACAC,GACAC,GACa;AACb,UAAM,EAAC,MAAAC,EAAAA,IAAQF;AAEf,QAAIE,MAAS;AACT,aAAO,IAAIC,EAAc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