@milaboratories/graph-maker 1.1.137 → 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 (283) hide show
  1. package/README.md +120 -24
  2. package/dist/GraphMaker/components/LassoControls/index.vue.js +15 -13
  3. package/dist/GraphMaker/components/LassoControls/index.vue.js.map +1 -1
  4. package/dist/GraphMaker/components/SettingsTabs/icons/AxesIcon.vue.d.ts.map +1 -0
  5. package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/AxesIcon.vue.js +1 -1
  6. package/dist/GraphMaker/components/SettingsTabs/icons/AxesIcon.vue.js.map +1 -0
  7. package/dist/GraphMaker/components/SettingsTabs/icons/DeleteChartIcon.vue.d.ts.map +1 -0
  8. package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/DeleteChartIcon.vue.js +1 -1
  9. package/dist/GraphMaker/components/SettingsTabs/icons/DeleteChartIcon.vue.js.map +1 -0
  10. package/dist/GraphMaker/components/SettingsTabs/icons/ExportIcon.vue.d.ts.map +1 -0
  11. package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/ExportIcon.vue.js +1 -1
  12. package/dist/GraphMaker/components/SettingsTabs/icons/ExportIcon.vue.js.map +1 -0
  13. package/dist/GraphMaker/components/SettingsTabs/icons/LayersIcon.vue.d.ts.map +1 -0
  14. package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LayersIcon.vue.js +1 -1
  15. package/dist/GraphMaker/components/SettingsTabs/icons/LayersIcon.vue.js.map +1 -0
  16. package/dist/GraphMaker/components/SettingsTabs/icons/LinkIcon.vue.d.ts.map +1 -0
  17. package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LinkIcon.vue.js +1 -1
  18. package/dist/GraphMaker/components/SettingsTabs/icons/LinkIcon.vue.js.map +1 -0
  19. package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.d.ts +3 -0
  20. package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.d.ts.map +1 -0
  21. package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.js +12 -0
  22. package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue.js.map +1 -0
  23. package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue2.js +5 -0
  24. package/dist/GraphMaker/components/SettingsTabs/icons/LogIcon.vue2.js.map +1 -0
  25. package/dist/GraphMaker/components/SettingsTabs/icons/SettingsIcon.vue.d.ts.map +1 -0
  26. package/dist/GraphMaker/components/SettingsTabs/index.vue.d.ts +2 -0
  27. package/dist/GraphMaker/components/SettingsTabs/index.vue.d.ts.map +1 -1
  28. package/dist/GraphMaker/components/SettingsTabs/index.vue.js +17 -15
  29. package/dist/GraphMaker/components/SettingsTabs/index.vue.js.map +1 -1
  30. package/dist/GraphMaker/forms/LogForm.vue.d.ts +19 -0
  31. package/dist/GraphMaker/forms/LogForm.vue.d.ts.map +1 -0
  32. package/dist/GraphMaker/forms/LogForm.vue.js +22 -0
  33. package/dist/GraphMaker/forms/LogForm.vue.js.map +1 -0
  34. package/dist/GraphMaker/forms/index.d.ts +22 -0
  35. package/dist/GraphMaker/forms/index.d.ts.map +1 -1
  36. package/dist/GraphMaker/forms/index.js +35 -28
  37. package/dist/GraphMaker/forms/index.js.map +1 -1
  38. package/dist/GraphMaker/index.vue.d.ts +1 -0
  39. package/dist/GraphMaker/index.vue.d.ts.map +1 -1
  40. package/dist/GraphMaker/index.vue.js +146 -144
  41. package/dist/GraphMaker/index.vue.js.map +1 -1
  42. package/dist/GraphMaker/store.d.ts.map +1 -1
  43. package/dist/GraphMaker/store.js +71 -67
  44. package/dist/GraphMaker/store.js.map +1 -1
  45. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +9 -3
  46. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
  47. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +17 -2
  48. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
  49. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +13 -4
  50. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
  51. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +28 -7
  52. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
  53. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +6 -2
  54. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
  55. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +16 -2
  56. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
  57. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +14 -2
  58. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
  59. package/dist/lib.js +1 -1
  60. package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js +95 -72
  61. package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js.map +1 -1
  62. package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +1 -1
  63. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js +124 -122
  64. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js.map +1 -1
  65. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js +72 -91
  66. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js.map +1 -1
  67. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js +43 -41
  68. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js.map +1 -1
  69. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js +28 -0
  70. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js.map +1 -0
  71. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js +94 -0
  72. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js.map +1 -0
  73. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +42 -38
  74. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
  75. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
  76. package/dist/node_modules/@milaboratories/miplots4/dist/common/Legend.js.map +1 -1
  77. package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js +11 -11
  78. package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js.map +1 -1
  79. package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js +20 -0
  80. package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js.map +1 -0
  81. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +181 -181
  82. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js.map +1 -1
  83. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js +2 -2
  84. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js.map +1 -1
  85. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js +45 -45
  86. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js.map +1 -1
  87. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js +27 -27
  88. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js.map +1 -1
  89. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Legend.js.map +1 -1
  90. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js +18 -18
  91. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js.map +1 -1
  92. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js +36 -36
  93. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js.map +1 -1
  94. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js +45 -41
  95. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js.map +1 -1
  96. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js +33 -33
  97. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js.map +1 -1
  98. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +90 -93
  99. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
  100. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +200 -199
  101. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js.map +1 -1
  102. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +17 -17
  103. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
  104. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/BoxElement.js.map +1 -1
  105. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +102 -99
  106. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
  107. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js +31 -36
  108. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js.map +1 -1
  109. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js +62 -74
  110. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js.map +1 -1
  111. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js +52 -53
  112. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js.map +1 -1
  113. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js +32 -32
  114. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js.map +1 -1
  115. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js +7 -6
  116. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js.map +1 -1
  117. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js +23 -23
  118. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js.map +1 -1
  119. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js +63 -63
  120. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js.map +1 -1
  121. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js +60 -64
  122. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js.map +1 -1
  123. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js +23 -23
  124. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js.map +1 -1
  125. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js +5 -5
  126. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js.map +1 -1
  127. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js +13 -13
  128. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map +1 -1
  129. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +258 -256
  130. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
  131. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +1 -1
  132. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
  133. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +45 -44
  134. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
  135. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +107 -106
  136. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
  137. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +18 -18
  138. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js.map +1 -1
  139. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +99 -95
  140. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
  141. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +30 -29
  142. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
  143. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js +1 -1
  144. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js.map +1 -1
  145. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
  146. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js +143 -142
  147. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js.map +1 -1
  148. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/HistogramSettingsImpl.js.map +1 -1
  149. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js +30 -30
  150. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js.map +1 -1
  151. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/ChartsGroup.js +7 -7
  152. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js +53 -54
  153. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js.map +1 -1
  154. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +59 -55
  155. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
  156. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/@d3fc/d3fc-axis/src/axisBase.js +7 -7
  157. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js +6 -12
  158. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js.map +1 -1
  159. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-shape/src/line.js.map +1 -1
  160. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js +148 -0
  161. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js.map +1 -0
  162. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js +172 -168
  163. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js.map +1 -1
  164. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +26 -26
  165. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  166. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js +11 -11
  167. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js +30 -29
  168. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js.map +1 -1
  169. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js +135 -153
  170. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js.map +1 -1
  171. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js +35 -32
  172. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js.map +1 -1
  173. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js +27 -27
  174. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
  175. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js +14 -14
  176. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/constants.js.map +1 -1
  177. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +24 -22
  178. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
  179. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +11 -14
  180. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
  181. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +57 -58
  182. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
  183. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js +85 -83
  184. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js.map +1 -1
  185. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js +20 -20
  186. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js.map +1 -1
  187. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +44 -37
  188. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
  189. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js +11 -0
  190. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
  191. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js +46 -56
  192. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js.map +1 -1
  193. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +223 -205
  194. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  195. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +22 -22
  196. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
  197. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js +42 -0
  198. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js.map +1 -0
  199. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js +84 -81
  200. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
  201. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/SVGLayer.js +11 -11
  202. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js +15 -14
  203. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js.map +1 -1
  204. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +89 -114
  205. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
  206. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +3 -1
  207. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
  208. package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +1 -1
  209. package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js.map +1 -1
  210. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +1 -1
  211. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
  212. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +1 -1
  213. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
  214. package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js +1 -1
  215. package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js.map +1 -1
  216. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +1 -1
  217. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
  218. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +4 -4
  219. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
  220. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js +39 -0
  221. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js.map +1 -0
  222. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js +101 -0
  223. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js.map +1 -0
  224. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js +4 -4
  225. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js.map +1 -1
  226. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js +3 -3
  227. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js.map +1 -1
  228. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +1031 -1023
  229. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
  230. package/package.json +3 -3
  231. package/dist/GraphMaker/icons/AxesIcon.vue.d.ts.map +0 -1
  232. package/dist/GraphMaker/icons/AxesIcon.vue.js.map +0 -1
  233. package/dist/GraphMaker/icons/DeleteChartIcon.vue.d.ts.map +0 -1
  234. package/dist/GraphMaker/icons/DeleteChartIcon.vue.js.map +0 -1
  235. package/dist/GraphMaker/icons/ExportIcon.vue.d.ts.map +0 -1
  236. package/dist/GraphMaker/icons/ExportIcon.vue.js.map +0 -1
  237. package/dist/GraphMaker/icons/LayersIcon.vue.d.ts.map +0 -1
  238. package/dist/GraphMaker/icons/LayersIcon.vue.js.map +0 -1
  239. package/dist/GraphMaker/icons/LinkIcon.vue.d.ts.map +0 -1
  240. package/dist/GraphMaker/icons/LinkIcon.vue.js.map +0 -1
  241. package/dist/GraphMaker/icons/SettingsIcon.vue.d.ts.map +0 -1
  242. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js +0 -91
  243. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js.map +0 -1
  244. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js +0 -30
  245. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js.map +0 -1
  246. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js +0 -29
  247. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js.map +0 -1
  248. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js +0 -12
  249. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js.map +0 -1
  250. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js +0 -7
  251. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js.map +0 -1
  252. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js +0 -26
  253. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js.map +0 -1
  254. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js +0 -7
  255. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js.map +0 -1
  256. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js +0 -51
  257. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js.map +0 -1
  258. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js +0 -21
  259. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js.map +0 -1
  260. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js +0 -7
  261. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js.map +0 -1
  262. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js +0 -12
  263. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js.map +0 -1
  264. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js +0 -14
  265. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js.map +0 -1
  266. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js +0 -19
  267. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js.map +0 -1
  268. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js +0 -11
  269. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js.map +0 -1
  270. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js +0 -11
  271. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js.map +0 -1
  272. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js +0 -24
  273. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js.map +0 -1
  274. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/AxesIcon.vue.d.ts +0 -0
  275. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/DeleteChartIcon.vue.d.ts +0 -0
  276. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/ExportIcon.vue.d.ts +0 -0
  277. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LayersIcon.vue.d.ts +0 -0
  278. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/LinkIcon.vue.d.ts +0 -0
  279. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue.d.ts +0 -0
  280. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue.js +0 -0
  281. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue.js.map +0 -0
  282. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue2.js +0 -0
  283. /package/dist/GraphMaker/{icons → components/SettingsTabs/icons}/SettingsIcon.vue2.js.map +0 -0
