@perses-dev/components 0.38.0 → 0.40.0

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 (349) hide show
  1. package/dist/BarChart/BarChart.d.ts +2 -2
  2. package/dist/BarChart/BarChart.d.ts.map +1 -1
  3. package/dist/BarChart/BarChart.js +16 -10
  4. package/dist/BarChart/BarChart.js.map +1 -1
  5. package/dist/BarChart/index.js.map +1 -1
  6. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  7. package/dist/ColorPicker/index.js.map +1 -1
  8. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  9. package/dist/ContentWithLegend/index.js.map +1 -1
  10. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +1 -1
  11. package/dist/ContentWithLegend/model/content-with-legend-model.js +19 -19
  12. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  13. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
  14. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +6 -22
  15. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
  16. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  17. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
  18. package/dist/DateTimeRangePicker/index.js.map +1 -1
  19. package/dist/DateTimeRangePicker/utils.js.map +1 -1
  20. package/dist/Dialog/Dialog.js.map +1 -1
  21. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  22. package/dist/Dialog/index.js.map +1 -1
  23. package/dist/Drawer/Drawer.js.map +1 -1
  24. package/dist/Drawer/index.js.map +1 -1
  25. package/dist/EChart/EChart.js +2 -2
  26. package/dist/EChart/EChart.js.map +1 -1
  27. package/dist/EChart/index.js.map +1 -1
  28. package/dist/ErrorAlert.js.map +1 -1
  29. package/dist/ErrorBoundary.js.map +1 -1
  30. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  31. package/dist/FontSizeSelector/index.js.map +1 -1
  32. package/dist/FormatControls/FormatControls.d.ts +9 -0
  33. package/dist/FormatControls/FormatControls.d.ts.map +1 -0
  34. package/dist/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +26 -26
  35. package/dist/FormatControls/FormatControls.js.map +1 -0
  36. package/dist/FormatControls/index.d.ts +2 -0
  37. package/dist/FormatControls/index.d.ts.map +1 -0
  38. package/dist/{UnitSelector → FormatControls}/index.js +1 -1
  39. package/dist/FormatControls/index.js.map +1 -0
  40. package/dist/GaugeChart/GaugeChart.d.ts +3 -3
  41. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
  42. package/dist/GaugeChart/GaugeChart.js +12 -12
  43. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  44. package/dist/GaugeChart/index.js.map +1 -1
  45. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  46. package/dist/InfoTooltip/index.js.map +1 -1
  47. package/dist/JSONEditor.js.map +1 -1
  48. package/dist/Legend/CompactLegend.js.map +1 -1
  49. package/dist/Legend/Legend.js +3 -3
  50. package/dist/Legend/Legend.js.map +1 -1
  51. package/dist/Legend/LegendColorBadge.js.map +1 -1
  52. package/dist/Legend/ListLegend.js.map +1 -1
  53. package/dist/Legend/ListLegendItem.js +2 -2
  54. package/dist/Legend/ListLegendItem.js.map +1 -1
  55. package/dist/Legend/TableLegend.js.map +1 -1
  56. package/dist/Legend/index.js.map +1 -1
  57. package/dist/Legend/legend-model.js.map +1 -1
  58. package/dist/LineChart/LineChart.d.ts +2 -2
  59. package/dist/LineChart/LineChart.d.ts.map +1 -1
  60. package/dist/LineChart/LineChart.js +17 -18
  61. package/dist/LineChart/LineChart.js.map +1 -1
  62. package/dist/LineChart/index.js.map +1 -1
  63. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  64. package/dist/ModeSelector/index.js.map +1 -1
  65. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  66. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  67. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  68. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  69. package/dist/OptionsEditorLayout/index.js.map +1 -1
  70. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  71. package/dist/RefreshIntervalPicker/index.js.map +1 -1
  72. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +2 -2
  73. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  74. package/dist/SettingsAutocomplete/index.js.map +1 -1
  75. package/dist/SortSelector/SortSelector.js.map +1 -1
  76. package/dist/SortSelector/index.js.map +1 -1
  77. package/dist/StatChart/StatChart.d.ts +2 -2
  78. package/dist/StatChart/StatChart.d.ts.map +1 -1
  79. package/dist/StatChart/StatChart.js +8 -8
  80. package/dist/StatChart/StatChart.js.map +1 -1
  81. package/dist/StatChart/calculateFontSize.js +7 -7
  82. package/dist/StatChart/calculateFontSize.js.map +1 -1
  83. package/dist/StatChart/index.js.map +1 -1
  84. package/dist/Table/InnerTable.js.map +1 -1
  85. package/dist/Table/Table.js.map +1 -1
  86. package/dist/Table/TableBody.js.map +1 -1
  87. package/dist/Table/TableCell.js +2 -2
  88. package/dist/Table/TableCell.js.map +1 -1
  89. package/dist/Table/TableCheckbox.js.map +1 -1
  90. package/dist/Table/TableHead.js.map +1 -1
  91. package/dist/Table/TableHeaderCell.js.map +1 -1
  92. package/dist/Table/TableRow.js.map +1 -1
  93. package/dist/Table/VirtualizedTable.js +6 -6
  94. package/dist/Table/VirtualizedTable.js.map +1 -1
  95. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  96. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  97. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +20 -20
  98. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  99. package/dist/Table/index.js.map +1 -1
  100. package/dist/Table/model/table-model.js +9 -9
  101. package/dist/Table/model/table-model.js.map +1 -1
  102. package/dist/ThresholdsEditor/ThresholdColorPicker.js +2 -2
  103. package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
  104. package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
  105. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  106. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  107. package/dist/ThresholdsEditor/ThresholdsEditor.js +19 -18
  108. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  109. package/dist/ThresholdsEditor/index.js.map +1 -1
  110. package/dist/TimeChart/TimeChart.d.ts +3 -3
  111. package/dist/TimeChart/TimeChart.d.ts.map +1 -1
  112. package/dist/TimeChart/TimeChart.js +108 -61
  113. package/dist/TimeChart/TimeChart.js.map +1 -1
  114. package/dist/TimeChart/index.js.map +1 -1
  115. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +3 -2
  116. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
  117. package/dist/TimeSeriesTooltip/LineChartTooltip.js +9 -8
  118. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
  119. package/dist/TimeSeriesTooltip/SeriesInfo.js +2 -2
  120. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  121. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  122. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  123. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +3 -2
  124. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  125. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +6 -5
  126. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  127. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  128. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +1 -0
  129. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
  130. package/dist/TimeSeriesTooltip/TooltipHeader.js +11 -11
  131. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  132. package/dist/TimeSeriesTooltip/index.js.map +1 -1
  133. package/dist/TimeSeriesTooltip/nearby-series.d.ts +7 -7
  134. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  135. package/dist/TimeSeriesTooltip/nearby-series.js +35 -39
  136. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  137. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +4 -0
  138. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  139. package/dist/TimeSeriesTooltip/tooltip-model.js +6 -0
  140. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  141. package/dist/TimeSeriesTooltip/utils.js +3 -3
  142. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  143. package/dist/YAxisLabel.js.map +1 -1
  144. package/dist/cjs/BarChart/BarChart.js +24 -16
  145. package/dist/cjs/BarChart/index.js +10 -8
  146. package/dist/cjs/ColorPicker/ColorPicker.js +15 -13
  147. package/dist/cjs/ColorPicker/index.js +10 -8
  148. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +12 -10
  149. package/dist/cjs/ContentWithLegend/index.js +10 -8
  150. package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +27 -23
  151. package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +29 -43
  152. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +12 -10
  153. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +13 -11
  154. package/dist/cjs/DateTimeRangePicker/index.js +12 -10
  155. package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
  156. package/dist/cjs/Dialog/Dialog.js +15 -13
  157. package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +11 -9
  158. package/dist/cjs/Dialog/index.js +11 -9
  159. package/dist/cjs/Drawer/Drawer.js +5 -3
  160. package/dist/cjs/Drawer/index.js +10 -8
  161. package/dist/cjs/EChart/EChart.js +12 -10
  162. package/dist/cjs/EChart/index.js +10 -8
  163. package/dist/cjs/ErrorAlert.js +5 -3
  164. package/dist/cjs/ErrorBoundary.js +4 -2
  165. package/dist/cjs/FontSizeSelector/FontSizeSelector.js +8 -6
  166. package/dist/cjs/FontSizeSelector/index.js +10 -8
  167. package/dist/cjs/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +38 -36
  168. package/dist/cjs/{UnitSelector → FormatControls}/index.js +10 -8
  169. package/dist/cjs/GaugeChart/GaugeChart.js +22 -18
  170. package/dist/cjs/GaugeChart/index.js +10 -8
  171. package/dist/cjs/InfoTooltip/InfoTooltip.js +13 -11
  172. package/dist/cjs/InfoTooltip/index.js +10 -8
  173. package/dist/cjs/JSONEditor.js +10 -8
  174. package/dist/cjs/Legend/CompactLegend.js +9 -7
  175. package/dist/cjs/Legend/Legend.js +15 -13
  176. package/dist/cjs/Legend/LegendColorBadge.js +7 -5
  177. package/dist/cjs/Legend/ListLegend.js +10 -8
  178. package/dist/cjs/Legend/ListLegendItem.js +12 -10
  179. package/dist/cjs/Legend/TableLegend.js +7 -5
  180. package/dist/cjs/Legend/index.js +11 -9
  181. package/dist/cjs/Legend/legend-model.js +3 -1
  182. package/dist/cjs/LineChart/LineChart.js +26 -25
  183. package/dist/cjs/LineChart/index.js +10 -8
  184. package/dist/cjs/ModeSelector/ModeSelector.js +8 -6
  185. package/dist/cjs/ModeSelector/index.js +10 -8
  186. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +6 -4
  187. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +16 -14
  188. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +5 -3
  189. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +11 -9
  190. package/dist/cjs/OptionsEditorLayout/index.js +13 -11
  191. package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +8 -6
  192. package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
  193. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +12 -10
  194. package/dist/cjs/SettingsAutocomplete/index.js +10 -8
  195. package/dist/cjs/SortSelector/SortSelector.js +8 -6
  196. package/dist/cjs/SortSelector/index.js +10 -8
  197. package/dist/cjs/StatChart/StatChart.js +20 -18
  198. package/dist/cjs/StatChart/calculateFontSize.js +10 -8
  199. package/dist/cjs/StatChart/index.js +10 -8
  200. package/dist/cjs/Table/InnerTable.js +5 -3
  201. package/dist/cjs/Table/Table.js +15 -13
  202. package/dist/cjs/Table/TableBody.js +5 -3
  203. package/dist/cjs/Table/TableCell.js +10 -8
  204. package/dist/cjs/Table/TableCheckbox.js +5 -3
  205. package/dist/cjs/Table/TableHead.js +5 -3
  206. package/dist/cjs/Table/TableHeaderCell.js +8 -6
  207. package/dist/cjs/Table/TableRow.js +5 -3
  208. package/dist/cjs/Table/VirtualizedTable.js +32 -30
  209. package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
  210. package/dist/cjs/Table/hooks/useTableKeyboardNav.js +3 -1
  211. package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +23 -21
  212. package/dist/cjs/Table/index.js +14 -10
  213. package/dist/cjs/Table/model/table-model.js +15 -11
  214. package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +15 -13
  215. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +14 -12
  216. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +44 -41
  217. package/dist/cjs/ThresholdsEditor/index.js +10 -8
  218. package/dist/cjs/TimeChart/TimeChart.js +121 -72
  219. package/dist/cjs/TimeChart/index.js +10 -8
  220. package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +30 -27
  221. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +17 -15
  222. package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +15 -13
  223. package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +5 -3
  224. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +24 -21
  225. package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +7 -5
  226. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +36 -34
  227. package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
  228. package/dist/cjs/TimeSeriesTooltip/nearby-series.js +61 -47
  229. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +57 -14
  230. package/dist/cjs/TimeSeriesTooltip/utils.js +17 -13
  231. package/dist/cjs/YAxisLabel.js +6 -4
  232. package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +38 -11
  233. package/dist/cjs/context/SnackbarProvider.js +6 -2
  234. package/dist/cjs/context/TimeZoneProvider.js +13 -7
  235. package/dist/cjs/context/index.js +32 -0
  236. package/dist/cjs/index.js +41 -41
  237. package/dist/cjs/model/graph.js +9 -3
  238. package/dist/cjs/model/index.js +12 -10
  239. package/dist/cjs/test/index.js +10 -8
  240. package/dist/cjs/test/render.js +7 -5
  241. package/dist/cjs/test-utils/index.js +10 -8
  242. package/dist/cjs/test-utils/theme.js +36 -19
  243. package/dist/cjs/theme/component-overrides/alert.js +3 -1
  244. package/dist/cjs/theme/component-overrides/paper.js +3 -1
  245. package/dist/cjs/theme/index.js +10 -8
  246. package/dist/cjs/theme/palette/background.js +6 -2
  247. package/dist/cjs/theme/palette/colors/blue.js +3 -1
  248. package/dist/cjs/theme/palette/colors/common.js +6 -2
  249. package/dist/cjs/theme/palette/colors/green.js +3 -1
  250. package/dist/cjs/theme/palette/colors/grey.js +3 -1
  251. package/dist/cjs/theme/palette/colors/index.js +17 -15
  252. package/dist/cjs/theme/palette/colors/orange.js +3 -1
  253. package/dist/cjs/theme/palette/colors/purple.js +3 -1
  254. package/dist/cjs/theme/palette/colors/red.js +3 -1
  255. package/dist/cjs/theme/palette/error.js +3 -1
  256. package/dist/cjs/theme/palette/grey.js +3 -1
  257. package/dist/cjs/theme/palette/index.js +10 -8
  258. package/dist/cjs/theme/palette/palette-options.js +3 -1
  259. package/dist/cjs/theme/palette/primary.js +3 -1
  260. package/dist/cjs/theme/palette/secondary.js +3 -1
  261. package/dist/cjs/theme/palette/success.js +3 -1
  262. package/dist/cjs/theme/palette/text.js +3 -1
  263. package/dist/cjs/theme/palette/warning.js +3 -1
  264. package/dist/cjs/theme/theme.js +5 -3
  265. package/dist/cjs/theme/typography.js +3 -1
  266. package/dist/cjs/utils/axis.js +11 -7
  267. package/dist/cjs/utils/chart-actions.js +59 -5
  268. package/dist/cjs/utils/combine-sx.js +3 -1
  269. package/dist/cjs/utils/component-ids.js +3 -1
  270. package/dist/cjs/utils/format.js +16 -8
  271. package/dist/cjs/utils/index.js +15 -13
  272. package/dist/cjs/utils/mathjs.js +3 -1
  273. package/dist/cjs/utils/theme-gen.js +12 -10
  274. package/dist/context/ChartsProvider.d.ts +19 -0
  275. package/dist/context/ChartsProvider.d.ts.map +1 -0
  276. package/dist/context/{ChartsThemeProvider.js → ChartsProvider.js} +24 -6
  277. package/dist/context/ChartsProvider.js.map +1 -0
  278. package/dist/context/SnackbarProvider.js.map +1 -1
  279. package/dist/context/TimeZoneProvider.js.map +1 -1
  280. package/dist/context/index.d.ts +4 -0
  281. package/dist/context/index.d.ts.map +1 -0
  282. package/dist/context/index.js +17 -0
  283. package/dist/context/index.js.map +1 -0
  284. package/dist/index.d.ts +2 -4
  285. package/dist/index.d.ts.map +1 -1
  286. package/dist/index.js +2 -4
  287. package/dist/index.js.map +1 -1
  288. package/dist/model/graph.js.map +1 -1
  289. package/dist/model/index.js.map +1 -1
  290. package/dist/test/index.js.map +1 -1
  291. package/dist/test/render.js.map +1 -1
  292. package/dist/test/setup-tests.js.map +1 -1
  293. package/dist/test-utils/index.js.map +1 -1
  294. package/dist/test-utils/theme.d.ts +2 -0
  295. package/dist/test-utils/theme.d.ts.map +1 -1
  296. package/dist/test-utils/theme.js +23 -16
  297. package/dist/test-utils/theme.js.map +1 -1
  298. package/dist/theme/component-overrides/alert.js.map +1 -1
  299. package/dist/theme/component-overrides/paper.js.map +1 -1
  300. package/dist/theme/index.d.ts +1 -0
  301. package/dist/theme/index.d.ts.map +1 -1
  302. package/dist/theme/index.js.map +1 -1
  303. package/dist/theme/palette/background.d.ts.map +1 -1
  304. package/dist/theme/palette/background.js +3 -1
  305. package/dist/theme/palette/background.js.map +1 -1
  306. package/dist/theme/palette/colors/blue.js.map +1 -1
  307. package/dist/theme/palette/colors/common.js.map +1 -1
  308. package/dist/theme/palette/colors/green.js.map +1 -1
  309. package/dist/theme/palette/colors/grey.js.map +1 -1
  310. package/dist/theme/palette/colors/index.js.map +1 -1
  311. package/dist/theme/palette/colors/orange.js.map +1 -1
  312. package/dist/theme/palette/colors/purple.js.map +1 -1
  313. package/dist/theme/palette/colors/red.js.map +1 -1
  314. package/dist/theme/palette/error.js.map +1 -1
  315. package/dist/theme/palette/grey.js.map +1 -1
  316. package/dist/theme/palette/index.js.map +1 -1
  317. package/dist/theme/palette/palette-options.js.map +1 -1
  318. package/dist/theme/palette/primary.js.map +1 -1
  319. package/dist/theme/palette/secondary.js.map +1 -1
  320. package/dist/theme/palette/success.js.map +1 -1
  321. package/dist/theme/palette/text.js.map +1 -1
  322. package/dist/theme/palette/warning.js.map +1 -1
  323. package/dist/theme/theme.js.map +1 -1
  324. package/dist/theme/typography.js.map +1 -1
  325. package/dist/utils/axis.d.ts +4 -4
  326. package/dist/utils/axis.d.ts.map +1 -1
  327. package/dist/utils/axis.js +4 -4
  328. package/dist/utils/axis.js.map +1 -1
  329. package/dist/utils/chart-actions.d.ts +5 -1
  330. package/dist/utils/chart-actions.d.ts.map +1 -1
  331. package/dist/utils/chart-actions.js +42 -0
  332. package/dist/utils/chart-actions.js.map +1 -1
  333. package/dist/utils/combine-sx.js.map +1 -1
  334. package/dist/utils/component-ids.js.map +1 -1
  335. package/dist/utils/format.js.map +1 -1
  336. package/dist/utils/index.js.map +1 -1
  337. package/dist/utils/mathjs.js.map +1 -1
  338. package/dist/utils/theme-gen.js +7 -7
  339. package/dist/utils/theme-gen.js.map +1 -1
  340. package/package.json +7 -6
  341. package/dist/UnitSelector/UnitSelector.d.ts +0 -9
  342. package/dist/UnitSelector/UnitSelector.d.ts.map +0 -1
  343. package/dist/UnitSelector/UnitSelector.js.map +0 -1
  344. package/dist/UnitSelector/index.d.ts +0 -2
  345. package/dist/UnitSelector/index.d.ts.map +0 -1
  346. package/dist/UnitSelector/index.js.map +0 -1
  347. package/dist/context/ChartsThemeProvider.d.ts +0 -10
  348. package/dist/context/ChartsThemeProvider.d.ts.map +0 -1
  349. package/dist/context/ChartsThemeProvider.js.map +0 -1
