@milaboratories/graph-maker 1.1.138 → 1.1.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/GraphMaker/components/Chart.vue.d.ts.map +1 -1
  2. package/dist/GraphMaker/components/Chart.vue.js +1 -0
  3. package/dist/GraphMaker/components/Chart.vue.js.map +1 -1
  4. package/dist/GraphMaker/components/LassoControls/index.vue.js +15 -13
  5. package/dist/GraphMaker/components/LassoControls/index.vue.js.map +1 -1
  6. package/dist/GraphMaker/dataBindAes.d.ts +5 -5
  7. package/dist/GraphMaker/dataBindAes.d.ts.map +1 -1
  8. package/dist/GraphMaker/dataBindAes.js +52 -49
  9. package/dist/GraphMaker/dataBindAes.js.map +1 -1
  10. package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js +14 -14
  11. package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js.map +1 -1
  12. package/dist/GraphMaker/index.vue.d.ts.map +1 -1
  13. package/dist/GraphMaker/index.vue.js +125 -124
  14. package/dist/GraphMaker/index.vue.js.map +1 -1
  15. package/dist/GraphMaker/types.d.ts +1 -1
  16. package/dist/GraphMaker/types.d.ts.map +1 -1
  17. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +6 -0
  18. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts.map +1 -1
  19. package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts +4 -8
  20. package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts.map +1 -1
  21. package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
  22. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +15 -0
  23. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts.map +1 -1
  24. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +12 -3
  25. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
  26. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +21 -0
  27. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts.map +1 -1
  28. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +10 -6
  29. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
  30. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +31 -13
  31. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
  32. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +56 -62
  33. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
  34. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +29 -13
  35. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
  36. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +20 -19
  37. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
  38. package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
  39. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +57 -54
  40. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
  41. package/dist/lib.js +1 -1
  42. package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js +5 -5
  43. package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js.map +1 -1
  44. package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js +95 -72
  45. package/dist/node_modules/@milaboratories/miplots4/dist/DataFrame.js.map +1 -1
  46. package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +8 -5
  47. package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js.map +1 -1
  48. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js +124 -122
  49. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/ChartRenderer.js.map +1 -1
  50. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js +72 -91
  51. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/Chart.js.map +1 -1
  52. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js +43 -41
  53. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/components/ChartsGroup.js.map +1 -1
  54. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js +28 -0
  55. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCellTooltip.js.map +1 -0
  56. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js +94 -0
  57. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getGroupedCellsData.js.map +1 -0
  58. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +38 -34
  59. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
  60. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
  61. package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js +4 -22
  62. package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js.map +1 -1
  63. package/dist/node_modules/@milaboratories/miplots4/dist/common/Legend.js.map +1 -1
  64. package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js +11 -11
  65. package/dist/node_modules/@milaboratories/miplots4/dist/common/Tooltip.js.map +1 -1
  66. package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js +20 -0
  67. package/dist/node_modules/@milaboratories/miplots4/dist/common/useDataFrame.js.map +1 -0
  68. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js +181 -181
  69. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/ChartRenderer.js.map +1 -1
  70. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js +2 -2
  71. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/DendroSettingsImpl.js.map +1 -1
  72. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js +45 -45
  73. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Chart.js.map +1 -1
  74. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js +27 -27
  75. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Heatmap.js.map +1 -1
  76. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/Legend.js.map +1 -1
  77. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js +18 -18
  78. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/LinksGroup.js.map +1 -1
  79. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js +36 -36
  80. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/components/NodesGroup.js.map +1 -1
  81. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js +45 -41
  82. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHeatmapData.js.map +1 -1
  83. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js +33 -33
  84. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/getHierarchyData.js.map +1 -1
  85. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +90 -93
  86. package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
  87. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +199 -198
  88. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js.map +1 -1
  89. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js +17 -17
  90. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
  91. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/BoxElement.js.map +1 -1
  92. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +102 -99
  93. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
  94. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js +31 -36
  95. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/bar.js.map +1 -1
  96. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js +62 -74
  97. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/binnedDots.js.map +1 -1
  98. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js +52 -53
  99. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/boxes.js.map +1 -1
  100. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js +32 -32
  101. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/dots.js.map +1 -1
  102. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js +7 -6
  103. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/lines.js.map +1 -1
  104. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js +23 -23
  105. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/logo.js.map +1 -1
  106. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js +63 -63
  107. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/pairedPoints.js.map +1 -1
  108. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js +60 -64
  109. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/sina.js.map +1 -1
  110. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js +23 -23
  111. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/layers/stackedBar.js.map +1 -1
  112. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js +5 -5
  113. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/getOutliersBounds.js.map +1 -1
  114. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js +13 -13
  115. package/dist/node_modules/@milaboratories/miplots4/dist/discrete/utils/splitTextByWidth.js.map +1 -1
  116. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js +258 -256
  117. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/ChartRenderer.js.map +1 -1
  118. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js +1 -1
  119. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
  120. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +81 -79
  121. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
  122. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +140 -134
  123. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
  124. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +17 -17
  125. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js.map +1 -1
  126. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js +99 -95
  127. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/getCells.js.map +1 -1
  128. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +32 -31
  129. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
  130. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js +1 -1
  131. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateAnnotationTitleSizes.js.map +1 -1
  132. package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
  133. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js +143 -142
  134. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/ChartRenderer.js.map +1 -1
  135. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/HistogramSettingsImpl.js.map +1 -1
  136. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js +30 -30
  137. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/Chart.js.map +1 -1
  138. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/components/ChartsGroup.js +7 -7
  139. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js +53 -54
  140. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/getHistogramData.js.map +1 -1
  141. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +62 -58
  142. package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
  143. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/@d3fc/d3fc-axis/src/axisBase.js +7 -7
  144. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js +6 -12
  145. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-array/src/min.js.map +1 -1
  146. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-shape/src/line.js.map +1 -1
  147. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js +148 -0
  148. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/kdbush/index.js.map +1 -0
  149. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js +172 -168
  150. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ChartRenderer.js.map +1 -1
  151. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +28 -28
  152. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  153. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/Chart.js +11 -11
  154. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js +30 -29
  155. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartAxisTitles.js.map +1 -1
  156. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js +135 -153
  157. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartLayersData.js.map +1 -1
  158. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js +35 -32
  159. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTooltip.js.map +1 -1
  160. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js +27 -27
  161. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
  162. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/components/ChartsGroup.js +14 -14
  163. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/constants.js.map +1 -1
  164. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +24 -25
  165. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
  166. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +13 -13
  167. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
  168. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +69 -76
  169. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
  170. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js +85 -83
  171. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/linearRegression.js.map +1 -1
  172. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js +20 -20
  173. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createAesGetter.js.map +1 -1
  174. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +50 -38
  175. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
  176. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js +11 -0
  177. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
  178. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js +46 -56
  179. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/getVisibleLabels.js.map +1 -1
  180. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js +18 -0
  181. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
  182. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js +223 -205
  183. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
  184. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +26 -26
  185. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
  186. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js +42 -0
  187. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/colors.js.map +1 -0
  188. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js +84 -81
  189. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
  190. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/SVGLayer.js +11 -11
  191. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js +15 -14
  192. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/components/UpperSVG.js.map +1 -1
  193. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +97 -118
  194. package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
  195. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js +3 -1
  196. package/dist/node_modules/@milaboratories/miplots4/dist/types/common.js.map +1 -1
  197. package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js +1 -1
  198. package/dist/node_modules/@milaboratories/miplots4/dist/types/dendro.js.map +1 -1
  199. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js +1 -1
  200. package/dist/node_modules/@milaboratories/miplots4/dist/types/discrete.js.map +1 -1
  201. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js +1 -1
  202. package/dist/node_modules/@milaboratories/miplots4/dist/types/heatmap.js.map +1 -1
  203. package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js +1 -1
  204. package/dist/node_modules/@milaboratories/miplots4/dist/types/histogram.js.map +1 -1
  205. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +23 -17
  206. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
  207. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +25 -19
  208. package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
  209. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js +39 -0
  210. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/TextMeasurer.js.map +1 -0
  211. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js +101 -0
  212. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer/charToWidth.json.js.map +1 -0
  213. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js +4 -4
  214. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arrangeLegendParts.js.map +1 -1
  215. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js +7 -0
  216. package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js.map +1 -0
  217. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js +3 -3
  218. package/dist/node_modules/@milaboratories/miplots4/dist/utils/getLegendWidth.js.map +1 -1
  219. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +1111 -1097
  220. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
  221. package/package.json +3 -3
  222. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js +0 -91
  223. package/dist/node_modules/@milaboratories/miplots4/dist/bubble/getCells.js.map +0 -1
  224. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js +0 -30
  225. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/add.js.map +0 -1
  226. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js +0 -29
  227. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/cover.js.map +0 -1
  228. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js +0 -12
  229. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/data.js.map +0 -1
  230. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js +0 -7
  231. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/extent.js.map +0 -1
  232. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js +0 -26
  233. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/find.js.map +0 -1
  234. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js +0 -7
  235. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quad.js.map +0 -1
  236. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js +0 -51
  237. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/quadtree.js.map +0 -1
  238. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js +0 -21
  239. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/remove.js.map +0 -1
  240. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js +0 -7
  241. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/root.js.map +0 -1
  242. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js +0 -12
  243. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/size.js.map +0 -1
  244. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js +0 -14
  245. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visit.js.map +0 -1
  246. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js +0 -19
  247. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/visitAfter.js.map +0 -1
  248. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js +0 -11
  249. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/x.js.map +0 -1
  250. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js +0 -11
  251. package/dist/node_modules/@milaboratories/miplots4/dist/node_modules/d3-quadtree/src/y.js.map +0 -1
  252. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js +0 -24
  253. package/dist/node_modules/@milaboratories/miplots4/dist/utils/TextMeasurer.js.map +0 -1
