@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 +1 @@
1
- {"version":3,"file":"stackedBar.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/layers/stackedBar.ts"],"sourcesContent":["import type {DataFrame, GroupKey} from '../../DataFrame';\nimport {NO_GROUPED} from '../../DataFrame';\nimport type {StackedBarLayer} from '../DiscreteSettingsImpl';\nimport type {StackedBarsData} from './types';\nimport {getFacetStringKey} from '../utils/getFacetStringKey';\nimport type {ColumnName, Row} from '../../types';\nimport {sum} from 'd3-array';\n\ntype BarPart = {\n height: number;\n key: string;\n};\n\nexport type StackedBar = {\n key: string;\n valuesMap: Record<string, BarPart>;\n primaryGrouping: string;\n boundsY: {\n min: number;\n max: number;\n };\n};\n\nexport function getStackedBarsData(\n layer: StackedBarLayer,\n groupingKeys: {\n facet: GroupKey[][],\n primary: GroupKey[],\n secondary: GroupKey[]\n },\n data: DataFrame,\n y: ColumnName,\n): StackedBarsData {\n let maxY = -Infinity;\n let minY = Infinity;\n\n return {\n type: 'stackedBar',\n geoms: groupingKeys.facet.reduce((res: Record<string, StackedBar[]>, facetKey) => {\n const strFacetKey = getFacetStringKey(facetKey);\n res[strFacetKey] = [];\n groupingKeys.primary.forEach(primaryKey => {\n let currentHeight = 0;\n const barParts:Record<string, BarPart> = {};\n groupingKeys.secondary.forEach(secondaryKey => {\n const secondaryKeyStr = secondaryKey === NO_GROUPED ? 'null' : secondaryKey;\n const rows = data.getRowsByGrouping([...facetKey, primaryKey, secondaryKey]);\n if (!rows.length) {\n return;\n }\n const height = sum(rows, (row:Row) => Number(row[y.value]));\n barParts[secondaryKeyStr] = {\n height,\n key: String(secondaryKeyStr),\n };\n currentHeight += height;\n });\n const maxStackHeight = currentHeight;\n if (layer.normalize) { // show in percents of every stack\n groupingKeys.secondary.forEach(secondaryKey => {\n const secondaryKeyStr = secondaryKey === NO_GROUPED ? 'null' : secondaryKey;\n if (!barParts[secondaryKeyStr]) {\n return;\n }\n barParts[secondaryKeyStr].height = barParts[secondaryKeyStr].height / maxStackHeight * 100;\n });\n }\n maxY = Math.max(maxY, 0, currentHeight);\n minY = Math.min(minY, 0, currentHeight);\n const bound = layer.normalize ? 100 : maxStackHeight;\n res[strFacetKey].push({\n key: `stackedBar_${String(primaryKey)}`,\n valuesMap: barParts,\n primaryGrouping: primaryKey,\n boundsY: {min: Math.min(bound, 0), max: Math.max(bound, 0)},\n } as StackedBar);\n });\n return res;\n }, {}),\n meta: {minY: layer.normalize ? 0 : minY, maxY: layer.normalize ? 100 : maxY, normalize: layer.normalize},\n aes: layer.aes,\n };\n}\n"],"names":["getStackedBarsData","layer","groupingKeys","data","y","maxY","minY","res","facetKey","strFacetKey","getFacetStringKey","primaryKey","currentHeight","barParts","secondaryKey","secondaryKeyStr","NO_GROUPED","rows","height","sum","row","maxStackHeight","bound"],"mappings":";;;AAuBO,SAASA,EACZC,GACAC,GAKAC,GACAC,GACe;AACf,MAAIC,IAAO,QACPC,IAAO;AAEX,SAAO;AAAA,IACH,MAAM;AAAA,IACN,OAAOJ,EAAa,MAAM,OAAO,CAACK,GAAmCC,MAAa;AAC9E,YAAMC,IAAcC,EAAkBF,CAAQ;AAC9C,aAAAD,EAAIE,CAAW,IAAI,CAAA,GACnBP,EAAa,QAAQ,QAAQ,CAAAS,MAAc;AACvC,YAAIC,IAAgB;AACpB,cAAMC,IAAmC,CAAA;AACzCX,QAAAA,EAAa,UAAU,QAAQ,CAAAY,MAAgB;AAC3C,gBAAMC,IAAkBD,MAAiBE,IAAa,SAASF,GACzDG,IAAOd,EAAK,kBAAkB,CAAC,GAAGK,GAAUG,GAAYG,CAAY,CAAC;AAC3E,cAAI,CAACG,EAAK;AACN;AAEJ,gBAAMC,IAASC,EAAIF,GAAM,CAACG,MAAY,OAAOA,EAAIhB,EAAE,KAAK,CAAC,CAAC;AAC1DS,UAAAA,EAASE,CAAe,IAAI;AAAA,YACxB,QAAAG;AAAAA,YACA,KAAK,OAAOH,CAAe;AAAA,UAAA,GAE/BH,KAAiBM;AAAAA,QACrB,CAAC;AACD,cAAMG,IAAiBT;AACnBX,QAAAA,EAAM,aACNC,EAAa,UAAU,QAAQ,CAAAY,MAAgB;AAC3C,gBAAMC,IAAkBD,MAAiBE,IAAa,SAASF;AAC1DD,UAAAA,EAASE,CAAe,MAG7BF,EAASE,CAAe,EAAE,SAASF,EAASE,CAAe,EAAE,SAAUM,IAAiB;AAAA,QAC5F,CAAC,GAELhB,IAAO,KAAK,IAAIA,GAAM,GAAGO,CAAa,GACtCN,IAAO,KAAK,IAAIA,GAAM,GAAGM,CAAa;AACtC,cAAMU,IAAQrB,EAAM,YAAY,MAAMoB;AACtCd,QAAAA,EAAIE,CAAW,EAAE,KAAK;AAAA,UAClB,KAAK,cAAc,OAAOE,CAAU,CAAC;AAAA,UACrC,WAAWE;AAAAA,UACX,iBAAiBF;AAAAA,UACjB,SAAS,EAAC,KAAK,KAAK,IAAIW,GAAO,CAAC,GAAG,KAAK,KAAK,IAAIA,GAAO,CAAC,EAAA;AAAA,QAAA,CAC9C;AAAA,MACnB,CAAC,GACMf;AAAAA,IACX,GAAG,CAAA,CAAE;AAAA,IACL,MAAM,EAAC,MAAMN,EAAM,YAAY,IAAIK,GAAM,MAAML,EAAM,YAAY,MAAMI,GAAM,WAAWJ,EAAM,UAAA;AAAA,IAC9F,KAAKA,EAAM;AAAA,EAAA;AAEnB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"stackedBar.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/layers/stackedBar.ts"],"sourcesContent":["import { sum } from 'd3-array';\nimport type { DataFrame, GroupKey } from '../../DataFrame';\nimport { NO_GROUPED } from '../../DataFrame';\nimport type { ColumnName } from '../../types';\nimport type { StackedBarLayer } from '../DiscreteSettingsImpl';\nimport { getFacetStringKey } from '../utils/getFacetStringKey';\nimport type { StackedBarsData } from './types';\n\ntype BarPart = {\n height: number;\n key: string;\n};\n\nexport type StackedBar = {\n key: string;\n valuesMap: Record<string, BarPart>;\n primaryGrouping: string;\n boundsY: {\n min: number;\n max: number;\n };\n};\n\nexport function getStackedBarsData(\n layer: StackedBarLayer,\n groupingKeys: {\n facet: GroupKey[][],\n primary: GroupKey[],\n secondary: GroupKey[]\n },\n data: DataFrame,\n y: ColumnName,\n): StackedBarsData {\n let maxY = -Infinity;\n let minY = Infinity;\n\n return {\n type: 'stackedBar',\n geoms: groupingKeys.facet.reduce((res: Record<string, StackedBar[]>, facetKey) => {\n const strFacetKey = getFacetStringKey(facetKey);\n res[strFacetKey] = [];\n groupingKeys.primary.forEach(primaryKey => {\n let currentHeight = 0;\n const barParts:Record<string, BarPart> = {};\n groupingKeys.secondary.forEach(secondaryKey => {\n const secondaryKeyStr = secondaryKey === NO_GROUPED ? 'null' : secondaryKey;\n const indexes = data.getRowsByGrouping([...facetKey, primaryKey, secondaryKey]);\n if (!indexes.length) {\n return;\n }\n const height = sum(indexes, (i) => Number(data.getColumnValue(y.value, i)));\n barParts[secondaryKeyStr] = {\n height,\n key: String(secondaryKeyStr),\n };\n currentHeight += height;\n });\n const maxStackHeight = currentHeight;\n if (layer.normalize) { // show in percents of every stack\n groupingKeys.secondary.forEach(secondaryKey => {\n const secondaryKeyStr = secondaryKey === NO_GROUPED ? 'null' : secondaryKey;\n if (!barParts[secondaryKeyStr]) {\n return;\n }\n barParts[secondaryKeyStr].height = barParts[secondaryKeyStr].height / maxStackHeight * 100;\n });\n }\n maxY = Math.max(maxY, 0, currentHeight);\n minY = Math.min(minY, 0, currentHeight);\n const bound = layer.normalize ? 100 : maxStackHeight;\n res[strFacetKey].push({\n key: `stackedBar_${String(primaryKey)}`,\n valuesMap: barParts,\n primaryGrouping: primaryKey,\n boundsY: {min: Math.min(bound, 0), max: Math.max(bound, 0)},\n } as StackedBar);\n });\n return res;\n }, {}),\n meta: {minY: layer.normalize ? 0 : minY, maxY: layer.normalize ? 100 : maxY, normalize: layer.normalize},\n aes: layer.aes,\n };\n}\n"],"names":["getStackedBarsData","layer","groupingKeys","data","y","maxY","minY","res","facetKey","strFacetKey","getFacetStringKey","primaryKey","currentHeight","barParts","secondaryKey","secondaryKeyStr","NO_GROUPED","indexes","height","sum","i","maxStackHeight","bound"],"mappings":";;;AAuBO,SAASA,EACZC,GACAC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B,SAAS,EAAC,KAAK,KAAK,IAAIW,GAAO,CAAC,GAAG,KAAK,KAAK,IAAIA,GAAO,CAAC,EAAA;AAAA,QAAA,CAC9C;AAAA,MACnB,CAAC,GACMf;AAAAA,IACX,GAAG,CAAA,CAAE;AAAA,IACL,MAAM,EAAC,MAAMN,EAAM,YAAY,IAAIK,GAAM,MAAML,EAAM,YAAY,MAAMI,GAAM,WAAWJ,EAAM,UAAA;AAAA,IAC9F,KAAKA,EAAM;AAAA,EAAA;AAEnB;","x_google_ignoreList":[0]}
@@ -1,9 +1,9 @@
1
- import { quantileSorted as u } from "../../node_modules/d3-array/src/quantile.js";
2
- function d(g, r, i = (o) => o) {
3
- const o = (t) => r === "log" ? Math.log10(t) : t, a = (t) => r === "log" ? Math.pow(10, t) : t, e = g.map(i).map(o).sort((t, m) => t - m), s = u(e, 0.25), l = u(e, 0.75), n = l - s, p = 1.5;
4
- return [a(s - p * n), a(l + p * n)];
1
+ import { quantileSorted as l } from "../../node_modules/d3-array/src/quantile.js";
2
+ function c(u, o) {
3
+ const g = (t) => o === "log" ? Math.log10(t) : t, r = (t) => o === "log" ? Math.pow(10, t) : t, a = u.map(g).sort((t, m) => t - m), e = l(a, 0.25), n = l(a, 0.75), s = n - e, i = 1.5;
4
+ return [r(e - i * s), r(n + i * s)];
5
5
  }
6
6
  export {
7
- d as getOutliersBounds
7
+ c as getOutliersBounds
8
8
  };
9
9
  //# sourceMappingURL=getOutliersBounds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getOutliersBounds.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/getOutliersBounds.ts"],"sourcesContent":["import {quantileSorted} from 'd3-array';\n\nexport function getOutliersBounds<ValueType>(values: ValueType[], scale: 'linear' | 'log', yGetter: (v: ValueType) => number = (v) => v as number) {\n const convertToScale = (v: number) => (scale === 'log' ? Math.log10(v) : v);\n const convertFromScale = (v: number) => (scale === 'log' ? Math.pow(10, v) : v);\n const valuesSortedConverted = values\n .map(yGetter)\n .map(convertToScale)\n .sort((a, b) => a - b);\n\n const q1 = quantileSorted(valuesSortedConverted, 0.25) as number;\n const q3 = quantileSorted(valuesSortedConverted, 0.75) as number;\n const interQuantileRange = q3 - q1;\n\n const k = 1.5;\n return [convertFromScale(q1 - k * interQuantileRange), convertFromScale(q3 + k * interQuantileRange)];\n}\n"],"names":["getOutliersBounds","values","scale","yGetter","v","convertToScale","convertFromScale","valuesSortedConverted","a","b","q1","quantileSorted","q3","interQuantileRange","k"],"mappings":";AAEO,SAASA,EAA6BC,GAAqBC,GAAyBC,IAAoC,CAACC,MAAMA,GAAa;AAC/I,QAAMC,IAAiB,CAACD,MAAeF,MAAU,QAAQ,KAAK,MAAME,CAAC,IAAIA,GACnEE,IAAmB,CAACF,MAAeF,MAAU,QAAQ,KAAK,IAAI,IAAIE,CAAC,IAAIA,GACvEG,IAAwBN,EACzB,IAAIE,CAAO,EACX,IAAIE,CAAc,EAClB,KAAK,CAACG,GAAGC,MAAMD,IAAIC,CAAC,GAEnBC,IAAKC,EAAeJ,GAAuB,IAAI,GAC/CK,IAAKD,EAAeJ,GAAuB,IAAI,GAC/CM,IAAqBD,IAAKF,GAE1BI,IAAI;AACV,SAAO,CAACR,EAAiBI,IAAKI,IAAID,CAAkB,GAAGP,EAAiBM,IAAKE,IAAID,CAAkB,CAAC;AACxG;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"getOutliersBounds.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/getOutliersBounds.ts"],"sourcesContent":["import { quantileSorted } from 'd3-array';\n\nexport function getOutliersBounds(values: number[], scale: 'linear' | 'log') {\n const convertToScale = (v: number) => (scale === 'log' ? Math.log10(v) : v);\n const convertFromScale = (v: number) => (scale === 'log' ? Math.pow(10, v) : v);\n const valuesSortedConverted = values\n .map(convertToScale)\n .sort((a, b) => a - b);\n\n const q1 = quantileSorted(valuesSortedConverted, 0.25) as number;\n const q3 = quantileSorted(valuesSortedConverted, 0.75) as number;\n const interQuantileRange = q3 - q1;\n\n const k = 1.5;\n return [convertFromScale(q1 - k * interQuantileRange), convertFromScale(q3 + k * interQuantileRange)];\n}\n"],"names":["getOutliersBounds","values","scale","convertToScale","v","convertFromScale","valuesSortedConverted","a","b","q1","quantileSorted","q3","interQuantileRange","k"],"mappings":";AAEO,SAASA,EAAkBC,GAAkBC,GAAyB;AACzE,QAAMC,IAAiB,CAACC,MAAeF,MAAU,QAAQ,KAAK,MAAME,CAAC,IAAIA,GACnEC,IAAmB,CAACD,MAAeF,MAAU,QAAQ,KAAK,IAAI,IAAIE,CAAC,IAAIA,GACvEE,IAAwBL,EACzB,IAAIE,CAAc,EAClB,KAAK,CAACI,GAAGC,MAAMD,IAAIC,CAAC,GAEnBC,IAAKC,EAAeJ,GAAuB,IAAI,GAC/CK,IAAKD,EAAeJ,GAAuB,IAAI,GAC/CM,IAAqBD,IAAKF,GAE1BI,IAAI;AACV,SAAO,CAACR,EAAiBI,IAAKI,IAAID,CAAkB,GAAGP,EAAiBM,IAAKE,IAAID,CAAkB,CAAC;AACxG;","x_google_ignoreList":[0]}
@@ -1,13 +1,13 @@
1
- import { TextMeasurer as f } from "../../utils/TextMeasurer.js";
2
- function d(p, h, a, o = 14) {
1
+ import { TextMeasurer as f } from "../../utils/TextMeasurer/TextMeasurer.js";
2
+ function d(h, p, a, o = 14) {
3
3
  const i = new f(`600 ${o}px Manrope`), s = [];
4
- p.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach((n) => {
4
+ h.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach((n) => {
5
5
  i.getTextWidth(n) > a ? s.push(...n.split("")) : s.push(n);
6
6
  });
7
7
  let e = "", r = 0, t = 0, u = "";
8
- for (; r <= h; ) {
8
+ for (; r <= p; ) {
9
9
  const n = i.getTextWidth(e + s[t]);
10
- n < h && (e += s[t], u = e, t++), r = n;
10
+ n < p && (e += s[t], u = e, t++), r = n;
11
11
  }
12
12
  e = "", r = 0;
13
13
  const c = [];
@@ -22,27 +22,27 @@ function d(p, h, a, o = 14) {
22
22
  lastPartLength: r
23
23
  };
24
24
  }
25
- function P(p, h, a) {
25
+ function P(h, p, a) {
26
26
  const o = new f(`600 ${a}px Manrope`);
27
- if (p.trim() === "")
27
+ if (h.trim() === "")
28
28
  return [];
29
- if (o.getTextWidth(p) <= h)
30
- return [p];
31
- const i = p.split(/\s+/), s = [];
29
+ if (o.getTextWidth(h) <= p)
30
+ return [h];
31
+ const i = h.split(/\s+/), s = [];
32
32
  let e = "", r = 0;
33
33
  for (let t = 0; t < i.length; t++) {
34
34
  const u = `${e} ${i[t]}`, c = o.getTextWidth(u);
35
- if (c <= h)
35
+ if (c <= p)
36
36
  e = u, r = c;
37
37
  else {
38
38
  const n = o.getTextWidth(i[t]);
39
- if (n > h) {
39
+ if (n > p) {
40
40
  const {
41
41
  firstPart: g,
42
42
  lines: l,
43
43
  lastPart: x,
44
44
  lastPartLength: T
45
- } = d(i[t], h - r, h, a);
45
+ } = d(i[t], p - r, p, a);
46
46
  s.push(`${e} ${g}`), s.push(...l), e = x, r = T;
47
47
  } else
48
48
  s.push(e), e = i[t], r = n;
@@ -1 +1 @@
1
- {"version":3,"file":"splitTextByWidth.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/splitTextByWidth.ts"],"sourcesContent":["import {TextMeasurer} from '../../utils/TextMeasurer';\n\nfunction splitWord(word:string, startLineLength:number, maxLength:number, fontSize = 14) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n // \"_\" and \"-\" symbols have priority as separation bounds, if this is not enough split by single symbols\n const parts:string[] = [];\n word\n .split(/(?=[_-])|(?<=[_-])/)\n .forEach((part) => {\n const length = textMeasurer.getTextWidth(part);\n if (length > maxLength) {\n parts.push(...part.split(''));\n } else {\n parts.push(part);\n }\n });\n let currentLine = '';\n let currentLineLength = 0;\n let i = 0;\n let firstPart = '';\n while (currentLineLength <= startLineLength) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < startLineLength) {\n currentLine += parts[i];\n firstPart = currentLine;\n i++;\n }\n currentLineLength = nextLength;\n }\n currentLine = '';\n currentLineLength = 0;\n const lines:string[] = [];\n for (i; i < parts.length; i++) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < maxLength) {\n currentLine += parts[i];\n currentLineLength = nextLength;\n } else {\n lines.push(currentLine);\n currentLine = parts[i];\n currentLineLength = textMeasurer.getTextWidth(parts[i]);\n }\n }\n return {\n firstPart,\n lines,\n lastPart: currentLine,\n lastPartLength: currentLineLength\n };\n}\n\nexport function splitTextByWidth (text:string, maxWidth: number, fontSize: number) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n if (text.trim() === '') {\n return [];\n }\n if (textMeasurer.getTextWidth(text) <= maxWidth) {\n return [text];\n }\n const words = text.split(/\\s+/);\n const result:string[] = [];\n let currentLine = '';\n let currentLineLength = 0;\n for (let i = 0; i < words.length; i++) {\n const tempLine = `${currentLine} ${words[i]}`;\n const tempLineLength = textMeasurer.getTextWidth(tempLine);\n if (tempLineLength <= maxWidth) {\n currentLine = tempLine;\n currentLineLength = tempLineLength;\n } else {\n const wordLength = textMeasurer.getTextWidth(words[i]);\n if (wordLength > maxWidth) {\n const {\n firstPart,\n lines,\n lastPart,\n lastPartLength\n } = splitWord(words[i], maxWidth - currentLineLength, maxWidth, fontSize);\n result.push(`${currentLine} ${firstPart}`);\n result.push(...lines);\n currentLine = lastPart;\n currentLineLength = lastPartLength;\n } else {\n result.push(currentLine);\n currentLine = words[i];\n currentLineLength = wordLength;\n }\n }\n }\n result.push(currentLine);\n return result.filter((line) => {\n return line.length > 0;\n });\n}\n"],"names":["splitWord","word","startLineLength","maxLength","fontSize","textMeasurer","TextMeasurer","parts","part","currentLine","currentLineLength","i","firstPart","nextLength","lines","splitTextByWidth","text","maxWidth","words","result","tempLine","tempLineLength","wordLength","lastPart","lastPartLength","line"],"mappings":";AAEA,SAASA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,QAAME,IAAQF,EAAK,MAAM,KAAK,GACxBG,IAAkB,CAAA;AACxB,MAAIV,IAAc,IACdC,IAAoB;AACxB,WAASC,IAAI,GAAGA,IAAIO,EAAM,QAAQP,KAAK;AACnC,UAAMS,IAAW,GAAGX,CAAW,IAAIS,EAAMP,CAAC,CAAC,IACrCU,IAAiBhB,EAAa,aAAae,CAAQ;AACzD,QAAIC,KAAkBJ;AAClBR,UAAcW,GACdV,IAAoBW;AAAAA,SACjB;AACH,YAAMC,IAAajB,EAAa,aAAaa,EAAMP,CAAC,CAAC;AACrD,UAAIW,IAAaL,GAAU;AACvB,cAAM;AAAA,UACF,WAAAL;AAAAA,UACA,OAAAE;AAAAA,UACA,UAAAS;AAAAA,UACA,gBAAAC;AAAAA,QAAA,IACAxB,EAAUkB,EAAMP,CAAC,GAAGM,IAAWP,GAAmBO,GAAUb,CAAQ;AACxEe,QAAAA,EAAO,KAAK,GAAGV,CAAW,IAAIG,CAAS,EAAE,GACzCO,EAAO,KAAK,GAAGL,CAAK,GACpBL,IAAcc,GACdb,IAAoBc;AAAAA,MACxB;AACIL,QAAAA,EAAO,KAAKV,CAAW,GACvBA,IAAcS,EAAMP,CAAC,GACrBD,IAAoBY;AAAAA,IAE5B;AAAA,EACJ;AACA,SAAAH,EAAO,KAAKV,CAAW,GAChBU,EAAO,OAAO,CAACM,MACXA,EAAK,SAAS,CACxB;AACL;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"splitTextByWidth.js","sources":["../../../../../../../node_modules/@milaboratories/miplots4/src/discrete/utils/splitTextByWidth.ts"],"sourcesContent":["import { TextMeasurer } from '../../utils/TextMeasurer/TextMeasurer';\n\nfunction splitWord(word:string, startLineLength:number, maxLength:number, fontSize = 14) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n // \"_\" and \"-\" symbols have priority as separation bounds, if this is not enough split by single symbols\n const parts:string[] = [];\n word\n .split(/(?=[_-])|(?<=[_-])/)\n .forEach((part) => {\n const length = textMeasurer.getTextWidth(part);\n if (length > maxLength) {\n parts.push(...part.split(''));\n } else {\n parts.push(part);\n }\n });\n let currentLine = '';\n let currentLineLength = 0;\n let i = 0;\n let firstPart = '';\n while (currentLineLength <= startLineLength) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < startLineLength) {\n currentLine += parts[i];\n firstPart = currentLine;\n i++;\n }\n currentLineLength = nextLength;\n }\n currentLine = '';\n currentLineLength = 0;\n const lines:string[] = [];\n for (i; i < parts.length; i++) {\n const nextLength = textMeasurer.getTextWidth(currentLine + parts[i]);\n if (nextLength < maxLength) {\n currentLine += parts[i];\n currentLineLength = nextLength;\n } else {\n lines.push(currentLine);\n currentLine = parts[i];\n currentLineLength = textMeasurer.getTextWidth(parts[i]);\n }\n }\n return {\n firstPart,\n lines,\n lastPart: currentLine,\n lastPartLength: currentLineLength\n };\n}\n\nexport function splitTextByWidth (text:string, maxWidth: number, fontSize: number) {\n const textMeasurer = new TextMeasurer(`600 ${fontSize}px Manrope`);\n if (text.trim() === '') {\n return [];\n }\n if (textMeasurer.getTextWidth(text) <= maxWidth) {\n return [text];\n }\n const words = text.split(/\\s+/);\n const result:string[] = [];\n let currentLine = '';\n let currentLineLength = 0;\n for (let i = 0; i < words.length; i++) {\n const tempLine = `${currentLine} ${words[i]}`;\n const tempLineLength = textMeasurer.getTextWidth(tempLine);\n if (tempLineLength <= maxWidth) {\n currentLine = tempLine;\n currentLineLength = tempLineLength;\n } else {\n const wordLength = textMeasurer.getTextWidth(words[i]);\n if (wordLength > maxWidth) {\n const {\n firstPart,\n lines,\n lastPart,\n lastPartLength\n } = splitWord(words[i], maxWidth - currentLineLength, maxWidth, fontSize);\n result.push(`${currentLine} ${firstPart}`);\n result.push(...lines);\n currentLine = lastPart;\n currentLineLength = lastPartLength;\n } else {\n result.push(currentLine);\n currentLine = words[i];\n currentLineLength = wordLength;\n }\n }\n }\n result.push(currentLine);\n return result.filter((line) => {\n return line.length > 0;\n });\n}\n"],"names":["splitWord","word","startLineLength","maxLength","fontSize","textMeasurer","TextMeasurer","parts","part","currentLine","currentLineLength","i","firstPart","nextLength","lines","splitTextByWidth","text","maxWidth","words","result","tempLine","tempLineLength","wordLength","lastPart","lastPartLength","line"],"mappings":";AAEA,SAASA,EAAUC,GAAaC,GAAwBC,GAAkBC,IAAW,IAAI;AACrF,QAAMC,IAAe,IAAIC,EAAa,OAAOF,CAAQ,YAAY,GAE3DG,IAAiB,CAAA;AACvBN,EAAAA,EACK,MAAM,IAAA,OAAA,oBAAoB,CAAA,EAC1B,QAAQ,CAACO,MAAS;AACAH,MAAa,aAAaG,CAAI,IAChCL,IACTI,EAAM,KAAK,GAAGC,EAAK,MAAM,EAAE,CAAC,IAE5BD,EAAM,KAAKC,CAAI;AAAA,EAEvB,CAAC;AACL,MAAIC,IAAc,IACdC,IAAoB,GACpBC,IAAI,GACJC,IAAY;AAChB,SAAOF,KAAqBR,KAAiB;AACzC,UAAMW,IAAaR,EAAa,aAAaI,IAAcF,EAAMI,CAAC,CAAC;AAC/DE,IAAAA,IAAaX,MACbO,KAAeF,EAAMI,CAAC,GACtBC,IAAYH,GACZE,MAEJD,IAAoBG;AAAAA,EACxB;AACAJ,MAAc,IACdC,IAAoB;AACpB,QAAMI,IAAiB,CAAA;AACvB,OAAKH,GAAGA,IAAIJ,EAAM,QAAQI,KAAK;AAC3B,UAAME,IAAaR,EAAa,aAAaI,IAAcF,EAAMI,CAAC,CAAC;AAC/DE,IAAAA,IAAaV,KACbM,KAAeF,EAAMI,CAAC,GACtBD,IAAoBG,MAEpBC,EAAM,KAAKL,CAAW,GACtBA,IAAcF,EAAMI,CAAC,GACrBD,IAAoBL,EAAa,aAAaE,EAAMI,CAAC,CAAC;AAAA,EAE9D;AACA,SAAO;AAAA,IACH,WAAAC;AAAAA,IACA,OAAAE;AAAAA,IACA,UAAUL;AAAAA,IACV,gBAAgBC;AAAAA,EAAA;AAExB;AAEO,SAASK,EAAkBC,GAAaC,GAAkBb,GA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