@@ -16,35 +16,37 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "Dialog", {
18
18
  enumerable: true,
19
- get: ()=>Dialog
19
+ get: function() {
20
+ return Dialog;
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
- const _close = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Close"));
26
+ const _Close = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Close"));
25
27
  const _utils = require("../utils");
26
- function _interopRequireDefault(obj) {
28
+ function _interop_require_default(obj) {
27
29
  return obj && obj.__esModule ? obj : {
28
30
  default: obj
29
31
  };
30
32
  }
31
33
  const Header = ({ children , onClose , ...props })=>{
32
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
34
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
33
35
  children: [
34
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.DialogTitle, {
36
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogTitle, {
35
37
  ...props,
36
38
  children: children
37
39
  }),
38
- onClose && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
40
+ onClose && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
39
41
  "aria-label": "Close",
40
42
  onClick: onClose,
41
43
  sx: dialogCloseIconButtonStyle,
42
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_close.default, {})
44
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Close.default, {})
43
45
  })
44
46
  ]
45
47
  });
46
48
  };
47
- const Content = ({ children , width =500 , sx , ...props })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.DialogContent, {
49
+ const Content = ({ children , width =500 , sx , ...props })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogContent, {
48
50
  dividers: true,
49
51
  ...props,
50
52
  sx: (0, _utils.combineSx)({
@@ -52,13 +54,13 @@ const Content = ({ children , width =500 , sx , ...props })=>/*#__PURE__*/ (0, _
52
54
  }, sx),
53
55
  children: children
54
56
  });
55
- const PrimaryButton = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
57
+ const PrimaryButton = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
56
58
  variant: "contained",
57
59
  type: "submit",
58
60
  ...props,
59
61
  children: children
60
62
  });