@@ -1,257 +1,236 @@
1
- import { j as E } from "../node_modules/react/jsx-runtime.js";
2
- import { Error as Q } from "../common/Error.js";
3
- import { DEFAULT_HEIGHT as A, DEFAULT_WIDTH as w, TITLE_LINE_HEIGHT as Y, MAX_SHOWN_UNIQUE_VALUES_IN_LABELS as J, BLACK as P, TITLE_MARGIN as Z } from "../constants.js";
4
- import { splitTextByWidth as tt } from "../discrete/utils/splitTextByWidth.js";
5
- import { SVGLayer as et } from "./components/SVGLayer.js";
6
- import { MIN_MARGIN as L, DEFAULT_DOT_AES as F } from "../scatterplot/constants.js";
7
- import { PADDINGS as W, TITLE_LINE as O, LEGEND_OFFSET as st } from "./constants.js";
8
- import { createAesGetter as M } from "../scatterplot/utils/createAesGetter.js";
9
- import { getTicksAndFormat as it } from "../scatterplot/utils/getTicksAndFormat.js";
10
- import { getFilteredLabels as I, updateLabelsBBoxes as at } from "../scatterplot/utils/getVisibleLabels.js";
11
- import { isContinuousAes as _ } from "../types/common.js";
1
+ import { j as b } from "../node_modules/react/jsx-runtime.js";
2
+ import B from "../node_modules/@d3fc/d3fc-chart/src/cartesian.js";
3
+ import "../node_modules/@d3fc/d3fc-webgl/src/scale/scaleMapper.js";
4
+ import U from "../node_modules/@d3fc/d3fc-webgl/src/style/fillColor.js";
5
+ import V from "../node_modules/@d3fc/d3fc-series/src/webgl/point.js";
6
+ import K from "../node_modules/@d3fc/d3fc-series/src/svg/multi.js";
7
+ import j from "../node_modules/@d3fc/d3fc-series/src/webgl/multi.js";
8
+ import q from "../node_modules/d3-zoom/src/zoom.js";
9
+ import "../node_modules/d3-zoom/src/transform.js";
10
+ import { createRoot as X } from "../node_modules/react-dom/client.js";
11
+ import { Error as Y } from "../common/Error.js";
12
+ import { DEFAULT_HEIGHT as w, DEFAULT_WIDTH as E, TITLE_LINE_HEIGHT as Q, BLACK as F, TITLE_MARGIN as J } from "../constants.js";
13
+ import { splitTextByWidth as Z } from "../discrete/utils/splitTextByWidth.js";
14
+ import { MIN_MARGIN as C, DEFAULT_DOT_AES as M } from "../scatterplot/constants.js";
15
+ import { createAesGetter as P } from "../scatterplot/utils/createAesGetter.js";
16
+ import { getTicksAndFormat as tt } from "../scatterplot/utils/getTicksAndFormat.js";
17
+ import { createLabelPositioner as et } from "../scatterplot/utils/getVisibleLabels.js";
18
+ import { isContinuousAes as G } from "../types/common.js";
12
19
  import "../types/discrete.js";
