@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.
Files changed (219) hide show
  1. package/dist/GraphMaker/components/LassoControls/index.vue.js +15 -13
  2. package/dist/GraphMaker/components/LassoControls/index.vue.js.map +1 -1
  3. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +9 -3
  4. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
  5. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +17 -2
  6. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
  7. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +13 -4
  8. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
  9. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +28 -7
  10. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
  11. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +6 -2
  12. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
  13. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +16 -2
  14. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
  15. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +14 -2
  16. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
  17. package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js +95 -72
  18. package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js.map +1 -1
  19. package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +1 -1
  20. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js +124 -122
  21. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js.map +1 -1
  22. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js +72 -91
  23. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js.map +1 -1
  24. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js +43 -41
  25. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js.map +1 -1
  26. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js +28 -0
  27. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js.map +1 -0
  28. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js +94 -0
  29. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js.map +1 -0
  30. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +42 -38
  31. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
  32. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
  33. package/dist/node_modules/@milaboratories/miplots4/dist/common/Legend.js.map +1 -1
  34. package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js +11 -11
  35. package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js.map +1 -1
  36. package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js +20 -0
  37. package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js.map +1 -0
  38. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +181 -181
  39. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js.map +1 -1
  40. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js +2 -2
  41. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js.map +1 -1
  42. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js +45 -45
  43. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js.map +1 -1
  44. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js +27 -27
  45. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js.map +1 -1
  46. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Legend.js.map +1 -1
  47. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js +18 -18
  48. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js.map +1 -1
  49. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js +36 -36
  50. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js.map +1 -1
  51. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js +45 -41
  52. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js.map +1 -1
  53. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js +33 -33
  54. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js.map +1 -1
  55. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +90 -93
  56. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
  57. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +200 -199
  58. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js.map +1 -1
  59. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +17 -17
  60. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
  61. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/BoxElement.js.map +1 -1
  62. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +102 -99
  63. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
  64. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js +31 -36
  65. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js.map +1 -1
  66. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js +62 -74
  67. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js.map +1 -1
  68. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js +52 -53
  69. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js.map +1 -1
  70. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js +32 -32
  71. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js.map +1 -1
  72. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js +7 -6
  73. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js.map +1 -1
  74. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js +23 -23
  75. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js.map +1 -1
  76. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js +63 -63
  77. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js.map +1 -1
  78. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js +60 -64
  79. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js.map +1 -1
  80. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js +23 -23
  81. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js.map +1 -1
  82. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js +5 -5
  83. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js.map +1 -1
  84. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js +13 -13
  85. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map +1 -1
  86. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +258 -256
  87. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
  88. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +1 -1
  89. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
  90. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +45 -44
  91. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
  92. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +107 -106
  93. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
  94. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +18 -18
  95. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js.map +1 -1
  96. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +99 -95
  97. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
  98. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +30 -29
  99. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
  100. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js +1 -1
  101. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js.map +1 -1
  102. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
  103. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js +143 -142
  104. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js.map +1 -1
  105. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/HistogramSettingsImpl.js.map +1 -1
  106. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js +30 -30
  107. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js.map +1 -1
  108. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/ChartsGroup.js +7 -7
  109. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js +53 -54
  110. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js.map +1 -1
  111. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +59 -55
  112. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
  113. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/@d3fc/d3fc-axis/src/axisBase.js +7 -7
  114. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js +6 -12
  115. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js.map +1 -1
  116. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-shape/src/line.js.map +1 -1
  117. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js +148 -0
  118. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js.map +1 -0
  119. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js +172 -168
  120. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js.map +1 -1
  121. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +26 -26
  122. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  123. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js +11 -11
  124. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js +30 -29
  125. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js.map +1 -1
  126. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js +135 -153
  127. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js.map +1 -1
  128. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js +35 -32
  129. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js.map +1 -1
  130. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js +27 -27
  131. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
  132. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js +14 -14
  133. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/constants.js.map +1 -1
  134. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +24 -22
  135. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
  136. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +11 -14
  137. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
  138. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +57 -58
  139. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
  140. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js +85 -83
  141. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js.map +1 -1
  142. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js +20 -20
  143. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js.map +1 -1
  144. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +44 -37
  145. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
  146. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js +11 -0
  147. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
  148. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js +46 -56
  149. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js.map +1 -1
  150. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +223 -205
  151. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  152. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +22 -22
  153. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
  154. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js +42 -0
  155. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js.map +1 -0
  156. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js +84 -81
  157. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
  158. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/SVGLayer.js +11 -11
  159. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js +15 -14
  160. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js.map +1 -1
  161. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +89 -114
  162. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
  163. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +3 -1
  164. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
  165. package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +1 -1
  166. package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js.map +1 -1
  167. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +1 -1
  168. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
  169. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +1 -1
  170. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
  171. package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js +1 -1
  172. package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js.map +1 -1
  173. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +1 -1
  174. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
  175. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +4 -4
  176. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
  177. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js +39 -0
  178. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js.map +1 -0
  179. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js +101 -0
  180. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js.map +1 -0
  181. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js +4 -4
  182. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js.map +1 -1
  183. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js +3 -3
  184. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js.map +1 -1
  185. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +1031 -1023
  186. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
  187. package/package.json +3 -3
  188. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js +0 -91
  189. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js.map +0 -1
  190. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js +0 -30
  191. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js.map +0 -1
  192. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js +0 -29
  193. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js.map +0 -1
  194. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js +0 -12
  195. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js.map +0 -1
  196. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js +0 -7
  197. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js.map +0 -1
  198. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js +0 -26
  199. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js.map +0 -1
  200. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js +0 -7
  201. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js.map +0 -1
  202. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js +0 -51
  203. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js.map +0 -1
  204. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js +0 -21
  205. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js.map +0 -1
  206. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js +0 -7
  207. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js.map +0 -1
  208. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js +0 -12
  209. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js.map +0 -1
  210. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js +0 -14
  211. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js.map +0 -1
  212. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js +0 -19
  213. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js.map +0 -1
  214. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js +0 -11
  215. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js.map +0 -1
  216. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js +0 -11
  217. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js.map +0 -1
  218. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js +0 -24
  219. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js.map +0 -1
@@ -1,53 +1,54 @@
1
- import { j as E } from "../node_modules/react/jsx-runtime.js";
2
- import { Error as W } from "../common/Error.js";
3
- import { calculateChartSideElementSizes as $ } from "./utils/calculateChartSideElementSizes.js";
4
- import { calculateSideElementsBBoxes as F } from "./utils/calculateSideElementsBBoxes.js";
5
- import { calculateCaptionTails as G } from "./utils/calculateCaptionTails.js";
6
- import { getChartEdgeSides as K } from "../utils/getChartEdgeSides.js";
7
- import { getContinuousLegendTicks as P } from "../utils/getContinuousLegendTicks.js";
8
- import { MIN_MARGIN as A, LEGEND_OFFSET as j, TITLE_LINE as D, CHART_SIDE_ELEMENTS as k, MIN_PADDING as B } from "./constants.js";
9
- import { TITLE_LINE_HEIGHT as U, TITLE_MARGIN as O, DEFAULT_HEIGHT_SMALL as V, DEFAULT_HEIGHT as L, DEFAULT_WIDTH as M } from "../constants.js";
10
- import { createRoot as q } from "../node_modules/react-dom/client.js";
11
- import { ChartsGroup as Q } from "./components/ChartsGroup.js";
12
- import { TextMeasurer as X } from "../utils/TextMeasurer.js";
13
- import { arrangeLegendParts as J } from "../utils/arrangeLegendParts.js";
1
+ import { j as L } from "../node_modules/react/jsx-runtime.js";
2
+ import { createRoot as W } from "../node_modules/react-dom/client.js";
3
+ import { Error as F } from "../common/Error.js";
4
+ import { DataFrameProvider as $ } from "../common/useDataFrame.js";
5
+ import { TITLE_LINE_HEIGHT as G, TITLE_MARGIN as K, DEFAULT_HEIGHT_SMALL as P, DEFAULT_HEIGHT as E, DEFAULT_WIDTH as M } from "../constants.js";
6
+ import { arrangeLegendParts as j } from "../utils/arrangeLegendParts.js";
7
+ import { getChartEdgeSides as k } from "../utils/getChartEdgeSides.js";
8
+ import { getContinuousLegendTicks as B } from "../utils/getContinuousLegendTicks.js";
9
+ import { TextMeasurer as U } from "../utils/TextMeasurer/TextMeasurer.js";
10
+ import { ChartsGroup as O } from "./components/ChartsGroup.js";
11
+ import { MIN_MARGIN as A, LEGEND_OFFSET as V, TITLE_LINE as I, CHART_SIDE_ELEMENTS as q, MIN_PADDING as X } from "./constants.js";
12
+ import { calculateChartSideElementSizes as J } from "./utils/calculateChartSideElementSizes.js";
13
+ import { calculateSideElementsBBoxes as Q } from "./utils/calculateSideElementsBBoxes.js";
14
+ import { calculateCaptionTails as Y } from "./utils/calculateCaptionTails.js";
14
15
  import w from "../node_modules/d3-scale/src/ordinal.js";