@@ -1,94 +1,117 @@
1
- import { l as g } from "./node_modules/lodash/lodash.js";
2
- import { exhaustive as w } from "./utils/index.js";
3
- var d = Object.defineProperty, f = (o, t, r) => t in o ? d(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r, u = (o, t, r) => f(o, typeof t != "symbol" ? t + "" : t, r);
4
- const m = Symbol("noGrouped");
5
- function C(o) {
6
- return "type" in o && o.type === "columns";
1
+ import { l as C } from "./node_modules/lodash/lodash.js";
2
+ import { exhaustive as c } from "./utils/index.js";
3
+ var f = Object.defineProperty, x = (s, e, t) => e in s ? f(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, u = (s, e, t) => x(s, typeof e != "symbol" ? e + "" : e, t);
4
+ const d = Symbol("noGrouped");
5
+ function y(s) {
6
+ return "type" in s && s.type === "columns";
7
7
  }
8
- class p {
9
- constructor(t, r) {
10
- u(this, "id"), u(this, "data"), u(this, "rowsCount"), u(this, "columnNames"), u(this, "rows"), u(this, "mapColumnCategories", /* @__PURE__ */ new Map()), u(this, "rowsGrouped"), this.id = t, this.data = r, this.columnNames = Object.keys(r), this.rowsCount = this.columnNames.length ? r[this.columnNames[0]].length : 0, this.rows = this.computeRows();
8
+ const p = new Uint16Array(0), w = class g {
9
+ constructor(e, t) {
10
+ u(this, "id"), u(this, "data"), u(this, "rowsCount"), u(this, "columnNames"), u(this, "rowIndexes"), u(this, "mapColumnCategories", /* @__PURE__ */ new Map()), u(this, "mapColumnCategoriesRowIndexes", /* @__PURE__ */ new Map()), u(this, "rowsGrouped"), this.id = e, this.data = t, this.columnNames = Object.keys(t), this.rowsCount = this.columnNames.length ? t[this.columnNames[0]].length : 0, this.rowIndexes = new Uint16Array(Array.from({ length: this.rowsCount }, (o, r) => r));
11
11
  }
12
- static from(t) {
13
- if (t instanceof p)
14
- return t;
15
- if (C(t))
16
- return new p(t.id, t.values);
17
- w(t, "Unknown input data format");
12
+ static from(e) {
13
+ if (e instanceof g)
14
+ return e;
15
+ if (y(e))
16
+ return new g(e.id, e.values);
17
+ c(e, "Unknown input data format");
18
18
  }
19
- computeRows() {
20
- const t = [];
21
- for (let r = 0; r < this.rowsCount; r++)
22
- t.push(
23
- this.columnNames.reduce((e, s) => (e[s] = this.data[s][r], e), {})
24
- );
25
- return t;
19
+ getColumn(e) {
20
+ return this.data[e];
26
21
  }
27
- getColumn(t) {
28
- return this.data[t];
22
+ getColumnValue(e, t) {
23
+ var o;
24
+ return (o = this.data[e]) == null ? void 0 : o[t];
29
25
  }
30
- getColumnCategories(t, r = !0) {
31
- if (!this.columnNames.includes(t))
32
- throw new Error(`Column ${t} does not exist`);
33
- const e = `${t}${r ? "" : "_not_null"}`;
34
- if (!this.mapColumnCategories.has(e)) {
35
- let s = this.getColumn(t);
36
- r && (s = s.filter((n) => n !== null)), this.mapColumnCategories.set(e, g.uniq(s.map(String)));
26
+ getColumnValueCategory(e, t) {
27
+ return g.toCategory(this.getColumnValue(e, t));
28
+ }
29
+ getColumnCategories(e, t = !0) {
30
+ this.mapColumnCategories.has(e) || this.computeColumnCategories(e);
31
+ const o = this.mapColumnCategories.get(e) ?? [];
32
+ return t && o && o.length > 0 && o[o.length - 1] === "null" ? o.slice(0, -1) : o;
33
+ }
34
+ getColumnCategoryRowIndex(e, t) {
35
+ var o;
36
+ const r = (o = this.mapColumnCategoriesRowIndexes.get(e)) == null ? void 0 : o.get(t);
37
+ if (r === void 0)
38
+ throw new Error(`Category ${t} not found in column ${e}`);
39
+ return r;
40
+ }
41
+ computeColumnCategories(e) {
42
+ if (!this.columnNames.includes(e))
43
+ throw new Error(`Column ${e} does not exist`);
44
+ const t = this.getColumn(e), o = /* @__PURE__ */ new Set(), r = [], i = /* @__PURE__ */ new Map();
45
+ let l = -1;
46
+ for (let n = 0; n < t.length; n++) {
47
+ const h = t[n];
48
+ if (o.has(h))
49
+ continue;
50
+ if (o.add(h), h === null) {
51
+ l = n;
52
+ continue;
53
+ }
54
+ const a = g.toCategory(h);
55
+ r.push(a), i.set(a, n);
37
56
  }
38
- return this.mapColumnCategories.get(e) ?? [];
57
+ l !== -1 && (r.push("null"), i.set("null", l)), this.mapColumnCategories.set(e, r), this.mapColumnCategoriesRowIndexes.set(e, i);
39
58
  }
40
- setGrouping(t) {
41
- const r = { grouped: {}, rows: this.rows };
42
- let e = [r];
43
- t.forEach((s) => {
44
- const n = s === null ? [m] : this.getColumnCategories(s, !1), h = [];
45
- e.forEach((i) => {
46
- if (s === null)
47
- i.grouped = {
48
- [m]: {
49
- rows: i.rows,
59
+ setGrouping(e) {
60
+ const t = { grouped: {}, rowIndexes: this.rowIndexes };
61
+ let o = [t];
62
+ e.forEach((r) => {
63
+ const i = r === null ? [d] : this.getColumnCategories(r, !1), l = [];
64
+ o.forEach((n) => {
65
+ if (r === null)
66
+ n.grouped = {
67
+ [d]: {
68
+ rowIndexes: n.rowIndexes,
50
69
  grouped: {}
51
70
  }
52
- }, h.push(i.grouped[m]);
71
+ }, l.push(n.grouped[d]);
53
72
  else {
54
- const c = g.groupBy(i.rows, (a) => String(a[s]));
55
- i.grouped = n.reduce((a, l) => (a[l] = {
56
- rows: c[l] ?? [],
73
+ const h = C.groupBy(n.rowIndexes, (a) => this.getColumnValueCategory(r, a));
74
+ n.grouped = i.reduce((a, m) => (a[m] = {
75
+ rowIndexes: new Uint16Array(h[m] ?? []),
57
76
  grouped: {}
58
- }, h.push(a[l]), a), {});
77
+ }, l.push(a[m]), a), {});
59
78
  }
60
- }), e = h;
61
- }), this.rowsGrouped = r.grouped;
79
+ }), o = l;
80
+ }), this.rowsGrouped = t.grouped;
62
81
  }
63
- getColumnByGrouping(t, r) {
82
+ // TODO: fix all places where this method is used
83
+ getColumnByGrouping(e, t) {
64
84
  if (!this.rowsGrouped)
65
85
  return [];
66
- if (!t.length)
67
- return this.rows.map((s) => Number(s[r]));
68
- let e = { grouped: this.rowsGrouped, rows: this.rows };
69
- return t.forEach((s) => {
70
- const n = e.grouped[s ?? "null"];
71
- if (!n)
86
+ if (!e.length)
87
+ return Array.from(this.rowIndexes).map((r) => Number(this.getColumnValue(t, r)));
88
+ let o = { grouped: this.rowsGrouped, rowIndexes: this.rowIndexes };
89
+ return e.forEach((r) => {
90
+ const i = o.grouped[r ?? "null"];
91
+ if (!i)
72
92
  return [];
73
- e = n;
74
- }), e.rows.map((s) => Number(s[r]));
93
+ o = i;
94
+ }), Array.from(o.rowIndexes).map((r) => Number(this.getColumnValue(t, r)));
75
95
  }
76
- getRowsByGrouping(t) {
96
+ // TODO: fix all places where this method is used
97
+ getRowsByGrouping(e) {
77
98
  if (!this.rowsGrouped)
78
- return [];
79
- if (!t.length)
80
- return this.rows;
81
- let r = { grouped: this.rowsGrouped, rows: this.rows };
82
- return t.forEach((e) => {
83
- const s = r.grouped[e];
84
- if (!s)
85
- return [];
86
- r = s;
87
- }), r.rows;
99
+ return p;
100
+ if (!e.length)
101
+ return this.rowIndexes;
102
+ let t = { grouped: this.rowsGrouped, rowIndexes: this.rowIndexes };
103
+ return e.forEach((o) => {
104
+ const r = t.grouped[o];
105
+ if (!r)
106
+ return p;
107
+ t = r;
108
+ }), t.rowIndexes;
88
109
  }
89
- }
110
+ };
111
+ u(w, "toCategory", (s) => String(s));
112
+ let G = w;
90
113
  export {
91
- p as DataFrame,
92
- m as NO_GROUPED
114
+ G as DataFrame,
115
+ d as NO_GROUPED
93
116
  };
94
117
  //# sourceMappingURL=DataFrame.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataFrame.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/DataFrame.ts"],"sourcesContent":["import { groupBy, uniq } from 'lodash';\nimport type { DataValue } from './types';\nimport { exhaustive } from './utils';\n\nexport type DataByColumns = {\n type: 'columns',\n values: Record<string, DataValue[]>,\n id: string\n}\nexport type DataSet = DataFrame | DataByColumns;\nexport const NO_GROUPED = Symbol('noGrouped');\nexport type GroupKey = string | typeof NO_GROUPED;\ntype Row = Record<string, DataValue>;\ntype RowsGroup = Record<\n GroupKey,\n {\n rows: Row[];\n grouped: RowsGroup;\n }\n>;\n\nfunction isDataByColumns (data:DataSet): data is DataByColumns {\n return 'type' in data && data.type === 'columns';\n}\n\nexport class DataFrame {\n readonly id: string;\n // input data grouped by columns\n readonly data: Record<string, DataValue[]>;\n readonly rowsCount: number;\n readonly columnNames: string[];\n readonly rows: Row[];\n\n readonly mapColumnCategories: Map<string, string[]> = new Map();\n\n rowsGrouped?: RowsGroup;\n\n static from (data: DataSet):DataFrame {\n if (data instanceof DataFrame) {\n return data;\n } else if (isDataByColumns(data)) {\n return new DataFrame(data.id, data.values);\n } else {\n exhaustive(data, 'Unknown input data format');\n }\n }\n\n constructor(id: string, data: Record<string, DataValue[]>) {\n this.id = id;\n this.data = data;\n this.columnNames = Object.keys(data);\n this.rowsCount = this.columnNames.length ? data[this.columnNames[0]].length : 0;\n this.rows = this.computeRows();\n }\n\n private computeRows() {\n const rows: Row[] = [];\n\n for (let i = 0; i < this.rowsCount; i++) {\n rows.push(\n this.columnNames.reduce((res: Record<string, DataValue>, key) => {\n res[key] = this.data[key][i];\n return res;\n }, {})\n );\n }\n\n return rows;\n }\n\n getColumn(key: string): DataValue[] {\n return this.data[key];\n }\n\n getColumnCategories(key: string, ignoreNull = true): string[] {\n if (!this.columnNames.includes(key)) {\n throw new Error(`Column ${key} does not exist`);\n }\n\n const fullKey = `${key}${ignoreNull ? '' : '_not_null'}`;\n\n if (!this.mapColumnCategories.has(fullKey)) {\n let columnData = this.getColumn(key);\n if (ignoreNull) columnData = columnData.filter((v) => v !== null);\n this.mapColumnCategories.set(fullKey, uniq(columnData.map(String)));\n }\n\n return this.mapColumnCategories.get(fullKey) ?? [];\n }\n\n setGrouping(groupingColumnIds: (string | null)[]) {\n const root = {grouped: {} as RowsGroup, rows: this.rows};\n let groups: RowsGroup[keyof RowsGroup][] = [root];\n groupingColumnIds.forEach(column => {\n const keys: GroupKey[] = column === null ? [NO_GROUPED] : this.getColumnCategories(column, false);\n const nextGroups: RowsGroup[keyof RowsGroup][] = [];\n groups.forEach(group => {\n if (column === null) {\n group.grouped = {\n [NO_GROUPED]: {\n rows: group.rows,\n grouped: {} as RowsGroup,\n },\n };\n nextGroups.push(group.grouped[NO_GROUPED]);\n } else {\n const groupedBy = groupBy(group.rows, row => String(row[column]));\n group.grouped = keys.reduce((res, key) => {\n res[key] = {\n rows: groupedBy[key as string] ?? [] as Row[],\n grouped: {} as RowsGroup,\n };\n nextGroups.push(res[key]);\n return res;\n }, {} as RowsGroup);\n }\n });\n groups = nextGroups;\n });\n this.rowsGrouped = root.grouped;\n }\n\n getColumnByGrouping(groupingKeys: GroupKey[], keyYColumn: string): number[] {\n if (!this.rowsGrouped) {\n return [];\n }\n if (!groupingKeys.length) {\n return this.rows.map(row => Number(row[keyYColumn]));\n }\n let result: {grouped: RowsGroup; rows: Row[]} = {grouped: this.rowsGrouped, rows: this.rows};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key ?? 'null'];\n if (!nextGroup) {\n return [];\n }\n result = nextGroup;\n });\n return result.rows.map(row => Number(row[keyYColumn]));\n }\n\n getRowsByGrouping(groupingKeys: GroupKey[]): Row[] {\n if (!this.rowsGrouped) {\n return [];\n }\n if (!groupingKeys.length) {\n return this.rows;\n }\n let result: {grouped: RowsGroup; rows: Row[]} = {grouped: this.rowsGrouped, rows: this.rows};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key];\n if (!nextGroup) {\n return [];\n }\n result = nextGroup;\n });\n return result.rows;\n }\n}\n"],"names":["NO_GROUPED","isDataByColumns","data","DataFrame","id","__publicField","exhaustive","rows","i","res","key","ignoreNull","fullKey","columnData","v","uniq","groupingColumnIds","root","groups","column","keys","nextGroups","group","groupedBy","groupBy","row","groupingKeys","keyYColumn","result","nextGroup"],"mappings":";;;AAUO,MAAMA,IAAa,OAAO,WAAW;AAW5C,SAASC,EAAiBC,GAAqC;AAC3D,SAAO,UAAUA,KAAQA,EAAK,SAAS;AAC3C;AAEO,MAAMC,EAAU;AAAA,EAsBnB,YAAYC,GAAYF,GAAmC;AArBlDG,MAAA,MAAA,IAAA,GAEAA,EAAA,MAAA,MAAA,GACAA,EAAA,MAAA,WAAA,GACAA,EAAA,MAAA,aAAA,GACAA,EAAA,MAAA,MAAA,GAEAA,EAAA,iDAAiD,IAAA,CAAA,GAE1DA,EAAA,MAAA,aAAA,GAaI,KAAK,KAAKD,GACV,KAAK,OAAOF,GACZ,KAAK,cAAc,OAAO,KAAKA,CAAI,GACnC,KAAK,YAAY,KAAK,YAAY,SAASA,EAAK,KAAK,YAAY,CAAC,CAAC,EAAE,SAAS,GAC9E,KAAK,OAAO,KAAK,YAAA;AAAA,EACrB;AAAA,EAhBA,OAAO,KAAMA,GAAyB;AAClC,QAAIA,aAAgBC;AAChB,aAAOD;AACX,QAAWD,EAAgBC,CAAI;AAC3B,aAAO,IAAIC,EAAUD,EAAK,IAAIA,EAAK,MAAM;AAEzCI,IAAAA,EAAWJ,GAAM,2BAA2B;AAAA,EAEpD;AAAA,EAUQ,cAAc;AAClB,UAAMK,IAAc,CAAA;AAEpB,aAASC,IAAI,GAAGA,IAAI,KAAK,WAAWA;AAChCD,MAAAA,EAAK;AAAA,QACD,KAAK,YAAY,OAAO,CAACE,GAAgCC,OACrDD,EAAIC,CAAG,IAAI,KAAK,KAAKA,CAAG,EAAEF,CAAC,GACpBC,IACR,CAAA,CAAE;AAAA,MAAA;AAIb,WAAOF;AAAAA,EACX;AAAA,EAEA,UAAUG,GAA0B;AAChC,WAAO,KAAK,KAAKA,CAAG;AAAA,EACxB;AAAA,EAEA,oBAAoBA,GAAaC,I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AAIC,CAAG,CAAC,GACjBD,IACR,EAAe;AAAA,QACtB;AAAA,MACJ,CAAC,GACDS,IAASG;AAAAA,IACb,CAAC,GACD,KAAK,cAAcJ,EAAK;AAAA,EAC5B;AAAA,EAEA,oBAAoBS,GAA0BC,GAA8B;AACxE,QAAI,CAAC,KAAK;AACN,aAAO,CAAA;AAEX,QAAI,CAACD,EAAa;AACd,aAAO,KAAK,KAAK,IAAI,CAAAD,MAAO,OAAOA,EAAIE,CAAU,CAAC,CAAC;AAEvD,QAAIC,IAA4C,EAAC,SAAS,KAAK,aAAa,MAAM,KAAK,KAAA;AACvF,WAAAF,EAAa,QAAQ,CAAAhB,MAAO;AACxB,YAAMmB,IAAYD,EAAO,QAAQlB,KAAO,MAAM;AAC9C,UAAI,CAACmB;AACD,eAAO,CAAA;AAEXD,MAAAA,IAASC;AAAAA,IACb,CAAC,GACMD,EAAO,KAAK,IAAI,CAAAH,MAAO,OAAOA,EAAIE,CAAU,CAAC,CAAC;AAAA,EACzD;AAAA,EAEA,kBAAkBD,GAAiC;AAC/C,QAAI,CAAC,KAAK;AACN,aAAO,CAAA;AAEX,QAAI,CAACA,EAAa;AACd,aAAO,KAAK;AAEhB,QAAIE,IAA4C,EAAC,SAAS,KAAK,aAAa,MAAM,KAAK,KAAA;AACvF,WAAAF,EAAa,QAAQ,CAAAhB,MAAO;AACxB,YAAMmB,IAAYD,EAAO,QAAQlB,CAAG;AACpC,UAAI,CAACmB;AACD,eAAO,CAAA;AAEXD,UAASC;AAAAA,IACb,CAAC,GACMD,EAAO;AAAA,EAClB;AACJ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"DataFrame.js","sources":["../../../../../node_modules/@milaboratories/miplots4/src/DataFrame.ts"],"sourcesContent":["import { groupBy } from 'lodash';\nimport type { Category, DataValue } from './types';\nimport { exhaustive } from './utils';\n\nexport type DataByColumns = {\n type: 'columns',\n values: Record<string, DataValue[]>,\n id: string\n}\nexport type DataSet = DataFrame | DataByColumns;\nexport const NO_GROUPED = Symbol('noGrouped');\nexport type GroupKey = string | typeof NO_GROUPED;\nexport type RowIndex = number;\ntype RowsGroup = Record<\n GroupKey,\n {\n rowIndexes: Uint16Array;\n grouped: RowsGroup;\n }\n>;\n\nfunction isDataByColumns (data:DataSet): data is DataByColumns {\n return 'type' in data && data.type === 'columns';\n}\n\ntype ColumnName = string;\n\nconst EMPTY_INDEXES = new Uint16Array(0);\n\nexport class DataFrame {\n static toCategory = (value: DataValue): string => String(value);\n\n readonly id: string;\n // input data grouped by columns\n readonly data: Record<string, DataValue[]>;\n readonly rowsCount: number;\n readonly columnNames: ColumnName[];\n readonly rowIndexes: Uint16Array;\n\n readonly mapColumnCategories: Map<ColumnName, Category[]> = new Map();\n readonly mapColumnCategoriesRowIndexes: Map<ColumnName, Map<Category, number>> = new Map();\n\n rowsGrouped?: RowsGroup;\n\n static from (data: DataSet):DataFrame {\n if (data instanceof DataFrame) {\n return data;\n } else if (isDataByColumns(data)) {\n return new DataFrame(data.id, data.values);\n } else {\n exhaustive(data, 'Unknown input data format');\n }\n }\n\n constructor(id: string, data: Record<string, DataValue[]>) {\n this.id = id;\n this.data = data;\n this.columnNames = Object.keys(data);\n this.rowsCount = this.columnNames.length ? data[this.columnNames[0]].length : 0;\n this.rowIndexes = new Uint16Array(Array.from({length: this.rowsCount}, (_, i) => i));\n }\n\n getColumn(key: string): DataValue[] {\n return this.data[key];\n }\n\n getColumnValue(key: string, index: number): DataValue {\n return this.data[key]?.[index];\n }\n\n getColumnValueCategory(key: string, index: number): Category {\n return DataFrame.toCategory(this.getColumnValue(key, index));\n }\n\n getColumnCategories(key: string, ignoreNull = true): Category[] {\n if (!this.mapColumnCategories.has(key)) {\n this.computeColumnCategories(key);\n }\n\n const categories = this.mapColumnCategories.get(key) ?? [];\n return ignoreNull && categories && categories.length > 0 && categories[categories.length - 1] === 'null'\n ? categories.slice(0, -1) // full copy without null to heavy for large datasets\n : categories; \n }\n\n getColumnCategoryRowIndex(key: string, value: Category): RowIndex {\n const rowIndex = this.mapColumnCategoriesRowIndexes.get(key)?.get(value);\n \n if (rowIndex === undefined) {\n throw new Error(`Category ${value} not found in column ${key}`);\n }\n\n return rowIndex;\n }\n\n private computeColumnCategories(key: ColumnName) {\n if (!this.columnNames.includes(key)) {\n throw new Error(`Column ${key} does not exist`);\n }\n \n const columnData = this.getColumn(key);\n const uniqValues = new Set<DataValue>();\n const categories: string[] = [];\n const categoriesIndexes = new Map<string, number>();\n let nullIdx = -1;\n for (let i = 0; i < columnData.length; i++) {\n const value = columnData[i];\n if (uniqValues.has(value)) {\n continue;\n }\n uniqValues.add(value);\n if (value === null) {\n nullIdx = i;\n continue;\n }\n const category = DataFrame.toCategory(value);\n categories.push(category);\n categoriesIndexes.set(category, i);\n }\n if (nullIdx !== -1) {\n categories.push('null');\n categoriesIndexes.set('null', nullIdx);\n }\n\n this.mapColumnCategories.set(key, categories);\n this.mapColumnCategoriesRowIndexes.set(key, categoriesIndexes);\n }\n\n setGrouping(groupingColumnIds: (string | null)[]) {\n const root = {grouped: {} as RowsGroup, rowIndexes: this.rowIndexes};\n let groups: RowsGroup[keyof RowsGroup][] = [root];\n groupingColumnIds.forEach(column => {\n const keys: GroupKey[] = column === null ? [NO_GROUPED] : this.getColumnCategories(column, false);\n const nextGroups: RowsGroup[keyof RowsGroup][] = [];\n groups.forEach(group => {\n if (column === null) {\n group.grouped = {\n [NO_GROUPED]: {\n rowIndexes: group.rowIndexes,\n grouped: {} as RowsGroup,\n },\n };\n nextGroups.push(group.grouped[NO_GROUPED]);\n } else {\n const groupedBy = groupBy(group.rowIndexes, idx => this.getColumnValueCategory(column, idx));\n group.grouped = keys.reduce((res, key) => {\n res[key] = {\n rowIndexes: new Uint16Array(groupedBy[key as string] ?? []),\n grouped: {} as RowsGroup,\n };\n nextGroups.push(res[key]);\n return res;\n }, {} as RowsGroup);\n }\n });\n groups = nextGroups;\n });\n this.rowsGrouped = root.grouped;\n }\n\n // TODO: fix all places where this method is used\n getColumnByGrouping(groupingKeys: GroupKey[], keyYColumn: string): number[] {\n if (!this.rowsGrouped) {\n return [];\n }\n if (!groupingKeys.length) {\n return Array.from(this.rowIndexes).map(idx => Number(this.getColumnValue(keyYColumn, idx)));\n }\n let result: {grouped: RowsGroup; rowIndexes: Uint16Array} = {grouped: this.rowsGrouped, rowIndexes: this.rowIndexes};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key ?? 'null'];\n if (!nextGroup) {\n return [];\n }\n result = nextGroup;\n });\n return Array.from(result.rowIndexes).map(idx => Number(this.getColumnValue(keyYColumn, idx)));\n }\n\n // TODO: fix all places where this method is used\n getRowsByGrouping(groupingKeys: GroupKey[]): Uint16Array {\n if (!this.rowsGrouped) {\n return EMPTY_INDEXES;\n }\n if (!groupingKeys.length) {\n return this.rowIndexes;\n }\n let result: {grouped: RowsGroup; rowIndexes: Uint16Array} = {grouped: this.rowsGrouped, rowIndexes: this.rowIndexes};\n groupingKeys.forEach(key => {\n const nextGroup = result.grouped[key];\n if (!nextGroup) {\n return EMPTY_INDEXES;\n }\n result = nextGroup;\n });\n return result.rowIndexes;\n }\n}\n"],"names":["NO_GROUPED","isDataByColumns","data","EMPTY_INDEXES","_DataFrame","id","__publicField","_","i","exhaustive","key","index","_a","ignoreNull","categories","value","rowIndex","columnData","uniqValues","categoriesIndexes","nullIdx","category","groupingColumnIds","root","groups","column","keys","nextGroups","group","groupedBy","groupBy","idx","res","groupingKeys","keyYColumn","result","nextGroup","DataFrame"],"mappings":";;;AAUO,MAAMA,IAAa,OAAO,WAAW;AAW5C,SAASC,EAAiBC,GAAqC;AAC3D,SAAO,UAAUA,KAAQA,EAAK,SAAS;AAC3C;AAIA,MAAMC,IAAgB,IAAI,YAAY,CAAC,GAE1BC,IAAN,MAAMA,EAAU;AAAA,EAyBnB,YAAYC,GAAYH,GAAmC;AAtBlDI,IAAAA,EAAA,MAAA,IAAA,GAEAA,EAAA,MAAA,MAAA,GACAA,EAAA,MAAA,WAAA,GACAA,EAAA,MAA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,GAAuC;AACrD,QAAI,CAAC,KAAK;AACN,aAAO9B;AAEX,QAAI,CAAC8B,EAAa;AACd,aAAO,KAAK;AAEhB,QAAIE,IAAwD,EAAC,SAAS,KAAK,aAAa,YAAY,KAAK,WAAA;AACzG,WAAAF,EAAa,QAAQ,CAAAvB,MAAO;AACxB,YAAM0B,IAAYD,EAAO,QAAQzB,CAAG;AACpC,UAAI,CAAC0B;AACD,eAAOjC;AAEXgC,UAASC;AAAAA,IACb,CAAC,GACMD,EAAO;AAAA,EAClB;AACJ;AAvKI7B,EADSF,GACF,cAAa,CAACW,MAA6B,OAAOA,CAAK,CAAA;AAD3D,IAAMsB,IAANjC;","x_google_ignoreList":[0]}
@@ -7,7 +7,7 @@ import { ChartScatterplotUmap as f } from "./scatterplot-umap/index.js";
7
7
  import { ChartBubble as d } from "./bubble/index.js";
8
8
  import { DataFrame as i } from "./DataFrame.js";
9
9
  import { exhaustive as l } from "./utils/index.js";
10
- var w = Object.defineProperty, C = (o, t, r) => t in o ? w(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r, s = (o, t, r) => C(o, typeof t != "symbol" ? t + "" : t, r);
10
+ var C = Object.defineProperty, b = (o, t, r) => t in o ? C(o, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[t] = r, s = (o, t, r) => b(o, typeof t != "symbol" ? t + "" : t, r);
11
11
  class h {
12
12
  constructor(t) {
13
13
  s(this, "node"), s(this, "chart"), this.chart = t;
@@ -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