13
20
  import "../types/scatterplot.js";
14
21
  import "../types/heatmap.js";
15
22
  import "../types/dendro.js";
16
23
  import "../types/histogram.js";
17
24
  import "../types/bubble.js";
18
- import { getContinuousColorScale as ot } from "../utils/getContinuousColorScale.js";
19
- import { getContinuousLegendTicks as lt } from "../utils/getContinuousLegendTicks.js";
20
- import { TextMeasurer as rt } from "../utils/TextMeasurer.js";
21
- import { createRoot as ht } from "../node_modules/react-dom/client.js";
22
- import nt from "../node_modules/d3-zoom/src/zoom.js";
23
- import "../node_modules/d3-zoom/src/transform.js";
24
- import dt from "../node_modules/@d3fc/d3fc-chart/src/cartesian.js";
25
- import "../node_modules/@d3fc/d3fc-webgl/src/scale/scaleMapper.js";
26
- import ct from "../node_modules/@d3fc/d3fc-webgl/src/style/fillColor.js";
27
- import mt from "../node_modules/@d3fc/d3fc-series/src/webgl/point.js";
28
- import pt from "../node_modules/@d3fc/d3fc-series/src/svg/multi.js";
29
- import ut from "../node_modules/@d3fc/d3fc-series/src/webgl/multi.js";
30
- import gt from "../node_modules/@d3fc/d3fc-pointer/src/pointer.js";
31
- import { arrangeLegendParts as yt } from "../utils/arrangeLegendParts.js";
32
- import C from "../node_modules/d3-scale/src/linear.js";
33
- import U from "../node_modules/d3-scale/src/log.js";
25
+ import { getContinuousColorScale as st } from "../utils/getContinuousColorScale.js";
26
+ import { getContinuousLegendTicks as it } from "../utils/getContinuousLegendTicks.js";
27
+ import { TextMeasurer as $ } from "../utils/TextMeasurer/TextMeasurer.js";
28
+ import { SVGLayer as at } from "./components/SVGLayer.js";
29
+ import { PADDINGS as D, TITLE_LINE as I, LEGEND_OFFSET as ot } from "./constants.js";
30
+ import lt from "../node_modules/@d3fc/d3fc-pointer/src/pointer.js";
31
+ import rt from "../node_modules/kdbush/index.js";
32
+ import { DataFrameProvider as nt } from "../common/useDataFrame.js";
33
+ import { arrangeLegendParts as ht } from "../utils/arrangeLegendParts.js";
34
+ import { stringToNumberRgba as W, getColorWithFakeOpacity as H, GET_BLACK as O } from "./colors.js";
35
+ import T from "../node_modules/d3-scale/src/linear.js";
36
+ import _ from "../node_modules/d3-scale/src/log.js";
34
37
  import N from "../node_modules/d3-selection/src/select.js";
