@perses-dev/components 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59

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 (505) hide show
  1. package/dist/BarChart/BarChart.d.ts +3 -4
  2. package/dist/BarChart/BarChart.d.ts.map +1 -1
  3. package/dist/BarChart/BarChart.js +17 -11
  4. package/dist/BarChart/BarChart.js.map +1 -1
  5. package/dist/BarChart/index.js.map +1 -1
  6. package/dist/ColorPicker/ColorPicker.d.ts +1 -2
  7. package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
  8. package/dist/ColorPicker/ColorPicker.js +1 -1
  9. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  10. package/dist/ColorPicker/index.js.map +1 -1
  11. package/dist/ContentWithLegend/ContentWithLegend.d.ts +1 -2
  12. package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
  13. package/dist/ContentWithLegend/ContentWithLegend.js +2 -2
  14. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  15. package/dist/ContentWithLegend/index.js.map +1 -1
  16. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +3 -3
  17. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
  18. package/dist/ContentWithLegend/model/content-with-legend-model.js +21 -21
  19. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  20. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +1 -2
  21. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
  22. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +8 -24
  23. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
  24. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -2
  25. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
  26. package/dist/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
  27. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  28. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +1 -2
  29. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -1
  30. package/dist/DateTimeRangePicker/TimeRangeSelector.js +2 -2
  31. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
  32. package/dist/DateTimeRangePicker/index.js.map +1 -1
  33. package/dist/DateTimeRangePicker/utils.js.map +1 -1
  34. package/dist/Dialog/Dialog.d.ts +6 -6
  35. package/dist/Dialog/Dialog.d.ts.map +1 -1
  36. package/dist/Dialog/Dialog.js +5 -5
  37. package/dist/Dialog/Dialog.js.map +1 -1
  38. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +1 -2
  39. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  40. package/dist/Dialog/DiscardChangesConfirmationDialog.js +1 -1
  41. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  42. package/dist/Dialog/index.js.map +1 -1
  43. package/dist/Drawer/Drawer.d.ts +1 -2
  44. package/dist/Drawer/Drawer.d.ts.map +1 -1
  45. package/dist/Drawer/Drawer.js +4 -3
  46. package/dist/Drawer/Drawer.js.map +1 -1
  47. package/dist/Drawer/index.js.map +1 -1
  48. package/dist/EChart/EChart.d.ts +7 -7
  49. package/dist/EChart/EChart.d.ts.map +1 -1
  50. package/dist/EChart/EChart.js +3 -3
  51. package/dist/EChart/EChart.js.map +1 -1
  52. package/dist/EChart/index.js.map +1 -1
  53. package/dist/ErrorAlert.d.ts +1 -2
  54. package/dist/ErrorAlert.d.ts.map +1 -1
  55. package/dist/ErrorAlert.js +1 -1
  56. package/dist/ErrorAlert.js.map +1 -1
  57. package/dist/ErrorBoundary.js.map +1 -1
  58. package/dist/FontSizeSelector/FontSizeSelector.d.ts +2 -3
  59. package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
  60. package/dist/FontSizeSelector/FontSizeSelector.js +2 -2
  61. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  62. package/dist/FontSizeSelector/index.js.map +1 -1
  63. package/dist/FormatControls/FormatControls.d.ts +8 -0
  64. package/dist/FormatControls/FormatControls.d.ts.map +1 -0
  65. package/dist/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +26 -26
  66. package/dist/FormatControls/FormatControls.js.map +1 -0
  67. package/dist/FormatControls/index.d.ts +2 -0
  68. package/dist/FormatControls/index.d.ts.map +1 -0
  69. package/dist/{UnitSelector → FormatControls}/index.js +1 -1
  70. package/dist/FormatControls/index.js.map +1 -0
  71. package/dist/GaugeChart/GaugeChart.d.ts +6 -7
  72. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
  73. package/dist/GaugeChart/GaugeChart.js +12 -12
  74. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  75. package/dist/GaugeChart/index.js.map +1 -1
  76. package/dist/InfoTooltip/InfoTooltip.d.ts +2 -2
  77. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  78. package/dist/InfoTooltip/InfoTooltip.js +4 -4
  79. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  80. package/dist/InfoTooltip/index.js.map +1 -1
  81. package/dist/JSONEditor.d.ts +4 -4
  82. package/dist/JSONEditor.d.ts.map +1 -1
  83. package/dist/JSONEditor.js +9 -8
  84. package/dist/JSONEditor.js.map +1 -1
  85. package/dist/Legend/CompactLegend.d.ts +1 -2
  86. package/dist/Legend/CompactLegend.d.ts.map +1 -1
  87. package/dist/Legend/CompactLegend.js +1 -1
  88. package/dist/Legend/CompactLegend.js.map +1 -1
  89. package/dist/Legend/Legend.d.ts +1 -2
  90. package/dist/Legend/Legend.d.ts.map +1 -1
  91. package/dist/Legend/Legend.js +4 -4
  92. package/dist/Legend/Legend.js.map +1 -1
  93. package/dist/Legend/LegendColorBadge.js +1 -1
  94. package/dist/Legend/LegendColorBadge.js.map +1 -1
  95. package/dist/Legend/ListLegend.d.ts +1 -2
  96. package/dist/Legend/ListLegend.d.ts.map +1 -1
  97. package/dist/Legend/ListLegend.js +1 -1
  98. package/dist/Legend/ListLegend.js.map +1 -1
  99. package/dist/Legend/ListLegendItem.d.ts +2 -2
  100. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  101. package/dist/Legend/ListLegendItem.js +7 -11
  102. package/dist/Legend/ListLegendItem.js.map +1 -1
  103. package/dist/Legend/TableLegend.d.ts +1 -2
  104. package/dist/Legend/TableLegend.d.ts.map +1 -1
  105. package/dist/Legend/TableLegend.js +2 -2
  106. package/dist/Legend/TableLegend.js.map +1 -1
  107. package/dist/Legend/index.js.map +1 -1
  108. package/dist/Legend/legend-model.d.ts +2 -2
  109. package/dist/Legend/legend-model.d.ts.map +1 -1
  110. package/dist/Legend/legend-model.js.map +1 -1
  111. package/dist/LineChart/LineChart.d.ts +2 -2
  112. package/dist/LineChart/LineChart.d.ts.map +1 -1
  113. package/dist/LineChart/LineChart.js +22 -24
  114. package/dist/LineChart/LineChart.js.map +1 -1
  115. package/dist/LineChart/index.js.map +1 -1
  116. package/dist/ModeSelector/ModeSelector.d.ts +2 -3
  117. package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
  118. package/dist/ModeSelector/ModeSelector.js +2 -2
  119. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  120. package/dist/ModeSelector/index.js.map +1 -1
  121. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +2 -2
  122. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
  123. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
  124. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  125. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +2 -3
  126. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  127. package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  128. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  129. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +2 -2
  130. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
  131. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
  132. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  133. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +2 -2
  134. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
  135. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
  136. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  137. package/dist/OptionsEditorLayout/index.js.map +1 -1
  138. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +1 -2
  139. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
  140. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +23 -7
  141. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  142. package/dist/RefreshIntervalPicker/index.js.map +1 -1
  143. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +1 -1
  144. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
  145. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +4 -4
  146. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  147. package/dist/SettingsAutocomplete/index.js.map +1 -1
  148. package/dist/SortSelector/SortSelector.d.ts +2 -3
  149. package/dist/SortSelector/SortSelector.d.ts.map +1 -1
  150. package/dist/SortSelector/SortSelector.js +2 -2
  151. package/dist/SortSelector/SortSelector.js.map +1 -1
  152. package/dist/SortSelector/index.js.map +1 -1
  153. package/dist/StatChart/StatChart.d.ts +3 -4
  154. package/dist/StatChart/StatChart.d.ts.map +1 -1
  155. package/dist/StatChart/StatChart.js +10 -10
  156. package/dist/StatChart/StatChart.js.map +1 -1
  157. package/dist/StatChart/calculateFontSize.js +8 -8
  158. package/dist/StatChart/calculateFontSize.js.map +1 -1
  159. package/dist/StatChart/index.js.map +1 -1
  160. package/dist/Table/InnerTable.d.ts +2 -2
  161. package/dist/Table/InnerTable.d.ts.map +1 -1
  162. package/dist/Table/InnerTable.js +2 -2
  163. package/dist/Table/InnerTable.js.map +1 -1
  164. package/dist/Table/Table.d.ts +1 -2
  165. package/dist/Table/Table.d.ts.map +1 -1
  166. package/dist/Table/Table.js +3 -3
  167. package/dist/Table/Table.js.map +1 -1
  168. package/dist/Table/TableBody.d.ts +2 -2
  169. package/dist/Table/TableBody.d.ts.map +1 -1
  170. package/dist/Table/TableBody.js.map +1 -1
  171. package/dist/Table/TableCell.d.ts +1 -1
  172. package/dist/Table/TableCell.d.ts.map +1 -1
  173. package/dist/Table/TableCell.js +4 -4
  174. package/dist/Table/TableCell.js.map +1 -1
  175. package/dist/Table/TableCheckbox.d.ts +1 -2
  176. package/dist/Table/TableCheckbox.d.ts.map +1 -1
  177. package/dist/Table/TableCheckbox.js +1 -1
  178. package/dist/Table/TableCheckbox.js.map +1 -1
  179. package/dist/Table/TableHead.d.ts +2 -2
  180. package/dist/Table/TableHead.d.ts.map +1 -1
  181. package/dist/Table/TableHead.js.map +1 -1
  182. package/dist/Table/TableHeaderCell.d.ts +1 -2
  183. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  184. package/dist/Table/TableHeaderCell.js +1 -1
  185. package/dist/Table/TableHeaderCell.js.map +1 -1
  186. package/dist/Table/TableRow.d.ts +1 -1
  187. package/dist/Table/TableRow.d.ts.map +1 -1
  188. package/dist/Table/TableRow.js.map +1 -1
  189. package/dist/Table/VirtualizedTable.d.ts +2 -2
  190. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  191. package/dist/Table/VirtualizedTable.js +8 -8
  192. package/dist/Table/VirtualizedTable.js.map +1 -1
  193. package/dist/Table/VirtualizedTableContainer.d.ts +2 -2
  194. package/dist/Table/VirtualizedTableContainer.d.ts.map +1 -1
  195. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  196. package/dist/Table/hooks/useTableKeyboardNav.d.ts +1 -1
  197. package/dist/Table/hooks/useTableKeyboardNav.d.ts.map +1 -1
  198. package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
  199. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  200. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +21 -21
  201. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  202. package/dist/Table/index.js.map +1 -1
  203. package/dist/Table/model/table-model.d.ts +6 -6
  204. package/dist/Table/model/table-model.d.ts.map +1 -1
  205. package/dist/Table/model/table-model.js +11 -11
  206. package/dist/Table/model/table-model.js.map +1 -1
  207. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +1 -2
  208. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +1 -1
  209. package/dist/ThresholdsEditor/ThresholdColorPicker.js +4 -4
  210. package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
  211. package/dist/ThresholdsEditor/ThresholdInput.d.ts +1 -1
  212. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
  213. package/dist/ThresholdsEditor/ThresholdInput.js +2 -2
  214. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  215. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +1 -2
  216. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  217. package/dist/ThresholdsEditor/ThresholdsEditor.js +23 -21
  218. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  219. package/dist/ThresholdsEditor/index.js.map +1 -1
  220. package/dist/TimeChart/TimeChart.d.ts +3 -3
  221. package/dist/TimeChart/TimeChart.d.ts.map +1 -1
  222. package/dist/TimeChart/TimeChart.js +110 -67
  223. package/dist/TimeChart/TimeChart.js.map +1 -1
  224. package/dist/TimeChart/index.js.map +1 -1
  225. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +2 -2
  226. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
  227. package/dist/TimeSeriesTooltip/LineChartTooltip.js +11 -10
  228. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
  229. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +1 -2
  230. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
  231. package/dist/TimeSeriesTooltip/SeriesInfo.js +3 -3
  232. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  233. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +1 -2
  234. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
  235. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
  236. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  237. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +1 -2
  238. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
  239. package/dist/TimeSeriesTooltip/SeriesMarker.js +1 -1
  240. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  241. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +2 -2
  242. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  243. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +6 -6
  244. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  245. package/dist/TimeSeriesTooltip/TooltipContent.d.ts +1 -2
  246. package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
  247. package/dist/TimeSeriesTooltip/TooltipContent.js +2 -2
  248. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  249. package/dist/TimeSeriesTooltip/TooltipHeader.js +7 -7
  250. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  251. package/dist/TimeSeriesTooltip/index.js.map +1 -1
  252. package/dist/TimeSeriesTooltip/nearby-series.d.ts +8 -8
  253. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  254. package/dist/TimeSeriesTooltip/nearby-series.js +44 -45
  255. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  256. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +13 -26
  257. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  258. package/dist/TimeSeriesTooltip/tooltip-model.js +5 -11
  259. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  260. package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
  261. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  262. package/dist/TimeSeriesTooltip/utils.js +5 -4
  263. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  264. package/dist/ToolbarIconButton/ToolbarIconButton.d.ts +6 -0
  265. package/dist/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -0
  266. package/dist/ToolbarIconButton/ToolbarIconButton.js +32 -0
  267. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
  268. package/dist/ToolbarIconButton/index.d.ts +2 -0
  269. package/dist/ToolbarIconButton/index.d.ts.map +1 -0
  270. package/dist/ToolbarIconButton/index.js +15 -0
  271. package/dist/ToolbarIconButton/index.js.map +1 -0
  272. package/dist/YAxisLabel.d.ts +1 -2
  273. package/dist/YAxisLabel.d.ts.map +1 -1
  274. package/dist/YAxisLabel.js +1 -1
  275. package/dist/YAxisLabel.js.map +1 -1
  276. package/dist/cjs/BarChart/BarChart.js +25 -17
  277. package/dist/cjs/BarChart/index.js +10 -8
  278. package/dist/cjs/ColorPicker/ColorPicker.js +19 -15
  279. package/dist/cjs/ColorPicker/index.js +10 -8
  280. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +13 -11
  281. package/dist/cjs/ContentWithLegend/index.js +10 -8
  282. package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +29 -25
  283. package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +30 -44
  284. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +13 -11
  285. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +14 -12
  286. package/dist/cjs/DateTimeRangePicker/index.js +12 -10
  287. package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
  288. package/dist/cjs/Dialog/Dialog.js +16 -14
  289. package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +12 -10
  290. package/dist/cjs/Dialog/index.js +11 -9
  291. package/dist/cjs/Drawer/Drawer.js +8 -5
  292. package/dist/cjs/Drawer/index.js +10 -8
  293. package/dist/cjs/EChart/EChart.js +16 -12
  294. package/dist/cjs/EChart/index.js +10 -8
  295. package/dist/cjs/ErrorAlert.js +6 -4
  296. package/dist/cjs/ErrorBoundary.js +4 -2
  297. package/dist/cjs/FontSizeSelector/FontSizeSelector.js +10 -8
  298. package/dist/cjs/FontSizeSelector/index.js +10 -8
  299. package/dist/cjs/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +38 -36
  300. package/dist/cjs/{UnitSelector → FormatControls}/index.js +10 -8
  301. package/dist/cjs/GaugeChart/GaugeChart.js +22 -18
  302. package/dist/cjs/GaugeChart/index.js +10 -8
  303. package/dist/cjs/InfoTooltip/InfoTooltip.js +16 -14
  304. package/dist/cjs/InfoTooltip/index.js +10 -8
  305. package/dist/cjs/JSONEditor.js +19 -16
  306. package/dist/cjs/Legend/CompactLegend.js +10 -8
  307. package/dist/cjs/Legend/Legend.js +16 -14
  308. package/dist/cjs/Legend/LegendColorBadge.js +8 -6
  309. package/dist/cjs/Legend/ListLegend.js +11 -9
  310. package/dist/cjs/Legend/ListLegendItem.js +20 -20
  311. package/dist/cjs/Legend/TableLegend.js +8 -6
  312. package/dist/cjs/Legend/index.js +11 -9
  313. package/dist/cjs/Legend/legend-model.js +3 -1
  314. package/dist/cjs/LineChart/LineChart.js +31 -31
  315. package/dist/cjs/LineChart/index.js +10 -8
  316. package/dist/cjs/ModeSelector/ModeSelector.js +10 -8
  317. package/dist/cjs/ModeSelector/index.js +10 -8
  318. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +7 -5
  319. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +17 -15
  320. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +6 -4
  321. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +12 -10
  322. package/dist/cjs/OptionsEditorLayout/index.js +13 -11
  323. package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +28 -10
  324. package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
  325. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +13 -11
  326. package/dist/cjs/SettingsAutocomplete/index.js +10 -8
  327. package/dist/cjs/SortSelector/SortSelector.js +10 -8
  328. package/dist/cjs/SortSelector/index.js +10 -8
  329. package/dist/cjs/StatChart/StatChart.js +22 -20
  330. package/dist/cjs/StatChart/calculateFontSize.js +11 -9
  331. package/dist/cjs/StatChart/index.js +10 -8
  332. package/dist/cjs/Table/InnerTable.js +7 -5
  333. package/dist/cjs/Table/Table.js +18 -16
  334. package/dist/cjs/Table/TableBody.js +5 -3
  335. package/dist/cjs/Table/TableCell.js +12 -10
  336. package/dist/cjs/Table/TableCheckbox.js +6 -4
  337. package/dist/cjs/Table/TableHead.js +5 -3
  338. package/dist/cjs/Table/TableHeaderCell.js +9 -7
  339. package/dist/cjs/Table/TableRow.js +5 -3
  340. package/dist/cjs/Table/VirtualizedTable.js +34 -32
  341. package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
  342. package/dist/cjs/Table/hooks/useTableKeyboardNav.js +4 -2
  343. package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +24 -22
  344. package/dist/cjs/Table/index.js +14 -10
  345. package/dist/cjs/Table/model/table-model.js +17 -13
  346. package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +17 -15
  347. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +15 -13
  348. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +50 -44
  349. package/dist/cjs/ThresholdsEditor/index.js +10 -8
  350. package/dist/cjs/TimeChart/TimeChart.js +123 -78
  351. package/dist/cjs/TimeChart/index.js +10 -8
  352. package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +31 -28
  353. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +18 -16
  354. package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +16 -14
  355. package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +6 -4
  356. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +23 -21
  357. package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +9 -7
  358. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +35 -33
  359. package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
  360. package/dist/cjs/TimeSeriesTooltip/nearby-series.js +70 -53
  361. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +56 -28
  362. package/dist/cjs/TimeSeriesTooltip/utils.js +19 -14
  363. package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +40 -0
  364. package/dist/cjs/ToolbarIconButton/index.js +30 -0
  365. package/dist/cjs/YAxisLabel.js +7 -5
  366. package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +41 -12
  367. package/dist/cjs/context/SnackbarProvider.js +7 -3
  368. package/dist/cjs/context/TimeZoneProvider.js +17 -9
  369. package/dist/cjs/context/index.js +32 -0
  370. package/dist/cjs/index.js +42 -41
  371. package/dist/cjs/model/graph.js +9 -3
  372. package/dist/cjs/model/index.js +12 -10
  373. package/dist/cjs/test/index.js +10 -8
  374. package/dist/cjs/test/render.js +7 -5
  375. package/dist/cjs/test-utils/index.js +10 -8
  376. package/dist/cjs/test-utils/theme.js +38 -19
  377. package/dist/cjs/theme/component-overrides/alert.js +7 -5
  378. package/dist/cjs/theme/component-overrides/paper.js +4 -2
  379. package/dist/cjs/theme/index.js +10 -8
  380. package/dist/cjs/theme/palette/background.js +6 -2
  381. package/dist/cjs/theme/palette/colors/blue.js +3 -1
  382. package/dist/cjs/theme/palette/colors/common.js +6 -2
  383. package/dist/cjs/theme/palette/colors/green.js +3 -1
  384. package/dist/cjs/theme/palette/colors/grey.js +3 -1
  385. package/dist/cjs/theme/palette/colors/index.js +17 -15
  386. package/dist/cjs/theme/palette/colors/orange.js +3 -1
  387. package/dist/cjs/theme/palette/colors/purple.js +3 -1
  388. package/dist/cjs/theme/palette/colors/red.js +3 -1
  389. package/dist/cjs/theme/palette/error.js +3 -1
  390. package/dist/cjs/theme/palette/grey.js +3 -1
  391. package/dist/cjs/theme/palette/index.js +10 -8
  392. package/dist/cjs/theme/palette/palette-options.js +3 -1
  393. package/dist/cjs/theme/palette/primary.js +3 -1
  394. package/dist/cjs/theme/palette/secondary.js +3 -1
  395. package/dist/cjs/theme/palette/success.js +3 -1
  396. package/dist/cjs/theme/palette/text.js +3 -1
  397. package/dist/cjs/theme/palette/warning.js +3 -1
  398. package/dist/cjs/theme/theme.js +6 -4
  399. package/dist/cjs/theme/typography.js +3 -1
  400. package/dist/cjs/utils/axis.js +11 -7
  401. package/dist/cjs/utils/chart-actions.js +68 -12
  402. package/dist/cjs/utils/combine-sx.js +3 -1
  403. package/dist/cjs/utils/component-ids.js +3 -1
  404. package/dist/cjs/utils/format.js +16 -8
  405. package/dist/cjs/utils/index.js +15 -13
  406. package/dist/cjs/utils/mathjs.js +4 -2
  407. package/dist/cjs/utils/theme-gen.js +16 -18
  408. package/dist/context/ChartsProvider.d.ts +19 -0
  409. package/dist/context/ChartsProvider.d.ts.map +1 -0
  410. package/dist/context/{ChartsThemeProvider.js → ChartsProvider.js} +24 -6
  411. package/dist/context/ChartsProvider.js.map +1 -0
  412. package/dist/context/SnackbarProvider.d.ts +2 -2
  413. package/dist/context/SnackbarProvider.d.ts.map +1 -1
  414. package/dist/context/SnackbarProvider.js +1 -1
  415. package/dist/context/SnackbarProvider.js.map +1 -1
  416. package/dist/context/TimeZoneProvider.d.ts +1 -1
  417. package/dist/context/TimeZoneProvider.d.ts.map +1 -1
  418. package/dist/context/TimeZoneProvider.js +1 -1
  419. package/dist/context/TimeZoneProvider.js.map +1 -1
  420. package/dist/context/index.d.ts +4 -0
  421. package/dist/context/index.d.ts.map +1 -0
  422. package/dist/context/index.js +17 -0
  423. package/dist/context/index.js.map +1 -0
  424. package/dist/index.d.ts +3 -4
  425. package/dist/index.d.ts.map +1 -1
  426. package/dist/index.js +3 -4
  427. package/dist/index.js.map +1 -1
  428. package/dist/model/graph.d.ts +8 -8
  429. package/dist/model/graph.d.ts.map +1 -1
  430. package/dist/model/graph.js.map +1 -1
  431. package/dist/model/index.js.map +1 -1
  432. package/dist/model/theme.d.ts +1 -1
  433. package/dist/model/theme.d.ts.map +1 -1
  434. package/dist/model/theme.js.map +1 -1
  435. package/dist/model/timeOption.js.map +1 -1
  436. package/dist/test/index.js.map +1 -1
  437. package/dist/test/render.js.map +1 -1
  438. package/dist/test/setup-tests.js.map +1 -1
  439. package/dist/test-utils/index.js.map +1 -1
  440. package/dist/test-utils/theme.d.ts +2 -0
  441. package/dist/test-utils/theme.d.ts.map +1 -1
  442. package/dist/test-utils/theme.js +25 -16
  443. package/dist/test-utils/theme.js.map +1 -1
  444. package/dist/theme/component-overrides/alert.js +4 -4
  445. package/dist/theme/component-overrides/alert.js.map +1 -1
  446. package/dist/theme/component-overrides/paper.js +1 -1
  447. package/dist/theme/component-overrides/paper.js.map +1 -1
  448. package/dist/theme/index.d.ts +1 -0
  449. package/dist/theme/index.d.ts.map +1 -1
  450. package/dist/theme/index.js.map +1 -1
  451. package/dist/theme/palette/background.d.ts.map +1 -1
  452. package/dist/theme/palette/background.js +3 -1
  453. package/dist/theme/palette/background.js.map +1 -1
  454. package/dist/theme/palette/colors/blue.js.map +1 -1
  455. package/dist/theme/palette/colors/common.js.map +1 -1
  456. package/dist/theme/palette/colors/green.js.map +1 -1
  457. package/dist/theme/palette/colors/grey.js.map +1 -1
  458. package/dist/theme/palette/colors/index.js.map +1 -1
  459. package/dist/theme/palette/colors/orange.js.map +1 -1
  460. package/dist/theme/palette/colors/purple.js.map +1 -1
  461. package/dist/theme/palette/colors/red.js.map +1 -1
  462. package/dist/theme/palette/colors/types.d.ts +1 -1
  463. package/dist/theme/palette/colors/types.d.ts.map +1 -1
  464. package/dist/theme/palette/colors/types.js.map +1 -1
  465. package/dist/theme/palette/error.js.map +1 -1
  466. package/dist/theme/palette/grey.js.map +1 -1
  467. package/dist/theme/palette/index.js.map +1 -1
  468. package/dist/theme/palette/palette-options.js.map +1 -1
  469. package/dist/theme/palette/primary.js.map +1 -1
  470. package/dist/theme/palette/secondary.js.map +1 -1
  471. package/dist/theme/palette/success.js.map +1 -1
  472. package/dist/theme/palette/text.js.map +1 -1
  473. package/dist/theme/palette/warning.js.map +1 -1
  474. package/dist/theme/theme.js +1 -1
  475. package/dist/theme/theme.js.map +1 -1
  476. package/dist/theme/types/ThemeExtension.d.js.map +1 -1
  477. package/dist/theme/typography.js.map +1 -1
  478. package/dist/utils/axis.d.ts +4 -4
  479. package/dist/utils/axis.d.ts.map +1 -1
  480. package/dist/utils/axis.js +4 -4
  481. package/dist/utils/axis.js.map +1 -1
  482. package/dist/utils/chart-actions.d.ts +6 -2
  483. package/dist/utils/chart-actions.d.ts.map +1 -1
  484. package/dist/utils/chart-actions.js +51 -7
  485. package/dist/utils/chart-actions.js.map +1 -1
  486. package/dist/utils/combine-sx.js.map +1 -1
  487. package/dist/utils/component-ids.js.map +1 -1
  488. package/dist/utils/format.js.map +1 -1
  489. package/dist/utils/index.js.map +1 -1
  490. package/dist/utils/mathjs.js +1 -1
  491. package/dist/utils/mathjs.js.map +1 -1
  492. package/dist/utils/theme-gen.d.ts +3 -8
  493. package/dist/utils/theme-gen.d.ts.map +1 -1
  494. package/dist/utils/theme-gen.js +11 -15
  495. package/dist/utils/theme-gen.js.map +1 -1
  496. package/package.json +8 -7
  497. package/dist/UnitSelector/UnitSelector.d.ts +0 -9
  498. package/dist/UnitSelector/UnitSelector.d.ts.map +0 -1
  499. package/dist/UnitSelector/UnitSelector.js.map +0 -1
  500. package/dist/UnitSelector/index.d.ts +0 -2
  501. package/dist/UnitSelector/index.d.ts.map +0 -1
  502. package/dist/UnitSelector/index.js.map +0 -1
  503. package/dist/context/ChartsThemeProvider.d.ts +0 -10
  504. package/dist/context/ChartsThemeProvider.d.ts.map +0 -1
  505. package/dist/context/ChartsThemeProvider.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/TimeSeriesTooltip/utils.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Theme } from '@mui/material';\nimport {\n CursorCoordinates,\n CursorData,\n TOOLTIP_MAX_WIDTH,\n TOOLTIP_MAX_HEIGHT,\n TOOLTIP_MIN_WIDTH,\n TOOLTIP_ADJUST_Y_POS_MULTIPLIER,\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_PADDING,\n} from './tooltip-model';\n\n/**\n * Determine position of tooltip depending on chart dimensions and the number of focused series\n */\nexport function assembleTransform(\n mousePos: CursorData['coords'],\n chartWidth: number,\n pinnedPos: CursorCoordinates | null,\n tooltipHeight: number,\n tooltipWidth: number,\n containerElement?: Element | null\n) {\n if (mousePos === null) {\n return 'translate3d(0, 0)';\n }\n\n const cursorPaddingX = 32;\n const cursorPaddingY = 16;\n\n if (pinnedPos !== null) {\n mousePos = pinnedPos;\n }\n\n // By default, tooltip is located in a Portal attached to the body.\n // Using page coordinates instead of viewport ensures the tooltip is\n // absolutely positioned correctly as the user scrolls\n let x = mousePos.page.x;\n let y = mousePos.page.y + cursorPaddingY;\n\n // If containerElement is defined, tooltip is attached to the containerElement instead.\n let containerRect;\n if (containerElement) {\n // get the container's position relative to viewport\n containerRect = containerElement.getBoundingClientRect();\n // calculate the mouse position relative to container\n x = x - containerRect.left + containerElement.scrollLeft;\n y = y - containerRect.top + containerElement.scrollTop;\n }\n\n if (mousePos.client.y + tooltipHeight + cursorPaddingY > window.innerHeight) {\n // adjust so tooltip does not get cut off at bottom of chart\n // multiplier ensures tooltip isn't overly adjusted and gets cut off at the top of the viewport\n y = y - tooltipHeight * TOOLTIP_ADJUST_Y_POS_MULTIPLIER;\n\n // If y is now above of the top of containerElement, set y close to 0 so tooltip does not get cut off\n if (containerRect && y < containerRect.top) {\n y = TOOLTIP_PADDING / 2; // leaves room for some padding around tooltip\n }\n }\n\n // use tooltip width to determine when to repos from right to left\n const xPosAdjustThreshold = chartWidth - tooltipWidth * 0.9;\n\n // reposition so tooltip is never too close to right side of chart or left side of browser window\n return mousePos.plotCanvas.x > xPosAdjustThreshold && x > TOOLTIP_MAX_WIDTH\n ? `translate3d(${x - cursorPaddingX}px, ${y}px, 0) translateX(-100%)`\n : `translate3d(${x + cursorPaddingX}px, ${y}px, 0)`;\n}\n\n/**\n * Helper for tooltip positioning styles\n */\nexport function getTooltipStyles(theme: Theme, pinnedPos: CursorCoordinates | null, maxHeight?: number) {\n const adjustedMaxHeight = maxHeight ? maxHeight - TOOLTIP_PADDING : undefined;\n return {\n minWidth: TOOLTIP_MIN_WIDTH,\n maxWidth: TOOLTIP_MAX_WIDTH,\n maxHeight: adjustedMaxHeight ?? TOOLTIP_MAX_HEIGHT,\n padding: 0,\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,\n borderRadius: '6px',\n color: '#fff',\n fontSize: '11px',\n visibility: 'visible',\n opacity: 1,\n transition: 'all 0.1s ease-out',\n // Ensure pinned tooltip shows behind edit panel drawer and sticky header\n zIndex: pinnedPos !== null ? 'auto' : theme.zIndex.tooltip,\n overflow: 'hidden',\n '&:hover': {\n overflowY: 'auto',\n },\n };\n}\n"],"names":["TOOLTIP_MAX_WIDTH","TOOLTIP_MAX_HEIGHT","TOOLTIP_MIN_WIDTH","TOOLTIP_ADJUST_Y_POS_MULTIPLIER","TOOLTIP_BG_COLOR_FALLBACK","TOOLTIP_PADDING","assembleTransform","mousePos","chartWidth","pinnedPos","tooltipHeight","tooltipWidth","containerElement","cursorPaddingX","cursorPaddingY","x","page","y","containerRect","getBoundingClientRect","left","scrollLeft","top","scrollTop","client","window","innerHeight","xPosAdjustThreshold","plotCanvas","getTooltipStyles","theme","maxHeight","adjustedMaxHeight","undefined","minWidth","maxWidth","padding","position","backgroundColor","palette","designSystem","grey","borderRadius","color","fontSize","visibility","opacity","transition","zIndex","tooltip","overflow","overflowY"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAGEA,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,+BAA+B,EAC/BC,yBAAyB,EACzBC,eAAe,QACV,iBAAiB,CAAC;AAEzB;;CAEC,GACD,OAAO,SAASC,iBAAiB,CAC/BC,QAA8B,EAC9BC,UAAkB,EAClBC,SAAmC,EACnCC,aAAqB,EACrBC,YAAoB,EACpBC,gBAAiC,EACjC;IACA,IAAIL,QAAQ,KAAK,IAAI,EAAE;QACrB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAMM,cAAc,GAAG,EAAE,AAAC;IAC1B,MAAMC,cAAc,GAAG,EAAE,AAAC;IAE1B,IAAIL,SAAS,KAAK,IAAI,EAAE;QACtBF,QAAQ,GAAGE,SAAS,CAAC;IACvB,CAAC;IAED,mEAAmE;IACnE,oEAAoE;IACpE,sDAAsD;IACtD,IAAIM,CAAC,GAAGR,QAAQ,CAACS,IAAI,CAACD,CAAC,AAAC;IACxB,IAAIE,CAAC,GAAGV,QAAQ,CAACS,IAAI,CAACC,CAAC,GAAGH,cAAc,AAAC;IAEzC,uFAAuF;IACvF,IAAII,aAAa,AAAC;IAClB,IAAIN,gBAAgB,EAAE;QACpB,oDAAoD;QACpDM,aAAa,GAAGN,gBAAgB,CAACO,qBAAqB,EAAE,CAAC;QACzD,qDAAqD;QACrDJ,CAAC,GAAGA,CAAC,GAAGG,aAAa,CAACE,IAAI,GAAGR,gBAAgB,CAACS,UAAU,CAAC;QACzDJ,CAAC,GAAGA,CAAC,GAAGC,aAAa,CAACI,GAAG,GAAGV,gBAAgB,CAACW,SAAS,CAAC;IACzD,CAAC;IAED,IAAIhB,QAAQ,CAACiB,MAAM,CAACP,CAAC,GAAGP,aAAa,GAAGI,cAAc,GAAGW,MAAM,CAACC,WAAW,EAAE;QAC3E,4DAA4D;QAC5D,+FAA+F;QAC/FT,CAAC,GAAGA,CAAC,GAAGP,aAAa,GAAGP,+BAA+B,CAAC;QAExD,qGAAqG;QACrG,IAAIe,aAAa,IAAID,CAAC,GAAGC,aAAa,CAACI,GAAG,EAAE;YAC1CL,CAAC,GAAGZ,eAAe,GAAG,CAAC,CAAC,CAAC,8CAA8C;QACzE,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,MAAMsB,mBAAmB,GAAGnB,UAAU,GAAGG,YAAY,GAAG,GAAG,AAAC;IAE5D,iGAAiG;IACjG,OAAOJ,QAAQ,CAACqB,UAAU,CAACb,CAAC,GAAGY,mBAAmB,IAAIZ,CAAC,GAAGf,iBAAiB,GACvE,CAAC,YAAY,EAAEe,CAAC,GAAGF,cAAc,CAAC,IAAI,EAAEI,CAAC,CAAC,wBAAwB,CAAC,GACnE,CAAC,YAAY,EAAEF,CAAC,GAAGF,cAAc,CAAC,IAAI,EAAEI,CAAC,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC;AAED;;CAEC,GACD,OAAO,SAASY,gBAAgB,CAACC,KAAY,EAAErB,SAAmC,EAAEsB,SAAkB,EAAE;QAUnFD,GAA0B;IAT7C,MAAME,iBAAiB,GAAGD,SAAS,GAAGA,SAAS,GAAG1B,eAAe,GAAG4B,SAAS,AAAC;QAS3DH,IAAqC;IARxD,OAAO;QACLI,QAAQ,EAAEhC,iBAAiB;QAC3BiC,QAAQ,EAAEnC,iBAAiB;QAC3B+B,SAAS,EAAEC,iBAAiB,aAAjBA,iBAAiB,cAAjBA,iBAAiB,GAAI/B,kBAAkB;QAClDmC,OAAO,EAAE,CAAC;QACVC,QAAQ,EAAE,UAAU;QACpBf,GAAG,EAAE,CAAC;QACNF,IAAI,EAAE,CAAC;QACPkB,eAAe,EAAER,CAAAA,IAAqC,GAArCA,CAAAA,GAA0B,GAA1BA,KAAK,CAACS,OAAO,CAACC,YAAY,cAA1BV,GAA0B,WAAM,GAAhCA,KAAAA,CAAgC,GAAhCA,GAA0B,CAAEW,IAAI,CAAC,GAAG,CAAC,cAArCX,IAAqC,cAArCA,IAAqC,GAAI1B,yBAAyB;QACnFsC,YAAY,EAAE,KAAK;QACnBC,KAAK,EAAE,MAAM;QACbC,QAAQ,EAAE,MAAM;QAChBC,UAAU,EAAE,SAAS;QACrBC,OAAO,EAAE,CAAC;QACVC,UAAU,EAAE,mBAAmB;QAC/B,yEAAyE;QACzEC,MAAM,EAAEvC,SAAS,KAAK,IAAI,GAAG,MAAM,GAAGqB,KAAK,CAACkB,MAAM,CAACC,OAAO;QAC1DC,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE;YACTC,SAAS,EAAE,MAAM;SAClB;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../src/TimeSeriesTooltip/utils.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Theme } from '@mui/material';\nimport {\n CursorCoordinates,\n CursorData,\n TOOLTIP_MAX_WIDTH,\n TOOLTIP_MAX_HEIGHT,\n TOOLTIP_MIN_WIDTH,\n TOOLTIP_ADJUST_Y_POS_MULTIPLIER,\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_PADDING,\n} from './tooltip-model';\n\n/**\n * Determine position of tooltip depending on chart dimensions and the number of focused series\n */\nexport function assembleTransform(\n mousePos: CursorData['coords'],\n chartWidth: number,\n pinnedPos: CursorCoordinates | null,\n tooltipHeight: number,\n tooltipWidth: number,\n containerElement?: Element | null\n) {\n if (mousePos === null) {\n return undefined;\n }\n\n const cursorPaddingX = 32;\n const cursorPaddingY = 16;\n\n if (pinnedPos !== null) {\n mousePos = pinnedPos;\n }\n\n if (mousePos.plotCanvas.x === undefined) return undefined;\n\n // By default, tooltip is located in a Portal attached to the body.\n // Using page coordinates instead of viewport ensures the tooltip is\n // absolutely positioned correctly as the user scrolls\n let x = mousePos.page.x;\n let y = mousePos.page.y + cursorPaddingY;\n\n // If containerElement is defined, tooltip is attached to the containerElement instead.\n let containerRect;\n if (containerElement) {\n // get the container's position relative to viewport\n containerRect = containerElement.getBoundingClientRect();\n // calculate the mouse position relative to container\n x = x - containerRect.left + containerElement.scrollLeft;\n y = y - containerRect.top + containerElement.scrollTop;\n }\n\n if (mousePos.client.y + tooltipHeight + cursorPaddingY > window.innerHeight) {\n // adjust so tooltip does not get cut off at bottom of chart\n // multiplier ensures tooltip isn't overly adjusted and gets cut off at the top of the viewport\n y = y - tooltipHeight * TOOLTIP_ADJUST_Y_POS_MULTIPLIER;\n\n // If y is now above of the top of containerElement, set y close to 0 so tooltip does not get cut off\n if (containerRect && y < containerRect.top) {\n y = TOOLTIP_PADDING / 2; // leaves room for some padding around tooltip\n }\n }\n\n // use tooltip width to determine when to repos from right to left\n const xPosAdjustThreshold = chartWidth - tooltipWidth * 0.9;\n\n // reposition so tooltip is never too close to right side of chart or left side of browser window\n return mousePos.plotCanvas.x > xPosAdjustThreshold && x > TOOLTIP_MAX_WIDTH\n ? `translate3d(${x - cursorPaddingX}px, ${y}px, 0) translateX(-100%)`\n : `translate3d(${x + cursorPaddingX}px, ${y}px, 0)`;\n}\n\n/**\n * Helper for tooltip positioning styles\n */\nexport function getTooltipStyles(theme: Theme, pinnedPos: CursorCoordinates | null, maxHeight?: number) {\n const adjustedMaxHeight = maxHeight ? maxHeight - TOOLTIP_PADDING : undefined;\n return {\n minWidth: TOOLTIP_MIN_WIDTH,\n maxWidth: TOOLTIP_MAX_WIDTH,\n maxHeight: adjustedMaxHeight ?? TOOLTIP_MAX_HEIGHT,\n padding: 0,\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,\n borderRadius: '6px',\n color: '#fff',\n fontSize: '11px',\n visibility: 'visible',\n opacity: 1,\n transition: 'all 0.1s ease-out',\n // Ensure pinned tooltip shows behind edit panel drawer and sticky header\n zIndex: pinnedPos !== null ? 'auto' : theme.zIndex.tooltip,\n overflow: 'hidden',\n '&:hover': {\n overflowY: 'auto',\n },\n };\n}\n"],"names":["TOOLTIP_MAX_WIDTH","TOOLTIP_MAX_HEIGHT","TOOLTIP_MIN_WIDTH","TOOLTIP_ADJUST_Y_POS_MULTIPLIER","TOOLTIP_BG_COLOR_FALLBACK","TOOLTIP_PADDING","assembleTransform","mousePos","chartWidth","pinnedPos","tooltipHeight","tooltipWidth","containerElement","undefined","cursorPaddingX","cursorPaddingY","plotCanvas","x","page","y","containerRect","getBoundingClientRect","left","scrollLeft","top","scrollTop","client","window","innerHeight","xPosAdjustThreshold","getTooltipStyles","theme","maxHeight","adjustedMaxHeight","minWidth","maxWidth","padding","position","backgroundColor","palette","designSystem","grey","borderRadius","color","fontSize","visibility","opacity","transition","zIndex","tooltip","overflow","overflowY"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAGEA,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,+BAA+B,EAC/BC,yBAAyB,EACzBC,eAAe,QACV,kBAAkB;AAEzB;;CAEC,GACD,OAAO,SAASC,kBACdC,QAA8B,EAC9BC,UAAkB,EAClBC,SAAmC,EACnCC,aAAqB,EACrBC,YAAoB,EACpBC,gBAAiC;IAEjC,IAAIL,aAAa,MAAM;QACrB,OAAOM;IACT;IAEA,MAAMC,iBAAiB;IACvB,MAAMC,iBAAiB;IAEvB,IAAIN,cAAc,MAAM;QACtBF,WAAWE;IACb;IAEA,IAAIF,SAASS,UAAU,CAACC,CAAC,KAAKJ,WAAW,OAAOA;IAEhD,mEAAmE;IACnE,oEAAoE;IACpE,sDAAsD;IACtD,IAAII,IAAIV,SAASW,IAAI,CAACD,CAAC;IACvB,IAAIE,IAAIZ,SAASW,IAAI,CAACC,CAAC,GAAGJ;IAE1B,uFAAuF;IACvF,IAAIK;IACJ,IAAIR,kBAAkB;QACpB,oDAAoD;QACpDQ,gBAAgBR,iBAAiBS,qBAAqB;QACtD,qDAAqD;QACrDJ,IAAIA,IAAIG,cAAcE,IAAI,GAAGV,iBAAiBW,UAAU;QACxDJ,IAAIA,IAAIC,cAAcI,GAAG,GAAGZ,iBAAiBa,SAAS;IACxD;IAEA,IAAIlB,SAASmB,MAAM,CAACP,CAAC,GAAGT,gBAAgBK,iBAAiBY,OAAOC,WAAW,EAAE;QAC3E,4DAA4D;QAC5D,+FAA+F;QAC/FT,IAAIA,IAAIT,gBAAgBP;QAExB,qGAAqG;QACrG,IAAIiB,iBAAiBD,IAAIC,cAAcI,GAAG,EAAE;YAC1CL,IAAId,kBAAkB,GAAG,8CAA8C;QACzE;IACF;IAEA,kEAAkE;IAClE,MAAMwB,sBAAsBrB,aAAaG,eAAe;IAExD,iGAAiG;IACjG,OAAOJ,SAASS,UAAU,CAACC,CAAC,GAAGY,uBAAuBZ,IAAIjB,oBACtD,CAAC,YAAY,EAAEiB,IAAIH,eAAe,IAAI,EAAEK,EAAE,wBAAwB,CAAC,GACnE,CAAC,YAAY,EAAEF,IAAIH,eAAe,IAAI,EAAEK,EAAE,MAAM,CAAC;AACvD;AAEA;;CAEC,GACD,OAAO,SAASW,iBAAiBC,KAAY,EAAEtB,SAAmC,EAAEuB,SAAkB;QAUjFD;IATnB,MAAME,oBAAoBD,YAAYA,YAAY3B,kBAAkBQ;QASjDkB;IARnB,OAAO;QACLG,UAAUhC;QACViC,UAAUnC;QACVgC,WAAWC,8BAAAA,+BAAAA,oBAAqBhC;QAChCmC,SAAS;QACTC,UAAU;QACVb,KAAK;QACLF,MAAM;QACNgB,iBAAiBP,CAAAA,qCAAAA,8BAAAA,MAAMQ,OAAO,CAACC,YAAY,cAA1BT,kDAAAA,4BAA4BU,IAAI,CAAC,IAAI,cAArCV,+CAAAA,oCAAyC3B;QAC1DsC,cAAc;QACdC,OAAO;QACPC,UAAU;QACVC,YAAY;QACZC,SAAS;QACTC,YAAY;QACZ,yEAAyE;QACzEC,QAAQvC,cAAc,OAAO,SAASsB,MAAMiB,MAAM,CAACC,OAAO;QAC1DC,UAAU;QACV,WAAW;YACTC,WAAW;QACb;IACF;AACF"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from '@mui/material';
3
+ type ToolbarIconButtonProps = ButtonProps;
4
+ export declare const ToolbarIconButton: import("react").ForwardRefExoticComponent<Omit<ToolbarIconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
5
+ export {};
6
+ //# sourceMappingURL=ToolbarIconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../src/ToolbarIconButton/ToolbarIconButton.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAkB,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,KAAK,sBAAsB,GAAG,WAAW,CAAC;AAa1C,eAAO,MAAM,iBAAiB,mIAAyB,CAAC"}
@@ -0,0 +1,32 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { forwardRef } from 'react';
15
+ import { Button, styled } from '@mui/material';
16
+ function IconButton(props, ref) {
17
+ return /*#__PURE__*/ _jsx(StyledIconButton, {
18
+ ref: ref,
19
+ variant: "outlined",
20
+ color: "secondary",
21
+ ...props
22
+ });
23
+ }
24
+ const StyledIconButton = styled(Button)(({ theme })=>({
25
+ // Using a button with some adjusted styles because it is easier to inherit
26
+ // styling and variants from themes than with an IconButton.
27
+ padding: theme.spacing(0.5),
28
+ minWidth: 'auto'
29
+ }));
30
+ export const ToolbarIconButton = /*#__PURE__*/ forwardRef(IconButton);
31
+
32
+ //# sourceMappingURL=ToolbarIconButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ToolbarIconButton/ToolbarIconButton.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ForwardedRef, forwardRef } from 'react';\nimport { Button, styled, ButtonProps } from '@mui/material';\n\ntype ToolbarIconButtonProps = ButtonProps;\n\nfunction IconButton(props: ToolbarIconButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n return <StyledIconButton ref={ref} variant=\"outlined\" color=\"secondary\" {...props} />;\n}\n\nconst StyledIconButton = styled(Button)(({ theme }) => ({\n // Using a button with some adjusted styles because it is easier to inherit\n // styling and variants from themes than with an IconButton.\n padding: theme.spacing(0.5),\n minWidth: 'auto',\n}));\n\nexport const ToolbarIconButton = forwardRef(IconButton);\n"],"names":["forwardRef","Button","styled","IconButton","props","ref","StyledIconButton","variant","color","theme","padding","spacing","minWidth","ToolbarIconButton"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAuBA,UAAU,QAAQ,QAAQ;AACjD,SAASC,MAAM,EAAEC,MAAM,QAAqB,gBAAgB;AAI5D,SAASC,WAAWC,KAA6B,EAAEC,GAAoC;IACrF,qBAAO,KAACC;QAAiBD,KAAKA;QAAKE,SAAQ;QAAWC,OAAM;QAAa,GAAGJ,KAAK;;AACnF;AAEA,MAAME,mBAAmBJ,OAAOD,QAAQ,CAAC,EAAEQ,KAAK,EAAE,GAAM,CAAA;QACtD,2EAA2E;QAC3E,4DAA4D;QAC5DC,SAASD,MAAME,OAAO,CAAC;QACvBC,UAAU;IACZ,CAAA;AAEA,OAAO,MAAMC,kCAAoBb,WAAWG,YAAY"}
@@ -0,0 +1,2 @@
1
+ export * from './ToolbarIconButton';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToolbarIconButton/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export * from './ToolbarIconButton';
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ToolbarIconButton/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ToolbarIconButton';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sBAAsB"}
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  interface YAxisLabelProps {
3
2
  name: string;
4
3
  height: number;
5
4
  }
6
- export declare function YAxisLabel({ name, height }: YAxisLabelProps): JSX.Element;
5
+ export declare function YAxisLabel({ name, height }: YAxisLabelProps): import("react/jsx-runtime").JSX.Element;
7
6
  export {};
8
7
  //# sourceMappingURL=YAxisLabel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"YAxisLabel.d.ts","sourceRoot":"","sources":["../src/YAxisLabel.tsx"],"names":[],"mappings":";AAeA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,eAAe,eA2B3D"}
1
+ {"version":3,"file":"YAxisLabel.d.ts","sourceRoot":"","sources":["../src/YAxisLabel.tsx"],"names":[],"mappings":"AAeA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,eAAe,2CA2B3D"}
@@ -12,7 +12,7 @@
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { Box, Typography } from '@mui/material';
15
- export function YAxisLabel({ name , height }) {
15
+ export function YAxisLabel({ name, height }) {
16
16
  return /*#__PURE__*/ _jsx(Box, {
17
17
  sx: {
18
18
  display: 'inline-block',
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/YAxisLabel.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, Typography } from '@mui/material';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps) {\n return (\n <Box\n sx={{\n display: 'inline-block',\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n position: 'absolute',\n top: `calc(${height}px / 2)`,\n transform: 'translateX(-50%) rotate(-90deg)',\n transformOrigin: 'top',\n textAlign: 'center',\n zIndex: 1,\n }}\n >\n <Typography\n variant=\"body1\"\n aria-label=\"y axis label\"\n sx={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","Typography","YAxisLabel","name","height","sx","display","maxWidth","position","top","transform","transformOrigin","textAlign","zIndex","variant","aria-label","whiteSpace","overflow","textOverflow"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,GAAG,EAAEC,UAAU,QAAQ,eAAe,CAAC;AAOhD,OAAO,SAASC,UAAU,CAAC,EAAEC,IAAI,CAAA,EAAEC,MAAM,CAAA,EAAmB,EAAE;IAC5D,qBACE,KAACJ,GAAG;QACFK,EAAE,EAAE;YACFC,OAAO,EAAE,cAAc;YACvBC,QAAQ,EAAEH,MAAM;YAChBI,QAAQ,EAAE,UAAU;YACpBC,GAAG,EAAE,CAAC,KAAK,EAAEL,MAAM,CAAC,OAAO,CAAC;YAC5BM,SAAS,EAAE,iCAAiC;YAC5CC,eAAe,EAAE,KAAK;YACtBC,SAAS,EAAE,QAAQ;YACnBC,MAAM,EAAE,CAAC;SACV;kBAED,cAAA,KAACZ,UAAU;YACTa,OAAO,EAAC,OAAO;YACfC,YAAU,EAAC,cAAc;YACzBV,EAAE,EAAE;gBACFW,UAAU,EAAE,QAAQ;gBACpBC,QAAQ,EAAE,QAAQ;gBAClBC,YAAY,EAAE,UAAU;aACzB;sBAEAf,IAAI;UACM;MACT,CACN;AACJ,CAAC"}
1
+ {"version":3,"sources":["../src/YAxisLabel.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, Typography } from '@mui/material';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps) {\n return (\n <Box\n sx={{\n display: 'inline-block',\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n position: 'absolute',\n top: `calc(${height}px / 2)`,\n transform: 'translateX(-50%) rotate(-90deg)',\n transformOrigin: 'top',\n textAlign: 'center',\n zIndex: 1,\n }}\n >\n <Typography\n variant=\"body1\"\n aria-label=\"y axis label\"\n sx={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","Typography","YAxisLabel","name","height","sx","display","maxWidth","position","top","transform","transformOrigin","textAlign","zIndex","variant","aria-label","whiteSpace","overflow","textOverflow"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,UAAU,QAAQ,gBAAgB;AAOhD,OAAO,SAASC,WAAW,EAAEC,IAAI,EAAEC,MAAM,EAAmB;IAC1D,qBACE,KAACJ;QACCK,IAAI;YACFC,SAAS;YACTC,UAAUH;YACVI,UAAU;YACVC,KAAK,CAAC,KAAK,EAAEL,OAAO,OAAO,CAAC;YAC5BM,WAAW;YACXC,iBAAiB;YACjBC,WAAW;YACXC,QAAQ;QACV;kBAEA,cAAA,KAACZ;YACCa,SAAQ;YACRC,cAAW;YACXV,IAAI;gBACFW,YAAY;gBACZC,UAAU;gBACVC,cAAc;YAChB;sBAECf;;;AAIT"}
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "BarChart", {
18
18
  enumerable: true,
19
- get: ()=>BarChart
19
+ get: function() {
20
+ return BarChart;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
23
+ const _jsxruntime = require("react/jsx-runtime");
22
24
  const _react = require("react");
23
25
  const _core = require("@perses-dev/core");
24
26
  const _core1 = require("echarts/core");
@@ -26,8 +28,9 @@ const _charts = require("echarts/charts");
26
28
  const _components = require("echarts/components");
27
29
  const _renderers = require("echarts/renderers");
28
30
  const _material = require("@mui/material");
29
- const _chartsThemeProvider = require("../context/ChartsThemeProvider");
30
- const _echart = require("../EChart");
31
+ const _ChartsProvider = require("../context/ChartsProvider");
32
+ const _EChart = require("../EChart");
33
+ const _utils = require("../utils");
31
34
  (0, _core1.use)([
32
35
  _charts.BarChart,
33
36
  _components.GridComponent,
@@ -39,12 +42,12 @@ const _echart = require("../EChart");
39
42
  const BAR_WIN_WIDTH = 14;
40
43
  const BAR_GAP = 6;
41
44
  function BarChart(props) {
42
- const { width , height , data , unit ={
43
- kind: 'Decimal'
44
- } , mode ='value' } = props;
45
- const chartsTheme = (0, _chartsThemeProvider.useChartsTheme)();
45
+ const { width, height, data, format = {
46
+ unit: 'decimal'
47
+ }, mode = 'value' } = props;
48
+ const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
46
49
  const option = (0, _react.useMemo)(()=>{
47
- if (data == null) return chartsTheme.noDataOption;
50
+ if (data == null || !data.length) return chartsTheme.noDataOption;
48
51
  const source = [];
49
52
  data.map((d)=>{
50
53
  source.push([
@@ -65,7 +68,7 @@ function BarChart(props) {
65
68
  source: source
66
69
  }
67
70
  ],
68
- xAxis: {},
71
+ xAxis: (0, _utils.getFormattedAxis)({}, format),
69
72
  yAxis: {
70
73
  type: 'category',
71
74
  splitLine: {
@@ -84,11 +87,11 @@ function BarChart(props) {
84
87
  formatter: (params)=>{
85
88
  if (mode === 'percentage') {
86
89
  return params.data[1] && (0, _core.formatValue)(params.data[1], {
87
- kind: 'Percent',
88
- decimal_places: unit.decimal_places
90
+ unit: 'percent',
91
+ decimalPlaces: format.decimalPlaces
89
92
  });
90
93
  }
91
- return params.data[1] && (0, _core.formatValue)(params.data[1], unit);
94
+ return params.data[1] && (0, _core.formatValue)(params.data[1], format);
92
95
  },
93
96
  barMinWidth: BAR_WIN_WIDTH,
94
97
  barCategoryGap: BAR_GAP
@@ -101,7 +104,12 @@ function BarChart(props) {
101
104
  tooltip: {
102
105
  appendToBody: true,
103
106
  confine: true,
104
- formatter: (params)=>params.data[1] && `<b>${params.name}</b> &emsp; ${(0, _core.formatValue)(params.data[1], unit)}`
107
+ formatter: (params)=>params.data[1] && `<b>${params.name}</b> &emsp; ${(0, _core.formatValue)(params.data[1], format)}`
108
+ },
109
+ // increase distance between grid and container to prevent y axis labels from getting cut off
110
+ grid: {
111
+ left: '5%',
112
+ right: '5%'
105
113
  }
106
114
  };
107
115
  }, [
@@ -109,15 +117,15 @@ function BarChart(props) {
109
117
  chartsTheme,
110
118
  width,
111
119
  mode,
112
- unit
120
+ format
113
121
  ]);
114
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
122
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
115
123
  sx: {
116
124
  width: width,
117
125
  height: height,
118
126
  overflow: 'auto'
119
127
  },
120
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_echart.EChart, {
128
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_EChart.EChart, {
121
129
  sx: {
122
130
  minHeight: height,
123
131
  height: data ? data.length * (BAR_WIN_WIDTH + BAR_GAP) : '100%'
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./BarChart"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./BarChart"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "ColorPicker", {
18
18
  enumerable: true,
19
- get: ()=>ColorPicker
19
+ get: function() {
20
+ return ColorPicker;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
23
+ const _jsxruntime = require("react/jsx-runtime");
22
24
  const _material = require("@mui/material");
23
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
24
- const _reactColorful = require("react-colorful");
25
- const _circle = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Circle"));
26
- function _interopRequireDefault(obj) {
25
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
26
+ const _reactcolorful = require("react-colorful");
27
+ const _Circle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Circle"));
28
+ function _interop_require_default(obj) {
27
29
  return obj && obj.__esModule ? obj : {
28
30
  default: obj
29
31
  };
@@ -36,7 +38,7 @@ function _getRequireWildcardCache(nodeInterop) {
36
38
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
37
39
  })(nodeInterop);
38
40
  }
39
- function _interopRequireWildcard(obj, nodeInterop) {
41
+ function _interop_require_wildcard(obj, nodeInterop) {
40
42
  if (!nodeInterop && obj && obj.__esModule) {
41
43
  return obj;
42
44
  }
@@ -49,7 +51,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
49
51
  if (cache && cache.has(obj)) {
50
52
  return cache.get(obj);
51
53
  }
52
- var newObj = {};
54
+ var newObj = {
55
+ __proto__: null
56
+ };
53
57
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
54
58
  for(var key in obj){
55
59
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -67,7 +71,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
67
71
  }
68
72
  return newObj;
69
73
  }
70
- const ColorPicker = ({ color , onChange , palette })=>{
74
+ const ColorPicker = ({ color, onChange, palette })=>{
71
75
  // value is the visible value for the controlled text input
72
76
  const [value, setValue] = (0, _react.useState)(color);
73
77
  const handleColorChange = (color)=>{
@@ -83,29 +87,29 @@ const ColorPicker = ({ color , onChange , palette })=>{
83
87
  onChange && onChange(e.target.value);
84
88
  }
85
89
  };
86
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
90
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
87
91
  spacing: 1,
88
92
  children: [
89
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactColorful.HexColorPicker, {
93
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcolorful.HexColorPicker, {
90
94
  color: color,
91
95
  onChange: handleColorChange
92
96
  }),
93
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Stack, {
97
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
94
98
  direction: "row",
95
99
  flexWrap: "wrap",
96
100
  justifyContent: "space-evenly",
97
101
  width: '200px',
98
- children: palette && palette.map((color, i)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
102
+ children: palette && palette.map((color, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
99
103
  size: "small",
100
104
  "aria-label": `change color to ${color}`,
101
105
  sx: {
102
106
  color
103
107
  },
104
108
  onClick: ()=>handleColorChange(color),
105
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_circle.default, {})
109
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Circle.default, {})
106
110
  }, i))
107
111
  }),
108
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
112
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
109
113
  inputProps: {
110
114
  'aria-label': 'enter hex color'
111
115
  },
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./ColorPicker"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./ColorPicker"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -16,22 +16,24 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "ContentWithLegend", {
18
18
  enumerable: true,
19
- get: ()=>ContentWithLegend
19
+ get: function() {
20
+ return ContentWithLegend;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
23
25
  const _material = require("@mui/material");
24
26
  const _core = require("@perses-dev/core");
25
- const _legend = require("../Legend");
26
- const _contentWithLegendModel = require("./model/content-with-legend-model");
27
- function _interopRequireDefault(obj) {
27
+ const _Legend = require("../Legend");
28
+ const _contentwithlegendmodel = require("./model/content-with-legend-model");
29
+ function _interop_require_default(obj) {
28
30
  return obj && obj.__esModule ? obj : {
29
31
  default: obj
30
32
  };
31
33
  }
32
- function ContentWithLegend({ children , legendProps , width , height , spacing =0 , legendSize , minChildrenWidth =100 , minChildrenHeight =100 }) {
34
+ function ContentWithLegend({ children, legendProps, width, height, spacing = 0, legendSize, minChildrenWidth = 100, minChildrenHeight = 100 }) {
33
35
  const theme = (0, _material.useTheme)();
34
- const { content , legend , margin } = (0, _contentWithLegendModel.getContentWithLegendLayout)({
36
+ const { content, legend, margin } = (0, _contentwithlegendmodel.getContentWithLegendLayout)({
35
37
  width,
36
38
  height,
37
39
  legendProps,
@@ -41,7 +43,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
41
43
  theme,
42
44
  legendSize: (0, _core.getLegendSize)(legendSize)
43
45
  });
44
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
46
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
45
47
  sx: {
46
48
  width,
47
49
  height,
@@ -49,7 +51,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
49
51
  overflow: 'hidden'
50
52
  },
51
53
  children: [
52
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
54
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
53
55
  sx: {
54
56
  width: content.width,
55
57
  height: content.height,
@@ -62,7 +64,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
62
64
  height: content.height
63
65
  }) : children
64
66
  }),
65
- legendProps && legend.show && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_legend.Legend, {
67
+ legendProps && legend.show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Legend.Legend, {
66
68
  ...legendProps,
67
69
  height: legend.height,
68
70
  width: legend.width
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./ContentWithLegend"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./ContentWithLegend"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -21,29 +21,33 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- TABLE_LEGEND_SIZE: ()=>TABLE_LEGEND_SIZE,
25
- getContentWithLegendLayout: ()=>getContentWithLegendLayout
24
+ TABLE_LEGEND_SIZE: function() {
25
+ return TABLE_LEGEND_SIZE;
26
+ },
27
+ getContentWithLegendLayout: function() {
28
+ return getContentWithLegendLayout;
29
+ }
26
30
  });
27
31
  const _core = require("@perses-dev/core");
28
- const _table = require("../../Table");
32
+ const _Table = require("../../Table");
29
33
  const TABLE_LEGEND_SIZE = {
30
- Medium: {
34
+ medium: {
31
35
  // 5 rows plus header. Value to be multiplied by row height in pixels.
32
- Bottom: 6,
36
+ bottom: 6,
33
37
  // Pixel value
34
- Right: 250
38
+ right: 250
35
39
  },
36
- Small: {
40
+ small: {
37
41
  // 3 rows plus header. Value to be multiplied by row height in pixels.
38
- Bottom: 4,
42
+ bottom: 4,
39
43
  // Pixel value
40
- Right: 150
44
+ right: 150
41
45
  }
42
46
  };
43
47
  const PANEL_HEIGHT_LG_BREAKPOINT = 300;
44
48
  const LEGEND_HEIGHT_SM = 40;
45
49
  const LEGEND_HEIGHT_LG = 100;
46
- function getContentWithLegendLayout({ width , height , legendProps , legendSize , minChildrenHeight , minChildrenWidth , spacing , theme }) {
50
+ function getContentWithLegendLayout({ width, height, legendProps, legendSize, minChildrenHeight, minChildrenWidth, spacing, theme }) {
47
51
  const legendOptions = legendProps === null || legendProps === void 0 ? void 0 : legendProps.options;
48
52
  const hasLegend = !!legendOptions;
49
53
  const noLegendLayout = {
@@ -64,40 +68,40 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
64
68
  if (!hasLegend) {
65
69
  return noLegendLayout;
66
70
  }
67
- const { position } = legendOptions;
71
+ const { position } = legendOptions;
68
72
  const mode = (0, _core.getLegendMode)(legendOptions.mode);
69
73
  let legendWidth;
70
74
  let legendHeight;
71
- if (mode === 'List') {
75
+ if (mode === 'list') {
72
76
  // TODO: normalize list to share similar height options as the table
73
77
  // when we add more size options.
74
- legendWidth = position === 'Right' ? 200 : width;
78
+ legendWidth = position === 'right' ? 200 : width;
75
79
  // TODO: account for number of legend items returned when adjusting legend spacing
76
80
  legendHeight = LEGEND_HEIGHT_SM;
77
- if (position === 'Right') {
81
+ if (position === 'right') {
78
82
  legendHeight = height;
79
83
  } else if (height >= PANEL_HEIGHT_LG_BREAKPOINT) {
80
84
  legendHeight = LEGEND_HEIGHT_LG;
81
85
  }
82
86
  } else {
83
- var ref;
87
+ var _legendProps_tableProps;
84
88
  // Table mode
85
- const tableLayout = (0, _table.getTableCellLayout)(theme, 'compact');
86
- const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (ref = legendProps.tableProps) === null || ref === void 0 ? void 0 : ref.columns) || [];
89
+ const tableLayout = (0, _Table.getTableCellLayout)(theme, 'compact');
90
+ const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (_legendProps_tableProps = legendProps.tableProps) === null || _legendProps_tableProps === void 0 ? void 0 : _legendProps_tableProps.columns) || [];
87
91
  const columnsWidth = tableColumns.reduce((total, col)=>{
88
92
  if (typeof col.width === 'number') {
89
93
  total += col.width;
90
94
  }
91
95
  return total;
92
96
  }, 0);
93
- legendWidth = position === 'Right' ? TABLE_LEGEND_SIZE[legendSize]['Right'] + columnsWidth : width;
97
+ legendWidth = position === 'right' ? TABLE_LEGEND_SIZE[legendSize]['right'] + columnsWidth : width;
94
98
  // Use the smaller of the size-based row count or the number of legend items + 1 for the header.
95
- const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['Bottom'], legendProps.data.length + 1);
96
- legendHeight = position === 'Bottom' ? rowsToShow * tableLayout.height : height;
99
+ const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['bottom'], legendProps.data.length + 1);
100
+ legendHeight = position === 'bottom' ? rowsToShow * tableLayout.height : height;
97
101
  }
98
- const contentWidth = position === 'Right' ? width - legendWidth - spacing : width;
99
- const contentHeight = position === 'Bottom' ? height - legendHeight - spacing : height;
100
- if (position === 'Right' && contentWidth < minChildrenWidth || position === 'Bottom' && contentHeight < minChildrenHeight) {
102
+ const contentWidth = position === 'right' ? width - legendWidth - spacing : width;
103
+ const contentHeight = position === 'bottom' ? height - legendHeight - spacing : height;
104
+ if (position === 'right' && contentWidth < minChildrenWidth || position === 'bottom' && contentHeight < minChildrenHeight) {
101
105
  // Legend does not fit. Just show the content.
102
106
  return noLegendLayout;
103
107
  }
@@ -112,8 +116,8 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
112
116
  height: contentHeight
113
117
  },
114
118
  margin: {
115
- right: position === 'Right' ? spacing : 0,
116
- bottom: position === 'Bottom' ? spacing : 0
119
+ right: position === 'right' ? spacing : 0,
120
+ bottom: position === 'bottom' ? spacing : 0
117
121
  }
118
122
  };
119
123
  }