@milaboratories/graph-maker 1.1.138 → 1.1.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GraphMaker/components/LassoControls/index.vue.js +15 -13
- package/dist/GraphMaker/components/LassoControls/index.vue.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +9 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +17 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +13 -4
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +28 -7
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +6 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +16 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +14 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js +95 -72
- package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js +124 -122
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js +72 -91
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js +43 -41
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js +28 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js +94 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +42 -38
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Legend.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js +11 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js +20 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +181 -181
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js +2 -2
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js +45 -45
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js +27 -27
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Legend.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js +18 -18
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js +36 -36
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js +45 -41
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js +33 -33
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +90 -93
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +200 -199
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +17 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/BoxElement.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +102 -99
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js +31 -36
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js +62 -74
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js +52 -53
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js +32 -32
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js +7 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js +23 -23
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js +63 -63
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js +60 -64
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js +23 -23
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js +5 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js +13 -13
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +258 -256
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +45 -44
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +107 -106
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +18 -18
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +99 -95
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +30 -29
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js +143 -142
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/HistogramSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js +30 -30
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/ChartsGroup.js +7 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js +53 -54
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +59 -55
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/@d3fc/d3fc-axis/src/axisBase.js +7 -7
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js +6 -12
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-shape/src/line.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js +148 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js +172 -168
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +26 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js +11 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js +30 -29
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js +135 -153
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js +35 -32
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js +27 -27
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/constants.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +24 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +11 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +57 -58
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js +85 -83
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js +20 -20
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +44 -37
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js +11 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js +46 -56
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +223 -205
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +22 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js +42 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js +84 -81
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/SVGLayer.js +11 -11
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js +15 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +89 -114
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +3 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js +39 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js +101 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js +4 -4
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js +3 -3
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js.map +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +1031 -1023
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/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,169 +1,144 @@
|
|
|
1
|
-
import { AbstractChart as
|
|
2
|
-
import { createLegendInfo as U, addPalettesToAesMapping as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { SCATTERPLOT_LASSO_EVENTS as
|
|
6
|
-
import { ScatterplotUmapSettingsImpl as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { AbstractChart as _ } from "../AbstractChart.js";
|
|
2
|
+
import { createLegendInfo as U, addPalettesToAesMapping as L } from "../scatterplot/utils/createLegendInfo.js";
|
|
3
|
+
import { formatColumnValue as A } from "../scatterplot/utils/formatColumnValue.js";
|
|
4
|
+
import R from "./ChartRenderer.js";
|
|
5
|
+
import { SCATTERPLOT_LASSO_EVENTS as p } from "./constants.js";
|
|
6
|
+
import { ScatterplotUmapSettingsImpl as b } from "./SettingsImpl.js";
|
|
7
|
+
import { format as T } from "../node_modules/d3-format/src/defaultLocale.js";
|
|
8
|
+
var P = Object.defineProperty, O = (u, t, e) => t in u ? P(u, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[t] = e, g = (u, t, e) => O(u, typeof t != "symbol" ? t + "" : t, e);
|
|
9
|
+
function V(u) {
|
|
10
|
+
return typeof u == "object" && "type" in u && u.type === "grouping";
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
continue;
|
|
18
|
-
const n = a.getTextMetrics(String(s));
|
|
19
|
-
t.push({
|
|
20
|
-
name: String(s),
|
|
21
|
-
width: (n == null ? void 0 : n.width) ?? 0,
|
|
22
|
-
height: ((n == null ? void 0 : n.actualBoundingBoxAscent) ?? 0) + ((n == null ? void 0 : n.actualBoundingBoxDescent) ?? 0),
|
|
23
|
-
x: 0,
|
|
24
|
-
y: 0,
|
|
25
|
-
xPosition: "right",
|
|
26
|
-
yPosition: "middle",
|
|
27
|
-
dot: e,
|
|
28
|
-
padding: X,
|
|
29
|
-
bbox: { minX: 0, maxX: 0, minY: 0, maxY: 0 },
|
|
30
|
-
outerBBox: { minX: 0, maxX: 0, minY: 0, maxY: 0 }
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return t;
|
|
34
|
-
}
|
|
35
|
-
class H extends L {
|
|
36
|
-
constructor(t, a, e) {
|
|
37
|
-
super(t, a), v(this, "settings"), v(this, "chartRenderer", new A()), v(this, "onPolygonUpdate", () => {
|
|
38
|
-
}), v(this, "onTooltipHintSwitch", () => {
|
|
39
|
-
}), v(this, "onLassoControlsStateUpdate", () => {
|
|
40
|
-
}), v(this, "calculatedData", null), this.settings = new E(a), e && (this.onPolygonUpdate = e.onPolygonUpdate, this.onTooltipHintSwitch = e.onTooltipHintSwitch, this.onLassoControlsStateUpdate = e.onLassoControlsStateUpdate);
|
|
12
|
+
class I extends _ {
|
|
13
|
+
constructor(t, e, a) {
|
|
14
|
+
super(t, e), g(this, "settings"), g(this, "chartRenderer"), g(this, "onPolygonUpdate", () => {
|
|
15
|
+
}), g(this, "onTooltipHintSwitch", () => {
|
|
16
|
+
}), g(this, "onLassoControlsStateUpdate", () => {
|
|
17
|
+
}), g(this, "calculatedData", null), this.settings = new b(e), this.chartRenderer = new R(), a && (this.onPolygonUpdate = a.onPolygonUpdate, this.onTooltipHintSwitch = a.onTooltipHintSwitch, this.onLassoControlsStateUpdate = a.onLassoControlsStateUpdate);
|
|
41
18
|
}
|
|
42
19
|
mount(t) {
|
|
43
20
|
try {
|
|
44
21
|
this.chartRenderer.init(t), this._updateData(), this._updateChart();
|
|
45
|
-
} catch (
|
|
46
|
-
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.error(e), e instanceof Error && (this.chartRenderer.renderError(e.message), console.error(e));
|
|
47
24
|
}
|
|
48
25
|
}
|
|
49
26
|
unmount() {
|
|
50
27
|
this.chartRenderer.clear();
|
|
51
28
|
}
|
|
52
|
-
updateSettingsAndData(t,
|
|
29
|
+
updateSettingsAndData(t, e) {
|
|
53
30
|
try {
|
|
54
|
-
const
|
|
55
|
-
this.settings = new
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
} catch (
|
|
59
|
-
|
|
31
|
+
const a = this.settings, r = this.data;
|
|
32
|
+
this.settings = new b(e), this.data = t, this._needUpdateCalculatedDataBySettings(a, this.settings) || this._needUpdateCalculatedDataByData(r, this.data) ? this._updateData() : this._updateAesInData();
|
|
33
|
+
const s = a.layers.find((l) => l.type === "dots"), o = this.settings.layers.find((l) => l.type === "dots");
|
|
34
|
+
s && o && s.aes.dotSize !== o.aes.dotSize && typeof s.aes.dotSize == "number" && typeof o.aes.dotSize == "number" && this.chartRenderer.updatePointSize(), this._updateChart();
|
|
35
|
+
} catch (a) {
|
|
36
|
+
a instanceof Error && (this.chartRenderer.renderError(a.message), console.error(a));
|
|
60
37
|
}
|
|
61
38
|
}
|
|
62
|
-
updateChartState(t,
|
|
63
|
-
if (t === "polygon" && (this.chartRenderer.polygons =
|
|
64
|
-
const
|
|
65
|
-
document.dispatchEvent(
|
|
39
|
+
updateChartState(t, e) {
|
|
40
|
+
if (t === "polygon" && (this.chartRenderer.polygons = e, this._updateChart()), t === p.delete && document) {
|
|
41
|
+
const a = new CustomEvent(p.delete);
|
|
42
|
+
document.dispatchEvent(a);
|
|
66
43
|
}
|
|
67
|
-
if (t ===
|
|
68
|
-
const
|
|
69
|
-
document.dispatchEvent(
|
|
44
|
+
if (t === p.selectMode && document) {
|
|
45
|
+
const a = new CustomEvent(p.selectMode, { detail: e });
|
|
46
|
+
document.dispatchEvent(a);
|
|
70
47
|
}
|
|
71
|
-
if (t ===
|
|
72
|
-
const
|
|
73
|
-
document.dispatchEvent(
|
|
48
|
+
if (t === p.forward && document) {
|
|
49
|
+
const a = new CustomEvent(p.forward);
|
|
50
|
+
document.dispatchEvent(a);
|
|
74
51
|
}
|
|
75
|
-
if (t ===
|
|
76
|
-
const
|
|
77
|
-
document.dispatchEvent(
|
|
52
|
+
if (t === p.back && document) {
|
|
53
|
+
const a = new CustomEvent(p.back);
|
|
54
|
+
document.dispatchEvent(a);
|
|
78
55
|
}
|
|
79
56
|
}
|
|
80
57
|
export() {
|
|
81
58
|
return console.warn("export not implemented"), "";
|
|
82
59
|
}
|
|
83
|
-
_needUpdateCalculatedDataBySettings(t,
|
|
84
|
-
var
|
|
85
|
-
return t.grouping.length !==
|
|
86
|
-
var
|
|
87
|
-
return
|
|
88
|
-
}) || t.layers.length !==
|
|
60
|
+
_needUpdateCalculatedDataBySettings(t, e) {
|
|
61
|
+
var a, r, s, o;
|
|
62
|
+
return t.grouping.length !== e.grouping.length || t.grouping.some((l, n) => {
|
|
63
|
+
var h;
|
|
64
|
+
return l.value !== ((h = e.grouping[n]) == null ? void 0 : h.value);
|
|
65
|
+
}) || t.layers.length !== e.layers.length || t.layers.some((l, n) => l.type !== e.layers[n].type) || (((a = t.label) == null ? void 0 : a.value) || ((r = e.label) == null ? void 0 : r.value)) && ((s = t.label) == null ? void 0 : s.value) !== ((o = e.label) == null ? void 0 : o.value);
|
|
89
66
|
}
|
|
90
|
-
_needUpdateCalculatedDataByData(t,
|
|
91
|
-
const
|
|
92
|
-
return t.id !==
|
|
93
|
-
var
|
|
94
|
-
return t.data[
|
|
67
|
+
_needUpdateCalculatedDataByData(t, e) {
|
|
68
|
+
const a = Object.keys(t.data), r = Object.keys(e.data);
|
|
69
|
+
return t.id !== e.id || a.length !== r.length || a.some((s) => {
|
|
70
|
+
var o;
|
|
71
|
+
return t.data[s].length !== ((o = e.data[s]) == null ? void 0 : o.length);
|
|
95
72
|
});
|
|
96
73
|
}
|
|
97
74
|
_updateData() {
|
|
98
|
-
const { x: t, y:
|
|
75
|
+
const { x: t, y: e, label: a, highlight: r, grouping: s, layers: o, inheritedAes: l } = this.settings, n = {
|
|
99
76
|
minX: 1 / 0,
|
|
100
77
|
maxX: -1 / 0,
|
|
101
78
|
minY: 1 / 0,
|
|
102
79
|
maxY: -1 / 0
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
idx:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
data: l
|
|
80
|
+
}, h = o.some((i) => i.type === "curve"), m = /* @__PURE__ */ new Set(), y = {}, v = [], E = a != null && a.format ? T(a.format) : void 0;
|
|
81
|
+
for (let i = 0; i < this.data.rowsCount; i++) {
|
|
82
|
+
const d = this.data.getColumnValue(t.value, i), c = this.data.getColumnValue(e.value, i);
|
|
83
|
+
if (typeof d != "number" || typeof c != "number")
|
|
84
|
+
continue;
|
|
85
|
+
d < n.minX && (n.minX = d), d > n.maxX && (n.maxX = d), c < n.minY && (n.minY = c), c > n.maxY && (n.maxY = c);
|
|
86
|
+
const w = r ? !this.data.getColumnValue(r.value, i) : !1, S = {
|
|
87
|
+
x: d,
|
|
88
|
+
y: c,
|
|
89
|
+
idx: i,
|
|
90
|
+
label: A(this.data, i, a, E),
|
|
91
|
+
dimmed: w
|
|
116
92
|
};
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
|
|
93
|
+
if (h) {
|
|
94
|
+
const f = s.map((x) => this.data.getColumnValue(x.value, i)).join("_");
|
|
95
|
+
m.add(f), y[f] || (y[f] = []), y[f].push(S);
|
|
120
96
|
}
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const C = [...
|
|
125
|
-
|
|
126
|
-
y[
|
|
97
|
+
v.push(S);
|
|
98
|
+
}
|
|
99
|
+
r && v.sort((i, d) => d.dimmed === i.dimmed ? 0 : d.dimmed ? 1 : -1);
|
|
100
|
+
const C = [...m];
|
|
101
|
+
h && C.forEach((i) => {
|
|
102
|
+
y[i].sort((d, c) => d.x - c.x);
|
|
127
103
|
});
|
|
128
|
-
const
|
|
104
|
+
const D = U(this.data, s, o, l);
|
|
129
105
|
this.calculatedData = {
|
|
130
|
-
dots:
|
|
106
|
+
dots: v,
|
|
131
107
|
dotsByGrouping: y,
|
|
132
108
|
groupingKeys: C,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}, this.chartRenderer.updateData(b);
|
|
109
|
+
dotsExtents: n,
|
|
110
|
+
legendLabels: D
|
|
111
|
+
};
|
|
137
112
|
}
|
|
138
113
|
_updateAesInData() {
|
|
139
114
|
const t = this.calculatedData;
|
|
140
115
|
if (!t)
|
|
141
116
|
return;
|
|
142
|
-
const { layers:
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
117
|
+
const { layers: e, inheritedAes: a, grouping: r } = this.settings;
|
|
118
|
+
r.forEach((s) => {
|
|
119
|
+
const o = /* @__PURE__ */ new Set(), l = {};
|
|
120
|
+
e.forEach((n) => {
|
|
121
|
+
n.aes && Object.entries(n.aes).forEach(([h, m]) => {
|
|
122
|
+
V(m) && m.value === s.value && (o.add(h), m.palette && (l[h] = m.palette));
|
|
148
123
|
});
|
|
149
|
-
}), t.legendLabels[
|
|
124
|
+
}), t.legendLabels[s.value].usedAes = [...o], t.legendLabels[s.value].aesMap = L(s, l, a[s.value]);
|
|
150
125
|
});
|
|
151
126
|
}
|
|
152
127
|
_updateChart() {
|
|
153
128
|
if (!this.calculatedData)
|
|
154
129
|
return;
|
|
155
|
-
const { id: t, chartSettings:
|
|
130
|
+
const { id: t, chartSettings: e, keyColumn: a, layers: r, grouping: s } = this.settings;
|
|
156
131
|
this.chartRenderer.render(
|
|
132
|
+
this.data,
|
|
157
133
|
t,
|
|
158
|
-
a,
|
|
159
134
|
e,
|
|
135
|
+
a,
|
|
160
136
|
this.calculatedData.dots,
|
|
161
137
|
this.calculatedData.dotsExtents,
|
|
162
138
|
this.calculatedData.dotsByGrouping,
|
|
163
|
-
|
|
139
|
+
r,
|
|
164
140
|
this.calculatedData.legendLabels,
|
|
165
|
-
|
|
166
|
-
this.calculatedData.allPossibleLabels,
|
|
141
|
+
s,
|
|
167
142
|
this.onPolygonUpdate,
|
|
168
143
|
this.onTooltipHintSwitch,
|
|
169
144
|
this.onLassoControlsStateUpdate
|
|
@@ -171,6 +146,6 @@ class H extends L {
|
|
|
171
146
|
}
|
|
172
147
|
}
|
|
173
148
|
export {
|
|
174
|
-
|
|
149
|
+
I as ChartScatterplotUmap
|
|
175
150
|
};
|
|
176
151
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/scatterplot-umap/index.ts"],"sourcesContent":["import { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport { addPalettesToAesMapping, createLegendInfo } from '../scatterplot/utils/createLegendInfo';\nimport type { Label } from '../scatterplot/utils/getVisibleLabels';\nimport type { AesItem, ContinuousAesFromColumn, InheritAesScatterplot, ScatterplotEventHandlers } from '../types';\nimport type { ScatterplotUmapLegendInfo, ScatterplotUmapSettings } from '../types/scatterplot-umap';\nimport { TextMeasurer } from '../utils/TextMeasurer';\nimport ChartRenderer from './ChartRenderer';\nimport { SCATTERPLOT_LASSO_EVENTS } from './constants';\nimport type { DotsLayer } from './SettingsImpl';\nimport { ScatterplotUmapSettingsImpl } from './SettingsImpl';\nimport type { Dot, DotsExtents, LassoControlsState, LassoMode, Polygon } from './types';\n\nfunction isInheritMapping<T extends (string | number)>(value:T | InheritAesScatterplot | ContinuousAesFromColumn<T>):value is InheritAesScatterplot {\n return typeof value === 'object' && 'type' in value && value.type === 'grouping';\n}\n\nconst LABEL_OFFSET = 10;\nfunction getAllPossibleLabels(dots: Dot[]) {\n const labels: Label[] = [];\n const textMeasurer = new TextMeasurer('16px Manrope');\n for (const dot of dots) {\n const text = dot.label;\n if (!text) {\n continue;\n }\n const metrics = textMeasurer.getTextMetrics(String(text));\n labels.push({\n name: String(text),\n width: metrics?.width ?? 0,\n height: (metrics?.actualBoundingBoxAscent ?? 0) + (metrics?.actualBoundingBoxDescent ?? 0),\n x: 0,\n y: 0,\n xPosition: 'right',\n yPosition: 'middle',\n dot,\n padding: LABEL_OFFSET,\n bbox: {minX: 0, maxX: 0, minY: 0, maxY: 0},\n outerBBox: {minX: 0, maxX: 0, minY: 0, maxY: 0},\n } as Label);\n }\n return labels;\n}\n\nexport class ChartScatterplotUmap extends AbstractChart {\n settings: ScatterplotUmapSettingsImpl;\n chartRenderer = new ChartRenderer();\n\n onPolygonUpdate: (data: number[], polygons: Polygon[]) => void = () => undefined; // dots indexes from input data\n onTooltipHintSwitch: (v:boolean) => void = () => undefined;\n onLassoControlsStateUpdate: (v: LassoControlsState) => void = () => undefined;\n\n calculatedData: {\n dots: Dot[],\n groupingKeys: string[],\n dotsByGrouping: Record<string, Dot[]>,\n allPossibleLabels: Label[],\n dotsExtents: DotsExtents,\n legendLabels: ScatterplotUmapLegendInfo\n } | null = null;\n\n constructor(data: DataFrame, settings: ScatterplotUmapSettings, eventHandlers?: ScatterplotEventHandlers) {\n super(data, settings);\n\n this.settings = new ScatterplotUmapSettingsImpl(settings);\n if (eventHandlers) {\n this.onPolygonUpdate = eventHandlers.onPolygonUpdate;\n this.onTooltipHintSwitch = eventHandlers.onTooltipHintSwitch;\n this.onLassoControlsStateUpdate = eventHandlers.onLassoControlsStateUpdate;\n }\n }\n\n mount(node: HTMLElement) {\n try {\n this.chartRenderer.init(node);\n this._updateData();\n this._updateChart();\n } catch (err) {\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n }\n }\n }\n\n unmount() {\n this.chartRenderer.clear();\n }\n\n updateSettingsAndData(data: DataFrame, settings: ScatterplotUmapSettings) {\n try {\n const previousSettings = this.settings;\n const previousData = this.data;\n this.settings = new ScatterplotUmapSettingsImpl(settings);\n this.data = data;\n if (\n this._needUpdateCalculatedDataBySettings(previousSettings, this.settings) ||\n this._needUpdateCalculatedDataByData(previousData, this.data)\n ) {\n this._updateData();\n } else {\n this._updateAesInData();\n }\n\n // for some reason it's not enough for size updating to do like with fillColor\n const prevLayer = previousSettings.layers.find(l => l.type === 'dots') as DotsLayer;\n const currentLayer = this.settings.layers.find(l => l.type === 'dots') as DotsLayer;\n if (prevLayer && currentLayer && prevLayer.aes.dotSize !== currentLayer.aes.dotSize\n && typeof prevLayer.aes.dotSize === 'number' && typeof currentLayer.aes.dotSize === 'number') {\n this.chartRenderer.updatePointSize();\n }\n this._updateChart();\n } catch (err) {\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n }\n }\n }\n\n updateChartState(field: string, value: unknown) {\n if (field === 'polygon') {\n this.chartRenderer.polygons = value as Polygon[];\n this._updateChart();\n }\n if (field === SCATTERPLOT_LASSO_EVENTS.delete) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.delete);\n document.dispatchEvent(event);\n }}\n if (field === SCATTERPLOT_LASSO_EVENTS.selectMode) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.selectMode, {detail: value as LassoMode});\n document.dispatchEvent(event);\n }\n }\n if (field === SCATTERPLOT_LASSO_EVENTS.forward) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.forward);\n document.dispatchEvent(event);\n }\n }\n if (field === SCATTERPLOT_LASSO_EVENTS.back) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.back);\n document.dispatchEvent(event);\n }\n }\n }\n\n export(): string {\n console.warn('export not implemented');\n return '';\n // this._updateChart();\n // return renderToString(this.chartRenderer.component);\n }\n\n _needUpdateCalculatedDataBySettings(prevSettings: ScatterplotUmapSettingsImpl, settings: ScatterplotUmapSettingsImpl) {\n return (\n prevSettings.grouping.length !== settings.grouping.length ||\n prevSettings.grouping.some((el, idx) => el.value !== settings.grouping[idx]?.value) ||\n prevSettings.layers.length !== settings.layers.length ||\n prevSettings.layers.some((l, idx) => l.type !== settings.layers[idx].type) ||\n (prevSettings.label?.value || settings.label?.value) && prevSettings.label?.value !== settings.label?.value\n );\n }\n\n _needUpdateCalculatedDataByData(prevData: DataFrame, data: DataFrame) {\n const prevKeys = Object.keys(prevData.data);\n const keys = Object.keys(data.data);\n return (\n prevData.id !== data.id ||\n prevKeys.length !== keys.length ||\n prevKeys.some(key => prevData.data[key].length !== data.data[key]?.length)\n );\n }\n\n _updateData() {\n const {x, y, label, highlight, grouping, layers, inheritedAes} = this.settings;\n\n const dotsExtents = {\n minX: Infinity,\n maxX: -Infinity,\n minY: Infinity,\n maxY: -Infinity,\n };\n\n const hasCurve = layers.some(layer => layer.type === 'curve');\n const groupingKeysSet = new Set<string>();\n const dotsByGrouping:Record<string, Dot[]> = {};\n\n const dots = this.data.rows.reduce((res:Dot[], row, idx) => {\n if (row[x.value] === null || row[y.value] === null) {\n return res;\n }\n const xv = Number(row[x.value]);\n const yv = Number(row[y.value]);\n\n if (xv !== null && xv < dotsExtents.minX) {\n dotsExtents.minX = xv;\n }\n if (xv !== null && xv > dotsExtents.maxX) {\n dotsExtents.maxX = xv;\n }\n if (yv !== null && yv < dotsExtents.minY) {\n dotsExtents.minY = yv;\n }\n if (yv !== null && yv > dotsExtents.maxY) {\n dotsExtents.maxY = yv;\n }\n const labelKey = label?.valueLabels ?? label?.value;\n const dot = {\n x: xv,\n y: yv,\n id: String(idx),\n idx: idx,\n dimmed: highlight ? !row[highlight.value] : false,\n label: labelKey && row[labelKey] ? String(row[labelKey]) : null,\n data: row\n };\n if (hasCurve) {\n const groupingKey = grouping.map(column => row[column.value]).join('_');\n groupingKeysSet.add(groupingKey);\n if (!dotsByGrouping[groupingKey]) {\n dotsByGrouping[groupingKey] = [];\n }\n dotsByGrouping[groupingKey].push(dot);\n\n }\n res.push(dot);\n return res;\n }, []);\n\n if (highlight) {\n dots.sort((d1, d2) => {\n return Number(d2.dimmed) - Number(d1.dimmed);\n });\n }\n\n const groupingKeys = [...groupingKeysSet];\n if (hasCurve) {\n groupingKeys.forEach(key => {\n dotsByGrouping[key].sort((a, b) => a.x - b.x);\n });\n }\n const legendLabels = createLegendInfo(this.data, grouping, layers, inheritedAes);\n\n this.calculatedData = {\n dots,\n dotsByGrouping,\n groupingKeys,\n allPossibleLabels: getAllPossibleLabels(dots),\n dotsExtents,\n legendLabels,\n };\n\n this.chartRenderer.updateData(dots);\n }\n\n _updateAesInData() {\n const calculated = this.calculatedData;\n if (!calculated) {\n return;\n }\n const {layers, inheritedAes, grouping} = this.settings;\n grouping.forEach(column => {\n const usedAes = new Set<keyof AesItem>();\n const usedAesFromPalettes:Partial<Record<keyof AesItem, string[]>> = {}; // if there is palette in mapping then\n layers.forEach(layer => {\n if (layer.aes) {\n Object.entries(layer.aes).forEach(([key, value]) => {\n if (isInheritMapping(value) && value.value === column.value) {\n usedAes.add(key as keyof AesItem);\n if (value.palette) {\n usedAesFromPalettes[key as keyof AesItem] = value.palette;\n }\n }\n });\n }\n });\n calculated.legendLabels[column.value].usedAes = [...usedAes];\n calculated.legendLabels[column.value].aesMap = addPalettesToAesMapping(calculated.legendLabels[column.value].values, usedAesFromPalettes, inheritedAes[column.value]);\n });\n }\n\n _updateChart() {\n if (!this.calculatedData) {\n return;\n }\n const {id, chartSettings, keyColumn, layers, grouping} = this.settings;\n this.chartRenderer.render(\n id,\n chartSettings,\n keyColumn,\n this.calculatedData.dots,\n this.calculatedData.dotsExtents,\n this.calculatedData.dotsByGrouping,\n layers,\n this.calculatedData.legendLabels,\n grouping,\n this.calculatedData.allPossibleLabels,\n this.onPolygonUpdate,\n this.onTooltipHintSwitch,\n this.onLassoControlsStateUpdate\n );\n }\n}\n"],"names":["isInheritMapping","value","LABEL_OFFSET","getAllPossibleLabels","dots","labels","textMeasurer","TextMeasurer","dot","text","metrics","ChartScatterplotUmap","AbstractChart","data","settings","eventHandlers","__publicField","ChartRenderer","ScatterplotUmapSettingsImpl","node","err","previousSettings","previousData","prevLayer","l","currentLayer","field","SCATTERPLOT_LASSO_EVENTS","event","prevSettings","el","idx","_a","_b","_c","_d","prevData","prevKeys","keys","s","key","x","y","label","highlight","grouping","layers","inheritedAes","dotsExtents","hasCurve","layer","groupingKeysSet","dotsByGrouping","res","row","xv","yv","labelKey","groupingKey","column","d1","d2","groupingKeys","a","b","legendLabels","createLegendInfo","calculated","usedAes","usedAesFromPalettes","addPalettesToAesMapping","id","chartSettings","keyColumn"],"mappings":";;;;;;;AAaA,SAASA,EAA8CC,GAA6F;AAChJ,SAAO,OAAOA,KAAU,YAAY,UAAUA,KAASA,EAAM,SAAS;AAC1E;AAEA,MAAMC,IAAe;AACrB,SAASC,EAAqBC,GAAa;AACvC,QAAMC,IAAkB,CAAA,GAClBC,IAAe,IAAIC,EAAa,cAAc;AACpD,aAAWC,KAAOJ,GAAM;AACpB,UAAMK,IAAOD,EAAI;AACjB,QAAI,CAACC;AACD;AAEJ,UAAMC,IAAUJ,EAAa,eAAe,OAAOG,CAAI,CAAC;AACxDJ,IAAAA,EAAO,KAAK;AAAA,MACR,MAAM,OAAOI,CAAI;AAAA,MACjB,QAAOC,KAAA,OAAA,SAAAA,EAAS,UAAS;AAAA,MACzB,UAASA,KAAA,OAAA,SAAAA,EAAS,4BAA2B,OAAMA,KAAA,OAAA,SAAAA,EAAS,6BAA4B;AAAA,MACxF,GAAG;AAAA,MACH,GAAG;AAAA,MACH,WAAW;AAAA,MACX,WAAW;AAAA,MACX,KAAAF;AAAAA,MACA,SAASN;AAAAA,MACT,MAAM,EAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAA;AAAA,MACxC,WAAW,EAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAA;AAAA,IAAA,CACvC;AAAA,EACd;AACA,SAAOG;AACX;AAEO,MAAMM,UAA6BC,EAAc;AAAA,EAiBpD,YAAYC,GAAiBC,GAAmCC,GAA0C;AACtG,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,KAAK;AAAA,MACL,KAAK;AAAA,IAAA;AAAA,EAEb;AACJ;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/scatterplot-umap/index.ts"],"sourcesContent":["import {format} from 'd3-format';\nimport { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport { addPalettesToAesMapping, createLegendInfo } from '../scatterplot/utils/createLegendInfo';\nimport {formatColumnValue} from '../scatterplot/utils/formatColumnValue';\nimport type { AesItem, ContinuousAesFromColumn, InheritAesScatterplot, ScatterplotEventHandlers } from '../types';\nimport type { ScatterplotUmapLegendInfo, ScatterplotUmapSettings } from '../types/scatterplot-umap';\nimport ChartRenderer from './ChartRenderer';\nimport { SCATTERPLOT_LASSO_EVENTS } from './constants';\nimport type { DotsLayer } from './SettingsImpl';\nimport { ScatterplotUmapSettingsImpl } from './SettingsImpl';\nimport type { Dot, DotsExtents, LassoControlsState, LassoMode, Polygon } from './types';\n\nfunction isInheritMapping<T extends (string | number)>(value:T | InheritAesScatterplot | ContinuousAesFromColumn<T>):value is InheritAesScatterplot {\n return typeof value === 'object' && 'type' in value && value.type === 'grouping';\n}\n\nexport class ChartScatterplotUmap extends AbstractChart {\n settings: ScatterplotUmapSettingsImpl;\n chartRenderer: ChartRenderer;\n\n onPolygonUpdate: (data: number[], polygons: Polygon[]) => void = () => undefined; // dots indexes from input data\n onTooltipHintSwitch: (v:boolean) => void = () => undefined;\n onLassoControlsStateUpdate: (v: LassoControlsState) => void = () => undefined;\n\n calculatedData: {\n dots: Dot[],\n groupingKeys: string[],\n dotsByGrouping: Record<string, Dot[]>,\n dotsExtents: DotsExtents,\n legendLabels: ScatterplotUmapLegendInfo\n } | null = null;\n\n constructor(data: DataFrame, settings: ScatterplotUmapSettings, eventHandlers?: ScatterplotEventHandlers) {\n super(data, settings);\n\n this.settings = new ScatterplotUmapSettingsImpl(settings);\n this.chartRenderer = new ChartRenderer();\n\n if (eventHandlers) {\n this.onPolygonUpdate = eventHandlers.onPolygonUpdate;\n this.onTooltipHintSwitch = eventHandlers.onTooltipHintSwitch;\n this.onLassoControlsStateUpdate = eventHandlers.onLassoControlsStateUpdate;\n }\n }\n\n mount(node: HTMLElement) {\n try {\n this.chartRenderer.init(node);\n this._updateData();\n this._updateChart();\n } catch (err) {\n console.error(err);\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n unmount() {\n this.chartRenderer.clear();\n }\n\n updateSettingsAndData(data: DataFrame, settings: ScatterplotUmapSettings) {\n try {\n const previousSettings = this.settings;\n const previousData = this.data;\n this.settings = new ScatterplotUmapSettingsImpl(settings);\n this.data = data;\n if (\n this._needUpdateCalculatedDataBySettings(previousSettings, this.settings) ||\n this._needUpdateCalculatedDataByData(previousData, this.data)\n ) {\n this._updateData();\n } else {\n this._updateAesInData();\n }\n\n // for some reason it's not enough for size updating to do like with fillColor\n const prevLayer = previousSettings.layers.find(l => l.type === 'dots') as DotsLayer;\n const currentLayer = this.settings.layers.find(l => l.type === 'dots') as DotsLayer;\n if (prevLayer && currentLayer && prevLayer.aes.dotSize !== currentLayer.aes.dotSize\n && typeof prevLayer.aes.dotSize === 'number' && typeof currentLayer.aes.dotSize === 'number') {\n this.chartRenderer.updatePointSize();\n }\n this._updateChart();\n } catch (err) {\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n updateChartState(field: string, value: unknown) {\n if (field === 'polygon') {\n this.chartRenderer.polygons = value as Polygon[];\n this._updateChart();\n }\n if (field === SCATTERPLOT_LASSO_EVENTS.delete) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.delete);\n document.dispatchEvent(event);\n }}\n if (field === SCATTERPLOT_LASSO_EVENTS.selectMode) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.selectMode, {detail: value as LassoMode});\n document.dispatchEvent(event);\n }\n }\n if (field === SCATTERPLOT_LASSO_EVENTS.forward) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.forward);\n document.dispatchEvent(event);\n }\n }\n if (field === SCATTERPLOT_LASSO_EVENTS.back) {\n if (document) {\n const event = new CustomEvent(SCATTERPLOT_LASSO_EVENTS.back);\n document.dispatchEvent(event);\n }\n }\n }\n\n export(): string {\n console.warn('export not implemented');\n return '';\n // this._updateChart();\n // return renderToString(this.chartRenderer.component);\n }\n\n _needUpdateCalculatedDataBySettings(prevSettings: ScatterplotUmapSettingsImpl, settings: ScatterplotUmapSettingsImpl) {\n return (\n prevSettings.grouping.length !== settings.grouping.length ||\n prevSettings.grouping.some((el, idx) => el.value !== settings.grouping[idx]?.value) ||\n prevSettings.layers.length !== settings.layers.length ||\n prevSettings.layers.some((l, idx) => l.type !== settings.layers[idx].type) ||\n (prevSettings.label?.value || settings.label?.value) && prevSettings.label?.value !== settings.label?.value\n );\n }\n\n _needUpdateCalculatedDataByData(prevData: DataFrame, data: DataFrame) {\n const prevKeys = Object.keys(prevData.data);\n const keys = Object.keys(data.data);\n return (\n prevData.id !== data.id ||\n prevKeys.length !== keys.length ||\n prevKeys.some(key => prevData.data[key].length !== data.data[key]?.length)\n );\n }\n\n _updateData() {\n const {x, y, label, highlight, grouping, layers, inheritedAes} = this.settings;\n\n const dotsExtents = {\n minX: Infinity,\n maxX: -Infinity,\n minY: Infinity,\n maxY: -Infinity,\n };\n\n const hasCurve = layers.some(layer => layer.type === 'curve');\n const groupingKeysSet = new Set<string>();\n const dotsByGrouping:Record<string, Dot[]> = {};\n\n const dots: Dot[] = [];\n const labelFormatter = label?.format ? format(label.format) : undefined;\n\n for (let idx = 0; idx < this.data.rowsCount; idx++) {\n const xv = this.data.getColumnValue(x.value, idx);\n const yv = this.data.getColumnValue(y.value, idx);\n\n if (typeof xv !== 'number' || typeof yv !== 'number') {\n continue;\n }\n\n if (xv < dotsExtents.minX) {\n dotsExtents.minX = xv;\n }\n if (xv > dotsExtents.maxX) {\n dotsExtents.maxX = xv;\n }\n if (yv < dotsExtents.minY) {\n dotsExtents.minY = yv;\n }\n if (yv > dotsExtents.maxY) {\n dotsExtents.maxY = yv;\n }\n\n const dimmed = highlight ? !this.data.getColumnValue(highlight.value, idx) : false;\n const dot: Dot = {\n x: xv,\n y: yv,\n idx,\n label: formatColumnValue(this.data, idx, label, labelFormatter),\n dimmed\n };\n if (hasCurve) {\n const groupingKey = grouping.map(column => this.data.getColumnValue(column.value, idx)).join('_');\n groupingKeysSet.add(groupingKey);\n if (!dotsByGrouping[groupingKey]) {\n dotsByGrouping[groupingKey] = [];\n }\n dotsByGrouping[groupingKey].push(dot);\n\n }\n dots.push(dot);\n }\n\n if (highlight) {\n dots.sort((d1, d2) => {\n if (d2.dimmed === d1.dimmed) return 0;\n if (d2.dimmed) return 1;\n return -1;\n });\n }\n\n const groupingKeys = [...groupingKeysSet];\n if (hasCurve) {\n groupingKeys.forEach(key => {\n dotsByGrouping[key].sort((a, b) => a.x - b.x);\n });\n }\n const legendLabels = createLegendInfo(this.data, grouping, layers, inheritedAes);\n\n this.calculatedData = {\n dots,\n dotsByGrouping,\n groupingKeys,\n dotsExtents,\n legendLabels,\n };\n }\n\n _updateAesInData() {\n const calculated = this.calculatedData;\n if (!calculated) {\n return;\n }\n const {layers, inheritedAes, grouping} = this.settings;\n grouping.forEach(column => {\n const usedAes = new Set<keyof AesItem>();\n const usedAesFromPalettes:Partial<Record<keyof AesItem, string[]>> = {}; // if there is palette in mapping then\n layers.forEach(layer => {\n if (!layer.aes) return;\n \n Object.entries(layer.aes).forEach(([key, value]) => {\n if (!(isInheritMapping(value) && value.value === column.value)) return;\n usedAes.add(key as keyof AesItem);\n if (value.palette) {\n usedAesFromPalettes[key as keyof AesItem] = value.palette;\n }\n });\n });\n\n calculated.legendLabels[column.value].usedAes = [...usedAes];\n calculated.legendLabels[column.value].aesMap = addPalettesToAesMapping(column, usedAesFromPalettes, inheritedAes[column.value]);\n });\n }\n\n _updateChart() {\n if (!this.calculatedData) {\n return;\n }\n const {id, chartSettings, keyColumn, layers, grouping} = this.settings;\n this.chartRenderer.render(\n this.data,\n id,\n chartSettings,\n keyColumn,\n this.calculatedData.dots,\n this.calculatedData.dotsExtents,\n this.calculatedData.dotsByGrouping,\n layers,\n this.calculatedData.legendLabels,\n grouping,\n this.onPolygonUpdate,\n this.onTooltipHintSwitch,\n this.onLassoControlsStateUpdate\n );\n }\n}\n"],"names":["isInheritMapping","value","ChartScatterplotUmap","AbstractChart","data","settings","eventHandlers","__publicField","ScatterplotUmapSettingsImpl","ChartRenderer","node","err","previousSettings","previousData","prevLayer","l","currentLayer","field","SCATTERPLOT_LASSO_EVENTS","event","prevSettings","el","idx","_a","_b","_c","_d","prevData","prevKeys","keys","n","key","x","y","label","highlight","grouping","layers","inheritedAes","dotsExtents","hasCurve","layer","groupingKeysSet","dotsByGrouping","dots","labelFormatter","format","xv","yv","dimmed","dot","formatColumnValue","groupingKey","column","d1","d2","groupingKeys","a","b","legendLabels","createLegendInfo","calculated","usedAes","usedAesFromPalettes","addPalettesToAesMapping","id","chartSettings","keyColumn"],"mappings":";;;;;;;;AAaA,SAASA,EAA8CC,GAA6F;AAChJ,SAAO,OAAOA,KAAU,YAAY,UAAUA,KAASA,EAAM,SAAS;AAC1E;AAEO,MAAMC,UAA6BC,EAAc;AAAA,EAgBpD,YAAYC,GAAiBC,GAAmCC,GAA0C;AACtG,UAAMF,GAAMC,CAAQ,GAhBxBE,EAAA,MAAA,UAAA,GACAA,EAAA,MAAA,eAAA,GAEAA,EAAA,yBAAiE,MAAA;AAAA,IAAA,CAAA,GACjEA,EAAA,6BAA2C,MAAA;AAAA,IAAA,CAAA,GAC3CA,EAAA,oCAA8D,MAAA;AAAA,IAAA,CAAA,GAE9DA,EAAA,MAAA,kBAMW,IAAA,GAKP,KAAK,WAAW,IAAIC,EAA4BH,CAAQ,GACxD,KAAK,gBAAgB,IAAII,EAAAA,GAErBH,MACA,KAAK,k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CAACV,GAAK9B,CAAK,MAAM;AAC1CD,YAAiBC,CAAK,KAAKA,EAAM,UAAUoD,EAAO,UACxDS,EAAQ,IAAI/B,CAAoB,GAC5B9B,EAAM,YACN8D,EAAoBhC,CAAoB,IAAI9B,EAAM;AAAA,QAE1D,CAAC;AAAA,MACL,CAAC,GAED4D,EAAW,aAAaR,EAAO,KAAK,EAAE,UAAU,CAAC,GAAGS,CAAO,GAC3DD,EAAW,aAAaR,EAAO,KAAK,EAAE,SAASW,EAAwBX,GAAQU,GAAqBzB,EAAae,EAAO,KAAK,CAAC;AAAA,IAClI,CAAC;AAAA,EACL;AAAA,EAEA,eAAe;AACX,QAAI,CAAC,KAAK;AACN;AAEJ,UAAM,EAAC,IAAAY,GAAI,eAAAC,GAAe,WAAAC,GAAW,QAAA9B,GAAQ,UAAAD,EAAAA,IAAY,KAAK;AAC9D,SAAK,cAAc;AAAA,MACf,KAAK;AAAA,MACL6B;AAAAA,MACAC;AAAAA,MACAC;AAAAA,MACA,KAAK,eAAe;AAAA,MACpB,KAAK,eAAe;AAAA,MACpB,KAAK,eAAe;AAAA,MACpB9B;AAAAA,MACA,KAAK,eAAe;AAAA,MACpBD;AAAAA,MACA,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,IAAA;AAAA,EAEb;AACJ;","x_google_ignoreList":[0]}
|
|
@@ -28,6 +28,8 @@ const c = e.union([e.string(), e.number(), e.null()]), t = [
|
|
|
28
28
|
], i = e.enum(t), l = ["solid", "dashed", "dotted", "dotdash", "longdash", "twodash"], n = e.enum(l), r = ["left", "bottom", "left-bottom", "full", "empty"], g = e.enum(r), s = ["inside", "right", "top", "bottom"], b = e.enum(s), u = ["left", "center", "right"], h = e.enum(u), a = e.object({
|
|
29
29
|
type: e.literal("column"),
|
|
30
30
|
value: e.string(),
|
|
31
|
+
format: e.optional(e.string()),
|
|
32
|
+
// d3 format
|
|
31
33
|
label: e.optional(e.string()),
|
|
32
34
|
valueLabels: e.optional(e.string())
|
|
33
35
|
}), m = e.object({
|
|
@@ -75,7 +77,7 @@ const L = e.object({
|
|
|
75
77
|
});
|
|
76
78
|
export {
|
|
77
79
|
m as AesItemSchema,
|
|
78
|
-
d as
|
|
80
|
+
d as AesRecordSchema,
|
|
79
81
|
L as AxisSettingsSchema,
|
|
80
82
|
a as ColumnNameSchema,
|
|
81
83
|
c as DataValueSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/common.ts"],"sourcesContent":["import type {LassoControlsState, Polygon} from '../scatterplot-umap/types';\nimport type {CategoricalAesFromColumn, ContinuousAesFromColumn} from './scatterplot';\
|
|
1
|
+
{"version":3,"file":"common.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/common.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { LassoControlsState, Polygon } from '../scatterplot-umap/types';\nimport type { CategoricalAesFromColumn, ContinuousAesFromColumn } from './scatterplot';\n\nexport type DataValue = string | number | null;\nexport type Category = string;\nexport const DataValueSchema = z.union([z.string(), z.number(), z.null()]);\n\nexport type Row = Record<string, DataValue>\n\nexport type Color = string;\n\n// numbered according ggplot2 symbols, 19 (third size of black circle) is missed\nexport const POINT_SHAPE = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n '13',\n '14',\n '15',\n '16',\n '17',\n '18',\n '20',\n '21',\n '22',\n '23',\n '24',\n '25',\n] as const;\nexport const PointShapeSchema = z.enum(POINT_SHAPE);\nexport type PointShape = z.infer<typeof PointShapeSchema>;\n\nconst LINE_SHAPE = ['solid', 'dashed', 'dotted', 'dotdash', 'longdash', 'twodash'] as const;\nexport const LineShapeSchema = z.enum(LINE_SHAPE);\nexport type LineShape = z.infer<typeof LineShapeSchema>;\n\nconst FRAME_TYPE = ['left', 'bottom', 'left-bottom', 'full', 'empty'] as const;\nexport const FrameTypeSchema = z.enum(FRAME_TYPE);\nexport type FrameType = z.infer<typeof FrameTypeSchema>;\n\nconst LEGEND_POSITION = ['inside', 'right', 'top', 'bottom'] as const;\nexport const LegendPositionSchema = z.enum(LEGEND_POSITION);\nexport type LegendPosition = z.infer<typeof LegendPositionSchema>;\n\nexport const TITLE_POSITION = ['left', 'center', 'right'] as const;\nexport const TitlePositionSchema = z.enum(TITLE_POSITION);\nexport type TitlePosition = z.infer<typeof TitlePositionSchema>;\n\nexport const ColumnNameSchema = z.object({\n type: z.literal('column'),\n value: z.string(),\n format: z.optional(z.string()), // d3 format\n label: z.optional(z.string()),\n valueLabels: z.optional(z.string())\n});\nexport type ColumnName = z.infer<typeof ColumnNameSchema>\n\nexport type AesItem = {\n fillColor?: Color;\n lineColor?: Color;\n lineWidth?: number;\n lineShape?: LineShape;\n dotShape?: PointShape;\n dotSize?: number;\n dotFill?: Color;\n};\nexport const AesItemSchema = z.object({\n fillColor: z.optional(z.string()),\n lineColor: z.optional(z.string()),\n lineWidth: z.optional(z.number()),\n lineShape: z.optional(LineShapeSchema),\n dotShape: z.optional(PointShapeSchema),\n dotSize: z.optional(z.number()),\n dotFill: z.optional(z.string()),\n});\n\nexport const AesRecordSchema = z.record(AesItemSchema);\nexport type AesRecord = z.infer<typeof AesRecordSchema>;\n\nexport function categoricalAesMappingFromValueSchema<ValueType extends z.ZodTypeAny>(\n valueSchema: ValueType,\n) {\n return z.object({\n columnName: ColumnNameSchema,\n valuesMap: z.record(valueSchema),\n });\n}\nexport function continuousAesMappingFromValueSchema<ValueType extends z.ZodTypeAny>(\n valueSchema: ValueType,\n) {\n return z.object({\n columnName: ColumnNameSchema,\n domain: z.array(z.number()),\n range: z.array(valueSchema),\n type: z.optional(z.union([z.literal('linear'), z.literal('log')]))\n });\n}\n\nexport function isCategoricalAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType> | unknown\n): item is CategoricalAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return item !== null && 'valuesMap' in item;\n}\n\nexport function isContinuousAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType> | unknown\n): item is ContinuousAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return item !== null && 'domain' in item && 'range' in item;\n}\n\nexport type AxisSettings = {\n title?: string | ColumnName;\n scale?: 'linear' | 'log';\n showGrid?: boolean;\n // for discrete X axis - lines between groups, to improve groups recognizing\n linesBetweenCategories?: boolean;\n showTicks?: boolean;\n labelsPosition?: 'center' | '45deg' | '90deg';\n significantLines?: number[],\n significantLinesStyle?: LineShape,\n symmetricRange?: number // to get some value perfectly in the middle of axis\n upperValue?: number // limits\n lowerValue?: number\n};\n\nexport const AxisSettingsSchema = z.object({\n title: z.optional(z.union([z.string(), ColumnNameSchema])),\n scale: z.optional(z.union([z.literal('linear'), z.literal('log')])),\n showGrid: z.optional(z.boolean()),\n linesBetweenCategories: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n labelsPosition: z.optional(z.union([z.literal('center'), z.literal('45deg'), z.literal('90deg')])),\n significantLines: z.optional(z.array(z.number())),\n significantLinesStyle: z.optional(LineShapeSchema),\n symmetricRange: z.optional(z.number()),\n upperValue: z.optional(z.number()),\n lowerValue: z.optional(z.number()),\n hiddenLabels: z.optional(z.boolean())\n});\n\nexport interface SettingsInterface {\n type: string;\n}\n\nexport type ClickEventData = {\n x: number;\n y: number;\n info: unknown;\n}\n\nexport type PolygonData = [number, number][];\n\nexport type ChartEventHandlers<T> = T;\nexport type DendroEventHandlers = ChartEventHandlers<[(d:ClickEventData) => void]>\nexport type ScatterplotEventHandlers = ChartEventHandlers<{\n onPolygonUpdate: (d:number[], p: Polygon[]) => void;\n onTooltipHintSwitch: (d:boolean) => void;\n onLassoStateChange: () => void;\n onLassoControlsStateUpdate: (v:LassoControlsState) => void;\n}>\nexport type BubbleEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type DiscreteEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type HeatmapEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type HistogramEventHandlers = ChartEventHandlers<[(d:boolean) => void]>"],"names":["DataValueSchema","z","POINT_SHAPE","PointShapeSchema","LINE_SHAPE","LineShapeSchema","FRAME_TYPE","FrameTypeSchema","LEGEND_POSITION","LegendPositionSchema","TITLE_POSITION","TitlePositionSchema","ColumnNameSchema","AesItemSchema","AesRecordSchema","categoricalAesMappingFromValueSchema","valueSchema","continuousAesMappingFromValueSchema","isCategoricalAes","item","isContinuousAes","AxisSettingsSchema"],"mappings":";AAMO,MAAMA,IAAkBC,EAAE,MAAM,CAACA,EAAE,OAAA,GAAUA,EAAE,OAAA,GAAUA,EAAE,KAAA,CAAM,CAAC,GAO5DC,IAAc;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GACaC,IAAmBF,EAAE,KAAKC,CAAW,GAG5CE,IAAa,CAAC,SAAS,UAAU,UAAU,WAAW,YAAY,SAAS,GACpEC,IAAkBJ,EAAE,KAAKG,CAAU,GAG1CE,IAAa,CAAC,QAAQ,UAAU,eAAe,QAAQ,OAAO,GACvDC,IAAkBN,EAAE,KAAKK,CAAU,GAG1CE,IAAkB,CAAC,UAAU,SAAS,OAAO,QAAQ,GAC9CC,IAAuBR,EAAE,KAAKO,CAAe,GAG7CE,IAAiB,CAAC,QAAQ,UAAU,OAAO,GAC3CC,IAAsBV,EAAE,KAAKS,CAAc,GAG3CE,IAAmBX,EAAE,OAAO;AAAA,EACrC,MAAMA,E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Q,WAAWA;AAC3D;AAiBO,MAAME,IAAqBpB,EAAE,OAAO;AAAA,EACvC,OAAOA,EAAE,SAASA,EAAE,MAAM,CAACA,EAAE,OAAA,GAAUW,CAAgB,CAAC,CAAC;AAAA,EACzD,OAAOX,EAAE,SAASA,EAAE,MAAM,CAACA,EAAE,QAAQ,QAAQ,GAAGA,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC;AAAA,EAClE,UAAUA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EAChC,wBAAwBA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EAC9C,WAAWA,EAAE,SAASA,EAAE,QAAA,CAAS;AAAA,EACjC,gBAAgBA,EAAE,SAASA,EAAE,MAAM,CAACA,EAAE,QAAQ,QAAQ,GAAGA,EAAE,QAAQ,OAAO,GAAGA,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC;AAAA,EACjG,kBAAkBA,EAAE,SAASA,EAAE,MAAMA,EAAE,OAAA,CAAQ,CAAC;AAAA,EAChD,uBAAuBA,EAAE,SAASI,CAAe;AAAA,EACjD,gBAAgBJ,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,EACrC,YAAYA,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,EACjC,YAAYA,EAAE,SAASA,EAAE,OAAA,CAAQ;AAAA,EACjC,cAAcA,EAAE,SAASA,EAAE,QAAA,CAAS;AACxC,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ColumnNameSchema as n, categoricalAesMappingFromValueSchema as e, continuousAesMappingFromValueSchema as a, LineShapeSchema as t, PointShapeSchema as i, LegendPositionSchema as l, TitlePositionSchema as p } from "./common.js";
|
|
2
1
|
import o from "../node_modules/zod/lib/index.js";
|
|
2
|
+
import { ColumnNameSchema as n, categoricalAesMappingFromValueSchema as e, continuousAesMappingFromValueSchema as a, LineShapeSchema as t, PointShapeSchema as i, LegendPositionSchema as l, TitlePositionSchema as p } from "./common.js";
|
|
3
3
|
const r = o.enum(["discrete", "continuous", "stringSource"]), c = o.object({
|
|
4
4
|
type: o.literal("dendro"),
|
|
5
5
|
title: o.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dendro.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/dendro.ts"],"sourcesContent":["import {\n type AesItem, type
|
|
1
|
+
{"version":3,"file":"dendro.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/types/dendro.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n type AesItem, type AesRecord,\n categoricalAesMappingFromValueSchema,\n ColumnNameSchema,\n continuousAesMappingFromValueSchema,\n LegendPositionSchema,\n LineShapeSchema,\n PointShapeSchema,\n TitlePositionSchema\n} from './common';\n\nconst ValueTypeSchema = z.enum(['discrete', 'continuous', 'stringSource']);\n\nexport const DendroSettingsSchema = z.object({\n type: z.literal('dendro'),\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n size: z.optional(\n z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n scale: z.optional(z.number()),\n minCellWidth: z.optional(z.number()),\n minCellHeight: z.optional(z.number()),\n maxCellWidth: z.optional(z.number()),\n maxCellHeight: z.optional(z.number()),\n })\n ),\n mode: z.optional(z.union([z.literal('normal'), z.literal('useAllNodesAsLeaves')])),\n leavesMode: z.optional(z.union([z.literal('normal'), z.literal('alignLeavesToLine')])),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n facetSettings: z.optional(\n z.object({\n nRows: z.optional(z.number()),\n nCols: z.optional(z.number()),\n })\n ),\n id: ColumnNameSchema,\n parentId: ColumnNameSchema,\n height: z.optional(ColumnNameSchema), // if height is not defined it is not considered in links length calculations\n labels: z.optional(ColumnNameSchema),\n facetBy: z.optional(z.array(ColumnNameSchema)),\n heatmapAnnotation: z.optional(ColumnNameSchema),\n heatmapAxis: z.optional(ColumnNameSchema),\n heatmapGroup: z.optional(z.array(ColumnNameSchema)),\n heatmapSettings: z.optional(z.object({\n valueType: z.optional(ValueTypeSchema),\n aes: z.optional(z.object({\n colorsList: z.optional(z.array(z.string())),\n colorsMap: z.optional(z.record(z.string()))\n }))\n })),\n\n connectionType: z.optional(z.union([z.literal('rectangle'), z.literal('line'), z.literal('curve')])),\n edgeInheritance: z.optional(z.union([z.literal('up'), z.literal('down')])),\n showNodes: z.optional(z.boolean()),\n showEdges: z.optional(z.boolean()),\n showLeavesLabels: z.optional(z.boolean()),\n showNodesLabels: z.optional(z.boolean()),\n rootPosition: z.optional(z.union([z.literal('left'), z.literal('top')])),\n\n aes: z.optional(\n z.object({\n nodeShape: z.optional(z.union([PointShapeSchema, categoricalAesMappingFromValueSchema(PointShapeSchema)])),\n nodeColor: z.optional(\n z.union([\n z.string(),\n categoricalAesMappingFromValueSchema(z.string()),\n continuousAesMappingFromValueSchema(z.string()),\n ])\n ),\n nodeSize: z.optional(z.union([\n z.number(),\n categoricalAesMappingFromValueSchema(z.number()),\n continuousAesMappingFromValueSchema(z.number()),\n ])),\n\n lineShape: z.optional(LineShapeSchema),\n lineColor: z.optional(z.union([\n z.string(),\n categoricalAesMappingFromValueSchema(z.string()),\n continuousAesMappingFromValueSchema(z.string()),\n ])),\n })\n ),\n});\n\nexport type DendroSettings = z.infer<typeof DendroSettingsSchema>;\n\nexport type DendroLegendInfo = Record<\n string,\n {\n values: string[];\n usedAes: (keyof AesItem)[];\n aesMap: AesRecord;\n labels: Record<string, string>;\n }\n>;\n"],"names":["ValueTypeSchema","z","DendroSettingsSchema","TitlePositionSchema","LegendPositionSchema","ColumnNameSchema","PointShapeSchema","categoricalAesMappingFromValueSchema","continuousAesMappingFromValueSchema","LineShapeSchema"],"mappings":";;AAYA,MAAMA,IAAkBC,EAAE,KAAK,CAAC,YAAY,cAAc,cAAc,CAAC,GAE5DC,IAAuBD,EAAE,OAAO;AAAA,EACzC,MAAMA,EAAE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AA,MACL,WAAWA,EAAE,SAASA,EAAE,MAAM,CAACK,GAAkBC,EAAqCD,CAAgB,CAAC,CAAC,CAAC;AAAA,MACzG,WAAWL,EAAE;AAAA,QACTA,EAAE,MAAM;AAAA,UACJA,EAAE,OAAA;AAAA,UACFM,EAAqCN,EAAE,QAAQ;AAAA,UAC/CO,EAAoCP,EAAE,OAAA,CAAQ;AAAA,QAAA,CACjD;AAAA,MAAA;AAAA,MAEL,UAAUA,EAAE,SAASA,EAAE,MAAM;AAAA,QACzBA,EAAE,OAAA;AAAA,QACFM,EAAqCN,EAAE,QAAQ;AAAA,QAC/CO,EAAoCP,EAAE,OAAA,CAAQ;AAAA,MAAA,CACjD,CAAC;AAAA,MAEF,WAAWA,EAAE,SAASQ,CAAe;AAAA,MACrC,WAAWR,EAAE,SAASA,EAAE,MAAM;AAAA,QAC1BA,EAAE,OAAA;AAAA,QACFM,EAAqCN,EAAE,QAAQ;AAAA,QAC/CO,EAAoCP,EAAE,OAAA,CAAQ;AAAA,MAAA,CACjD,CAAC;AAAA,IAAA,CACL;AAAA,EAAA;AAET,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LineShapeSchema as t, PointShapeSchema as e, ColumnNameSchema as i, DataValueSchema as a, AxisSettingsSchema as l, TitlePositionSchema as p, AesMapSchema as r, FrameTypeSchema as m, LegendPositionSchema as s } from "./common.js";
|
|
2
1
|
import o from "../node_modules/zod/lib/index.js";
|
|
2
|
+
import { LineShapeSchema as t, PointShapeSchema as e, ColumnNameSchema as i, DataValueSchema as a, AxisSettingsSchema as l, TitlePositionSchema as p, AesRecordSchema as r, FrameTypeSchema as m, LegendPositionSchema as s } from "./common.js";
|
|
3
3
|
const n = o.object({ type: o.enum(["primaryGrouping", "secondaryGrouping"]) }), u = o.object({
|
|
4
4
|
type: o.literal("box"),
|
|
5
5
|
stat: o.optional(
|