61
- const SecondaryButton = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
63
+ const SecondaryButton = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
62
64
  variant: "outlined",
63
65
  color: "secondary",
64
66
  ...props,
@@ -84,7 +86,7 @@ const SecondaryButton = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxRuntime
84
86
  right: theme.spacing(0.5)
85
87
  };
86
88
  };
87
- const Dialog = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Dialog, {
89
+ const Dialog = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Dialog, {
88
90
  ...props,
89
91
  children: children
90
92
  });
@@ -16,31 +16,33 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "DiscardChangesConfirmationDialog", {
18
18
  enumerable: true,
19
- get: ()=>DiscardChangesConfirmationDialog
19
+ get: function() {
20
+ return DiscardChangesConfirmationDialog;
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 _dialog = require("./Dialog");
25
+ const _Dialog = require("./Dialog");
24
26
  const DiscardChangesConfirmationDialog = (props)=>{
25
27
  const { description , isOpen , onCancel , onDiscardChanges } = props;
26
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_dialog.Dialog, {
28
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Dialog.Dialog, {
27
29
  open: isOpen,
28
30
  "aria-labelledby": "discard-dialog",
29
31
  children: [
30
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_dialog.Dialog.Header, {
32
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_Dialog.Dialog.Header, {
31
33
  children: "Discard Changes"
32
34
  }),
33
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_dialog.Dialog.Content, {
35
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_Dialog.Dialog.Content, {
34
36
  children: description
35
37
  }),
36
- /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_dialog.Dialog.Actions, {
38
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Dialog.Dialog.Actions, {
37
39
  children: [
38
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
40
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
39
41
  variant: "contained",
40
42
  onClick: onDiscardChanges,
41
43
  children: "Discard Changes"
42
44
  }),
43
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
45
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
44
46
  variant: "outlined",
45
47
  color: "secondary",
46
48
  onClick: onCancel,
@@ -14,16 +14,18 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./Dialog"), exports);
18
- _exportStar(require("./DiscardChangesConfirmationDialog"), exports);
19
- function _exportStar(from, to) {
17
+ _export_star(require("./Dialog"), exports);
18
+ _export_star(require("./DiscardChangesConfirmationDialog"), exports);
19
+ function _export_star(from, to) {
20
20
  Object.keys(from).forEach(function(k) {
21
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
22
- enumerable: true,
23
- get: function() {
24
- return from[k];
25
- }
26
- });
21
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
22
+ Object.defineProperty(to, k, {
23
+ enumerable: true,
24
+ get: function() {
25
+ return from[k];
26
+ }
27
+ });
28
+ }
27
29
  });
28
30
  return from;
29
31
  }
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "Drawer", {
18
18
  enumerable: true,
19
- get: ()=>Drawer
19
+ get: function() {
20
+ return Drawer;
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
25
  const _utils = require("../utils");
24
26
  const DRAWER_DEFAULT_WIDTH = 1080;
25
27
  const Drawer = ({ anchor ='right' , isOpen , onClose , PaperProps , children , ...rest })=>{
26
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Drawer, {
28
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Drawer, {
27
29
  ...rest,
28
30
  open: isOpen,
29
31
  onClose: onClose,
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./Drawer"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./Drawer"), 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,15 +16,17 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "EChart", {
18
18
  enumerable: true,
19
- get: ()=>EChart
19
+ get: function() {
20
+ return EChart;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
23
25
  const _core = require("echarts/core");
24
26
  const _material = require("@mui/material");
25
- const _isEqual = /*#__PURE__*/ _interopRequireDefault(require("lodash/isEqual"));
26
- const _debounce = /*#__PURE__*/ _interopRequireDefault(require("lodash/debounce"));
27
- function _interopRequireDefault(obj) {
27
+ const _isEqual = /*#__PURE__*/ _interop_require_default(require("lodash/isEqual"));
28
+ const _debounce = /*#__PURE__*/ _interop_require_default(require("lodash/debounce"));
29
+ function _interop_require_default(obj) {
28
30
  return obj && obj.__esModule ? obj : {
29
31
  default: obj
30
32
  };
@@ -37,7 +39,7 @@ function _getRequireWildcardCache(nodeInterop) {
37
39
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
38
40
  })(nodeInterop);
39
41
  }
40
- function _interopRequireWildcard(obj, nodeInterop) {
42
+ function _interop_require_wildcard(obj, nodeInterop) {
41
43
  if (!nodeInterop && obj && obj.__esModule) {
42
44
  return obj;
43
45
  }
@@ -176,7 +178,7 @@ const EChart = /*#__PURE__*/ _react.default.memo(function EChart({ option , them
176
178
  }, [
177
179
  sx
178
180
  ]);
179
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
181
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
180
182
  ref: containerRef,
181
183
  sx: sx
182
184
  });
@@ -197,8 +199,8 @@ function bindEvents(instance, events) {
197
199
  }
198
200
  for(const eventName in events){
199
201
  if (Object.prototype.hasOwnProperty.call(events, eventName)) {
200
- var _eventName;
201
- const customEvent = (_eventName = events[eventName]) !== null && _eventName !== void 0 ? _eventName : null;
202
+ var _events_eventName;
203
+ const customEvent = (_events_eventName = events[eventName]) !== null && _events_eventName !== void 0 ? _events_eventName : null;
202
204
  if (customEvent) {
203
205
  bindEvent(eventName, customEvent);
204
206
  }
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./EChart"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./EChart"), 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,13 +16,15 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "ErrorAlert", {
18
18
  enumerable: true,
19
- get: ()=>ErrorAlert
19
+ get: function() {
20
+ return ErrorAlert;
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
25
  function ErrorAlert(props) {
24
26
  const { error } = props;
25
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Alert, {
27
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
26
28
  severity: "error",
27
29
  children: error.message
28
30
  });
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "__esModule", {
17
17
  });
18
18
  Object.defineProperty(exports, "ErrorBoundary", {
19
19
  enumerable: true,
20
- get: ()=>_reactErrorBoundary.ErrorBoundary
20
+ get: function() {
21
+ return _reacterrorboundary.ErrorBoundary;
22
+ }
21
23
  });
22
- const _reactErrorBoundary = require("react-error-boundary");
24
+ const _reacterrorboundary = require("react-error-boundary");
@@ -16,11 +16,13 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "FontSizeSelector", {
18
18
  enumerable: true,
19
- get: ()=>FontSizeSelector
19
+ get: function() {
20
+ return FontSizeSelector;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _optionsEditorLayout = require("../OptionsEditorLayout");
23
- const _settingsAutocomplete = require("../SettingsAutocomplete");
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _OptionsEditorLayout = require("../OptionsEditorLayout");
25
+ const _SettingsAutocomplete = require("../SettingsAutocomplete");
24
26
  const FONT_SIZE_OPTIONS = [
25
27
  {
26
28
  id: 'default',
@@ -117,9 +119,9 @@ function FontSizeSelector({ value , onChange }) {
117
119
  const handleFontSizeChange = (_, { value })=>{
118
120
  onChange(value);
119
121
  };
120
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_optionsEditorLayout.OptionsEditorControl, {
122
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
121
123
  label: "Font Size",
122
- control: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_settingsAutocomplete.SettingsAutocomplete, {
124
+ control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_SettingsAutocomplete.SettingsAutocomplete, {
123
125
  value: FONT_SIZE_OPTIONS.find((o)=>o.value === value),
124
126
  options: FONT_SIZE_OPTIONS,
125
127
  getOptionLabel: (o)=>o.label,
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./FontSizeSelector"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./FontSizeSelector"), 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
  }
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- Object.defineProperty(exports, "UnitSelector", {
17
+ Object.defineProperty(exports, "FormatControls", {
18
18
  enumerable: true,
19
- get: ()=>UnitSelector
19
+ get: function() {
20
+ return FormatControls;
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
25
  const _core = require("@perses-dev/core");
24
- const _optionsEditorLayout = require("../OptionsEditorLayout");
25
- const _settingsAutocomplete = require("../SettingsAutocomplete");
26
+ const _OptionsEditorLayout = require("../OptionsEditorLayout");
27
+ const _SettingsAutocomplete = require("../SettingsAutocomplete");
26
28
  const KIND_OPTIONS = Object.entries(_core.UNIT_CONFIG).map(([id, config])=>{
27
29
  return {
28
30
  id: id,
@@ -33,78 +35,78 @@ const DECIMAL_PLACES_OPTIONS = [
33
35
  {
34
36
  id: 'default',
35
37
  label: 'Default',
36
- decimal_places: undefined
38
+ decimalPlaces: undefined
37
39
  },
38
40
  {
39
41
  id: '0',
40
42
  label: '0',
41
- decimal_places: 0
43
+ decimalPlaces: 0
42
44
  },
43
45
  {
44
46
  id: '1',
45
47
  label: '1',
46
- decimal_places: 1
48
+ decimalPlaces: 1
47
49
  },
48
50
  {
49
51
  id: '2',
50
52
  label: '2',
51
- decimal_places: 2
53
+ decimalPlaces: 2
52
54
  },
53
55
  {
54
56
  id: '3',
55
57
  label: '3',
56
- decimal_places: 3
58
+ decimalPlaces: 3
57
59
  },
58
60
  {
59
61
  id: '4',
60
62
  label: '4',
61
- decimal_places: 4
63
+ decimalPlaces: 4
62
64
  }
63
65
  ];
64
- function getOptionByDecimalPlaces(decimal_places) {
65
- return DECIMAL_PLACES_OPTIONS.find((o)=>o.decimal_places === decimal_places);
66
+ function getOptionByDecimalPlaces(decimalPlaces) {
67
+ return DECIMAL_PLACES_OPTIONS.find((o)=>o.decimalPlaces === decimalPlaces);
66
68
  }
67
- function UnitSelector({ value , onChange , disabled =false }) {
69
+ function FormatControls({ value , onChange , disabled =false }) {
68
70
  const hasDecimalPlaces = (0, _core.isUnitWithDecimalPlaces)(value);
69
- const hasAbbreviate = (0, _core.isUnitWithAbbreviate)(value);
71
+ const hasShortValues = (0, _core.isUnitWithShortValues)(value);
70
72
  const handleKindChange = (_, newValue)=>{
71
73
  onChange({
72
- kind: newValue.id
74
+ unit: newValue.id
73
75
  });
74
76
  };
75
- const handleDecimalPlacesChange = (_, { decimal_places })=>{
77
+ const handleDecimalPlacesChange = (_, { decimalPlaces })=>{
76
78
  if (hasDecimalPlaces) {
77
79
  onChange({
78
80
  ...value,
79
- decimal_places: decimal_places
81
+ decimalPlaces: decimalPlaces
80
82
  });
81
83
  }
82
84
  };
83
- const handleAbbreviateChange = (_, checked)=>{
84
- if (hasAbbreviate) {
85
+ const handleShortValuesChange = (_, checked)=>{
86
+ if (hasShortValues) {
85
87
  onChange({
86
88
  ...value,
87
- abbreviate: checked
89
+ shortValues: checked
88
90
  });
89
91
  }
90
92
  };
91
- const kindConfig = _core.UNIT_CONFIG[value.kind];
92
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
93
+ const unitConfig = _core.UNIT_CONFIG[value.unit];
94
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
93
95
  children: [
94
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_optionsEditorLayout.OptionsEditorControl, {
95
- label: "Abbreviate",
96
- control: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Switch, {
97
- checked: hasAbbreviate ? (0, _core.shouldAbbreviate)(value.abbreviate) : false,
98
- onChange: handleAbbreviateChange,
99
- disabled: !hasAbbreviate
96
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
97
+ label: "Short values",
98
+ control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
99
+ checked: hasShortValues ? (0, _core.shouldShortenValues)(value.shortValues) : false,
100
+ onChange: handleShortValuesChange,
101
+ disabled: !hasShortValues
100
102
  })
101
103
  }),
102
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_optionsEditorLayout.OptionsEditorControl, {
104
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
103
105
  label: "Unit",
104
- control: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_settingsAutocomplete.SettingsAutocomplete, {
106
+ control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_SettingsAutocomplete.SettingsAutocomplete, {
105
107
  value: {
106
- id: value.kind,
107
- ...kindConfig
108
+ id: value.unit,
109
+ ...unitConfig
108
110
  },
109
111
  options: KIND_OPTIONS,
110
112
  groupBy: (option)=>option.group,
@@ -113,10 +115,10 @@ function UnitSelector({ value , onChange , disabled =false }) {
113
115
  disabled: disabled
114
116
  })
115
117
  }),
116
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_optionsEditorLayout.OptionsEditorControl, {
118
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
117
119
  label: "Decimals",
118
- control: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_settingsAutocomplete.SettingsAutocomplete, {
119
- value: getOptionByDecimalPlaces(value.decimal_places),
120
+ control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_SettingsAutocomplete.SettingsAutocomplete, {
121
+ value: getOptionByDecimalPlaces(value.decimalPlaces),
120
122
  options: DECIMAL_PLACES_OPTIONS,
121
123
  getOptionLabel: (o)=>o.label,
122
124
  onChange: handleDecimalPlacesChange,
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./UnitSelector"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./FormatControls"), 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,17 +21,21 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- GaugeChart: ()=>GaugeChart,
25
- getResponsiveValueSize: ()=>getResponsiveValueSize
24
+ GaugeChart: function() {
25
+ return GaugeChart;
26
+ },
27
+ getResponsiveValueSize: function() {
28
+ return getResponsiveValueSize;
29
+ }
26
30
  });
27
- const _jsxRuntime = require("react/jsx-runtime");
31
+ const _jsxruntime = require("react/jsx-runtime");
28
32
  const _core = require("@perses-dev/core");
29
33
  const _core1 = require("echarts/core");
30
34
  const _charts = require("echarts/charts");
31
35
  const _components = require("echarts/components");
32
36
  const _renderers = require("echarts/renderers");
33
- const _chartsThemeProvider = require("../context/ChartsThemeProvider");
34
- const _echart = require("../EChart");
37
+ const _ChartsProvider = require("../context/ChartsProvider");
38
+ const _EChart = require("../EChart");
35
39
  (0, _core1.use)([
36
40
  _charts.GaugeChart,
37
41
  _components.GridComponent,
@@ -43,15 +47,15 @@ const PROGRESS_WIDTH = 16;
43
47
  // adjusts when to show pointer icon
44
48
  const GAUGE_SMALL_BREAKPOINT = 170;
45
49
  function GaugeChart(props) {
46
- const { width , height , data , unit , axisLine , max } = props;
47
- const chartsTheme = (0, _chartsThemeProvider.useChartsTheme)();
50
+ const { width , height , data , format , axisLine , max } = props;
51
+ const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
48
52
  // useDeepMemo ensures value size util does not rerun everytime you hover on the chart
49
53
  const option = (0, _core.useDeepMemo)(()=>{
50
- var ref;
54
+ var _chartsTheme_echartsTheme_textStyle;
51
55
  if (data.value === undefined) return chartsTheme.noDataOption;
52
56
  // adjusts fontSize depending on number of characters
53
- const valueSizeClamp = getResponsiveValueSize(data.value, unit, width, height);
54
- var ref1;
57
+ const valueSizeClamp = getResponsiveValueSize(data.value, format, width, height);
58
+ var _chartsTheme_echartsTheme_textStyle_color;
55
59
  return {
56
60
  title: {
57
61
  show: false
@@ -170,7 +174,7 @@ function GaugeChart(props) {
170
174
  // when the value is `null`, making it difficult to differentiate
171
175
  // `null` from a true `NaN` case.
172
176
  ()=>'null' : (value)=>{
173
- return (0, _core.formatValue)(value, unit);
177
+ return (0, _core.formatValue)(value, format);
174
178
  }
175
179
  },
176
180
  data: [
@@ -181,7 +185,7 @@ function GaugeChart(props) {
181
185
  // https://echarts.apache.org/en/option.html#series-gauge.data.title
182
186
  title: {
183
187
  show: true,
184
- color: (ref1 = (ref = chartsTheme.echartsTheme.textStyle) === null || ref === void 0 ? void 0 : ref.color) !== null && ref1 !== void 0 ? ref1 : 'inherit',
188
+ color: (_chartsTheme_echartsTheme_textStyle_color = (_chartsTheme_echartsTheme_textStyle = chartsTheme.echartsTheme.textStyle) === null || _chartsTheme_echartsTheme_textStyle === void 0 ? void 0 : _chartsTheme_echartsTheme_textStyle.color) !== null && _chartsTheme_echartsTheme_textStyle_color !== void 0 ? _chartsTheme_echartsTheme_textStyle_color : 'inherit',
185
189
  offsetCenter: [
186
190
  0,
187
191
  '55%'
@@ -200,11 +204,11 @@ function GaugeChart(props) {
200
204
  width,
201
205
  height,
202
206
  chartsTheme,
203
- unit,
207
+ format,
204
208
  axisLine,
205
209
  max
206
210
  ]);
207
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_echart.EChart, {
211
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_EChart.EChart, {
208
212
  sx: {
209
213
  width: width,
210
214
  height: height,
@@ -214,13 +218,13 @@ function GaugeChart(props) {
214
218
  theme: chartsTheme.echartsTheme
215
219
  });
216
220
  }
217
- function getResponsiveValueSize(value, unit, width, height) {
221
+ function getResponsiveValueSize(value, format, width, height) {
218
222
  const MIN_SIZE = 3;
219
223
  const MAX_SIZE = 24;
220
224
  const SIZE_MULTIPLIER = 0.7;
221
- const formattedValue = typeof value === 'number' ? (0, _core.formatValue)(value, unit) : `${value}`;
222
- var _length;
223
- const valueCharacters = (_length = formattedValue.length) !== null && _length !== void 0 ? _length : 2;
225
+ const formattedValue = typeof value === 'number' ? (0, _core.formatValue)(value, format) : `${value}`;
226
+ var _formattedValue_length;
227
+ const valueCharacters = (_formattedValue_length = formattedValue.length) !== null && _formattedValue_length !== void 0 ? _formattedValue_length : 2;
224
228
  const valueSize = Math.min(width, height) / valueCharacters * SIZE_MULTIPLIER;
225
229
  return `clamp(${MIN_SIZE}px, ${valueSize}px, ${MAX_SIZE}px)`;
226
230
  }