35
- import vt from "../node_modules/d3-scale/src/ordinal.js";
36
- import St from "../node_modules/d3-scale/src/symlog.js";
37
- import { sqrt as ft } from "../node_modules/d3-scale/src/pow.js";
38
- import { rgb as D } from "../node_modules/d3-color/src/color.js";
39
- import xt from "../node_modules/d3-quadtree/src/quadtree.js";
40
- import zt from "../node_modules/d3-polygon/src/contains.js";
41
- var Lt = Object.defineProperty, bt = (n, t, e) => t in n ? Lt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, r = (n, t, e) => bt(n, typeof t != "symbol" ? t + "" : t, e);
42
- function R(n) {
43
- return n / 2.35 * (n / 2.35) * 64;
44
- }
45
- function G(n, t) {
46
- return n + (1 - n) * (1 - t);
38
+ import dt from "../node_modules/d3-scale/src/ordinal.js";
39
+ import ct from "../node_modules/d3-scale/src/symlog.js";
40
+ import { sqrt as mt } from "../node_modules/d3-scale/src/pow.js";
41
+ import pt from "../node_modules/d3-polygon/src/contains.js";
42
+ var ut = Object.defineProperty, gt = (S, t, e) => t in S ? ut(S, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : S[t] = e, c = (S, t, e) => gt(S, typeof t != "symbol" ? t + "" : t, e);
43
+ function R(S) {
44
+ return S / 2.35 * (S / 2.35) * 64;
47
45
  }
48
- function $(n, t) {
49
- return [
50
- G(n.r / 255, t),
51
- G(n.g / 255, t),
52
- G(n.b / 255, t),
53
- 1
54
- ];
46
+ function A(S, t, e) {
47
+ return e.length === 0 ? !0 : e.some((s) => s.closed && s.points.length > 2 && pt(s.points, [S, t]));
55
48
  }
56
- function H(n, t, e) {
57
- return e.length === 0 ? !0 : e.some((i) => i.closed && i.points.length > 2 && zt(i.points, [n, t]));
58
- }
59
- function V(n, t) {
60
- const e = t.find((d) => d.type === "dots"), i = t.find((d) => d.type === "curve");
49
+ function k(S, t, e) {
50
+ const s = e.find((a) => a.type === "dots"), l = e.find((a) => a.type === "curve");
61
51
  return {
62
- dotFill: M(n, (e == null ? void 0 : e.aes.dotFill) ?? F.color, "dotFill"),
63
- dotSize: M(n, (e == null ? void 0 : e.aes.dotSize) ?? F.size, "dotSize"),
64
- lineType: M(n, (i == null ? void 0 : i.aes.lineShape) ?? "solid", "lineShape")
52
+ dotFill: P(S, t, (s == null ? void 0 : s.aes.dotFill) ?? M.color, "dotFill"),
53
+ dotSize: P(S, t, (s == null ? void 0 : s.aes.dotSize) ?? M.size, "dotSize"),
54
+ lineType: P(S, t, (l == null ? void 0 : l.aes.lineShape) ?? "solid", "lineShape")
65
55
  };
66
56
  }
67
- class de {
57
+ class ie {
68
58
  constructor() {
69
- r(this, "reactRoot", null), r(this, "parentNode", null), r(this, "rootNode", null), r(this, "canvasNode", null), r(this, "svgLayerElement", null), r(this, "svgLayerComponent", /* @__PURE__ */ E.jsx(E.Fragment, {})), r(this, "aesGetters", {
59
+ c(this, "reactRoot", null), c(this, "parentNode", null), c(this, "rootNode", null), c(this, "canvasNode", null), c(this, "svgLayerElement", null), c(this, "svgLayerComponent", /* @__PURE__ */ b.jsx(b.Fragment, {})), c(this, "aesGetters", {
70
60
  dotSize: () => 2,
71
- dotFill: () => P,
61
+ dotFill: () => F,
72
62
  lineType: () => "solid"
73
- }), r(this, "tools", null), r(this, "margins", {
74
- top: L,
75
- bottom: L,
76
- left: L,
77
- right: L
78
- }), r(this, "chartSizes", {
79
- chartWidth: w,
63
+ }), c(this, "tools", null), c(this, "margins", {
64
+ top: C,
65
+ bottom: C,
66
+ left: C,
67
+ right: C
68
+ }), c(this, "chartSizes", {
69
+ chartWidth: E,
80
70
  // width of single chart
81
- chartHeight: A,
71
+ chartHeight: w,
82
72
  // height of single chart
83
- totalWidth: w,
73
+ totalWidth: E,
84
74
  // width of all charts in charts row, plus left axis, plus legend
85
- totalHeight: A
75
+ totalHeight: w
86
76
  // width of all charts in charts height, plus bottom axis, plus top title
87
- }), r(this, "scales", {
88
- x: C().domain([0, 10]).range([0, w]),
89
- y: C().domain([0, 10]).range([A, 0]),
90
- xOriginal: C().domain([0, 10]).range([0, w]),
91
- yOriginal: C().domain([0, 10]).range([A, 0])
92
- }), r(this, "polygons", []), r(this, "onPolygonUpdateOutside", () => {
93
- }), r(this, "onTooltipHintSwitch", () => {
94
- }), r(this, "onLassoControlsStateUpdate", () => {
95
- }), r(this, "zoomTransform", null), r(this, "zoomStateKey", ""), r(this, "selectedDot", null), r(this, "captionsSizes", {
77
+ }), c(this, "scales", {
78
+ x: T().domain([0, 10]).range([0, E]),
79
+ y: T().domain([0, 10]).range([w, 0]),
80
+ xOriginal: T().domain([0, 10]).range([0, E]),
81
+ yOriginal: T().domain([0, 10]).range([w, 0])
82
+ }), c(this, "polygons", []), c(this, "onPolygonUpdateOutside", () => {
83
+ }), c(this, "onTooltipHintSwitch", () => {
84
+ }), c(this, "onLassoControlsStateUpdate", () => {
85
+ }), c(this, "zoomTransform", null), c(this, "zoomStateKey", ""), c(this, "selectedDot", null), c(this, "captionsSizes", {
96
86
  xAxisCaptionsWidth: 30,
97
87
  yAxisCaptionsWidth: 100
98
- }), r(this, "mainTitle", []), r(this, "legend", { width: 0, height: 0, items: [] }), r(this, "notCalculatedProps", {}), r(this, "allDots", []), r(this, "allPossibleLabels", []), r(this, "visibleLabels", []), r(this, "onPolygonUpdate", (t) => {
88
+ }), c(this, "mainTitle", []), c(this, "legend", { width: 0, height: 0, items: [] }), c(this, "notCalculatedProps", {}), c(this, "allDots", []), c(this, "visibleLabels", []), c(this, "onPolygonUpdate", (t) => {
99
89
  this.polygons = t, this.updateByLasso();
100
- const e = this.allDots.filter((i) => H(i.x, i.y, this.polygons)).map((i) => i.idx);
90
+ const e = this.allDots.filter((s) => A(s.x, s.y, this.polygons)).map((s) => s.idx);
101
91
  this.onPolygonUpdateOutside(e, t);
102
92
  });
103
93
  }
104
94
  clear() {
105
95
  var t, e;
106
96
  this.parentNode && this.rootNode && this.canvasNode && ((t = this.parentNode) == null || t.removeChild(this.rootNode), (e = this.parentNode) == null || e.removeChild(this.canvasNode), this.parentNode = null, this.rootNode = null, this.canvasNode = null, this.svgLayerElement = null, this.tools = null), setTimeout(() => {
107
- var i;
108
- (i = this.reactRoot) == null || i.unmount(), this.reactRoot = null;
97
+ var s;
98
+ (s = this.reactRoot) == null || s.unmount(), this.reactRoot = null;
109
99
  });
110
100
  }
111
101
  init(t) {
112
- this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.canvasNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.parentNode.appendChild(this.canvasNode), this.reactRoot = ht(this.rootNode));
102
+ this.parentNode === null && (this.parentNode = t, this.rootNode = document.createElement("div"), this.canvasNode = document.createElement("div"), this.parentNode.appendChild(this.rootNode), this.parentNode.appendChild(this.canvasNode), this.reactRoot = X(this.rootNode));
113
103
  }
114
104
  updateChartSizes(t) {
115
105
  (t.width !== this.chartSizes.chartWidth || t.height !== this.chartSizes.chartHeight) && (this.chartSizes.chartWidth = t.width, this.chartSizes.chartHeight = t.height, this.scales.x.range([0, this.chartSizes.chartWidth]), this.scales.y.range([this.chartSizes.chartHeight, 0]));
116
106
  }
117
- updateViewport(t, e, i) {
118
- const d = t.scale === "log" ? U() : C();
119
- let { minX: h, minY: p, maxX: m, maxY: y } = i;
120
- if (t.lowerValue !== void 0 && (h = Math.max(h, t.lowerValue)), t.upperValue !== void 0 && (m = Math.min(m, t.upperValue)), e.lowerValue !== void 0 && (p = Math.max(p, e.lowerValue)), e.upperValue !== void 0 && (y = Math.min(y, e.upperValue)), t.symmetricRange !== void 0) {
121
- const a = t.symmetricRange;
122
- if (a >= h && a <= m) {
123
- const v = Math.max(a - h, m - a);
124
- h = a - v, m = a + v;
107
+ updateViewport(t, e, s) {
108
+ const l = t.scale === "log" ? _() : T();
109
+ let { minX: a, minY: r, maxX: u, maxY: p } = s;
110
+ if (t.lowerValue !== void 0 && (a = Math.max(a, t.lowerValue)), t.upperValue !== void 0 && (u = Math.min(u, t.upperValue)), e.lowerValue !== void 0 && (r = Math.max(r, e.lowerValue)), e.upperValue !== void 0 && (p = Math.min(p, e.upperValue)), t.symmetricRange !== void 0) {
111
+ const o = t.symmetricRange;
112
+ if (o >= a && o <= u) {
113
+ const y = Math.max(o - a, u - o);
114
+ a = o - y, u = o + y;
125
115
  }
126
116
  }
127
117
  if (typeof e.symmetricRange < "u") {
128
- const a = e.symmetricRange;
129
- if (a >= p && a <= y) {
130
- const v = Math.max(a - p, y - a);
131
- p = a - v, y = a + v;
118
+ const o = e.symmetricRange;
119
+ if (o >= r && o <= p) {
120
+ const y = Math.max(o - r, p - o);
121
+ r = o - y, p = o + y;
132
122
  }
133
123
  }
134
- const x = [0, this.chartSizes.chartWidth], z = d.copy().domain([h, m]).range([W.LEFT, this.chartSizes.chartWidth - W.RIGHT]);
135
- d.domain([z.invert(0), z.invert(this.chartSizes.chartWidth)]).range(x).nice(), this.scales.x = d, this.scales.xOriginal = d.copy();
136
- const c = e.scale === "log" ? U() : C(), o = [this.chartSizes.chartHeight, 0], g = c.copy().domain([p, y]).range([this.chartSizes.chartHeight - W.BOTTOM, W.TOP]);
137
- c.domain([g.invert(this.chartSizes.chartHeight), g.invert(0)]).range(o).nice(), this.scales.y = c, this.scales.yOriginal = c.copy();
124
+ const f = [0, this.chartSizes.chartWidth], x = l.copy().domain([a, u]).range([D.LEFT, this.chartSizes.chartWidth - D.RIGHT]);
125
+ l.domain([x.invert(0), x.invert(this.chartSizes.chartWidth)]).range(f).nice(), this.scales.x = l, this.scales.xOriginal = l.copy();
126
+ const d = e.scale === "log" ? _() : T(), n = [this.chartSizes.chartHeight, 0], g = d.copy().domain([r, p]).range([this.chartSizes.chartHeight - D.BOTTOM, D.TOP]);
127
+ d.domain([g.invert(this.chartSizes.chartHeight), g.invert(0)]).range(n).nice(), this.scales.y = d, this.scales.yOriginal = d.copy();
138
128
  }
139
129
  updateCaptionsSize() {
140
- const t = new rt("600 14px Arial");
141
- function e(p) {
142
- return Math.max(...p.map((m) => t.getTextWidth(m)));
130
+ const t = new $("600 14px Arial");
131
+ function e(r) {
132
+ return Math.max(...r.map((u) => t.getTextWidth(u)));
143
133
  }
144
- const { ticks: i, format: d } = it(this.scales.y, !1), h = e(i.map(d));
134
+ const { ticks: s, format: l } = tt(this.scales.y, !1), a = e(s.map(l));
145
135
  this.captionsSizes = {
146
136
  xAxisCaptionsWidth: 20,
147
- yAxisCaptionsWidth: h
137
+ yAxisCaptionsWidth: a
148
138
  };
149
139
  }
150
140
  createMainTitle(t) {
151
- this.mainTitle = tt(
141
+ this.mainTitle = Z(
152
142
  t.name,
153
143
  this.chartSizes.totalWidth - this.margins.left - this.margins.right,
154
144
  20
155
145
  );
156
146
  }
157
147
  updateMargins() {
158
- const t = Y * this.mainTitle.length, e = t > 0 ? t + Z * 2 : 0;
148
+ const t = Q * this.mainTitle.length, e = t > 0 ? t + J * 2 : 0;
159
149
  this.margins = {
160
- top: Math.max(e, L),
161
- bottom: L + this.captionsSizes.xAxisCaptionsWidth + O,
162
- left: L + this.captionsSizes.yAxisCaptionsWidth + O,
163
- right: this.legend.width + L
150
+ top: Math.max(e, C),
151
+ bottom: C + this.captionsSizes.xAxisCaptionsWidth + I,
152
+ left: C + this.captionsSizes.yAxisCaptionsWidth + I,
153
+ right: this.legend.width + C
164
154
  }, this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartWidth + this.margins.right, this.chartSizes.totalHeight = this.margins.top + Math.max(this.chartSizes.chartHeight, this.legend.height) + this.margins.bottom, N(this.canvasNode).style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
165
155
  }
166
- updateLegendSize(t, e, i, d) {
156
+ updateLegendSize(t, e, s, l) {
167
157
  if (!t.show) {
168
158
  this.legend = { width: 0, height: 0, items: [] };
169
159
  return;
170
160
  }
171
- const h = [], p = { width: 0, height: 0, left: 0, top: 0 };
172
- if (i.forEach((c) => {
173
- const o = e[c.value];
174
- if (o.usedAes.length === 0 || !o.aesMap)
175
- return;
176
- if (o.values.length > J) {
177
- console.warn(`Too many values for discrete legend (${o.values.length})`);
161
+ const a = [], r = { width: 0, height: 0, left: 0, top: 0 };
162
+ if (s.forEach((d) => {
163
+ const n = e[d.value];
164
+ if (n.usedAes.length === 0 || !n.aesMap)
178
165
  return;
179
- }
180
166
  const g = {};
181
- o.values.forEach((u) => {
182
- g[u] || (g[u] = { ...F }), o.usedAes.forEach((S) => {
183
- var s, l;
184
- S === "dotFill" && (g[u].color = ((s = o.aesMap[u]) == null ? void 0 : s[S]) ?? P), S === "dotSize" && (g[u].size = ((l = o.aesMap[u]) == null ? void 0 : l[S]) ?? 3);
167
+ n.values.forEach((m) => {
168
+ g[m] || (g[m] = { ...M }), n.usedAes.forEach((v) => {
169
+ v === "dotFill" && (g[m].color = n.aesMap(m, v) ?? F), v === "dotSize" && (g[m].size = Number(n.aesMap(m, v) ?? 3));
185
170
  });
186
171
  });
187
- const a = c.label ?? c.value, v = vt().domain(o.values).range(o.values.map((u) => g[u]));
188
- h.push({ ...p, id: c.value, type: "dots", title: a, scale: v, values: o.values, labels: o.labels });
189
- }), d.forEach((c) => {
190
- if (c.type === "dots" && _(c.aes.dotFill)) {
191
- const { domain: o, range: g, columnName: a, type: v = "linear" } = c.aes.dotFill, u = a.label ?? a.value, S = ot(g, o, "linear"), s = (v === "log" ? St() : C()).domain(o).range([this.chartSizes.chartHeight, 0]), l = lt(s, o);
192
- h.push({ ...p, id: "dotFill", type: "continuous", title: u, scale: S, tickPositionScale: s, values: l });
172
+ const o = d.label ?? d.value, y = dt().domain(n.values).range(n.values.map((m) => g[m]));
173
+ a.push({ ...r, id: d.value, type: "dots", title: o, scale: y, values: n.values, labels: n.labels });
174
+ }), l.forEach((d) => {
175
+ if (d.type === "dots" && G(d.aes.dotFill)) {
176
+ const { domain: n, range: g, columnName: o, type: y = "linear" } = d.aes.dotFill, m = o.label ?? o.value, v = st(g, n, "linear"), i = (y === "log" ? ct() : T()).domain(n).range([this.chartSizes.chartHeight, 0]), h = it(i, n);
177
+ a.push({ ...r, id: "dotFill", type: "continuous", title: m, scale: v, tickPositionScale: i, values: h });
193
178
  }
194
- if (c.type === "dots" && _(c.aes.dotSize)) {
195
- const { columnName: o, domain: g, range: a } = c.aes.dotSize, v = o.label ?? o.value, u = ft(g, a), S = u.ticks(3), s = u.tickFormat(3), l = S.reduce((f, b) => (f[String(b)] = s(b), f), {});
196
- h.push({ ...p, id: o.value, type: "size", title: v, scale: u, values: S, labels: l });
179
+ if (d.type === "dots" && G(d.aes.dotSize)) {
180
+ const { columnName: n, domain: g, range: o } = d.aes.dotSize, y = n.label ?? n.value, m = mt(g, o), v = m.ticks(3), i = m.tickFormat(3), h = v.reduce((z, L) => (z[String(L)] = i(L), z), {});
181
+ a.push({ ...r, id: n.value, type: "size", title: y, scale: m, values: v, labels: h });
197
182
  }
198
- }), !h.length) {
183
+ }), !a.length) {
199
184
  this.legend = { width: 0, height: 0, items: [] };
200
185
  return;
201
186
  }
202
- const m = yt(h, this.chartSizes.chartHeight), y = m[m.length - 1], x = y.left + y.width + st, z = this.chartSizes.chartHeight;
187
+ const u = ht(a, this.chartSizes.chartHeight), p = u[u.length - 1], f = p.left + p.width + ot, x = this.chartSizes.chartHeight;
203
188
  this.legend = {
204
- width: x,
205
- height: z,
206
- items: m
189
+ width: f,
190
+ height: x,
191
+ items: u
207
192
  };
208
193
  }
209
- initSettings(t, e, i, d, h, p) {
210
- const { xAxis: m, yAxis: y, size: x, title: z, legend: c } = e;
211
- this.updateChartSizes(x), this.updateViewport(m, y, i), this.updateCaptionsSize(), this.updateLegendSize(c, d, p, h), this.createMainTitle(z), this.updateMargins(), this.aesGetters = V(d, h);
212
- const o = ct().data(t).value((s) => {
213
- const l = D(this.aesGetters.dotFill(s.data)), f = !s.dimmed && H(s.x, s.y, this.polygons) ? 1 : 0.4;
214
- return $(l, f);
215
- }), g = mt().equals((s, l) => s === l).size((s) => R(this.aesGetters.dotSize(s.data))).crossValue((s) => s.x).mainValue((s) => s.y).decorate((s) => o(s)), a = nt().scaleExtent([0.1, 1e3]).filter((s) => s.type === "wheel" || s.metaKey || s.ctrlKey).on("start", () => {
194
+ initSettings(t, e, s, l, a, r, u) {
195
+ const { xAxis: p, yAxis: f, size: x, title: d, legend: n } = s;
196
+ this.updateChartSizes(x), this.updateViewport(p, f, l), this.updateCaptionsSize(), this.updateLegendSize(n, a, u, r), this.createMainTitle(d), this.updateMargins(), this.aesGetters = k(t, a, r);
197
+ const g = U().data(e).value((i) => {
198
+ const h = W(this.aesGetters.dotFill(i.idx));
199
+ return h[3] = !i.dimmed && A(i.x, i.y, this.polygons) ? 1 : 0.4, H(h, h);
200
+ }), o = V().equals((i, h) => i === h).size((i) => R(this.aesGetters.dotSize(i.idx))).crossValue((i) => i.x).mainValue((i) => i.y).decorate((i) => g(i)), y = q().scaleExtent([0.1, 1e3]).filter((i) => i.type === "wheel" || i.metaKey || i.ctrlKey).on("start", () => {
216
201
  this.selectedDot = null;
217
- }).on("zoom", (s) => {
218
- const l = s.transform, f = l.rescaleX(this.scales.xOriginal), b = l.rescaleY(this.scales.yOriginal);
219
- this.scales.x.domain(f.domain()), this.scales.y.domain(b.domain()), this.zoomTransform = l, this.zoomStateKey = `${l.x}_${l.y}_${l.k}`, this.renderSvgLayer(), this.renderWebglLayer();
202
+ }).on("zoom", (i) => {
203
+ const h = i.transform, z = h.rescaleX(this.scales.xOriginal), L = h.rescaleY(this.scales.yOriginal);
204
+ this.scales.x.domain(z.domain()), this.scales.y.domain(L.domain()), this.zoomTransform = h, this.zoomStateKey = `${h.x}_${h.y}_${h.k}`, this.updateLabelsPosition(this.visibleLabels), this.renderSvgLayer(t), this.renderWebglLayer();
220
205
  }).on("end", () => {
221
- this.allPossibleLabels.forEach((s) => {
222
- s.x = this.scales.x(s.dot.x), s.y = this.scales.y(s.dot.y);
223
- }), this.visibleLabels = I(this.allPossibleLabels, this.chartSizes.chartWidth, this.chartSizes.chartHeight), this.renderSvgLayer();
224
- }), v = this.createQuadtree(t), u = gt().on("point", ([s]) => {
225
- var l, f, b;
226
- let T;
227
- if (s) {
228
- const B = this.scales.x.invert(s.x), K = this.scales.y.invert(s.y), q = this.scales.xOriginal(B), j = this.scales.yOriginal(K), X = 20 / (((l = this.zoomTransform) == null ? void 0 : l.k) || 1);
229
- T = (f = this.tools) == null ? void 0 : f.qt.find(q, j, X);
230
- }
231
- const k = this.selectedDot && !T || !this.selectedDot && T || ((b = this.selectedDot) == null ? void 0 : b.id) !== (T == null ? void 0 : T.id);
232
- this.selectedDot = T ?? null, k && this.renderSvgLayer();
233
- }), S = dt({
206
+ this.visibleLabels = this.computeLabels(this.allDots), this.renderSvgLayer(t);
207
+ }), m = lt().on("point", ([i]) => {
208
+ var h;
209
+ let z;
210
+ i && (z = this.getClosestDot(i.x, i.y));
211
+ const L = this.selectedDot && !z || !this.selectedDot && z || ((h = this.selectedDot) == null ? void 0 : h.idx) !== (z == null ? void 0 : z.idx);
212
+ this.selectedDot = z ?? null, L && this.renderSvgLayer(t);
213
+ }), v = B({
234
214
  xScale: this.scales.x,
235
215
  yScale: this.scales.y
236
- }).xAxisHeight(() => "0").yAxisWidth(() => "0").svgPlotArea(pt()).webglPlotArea(
216
+ }).xAxisHeight(() => "0").yAxisWidth(() => "0").svgPlotArea(K()).webglPlotArea(
237
217
  // only render the point series on the WebGL layer
238
- ut().series([g]).mapping((s) => s)
239
- ).decorate((s) => {
240
- const l = s.enter();
241
- l && !this.svgLayerElement && (l.style("grid-template-columns", "0 auto 1fr auto 0"), l.style("grid-template-rows", "0 auto 1fr auto 0"), this.svgLayerElement = l.select(".svg-plot-area.plot-area svg").node()), l.select(".svg-plot-area.plot-area").attr("class", "svg-plot-area plot-area miplots-scatterplot-plot-area").call(a).call(u);
218
+ j().series([o]).mapping((i) => i)
219
+ ).decorate((i) => {
220
+ const h = i.enter();
221
+ h && !this.svgLayerElement && (h.style("grid-template-columns", "0 auto 1fr auto 0"), h.style("grid-template-rows", "0 auto 1fr auto 0"), this.svgLayerElement = h.select(".svg-plot-area.plot-area svg").node()), h.select(".svg-plot-area.plot-area").attr("class", "svg-plot-area plot-area miplots-scatterplot-plot-area").call(y).call(m);
242
222
  });
243
223
  this.tools = {
244
- webglChart: S,
245
- zoom: a,
246
- qt: v,
247
- fillColor: o,
248
- pointSeries: g
249
- }, N(this.canvasNode).datum(t).style("position", "absolute").style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
224
+ webglChart: v,
225
+ zoom: y,
226
+ fillColor: g,
227
+ pointSeries: o
228
+ }, N(this.canvasNode).datum(e).style("position", "absolute").style("width", this.chartSizes.chartWidth + "px").style("height", this.chartSizes.chartHeight + "px").style("top", this.margins.top + "px").style("left", this.margins.left + "px");
250
229
  }
251
- updateAes(t, e) {
252
- this.tools !== null && (this.aesGetters = V(t, e), this.tools.fillColor.value((i) => {
253
- const d = this.aesGetters.dotFill ?? (() => P), h = D(d(i.data)), p = !i.dimmed && H(i.x, i.y, this.polygons) ? 1 : 0.4;
254
- return $(h, p);
230
+ updateAes(t, e, s) {
231
+ this.tools !== null && (this.aesGetters = k(t, e, s), this.tools.fillColor.value((l) => {
232
+ const a = this.aesGetters.dotFill ?? O, r = W(a(l.idx));
233
+ return r[3] = !l.dimmed && A(l.x, l.y, this.polygons) ? 1 : 0.4, H(r, r);
255
234
  }));
256
235
  }
257
236
  updatePointSize() {
@@ -260,50 +239,62 @@ class de {
260
239
  updateByLasso() {
261
240
  var t;
262
241
  this.tools !== null && ((t = this.tools) == null || t.fillColor.value((e) => {
263
- const i = this.aesGetters.dotFill ?? (() => P), d = D(i(e.data)), h = !e.dimmed && H(e.x, e.y, this.polygons) ? 1 : 0.4;
264
- return $(d, h);
242
+ const s = this.aesGetters.dotFill ?? O, l = W(s(e.idx));
243
+ return l[3] = !e.dimmed && A(e.x, e.y, this.polygons) ? 1 : 0.4, H(l, l);
265
244
  }), this.renderWebglLayer());
266
245
  }
267
246
  createQuadtree(t) {
268
- return xt().x((e) => this.scales.xOriginal(e.x)).y((e) => this.scales.yOriginal(e.y)).addAll(t);
247
+ const e = new rt(t.length, 512);
248
+ for (let s = 0; s < t.length; s++)
249
+ e.add(t[s].x, t[s].y);
250
+ return e.finish();
269
251
  }
270
- updateData(t) {
271
- this.tools !== null && (N(this.canvasNode).datum(t), this.tools.fillColor.data(t), this.tools.qt = this.createQuadtree(t));
252
+ getClosestDot(t, e) {
253
+ var s, l;
254
+ const a = (s = this.tools) == null ? void 0 : s.qt;
255
+ if (!a) return null;
256
+ const r = this.allDots, u = this.scales.x.invert(t), p = this.scales.y.invert(e), f = 1 / (((l = this.zoomTransform) == null ? void 0 : l.k) || 1), x = u - f, d = u + f, n = p - f, g = p + f, o = a.range(x, n, d, g), y = o.reduce((m, v) => {
257
+ const i = r[v], h = this.scales.x(i.x) - t, z = this.scales.y(i.y) - e, L = Math.hypot(h, z);
258
+ return (m === null || L < m.distance) && (m.index = v, m.distance = L), m;
259
+ }, {
260
+ index: -1,
261
+ distance: 1 / 0
262
+ });
263
+ return o.length === 0 || y.index === -1 ? null : r[y.index];
264
+ }
265
+ updateDots(t) {
266
+ this.tools !== null && (N(this.canvasNode).datum(t), this.tools.fillColor.data(t), this.tools.qt = this.createQuadtree(t), this.allDots = t);
272
267
  }
273
- render(t, e, i, d, h, p, m, y, x, z, c, o, g) {
268
+ render(t, e, s, l, a, r, u, p, f, x, d, n, g) {
274
269
  if (this.tools === null)
275
270
  this.initSettings(
276
- d,
277
- e,
278
- h,
279
- y,
280
- m,
271
+ t,
272
+ a,
273
+ s,
274
+ r,
275
+ f,
276
+ p,
281
277
  x
282
- ), this.onPolygonUpdateOutside = c, this.onTooltipHintSwitch = o, this.onLassoControlsStateUpdate = g;
278
+ );
283
279
  else {
284
- const { title: a, legend: v, size: u } = e;
285
- this.updateChartSizes(u), this.updateLegendSize(v, y, x, m), this.createMainTitle(a), this.updateMargins(), this.updateAes(y, m);
280
+ const { title: o, legend: y, size: m } = s;
281
+ this.updateChartSizes(m), this.updateLegendSize(y, f, x, p), this.createMainTitle(o), this.updateMargins(), this.updateAes(t, f, p);
286
282
  }
287
- this.allDots = d, this.allPossibleLabels = z, this.allPossibleLabels.forEach((a) => {
288
- a.x = this.scales.x(a.dot.x), a.y = this.scales.y(a.dot.y);
289
- }), this.visibleLabels = I(this.allPossibleLabels, this.chartSizes.chartWidth, this.chartSizes.chartHeight), this.notCalculatedProps = {
290
- settingsId: t,
291
- chartSettings: e,
292
- keyColumn: i,
293
- dotsByGrouping: p,
294
- layers: m
295
- }, this.renderWebglLayer(), this.renderSvgLayer();
283
+ this.onPolygonUpdateOutside = d, this.onTooltipHintSwitch = n, this.onLassoControlsStateUpdate = g, this.allDots !== a && (this.updateDots(a), this.visibleLabels = this.computeLabels(a)), this.notCalculatedProps = {
284
+ settingsId: e,
285
+ chartSettings: s,
286
+ keyColumn: l,
287
+ dotsByGrouping: u,
288
+ layers: p
289
+ }, this.renderWebglLayer(), this.renderSvgLayer(t);
296
290
  }
297
291
  renderWebglLayer() {
298
292
  var t, e;
299
293
  (t = this.tools) != null && t.webglChart && N(this.canvasNode).call((e = this.tools) == null ? void 0 : e.webglChart);
300
294
  }
301
- renderSvgLayer() {
302
- var t;
303
- this.visibleLabels.forEach((i) => {
304
- i.x = this.scales.x(i.dot.x), i.y = this.scales.y(i.dot.y);
305
- }), at(this.visibleLabels);
306
- const e = {
295
+ renderSvgLayer(t) {
296
+ var e;
297
+ const s = {
307
298
  settingsId: this.notCalculatedProps.settingsId,
308
299
  chartSettings: this.notCalculatedProps.chartSettings,
309
300
  keyColumn: this.notCalculatedProps.keyColumn,
@@ -325,14 +316,41 @@ class de {
325
316
  onTooltipHintSwitch: this.onTooltipHintSwitch,
326
317
  onLassoControlsStateUpdate: this.onLassoControlsStateUpdate
327
318
  };
328
- this.svgLayerComponent = /* @__PURE__ */ E.jsx(et, { ...e }), (t = this.reactRoot) == null || t.render(this.svgLayerComponent);
319
+ this.svgLayerComponent = /* @__PURE__ */ b.jsx(nt, { dataFrame: t, children: /* @__PURE__ */ b.jsx(at, { ...s }) }), (e = this.reactRoot) == null || e.render(this.svgLayerComponent);
329
320
  }
330
321
  renderError(t) {
331
322
  var e;
332
- (e = this.reactRoot) == null || e.render(/* @__PURE__ */ E.jsx(Q, { message: t }));
323
+ (e = this.reactRoot) == null || e.render(/* @__PURE__ */ b.jsx(Y, { message: t }));
324
+ }
325
+ computeLabels(t) {
326
+ const e = new $("16px Manrope"), s = et(this.chartSizes.chartWidth, this.chartSizes.chartHeight), l = [];
327
+ for (let a = 0; a < t.length; a++) {
328
+ const r = t[a];
329
+ if (r.label == null)
330
+ continue;
331
+ const u = String(r.label), p = e.getTextMetrics(u), f = this.scales.x(r.x), x = this.scales.y(r.y), d = p.width, n = p.actualBoundingBoxAscent + p.actualBoundingBoxDescent, g = 10, o = s(f, x, d, n, g);
332
+ o && l.push({
333
+ x: f,
334
+ y: x,
335
+ dot: r,
336
+ name: u,
337
+ width: d,
338
+ height: n,
339
+ padding: g,
340
+ xPosition: o[0],
341
+ yPosition: o[1]
342
+ });
343
+ }
344
+ return l;
345
+ }
346
+ updateLabelsPosition(t) {
347
+ for (let e = 0; e < t.length; e++) {
348
+ const s = t[e];
349
+ s.x = this.scales.x(s.dot.x), s.y = this.scales.y(s.dot.y);
350
+ }
333
351
  }
334
352
  }
335
353
  export {
336
- de as default
354
+ ie as default
337
355
  };
338
356
  //# sourceMappingURL=ChartRenderer.js.map