@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stackedBar.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/layers/stackedBar.ts"],"sourcesContent":["import type {DataFrame, GroupKey} from '../../DataFrame';\nimport {NO_GROUPED} from '../../DataFrame';\nimport type {
|
|
1
|
+
{"version":3,"file":"stackedBar.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/layers/stackedBar.ts"],"sourcesContent":["import { sum } from 'd3-array';\nimport type { DataFrame, GroupKey } from '../../DataFrame';\nimport { NO_GROUPED } from '../../DataFrame';\nimport type { ColumnName } from '../../types';\nimport type { StackedBarLayer } from '../DiscreteSettingsImpl';\nimport { getFacetStringKey } from '../utils/getFacetStringKey';\nimport type { StackedBarsData } from './types';\n\ntype BarPart = {\n height: number;\n key: string;\n};\n\nexport type StackedBar = {\n key: string;\n valuesMap: Record<string, BarPart>;\n primaryGrouping: string;\n boundsY: {\n min: number;\n max: number;\n };\n};\n\nexport function getStackedBarsData(\n layer: StackedBarLayer,\n groupingKeys: {\n facet: GroupKey[][],\n primary: GroupKey[],\n secondary: GroupKey[]\n },\n data: DataFrame,\n y: ColumnName,\n): StackedBarsData {\n let maxY = -Infinity;\n let minY = Infinity;\n\n return {\n type: 'stackedBar',\n geoms: groupingKeys.facet.reduce((res: Record<string, StackedBar[]>, facetKey) => {\n const strFacetKey = getFacetStringKey(facetKey);\n res[strFacetKey] = [];\n groupingKeys.primary.forEach(primaryKey => {\n let currentHeight = 0;\n const barParts:Record<string, BarPart> = {};\n groupingKeys.secondary.forEach(secondaryKey => {\n const secondaryKeyStr = secondaryKey === NO_GROUPED ? 'null' : secondaryKey;\n const indexes = data.getRowsByGrouping([...facetKey, primaryKey, secondaryKey]);\n if (!indexes.length) {\n return;\n }\n const height = sum(indexes, (i) => Number(data.getColumnValue(y.value, i)));\n barParts[secondaryKeyStr] = {\n height,\n key: String(secondaryKeyStr),\n };\n currentHeight += height;\n });\n const maxStackHeight = currentHeight;\n if (layer.normalize) { // show in percents of every stack\n groupingKeys.secondary.forEach(secondaryKey => {\n const secondaryKeyStr = secondaryKey === NO_GROUPED ? 'null' : secondaryKey;\n if (!barParts[secondaryKeyStr]) {\n return;\n }\n barParts[secondaryKeyStr].height = barParts[secondaryKeyStr].height / maxStackHeight * 100;\n });\n }\n maxY = Math.max(maxY, 0, currentHeight);\n minY = Math.min(minY, 0, currentHeight);\n const bound = layer.normalize ? 100 : maxStackHeight;\n res[strFacetKey].push({\n key: `stackedBar_${String(primaryKey)}`,\n valuesMap: barParts,\n primaryGrouping: primaryKey,\n boundsY: {min: Math.min(bound, 0), max: Math.max(bound, 0)},\n } as StackedBar);\n });\n return res;\n }, {}),\n meta: {minY: layer.normalize ? 0 : minY, maxY: layer.normalize ? 100 : maxY, normalize: layer.normalize},\n aes: layer.aes,\n };\n}\n"],"names":["getStackedBarsData","layer","groupingKeys","data","y","maxY","minY","res","facetKey","strFacetKey","getFacetStringKey","primaryKey","currentHeight","barParts","secondaryKey","secondaryKeyStr","NO_GROUPED","indexes","height","sum","i","maxStackHeight","bound"],"mappings":";;;AAuBO,SAASA,EACZC,GACAC,GAKAC,GACAC,GACe;AACf,MAAIC,IAA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AAO,CAAC,GAAG,KAAK,KAAK,IAAIA,GAAO,CAAC,EAAA;AAAA,QAAA,CAC9C;AAAA,MACnB,CAAC,GACMf;AAAAA,IACX,GAAG,CAAA,CAAE;AAAA,IACL,MAAM,EAAC,MAAMN,EAAM,YAAY,IAAIK,GAAM,MAAML,EAAM,YAAY,MAAMI,GAAM,WAAWJ,EAAM,UAAA;AAAA,IAC9F,KAAKA,EAAM;AAAA,EAAA;AAEnB;","x_google_ignoreList":[0]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { quantileSorted as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return [
|
|
1
|
+
import { quantileSorted as l } from "../../node_modules/d3-array/src/quantile.js";
|
|
2
|
+
function c(u, o) {
|
|
3
|
+
const g = (t) => o === "log" ? Math.log10(t) : t, r = (t) => o === "log" ? Math.pow(10, t) : t, a = u.map(g).sort((t, m) => t - m), e = l(a, 0.25), n = l(a, 0.75), s = n - e, i = 1.5;
|
|
4
|
+
return [r(e - i * s), r(n + i * s)];
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
c as getOutliersBounds
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=getOutliersBounds.js.map
|
package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOutliersBounds.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/getOutliersBounds.ts"],"sourcesContent":["import {quantileSorted} from 'd3-array';\n\nexport function getOutliersBounds
|
|
1
|
+
{"version":3,"file":"getOutliersBounds.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/getOutliersBounds.ts"],"sourcesContent":["import { quantileSorted } from 'd3-array';\n\nexport function getOutliersBounds(values: number[], scale: 'linear' | 'log') {\n const convertToScale = (v: number) => (scale === 'log' ? Math.log10(v) : v);\n const convertFromScale = (v: number) => (scale === 'log' ? Math.pow(10, v) : v);\n const valuesSortedConverted = values\n .map(convertToScale)\n .sort((a, b) => a - b);\n\n const q1 = quantileSorted(valuesSortedConverted, 0.25) as number;\n const q3 = quantileSorted(valuesSortedConverted, 0.75) as number;\n const interQuantileRange = q3 - q1;\n\n const k = 1.5;\n return [convertFromScale(q1 - k * interQuantileRange), convertFromScale(q3 + k * interQuantileRange)];\n}\n"],"names":["getOutliersBounds","values","scale","convertToScale","v","convertFromScale","valuesSortedConverted","a","b","q1","quantileSorted","q3","interQuantileRange","k"],"mappings":";AAEO,SAASA,EAAkBC,GAAkBC,GAAyB;AACzE,QAAMC,IAAiB,CAACC,MAAeF,MAAU,QAAQ,KAAK,MAAME,CAAC,IAAIA,GACnEC,IAAmB,CAACD,MAAeF,MAAU,QAAQ,KAAK,IAAI,IAAIE,CAAC,IAAIA,GACvEE,IAAwBL,EACzB,IAAIE,CAAc,EAClB,KAAK,CAACI,GAAGC,MAAMD,IAAIC,CAAC,GAEnBC,IAAKC,EAAeJ,GAAuB,IAAI,GAC/CK,IAAKD,EAAeJ,GAAuB,IAAI,GAC/CM,IAAqBD,IAAKF,GAE1BI,IAAI;AACV,SAAO,CAACR,EAAiBI,IAAKI,IAAID,CAAkB,GAAGP,EAAiBM,IAAKE,IAAID,CAAkB,CAAC;AACxG;","x_google_ignoreList":[0]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TextMeasurer as f } from "../../utils/TextMeasurer.js";
|
|
2
|
-
function d(
|
|
1
|
+
import { TextMeasurer as f } from "../../utils/TextMeasurer/TextMeasurer.js";
|
|
2
|
+
function d(h, p, a, o = 14) {
|
|
3
3
|
const i = new f(`600 ${o}px Manrope`), s = [];
|
|
4
|
-
|
|
4
|
+
h.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach((n) => {
|
|
5
5
|
i.getTextWidth(n) > a ? s.push(...n.split("")) : s.push(n);
|
|
6
6
|
});
|
|
7
7
|
let e = "", r = 0, t = 0, u = "";
|
|
8
|
-
for (; r <=
|
|
8
|
+
for (; r <= p; ) {
|
|
9
9
|
const n = i.getTextWidth(e + s[t]);
|
|
10
|
-
n <
|
|
10
|
+
n < p && (e += s[t], u = e, t++), r = n;
|
|
11
11
|
}
|
|
12
12
|
e = "", r = 0;
|
|
13
13
|
const c = [];
|
|
@@ -22,27 +22,27 @@ function d(p, h, a, o = 14) {
|
|
|
22
22
|
lastPartLength: r
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function P(
|
|
25
|
+
function P(h, p, a) {
|
|
26
26
|
const o = new f(`600 ${a}px Manrope`);
|
|
27
|
-
if (
|
|
27
|
+
if (h.trim() === "")
|
|
28
28
|
return [];
|
|
29
|
-
if (o.getTextWidth(
|
|
30
|
-
return [
|
|
31
|
-
const i =
|
|
29
|
+
if (o.getTextWidth(h) <= p)
|
|
30
|
+
return [h];
|
|
31
|
+
const i = h.split(/\s+/), s = [];
|
|
32
32
|
let e = "", r = 0;
|
|
33
33
|
for (let t = 0; t < i.length; t++) {
|
|
34
34
|
const u = `${e} ${i[t]}`, c = o.getTextWidth(u);
|
|
35
|
-
if (c <=
|
|
35
|
+
if (c <= p)
|
|
36
36
|
e = u, r = c;
|
|
37
37
|
else {
|
|
38
38
|
const n = o.getTextWidth(i[t]);
|
|
39
|
-
if (n >
|
|
39
|
+
if (n > p) {
|
|
40
40
|
const {
|
|
41
41
|
firstPart: g,
|
|
42
42
|
lines: l,
|
|
43
43
|
lastPart: x,
|
|
44
44
|
lastPartLength: T
|
|
45
|
-
} = d(i[t],
|
|
45
|
+
} = d(i[t], p - r, p, a);
|
|
46
46
|
s.push(`${e} ${g}`), s.push(...l), e = x, r = T;
|
|
47
47
|
} else
|
|
48
48
|
s.push(e), e = i[t], r = n;
|
package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitTextByWidth.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/splitTextByWidth.ts"],"sourcesContent":["import {TextMeasurer} from '../../utils/TextMeasurer';\n\nfunction splitWord(word:string, startLineLength:number, maxLength:number, fontSize = 14) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n // \"_\" and \"-\" symbols have priority as separation bounds, if this is not enough split by single symbols\n const parts:string[] = [];\n word\n .split(/(?=[_-])|(?<=[_-])/)\n .forEach((part) => {\n const length = textMeasurer.getTextWidth(part);\n if (length > maxLength) {\n parts.push(...part.split(''));\n } else {\n parts.push(part);\n }\n });\n let currentLine = '';\n let currentLineLength = 0;\n let i = 0;\n let firstPart = '';\n while (currentLineLength <= startLineLength) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < startLineLength) {\n currentLine += parts[i];\n firstPart = currentLine;\n i++;\n }\n currentLineLength = nextLength;\n }\n currentLine = '';\n currentLineLength = 0;\n const lines:string[] = [];\n for (i; i < parts.length; i++) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < maxLength) {\n currentLine += parts[i];\n currentLineLength = nextLength;\n } else {\n lines.push(currentLine);\n currentLine = parts[i];\n currentLineLength = textMeasurer.getTextWidth(parts[i]);\n }\n }\n return {\n firstPart,\n lines,\n lastPart: currentLine,\n lastPartLength: currentLineLength\n };\n}\n\nexport function splitTextByWidth (text:string, maxWidth: number, fontSize: number) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n if (text.trim() === '') {\n return [];\n }\n if (textMeasurer.getTextWidth(text) <= maxWidth) {\n return [text];\n }\n const words = text.split(/\\s+/);\n const result:string[] = [];\n let currentLine = '';\n let currentLineLength = 0;\n for (let i = 0; i < words.length; i++) {\n const tempLine = `${currentLine} ${words[i]}`;\n const tempLineLength = textMeasurer.getTextWidth(tempLine);\n if (tempLineLength <= maxWidth) {\n currentLine = tempLine;\n currentLineLength = tempLineLength;\n } else {\n const wordLength = textMeasurer.getTextWidth(words[i]);\n if (wordLength > maxWidth) {\n const {\n firstPart,\n lines,\n lastPart,\n lastPartLength\n } = splitWord(words[i], maxWidth - currentLineLength, maxWidth, fontSize);\n result.push(`${currentLine} ${firstPart}`);\n result.push(...lines);\n currentLine = lastPart;\n currentLineLength = lastPartLength;\n } else {\n result.push(currentLine);\n currentLine = words[i];\n currentLineLength = wordLength;\n }\n }\n }\n result.push(currentLine);\n return result.filter((line) => {\n return line.length > 0;\n });\n}\n"],"names":["splitWord","word","startLineLength","maxLength","fontSize","textMeasurer","TextMeasurer","parts","part","currentLine","currentLineLength","i","firstPart","nextLength","lines","splitTextByWidth","text","maxWidth","words","result","tempLine","tempLineLength","wordLength","lastPart","lastPartLength","line"],"mappings":";AAEA,SAASA,EAAUC,GAAaC,GAAwBC,GAAkBC,IAAW,IAAI;AACrF,QAAMC,IAAe,IAAIC,EAAa,OAAOF,CAAQ,YAAY,GAE3DG,IAAiB,CAAA;AACvBN,EAAAA,EACK,MAAM,IAAA,OAAA,oBAAoB,CAAA,EAC1B,QAAQ,CAACO,MAAS;AACAH,MAAa,aAAaG,CAAI,IAChCL,IACTI,EAAM,KAAK,GAAGC,EAAK,MAAM,EAAE,CAAC,IAE5BD,EAAM,KAAKC,CAAI;AAAA,EAEvB,CAAC;AACL,MAAIC,IAAc,IACdC,IAAoB,GACpBC,IAAI,GACJC,IAAY;AAChB,SAAOF,KAAqBR,KAAiB;AACzC,UAAMW,IAAaR,EAAa,aAAaI,IAAcF,EAAMI,CAAC,CAAC;AAC/DE,IAAAA,IAAaX,MACbO,KAAeF,EAAMI,CAAC,GACtBC,IAAYH,GACZE,MAEJD,IAAoBG;AAAAA,EACxB;AACAJ,MAAc,IACdC,IAAoB;AACpB,QAAMI,IAAiB,CAAA;AACvB,OAAKH,GAAGA,IAAIJ,EAAM,QAAQI,KAAK;AAC3B,UAAME,IAAaR,EAAa,aAAaI,IAAcF,EAAMI,CAAC,CAAC;AAC/DE,IAAAA,IAAaV,KACbM,KAAeF,EAAM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,EACJ;AACA,SAAAH,EAAO,KAAKV,CAAW,GAChBU,EAAO,OAAO,CAACM,MACXA,EAAK,SAAS,CACxB;AACL;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"splitTextByWidth.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/splitTextByWidth.ts"],"sourcesContent":["import { TextMeasurer } from '../../utils/TextMeasurer/TextMeasurer';\n\nfunction splitWord(word:string, startLineLength:number, maxLength:number, fontSize = 14) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n // \"_\" and \"-\" symbols have priority as separation bounds, if this is not enough split by single symbols\n const parts:string[] = [];\n word\n .split(/(?=[_-])|(?<=[_-])/)\n .forEach((part) => {\n const length = textMeasurer.getTextWidth(part);\n if (length > maxLength) {\n parts.push(...part.split(''));\n } else {\n parts.push(part);\n }\n });\n let currentLine = '';\n let currentLineLength = 0;\n let i = 0;\n let firstPart = '';\n while (currentLineLength <= startLineLength) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < startLineLength) {\n currentLine += parts[i];\n firstPart = currentLine;\n i++;\n }\n currentLineLength = nextLength;\n }\n currentLine = '';\n currentLineLength = 0;\n const lines:string[] = [];\n for (i; i < parts.length; i++) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < maxLength) {\n currentLine += parts[i];\n currentLineLength = nextLength;\n } else {\n lines.push(currentLine);\n currentLine = parts[i];\n currentLineLength = textMeasurer.getTextWidth(parts[i]);\n }\n }\n return {\n firstPart,\n lines,\n lastPart: currentLine,\n lastPartLength: currentLineLength\n };\n}\n\nexport function splitTextByWidth (text:string, maxWidth: number, fontSize: number) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n if (text.trim() === '') {\n return [];\n }\n if (textMeasurer.getTextWidth(text) <= maxWidth) {\n return [text];\n }\n const words = text.split(/\\s+/);\n const result:string[] = [];\n let currentLine = '';\n let currentLineLength = 0;\n for (let i = 0; i < words.length; i++) {\n const tempLine = `${currentLine} ${words[i]}`;\n const tempLineLength = textMeasurer.getTextWidth(tempLine);\n if (tempLineLength <= maxWidth) {\n currentLine = tempLine;\n currentLineLength = tempLineLength;\n } else {\n const wordLength = textMeasurer.getTextWidth(words[i]);\n if (wordLength > maxWidth) {\n const {\n firstPart,\n lines,\n lastPart,\n lastPartLength\n } = splitWord(words[i], maxWidth - currentLineLength, maxWidth, fontSize);\n result.push(`${currentLine} ${firstPart}`);\n result.push(...lines);\n currentLine = lastPart;\n currentLineLength = lastPartLength;\n } else {\n result.push(currentLine);\n currentLine = words[i];\n currentLineLength = wordLength;\n }\n }\n }\n result.push(currentLine);\n return result.filter((line) => {\n return line.length > 0;\n });\n}\n"],"names":["splitWord","word","startLineLength","maxLength","fontSize","textMeasurer","TextMeasurer","parts","part","currentLine","currentLineLength","i","firstPart","nextLength","lines","splitTextByWidth","text","maxWidth","words","result","tempLine","tempLineLength","wordLength","lastPart","lastPartLength","line"],"mappings":";AAEA,SAASA,EAAUC,GAAaC,GAAwBC,GAAkBC,IAAW,IAAI;AACrF,QAAMC,IAAe,IAAIC,EAAa,OAAOF,CAAQ,YAAY,GAE3DG,IAAiB,CAAA;AACvBN,EAAAA,EACK,MAAM,IAAA,OAAA,oBAAoB,CAAA,EAC1B,QAAQ,CAACO,MAAS;AACAH,MAAa,aAAaG,CAAI,IAChCL,IACTI,EAAM,KAAK,GAAGC,EAAK,MAAM,EAAE,CAAC,IAE5BD,EAAM,KAAKC,CAAI;AAAA,EAEvB,CAAC;AACL,MAAIC,IAAc,IACdC,IAAoB,GACpBC,IAAI,GACJC,IAAY;AAChB,SAAOF,KAAqBR,KAAiB;AACzC,UAAMW,IAAaR,EAAa,aAAaI,IAAcF,EAAMI,CAAC,CAAC;AAC/DE,IAAAA,IAAaX,MACbO,KAAeF,EAAMI,CAAC,GACtBC,IAAYH,GACZE,MAEJD,IAAoBG;AAAAA,EACxB;AACAJ,MAAc,IACdC,IAA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