15
16
  import N from "../node_modules/d3-scale/src/linear.js";
16
17
  import { sqrt as v } from "../node_modules/d3-scale/src/pow.js";
17
- var Y = Object.defineProperty, Z = (l, t, s) => t in l ? Y(l, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : l[t] = s, d = (l, t, s) => Z(l, typeof t != "symbol" ? t + "" : t, s);
18
- const tt = (l, t) => {
19
- const s = Math.min(...t), a = Math.max(...t);
20
- if (s === a) {
21
- const h = l % 2 === 0 ? [] : [s];
22
- for (let r = 1; r < l / 2 + 1; r++)
23
- h.push(s + r), h.unshift(s - r);
24
- return h;
18
+ var Z = Object.defineProperty, tt = (r, t, e) => t in r ? Z(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, d = (r, t, e) => tt(r, typeof t != "symbol" ? t + "" : t, e);
19
+ const et = (r, t) => {
20
+ const e = Math.min(...t), s = Math.max(...t);
21
+ if (e === s) {
22
+ const o = r % 2 === 0 ? [] : [e];
23
+ for (let m = 1; m < r / 2 + 1; m++)
24
+ o.push(e + m), o.unshift(e - m);
25
+ return o;
25
26
  }
26
- if (l < 2)
27
- return [s, a];
28
- const o = (a - s) / (l - 1), e = [];
29
- for (let h = 0; h < l - 1; h++)
30
- e.push(s + o * h);
31
- return e.push(a), e;
27
+ if (r < 2)
28
+ return [e, s];
29
+ const h = (s - e) / (r - 1), i = [];
30
+ for (let o = 0; o < r - 1; o++)
31
+ i.push(e + h * o);
32
+ return i.push(s), i;
32
33
  };
33
- function st(l, t, s) {
34
- let a = s;
35
- return l && (l.colorRange && (a = l.colorRange), l.method === "standardScaling" && (a = [-2, 2]), l.method === "meanNormalization" && (a = [-0.75, 0.75])), tt(t, a);
34
+ function st(r, t, e) {
35
+ let s = e;
36
+ return r && (r.colorRange && (s = r.colorRange), r.method === "standardScaling" && (s = [-2, 2]), r.method === "meanNormalization" && (s = [-0.75, 0.75])), et(t, s);
36
37
  }
37
- class ft {
38
+ class zt {
38
39
  constructor() {
39
- d(this, "reactRoot", null), d(this, "parentNode", null), d(this, "rootNode", null), d(this, "component", /* @__PURE__ */ E.jsx(E.Fragment, {})), d(this, "chartsDimensions", {}), d(this, "chartSizes", {
40
+ d(this, "reactRoot", null), d(this, "parentNode", null), d(this, "rootNode", null), d(this, "component", /* @__PURE__ */ L.jsx(L.Fragment, {})), d(this, "chartsDimensions", {}), d(this, "chartSizes", {
40
41
  chartWidth: M,
41
42
  // width of single chart
42
- chartHeight: L,
43
+ chartHeight: E,
43
44
  // height of single chart
44
45
  chartsWidth: M,
45
46
  // width of all charts in charts row
46
- chartsHeight: L,
47
+ chartsHeight: E,
47
48
  // width of all charts in charts column, without axes
48
49
  totalWidth: M,
49
50
  // width of all charts in charts row, plus left axis, plus legend
50
- totalHeight: L
51
+ totalHeight: E
51
52
  // width of all charts in charts height, plus bottom axis, plus top title
52
53
  }), d(this, "margins", {
53
54
  top: A,
@@ -74,108 +75,108 @@ class ft {
74
75
  clear() {
75
76
  var t;
76
77
  this.parentNode && this.rootNode && ((t = this.parentNode) == null || t.removeChild(this.rootNode), this.parentNode = null, this.rootNode = null), setTimeout(() => {
77
- var s;
78
- (s = this.reactRoot) == null || s.unmount(), this.reactRoot = null;
78
+ var e;
79
+ (e = this.reactRoot) == null || e.unmount(), this.reactRoot = null;
79
80
  });
80
81
  }
81
82
  init(t) {
82
- this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = q(this.rootNode));
83
+ this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.reactRoot = W(this.rootNode));
83
84
  }
84
85
  updateMargins(t) {
85
86
  this.margins = {
86
- top: t.show ? U + O * 2 : A,
87
+ top: t.show ? G + K * 2 : A,
87
88
  bottom: A,
88
89
  left: A,
89
90
  right: this.legend.width
90
91
  }, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartsHeight, this.legend.height) + this.margins.bottom;
91
92
  }
92
- updateLegendSize(t, s, a, o) {
93
+ updateLegendSize(t, e, s, h) {
93
94
  if (!t.show) {
94
95
  this.legend = { width: 0, height: 0, items: [] };
95
96
  return;
96
97
  }
97
- const e = [], h = Math.min(
98
- Math.max(this.chartSizes.chartHeight, V),
99
- L
100
- ), r = Math.max(this.chartSizes.chartHeight, h), g = { width: 0, height: 0, left: 0, top: 0 }, S = this.colorScale.domain(), x = P(this.colorScale, [
98
+ const i = [], o = Math.min(
99
+ Math.max(this.chartSizes.chartHeight, P),
100
+ E
101
+ ), m = Math.max(this.chartSizes.chartHeight, o), g = { width: 0, height: 0, left: 0, top: 0 }, S = this.colorScale.domain(), x = B(this.colorScale, [
101
102
  S[0],
102
103
  S[S.length - 1]
103
- ]), z = s.label ?? s.value, c = N([x[0], x[x.length - 1]], [h, 0]);
104
- e.push({
104
+ ]), C = e.label ?? e.value, u = N([x[0], x[x.length - 1]], [o, 0]);
105
+ i.push({
105
106
  id: "colorValue",
106
107
  type: "continuous",
107
108
  scale: this.colorScale,
108
- tickPositionScale: c,
109
+ tickPositionScale: u,
109
110
  values: x,
110
- title: z,
111
+ title: C,
111
112
  ...g
112
113
  });
113
- const u = a.label ?? a.value, C = this.sizeScale.ticks(3), p = this.sizeScale.tickFormat(3), i = C.reduce((T, b) => (T[String(b)] = p(b), T), {});
114
- if (e.push({
114
+ const p = s.label ?? s.value, z = this.sizeScale.ticks(3), l = this.sizeScale.tickFormat(3), a = z.reduce((T, b) => (T[String(b)] = l(b), T), {});
115
+ if (i.push({
115
116
  id: "sizeValue",
116
117
  type: "size",
117
- title: u,
118
+ title: p,
118
119
  scale: this.sizeScale,
119
- values: C,
120
- labels: i,
120
+ values: z,
121
+ labels: a,
121
122
  ...g
122
- }), !e.length) {
123
+ }), !i.length) {
123
124
  this.legend = { width: 0, height: 0, items: [] };
124
125
  return;
125
126
  }
126
- const n = J(e, r, h), m = n[n.length - 1], y = m.left + m.width + 2 * j, f = this.chartsDimensions[o[0]].padding;
127
+ const n = j(i, m, o), c = n[n.length - 1], y = c.left + c.width + 2 * V, f = this.chartsDimensions[h[0]].padding;
127
128
  this.legend = {
128
129
  width: y,
129
- height: r + f.top,
130
+ height: m + f.top,
130
131
  items: n
131
132
  };
132
133
  }
133
- updateCaptionsSize(t, s, a) {
134
- const o = new X("bold 14px Arial"), { xKeys: e, yKeys: h, xLabels: r, yLabels: g } = t.meta;
134
+ updateCaptionsSize(t, e, s) {
135
+ const h = new U("bold 14px Arial"), { xKeys: i, yKeys: o, xLabels: m, yLabels: g } = t.meta;
135
136
  this.labelAngles = {
136
- xAxisLabels: s.axisLabelsAngle,
137
- yAxisLabels: a.axisLabelsAngle
137
+ xAxisLabels: e.axisLabelsAngle,
138
+ yAxisLabels: s.axisLabelsAngle
138
139
  };
139
140
  let S = 0, x = 0;
140
- for (const p of e) {
141
- const i = o.getTextWidth(r[p]);
142
- i > S && (S = i);
141
+ for (const l of i) {
142
+ const a = h.getTextWidth(m[l]);
143
+ a > S && (S = a);
143
144
  }
144
- for (const p of h) {
145
- const i = o.getTextWidth(g[p]);
146
- i > x && (x = i);
145
+ for (const l of o) {
146
+ const a = h.getTextWidth(g[l]);
147
+ a > x && (x = a);
147
148
  }
148
- const { xCaptionTail: z, yCaptionTail: c } = G(
149
+ const { xCaptionTail: C, yCaptionTail: u } = Y(
149
150
  this.labelAngles,
150
151
  this.step,
151
152
  t,
152
- o
153
- ), u = this.labelAngles.xAxisLabels / 180 * Math.PI, C = this.labelAngles.yAxisLabels / 180 * Math.PI;
153
+ h
154
+ ), p = this.labelAngles.xAxisLabels / 180 * Math.PI, z = this.labelAngles.yAxisLabels / 180 * Math.PI;
154
155
  this.captionsSizes = {
155
- xCaptionTail: z,
156
- yCaptionTail: c,
157
- xAxisCaptions: S * Math.sin(u) || D,
158
- yAxisCaptions: x * Math.sin(C) || D
156
+ xCaptionTail: C,
157
+ yCaptionTail: u,
158
+ xAxisCaptions: S * Math.sin(p) || I,
159
+ yAxisCaptions: x * Math.sin(z) || I
159
160
  };
160
161
  }
161
- updateChartDimensions(t, s, a, o) {
162
- const e = t.length, h = Math.min(s.nRows ?? e, e), r = Math.min(s.nCols ?? e, e);
163
- this.columnsCount = s.nRows ? Math.ceil(e / h) : r, this.rowsCount = Math.ceil(e / this.columnsCount), this.chartsDimensions = {};
162
+ updateChartDimensions(t, e, s, h) {
163
+ const i = t.length, o = Math.min(e.nRows ?? i, i), m = Math.min(e.nCols ?? i, i);
164
+ this.columnsCount = e.nRows ? Math.ceil(i / o) : m, this.rowsCount = Math.ceil(i / this.columnsCount), this.chartsDimensions = {};
164
165
  let g = 0, S = 0;
165
- t.forEach((c, u) => {
166
- const C = u % this.columnsCount + 1, p = K(u, t.length, this.columnsCount, this.rowsCount), i = this.chartSizes.chartWidth, n = this.chartSizes.chartHeight, m = $(
167
- a,
168
- o,
166
+ t.forEach((u, p) => {
167
+ const z = p % this.columnsCount + 1, l = k(p, t.length, this.columnsCount, this.rowsCount), a = this.chartSizes.chartWidth, n = this.chartSizes.chartHeight, c = J(
168
+ s,
169
+ h,
169
170
  this.captionsSizes,
170
- p,
171
+ l,
171
172
  t,
172
173
  this.step.x,
173
174
  this.step.y
174
175
  );
175
- function y(I) {
176
+ function y(D) {
176
177
  return Math.max(
177
- k[I].reduce((R, _) => R + m[I][_], 0),
178
- B
178
+ q[D].reduce((R, _) => R + c[D][_], 0),
179
+ X
179
180
  );
180
181
  }
181
182
  const f = {
@@ -185,74 +186,75 @@ class ft {
185
186
  bottom: y("bottom")
186
187
  };
187
188
  f.left < this.captionsSizes.xCaptionTail && (f.left = this.captionsSizes.xCaptionTail), f.bottom < this.captionsSizes.yCaptionTail && (f.bottom = this.captionsSizes.yCaptionTail);
188
- const T = F(m, i, n), b = i + f.left + f.right, H = n + f.top + f.bottom;
189
- this.chartsDimensions[c] = {
189
+ const T = Q(c, a, n), b = a + f.left + f.right, H = n + f.top + f.bottom;
190
+ this.chartsDimensions[u] = {
190
191
  left: g,
191
192
  top: S,
192
- inner: { width: i, height: n },
193
+ inner: { width: a, height: n },
193
194
  outer: { width: b, height: H },
194
195
  padding: f,
195
196
  sideElementBBoxes: T,
196
- chartEdgeSides: p
197
- }, g += b, C === this.columnsCount && (g = 0, S += H);
197
+ chartEdgeSides: l
198
+ }, g += b, z === this.columnsCount && (g = 0, S += H);
198
199
  });
199
- const x = t.slice(0, this.columnsCount).reduce((c, u) => c + this.chartsDimensions[u].outer.width, 0), z = t.filter((c, u) => u % this.columnsCount === 0).reduce((c, u) => c + this.chartsDimensions[u].outer.height, 0);
200
- this.chartSizes.chartsWidth = x, this.chartSizes.chartsHeight = z;
200
+ const x = t.slice(0, this.columnsCount).reduce((u, p) => u + this.chartsDimensions[p].outer.width, 0), C = t.filter((u, p) => p % this.columnsCount === 0).reduce((u, p) => u + this.chartsDimensions[p].outer.height, 0);
201
+ this.chartSizes.chartsWidth = x, this.chartSizes.chartsHeight = C;
201
202
  }
202
- updateChartsSizes(t, s) {
203
- const { width: a, height: o, cellSize: e } = s;
204
- e && (this.chartSizes.chartWidth = t.meta.xKeys.length * e, this.chartSizes.chartHeight = t.meta.yKeys.length * e), a && o && (this.chartSizes.chartWidth = a, this.chartSizes.chartHeight = o);
203
+ updateChartsSizes(t, e) {
204
+ const { width: s, height: h, cellSize: i } = e;
205
+ i && (this.chartSizes.chartWidth = t.meta.xKeys.length * i, this.chartSizes.chartHeight = t.meta.yKeys.length * i), s && h && (this.chartSizes.chartWidth = s, this.chartSizes.chartHeight = h);
205
206
  }
206
207
  // update scales for cell positions, x and y for each facet
207
- updateScales(t, s, a, o) {
208
- const { width: e, height: h, cellSize: r } = s, { meta: g } = t, S = (p, i = {}) => [...p].sort(
209
- (n, m) => a.sorting === "asc" ? (i[n] ?? n).localeCompare(i[m] ?? m, "en", { numeric: !0 }) : (i[m] ?? m).localeCompare(i[n] ?? n, "en", { numeric: !0 })
210
- ), x = (p, i = {}) => [...p].sort(
211
- (n, m) => o.sorting === "asc" ? (i[n] ?? n).localeCompare(i[m] ?? m, "en", { numeric: !0 }) : (i[m] ?? m).localeCompare(i[n] ?? n, "en", { numeric: !0 })
212
- ), z = S(g.xKeys, g.xLabels), c = x(g.yKeys, g.yLabels);
213
- r ? (this.step.x = r, this.step.y = r) : e && h && (this.step.x = e / z.length, this.step.y = h / c.length);
214
- const u = new Array(z.length).fill(null).map((p, i) => i * this.step.x), C = new Array(c.length).fill(null).map((p, i) => i * this.step.y);
215
- this.scales.x = w().domain(z).range(u), this.scales.y = w().domain(c).range(C);
208
+ updateScales(t, e, s, h) {
209
+ const { width: i, height: o, cellSize: m } = e, { meta: g } = t, S = (l, a = {}) => [...l].sort(
210
+ (n, c) => s.sorting === "asc" ? (a[n] ?? n).localeCompare(a[c] ?? c, "en", { numeric: !0 }) : (a[c] ?? c).localeCompare(a[n] ?? n, "en", { numeric: !0 })
211
+ ), x = (l, a = {}) => [...l].sort(
212
+ (n, c) => h.sorting === "asc" ? (a[n] ?? n).localeCompare(a[c] ?? c, "en", { numeric: !0 }) : (a[c] ?? c).localeCompare(a[n] ?? n, "en", { numeric: !0 })
213
+ ), C = S(g.xKeys, g.xLabels), u = x(g.yKeys, g.yLabels);
214
+ m ? (this.step.x = m, this.step.y = m) : i && o && (this.step.x = i / C.length, this.step.y = o / u.length);
215
+ const p = new Array(C.length).fill(null).map((l, a) => a * this.step.x), z = new Array(u.length).fill(null).map((l, a) => a * this.step.y);
216
+ this.scales.x = w().domain(C).range(p), this.scales.y = w().domain(u).range(z);
216
217
  }
217
- updateAesScale(t, s, a, o) {
218
- this.colorScale = N().domain(st(o, t.colorsList.length, a)).range(t.colorsList), this.sizeScale = v(s, [t.minRadius, t.maxRadius]);
218
+ updateAesScale(t, e, s, h) {
219
+ this.colorScale = N().domain(st(h, t.colorsList.length, s)).range(t.colorsList), this.sizeScale = v(e, [t.minRadius, t.maxRadius]);
219
220
  }
220
- render(t, s, a, o, e, h, r, g, S, x) {
221
- var z;
222
- const { meta: c, facets: u } = e, { valueExtentSize: C, valueExtentColor: p } = c, { xAxis: i, yAxis: n, title: m, size: y } = s;
223
- this.updateChartsSizes(e, y), this.updateAesScale(S, C, p, g), this.updateScales(e, y, s.xAxis, s.yAxis), this.updateCaptionsSize(e, i, n), this.updateChartDimensions(o, a, i, n), this.updateLegendSize(s.legend, h, r, o), this.updateMargins(m);
224
- const f = /* @__PURE__ */ E.jsx(
225
- Q,
221
+ render(t, e, s, h, i, o, m, g, S, x, C) {
222
+ var u;
223
+ const { meta: p, facets: z, meta: { facetKeys: l } } = i, { valueExtentSize: a, valueExtentColor: n } = p, { xAxis: c, yAxis: y, title: f, size: T } = s;
224
+ this.updateChartsSizes(i, T), this.updateAesScale(S, a, n, g), this.updateScales(i, T, s.xAxis, s.yAxis), this.updateCaptionsSize(i, c, y), this.updateChartDimensions(l, h, c, y), this.updateLegendSize(s.legend, o, m, l), this.updateMargins(f);
225
+ const b = /* @__PURE__ */ L.jsx($, { dataFrame: t, children: /* @__PURE__ */ L.jsx(
226
+ O,
226
227
  {
227
228
  aes: S,
228
229
  captionsSizes: this.captionsSizes,
229
- cellsMeta: c,
230
+ cellsMeta: p,
230
231
  columnsCount: this.columnsCount,
231
232
  chartsDimensions: this.chartsDimensions,
232
233
  chartSettings: s,
233
234
  chartSizes: this.chartSizes,
234
235
  sizeScale: this.sizeScale,
235
236
  colorScale: this.colorScale,
236
- facetKeys: o,
237
- facetSettings: a,
238
- groupedCells: u,
237
+ facetKeys: l,
238
+ facetSettings: h,
239
+ groupedCells: z,
239
240
  labelAngles: this.labelAngles,
240
241
  legend: this.legend,
241
242
  margins: this.margins,
242
243
  scales: this.scales,
243
- settingsId: t,
244
+ settingsId: e,
244
245
  step: this.step,
245
- onTooltipHintSwitch: x
246
+ getCellTooltip: x,
247
+ onTooltipHintSwitch: C
246
248
  }
247
- );
248
- this.component = f, (z = this.reactRoot) == null || z.render(f);
249
+ ) });
250
+ this.component = b, (u = this.reactRoot) == null || u.render(b);
249
251
  }
250
252
  renderError(t) {
251
- var s;
252
- (s = this.reactRoot) == null || s.render(/* @__PURE__ */ E.jsx(W, { message: t }));
253
+ var e;
254
+ (e = this.reactRoot) == null || e.render(/* @__PURE__ */ L.jsx(F, { message: t }));
253
255
  }
254
256
  }
255
257
  export {
256
- ft as default
258
+ zt as default
257
259
  };
258
260
  //# sourceMappingURL=ChartRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartRenderer.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/bubble/ChartRenderer.tsx"],"sourcesContent":["import type {BubbleSettingsImpl} from './BubbleSettingsImpl';\nimport type {ChartScales} from './components/types';\nimport {Error} from '../common/Error';\nimport type {\n CaptionsSizes,\n ChartDimensionsData,\n ChartSizes,\n LabelAngles,\n Margins,\n} from './components/types';\nimport type {GroupedCellsData} from './getCells';\nimport {calculateChartSideElementSizes, calculateSideElementsBBoxes} from './utils';\nimport {calculateCaptionTails} from './utils/calculateCaptionTails';\nimport type {ColumnName, DataValue} from '../types';\nimport {getChartEdgeSides} from '../utils/getChartEdgeSides';\nimport {getContinuousLegendTicks} from '../utils/getContinuousLegendTicks';\nimport type {ScaleLinear, ScalePower} from 'd3-scale';\nimport {scaleLinear, scaleOrdinal, scaleSqrt} from 'd3-scale';\nimport {CHART_SIDE_ELEMENTS, LEGEND_OFFSET, MIN_MARGIN, MIN_PADDING, TITLE_LINE} from './constants';\nimport {DEFAULT_HEIGHT, DEFAULT_HEIGHT_SMALL, DEFAULT_WIDTH, TITLE_LINE_HEIGHT, TITLE_MARGIN} from '../constants';\nimport type {ReactElement} from 'react';\nimport React from 'react';\nimport type {Root} from 'react-dom/client';\nimport {createRoot} from 'react-dom/client';\nimport {ChartsGroup} from './components/ChartsGroup';\nimport {TextMeasurer} from '../utils/TextMeasurer';\nimport type { LegendData, LegendItem } from '../common/types';\nimport { arrangeLegendParts } from '../utils/arrangeLegendParts';\n\nconst getSteps = (count: number, valueExtent: number[]) => {\n const min = Math.min(...valueExtent);\n const max = Math.max(...valueExtent);\n if (min === max) {\n const steps = count % 2 === 0 ? [] : [min];\n for (let i = 1; i < count / 2 + 1; i++) {\n steps.push(min + i);\n steps.unshift(min - i);\n }\n return steps;\n }\n if (count < 2) {\n return [min, max];\n }\n const step = (max - min) / (count - 1);\n const steps = [];\n for (let i = 0; i < count - 1; i++) {\n steps.push(min + step * i);\n }\n steps.push(max);\n return steps;\n};\n\nfunction getContinuousColorRange(\n normalization: BubbleSettingsImpl['normalization'],\n colorsCount: number,\n valueExtent: number[]\n) {\n let extent = valueExtent;\n if (normalization) {\n if (normalization.colorRange) {\n extent = normalization.colorRange;\n }\n if (normalization.method === 'standardScaling') {\n extent = [-2, 2];\n }\n if (normalization.method === 'meanNormalization') {\n extent = [-0.75, 0.75];\n }\n }\n return getSteps(colorsCount, extent);\n}\n\nclass ChartRenderer {\n reactRoot: Root | null = null;\n parentNode: HTMLElement | null = null;\n rootNode: HTMLElement | null = null;\n component: ReactElement = (<></>);\n chartsDimensions: Record<string, ChartDimensionsData> = {};\n chartSizes: ChartSizes = {\n chartWidth: DEFAULT_WIDTH, // width of single chart\n chartHeight: DEFAULT_HEIGHT, // height of single chart\n chartsWidth: DEFAULT_WIDTH, // width of all charts in charts row\n chartsHeight: DEFAULT_HEIGHT, // width of all charts in charts column, without axes\n totalWidth: DEFAULT_WIDTH, // width of all charts in charts row, plus left axis, plus legend\n totalHeight: DEFAULT_HEIGHT, // width of all charts in charts height, plus bottom axis, plus top title\n };\n margins: Margins = {\n top: MIN_MARGIN,\n bottom: MIN_MARGIN,\n left: MIN_MARGIN,\n right: MIN_MARGIN,\n };\n captionsSizes: CaptionsSizes = {\n xAxisCaptions: 100,\n yAxisCaptions: 100,\n xCaptionTail: 0,\n yCaptionTail: 0,\n };\n labelAngles: LabelAngles = {\n xAxisLabels: 0,\n yAxisLabels: 0,\n };\n columnsCount = 1;\n rowsCount = 1;\n scales: ChartScales = {\n x: scaleOrdinal<string, number>().domain(['null']).range([1]),\n y: scaleOrdinal<string, number>().domain(['null']).range([1]),\n };\n step: {x: number; y: number} = {x: 10, y: 10};\n colorScale: ScaleLinear<string, string> = scaleLinear<string, string>().domain([0, 1]).range(['white', 'black']);\n sizeScale: ScalePower<number, number> = scaleSqrt().domain([0, 1]).range([3, 20]);\n legend: LegendData = {\n width: 0,\n height: 0,\n items: [],\n };\n\n clear() {\n if (this.parentNode && this.rootNode) {\n this.parentNode?.removeChild(this.rootNode);\n this.parentNode = null;\n this.rootNode = null;\n }\n // timeout to avoid trying to unmount during rendering\n setTimeout(() => {\n this.reactRoot?.unmount();\n this.reactRoot = null;\n });\n }\n\n init(node: HTMLElement) {\n if (this.parentNode === null) {\n this.parentNode = node;\n this.rootNode = document.createElement('div');\n this.parentNode.appendChild(this.rootNode);\n this.reactRoot = createRoot(this.rootNode);\n }\n }\n\n updateMargins(title: BubbleSettingsImpl['chartSettings']['title']) {\n this.margins = {\n top: title.show ? TITLE_LINE_HEIGHT + TITLE_MARGIN * 2 : MIN_MARGIN,\n bottom: MIN_MARGIN,\n left: MIN_MARGIN,\n right: this.legend.width,\n };\n this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right;\n this.chartSizes.totalHeight =\n this.margins.top + Math.max(this.chartSizes.chartsHeight, this.legend.height) + this.margins.bottom;\n }\n\n updateLegendSize(\n legend: BubbleSettingsImpl['chartSettings']['legend'],\n columnValueColor: ColumnName,\n columnValueSize: ColumnName,\n facetKeys: string[]\n ) {\n if (!legend.show) {\n this.legend = {width: 0, height: 0, items: []};\n return;\n }\n\n const legendItems: LegendItem[] = [];\n const continuousHeight = Math.min(\n Math.max(this.chartSizes.chartHeight, DEFAULT_HEIGHT_SMALL),\n DEFAULT_HEIGHT\n );\n const legendHeight = Math.max(this.chartSizes.chartHeight, continuousHeight);\n const emptySizes = {width:0, height:0, left:0, top: 0};\n\n const colorDomain = this.colorScale.domain();\n const colorValues = getContinuousLegendTicks(this.colorScale, [\n colorDomain[0],\n colorDomain[colorDomain.length - 1],\n ]);\n const colorTitle = columnValueColor.label ?? columnValueColor.value;\n const tickPositionScale = scaleLinear([colorValues[0], colorValues[colorValues.length - 1]], [continuousHeight, 0]); //TODO: update during adding log scale for heatmap\n \n legendItems.push({\n id: 'colorValue',\n type: 'continuous',\n scale: this.colorScale,\n tickPositionScale,\n values: colorValues,\n title: colorTitle,\n ...emptySizes\n });\n\n const sizeTitle = columnValueSize.label ?? columnValueSize.value;\n const sizeValues = this.sizeScale.ticks(3);\n const format = this.sizeScale.tickFormat(3);\n const labels = sizeValues.reduce((res: Record<string, string>, v) => {\n res[String(v)] = format(v);\n return res;\n }, {});\n legendItems.push({\n id: 'sizeValue',\n type: 'size',\n title: sizeTitle,\n scale: this.sizeScale,\n values: sizeValues,\n labels,\n ...emptySizes\n });\n\n if (!legendItems.length) {\n this.legend = {width: 0, height: 0, items: []};\n return;\n }\n\n const items = arrangeLegendParts(legendItems, legendHeight, continuousHeight);\n\n const lastItem = items[items.length - 1];\n const legendWidth = lastItem.left + lastItem.width + 2 * LEGEND_OFFSET;\n\n const leftTopChartPadding = this.chartsDimensions[facetKeys[0]].padding; // additional offset of legend for alignment with chart\n\n this.legend = {\n width: legendWidth,\n height: legendHeight + leftTopChartPadding.top,\n items: items,\n };\n }\n\n updateCaptionsSize(\n groupedCells: GroupedCellsData,\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis']\n ) {\n const textMeasurer = new TextMeasurer('bold 14px Arial');\n const {xKeys, yKeys, xLabels, yLabels} = groupedCells.meta;\n this.labelAngles = {\n xAxisLabels: xAxis.axisLabelsAngle,\n yAxisLabels: yAxis.axisLabelsAngle,\n };\n let maxXLabelSize = 0;\n let maxYLabelSize = 0;\n for (const xKey of xKeys) {\n const l = textMeasurer.getTextWidth(xLabels[xKey]);\n if (l > maxXLabelSize) {\n maxXLabelSize = l;\n }\n }\n for (const yKey of yKeys) {\n const l = textMeasurer.getTextWidth(yLabels[yKey]);\n if (l > maxYLabelSize) {\n maxYLabelSize = l;\n }\n }\n const {xCaptionTail, yCaptionTail} = calculateCaptionTails(\n this.labelAngles,\n this.step,\n groupedCells,\n textMeasurer\n );\n const xLabelAngle = (this.labelAngles.xAxisLabels / 180) * Math.PI;\n const yLabelAngle = (this.labelAngles.yAxisLabels / 180) * Math.PI;\n this.captionsSizes = {\n xCaptionTail,\n yCaptionTail,\n xAxisCaptions: maxXLabelSize * Math.sin(xLabelAngle) || TITLE_LINE,\n yAxisCaptions: maxYLabelSize * Math.sin(yLabelAngle) || TITLE_LINE,\n };\n }\n\n updateChartDimensions(\n facetKeys: string[],\n facetSettings: BubbleSettingsImpl['facetSettings'],\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis']\n ) {\n const facetCount = facetKeys.length;\n const maxNRows = Math.min(facetSettings.nRows ?? facetCount, facetCount);\n const maxNCols = Math.min(facetSettings.nCols ?? facetCount, facetCount);\n // Use columns/rows count from settings if some of them defined, else make 1 column\n this.columnsCount = facetSettings.nRows ? Math.ceil(facetCount / maxNRows) : maxNCols;\n this.rowsCount = Math.ceil(facetCount / this.columnsCount);\n this.chartsDimensions = {};\n\n let currentLeft = 0;\n let currentTop = 0;\n facetKeys.forEach((key, index) => {\n const currentColumn = (index % this.columnsCount) + 1;\n const chartSides = getChartEdgeSides(index, facetKeys.length, this.columnsCount, this.rowsCount);\n const width = this.chartSizes.chartWidth;\n const height = this.chartSizes.chartHeight;\n const sideElementSizes = calculateChartSideElementSizes(\n xAxis,\n yAxis,\n this.captionsSizes,\n chartSides,\n facetKeys,\n this.step.x,\n this.step.y\n );\n\n function getPadding(side: 'left' | 'right' | 'top' | 'bottom') {\n return Math.max(\n CHART_SIDE_ELEMENTS[side].reduce((res, el) => res + sideElementSizes[side][el], 0),\n MIN_PADDING\n );\n }\n\n const padding = {\n left: getPadding('left'),\n right: getPadding('right'),\n top: getPadding('top'),\n bottom: getPadding('bottom'),\n };\n if (padding.left < this.captionsSizes.xCaptionTail) {\n padding.left = this.captionsSizes.xCaptionTail;\n }\n if (padding.bottom < this.captionsSizes.yCaptionTail) {\n padding.bottom = this.captionsSizes.yCaptionTail;\n }\n const sideElementBBoxes = calculateSideElementsBBoxes(sideElementSizes, width, height);\n const outerWidth = width + padding.left + padding.right;\n const outerHeight = height + padding.top + padding.bottom;\n this.chartsDimensions[key] = {\n left: currentLeft,\n top: currentTop,\n inner: {width, height},\n outer: {width: outerWidth, height: outerHeight},\n padding,\n sideElementBBoxes,\n chartEdgeSides: chartSides,\n };\n currentLeft += outerWidth;\n if (currentColumn === this.columnsCount) {\n currentLeft = 0;\n currentTop += outerHeight;\n }\n });\n\n // sum of widths of first row\n const chartsWidth = facetKeys\n .slice(0, this.columnsCount)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.width, 0);\n // sum of heights of first column\n const chartsHeight = facetKeys\n .filter((_key, index) => index % this.columnsCount === 0)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.height, 0);\n this.chartSizes.chartsWidth = chartsWidth;\n this.chartSizes.chartsHeight = chartsHeight;\n }\n\n updateChartsSizes(groupedCellsData: GroupedCellsData, size: BubbleSettingsImpl['chartSettings']['size']) {\n const {width, height, cellSize} = size;\n if (cellSize) {\n this.chartSizes.chartWidth = groupedCellsData.meta.xKeys.length * cellSize;\n this.chartSizes.chartHeight = groupedCellsData.meta.yKeys.length * cellSize;\n }\n if (width && height) {\n this.chartSizes.chartWidth = width;\n this.chartSizes.chartHeight = height;\n }\n }\n\n // update scales for cell positions, x and y for each facet\n updateScales(\n groupedCells: GroupedCellsData,\n size: BubbleSettingsImpl['chartSettings']['size'],\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis'],\n ) {\n const {width, height, cellSize} = size;\n const {meta} = groupedCells;\n const sortX = (arr: string[], labels: Record<string, string> = {}) => {\n return [...arr].sort((a, b) => xAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', {numeric: true})\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', {numeric: true})\n );\n };\n const sortY = (arr: string[], labels: Record<string, string> = {}) => {\n return [...arr].sort((a, b) => yAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', {numeric: true})\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', {numeric: true})\n );\n };\n const xKeys = sortX(meta.xKeys, meta.xLabels);\n const yKeys = sortY(meta.yKeys, meta.yLabels);\n if (cellSize) {\n this.step.x = cellSize;\n this.step.y = cellSize;\n } else if (width && height) {\n this.step.x = width / xKeys.length;\n this.step.y = height / yKeys.length;\n }\n const xPositions: number[] = new Array(xKeys.length).fill(null).map((_v, idx) => idx * this.step.x);\n const yPositions: number[] = new Array(yKeys.length).fill(null).map((_v, idx) => idx * this.step.y);\n this.scales.x = scaleOrdinal<string, number>().domain(xKeys).range(xPositions);\n this.scales.y = scaleOrdinal<string, number>().domain(yKeys).range(yPositions);\n }\n\n updateAesScale(\n aes: BubbleSettingsImpl['aes'],\n valueExtentSize: [number, number],\n valueExtentColor: [number, number],\n normalization: BubbleSettingsImpl['normalization']\n ) {\n this.colorScale = scaleLinear<string, string>()\n .domain(getContinuousColorRange(normalization, aes.colorsList.length, valueExtentColor))\n .range(aes.colorsList);\n this.sizeScale = scaleSqrt(valueExtentSize, [aes.minRadius, aes.maxRadius]);\n }\n\n render(\n settingsId: string,\n chartSettings: BubbleSettingsImpl['chartSettings'],\n facetSettings: BubbleSettingsImpl['facetSettings'],\n facetKeys: string[],\n groupedCellsData: GroupedCellsData,\n valueColumnColor: ColumnName,\n valueColumnSize: ColumnName,\n normalization: BubbleSettingsImpl['normalization'],\n aes: BubbleSettingsImpl['aes'],\n onTooltipHintSwitch: (v:boolean) => void\n ) {\n const {meta, facets} = groupedCellsData;\n const {valueExtentSize, valueExtentColor} = meta;\n const {xAxis, yAxis, title, size} = chartSettings;\n this.updateChartsSizes(groupedCellsData, size);\n this.updateAesScale(aes, valueExtentSize, valueExtentColor, normalization);\n this.updateScales(groupedCellsData, size, chartSettings.xAxis, chartSettings.yAxis);\n // caption sizes are needed for chart paddings in chart dimensions\n this.updateCaptionsSize(groupedCellsData, xAxis, yAxis);\n this.updateChartDimensions(facetKeys, facetSettings, xAxis, yAxis);\n this.updateLegendSize(chartSettings.legend, valueColumnColor, valueColumnSize, facetKeys);\n this.updateMargins(title);\n const component = (\n <ChartsGroup\n aes={aes}\n captionsSizes={this.captionsSizes}\n cellsMeta={meta}\n columnsCount={this.columnsCount}\n chartsDimensions={this.chartsDimensions}\n chartSettings={chartSettings}\n chartSizes={this.chartSizes}\n sizeScale={this.sizeScale as (v: DataValue) => number}\n colorScale={this.colorScale as (v: DataValue) => string}\n facetKeys={facetKeys}\n facetSettings={facetSettings}\n groupedCells={facets}\n labelAngles={this.labelAngles}\n legend={this.legend}\n margins={this.margins}\n scales={this.scales}\n settingsId={settingsId}\n step={this.step}\n onTooltipHintSwitch={onTooltipHintSwitch}\n />\n );\n this.component = component;\n this.reactRoot?.render(component);\n }\n\n renderError(message: string) {\n this.reactRoot?.render(<Error message={message} />);\n }\n}\n\nexport default ChartRenderer;\n"],"names":["getSteps","count","valueExtent","min","max","steps","i","step","getContinuousColorRange","normalization","colorsCount","extent","ChartRenderer","__publicField","jsx","Fragment","DEFAULT_WIDTH","DEFAULT_HEIGHT","MIN_MARGIN","scaleOrdinal","scaleLinear","scaleSqrt","_a","node","createRoot","title","TITLE_LINE_HEIGHT","TITLE_MARGIN","legend","columnValueColor","columnValueSize","facetKeys","legendItems","continuousHeight","DEFAULT_HEIGHT_SMALL","legendHeight","emptySizes","colorDomain","colorValues","getContinuousLegendTicks","colorTitle","tickPositionScale","sizeTitle","sizeValues","format","labels","res","v","items","arrangeLegendParts","lastItem","legendWidth","LEGEND_OFFSET","leftTopChartPadding","groupedCells","xAxis","yAxis","textMeasurer","TextMeasurer","xKeys","yKeys","xLabels","yLabels","maxXLabelSize","maxYLabelSize","xKey","l","yKey","xCaptionTail","yCaptionTail","calculateCaptionTails","xLabelAngle","yLabelAngle","TITLE_LINE","facetSettings","facetCount","maxNRows","maxNCols","currentLeft","currentTop","key","index","currentColumn","chartSides","getChartEdgeSides","width","height","sideElementSizes","calculateChartSideElementSizes","getPadding","side","CHART_SIDE_ELEMENTS","el","MIN_PADDING","padding","sideElementBBoxes","calculateSideElementsBBoxes","outerWidth","outerHeight","chartsWidth","sum","chartsHeight","_key","groupedCellsData","size","cellSize","meta","sortX","arr","a","b","sortY","xPositions","_v","idx","yPositions","aes","valueExtentSize","valueExtentColor","settingsId","chartSettings","valueColumnColor","valueColumnSize","onTooltipHintSwitch","facets","component","ChartsGroup","message","Error"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,MAAMA,KAAW,CAACC,GAAeC,MAA0B;AACvD,QAAMC,IAAM,KAAK,IAAI,GAAGD,CAAW,GAC7BE,IAAM,KAAK,IAAI,GAAGF,CAAW;AACnC,MAAIC,MAAQC,GAAK;AACb,UAAMC,IAAQJ,IAAQ,MAAM,IAAI,CAAA,IAAK,CAACE,CAAG;AACzC,aAASG,IAAI,GAAGA,IAAIL,IAAQ,IAAI,GAAGK;AAC/BD,QAAM,KAAKF,IAAMG,CAAC,GAClBD,EAAM,QAAQF,IAAMG,CAAC;AAEzB,WAAOD;AAAAA,EACX;AACA,MAAIJ,IAAQ;AACR,WAAO,CAACE,GAAKC,CAAG;AAEpB,QAAMG,KAAQH,IAAMD,MAAQF,IAAQ,IAC9BI,IAAQ,CAAA;AACd,WAASC,IAAI,GAAGA,IAAIL,IAAQ,GAAGK;AAC3BD,IAAAA,EAAM,KAAKF,IAAMI,IAAOD,CAAC;AAE7B,SAAAD,EAAM,KAAKD,CAAG,GACPC;AACX;AAEA,SAASG,GACLC,GACAC,GACAR,GACF;AACE,MAAIS,IAAST;AACb,SAAIO,MACIA,EAAc,eACdE,IAASF,EAAc,aAEvBA,EAAc,WAAW,sBACzBE,IAAS,CAAC,IAAI,CAAC,IAEfF,EAAc,WAAW,wBACzBE,IAAS,CAAC,OAAO,IAAI,KAGtBX,GAASU,GAAaC,CAAM;AACvC;AAEA,MAAMC,GAAc;AAAA,EAApB,cAAA;AACIC,MAAA,MAAA,aAAyB,IAAA,GACzBA,EAAA,MAAA,cAAiC,IAAA,GACjCA,EAAA,MAAA,YAA+B,IAAA,GAC/BA,EAAA,MAAA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AL;AAAAA,QACA,MAAM,KAAK;AAAA,QACX,qBAAAI;AAAAA,MAAA;AAAA,IAAA;AAGR,SAAK,YAAYE,IACjBvG,IAAA,KAAK,cAAL,QAAAA,EAAgB,OAAOuG,CAAAA;AAAAA,EAC3B;AAAA,EAEA,YAAYE,GAAiB;;AACzB,KAAAzG,IAAA,KAAK,cAAL,QAAAA,EAAgB,OAAOR,gBAAAA,EAAAA,IAACkH,GAAA,EAAM,SAAAD,EAAAA,CAAkB,CAAA;AAAA,EACpD;AACJ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ChartRenderer.js","sources":["../../../../../../node_modules/@milaboratories/miplots4/src/bubble/ChartRenderer.tsx"],"sourcesContent":["import type { ScaleLinear, ScalePower } from 'd3-scale';\nimport { scaleLinear, scaleOrdinal, scaleSqrt } from 'd3-scale';\nimport type { ReactElement } from 'react';\nimport type { Root } from 'react-dom/client';\nimport { createRoot } from 'react-dom/client';\nimport { Error } from '../common/Error';\nimport type { LegendData, LegendItem } from '../common/types';\nimport { DataFrameProvider } from '../common/useDataFrame';\nimport { DEFAULT_HEIGHT, DEFAULT_HEIGHT_SMALL, DEFAULT_WIDTH, TITLE_LINE_HEIGHT, TITLE_MARGIN } from '../constants';\nimport type { DataFrame } from '../DataFrame';\nimport type { ColumnName, DataValue } from '../types';\nimport { arrangeLegendParts } from '../utils/arrangeLegendParts';\nimport { getChartEdgeSides } from '../utils/getChartEdgeSides';\nimport { getContinuousLegendTicks } from '../utils/getContinuousLegendTicks';\nimport { TextMeasurer } from '../utils/TextMeasurer/TextMeasurer';\nimport type { BubbleSettingsImpl } from './BubbleSettingsImpl';\nimport { ChartsGroup } from './components/ChartsGroup';\nimport type {\n CaptionsSizes,\n ChartDimensionsData, ChartScales, ChartSizes,\n LabelAngles,\n Margins\n} from './components/types';\nimport { CHART_SIDE_ELEMENTS, LEGEND_OFFSET, MIN_MARGIN, MIN_PADDING, TITLE_LINE } from './constants';\nimport type { Cell, GroupedCellsData } from './getGroupedCellsData';\nimport { calculateChartSideElementSizes, calculateSideElementsBBoxes } from './utils';\nimport { calculateCaptionTails } from './utils/calculateCaptionTails';\n\nconst getSteps = (count: number, valueExtent: number[]) => {\n const min = Math.min(...valueExtent);\n const max = Math.max(...valueExtent);\n if (min === max) {\n const steps = count % 2 === 0 ? [] : [min];\n for (let i = 1; i < count / 2 + 1; i++) {\n steps.push(min + i);\n steps.unshift(min - i);\n }\n return steps;\n }\n if (count < 2) {\n return [min, max];\n }\n const step = (max - min) / (count - 1);\n const steps = [];\n for (let i = 0; i < count - 1; i++) {\n steps.push(min + step * i);\n }\n steps.push(max);\n return steps;\n};\n\nfunction getContinuousColorRange(\n normalization: BubbleSettingsImpl['normalization'],\n colorsCount: number,\n valueExtent: number[]\n) {\n let extent = valueExtent;\n if (normalization) {\n if (normalization.colorRange) {\n extent = normalization.colorRange;\n }\n if (normalization.method === 'standardScaling') {\n extent = [-2, 2];\n }\n if (normalization.method === 'meanNormalization') {\n extent = [-0.75, 0.75];\n }\n }\n return getSteps(colorsCount, extent);\n}\n\nclass ChartRenderer {\n reactRoot: Root | null = null;\n parentNode: HTMLElement | null = null;\n rootNode: HTMLElement | null = null;\n component: ReactElement = (<></>);\n chartsDimensions: Record<string, ChartDimensionsData> = {};\n chartSizes: ChartSizes = {\n chartWidth: DEFAULT_WIDTH, // width of single chart\n chartHeight: DEFAULT_HEIGHT, // height of single chart\n chartsWidth: DEFAULT_WIDTH, // width of all charts in charts row\n chartsHeight: DEFAULT_HEIGHT, // width of all charts in charts column, without axes\n totalWidth: DEFAULT_WIDTH, // width of all charts in charts row, plus left axis, plus legend\n totalHeight: DEFAULT_HEIGHT, // width of all charts in charts height, plus bottom axis, plus top title\n };\n margins: Margins = {\n top: MIN_MARGIN,\n bottom: MIN_MARGIN,\n left: MIN_MARGIN,\n right: MIN_MARGIN,\n };\n captionsSizes: CaptionsSizes = {\n xAxisCaptions: 100,\n yAxisCaptions: 100,\n xCaptionTail: 0,\n yCaptionTail: 0,\n };\n labelAngles: LabelAngles = {\n xAxisLabels: 0,\n yAxisLabels: 0,\n };\n columnsCount = 1;\n rowsCount = 1;\n scales: ChartScales = {\n x: scaleOrdinal<string, number>().domain(['null']).range([1]),\n y: scaleOrdinal<string, number>().domain(['null']).range([1]),\n };\n step: {x: number; y: number} = {x: 10, y: 10};\n colorScale: ScaleLinear<string, string> = scaleLinear<string, string>().domain([0, 1]).range(['white', 'black']);\n sizeScale: ScalePower<number, number> = scaleSqrt().domain([0, 1]).range([3, 20]);\n legend: LegendData = {\n width: 0,\n height: 0,\n items: [],\n };\n\n clear() {\n if (this.parentNode && this.rootNode) {\n this.parentNode?.removeChild(this.rootNode);\n this.parentNode = null;\n this.rootNode = null;\n }\n // timeout to avoid trying to unmount during rendering\n setTimeout(() => {\n this.reactRoot?.unmount();\n this.reactRoot = null;\n });\n }\n\n init(node: HTMLElement) {\n if (this.parentNode === null) {\n this.parentNode = node;\n this.rootNode = document.createElement('div');\n this.parentNode.appendChild(this.rootNode);\n this.reactRoot = createRoot(this.rootNode);\n }\n }\n\n updateMargins(title: BubbleSettingsImpl['chartSettings']['title']) {\n this.margins = {\n top: title.show ? TITLE_LINE_HEIGHT + TITLE_MARGIN * 2 : MIN_MARGIN,\n bottom: MIN_MARGIN,\n left: MIN_MARGIN,\n right: this.legend.width,\n };\n this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right;\n this.chartSizes.totalHeight =\n this.margins.top + Math.max(this.chartSizes.chartsHeight, this.legend.height) + this.margins.bottom;\n }\n\n updateLegendSize(\n legend: BubbleSettingsImpl['chartSettings']['legend'],\n columnValueColor: ColumnName,\n columnValueSize: ColumnName,\n facetKeys: string[]\n ) {\n if (!legend.show) {\n this.legend = {width: 0, height: 0, items: []};\n return;\n }\n\n const legendItems: LegendItem[] = [];\n const continuousHeight = Math.min(\n Math.max(this.chartSizes.chartHeight, DEFAULT_HEIGHT_SMALL),\n DEFAULT_HEIGHT\n );\n const legendHeight = Math.max(this.chartSizes.chartHeight, continuousHeight);\n const emptySizes = {width:0, height:0, left:0, top: 0};\n\n const colorDomain = this.colorScale.domain();\n const colorValues = getContinuousLegendTicks(this.colorScale, [\n colorDomain[0],\n colorDomain[colorDomain.length - 1],\n ]);\n const colorTitle = columnValueColor.label ?? columnValueColor.value;\n const tickPositionScale = scaleLinear([colorValues[0], colorValues[colorValues.length - 1]], [continuousHeight, 0]); //TODO: update during adding log scale for heatmap\n \n legendItems.push({\n id: 'colorValue',\n type: 'continuous',\n scale: this.colorScale,\n tickPositionScale,\n values: colorValues,\n title: colorTitle,\n ...emptySizes\n });\n\n const sizeTitle = columnValueSize.label ?? columnValueSize.value;\n const sizeValues = this.sizeScale.ticks(3);\n const format = this.sizeScale.tickFormat(3);\n const labels = sizeValues.reduce((res: Record<string, string>, v) => {\n res[String(v)] = format(v);\n return res;\n }, {});\n legendItems.push({\n id: 'sizeValue',\n type: 'size',\n title: sizeTitle,\n scale: this.sizeScale,\n values: sizeValues,\n labels,\n ...emptySizes\n });\n\n if (!legendItems.length) {\n this.legend = {width: 0, height: 0, items: []};\n return;\n }\n\n const items = arrangeLegendParts(legendItems, legendHeight, continuousHeight);\n\n const lastItem = items[items.length - 1];\n const legendWidth = lastItem.left + lastItem.width + 2 * LEGEND_OFFSET;\n\n const leftTopChartPadding = this.chartsDimensions[facetKeys[0]].padding; // additional offset of legend for alignment with chart\n\n this.legend = {\n width: legendWidth,\n height: legendHeight + leftTopChartPadding.top,\n items: items,\n };\n }\n\n updateCaptionsSize(\n groupedCells: GroupedCellsData,\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis']\n ) {\n const textMeasurer = new TextMeasurer('bold 14px Arial');\n const {xKeys, yKeys, xLabels, yLabels} = groupedCells.meta;\n this.labelAngles = {\n xAxisLabels: xAxis.axisLabelsAngle,\n yAxisLabels: yAxis.axisLabelsAngle,\n };\n let maxXLabelSize = 0;\n let maxYLabelSize = 0;\n for (const xKey of xKeys) {\n const l = textMeasurer.getTextWidth(xLabels[xKey]);\n if (l > maxXLabelSize) {\n maxXLabelSize = l;\n }\n }\n for (const yKey of yKeys) {\n const l = textMeasurer.getTextWidth(yLabels[yKey]);\n if (l > maxYLabelSize) {\n maxYLabelSize = l;\n }\n }\n const {xCaptionTail, yCaptionTail} = calculateCaptionTails(\n this.labelAngles,\n this.step,\n groupedCells,\n textMeasurer\n );\n const xLabelAngle = (this.labelAngles.xAxisLabels / 180) * Math.PI;\n const yLabelAngle = (this.labelAngles.yAxisLabels / 180) * Math.PI;\n this.captionsSizes = {\n xCaptionTail,\n yCaptionTail,\n xAxisCaptions: maxXLabelSize * Math.sin(xLabelAngle) || TITLE_LINE,\n yAxisCaptions: maxYLabelSize * Math.sin(yLabelAngle) || TITLE_LINE,\n };\n }\n\n updateChartDimensions(\n facetKeys: string[],\n facetSettings: BubbleSettingsImpl['facetSettings'],\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis']\n ) {\n const facetCount = facetKeys.length;\n const maxNRows = Math.min(facetSettings.nRows ?? facetCount, facetCount);\n const maxNCols = Math.min(facetSettings.nCols ?? facetCount, facetCount);\n // Use columns/rows count from settings if some of them defined, else make 1 column\n this.columnsCount = facetSettings.nRows ? Math.ceil(facetCount / maxNRows) : maxNCols;\n this.rowsCount = Math.ceil(facetCount / this.columnsCount);\n this.chartsDimensions = {};\n\n let currentLeft = 0;\n let currentTop = 0;\n facetKeys.forEach((key, index) => {\n const currentColumn = (index % this.columnsCount) + 1;\n const chartSides = getChartEdgeSides(index, facetKeys.length, this.columnsCount, this.rowsCount);\n const width = this.chartSizes.chartWidth;\n const height = this.chartSizes.chartHeight;\n const sideElementSizes = calculateChartSideElementSizes(\n xAxis,\n yAxis,\n this.captionsSizes,\n chartSides,\n facetKeys,\n this.step.x,\n this.step.y\n );\n\n function getPadding(side: 'left' | 'right' | 'top' | 'bottom') {\n return Math.max(\n CHART_SIDE_ELEMENTS[side].reduce((res, el) => res + sideElementSizes[side][el], 0),\n MIN_PADDING\n );\n }\n\n const padding = {\n left: getPadding('left'),\n right: getPadding('right'),\n top: getPadding('top'),\n bottom: getPadding('bottom'),\n };\n if (padding.left < this.captionsSizes.xCaptionTail) {\n padding.left = this.captionsSizes.xCaptionTail;\n }\n if (padding.bottom < this.captionsSizes.yCaptionTail) {\n padding.bottom = this.captionsSizes.yCaptionTail;\n }\n const sideElementBBoxes = calculateSideElementsBBoxes(sideElementSizes, width, height);\n const outerWidth = width + padding.left + padding.right;\n const outerHeight = height + padding.top + padding.bottom;\n this.chartsDimensions[key] = {\n left: currentLeft,\n top: currentTop,\n inner: {width, height},\n outer: {width: outerWidth, height: outerHeight},\n padding,\n sideElementBBoxes,\n chartEdgeSides: chartSides,\n };\n currentLeft += outerWidth;\n if (currentColumn === this.columnsCount) {\n currentLeft = 0;\n currentTop += outerHeight;\n }\n });\n\n // sum of widths of first row\n const chartsWidth = facetKeys\n .slice(0, this.columnsCount)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.width, 0);\n // sum of heights of first column\n const chartsHeight = facetKeys\n .filter((_key, index) => index % this.columnsCount === 0)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.height, 0);\n this.chartSizes.chartsWidth = chartsWidth;\n this.chartSizes.chartsHeight = chartsHeight;\n }\n\n updateChartsSizes(groupedCellsData: GroupedCellsData, size: BubbleSettingsImpl['chartSettings']['size']) {\n const {width, height, cellSize} = size;\n if (cellSize) {\n this.chartSizes.chartWidth = groupedCellsData.meta.xKeys.length * cellSize;\n this.chartSizes.chartHeight = groupedCellsData.meta.yKeys.length * cellSize;\n }\n if (width && height) {\n this.chartSizes.chartWidth = width;\n this.chartSizes.chartHeight = height;\n }\n }\n\n // update scales for cell positions, x and y for each facet\n updateScales(\n groupedCells: GroupedCellsData,\n size: BubbleSettingsImpl['chartSettings']['size'],\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis'],\n ) {\n const {width, height, cellSize} = size;\n const {meta} = groupedCells;\n const sortX = (arr: string[], labels: Record<string, string> = {}) => {\n return [...arr].sort((a, b) => xAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', {numeric: true})\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', {numeric: true})\n );\n };\n const sortY = (arr: string[], labels: Record<string, string> = {}) => {\n return [...arr].sort((a, b) => yAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', {numeric: true})\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', {numeric: true})\n );\n };\n const xKeys = sortX(meta.xKeys, meta.xLabels);\n const yKeys = sortY(meta.yKeys, meta.yLabels);\n if (cellSize) {\n this.step.x = cellSize;\n this.step.y = cellSize;\n } else if (width && height) {\n this.step.x = width / xKeys.length;\n this.step.y = height / yKeys.length;\n }\n const xPositions: number[] = new Array(xKeys.length).fill(null).map((_v, idx) => idx * this.step.x);\n const yPositions: number[] = new Array(yKeys.length).fill(null).map((_v, idx) => idx * this.step.y);\n this.scales.x = scaleOrdinal<string, number>().domain(xKeys).range(xPositions);\n this.scales.y = scaleOrdinal<string, number>().domain(yKeys).range(yPositions);\n }\n\n updateAesScale(\n aes: BubbleSettingsImpl['aes'],\n valueExtentSize: [number, number],\n valueExtentColor: [number, number],\n normalization: BubbleSettingsImpl['normalization']\n ) {\n this.colorScale = scaleLinear<string, string>()\n .domain(getContinuousColorRange(normalization, aes.colorsList.length, valueExtentColor))\n .range(aes.colorsList);\n this.sizeScale = scaleSqrt(valueExtentSize, [aes.minRadius, aes.maxRadius]);\n }\n\n render(\n dataFrame: DataFrame,\n settingsId: string,\n chartSettings: BubbleSettingsImpl['chartSettings'],\n facetSettings: BubbleSettingsImpl['facetSettings'],\n groupedCellsData: GroupedCellsData,\n valueColumnColor: ColumnName,\n valueColumnSize: ColumnName,\n normalization: BubbleSettingsImpl['normalization'],\n aes: BubbleSettingsImpl['aes'],\n getCellTooltip: (cell: Cell) => string[],\n onTooltipHintSwitch: (v:boolean) => void\n ) {\n const {meta, facets, meta: { facetKeys }} = groupedCellsData;\n const {valueExtentSize, valueExtentColor} = meta;\n const {xAxis, yAxis, title, size} = chartSettings;\n this.updateChartsSizes(groupedCellsData, size);\n this.updateAesScale(aes, valueExtentSize, valueExtentColor, normalization);\n this.updateScales(groupedCellsData, size, chartSettings.xAxis, chartSettings.yAxis);\n // caption sizes are needed for chart paddings in chart dimensions\n this.updateCaptionsSize(groupedCellsData, xAxis, yAxis);\n this.updateChartDimensions(facetKeys, facetSettings, xAxis, yAxis);\n this.updateLegendSize(chartSettings.legend, valueColumnColor, valueColumnSize, facetKeys);\n this.updateMargins(title);\n const component = (\n <DataFrameProvider dataFrame={dataFrame}>\n <ChartsGroup\n aes={aes}\n captionsSizes={this.captionsSizes}\n cellsMeta={meta}\n columnsCount={this.columnsCount}\n chartsDimensions={this.chartsDimensions}\n chartSettings={chartSettings}\n chartSizes={this.chartSizes}\n sizeScale={this.sizeScale as (v: DataValue) => number}\n colorScale={this.colorScale as (v: DataValue) => string}\n facetKeys={facetKeys}\n facetSettings={facetSettings}\n groupedCells={facets}\n labelAngles={this.labelAngles}\n legend={this.legend}\n margins={this.margins}\n scales={this.scales}\n settingsId={settingsId}\n step={this.step}\n getCellTooltip={getCellTooltip}\n onTooltipHintSwitch={onTooltipHintSwitch}\n />\n </DataFrameProvider>\n );\n this.component = component;\n this.reactRoot?.render(component);\n }\n\n renderError(message: string) {\n this.reactRoot?.render(<Error message={message} />);\n }\n}\n\nexport default ChartRenderer;\n"],"names":["getSteps","count","valueExtent","min","max","steps","i","step","getContinuousColorRange","normalization","colorsCount","extent","ChartRenderer","__publicField","jsx","Fragment","DEFAULT_WIDTH","DEFAULT_HEIGHT","MIN_MARGIN","scaleOrdinal","scaleLinear","scaleSqrt","_a","node","createRoot","title","TITLE_LINE_HEIGHT","TITLE_MARGIN","legend","columnValueColor","columnValueSize","facetKeys","legendItems","continuousHeight","DEFAULT_HEIGHT_SMALL","legendHeight","emptySizes","colorDomain","colorValues","getContinuousLegendTicks","colorTitle","tickPositionScale","sizeTitle","sizeValues","format","labels","res","v","items","arrangeLegendParts","lastItem","legendWidth","LEGEND_OFFSET","leftTopChartPadding","groupedCells","xAxis","yAxis","textMeasurer","TextMeasurer","xKeys","yKeys","xLabels","yLabels","maxXLabelSize","maxYLabelSize","xKey","l","yKey","xCaptionTail","yCaptionTail","calculateCaptionTails","xLabelAngle","yLabelAngle","TITLE_LINE","facetSettings","facetCount","maxNRows","maxNCols","currentLeft","currentTop","key","index","currentColumn","chartSides","getChartEdgeSides","width","height","sideElementSizes","calculateChartSideElementSizes","getPadding","side","CHART_SIDE_ELEMENTS","el","MIN_PADDING","padding","sideElementBBoxes","calculateSideElementsBBoxes","outerWidth","outerHeight","chartsWidth","sum","chartsHeight","_key","groupedCellsData","size","cellSize","meta","sortX","arr","a","b","sortY","xPositions","_v","idx","yPositions","aes","valueExtentSize","valueExtentColor","dataFrame","settingsId","chartSettings","valueColumnColor","valueColumnSize","getCellTooltip","onTooltipHintSwitch","facets","component","DataFrameProvider","ChartsGroup","message","Error"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAMA,KAAW,CAACC,GAAeC,MAA0B;AACvD,QAAMC,IAAM,KAAK,IAAI,GAAGD,CAAW,GAC7BE,IAAM,KAAK,IAAI,GAAGF,CAAW;AACnC,MAAIC,MAAQC,GAAK;AACb,UAAMC,IAAQJ,IAAQ,MAAM,IAAI,CAAA,IAAK,CAACE,CAAG;AACzC,aAASG,IAAI,GAAGA,IAAIL,IAAQ,IAAI,GAAGK;AAC/BD,MAAAA,EAAM,KAAKF,IAAMG,CAAC,GAClBD,EAAM,QAAQF,IAAMG,CAAC;AAEzB,WAAOD;AAAAA,EACX;AACA,MAAIJ,IAAQ;AACR,WAAO,CAACE,GAAKC,CAAG;AAEpB,QAAMG,KAAQH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