@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":"Heatmap.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/Heatmap.tsx"],"sourcesContent":["import {Tooltip} from '../../common/Tooltip';\nimport {BLACK} from '../../constants';\nimport type {
|
|
1
|
+
{"version":3,"file":"Heatmap.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/Heatmap.tsx"],"sourcesContent":["import type { HierarchyPointNode } from 'd3-hierarchy';\nimport { useState } from 'react';\nimport { Tooltip } from '../../common/Tooltip';\nimport { BLACK } from '../../constants';\nimport type { DataValue } from '../../types';\nimport { COLOR_EMPTY, DIMMED_OPACITY, HEATMAP_LEFT_OFFSET, MARGIN } from '../constants';\nimport type { HeatmapData } from '../getHeatmapData';\nimport type { TreeNodeData } from '../getHierarchyData';\nimport type { Cell, ChartScales, ChartSizes } from './types';\n\nfunction formatCellValue(v: DataValue): number | string {\n if (v === null) {\n return 'null';\n }\n if (typeof v === 'number') {\n const whole = Math.floor(v);\n const decimal = v - whole;\n return whole + Number(decimal.toPrecision(2));\n }\n return v;\n}\n\nfunction getTooltipContent(cell: Cell, labels:Record<string, string>) {\n return [`X: ${labels[cell.x]}`, `Node: ${cell.y}`, `Value: ${formatCellValue(cell.value)}`];\n}\n\nexport function Heatmap({\n heatmapData,\n scales,\n step,\n colorScale,\n tooltipsContainer,\n chartSizes,\n selectedNode,\n labels\n}: {\n heatmapData: HeatmapData;\n scales: ChartScales;\n step: {x: number; y: number};\n colorScale: (value: DataValue) => string;\n chartSizes: ChartSizes;\n tooltipsContainer: Element | null;\n selectedNode: HierarchyPointNode<TreeNodeData> | null,\n labels: string[]\n}) {\n const {xKeys, yKeys, cells, meta} = heatmapData;\n const [selectedCell, setSelectedCell] = useState<Cell | null>(null);\n const sideDistances = {\n left: chartSizes.treeWidth + HEATMAP_LEFT_OFFSET + MARGIN.LEFT,\n right: chartSizes.heatmapWidth + MARGIN.RIGHT,\n top: MARGIN.TOP,\n bottom: chartSizes.heatmapHeight + MARGIN.BOTTOM,\n };\n return (\n <g onMouseLeave={() => setSelectedCell(null)}>\n {labels.length && (\n <g transform={'translate(0,-8)'} >\n {xKeys.map((key, idx) => (\n <text x={scales.x(key) + 2} key={key} fontWeight=\"500\">\n <title>{meta.xLabels[key]}</title>\n {labels[idx]}\n </text>\n ))}\n </g>\n )}\n {/* cells */}\n {xKeys.map(xKey =>\n yKeys.map(yKey => {\n const cell = cells?.[xKey]?.[yKey];\n return (\n <rect\n key={cell ? cell.id : `${xKey}_${yKey}`}\n x={scales.x(xKey)}\n y={scales.y(yKey)}\n width={step.x}\n height={step.y}\n stroke=\"white\"\n strokeWidth=\"1px\"\n fill={cell ? colorScale(cell?.value) : COLOR_EMPTY}\n onMouseOver={() => {\n if (cell?.value !== null && typeof cell?.value !== 'undefined') {\n setSelectedCell(cell);\n } else {\n setSelectedCell(null);\n }\n }}\n opacity={selectedNode && selectedNode.data.rawIndexes[0] !== cell?.idx ? DIMMED_OPACITY : 1}\n />\n );\n })\n )}\n {labels.length && (\n <line x1=\"0\" x2={chartSizes.heatmapWidth} y1=\"0\" y2=\"0\" stroke={BLACK} strokeWidth=\"1px\"/>\n )}\n {selectedCell && tooltipsContainer && (\n <Tooltip\n content={getTooltipContent(selectedCell, heatmapData.meta.xLabels)}\n x={scales.x(selectedCell.x) + step.x / 2}\n y={scales.y(selectedCell.y) + step.y / 2}\n offset={xKeys.length > 1 ? step.x / 2 : 0}\n active={true}\n fixed={false}\n sideDistances={sideDistances}\n container={tooltipsContainer}\n />\n )}\n </g>\n );\n}\n"],"names":["formatCellValue","v","whole","decimal","getTooltipContent","cell","labels","Heatmap","heatmapData","scales","step","colorScale","tooltipsContainer","chartSizes","selectedNode","xKeys","yKeys","cells","meta","selectedCell","setSelectedCell","useState","sideDistances","HEATMAP_LEFT_OFFSET","MARGIN","i","jsx","key","idx","jsxs","xKey","yKey","_a","COLOR_EMPTY","DIMMED_OPACITY","BLACK","Tooltip"],"mappings":";;;;;AAUA,SAASA,EAAgBC,GAA+B;AACpD,MAAIA,MAAM;AACN,WAAO;AAEX,MAAI,OAAOA,KAAM,UAAU;AACvB,UAAMC,IAAQ,KAAK,MAAMD,CAAC,GACpBE,IAAUF,IAAIC;AACpB,WAAOA,IAAQ,OAAOC,EAAQ,YAAY,CAAC,CAAC;AAAA,EAChD;AACA,SAAOF;AACX;AAEA,SAASG,EAAkBC,GAAYC,GAA+B;AAClE,SAAO,CAAC,MAAMA,EAAOD,EAAK,CAAC,CAAC,IAAI,SAASA,EAAK,CAAC,IAAI,UAAUL,EAAgBK,EAAK,KAAK,CAAC,EAAE;AAC9F;AAEO,SAASE,EAAQ;AAAA,EACpB,aAAAC;AAAAA,EACA,QAAAC;AAAAA,EACA,MAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA,mBAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA,cAAAC;AAAAA,EACA,QAAAR;AACJ,GASG;AACC,QAAM,EAAC,OAAAS,GAAO,OAAAC,GAAO,OAAAC,GAAO,MAAAC,EAAAA,IAAQV,GAC9B,CAACW,GAAcC,CAAe,IAAIC,EAAAA,SAAsB,IAAI,GAC5DC,IAAgB;AAAA,IACl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N,KAAgBA,EAAa,KAAK,WAAW,CAAC,OAAMT,KAAA,OAAA,SAAAA,EAAM,OAAM6B,IAAiB;AAAA,UAAA;AAAA,UAfrF7B,IAAOA,EAAK,KAAK,GAAGyB,CAAI,IAAIC,CAAI;AAAA,QAAA;AAAA,MAkBjD,CAAC;AAAA,IAAA;AAAA,IAEJzB,EAAO,UACJoB,gBAAAA,MAAC,QAAA,EAAK,IAAG,KAAI,IAAIb,EAAW,cAAc,IAAG,KAAI,IAAG,KAAI,QAAQsB,GAAO,aAAY,OAAK;AAAA,IAE3FhB,KAAgBP,KACbc,gBAAAA,EAAAA;AAAAA,MAACU;AAAAA,MAAA;AAAA,QACG,SAAShC,EAAkBe,GAAcX,EAAY,KAAK,OAAO;AAAA,QACjE,GAAGC,EAAO,EAAEU,EAAa,CAAC,IAAIT,EAAK,IAAI;AAAA,QACvC,GAAGD,EAAO,EAAEU,EAAa,CAAC,IAAIT,EAAK,IAAI;AAAA,QACvC,QAAQK,EAAM,SAAS,IAAIL,EAAK,IAAI,IAAI;AAAA,QACxC,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,eAAAY;AAAAA,QACA,WAAWV;AAAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGvB;AAER;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/Legend.tsx"],"sourcesContent":["import {BLACK} from '../../constants';\nimport type {DotAesItem, LegendData, LegendItemContinuous} from './types';\nimport {getPointShape} from '../../utils/getPointShape';\nimport React from 'react';\n\nconst COLOR_ITEM_WIDTH_C = 14;\nconst COLOR_ITEM_SIZE_D = 12;\nconst LEGEND_ITEM_SIZE = 12;\nconst TITLE_POSITION = -12;\n\ninterface LegendProps {\n legendData: LegendData;\n}\n\nfunction AesItem({aes, label}: {aes: DotAesItem; label: string}) {\n const shape = getPointShape(aes.shape, aes.size, aes.color);\n\n return (\n <g>\n <g transform={`translate(${LEGEND_ITEM_SIZE / 2},${LEGEND_ITEM_SIZE / 2})`}>{shape}</g>\n <text x={LEGEND_ITEM_SIZE + 8} y={LEGEND_ITEM_SIZE / 2} dominantBaseline=\"central\" fontWeight={500}>\n {label}\n </text>\n </g>\n );\n}\n\nexport function Legend({legendData}: LegendProps) {\n const debug = false;\n const continuousItems= legendData.items.filter((item) => item.type === 'continuous') as LegendItemContinuous[];\n return (\n <g>\n <defs>\n {continuousItems.map(item => (\n <linearGradient key={item.id} id={item.id} gradientTransform=\"rotate(90)\">\n {item.scale.domain().map(value => {\n const domain = item.scale.domain();\n const range = domain[domain.length - 1] - domain[0];\n const percent = range > 0 ? (value - domain[0]) / range * 100 : 0;\n return (\n <stop\n key={value}\n offset={`${percent}%`}\n stopColor={item.scale(value)}\n />\n );\n })}\n </linearGradient>\n ))}\n </defs>\n {legendData.items.map(item => {\n if (item.type === 'continuous') {\n const min = Math.min(...item.values);\n const max = Math.max(...item.values);\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`}>\n <text fontWeight={500} fontSize=\"14px\" y={TITLE_POSITION}>{item.title}</text>\n <rect\n x=\"0\"\n y=\"0\"\n width={COLOR_ITEM_WIDTH_C}\n height={item.height}\n stroke={BLACK}\n fill={`url(#${item.id})`}\n />\n <g transform={`translate(${COLOR_ITEM_WIDTH_C},0)`}>\n {item.values.map(value => {\n const range = max - min;\n const y = range > 0 ? (item.height * (value - min)) / range : 0;\n return (\n <g key={value} transform={`translate(0,${y})`}>\n <line x1=\"0\" x2={-4} stroke={BLACK} />\n <text x={8} y={4}>{value}</text>\n </g>\n );\n })}\n </g>\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\"/>}\n </g>\n );\n }\n if (item.type === 'discrete') {\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`}>\n <text fontWeight={500} fontSize=\"14px\" y={TITLE_POSITION}>{item.title}</text>\n {item.values.map((value, idx) => {\n return <g key={value} transform={`translate(0, ${idx * (COLOR_ITEM_SIZE_D + 4)})`}>\n <rect\n x=\"0\"\n y=\"0\"\n width={COLOR_ITEM_SIZE_D}\n height={COLOR_ITEM_SIZE_D}\n fill={item.scale(value)}\n rx=\"1\"\n ry=\"1\"\n />\n <text x={COLOR_ITEM_SIZE_D + 8} y={10}>{value}</text>\n </g>;\n })}\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\"/>}\n </g>\n );\n }\n if (item.type === 'nodes') {\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`} fontSize=\"14px\" fontWeight={500}>\n <text fontWeight={500} y={TITLE_POSITION}>\n {item.title}\n </text>\n {item.values.map((value, idx) => {\n return (\n <g key={value} transform={`translate(0, ${idx * (LEGEND_ITEM_SIZE + 4)})`}>\n <AesItem aes={item.scale(value)} label={item.labels[value]} />\n </g>\n );\n })}\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\" />}\n </g>\n );\n }\n if (item.type === 'size') {\n const size = item.height / item.values.length;\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`} fontSize=\"14px\" fontWeight={500}>\n <text fontWeight={500} y={TITLE_POSITION}>\n {item.title}\n </text>\n {item.values.map((value, idx) => {\n const r = item.scale(value);\n return (\n <g key={value} transform={`translate(0, ${idx * size})`}>\n <circle r={r} cx={size / 2} cy={size / 2} fill={BLACK}/>\n <text x={size + 4} y={size / 2} alignmentBaseline=\"central\">{item.labels[value]}</text>\n </g>\n );\n })}\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\" />}\n </g>\n );\n }\n })}\n </g>\n );\n}\n"],"names":["COLOR_ITEM_WIDTH_C","COLOR_ITEM_SIZE_D","LEGEND_ITEM_SIZE","TITLE_POSITION","AesItem","aes","label","shape","getPointShape","n","jsx","Legend","legendData","continuousItems","item","value","domain","range","percent","min","max","jsxs","t","BLACK","y","idx","size","r"],"mappings":";;;AAKA,MAAMA,IAAqB,IACrBC,IAAoB,IACpBC,IAAmB,IACn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,EAYb;AAGR,UAAIA,EAAK,SAAS,QAAQ;AACtB,cAAMY,IAAOZ,EAAK,SAASA,EAAK,OAAO;AACvC,eACIO,gBAAAA,EAAAA,KAAC,KAAA,EAAgB,WAAW,aAAaP,EAAK,IAAI,IAAIA,EAAK,GAAG,KAAK,UAAS,QAAO,YAAY,KAC3F,UAAA;AAAA,UAAAJ,gBAAAA,MAAC,QAAA,EAAK,YAAY,KAAK,GAAGP,GACrB,YAAK,MAAA,CACV;AAAA,UACCW,EAAK,OAAO,IAAI,CAACC,GAAOU,MAAQ;AAC7B,kBAAME,IAAIb,EAAK,MAAMC,CAAK;AAC1B,mBAAAN,gBAAAA,EAAA,KACK,KAAA,EAAc,WAAW,gBAAgBgB,IAAMC,CAAI,KAChD,UAAA;AAAA,cAAAhB,gBAAAA,EAAAA,IAAC,UAAA,EAAO,GAAAiB,GAAM,IAAID,IAAO,GAAG,IAAIA,IAAO,GAAG,MAAMH,GAAM;AAAA,cACtDb,gBAAAA,EAAAA,IAAC,QAAA,EAAK,GAAGgB,IAAO,GAAG,GAAGA,IAAO,GAAG,mBAAkB,WAAW,UAAAZ,EAAK,OAAOC,CAAK,GAAE;AAAA,YAAA,EAAA,GAF5EA,CAGR;AAAA,UAER,CAAC;AAAA,UACA;AAAA,QAAA,EAAkF,GAb/ED,EAAK,EAcb;AAAA,MAER;AAAA,IACJ,CAAC;AAAA,EAAA,GACL;AAER;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"Legend.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/Legend.tsx"],"sourcesContent":["import { BLACK } from '../../constants';\nimport { getPointShape } from '../../utils/getPointShape';\nimport type { DotAesItem, LegendData, LegendItemContinuous } from './types';\n\nconst COLOR_ITEM_WIDTH_C = 14;\nconst COLOR_ITEM_SIZE_D = 12;\nconst LEGEND_ITEM_SIZE = 12;\nconst TITLE_POSITION = -12;\n\ninterface LegendProps {\n legendData: LegendData;\n}\n\nfunction AesItem({aes, label}: {aes: DotAesItem; label: string}) {\n const shape = getPointShape(aes.shape, aes.size, aes.color);\n\n return (\n <g>\n <g transform={`translate(${LEGEND_ITEM_SIZE / 2},${LEGEND_ITEM_SIZE / 2})`}>{shape}</g>\n <text x={LEGEND_ITEM_SIZE + 8} y={LEGEND_ITEM_SIZE / 2} dominantBaseline=\"central\" fontWeight={500}>\n {label}\n </text>\n </g>\n );\n}\n\nexport function Legend({legendData}: LegendProps) {\n const debug = false;\n const continuousItems= legendData.items.filter((item) => item.type === 'continuous') as LegendItemContinuous[];\n return (\n <g>\n <defs>\n {continuousItems.map(item => (\n <linearGradient key={item.id} id={item.id} gradientTransform=\"rotate(90)\">\n {item.scale.domain().map(value => {\n const domain = item.scale.domain();\n const range = domain[domain.length - 1] - domain[0];\n const percent = range > 0 ? (value - domain[0]) / range * 100 : 0;\n return (\n <stop\n key={value}\n offset={`${percent}%`}\n stopColor={item.scale(value)}\n />\n );\n })}\n </linearGradient>\n ))}\n </defs>\n {legendData.items.map(item => {\n if (item.type === 'continuous') {\n const min = Math.min(...item.values);\n const max = Math.max(...item.values);\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`}>\n <text fontWeight={500} fontSize=\"14px\" y={TITLE_POSITION}>{item.title}</text>\n <rect\n x=\"0\"\n y=\"0\"\n width={COLOR_ITEM_WIDTH_C}\n height={item.height}\n stroke={BLACK}\n fill={`url(#${item.id})`}\n />\n <g transform={`translate(${COLOR_ITEM_WIDTH_C},0)`}>\n {item.values.map(value => {\n const range = max - min;\n const y = range > 0 ? (item.height * (value - min)) / range : 0;\n return (\n <g key={value} transform={`translate(0,${y})`}>\n <line x1=\"0\" x2={-4} stroke={BLACK} />\n <text x={8} y={4}>{value}</text>\n </g>\n );\n })}\n </g>\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\"/>}\n </g>\n );\n }\n if (item.type === 'discrete') {\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`}>\n <text fontWeight={500} fontSize=\"14px\" y={TITLE_POSITION}>{item.title}</text>\n {item.values.map((value, idx) => {\n return <g key={value} transform={`translate(0, ${idx * (COLOR_ITEM_SIZE_D + 4)})`}>\n <rect\n x=\"0\"\n y=\"0\"\n width={COLOR_ITEM_SIZE_D}\n height={COLOR_ITEM_SIZE_D}\n fill={item.scale(value)}\n rx=\"1\"\n ry=\"1\"\n />\n <text x={COLOR_ITEM_SIZE_D + 8} y={10}>{value}</text>\n </g>;\n })}\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\"/>}\n </g>\n );\n }\n if (item.type === 'nodes') {\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`} fontSize=\"14px\" fontWeight={500}>\n <text fontWeight={500} y={TITLE_POSITION}>\n {item.title}\n </text>\n {item.values.map((value, idx) => {\n return (\n <g key={value} transform={`translate(0, ${idx * (LEGEND_ITEM_SIZE + 4)})`}>\n <AesItem aes={item.scale(value)} label={item.labels[value]} />\n </g>\n );\n })}\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\" />}\n </g>\n );\n }\n if (item.type === 'size') {\n const size = item.height / item.values.length;\n return (\n <g key={item.id} transform={`translate(${item.left},${item.top})`} fontSize=\"14px\" fontWeight={500}>\n <text fontWeight={500} y={TITLE_POSITION}>\n {item.title}\n </text>\n {item.values.map((value, idx) => {\n const r = item.scale(value);\n return (\n <g key={value} transform={`translate(0, ${idx * size})`}>\n <circle r={r} cx={size / 2} cy={size / 2} fill={BLACK}/>\n <text x={size + 4} y={size / 2} alignmentBaseline=\"central\">{item.labels[value]}</text>\n </g>\n );\n })}\n {debug && <rect width={item.width} height={item.height} fill=\"none\" stroke=\"black\" />}\n </g>\n );\n }\n })}\n </g>\n );\n}\n"],"names":["COLOR_ITEM_WIDTH_C","COLOR_ITEM_SIZE_D","LEGEND_ITEM_SIZE","TITLE_POSITION","AesItem","aes","label","shape","getPointShape","n","jsx","Legend","legendData","continuousItems","item","value","domain","range","percent","min","max","jsxs","t","BLACK","y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CAAG,EAAA,GADxDA,CAER,CAEP;AAAA,UACA;AAAA,QAAA,EAAkF,GAX/ED,EAAK,EAYb;AAGR,UAAIA,EAAK,SAAS,QAAQ;AACtB,cAAMY,IAAOZ,EAAK,SAASA,EAAK,OAAO;AACvC,eACIO,gBAAAA,EAAAA,KAAC,KAAA,EAAgB,WAAW,aAAaP,EAAK,IAAI,IAAIA,EAAK,GAAG,KAAK,UAAS,QAAO,YAAY,KAC3F,UAAA;AAAA,UAAAJ,gBAAAA,MAAC,QAAA,EAAK,YAAY,KAAK,GAAGP,GACrB,YAAK,MAAA,CACV;AAAA,UACCW,EAAK,OAAO,IAAI,CAACC,GAAOU,MAAQ;AAC7B,kBAAME,IAAIb,EAAK,MAAMC,CAAK;AAC1B,mBAAAN,gBAAAA,EAAA,KACK,KAAA,EAAc,WAAW,gBAAgBgB,IAAMC,CAAI,KAChD,UAAA;AAAA,cAAAhB,gBAAAA,EAAAA,IAAC,UAAA,EAAO,GAAAiB,GAAM,IAAID,IAAO,GAAG,IAAIA,IAAO,GAAG,MAAMH,GAAM;AAAA,cACtDb,gBAAAA,EAAAA,IAAC,QAAA,EAAK,GAAGgB,IAAO,GAAG,GAAGA,IAAO,GAAG,mBAAkB,WAAW,UAAAZ,EAAK,OAAOC,CAAK,GAAE;AAAA,YAAA,EAAA,GAF5EA,CAGR;AAAA,UAER,CAAC;AAAA,UACA;AAAA,QAAA,EAAkF,GAb/ED,EAAK,EAcb;AAAA,MAER;AAAA,IACJ,CAAC;AAAA,EAAA,GACL;AAER;","x_google_ignoreList":[0]}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as a } from "../../node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { SELECTED_PATH_COLOR as u } from "../constants.js";
|
|
3
3
|
import { link as y } from "../../node_modules/d3-shape/src/link.js";
|
|
4
4
|
import { bumpY as m, bumpX as p } from "../../node_modules/d3-shape/src/curve/bump.js";
|
|
5
|
-
function L(n,
|
|
6
|
-
const { source:
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
).x((
|
|
5
|
+
function L(n, s, $) {
|
|
6
|
+
const { source: t, target: r } = n, o = $ === "top";
|
|
7
|
+
return s === "rectangle" ? o ? `M ${t.x},${t.y} L ${r.x},${t.y} L${r.x},${r.y}` : `M ${t.y},${t.x} L ${t.y},${r.x} L${r.y},${r.x}` : s === "curve" ? y(
|
|
8
|
+
o ? m : p
|
|
9
|
+
).x((e) => o ? e.x : e.y).y((e) => o ? e.y : e.x).source((e) => e.target).target((e) => e.source)(n) ?? "" : o ? `M ${t.x},${t.y} L${r.x},${r.y}` : `M ${t.y},${t.x} L${r.y},${r.x}`;
|
|
10
10
|
}
|
|
11
11
|
function h({
|
|
12
12
|
links: n,
|
|
13
|
-
connectionType:
|
|
14
|
-
rootPosition:
|
|
15
|
-
edgeInheritance:
|
|
16
|
-
aesGetters:
|
|
17
|
-
selected:
|
|
13
|
+
connectionType: s,
|
|
14
|
+
rootPosition: $,
|
|
15
|
+
edgeInheritance: t,
|
|
16
|
+
aesGetters: r,
|
|
17
|
+
selected: o
|
|
18
18
|
}) {
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
const { source: i, target: x } =
|
|
21
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ a.jsx(a.Fragment, { children: n.map((e) => {
|
|
20
|
+
const { source: i, target: x } = e, c = (t === "up" ? i : x).data.rawIndexes[0];
|
|
21
|
+
return /* @__PURE__ */ a.jsx(
|
|
22
22
|
"path",
|
|
23
23
|
{
|
|
24
|
-
d: L(
|
|
25
|
-
stroke:
|
|
26
|
-
strokeWidth:
|
|
24
|
+
d: L(e, s, $),
|
|
25
|
+
stroke: o ? u : r.lineColor(c),
|
|
26
|
+
strokeWidth: o ? 2 : 1,
|
|
27
27
|
fill: "none"
|
|
28
28
|
},
|
|
29
|
-
`${
|
|
29
|
+
`${e.source.id},${e.target.id}`
|
|
30
30
|
);
|
|
31
31
|
}) });
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinksGroup.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/LinksGroup.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"LinksGroup.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/LinksGroup.tsx"],"sourcesContent":["import type { HierarchyPointLink, HierarchyPointNode } from 'd3-hierarchy';\nimport { curveBumpX, curveBumpY, link as d3link } from 'd3-shape';\nimport { SELECTED_PATH_COLOR } from '../constants';\nimport type { DendroSettingsImpl } from '../DendroSettingsImpl';\nimport type { TreeNodeData } from '../getHierarchyData';\n\ninterface LinksGroupProps {\n links: HierarchyPointLink<TreeNodeData>[];\n connectionType: DendroSettingsImpl['connectionType'];\n rootPosition: DendroSettingsImpl['rootPosition'];\n edgeInheritance: DendroSettingsImpl['edgeInheritance'];\n aesGetters: {\n nodeShape: (idx: number) => string;\n nodeColor: (idx: number) => string;\n nodeSize: (idx: number) => number;\n lineShape: (idx: number) => string;\n lineColor: (idx: number) => string;\n };\n selected: boolean;\n}\n\nfunction getLinkPath(\n link: HierarchyPointLink<TreeNodeData>,\n connectionType: DendroSettingsImpl['connectionType'],\n rootPosition: DendroSettingsImpl['rootPosition']\n): string {\n const {source, target} = link;\n const isVertical = rootPosition === 'top';\n if (connectionType === 'rectangle') {\n return isVertical\n ? `M ${source.x},${source.y} L ${target.x},${source.y} L${target.x},${target.y}`\n : `M ${source.y},${source.x} L ${source.y},${target.x} L${target.y},${target.x}`;\n }\n if (connectionType === 'curve') {\n return (\n d3link<HierarchyPointLink<TreeNodeData>, HierarchyPointNode<TreeNodeData>>(\n isVertical ? curveBumpY : curveBumpX\n )\n .x(d => (isVertical ? d.x : d.y))\n .y(d => (isVertical ? d.y : d.x))\n .source(d => d.target)\n .target(d => d.source)(link) ?? ''\n );\n }\n return isVertical\n ? `M ${source.x},${source.y} L${target.x},${target.y}`\n : `M ${source.y},${source.x} L${target.y},${target.x}`;\n}\n\nexport function LinksGroup({\n links,\n connectionType,\n rootPosition,\n edgeInheritance,\n aesGetters,\n selected,\n}: LinksGroupProps) {\n return (\n <>\n {links.map(link => {\n const {source, target} = link;\n const aesNode = edgeInheritance === 'up' ? source : target;\n const idx = aesNode.data.rawIndexes[0];\n return (\n <path\n key={`${link.source.id},${link.target.id}`}\n d={getLinkPath(link, connectionType, rootPosition)}\n stroke={selected ? SELECTED_PATH_COLOR : aesGetters.lineColor(idx)}\n strokeWidth={selected ? 2 : 1}\n fill=\"none\"\n />\n );\n })}\n </>\n );\n}\n"],"names":["getLinkPath","link","connectionType","rootPosition","source","target","isVertical","d3link","curveBumpY","curveBumpX","d","LinksGroup","links","edgeInheritance","aesGetters","selected","jsx","Fragment","idx","SELECTED_PATH_COLOR"],"mappings":";;;;AAqBA,SAASA,EACLC,GACAC,GACAC,GACM;AACN,QAAM,EAAC,QAAAC,GAAQ,QAAAC,MAAUJ,GACnBK,IAAaH,MAAiB;AACpC,SAAID,MAAmB,cACZI,IACD,KAAKF,EAAO,CAAC,IAAIA,EAAO,CAAC,MAAMC,EAAO,CAAC,IAAID,EAAO,CAAC,KAAKC,EAAO,CAAC,IAAIA,EAAO,CAAC,KAC5E,KAAKD,EAAO,CAAC,IAAIA,EAAO,CAAC,MAAMA,EAAO,CAAC,IAAIC,EAAO,CAAC,KAAKA,EAAO,CAAC,IAAIA,EAAO,CAAC,KAElFH,MAAmB,UAEfK;AAAAA,IACID,IAAaE,IAAaC;AAAAA,EAAAA,EAEzB,EAAE,CAAAC,MAAMJ,IAAaI,EAAE,IAAIA,EAAE,CAAE,EAC/B,EAAE,CAAAA,MAAMJ,IAAaI,EAAE,IAAIA,EAAE,CAAE,EAC/B,OAAO,CAAAA,MAAKA,EAAE,MAAM,EACpB,OAAO,CAAAA,MAAKA,EAAE,MAAM,EAAET,CAAI,KAAK,KAGrCK,IACD,KAAKF,EAAO,CAAC,IAAIA,EAAO,CAAC,KAAKC,EAAO,CAAC,IAAIA,EAAO,CAAC,KAClD,KAAKD,EAAO,CAAC,IAAIA,EAAO,CAAC,KAAKC,EAAO,CAAC,IAAIA,EAAO,CAAC;AAC5D;AAEO,SAASM,EAAW;AAAA,EACvB,OAAAC;AAAAA,EACA,gBAAAV;AAAAA,EACA,cAAAC;AAAAA,EACA,iBAAAU;AAAAA,EACA,YAAAC;AAAAA,EACA,UAAAC;AACJ,GAAoB;AAChB,SACIC,gBAAAA,EAAAA,IAAAC,EAAAA,UAAA,EACK,UAAAL,EAAM,IAAI,CAAAX,MAAQ;AACf,UAAM,EAAC,QAAAG,GAAQ,QAAAC,MAAUJ,GAEnBiB,KADUL,MAAoB,OAAOT,IAASC,GAChC,KAAK,WAAW,CAAC;AACrC,WACIW,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QAEG,GAAGhB,EAAYC,GAAMC,GAAgBC,CAAY;AAAA,QACjD,QAAQY,IAAWI,IAAsBL,EAAW,UAAUI,CAAG;AAAA,QACjE,aAAaH,IAAW,IAAI;AAAA,QAC5B,MAAK;AAAA,MAAA;AAAA,MAJA,GAAGd,EAAK,OAAO,EAAE,IAAIA,EAAK,OAAO,EAAE;AAAA,IAAA;AAAA,EAOpD,CAAC,GACL;AAER;","x_google_ignoreList":[0]}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import { getPointShape as
|
|
4
|
-
import {
|
|
1
|
+
import { j as o } from "../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { r as f } from "../../_virtual/index.js";
|
|
3
|
+
import { getPointShape as L } from "../../utils/getPointShape.js";
|
|
4
|
+
import { DIMMED_OPACITY as O, SELECTED_NODE_COLOR as y, MARGIN as x } from "../constants.js";
|
|
5
5
|
const C = 12;
|
|
6
|
-
function
|
|
6
|
+
function P({
|
|
7
7
|
nodes: p,
|
|
8
8
|
rootPosition: g,
|
|
9
9
|
showLeavesLabels: j,
|
|
10
|
-
showNodesLabels:
|
|
11
|
-
aesGetters:
|
|
10
|
+
showNodesLabels: I,
|
|
11
|
+
aesGetters: s,
|
|
12
12
|
selectedNodeId: u,
|
|
13
13
|
onClick: h,
|
|
14
14
|
onSelectedUpdate: m
|
|
15
15
|
}) {
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
}, [u]), /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
16
|
+
const t = g === "top", [w, d] = f.useState(null);
|
|
17
|
+
return f.useEffect(() => {
|
|
18
|
+
d(null);
|
|
19
|
+
}, [u]), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
20
|
+
/* @__PURE__ */ o.jsx("g", { children: p.map((e) => {
|
|
21
|
+
const n = e.data.rawIndexes[0], l = s.nodeSize(n), r = s.nodeColor(n), a = t ? e.x : e.y, i = t ? e.y : e.x;
|
|
22
|
+
return /* @__PURE__ */ o.jsx(
|
|
23
23
|
"g",
|
|
24
24
|
{
|
|
25
|
-
transform: `translate(${
|
|
25
|
+
transform: `translate(${a},${i})`,
|
|
26
26
|
style: { cursor: "pointer" },
|
|
27
27
|
onClick: (c) => {
|
|
28
|
-
c.stopPropagation(), h({ x:
|
|
28
|
+
c.stopPropagation(), h({ x: a + x.LEFT, y: i + x.TOP, info: e.data.rawIndexes }), m(e);
|
|
29
29
|
},
|
|
30
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ o.jsx("g", { children: /* @__PURE__ */ o.jsx(
|
|
31
31
|
"circle",
|
|
32
32
|
{
|
|
33
33
|
cx: 0,
|
|
34
34
|
cy: 0,
|
|
35
35
|
r: l + C,
|
|
36
|
-
fill: u === e.id ?
|
|
37
|
-
opacity:
|
|
38
|
-
onMouseOver: () =>
|
|
39
|
-
onMouseLeave: () =>
|
|
36
|
+
fill: u === e.id ? y : w === e.id ? r : "transparent",
|
|
37
|
+
opacity: O,
|
|
38
|
+
onMouseOver: () => d(e.id ?? null),
|
|
39
|
+
onMouseLeave: () => d(null)
|
|
40
40
|
}
|
|
41
41
|
) })
|
|
42
42
|
},
|
|
43
43
|
e.id
|
|
44
44
|
);
|
|
45
45
|
}) }),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ o.jsx("g", { children: p.map((e) => {
|
|
47
|
+
const n = e.data.rawIndexes[0], l = s.nodeShape(n), r = s.nodeSize(n), a = s.nodeColor(n), i = t ? e.x : e.y, c = t ? e.y : e.x;
|
|
48
|
+
return /* @__PURE__ */ o.jsx(
|
|
49
49
|
"g",
|
|
50
50
|
{
|
|
51
|
-
transform: `translate(${
|
|
51
|
+
transform: `translate(${i},${c})`,
|
|
52
52
|
style: { cursor: "pointer" },
|
|
53
53
|
onClick: (E) => {
|
|
54
|
-
E.stopPropagation(), h({ x:
|
|
54
|
+
E.stopPropagation(), h({ x: i + x.LEFT, y: c + x.TOP, info: e.data.rawIndexes }), m(e);
|
|
55
55
|
},
|
|
56
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ o.jsx(
|
|
57
57
|
"g",
|
|
58
58
|
{
|
|
59
|
-
onMouseOver: () =>
|
|
60
|
-
onMouseLeave: () =>
|
|
61
|
-
children:
|
|
59
|
+
onMouseOver: () => d(e.id ?? null),
|
|
60
|
+
onMouseLeave: () => d(null),
|
|
61
|
+
children: L(l, r, u === e.id ? y : a)
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
64
|
},
|
|
65
65
|
e.id
|
|
66
66
|
);
|
|
67
67
|
}) }),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
const
|
|
70
|
-
return /* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ o.jsx("g", { children: p.map((e) => {
|
|
69
|
+
const n = e.data.rawIndexes[0], l = s.nodeSize(n), r = t ? e.x : e.y, a = t ? e.y : e.x;
|
|
70
|
+
return /* @__PURE__ */ o.jsx(
|
|
71
71
|
"g",
|
|
72
72
|
{
|
|
73
|
-
transform: `translate(${r},${
|
|
73
|
+
transform: `translate(${r},${a})`,
|
|
74
74
|
style: { pointerEvents: "none" },
|
|
75
|
-
children: (
|
|
75
|
+
children: (I && e.children || j && !e.children) && /* @__PURE__ */ o.jsx(
|
|
76
76
|
"text",
|
|
77
77
|
{
|
|
78
78
|
x: l + 4,
|
|
@@ -90,6 +90,6 @@ function $({
|
|
|
90
90
|
] });
|
|
91
91
|
}
|
|
92
92
|
export {
|
|
93
|
-
|
|
93
|
+
P as NodesGroup
|
|
94
94
|
};
|
|
95
95
|
//# sourceMappingURL=NodesGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodesGroup.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/NodesGroup.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"NodesGroup.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/dendro/components/NodesGroup.tsx"],"sourcesContent":["import type { HierarchyPointNode } from 'd3-hierarchy';\nimport { useEffect, useState } from 'react';\nimport type { ClickEventData, PointShape } from '../../types';\nimport { getPointShape } from '../../utils/getPointShape';\nimport { DIMMED_OPACITY, MARGIN, SELECTED_NODE_COLOR } from '../constants';\nimport type { DendroSettingsImpl } from '../DendroSettingsImpl';\nimport type { TreeNodeData } from '../getHierarchyData';\n\ninterface NodeGroupProps {\n nodes: HierarchyPointNode<TreeNodeData>[];\n rootPosition: DendroSettingsImpl['rootPosition'];\n showLeavesLabels: DendroSettingsImpl['showLeavesLabels'];\n showNodesLabels: DendroSettingsImpl['showNodesLabels'];\n aesGetters: {\n nodeShape: (idx: number) => string;\n nodeColor: (idx: number) => string;\n nodeSize: (idx: number) => number;\n lineShape: (idx: number) => string;\n lineColor: (idx: number) => string;\n };\n onClick: (data: ClickEventData) => void;\n onSelectedUpdate: (node: HierarchyPointNode<TreeNodeData>) => void;\n selectedNodeId?: string;\n}\n\nconst SELECTED_NODE_HIGHLIGHT_WIDTH = 12;\n\nexport function NodesGroup({\n nodes,\n rootPosition,\n showLeavesLabels,\n showNodesLabels,\n aesGetters,\n selectedNodeId,\n onClick,\n onSelectedUpdate,\n}: NodeGroupProps) {\n const isVertical = rootPosition === 'top';\n const [hoveredNodeId, setHoveredNodeId] = useState<string | null>(null);\n useEffect(() => {\n setHoveredNodeId(null);\n }, [selectedNodeId]);\n return (\n <>\n <g>\n {nodes.map(node => {\n const idx = node.data.rawIndexes[0];\n const size = aesGetters.nodeSize(idx);\n const color = aesGetters.nodeColor(idx);\n const x = isVertical ? node.x : node.y;\n const y = isVertical ? node.y : node.x;\n return (\n <g\n key={node.id}\n transform={`translate(${x},${y})`}\n style={{cursor: 'pointer'}}\n onClick={e => {\n e.stopPropagation();\n onClick({x: x + MARGIN.LEFT, y: y + MARGIN.TOP, info: node.data.rawIndexes});\n onSelectedUpdate(node);\n }}\n >\n <g>\n <circle\n cx={0}\n cy={0}\n r={size + SELECTED_NODE_HIGHLIGHT_WIDTH}\n fill={\n selectedNodeId === node.id\n ? SELECTED_NODE_COLOR\n : hoveredNodeId === node.id\n ? color\n : 'transparent'\n }\n opacity={DIMMED_OPACITY}\n onMouseOver={() => setHoveredNodeId(node.id ?? null)}\n onMouseLeave={() => setHoveredNodeId(null)}\n />\n </g>\n </g>\n );\n })}\n </g>\n <g>\n {nodes.map(node => {\n const idx = node.data.rawIndexes[0];\n const shape = aesGetters.nodeShape(idx) as PointShape;\n const size = aesGetters.nodeSize(idx);\n const color = aesGetters.nodeColor(idx);\n const x = isVertical ? node.x : node.y;\n const y = isVertical ? node.y : node.x;\n return (\n <g\n key={node.id}\n transform={`translate(${x},${y})`}\n style={{cursor: 'pointer'}}\n onClick={e => {\n e.stopPropagation();\n onClick({x: x + MARGIN.LEFT, y: y + MARGIN.TOP, info: node.data.rawIndexes});\n onSelectedUpdate(node);\n }}\n >\n <g\n onMouseOver={() => setHoveredNodeId(node.id ?? null)}\n onMouseLeave={() => setHoveredNodeId(null)}\n >\n {getPointShape(shape, size, selectedNodeId === node.id ? SELECTED_NODE_COLOR : color)}\n </g>\n </g>\n );\n })}\n </g>\n <g>\n {nodes.map(node => {\n const idx = node.data.rawIndexes[0];\n const size = aesGetters.nodeSize(idx);\n const x = isVertical ? node.x : node.y;\n const y = isVertical ? node.y : node.x;\n return (\n <g\n key={node.id}\n transform={`translate(${x},${y})`}\n style={{pointerEvents: 'none'}}\n >\n {((showNodesLabels && node.children) || (showLeavesLabels && !node.children)) && (\n <text\n x={size + 4}\n y=\"4\"\n paintOrder=\"stroke\"\n stroke=\"white\"\n strokeWidth=\"3\"\n >\n {node.data.label}\n </text>\n )}\n </g>\n );\n })}\n </g>\n </>\n );\n}\n"],"names":["SELECTED_NODE_HIGHLIGHT_WIDTH","NodesGroup","nodes","rootPosition","showLeavesLabels","showNodesLabels","aesGetters","selectedNodeId","onClick","onSelectedUpdate","isVertical","hoveredNodeId","setHoveredNodeId","useState","useEffect","jsxs","Fragment","jsx","node","idx","size","color","x","y","e","MARGIN","t","SELECTED_NODE_COLOR","DIMMED_OPACITY","shape","g"],"mappings":";;;;AAyBA,MAAMA,IAAgC;AAE/B,SAASC,EAAW;AAAA,EACvB,OAAAC;AAAAA,EACA,cAAAC;AAAAA,EACA,kBAAAC;AAAAA,EACA,iBAAAC;AAAAA,EACA,YAAAC;AAAAA,EACA,gBAAAC;AAAAA,EACA,SAAAC;AAAAA,EACA,kBAAAC;AACJ,GAAmB;AACf,QAAMC,IAAaP,MAAiB,OAC9B,CAACQ,GAAeC,CAAgB,IAAIC,EAAAA,SAAwB,IAAI;AACtEC,SAAAA,EAAAA,UAAU,MAAM;AACZF,IAAAA,EAAiB,IAAI;AAAA,EACzB,GAAG,CAACL,CAAc,CAAC,GAEfQ,gBAAAA,EAAAA,KAAAC,EAAAA,UAAA,EACI,UAAA;AAAA,IAAAC,gBAAAA,EAAAA,IAAC,KAAA,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G,GAAGG,IAAO;AAAA,cACV,GAAE;AAAA,cACF,YAAW;AAAA,cACX,QAAO;AAAA,cACP,aAAY;AAAA,cAEX,YAAK,KAAK;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAZdF,EAAK;AAAA,MAAA;AAAA,IAiBtB,CAAC,GACL;AAAA,EAAA,GACJ;AAER;","x_google_ignoreList":[0]}
|
|
@@ -1,73 +1,77 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function G(t, x, m, d, S, n, g) {
|
|
2
|
+
return x === "stringSource" ? h(t, m, n, g) : V(t, x, m, d, S, n, g);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
if (!
|
|
4
|
+
function V(t, x, m, d, S, n, g) {
|
|
5
|
+
if (!m || !d)
|
|
6
6
|
return null;
|
|
7
|
-
const
|
|
7
|
+
const K = g.leaves().map((l) => String(t.getColumnValue(n.value, l.data.rawIndexes[0]))), e = {
|
|
8
8
|
xKeys: [],
|
|
9
9
|
xGroupKeys: [],
|
|
10
10
|
xKeysByGroups: {},
|
|
11
|
-
yKeys:
|
|
11
|
+
yKeys: K,
|
|
12
12
|
cells: {},
|
|
13
13
|
meta: {
|
|
14
14
|
valueExtent: [1 / 0, -1 / 0],
|
|
15
15
|
uniqueValues: /* @__PURE__ */ new Set(),
|
|
16
16
|
xLabels: {}
|
|
17
17
|
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
throw Error(`More than 1 value for x=${
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
e.meta.xLabels[
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
}, p = m, v = S, u = d, r = n, y = /* @__PURE__ */ new Set(), o = {}, s = /* @__PURE__ */ new Set();
|
|
19
|
+
for (let l = 0; l < t.rowsCount; l++) {
|
|
20
|
+
const i = v.length ? v.map((w) => String(t.getColumnValue(w.value, l))).join("_") : "null";
|
|
21
|
+
let a = t.getColumnValue(u.value, l), c = t.getColumnValue(r.value, l);
|
|
22
|
+
if (a === null || c === null)
|
|
23
|
+
continue;
|
|
24
|
+
a = String(a), c = String(c), o[i] || (o[i] = /* @__PURE__ */ new Set(), s.add(i)), y.add(a), o[i].add(a), e.cells[a] || (e.cells[a] = {});
|
|
25
|
+
const f = t.getColumnValue(p.value, l);
|
|
26
|
+
if (x === "discrete" && e.meta.uniqueValues.add(String(f)), x === "continuous" && (e.meta.valueExtent[0] = Math.min(f, e.meta.valueExtent[0]), e.meta.valueExtent[1] = Math.max(f, e.meta.valueExtent[1])), e.cells[a][c] && f !== f)
|
|
27
|
+
throw Error(`More than 1 value for x=${a}, y=${c}`);
|
|
28
|
+
const C = String(
|
|
29
|
+
t.getColumnValue(u.valueLabels ?? u.value, l)
|
|
30
|
+
);
|
|
31
|
+
if (e.meta.xLabels[a] && C !== e.meta.xLabels[a])
|
|
32
|
+
throw Error(`More than 1 x-label value for x=${a}`);
|
|
33
|
+
e.meta.xLabels[a] = C, e.cells[a][c] = {
|
|
34
|
+
idx: l,
|
|
35
|
+
id: `${a}_${c}`,
|
|
36
|
+
x: a,
|
|
34
37
|
y: c,
|
|
35
|
-
value:
|
|
36
|
-
data: a
|
|
38
|
+
value: t.getColumnValue(p.value, l)
|
|
37
39
|
};
|
|
38
|
-
}
|
|
40
|
+
}
|
|
41
|
+
return e.xGroupKeys = [...s], e.xKeysByGroups = [...s].reduce((l, i) => (l[i] = [...o[i]], l), {}), e.xKeys = e.xGroupKeys.reduce((l, i) => (l = l.concat(e.xKeysByGroups[i]), l), []), e;
|
|
39
42
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
43
|
+
function h(t, x, m, d) {
|
|
44
|
+
if (!x)
|
|
42
45
|
return null;
|
|
43
|
-
const
|
|
46
|
+
const S = d.leaves().map((u) => String(t.getColumnValue(m.value, u.data.rawIndexes[0]))), n = {
|
|
44
47
|
xKeys: [],
|
|
45
48
|
xGroupKeys: [],
|
|
46
49
|
xKeysByGroups: {},
|
|
47
|
-
yKeys:
|
|
50
|
+
yKeys: S,
|
|
48
51
|
cells: {},
|
|
49
52
|
meta: {
|
|
50
53
|
valueExtent: [1 / 0, -1 / 0],
|
|
51
54
|
uniqueValues: /* @__PURE__ */ new Set(),
|
|
52
55
|
xLabels: {}
|
|
53
56
|
}
|
|
54
|
-
},
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
const r =
|
|
58
|
-
let y =
|
|
57
|
+
}, g = x, K = m, e = { null: /* @__PURE__ */ new Set() }, p = ["null"];
|
|
58
|
+
let v = 0;
|
|
59
|
+
for (let u = 0; u < t.rowsCount; u++) {
|
|
60
|
+
const r = t.getColumnValue(g.value, u);
|
|
61
|
+
let y = t.getColumnValue(K.value, u);
|
|
59
62
|
if (!(r === null || y === null)) {
|
|
60
63
|
y = String(y);
|
|
61
|
-
for (let
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
e.null.add(
|
|
64
|
+
for (let o = 0; o < r.length; o++) {
|
|
65
|
+
v = Math.max(v, r.length);
|
|
66
|
+
const s = String(o), l = r[o];
|
|
67
|
+
e.null.add(s), n.meta.uniqueValues.add(l), n.meta.xLabels[s] = s, n.cells[s] || (n.cells[s] = {}), n.cells[s][y] = { idx: u, id: `${s}_${y}`, x: s, y, value: l };
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
}
|
|
70
|
+
}
|
|
71
|
+
return n.xGroupKeys = p, n.xKeysByGroups = p.reduce((u, r) => (u[r] = [...e[r]], u), {}), n.xKeys = new Array(v).fill(null).map((u, r) => String(r)), n;
|
|
68
72
|
}
|
|
69
73
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
G as getHeatmapData,
|
|
75
|
+
V as getHeatmapDataWithAxisColumn
|
|
72
76
|
};
|
|
73
77
|
//# sourceMappingURL=getHeatmapData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHeatmapData.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/dendro/getHeatmapData.ts"],"sourcesContent":["import type {DataFrame} from '../DataFrame';\nimport type {DendroSettingsImpl} from './DendroSettingsImpl';\nimport type {TreeNodeData} from './getHierarchyData';\nimport type {Cell} from './components/types';\nimport type {HierarchyNode} from 'd3-hierarchy';\n\nexport type HeatmapData = {\n xKeys: string[];\n yKeys: string[];\n xGroupKeys: string[];\n xKeysByGroups: Record<string, string[]>;\n cells: Record<string, Record<string, Cell>>;\n meta: {\n valueExtent: [number, number];\n uniqueValues: Set<string>;\n xLabels: Record<string, string>;\n };\n};\n\nexport function getHeatmapData(\n data:DataFrame,\n type: DendroSettingsImpl['heatmapSettings']['valueType'],\n heatmapAnnotation: DendroSettingsImpl['heatmapAnnotation'],\n heatmapAxis: DendroSettingsImpl['heatmapAxis'],\n heatmapGroup: DendroSettingsImpl['heatmapGroup'],\n id: DendroSettingsImpl['id'],\n hierarchy: HierarchyNode<TreeNodeData>\n) {\n return type === 'stringSource'\n ? getHeatmapDataByStringSource(data, heatmapAnnotation, id, hierarchy)\n : getHeatmapDataWithAxisColumn(data, type, heatmapAnnotation, heatmapAxis, heatmapGroup, id, hierarchy);\n}\nexport function getHeatmapDataWithAxisColumn(\n data:DataFrame,\n type: DendroSettingsImpl['heatmapSettings']['valueType'],\n heatmapAnnotation: DendroSettingsImpl['heatmapAnnotation'],\n heatmapAxis: DendroSettingsImpl['heatmapAxis'],\n heatmapGroup: DendroSettingsImpl['heatmapGroup'],\n id: DendroSettingsImpl['id'],\n hierarchy: HierarchyNode<TreeNodeData>\n) : HeatmapData | null {\n if (!heatmapAnnotation || !heatmapAxis) {\n return null;\n }\n const yKeys = hierarchy.leaves().map((node) => String(node.data.rawData[0][id.value]));\n const result:HeatmapData = {\n xKeys: [],\n xGroupKeys: [],\n xKeysByGroups: {},\n yKeys: yKeys,\n cells: {},\n meta: {\n valueExtent: [Infinity, -Infinity],\n uniqueValues: new Set(),\n xLabels: {},\n }\n };\n const valueColumn = heatmapAnnotation;\n const xGroupBy = heatmapGroup;\n const xColumn = heatmapAxis;\n const yColumn = id;\n\n const xKeysSet = new Set<string>();\n const xKeysByGroups:Record<string, Set<string>> = {};\n const xGroupKeys = new Set<string>();\n data.rows.forEach(row => {\n const xGroupKey = xGroupBy.length ? xGroupBy.map(column => String(row[column.value])).join('_') : 'null';\n let x = row[xColumn.value];\n let y = row[yColumn.value];\n if (x === null || y === null) {\n return;\n }\n x = String(x);\n y = String(y);\n if (!xKeysByGroups[xGroupKey]) {\n xKeysByGroups[xGroupKey] = new Set<string>();\n xGroupKeys.add(xGroupKey);\n }\n xKeysSet.add(x);\n xKeysByGroups[xGroupKey].add(x);\n\n if (!result.cells[x]) {\n result.cells[x] = {};\n }\n\n const value = row[valueColumn.value];\n\n if (type === 'discrete') {\n result.meta.uniqueValues.add(String(value));\n }\n if (type === 'continuous') {\n result.meta.valueExtent[0] = Math.min(value as number, result.meta.valueExtent[0]);\n result.meta.valueExtent[1] = Math.max(value as number, result.meta.valueExtent[1]);\n }\n\n if (result.cells[x][y] && value !== value) {\n throw Error(`More than 1 value for x=${x}, y=${y}`);\n }\n const label = String(row[xColumn.valueLabels ?? xColumn.value]);\n if (result.meta.xLabels[x] && label !== result.meta.xLabels[x]) {\n throw Error(`More than 1 x-label value for x=${x}`);\n }\n result.meta.xLabels[x] = label;\n\n result.cells[x][y] = {\n id: `${x}_${y}`,\n x,\n y,\n value: row[valueColumn.value],\n data: row,\n };\n });\n result.xGroupKeys = [...xGroupKeys];\n result.xKeysByGroups = [...xGroupKeys].reduce((res:HeatmapData['xKeysByGroups'], key) => {\n res[key] = [...xKeysByGroups[key]];\n return res;\n }, {});\n result.xKeys = result.xGroupKeys.reduce((res:string[], groupKey) => {\n res = res.concat(result.xKeysByGroups[groupKey]);\n return res;\n }, []);\n return result;\n}\n\nfunction getHeatmapDataByStringSource(\n data:DataFrame,\n heatmapAnnotation: DendroSettingsImpl['heatmapAnnotation'],\n id: DendroSettingsImpl['id'],\n hierarchy: HierarchyNode<TreeNodeData>\n) : HeatmapData | null {\n if (!heatmapAnnotation) {\n return null;\n }\n const yKeys = hierarchy.leaves().map((node) => String(node.data.rawData[0][id.value]));\n const result:HeatmapData = {\n xKeys: [],\n xGroupKeys: [],\n xKeysByGroups: {},\n yKeys: yKeys,\n cells: {},\n meta: {\n valueExtent: [Infinity, -Infinity],\n uniqueValues: new Set(),\n xLabels: {},\n }\n };\n const valueColumn = heatmapAnnotation;\n const yColumn = id;\n\n const xKeysByGroups:Record<string, Set<string>> = {'null': new Set()};\n const xGroupKeys = ['null'];\n let maxLine = 0;\n\n data.rows.forEach(row => {\n const line = row[valueColumn.value] as string;\n let y = row[yColumn.value];\n if (line === null || y === null) {\n return;\n }\n y = String(y);\n for (let i = 0; i < line.length; i++) {\n maxLine = Math.max(maxLine, line.length);\n const x = String(i);\n const value = line[i];\n xKeysByGroups['null'].add(x);\n\n result.meta.uniqueValues.add(value);\n result.meta.xLabels[x] = x;\n\n if (!result.cells[x]) {\n result.cells[x] = {};\n }\n result.cells[x][y] = {id: `${x}_${y}`, x, y, value, data: row};\n }\n });\n result.xGroupKeys = xGroupKeys;\n result.xKeysByGroups = xGroupKeys.reduce((res:HeatmapData['xKeysByGroups'], key) => {\n res[key] = [...xKeysByGroups[key]];\n return res;\n }, {});\n result.xKeys = new Array(maxLine).fill(null).map((_v, idx) => String(idx));\n return result;\n}\n"],"names":["getHeatmapData","data","type","heatmapAnnotation","heatmapAxis","heatmapGroup","id","hierarchy","getHeatmapDataByStringSource","getHeatmapDataWithAxisColumn","yKeys","node","result","valueColumn","xGroupBy","xColumn","yColumn","xKeysSet","xKeysByGroups","xGroupKeys","row","xGroupKey","column","x","y","value","label","res","key","groupKey","maxLine","line","i","_v","idx"],"mappings":"AAmBO,SAASA,EACZC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACF;AACE,SAAOL,MAA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ML,EAAAA;AAAAA,MAC9D;AAAA,IAAA;AAAA,EACJ,CAAC,GACDR,EAAO,aAAaO,GACpBP,EAAO,gBAAgBO,EAAW,OAAO,CAACQ,GAAkCC,OACxED,EAAIC,CAAG,IAAI,CAAC,GAAGV,EAAcU,CAAG,CAAC,GAC1BD,IACR,CAAA,CAAE,GACLf,EAAO,QAAQ,IAAI,MAAMkB,CAAO,EAAE,KAAK,IAAI,EAAE,IAAI,CAACG,GAAIC,MAAQ,OAAOA,CAAG,CAAC,GAClEtB;AACX;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"getHeatmapData.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/dendro/getHeatmapData.ts"],"sourcesContent":["import type { HierarchyNode } from 'd3-hierarchy';\nimport type { DataFrame } from '../DataFrame';\nimport type { Cell } from './components/types';\nimport type { DendroSettingsImpl } from './DendroSettingsImpl';\nimport type { TreeNodeData } from './getHierarchyData';\n\nexport type HeatmapData = {\n xKeys: string[];\n yKeys: string[];\n xGroupKeys: string[];\n xKeysByGroups: Record<string, string[]>;\n cells: Record<string, Record<string, Cell>>;\n meta: {\n valueExtent: [number, number];\n uniqueValues: Set<string>;\n xLabels: Record<string, string>;\n };\n};\n\nexport function getHeatmapData(\n data:DataFrame,\n type: DendroSettingsImpl['heatmapSettings']['valueType'],\n heatmapAnnotation: DendroSettingsImpl['heatmapAnnotation'],\n heatmapAxis: DendroSettingsImpl['heatmapAxis'],\n heatmapGroup: DendroSettingsImpl['heatmapGroup'],\n id: DendroSettingsImpl['id'],\n hierarchy: HierarchyNode<TreeNodeData>\n) {\n return type === 'stringSource'\n ? getHeatmapDataByStringSource(data, heatmapAnnotation, id, hierarchy)\n : getHeatmapDataWithAxisColumn(data, type, heatmapAnnotation, heatmapAxis, heatmapGroup, id, hierarchy);\n}\nexport function getHeatmapDataWithAxisColumn(\n data:DataFrame,\n type: DendroSettingsImpl['heatmapSettings']['valueType'],\n heatmapAnnotation: DendroSettingsImpl['heatmapAnnotation'],\n heatmapAxis: DendroSettingsImpl['heatmapAxis'],\n heatmapGroup: DendroSettingsImpl['heatmapGroup'],\n id: DendroSettingsImpl['id'],\n hierarchy: HierarchyNode<TreeNodeData>\n) : HeatmapData | null {\n if (!heatmapAnnotation || !heatmapAxis) {\n return null;\n }\n const yKeys = hierarchy.leaves().map((node) => String(data.getColumnValue(id.value, node.data.rawIndexes[0])));\n const result:HeatmapData = {\n xKeys: [],\n xGroupKeys: [],\n xKeysByGroups: {},\n yKeys: yKeys,\n cells: {},\n meta: {\n valueExtent: [Infinity, -Infinity],\n uniqueValues: new Set(),\n xLabels: {},\n }\n };\n const valueColumn = heatmapAnnotation;\n const xGroupBy = heatmapGroup;\n const xColumn = heatmapAxis;\n const yColumn = id;\n\n const xKeysSet = new Set<string>();\n const xKeysByGroups:Record<string, Set<string>> = {};\n const xGroupKeys = new Set<string>();\n\n for (let i = 0; i < data.rowsCount; i++) {\n const xGroupKey = xGroupBy.length ? xGroupBy.map(column => String(data.getColumnValue(column.value, i))).join('_') : 'null';\n let x = data.getColumnValue(xColumn.value, i);\n let y = data.getColumnValue(yColumn.value, i);\n if (x === null || y === null) {\n continue;\n }\n\n x = String(x);\n y = String(y);\n if (!xKeysByGroups[xGroupKey]) {\n xKeysByGroups[xGroupKey] = new Set<string>();\n xGroupKeys.add(xGroupKey);\n }\n xKeysSet.add(x);\n xKeysByGroups[xGroupKey].add(x);\n\n if (!result.cells[x]) {\n result.cells[x] = {};\n }\n\n const value = data.getColumnValue(valueColumn.value, i);\n\n if (type === 'discrete') {\n result.meta.uniqueValues.add(String(value));\n }\n if (type === 'continuous') {\n result.meta.valueExtent[0] = Math.min(value as number, result.meta.valueExtent[0]);\n result.meta.valueExtent[1] = Math.max(value as number, result.meta.valueExtent[1]);\n }\n\n if (result.cells[x][y] && value !== value) {\n throw Error(`More than 1 value for x=${x}, y=${y}`);\n }\n const label = String(\n data.getColumnValue(xColumn.valueLabels ?? xColumn.value, i)\n );\n if (result.meta.xLabels[x] && label !== result.meta.xLabels[x]) {\n throw Error(`More than 1 x-label value for x=${x}`);\n }\n result.meta.xLabels[x] = label;\n\n result.cells[x][y] = {\n idx: i,\n id: `${x}_${y}`,\n x,\n y,\n value: data.getColumnValue(valueColumn.value, i),\n };\n }\n\n result.xGroupKeys = [...xGroupKeys];\n result.xKeysByGroups = [...xGroupKeys].reduce((res:HeatmapData['xKeysByGroups'], key) => {\n res[key] = [...xKeysByGroups[key]];\n return res;\n }, {});\n result.xKeys = result.xGroupKeys.reduce((res:string[], groupKey) => {\n res = res.concat(result.xKeysByGroups[groupKey]);\n return res;\n }, []);\n return result;\n}\n\nfunction getHeatmapDataByStringSource(\n data:DataFrame,\n heatmapAnnotation: DendroSettingsImpl['heatmapAnnotation'],\n id: DendroSettingsImpl['id'],\n hierarchy: HierarchyNode<TreeNodeData>\n) : HeatmapData | null {\n if (!heatmapAnnotation) {\n return null;\n }\n const yKeys = hierarchy.leaves().map((node) => String(data.getColumnValue(id.value, node.data.rawIndexes[0])));\n const result:HeatmapData = {\n xKeys: [],\n xGroupKeys: [],\n xKeysByGroups: {},\n yKeys: yKeys,\n cells: {},\n meta: {\n valueExtent: [Infinity, -Infinity],\n uniqueValues: new Set(),\n xLabels: {},\n }\n };\n const valueColumn = heatmapAnnotation;\n const yColumn = id;\n\n const xKeysByGroups:Record<string, Set<string>> = {'null': new Set()};\n const xGroupKeys = ['null'];\n let maxLine = 0;\n\n for (let i = 0; i < data.rowsCount; i++) {\n const line = data.getColumnValue(valueColumn.value, i) as string;\n let y = data.getColumnValue(yColumn.value, i);\n if (line === null || y === null) {\n continue;\n }\n y = String(y);\n for (let j = 0; j < line.length; j++) {\n maxLine = Math.max(maxLine, line.length);\n const x = String(j);\n const value = line[j];\n xKeysByGroups['null'].add(x);\n\n result.meta.uniqueValues.add(value);\n result.meta.xLabels[x] = x;\n\n if (!result.cells[x]) {\n result.cells[x] = {};\n }\n result.cells[x][y] = {idx: i, id: `${x}_${y}`, x, y, value};\n }\n }\n \n result.xGroupKeys = xGroupKeys;\n result.xKeysByGroups = xGroupKeys.reduce((res:HeatmapData['xKeysByGroups'], key) => {\n res[key] = [...xKeysByGroups[key]];\n return res;\n }, {});\n result.xKeys = new Array(maxLine).fill(null).map((_v, idx) => String(idx));\n return result;\n}\n"],"names":["getHeatmapData","data","type","heatmapAnnotation","heatmapAxis","heatmapGroup","id","hierarchy","getHeatmapDataByStringSource","getHeatmapDataWithAxisColumn","yKeys","node","result","valueColumn","xGroupBy","xColumn","yColumn","xKeysSet","xKeysByGroups","xGroupKeys","i","xGroupKey","column","x","y","value","label","res","key","groupKey","maxLine","line","j","_v","idx"],"mappings":"AAmBO,SAASA,EACZC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACF;AACE,SAAOL,MAAS,iBACVM,EAA6BP,GAAME,GAAmBG,GAAIC,CAAS,IACnEE,EAA6BR,GAAMC,GAAMC,GAAmBC,GAAaC,GAAcC,GAAIC,CAAS;AAC9G;AACO,SAASE,EACZR,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACmB;AACnB,MAAI,CAACJ,KAAqB,CAACC;AACvB,WAAO;AAEX,QAAMM,IAAQH,EAAU,OAAA,EAAS,IAAI,CAACI,MAAS,OAAOV,EAAK,eAAeK,EAAG,OAAOK,EAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,GACvGC,IAAqB;AAAA,IACvB,OAAO,CAAA;AAAA,IACP,YAAY,CAAA;AAAA,IACZ,eAAe,CAAA;AAAA,IACf,OAAAF;AAAAA,IACA,OAAO,CAAA;AAAA,IACP,MAAM;AAAA,MACF,aAAa,CAAC,OAAU,MAAS;AAAA,MACjC,kCAAkB,IAAA;AAAA,MAClB,SAAS,CAAA;AAAA,IAAA;AAAA,EAAC,GAGZG,IAAcV,GACdW,IAAWT,GACXU,IAAUX,GACVY,IAAUV,GAEVW,IAAAA,oBAAe,OACfC,IAA4C,CAAA,GAC5CC,wBAAiB,IAAA;AAEvB,WAASC,IA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