@perses-dev/components 0.21.0 → 0.22.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 (379) hide show
  1. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +1 -1
  2. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
  3. package/dist/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
  4. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  5. package/dist/DateTimeRangePicker/TimeRangeSelector.js +1 -1
  6. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
  7. package/dist/DateTimeRangePicker/index.js +1 -1
  8. package/dist/DateTimeRangePicker/index.js.map +1 -1
  9. package/dist/DateTimeRangePicker/utils.js +1 -1
  10. package/dist/DateTimeRangePicker/utils.js.map +1 -1
  11. package/dist/Drawer/Drawer.js +1 -1
  12. package/dist/Drawer/Drawer.js.map +1 -1
  13. package/dist/Drawer/index.js +1 -1
  14. package/dist/Drawer/index.js.map +1 -1
  15. package/dist/EChart.js +1 -1
  16. package/dist/EChart.js.map +1 -1
  17. package/dist/ErrorAlert.js +1 -1
  18. package/dist/ErrorAlert.js.map +1 -1
  19. package/dist/ErrorBoundary.js +1 -1
  20. package/dist/ErrorBoundary.js.map +1 -1
  21. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
  22. package/dist/GaugeChart/GaugeChart.js +3 -9
  23. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  24. package/dist/GaugeChart/index.js +1 -1
  25. package/dist/GaugeChart/index.js.map +1 -1
  26. package/dist/InfoTooltip/InfoTooltip.d.ts +1 -6
  27. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  28. package/dist/InfoTooltip/InfoTooltip.js +2 -9
  29. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  30. package/dist/InfoTooltip/InfoTooltip.test.js +1 -1
  31. package/dist/InfoTooltip/InfoTooltip.test.js.map +1 -1
  32. package/dist/InfoTooltip/index.js +1 -1
  33. package/dist/InfoTooltip/index.js.map +1 -1
  34. package/dist/JSONEditor.d.ts +5 -4
  35. package/dist/JSONEditor.d.ts.map +1 -1
  36. package/dist/JSONEditor.js +21 -16
  37. package/dist/JSONEditor.js.map +1 -1
  38. package/dist/Legend/CompactLegend.js +1 -1
  39. package/dist/Legend/CompactLegend.js.map +1 -1
  40. package/dist/Legend/Legend.d.ts.map +1 -1
  41. package/dist/Legend/Legend.js +18 -6
  42. package/dist/Legend/Legend.js.map +1 -1
  43. package/dist/Legend/LegendColorBadge.js +1 -1
  44. package/dist/Legend/LegendColorBadge.js.map +1 -1
  45. package/dist/Legend/ListLegend.js +1 -1
  46. package/dist/Legend/ListLegend.js.map +1 -1
  47. package/dist/Legend/ListLegendItem.js +1 -1
  48. package/dist/Legend/ListLegendItem.js.map +1 -1
  49. package/dist/Legend/index.js +1 -1
  50. package/dist/Legend/index.js.map +1 -1
  51. package/dist/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  52. package/dist/LegendOptionsEditor/LegendOptionsEditor.js +13 -18
  53. package/dist/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  54. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js +23 -2
  55. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js.map +1 -1
  56. package/dist/LegendOptionsEditor/index.js +1 -1
  57. package/dist/LegendOptionsEditor/index.js.map +1 -1
  58. package/dist/LineChart/LineChart.js +3 -3
  59. package/dist/LineChart/LineChart.js.map +1 -1
  60. package/dist/LineChart/index.js +1 -1
  61. package/dist/LineChart/index.js.map +1 -1
  62. package/dist/LineChart/utils.js +1 -1
  63. package/dist/LineChart/utils.js.map +1 -1
  64. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
  65. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  66. package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  67. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  68. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
  69. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  70. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
  71. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  72. package/dist/OptionsEditorLayout/index.js +1 -1
  73. package/dist/OptionsEditorLayout/index.js.map +1 -1
  74. package/dist/StatChart/StatChart.js +1 -1
  75. package/dist/StatChart/StatChart.js.map +1 -1
  76. package/dist/StatChart/StatChart.test.js +1 -1
  77. package/dist/StatChart/StatChart.test.js.map +1 -1
  78. package/dist/StatChart/index.js +1 -1
  79. package/dist/StatChart/index.js.map +1 -1
  80. package/dist/{Tooltip → TimeSeriesTooltip}/SeriesInfo.d.ts +1 -2
  81. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -0
  82. package/dist/TimeSeriesTooltip/SeriesInfo.js +89 -0
  83. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -0
  84. package/dist/TimeSeriesTooltip/SeriesInfo.test.d.ts +2 -0
  85. package/dist/TimeSeriesTooltip/SeriesInfo.test.d.ts.map +1 -0
  86. package/dist/TimeSeriesTooltip/SeriesInfo.test.js +52 -0
  87. package/dist/TimeSeriesTooltip/SeriesInfo.test.js.map +1 -0
  88. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +9 -0
  89. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -0
  90. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +99 -0
  91. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -0
  92. package/dist/{Tooltip → TimeSeriesTooltip}/SeriesMarker.d.ts +2 -1
  93. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -0
  94. package/dist/{Tooltip → TimeSeriesTooltip}/SeriesMarker.js +7 -7
  95. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -0
  96. package/dist/{Tooltip/Tooltip.d.ts → TimeSeriesTooltip/TimeSeriesTooltip.d.ts} +4 -4
  97. package/dist/TimeSeriesTooltip/TimeSeriesTooltip.d.ts.map +1 -0
  98. package/dist/{Tooltip/Tooltip.js → TimeSeriesTooltip/TimeSeriesTooltip.js} +3 -4
  99. package/dist/TimeSeriesTooltip/TimeSeriesTooltip.js.map +1 -0
  100. package/dist/{Tooltip → TimeSeriesTooltip}/TooltipContent.d.ts +1 -2
  101. package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -0
  102. package/dist/{Tooltip → TimeSeriesTooltip}/TooltipContent.js +1 -1
  103. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -0
  104. package/dist/TimeSeriesTooltip/TooltipContent.test.d.ts +2 -0
  105. package/dist/TimeSeriesTooltip/TooltipContent.test.d.ts.map +1 -0
  106. package/dist/TimeSeriesTooltip/TooltipContent.test.js +78 -0
  107. package/dist/TimeSeriesTooltip/TooltipContent.test.js.map +1 -0
  108. package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.d.ts +0 -0
  109. package/dist/TimeSeriesTooltip/focused-series.d.ts.map +1 -0
  110. package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.js +3 -3
  111. package/dist/TimeSeriesTooltip/focused-series.js.map +1 -0
  112. package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.test.d.ts +0 -0
  113. package/dist/TimeSeriesTooltip/focused-series.test.d.ts.map +1 -0
  114. package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.test.js +1 -1
  115. package/dist/TimeSeriesTooltip/focused-series.test.js.map +1 -0
  116. package/dist/TimeSeriesTooltip/index.d.ts +9 -0
  117. package/dist/TimeSeriesTooltip/index.d.ts.map +1 -0
  118. package/dist/{Tooltip → TimeSeriesTooltip}/index.js +8 -2
  119. package/dist/TimeSeriesTooltip/index.js.map +1 -0
  120. package/dist/{Tooltip → TimeSeriesTooltip}/tooltip-model.d.ts +0 -0
  121. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -0
  122. package/dist/{Tooltip → TimeSeriesTooltip}/tooltip-model.js +1 -1
  123. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -0
  124. package/dist/{Tooltip → TimeSeriesTooltip}/utils.d.ts +0 -0
  125. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -0
  126. package/dist/{Tooltip → TimeSeriesTooltip}/utils.js +1 -1
  127. package/dist/TimeSeriesTooltip/utils.js.map +1 -0
  128. package/dist/UnitSelector/UnitSelector.js +1 -1
  129. package/dist/UnitSelector/UnitSelector.js.map +1 -1
  130. package/dist/UnitSelector/UnitSelector.test.js +1 -1
  131. package/dist/UnitSelector/UnitSelector.test.js.map +1 -1
  132. package/dist/UnitSelector/index.js +1 -1
  133. package/dist/UnitSelector/index.js.map +1 -1
  134. package/dist/YAxisLabel.js +1 -1
  135. package/dist/YAxisLabel.js.map +1 -1
  136. package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +1 -1
  137. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
  138. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +1 -1
  139. package/dist/cjs/DateTimeRangePicker/index.js +1 -1
  140. package/dist/cjs/DateTimeRangePicker/utils.js +1 -1
  141. package/dist/cjs/Drawer/Drawer.js +1 -1
  142. package/dist/cjs/Drawer/index.js +1 -1
  143. package/dist/cjs/EChart.js +1 -1
  144. package/dist/cjs/ErrorAlert.js +1 -1
  145. package/dist/cjs/ErrorBoundary.js +1 -1
  146. package/dist/cjs/GaugeChart/GaugeChart.js +3 -9
  147. package/dist/cjs/GaugeChart/index.js +1 -1
  148. package/dist/cjs/InfoTooltip/InfoTooltip.js +5 -18
  149. package/dist/cjs/InfoTooltip/InfoTooltip.test.js +1 -1
  150. package/dist/cjs/InfoTooltip/index.js +1 -1
  151. package/dist/cjs/JSONEditor.js +25 -15
  152. package/dist/cjs/Legend/CompactLegend.js +1 -1
  153. package/dist/cjs/Legend/Legend.js +17 -5
  154. package/dist/cjs/Legend/LegendColorBadge.js +1 -1
  155. package/dist/cjs/Legend/ListLegend.js +1 -1
  156. package/dist/cjs/Legend/ListLegendItem.js +1 -1
  157. package/dist/cjs/Legend/index.js +1 -1
  158. package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.js +13 -18
  159. package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.test.js +23 -2
  160. package/dist/cjs/LegendOptionsEditor/index.js +1 -1
  161. package/dist/cjs/LineChart/LineChart.js +3 -3
  162. package/dist/cjs/LineChart/index.js +1 -1
  163. package/dist/cjs/LineChart/utils.js +1 -1
  164. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
  165. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  166. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
  167. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
  168. package/dist/cjs/OptionsEditorLayout/index.js +1 -1
  169. package/dist/cjs/StatChart/StatChart.js +1 -1
  170. package/dist/cjs/StatChart/StatChart.test.js +1 -1
  171. package/dist/cjs/StatChart/index.js +1 -1
  172. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +95 -0
  173. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.test.js +54 -0
  174. package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +105 -0
  175. package/dist/cjs/{Tooltip → TimeSeriesTooltip}/SeriesMarker.js +7 -7
  176. package/dist/cjs/{Tooltip/Tooltip.js → TimeSeriesTooltip/TimeSeriesTooltip.js} +4 -4
  177. package/dist/cjs/{Tooltip → TimeSeriesTooltip}/TooltipContent.js +1 -1
  178. package/dist/cjs/TimeSeriesTooltip/TooltipContent.test.js +80 -0
  179. package/dist/cjs/{Tooltip → TimeSeriesTooltip}/focused-series.js +3 -3
  180. package/dist/cjs/{Tooltip → TimeSeriesTooltip}/focused-series.test.js +1 -1
  181. package/dist/cjs/{Tooltip → TimeSeriesTooltip}/index.js +8 -2
  182. package/dist/cjs/{Tooltip → TimeSeriesTooltip}/tooltip-model.js +1 -1
  183. package/dist/cjs/{Tooltip → TimeSeriesTooltip}/utils.js +1 -1
  184. package/dist/cjs/UnitSelector/UnitSelector.js +1 -1
  185. package/dist/cjs/UnitSelector/UnitSelector.test.js +1 -1
  186. package/dist/cjs/UnitSelector/index.js +1 -1
  187. package/dist/cjs/YAxisLabel.js +1 -1
  188. package/dist/cjs/context/ChartsThemeProvider.js +1 -1
  189. package/dist/cjs/context/TimeZoneProvider.js +1 -1
  190. package/dist/cjs/index.js +2 -1
  191. package/dist/cjs/model/graph.js +4 -15
  192. package/dist/cjs/model/index.js +2 -1
  193. package/dist/cjs/model/legend.js +67 -0
  194. package/dist/cjs/model/legend.test.js +29 -0
  195. package/dist/cjs/model/theme.js +1 -1
  196. package/dist/cjs/model/units/bytes.js +1 -1
  197. package/dist/cjs/model/units/constants.js +1 -1
  198. package/dist/cjs/model/units/decimal.js +1 -1
  199. package/dist/cjs/model/units/index.js +1 -1
  200. package/dist/cjs/model/units/percent.js +1 -1
  201. package/dist/cjs/model/units/time.js +1 -1
  202. package/dist/cjs/model/units/types.js +1 -1
  203. package/dist/cjs/model/units/units.js +1 -1
  204. package/dist/cjs/model/units/units.test.js +5 -6
  205. package/dist/cjs/test/index.js +1 -1
  206. package/dist/cjs/test/render.js +1 -1
  207. package/dist/cjs/test/setup-tests.js +1 -1
  208. package/dist/cjs/test-utils/index.js +1 -1
  209. package/dist/cjs/test-utils/theme.js +1 -1
  210. package/dist/cjs/theme/index.js +1 -1
  211. package/dist/cjs/theme/palette/background.js +1 -1
  212. package/dist/cjs/theme/palette/colors/blue.js +1 -1
  213. package/dist/cjs/theme/palette/colors/common.js +1 -1
  214. package/dist/cjs/theme/palette/colors/green.js +1 -1
  215. package/dist/cjs/theme/palette/colors/grey.js +1 -1
  216. package/dist/cjs/theme/palette/colors/index.js +1 -1
  217. package/dist/cjs/theme/palette/colors/orange.js +1 -1
  218. package/dist/cjs/theme/palette/colors/purple.js +1 -1
  219. package/dist/cjs/theme/palette/colors/red.js +1 -1
  220. package/dist/cjs/theme/palette/colors/types.js +1 -1
  221. package/dist/cjs/theme/palette/error.js +1 -1
  222. package/dist/cjs/theme/palette/grey.js +1 -1
  223. package/dist/cjs/theme/palette/index.js +1 -1
  224. package/dist/cjs/theme/palette/palette-options.js +1 -1
  225. package/dist/cjs/theme/palette/primary.js +1 -1
  226. package/dist/cjs/theme/palette/secondary.js +1 -1
  227. package/dist/cjs/theme/palette/success.js +1 -1
  228. package/dist/cjs/theme/palette/text.js +1 -1
  229. package/dist/cjs/theme/palette/warning.js +1 -1
  230. package/dist/cjs/theme/theme.js +12 -1
  231. package/dist/cjs/theme/types/ThemeExtension.d.js +1 -1
  232. package/dist/cjs/theme/typography.js +1 -1
  233. package/dist/cjs/utils/combine-sx.js +1 -1
  234. package/dist/cjs/utils/component-ids.js +1 -1
  235. package/dist/cjs/utils/format.js +1 -1
  236. package/dist/cjs/utils/format.test.js +1 -1
  237. package/dist/cjs/utils/index.js +1 -1
  238. package/dist/cjs/utils/mathjs.js +1 -1
  239. package/dist/cjs/utils/theme-gen.js +1 -1
  240. package/dist/cjs/utils/theme-gen.test.js +1 -1
  241. package/dist/context/ChartsThemeProvider.js +1 -1
  242. package/dist/context/ChartsThemeProvider.js.map +1 -1
  243. package/dist/context/TimeZoneProvider.js +1 -1
  244. package/dist/context/TimeZoneProvider.js.map +1 -1
  245. package/dist/index.d.ts +1 -0
  246. package/dist/index.d.ts.map +1 -1
  247. package/dist/index.js +2 -1
  248. package/dist/index.js.map +1 -1
  249. package/dist/model/graph.d.ts +1 -16
  250. package/dist/model/graph.d.ts.map +1 -1
  251. package/dist/model/graph.js +1 -5
  252. package/dist/model/graph.js.map +1 -1
  253. package/dist/model/index.d.ts +1 -0
  254. package/dist/model/index.d.ts.map +1 -1
  255. package/dist/model/index.js +2 -1
  256. package/dist/model/index.js.map +1 -1
  257. package/dist/model/legend.d.ts +22 -0
  258. package/dist/model/legend.d.ts.map +1 -0
  259. package/dist/model/legend.js +51 -0
  260. package/dist/model/legend.js.map +1 -0
  261. package/dist/model/legend.test.d.ts +2 -0
  262. package/dist/model/legend.test.d.ts.map +1 -0
  263. package/dist/model/legend.test.js +27 -0
  264. package/dist/model/legend.test.js.map +1 -0
  265. package/dist/model/theme.js +1 -1
  266. package/dist/model/theme.js.map +1 -1
  267. package/dist/model/units/bytes.js +1 -1
  268. package/dist/model/units/bytes.js.map +1 -1
  269. package/dist/model/units/constants.js +1 -1
  270. package/dist/model/units/constants.js.map +1 -1
  271. package/dist/model/units/decimal.js +1 -1
  272. package/dist/model/units/decimal.js.map +1 -1
  273. package/dist/model/units/index.js +1 -1
  274. package/dist/model/units/index.js.map +1 -1
  275. package/dist/model/units/percent.js +1 -1
  276. package/dist/model/units/percent.js.map +1 -1
  277. package/dist/model/units/time.js +1 -1
  278. package/dist/model/units/time.js.map +1 -1
  279. package/dist/model/units/types.js +1 -1
  280. package/dist/model/units/types.js.map +1 -1
  281. package/dist/model/units/units.js +1 -1
  282. package/dist/model/units/units.js.map +1 -1
  283. package/dist/model/units/units.test.js +5 -6
  284. package/dist/model/units/units.test.js.map +1 -1
  285. package/dist/test/index.js +1 -1
  286. package/dist/test/index.js.map +1 -1
  287. package/dist/test/render.js +1 -1
  288. package/dist/test/render.js.map +1 -1
  289. package/dist/test/setup-tests.js +1 -1
  290. package/dist/test/setup-tests.js.map +1 -1
  291. package/dist/test-utils/index.js +1 -1
  292. package/dist/test-utils/index.js.map +1 -1
  293. package/dist/test-utils/theme.js +1 -1
  294. package/dist/test-utils/theme.js.map +1 -1
  295. package/dist/theme/index.js +1 -1
  296. package/dist/theme/index.js.map +1 -1
  297. package/dist/theme/palette/background.js +1 -1
  298. package/dist/theme/palette/background.js.map +1 -1
  299. package/dist/theme/palette/colors/blue.js +1 -1
  300. package/dist/theme/palette/colors/blue.js.map +1 -1
  301. package/dist/theme/palette/colors/common.js +1 -1
  302. package/dist/theme/palette/colors/common.js.map +1 -1
  303. package/dist/theme/palette/colors/green.js +1 -1
  304. package/dist/theme/palette/colors/green.js.map +1 -1
  305. package/dist/theme/palette/colors/grey.js +1 -1
  306. package/dist/theme/palette/colors/grey.js.map +1 -1
  307. package/dist/theme/palette/colors/index.js +1 -1
  308. package/dist/theme/palette/colors/index.js.map +1 -1
  309. package/dist/theme/palette/colors/orange.js +1 -1
  310. package/dist/theme/palette/colors/orange.js.map +1 -1
  311. package/dist/theme/palette/colors/purple.js +1 -1
  312. package/dist/theme/palette/colors/purple.js.map +1 -1
  313. package/dist/theme/palette/colors/red.js +1 -1
  314. package/dist/theme/palette/colors/red.js.map +1 -1
  315. package/dist/theme/palette/colors/types.js +1 -1
  316. package/dist/theme/palette/colors/types.js.map +1 -1
  317. package/dist/theme/palette/error.js +1 -1
  318. package/dist/theme/palette/error.js.map +1 -1
  319. package/dist/theme/palette/grey.js +1 -1
  320. package/dist/theme/palette/grey.js.map +1 -1
  321. package/dist/theme/palette/index.js +1 -1
  322. package/dist/theme/palette/index.js.map +1 -1
  323. package/dist/theme/palette/palette-options.js +1 -1
  324. package/dist/theme/palette/palette-options.js.map +1 -1
  325. package/dist/theme/palette/primary.js +1 -1
  326. package/dist/theme/palette/primary.js.map +1 -1
  327. package/dist/theme/palette/secondary.js +1 -1
  328. package/dist/theme/palette/secondary.js.map +1 -1
  329. package/dist/theme/palette/success.js +1 -1
  330. package/dist/theme/palette/success.js.map +1 -1
  331. package/dist/theme/palette/text.js +1 -1
  332. package/dist/theme/palette/text.js.map +1 -1
  333. package/dist/theme/palette/warning.js +1 -1
  334. package/dist/theme/palette/warning.js.map +1 -1
  335. package/dist/theme/theme.d.ts.map +1 -1
  336. package/dist/theme/theme.js +13 -2
  337. package/dist/theme/theme.js.map +1 -1
  338. package/dist/theme/types/ThemeExtension.d.js +1 -1
  339. package/dist/theme/types/ThemeExtension.d.js.map +1 -1
  340. package/dist/theme/typography.js +1 -1
  341. package/dist/theme/typography.js.map +1 -1
  342. package/dist/utils/combine-sx.js +1 -1
  343. package/dist/utils/combine-sx.js.map +1 -1
  344. package/dist/utils/component-ids.js +1 -1
  345. package/dist/utils/component-ids.js.map +1 -1
  346. package/dist/utils/format.js +1 -1
  347. package/dist/utils/format.js.map +1 -1
  348. package/dist/utils/format.test.js +1 -1
  349. package/dist/utils/format.test.js.map +1 -1
  350. package/dist/utils/index.js +1 -1
  351. package/dist/utils/index.js.map +1 -1
  352. package/dist/utils/mathjs.js +1 -1
  353. package/dist/utils/mathjs.js.map +1 -1
  354. package/dist/utils/theme-gen.js +1 -1
  355. package/dist/utils/theme-gen.js.map +1 -1
  356. package/dist/utils/theme-gen.test.js +1 -1
  357. package/dist/utils/theme-gen.test.js.map +1 -1
  358. package/package.json +4 -2
  359. package/dist/Tooltip/SeriesInfo.d.ts.map +0 -1
  360. package/dist/Tooltip/SeriesInfo.js +0 -143
  361. package/dist/Tooltip/SeriesInfo.js.map +0 -1
  362. package/dist/Tooltip/SeriesMarker.d.ts.map +0 -1
  363. package/dist/Tooltip/SeriesMarker.js.map +0 -1
  364. package/dist/Tooltip/Tooltip.d.ts.map +0 -1
  365. package/dist/Tooltip/Tooltip.js.map +0 -1
  366. package/dist/Tooltip/TooltipContent.d.ts.map +0 -1
  367. package/dist/Tooltip/TooltipContent.js.map +0 -1
  368. package/dist/Tooltip/focused-series.d.ts.map +0 -1
  369. package/dist/Tooltip/focused-series.js.map +0 -1
  370. package/dist/Tooltip/focused-series.test.d.ts.map +0 -1
  371. package/dist/Tooltip/focused-series.test.js.map +0 -1
  372. package/dist/Tooltip/index.d.ts +0 -3
  373. package/dist/Tooltip/index.d.ts.map +0 -1
  374. package/dist/Tooltip/index.js.map +0 -1
  375. package/dist/Tooltip/tooltip-model.d.ts.map +0 -1
  376. package/dist/Tooltip/tooltip-model.js.map +0 -1
  377. package/dist/Tooltip/utils.d.ts.map +0 -1
  378. package/dist/Tooltip/utils.js.map +0 -1
  379. package/dist/cjs/Tooltip/SeriesInfo.js +0 -149
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/LineChart/utils.ts"],"sourcesContent":["// Copyright 2022 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 { merge } from 'lodash-es';\nimport type { YAXisComponentOption } from 'echarts';\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { formatValue, UnitOptions } from '../model';\nimport { dateFormatOptionsWithTimeZone } from '../utils';\n\nexport interface ZoomEventData {\n start: number;\n end: number;\n startIndex: number;\n endIndex: number;\n}\n\n/**\n * Enable dataZoom without requring user to click toolbox icon\n */\nexport function enableDataZoom(chart: EChartsInstance) {\n const chartModel = chart['_model'];\n if (chartModel === undefined) return;\n if (chartModel.option.toolbox !== undefined && chartModel.option.toolbox.length > 0) {\n // check if hidden data zoom icon is unselected (if selected it would be 'emphasis' instead of 'normal')\n if (chartModel.option.toolbox[0].feature.dataZoom.iconStatus.zoom === 'normal') {\n chart.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: true,\n });\n }\n }\n}\n\n/**\n * Restore chart to original state before zoom or other actions were dispatched\n */\nexport function restoreChart(chart: EChartsInstance) {\n // TODO: support incremental unzoom instead of restore to original state\n chart.dispatchAction({\n type: 'restore', // https://echarts.apache.org/en/api.html#events.restore\n });\n}\n\n/**\n * Calculate date range, used as a fallback when xAxis time range not passed as prop\n */\nexport function getDateRange(data: number[]) {\n const defaultRange = 3600000; // hour in ms\n if (data.length === 0) return defaultRange;\n const lastDatum = data[data.length - 1];\n if (data[0] === undefined || lastDatum === undefined) return defaultRange;\n return lastDatum - data[0];\n}\n\n/*\n * Determines time granularity for axis labels, defaults to hh:mm\n */\nexport function getFormattedDate(value: number, rangeMs: number, timeZone?: string) {\n const dateFormatOptions: Intl.DateTimeFormatOptions = dateFormatOptionsWithTimeZone(\n {\n hour: 'numeric',\n minute: 'numeric',\n hourCycle: 'h23',\n },\n timeZone\n );\n const thirtyMinMs = 1800000;\n const dayMs = 86400000;\n if (rangeMs <= thirtyMinMs) {\n dateFormatOptions.second = 'numeric';\n } else if (rangeMs >= dayMs) {\n dateFormatOptions.month = 'numeric';\n dateFormatOptions.day = 'numeric';\n }\n const DATE_FORMAT = new Intl.DateTimeFormat(undefined, dateFormatOptions);\n // remove comma when month / day present\n return DATE_FORMAT.format(value).replace(/, /g, ' ');\n}\n\n/*\n * Populate yAxis properties, returns an Array since multiple y axes will be supported in the future\n */\nexport function getYAxes(yAxis?: YAXisComponentOption, unit?: UnitOptions) {\n // TODO: support alternate yAxis that shows on right side\n const Y_AXIS_DEFAULT = {\n type: 'value',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number) => {\n return formatValue(value, unit);\n },\n },\n };\n return [merge(Y_AXIS_DEFAULT, yAxis)];\n}\n"],"names":["merge","formatValue","dateFormatOptionsWithTimeZone","enableDataZoom","chart","chartModel","undefined","option","toolbox","length","feature","dataZoom","iconStatus","zoom","dispatchAction","type","key","dataZoomSelectActive","restoreChart","getDateRange","data","defaultRange","lastDatum","getFormattedDate","value","rangeMs","timeZone","dateFormatOptions","hour","minute","hourCycle","thirtyMinMs","dayMs","second","month","day","DATE_FORMAT","Intl","DateTimeFormat","format","replace","getYAxes","yAxis","unit","Y_AXIS_DEFAULT","boundaryGap","axisLabel","formatter"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AAC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;AACxC,CAAC"}
1
+ {"version":3,"sources":["../../src/LineChart/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 { merge } from 'lodash-es';\nimport type { YAXisComponentOption } from 'echarts';\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { formatValue, UnitOptions } from '../model';\nimport { dateFormatOptionsWithTimeZone } from '../utils';\n\nexport interface ZoomEventData {\n start: number;\n end: number;\n startIndex: number;\n endIndex: number;\n}\n\n/**\n * Enable dataZoom without requring user to click toolbox icon\n */\nexport function enableDataZoom(chart: EChartsInstance) {\n const chartModel = chart['_model'];\n if (chartModel === undefined) return;\n if (chartModel.option.toolbox !== undefined && chartModel.option.toolbox.length > 0) {\n // check if hidden data zoom icon is unselected (if selected it would be 'emphasis' instead of 'normal')\n if (chartModel.option.toolbox[0].feature.dataZoom.iconStatus.zoom === 'normal') {\n chart.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: true,\n });\n }\n }\n}\n\n/**\n * Restore chart to original state before zoom or other actions were dispatched\n */\nexport function restoreChart(chart: EChartsInstance) {\n // TODO: support incremental unzoom instead of restore to original state\n chart.dispatchAction({\n type: 'restore', // https://echarts.apache.org/en/api.html#events.restore\n });\n}\n\n/**\n * Calculate date range, used as a fallback when xAxis time range not passed as prop\n */\nexport function getDateRange(data: number[]) {\n const defaultRange = 3600000; // hour in ms\n if (data.length === 0) return defaultRange;\n const lastDatum = data[data.length - 1];\n if (data[0] === undefined || lastDatum === undefined) return defaultRange;\n return lastDatum - data[0];\n}\n\n/*\n * Determines time granularity for axis labels, defaults to hh:mm\n */\nexport function getFormattedDate(value: number, rangeMs: number, timeZone?: string) {\n const dateFormatOptions: Intl.DateTimeFormatOptions = dateFormatOptionsWithTimeZone(\n {\n hour: 'numeric',\n minute: 'numeric',\n hourCycle: 'h23',\n },\n timeZone\n );\n const thirtyMinMs = 1800000;\n const dayMs = 86400000;\n if (rangeMs <= thirtyMinMs) {\n dateFormatOptions.second = 'numeric';\n } else if (rangeMs >= dayMs) {\n dateFormatOptions.month = 'numeric';\n dateFormatOptions.day = 'numeric';\n }\n const DATE_FORMAT = new Intl.DateTimeFormat(undefined, dateFormatOptions);\n // remove comma when month / day present\n return DATE_FORMAT.format(value).replace(/, /g, ' ');\n}\n\n/*\n * Populate yAxis properties, returns an Array since multiple y axes will be supported in the future\n */\nexport function getYAxes(yAxis?: YAXisComponentOption, unit?: UnitOptions) {\n // TODO: support alternate yAxis that shows on right side\n const Y_AXIS_DEFAULT = {\n type: 'value',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number) => {\n return formatValue(value, unit);\n },\n },\n };\n return [merge(Y_AXIS_DEFAULT, yAxis)];\n}\n"],"names":["merge","formatValue","dateFormatOptionsWithTimeZone","enableDataZoom","chart","chartModel","undefined","option","toolbox","length","feature","dataZoom","iconStatus","zoom","dispatchAction","type","key","dataZoomSelectActive","restoreChart","getDateRange","data","defaultRange","lastDatum","getFormattedDate","value","rangeMs","timeZone","dateFormatOptions","hour","minute","hourCycle","thirtyMinMs","dayMs","second","month","day","DATE_FORMAT","Intl","DateTimeFormat","format","replace","getYAxes","yAxis","unit","Y_AXIS_DEFAULT","boundaryGap","axisLabel","formatter"],"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,KAAK,QAAQ,WAAW,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 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.tsx"],"sourcesContent":["// Copyright 2022 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 { Grid, Stack } from '@mui/material';\n\nexport type OptionsEditorColumnProps = {\n /**\n * Components to render in the column. These will usually be\n * `OptionsEditorGroup` components.\n */\n children: React.ReactNode;\n};\n\n/**\n * Lay out content in a column within panel options.\n */\nexport const OptionsEditorColumn = ({ children }: OptionsEditorColumnProps) => {\n return (\n <Grid item xs={4}>\n <Stack spacing={3}>{children}</Stack>\n </Grid>\n );\n};\n"],"names":["Grid","Stack","OptionsEditorColumn","children","item","xs","spacing"],"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,IAAI,EAAEC,KAAK,QAAQ,eAAe,CAAC;AAU5C;;CAEC,GACD,OAAO,MAAMC,mBAAmB,GAAG,CAAC,EAAEC,QAAQ,CAAA,EAA4B,GAAK;IAC7E,qBACE,KAACH,IAAI;QAACI,IAAI;QAACC,EAAE,EAAE,CAAC;kBACd,cAAA,KAACJ,KAAK;YAACK,OAAO,EAAE,CAAC;sBAAGH,QAAQ;UAAS;MAChC,CACP;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.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 { Grid, Stack } from '@mui/material';\n\nexport type OptionsEditorColumnProps = {\n /**\n * Components to render in the column. These will usually be\n * `OptionsEditorGroup` components.\n */\n children: React.ReactNode;\n};\n\n/**\n * Lay out content in a column within panel options.\n */\nexport const OptionsEditorColumn = ({ children }: OptionsEditorColumnProps) => {\n return (\n <Grid item xs={4}>\n <Stack spacing={3}>{children}</Stack>\n </Grid>\n );\n};\n"],"names":["Grid","Stack","OptionsEditorColumn","children","item","xs","spacing"],"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,IAAI,EAAEC,KAAK,QAAQ,eAAe,CAAC;AAU5C;;CAEC,GACD,OAAO,MAAMC,mBAAmB,GAAG,CAAC,EAAEC,QAAQ,CAAA,EAA4B,GAAK;IAC7E,qBACE,KAACH,IAAI;QAACI,IAAI;QAACC,EAAE,EAAE,CAAC;kBACd,cAAA,KAACJ,KAAK;YAACK,OAAO,EAAE,CAAC;sBAAGH,QAAQ;UAAS;MAChC,CACP;AACJ,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"sourcesContent":["// Copyright 2022 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 { FormControl, FormLabel, FormControlLabelProps, Stack, Box } from '@mui/material';\nimport React from 'react';\nimport { useId } from '../utils';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'>;\n\nexport const OptionsEditorControl = ({ label, control }: OptionsEditorControlProps) => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = useId('EditorSectionControl');\n const controlId = `${generatedControlId}-control`;\n\n const controlProps = {\n id: controlId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <FormLabel htmlFor={controlId}>{label}</FormLabel>\n <Box sx={{ width: '160px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","React","useId","OptionsEditorControl","label","control","generatedControlId","controlId","controlProps","id","direction","alignItems","justifyContent","htmlFor","sx","width","textAlign","cloneElement"],"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,WAAW,EAAEC,SAAS,EAAyBC,KAAK,EAAEC,GAAG,QAAQ,eAAe,CAAC;AAC1F,OAAOC,KAAK,MAAM,OAAO,CAAC;AAC1B,SAASC,KAAK,QAAQ,UAAU,CAAC;AAIjC,OAAO,MAAMC,oBAAoB,GAAG,CAAC,EAAEC,KAAK,CAAA,EAAEC,OAAO,CAAA,EAA6B,GAAK;IACrF,sEAAsE;IACtE,qBAAqB;IACrB,MAAMC,kBAAkB,GAAGJ,KAAK,CAAC,sBAAsB,CAAC,AAAC;IACzD,MAAMK,SAAS,GAAG,CAAC,EAAED,kBAAkB,CAAC,QAAQ,CAAC,AAAC;IAElD,MAAME,YAAY,GAAG;QACnBC,EAAE,EAAEF,SAAS;KACd,AAAC;IAEF,qBACE,KAACV,WAAW;kBACV,cAAA,MAACE,KAAK;YAACW,SAAS,EAAC,KAAK;YAACC,UAAU,EAAC,QAAQ;YAACC,cAAc,EAAC,eAAe;;8BACvE,KAACd,SAAS;oBAACe,OAAO,EAAEN,SAAS;8BAAGH,KAAK;kBAAa;8BAClD,MAACJ,GAAG;oBAACc,EAAE,EAAE;wBAAEC,KAAK,EAAE,OAAO;wBAAEC,SAAS,EAAE,OAAO;qBAAE;;wBAAE,GAAC;sCAACf,KAAK,CAACgB,YAAY,CAACZ,OAAO,EAAEG,YAAY,CAAC;;kBAAO;;UAC7F;MACI,CACd;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.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 { FormControl, FormLabel, FormControlLabelProps, Stack, Box } from '@mui/material';\nimport React from 'react';\nimport { useId } from '../utils';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'>;\n\nexport const OptionsEditorControl = ({ label, control }: OptionsEditorControlProps) => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = useId('EditorSectionControl');\n const controlId = `${generatedControlId}-control`;\n\n const controlProps = {\n id: controlId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <FormLabel htmlFor={controlId}>{label}</FormLabel>\n <Box sx={{ width: '160px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","React","useId","OptionsEditorControl","label","control","generatedControlId","controlId","controlProps","id","direction","alignItems","justifyContent","htmlFor","sx","width","textAlign","cloneElement"],"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,WAAW,EAAEC,SAAS,EAAyBC,KAAK,EAAEC,GAAG,QAAQ,eAAe,CAAC;AAC1F,OAAOC,KAAK,MAAM,OAAO,CAAC;AAC1B,SAASC,KAAK,QAAQ,UAAU,CAAC;AAIjC,OAAO,MAAMC,oBAAoB,GAAG,CAAC,EAAEC,KAAK,CAAA,EAAEC,OAAO,CAAA,EAA6B,GAAK;IACrF,sEAAsE;IACtE,qBAAqB;IACrB,MAAMC,kBAAkB,GAAGJ,KAAK,CAAC,sBAAsB,CAAC,AAAC;IACzD,MAAMK,SAAS,GAAG,CAAC,EAAED,kBAAkB,CAAC,QAAQ,CAAC,AAAC;IAElD,MAAME,YAAY,GAAG;QACnBC,EAAE,EAAEF,SAAS;KACd,AAAC;IAEF,qBACE,KAACV,WAAW;kBACV,cAAA,MAACE,KAAK;YAACW,SAAS,EAAC,KAAK;YAACC,UAAU,EAAC,QAAQ;YAACC,cAAc,EAAC,eAAe;;8BACvE,KAACd,SAAS;oBAACe,OAAO,EAAEN,SAAS;8BAAGH,KAAK;kBAAa;8BAClD,MAACJ,GAAG;oBAACc,EAAE,EAAE;wBAAEC,KAAK,EAAE,OAAO;wBAAEC,SAAS,EAAE,OAAO;qBAAE;;wBAAE,GAAC;sCAACf,KAAK,CAACgB,YAAY,CAACZ,OAAO,EAAEG,YAAY,CAAC;;kBAAO;;UAC7F;MACI,CACd;AACJ,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGrid.tsx"],"sourcesContent":["// Copyright 2022 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 { Grid } from '@mui/material';\n\nexport type OptionsEditorGridProps = {\n /**\n * 1-3 `OptionsEditorColumn` components to render content in columns.\n */\n children: React.ReactNode;\n};\n\n/**\n * Top level grid container used to lay out content for editing in panel\n * options.\n */\nexport const OptionsEditorGrid = ({ children }: OptionsEditorGridProps) => {\n return (\n <Grid container spacing={8}>\n {children}\n </Grid>\n );\n};\n"],"names":["Grid","OptionsEditorGrid","children","container","spacing"],"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,IAAI,QAAQ,eAAe,CAAC;AASrC;;;CAGC,GACD,OAAO,MAAMC,iBAAiB,GAAG,CAAC,EAAEC,QAAQ,CAAA,EAA0B,GAAK;IACzE,qBACE,KAACF,IAAI;QAACG,SAAS;QAACC,OAAO,EAAE,CAAC;kBACvBF,QAAQ;MACJ,CACP;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGrid.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 { Grid } from '@mui/material';\n\nexport type OptionsEditorGridProps = {\n /**\n * 1-3 `OptionsEditorColumn` components to render content in columns.\n */\n children: React.ReactNode;\n};\n\n/**\n * Top level grid container used to lay out content for editing in panel\n * options.\n */\nexport const OptionsEditorGrid = ({ children }: OptionsEditorGridProps) => {\n return (\n <Grid container spacing={8}>\n {children}\n </Grid>\n );\n};\n"],"names":["Grid","OptionsEditorGrid","children","container","spacing"],"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,IAAI,QAAQ,eAAe,CAAC;AASrC;;;CAGC,GACD,OAAO,MAAMC,iBAAiB,GAAG,CAAC,EAAEC,QAAQ,CAAA,EAA0B,GAAK;IACzE,qBACE,KAACF,IAAI;QAACG,SAAS;QAACC,OAAO,EAAE,CAAC;kBACvBF,QAAQ;MACJ,CACP;AACJ,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGroup.tsx"],"sourcesContent":["// Copyright 2022 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, Stack } from '@mui/material';\n\nexport type OptionsEditorGroupProps = {\n /**\n * Text that communicates the purpose of the grouping.\n */\n title: string;\n children: React.ReactNode;\n};\n\n/**\n * Group similar content within panel options.\n */\nexport const OptionsEditorGroup = ({ title, children }: OptionsEditorGroupProps) => {\n return (\n <Box>\n <Typography\n variant=\"overline\"\n component=\"h4\"\n borderBottom={1}\n borderColor=\"grey.300\"\n marginBottom={(theme) => theme.spacing(1)}\n >\n {title}\n </Typography>\n <Stack spacing={1}>{children}</Stack>\n </Box>\n );\n};\n"],"names":["Box","Typography","Stack","OptionsEditorGroup","title","children","variant","component","borderBottom","borderColor","marginBottom","theme","spacing"],"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,EAAEC,KAAK,QAAQ,eAAe,CAAC;AAUvD;;CAEC,GACD,OAAO,MAAMC,kBAAkB,GAAG,CAAC,EAAEC,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAA2B,GAAK;IAClF,qBACE,MAACL,GAAG;;0BACF,KAACC,UAAU;gBACTK,OAAO,EAAC,UAAU;gBAClBC,SAAS,EAAC,IAAI;gBACdC,YAAY,EAAE,CAAC;gBACfC,WAAW,EAAC,UAAU;gBACtBC,YAAY,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;0BAExCR,KAAK;cACK;0BACb,KAACF,KAAK;gBAACU,OAAO,EAAE,CAAC;0BAAGP,QAAQ;cAAS;;MACjC,CACN;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGroup.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, Stack } from '@mui/material';\n\nexport type OptionsEditorGroupProps = {\n /**\n * Text that communicates the purpose of the grouping.\n */\n title: string;\n children: React.ReactNode;\n};\n\n/**\n * Group similar content within panel options.\n */\nexport const OptionsEditorGroup = ({ title, children }: OptionsEditorGroupProps) => {\n return (\n <Box>\n <Typography\n variant=\"overline\"\n component=\"h4\"\n borderBottom={1}\n borderColor=\"grey.300\"\n marginBottom={(theme) => theme.spacing(1)}\n >\n {title}\n </Typography>\n <Stack spacing={1}>{children}</Stack>\n </Box>\n );\n};\n"],"names":["Box","Typography","Stack","OptionsEditorGroup","title","children","variant","component","borderBottom","borderColor","marginBottom","theme","spacing"],"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,EAAEC,KAAK,QAAQ,eAAe,CAAC;AAUvD;;CAEC,GACD,OAAO,MAAMC,kBAAkB,GAAG,CAAC,EAAEC,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAA2B,GAAK;IAClF,qBACE,MAACL,GAAG;;0BACF,KAACC,UAAU;gBACTK,OAAO,EAAC,UAAU;gBAClBC,SAAS,EAAC,IAAI;gBACdC,YAAY,EAAE,CAAC;gBACfC,WAAW,EAAC,UAAU;gBACtBC,YAAY,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;0BAExCR,KAAK;cACK;0BACb,KAACF,KAAK;gBAACU,OAAO,EAAE,CAAC;0BAAGP,QAAQ;cAAS;;MACjC,CACN;AACJ,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/index.ts"],"sourcesContent":["// Copyright 2022 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 './OptionsEditorColumn';\nexport * from './OptionsEditorControl';\nexport * from './OptionsEditorGrid';\nexport * from './OptionsEditorGroup';\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,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/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 './OptionsEditorColumn';\nexport * from './OptionsEditorControl';\nexport * from './OptionsEditorGrid';\nexport * from './OptionsEditorGroup';\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,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StatChart/StatChart.tsx"],"sourcesContent":["// Copyright 2022 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 React, { useMemo } from 'react';\nimport { Box, Typography } from '@mui/material';\nimport { merge } from 'lodash-es';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { GaugeChart as EChartsGaugeChart, GaugeSeriesOption } from 'echarts/charts';\nimport { LineChart as EChartsLineChart, LineSeriesOption } from 'echarts/charts';\nimport { GridComponent, DatasetComponent, TitleComponent, TooltipComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { useChartsTheme } from '../context/ChartsThemeProvider';\nimport { formatValue, UnitOptions } from '../model/units';\nimport { EChart } from '../EChart';\nimport { GraphSeries } from '../model/graph';\n\nuse([\n EChartsGaugeChart,\n EChartsLineChart,\n GridComponent,\n DatasetComponent,\n TitleComponent,\n TooltipComponent,\n CanvasRenderer,\n]);\n\nconst PANEL_PADDING = 32;\nconst MIN_VALUE_SIZE = 12;\nconst MAX_VALUE_SIZE = 36;\n\nexport interface StatChartData {\n calculatedValue?: number;\n seriesData?: GraphSeries;\n name?: string;\n}\n\ninterface StatChartProps {\n width: number;\n height: number;\n data: StatChartData;\n unit: UnitOptions;\n sparkline?: LineSeriesOption;\n}\n\nexport function StatChart(props: StatChartProps) {\n const { width, height, data, unit, sparkline } = props;\n const chartsTheme = useChartsTheme();\n\n const formattedValue = data.calculatedValue === undefined ? '' : formatValue(data.calculatedValue, unit);\n\n const option: EChartsCoreOption = useMemo(() => {\n if (data.seriesData === undefined) return chartsTheme.noDataOption;\n\n const series = data.seriesData;\n\n const statSeries: Array<GaugeSeriesOption | LineSeriesOption> = [];\n\n if (sparkline !== undefined) {\n const lineSeries: LineSeriesOption = {\n type: 'line',\n data: [...series.values],\n zlevel: 1,\n symbol: 'none',\n animation: false,\n silent: true,\n };\n const mergedSeries = merge(lineSeries, sparkline);\n statSeries.push(mergedSeries);\n }\n\n const option = {\n title: {\n show: false,\n },\n grid: {\n show: false,\n top: '35%', // adds space above sparkline\n right: 0,\n bottom: 0,\n left: 0,\n containLabel: false,\n },\n xAxis: {\n type: 'time',\n show: false,\n boundaryGap: false,\n },\n yAxis: {\n type: 'value',\n show: false,\n },\n tooltip: {\n show: false,\n },\n series: statSeries,\n };\n\n return option;\n }, [data, chartsTheme, sparkline]);\n\n const isLargePanel = width > 250 && height > 180;\n // adjusts fontSize depending on number of characters, clamp also used in fontSize attribute\n const charactersAdjust = formattedValue.length;\n const valueSize = isLargePanel === true ? MAX_VALUE_SIZE : Math.min(width, height) / charactersAdjust;\n\n return (\n <Box>\n <Typography\n variant=\"h3\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n fontSize: `clamp(${MIN_VALUE_SIZE}px, ${valueSize}px, ${MAX_VALUE_SIZE}px)`,\n })}\n >\n {formattedValue}\n </Typography>\n {sparkline !== undefined && (\n <EChart\n sx={{\n width: width + PANEL_PADDING, // allows sparkline to extend to edge of panel\n height: height,\n position: 'absolute',\n bottom: 0,\n left: 0,\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n renderer=\"svg\"\n />\n )}\n </Box>\n );\n}\n"],"names":["React","useMemo","Box","Typography","merge","use","GaugeChart","EChartsGaugeChart","LineChart","EChartsLineChart","GridComponent","DatasetComponent","TitleComponent","TooltipComponent","CanvasRenderer","useChartsTheme","formatValue","EChart","PANEL_PADDING","MIN_VALUE_SIZE","MAX_VALUE_SIZE","StatChart","props","width","height","data","unit","sparkline","chartsTheme","formattedValue","calculatedValue","undefined","option","seriesData","noDataOption","series","statSeries","lineSeries","type","values","zlevel","symbol","animation","silent","mergedSeries","push","title","show","grid","top","right","bottom","left","containLabel","xAxis","boundaryGap","yAxis","tooltip","isLargePanel","charactersAdjust","length","valueSize","Math","min","variant","sx","theme","color","palette","text","primary","fontSize","position","echartsTheme","renderer"],"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,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO,CAAC;AACvC,SAASC,GAAG,EAAEC,UAAU,QAAQ,eAAe,CAAC;AAChD,SAASC,KAAK,QAAQ,WAAW,CAAC;AAClC,SAASC,GAAG,QAA2B,cAAc,CAAC;AACtD,SAASC,UAAU,IAAIC,iBAAiB,QAA2B,gBAAgB,CAAC;AACpF,SAASC,SAAS,IAAIC,gBAAgB,QAA0B,gBAAgB,CAAC;AACjF,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,oBAAoB,CAAC;AACvG,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,cAAc,QAAQ,gCAAgC,CAAC;AAChE,SAASC,WAAW,QAAqB,gBAAgB,CAAC;AAC1D,SAASC,MAAM,QAAQ,WAAW,CAAC;AAGnCZ,GAAG,CAAC;IACFE,iBAAiB;IACjBE,gBAAgB;IAChBC,aAAa;IACbC,gBAAgB;IAChBC,cAAc;IACdC,gBAAgB;IAChBC,cAAc;CACf,CAAC,CAAC;AAEH,MAAMI,aAAa,GAAG,EAAE,AAAC;AACzB,MAAMC,cAAc,GAAG,EAAE,AAAC;AAC1B,MAAMC,cAAc,GAAG,EAAE,AAAC;AAgB1B,OAAO,SAASC,SAAS,CAACC,KAAqB,EAAE;IAC/C,MAAM,EAAEC,KAAK,CAA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C,KAAK;cACd,AACH;;MACG,CACN;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../src/StatChart/StatChart.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 React, { useMemo } from 'react';\nimport { Box, Typography } from '@mui/material';\nimport { merge } from 'lodash-es';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { GaugeChart as EChartsGaugeChart, GaugeSeriesOption } from 'echarts/charts';\nimport { LineChart as EChartsLineChart, LineSeriesOption } from 'echarts/charts';\nimport { GridComponent, DatasetComponent, TitleComponent, TooltipComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { useChartsTheme } from '../context/ChartsThemeProvider';\nimport { formatValue, UnitOptions } from '../model/units';\nimport { EChart } from '../EChart';\nimport { GraphSeries } from '../model/graph';\n\nuse([\n EChartsGaugeChart,\n EChartsLineChart,\n GridComponent,\n DatasetComponent,\n TitleComponent,\n TooltipComponent,\n CanvasRenderer,\n]);\n\nconst PANEL_PADDING = 32;\nconst MIN_VALUE_SIZE = 12;\nconst MAX_VALUE_SIZE = 36;\n\nexport interface StatChartData {\n calculatedValue?: number;\n seriesData?: GraphSeries;\n name?: string;\n}\n\ninterface StatChartProps {\n width: number;\n height: number;\n data: StatChartData;\n unit: UnitOptions;\n sparkline?: LineSeriesOption;\n}\n\nexport function StatChart(props: StatChartProps) {\n const { width, height, data, unit, sparkline } = props;\n const chartsTheme = useChartsTheme();\n\n const formattedValue = data.calculatedValue === undefined ? '' : formatValue(data.calculatedValue, unit);\n\n const option: EChartsCoreOption = useMemo(() => {\n if (data.seriesData === undefined) return chartsTheme.noDataOption;\n\n const series = data.seriesData;\n\n const statSeries: Array<GaugeSeriesOption | LineSeriesOption> = [];\n\n if (sparkline !== undefined) {\n const lineSeries: LineSeriesOption = {\n type: 'line',\n data: [...series.values],\n zlevel: 1,\n symbol: 'none',\n animation: false,\n silent: true,\n };\n const mergedSeries = merge(lineSeries, sparkline);\n statSeries.push(mergedSeries);\n }\n\n const option = {\n title: {\n show: false,\n },\n grid: {\n show: false,\n top: '35%', // adds space above sparkline\n right: 0,\n bottom: 0,\n left: 0,\n containLabel: false,\n },\n xAxis: {\n type: 'time',\n show: false,\n boundaryGap: false,\n },\n yAxis: {\n type: 'value',\n show: false,\n },\n tooltip: {\n show: false,\n },\n series: statSeries,\n };\n\n return option;\n }, [data, chartsTheme, sparkline]);\n\n const isLargePanel = width > 250 && height > 180;\n // adjusts fontSize depending on number of characters, clamp also used in fontSize attribute\n const charactersAdjust = formattedValue.length;\n const valueSize = isLargePanel === true ? MAX_VALUE_SIZE : Math.min(width, height) / charactersAdjust;\n\n return (\n <Box>\n <Typography\n variant=\"h3\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n fontSize: `clamp(${MIN_VALUE_SIZE}px, ${valueSize}px, ${MAX_VALUE_SIZE}px)`,\n })}\n >\n {formattedValue}\n </Typography>\n {sparkline !== undefined && (\n <EChart\n sx={{\n width: width + PANEL_PADDING, // allows sparkline to extend to edge of panel\n height: height,\n position: 'absolute',\n bottom: 0,\n left: 0,\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n renderer=\"svg\"\n />\n )}\n </Box>\n );\n}\n"],"names":["React","useMemo","Box","Typography","merge","use","GaugeChart","EChartsGaugeChart","LineChart","EChartsLineChart","GridComponent","DatasetComponent","TitleComponent","TooltipComponent","CanvasRenderer","useChartsTheme","formatValue","EChart","PANEL_PADDING","MIN_VALUE_SIZE","MAX_VALUE_SIZE","StatChart","props","width","height","data","unit","sparkline","chartsTheme","formattedValue","calculatedValue","undefined","option","seriesData","noDataOption","series","statSeries","lineSeries","type","values","zlevel","symbol","animation","silent","mergedSeries","push","title","show","grid","top","right","bottom","left","containLabel","xAxis","boundaryGap","yAxis","tooltip","isLargePanel","charactersAdjust","length","valueSize","Math","min","variant","sx","theme","color","palette","text","primary","fontSize","position","echartsTheme","renderer"],"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,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO,CAAC;AACvC,SAASC,GAAG,EAAEC,UAAU,QAAQ,eAAe,CAAC;AAChD,SAASC,KAAK,QAAQ,WAAW,CAAC;AAClC,SAASC,GAAG,QAA2B,cAAc,CAAC;AACtD,SAASC,UAAU,IAAIC,iBAAiB,QAA2B,gBAAgB,CAAC;AACpF,SAASC,SAAS,IAAIC,gBAAgB,QAA0B,gBAAgB,CAAC;AACjF,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,oBAAoB,CAAC;AACvG,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,cAAc,QAAQ,gCAAgC,CAAC;AAChE,SAASC,WAAW,QAAqB,gBAAgB,CAAC;AAC1D,SAASC,MAAM,QAAQ,WAAW,CAAC;AAGnCZ,GAAG,CAAC;IACFE,iBAAiB;IACjBE,gBAAgB;IAChBC,aAAa;IACbC,gBAAgB;IAChBC,cAAc;IACdC,gBAAgB;IAChBC,cAAc;CACf,CAAC,CAAC;AAEH,MAAMI,aAAa,GAAG,EAAE,AAAC;AACzB,MAAMC,cAAc,GAAG,EAAE,AAAC;AAC1B,MAAMC,cAAc,GAAG,EAAE,AAAC;AAgB1B,OAAO,SAASC,SAAS,CAACC,KAAqB,EAAE;IAC/C,MAAM,EAAEC,KAAK,CAAA,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KAAK;cACd,AACH;;MACG,CACN;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StatChart/StatChart.test.tsx"],"sourcesContent":["// Copyright 2022 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 { render, screen } from '@testing-library/react';\nimport { ChartsThemeProvider } from '../context/ChartsThemeProvider';\nimport { UnitOptions } from '../model';\nimport { testChartsTheme } from '../test-utils';\nimport { StatChart, StatChartData } from './StatChart';\n\ndescribe('StatChart', () => {\n const renderChart = (unit: UnitOptions) => {\n const contentDimensions = {\n width: 200,\n height: 200,\n };\n render(\n <ChartsThemeProvider chartsTheme={testChartsTheme}>\n <StatChart width={contentDimensions.width} height={contentDimensions.height} data={mockStatData} unit={unit} />\n </ChartsThemeProvider>\n );\n };\n\n const mockStatData: StatChartData = {\n calculatedValue: 7.72931659687181,\n name: 'Example Stat Chart',\n seriesData: {\n name: '(((count(count(node_cpu_seconds_total{job=\"example\"}) by (cpu))',\n values: [\n [1654006170000, 7.736401673473903],\n [1654006185000, 7.733891213538757],\n [1654006200000, 7.731101813010433],\n [1654006215000, 7.722454672079215],\n [1654006230000, 7.722733612256738],\n ],\n },\n };\n\n it('render default options (no sparkline)', () => {\n const unit: UnitOptions = {\n kind: 'Decimal',\n decimal_places: 2,\n };\n renderChart(unit);\n expect(screen.getByText('7.73')).toBeInTheDocument();\n });\n\n it('show value with bytes unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Bytes',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 bytes')).toBeInTheDocument();\n });\n\n it('show value with seconds time unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Seconds',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 seconds')).toBeInTheDocument();\n });\n\n it('show value with months time unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Months',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 months')).toBeInTheDocument();\n });\n});\n"],"names":["render","screen","ChartsThemeProvider","testChartsTheme","StatChart","describe","renderChart","unit","contentDimensions","width","height","chartsTheme","data","mockStatData","calculatedValue","name","seriesData","values","it","kind","decimal_places","expect","getByText","toBeInTheDocument"],"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,MAAM,EAAEC,MAAM,QAAQ,wBAAwB,CAAC;AACxD,SAASC,mBAAmB,QAAQ,gCAAgC,CAAC;AAErE,SAASC,eAAe,QAAQ,eAAe,CAAC;AAChD,SAASC,SAAS,QAAuB,aAAa,CAAC;AAEvDC,QAAQ,CAAC,WAAW,EAAE,IAAM;IAC1B,MAAMC,WAAW,GAAG,CAACC,IAAiB,GAAK;QACzC,MAAMC,iBAAiB,GAAG;YACxBC,KAAK,EAAE,GAAG;YACVC,MAAM,EAAE,GAAG;SACZ,AAAC;QACFV,MAAM,eACJ,KAACE,mBAAmB;YAACS,WAAW,EAAER,eAAe;sBAC/C,cAAA,KAACC,SAAS;gBAACK,KAAK,EAAED,iBAAiB,CAACC,KAAK;gBAAEC,MAAM,EAAEF,iBAAiB,CAACE,MAAM;gBAAEE,IAAI,EAAEC,YAAY;gBAAEN,IAAI,EAAEA,IAAI;cA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C,EAAE,IAAM;QACtD,MAAMX,IAAI,GAAgB;YACxBY,IAAI,EAAE,QAAQ;SACf,AAAC;QACFb,WAAW,CAACC,IAAI,CAAC,CAAC;QAClBc,MAAM,CAACpB,MAAM,CAACqB,SAAS,CAAC,aAAa,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/StatChart/StatChart.test.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 { render, screen } from '@testing-library/react';\nimport { ChartsThemeProvider } from '../context/ChartsThemeProvider';\nimport { UnitOptions } from '../model';\nimport { testChartsTheme } from '../test-utils';\nimport { StatChart, StatChartData } from './StatChart';\n\ndescribe('StatChart', () => {\n const renderChart = (unit: UnitOptions) => {\n const contentDimensions = {\n width: 200,\n height: 200,\n };\n render(\n <ChartsThemeProvider chartsTheme={testChartsTheme}>\n <StatChart width={contentDimensions.width} height={contentDimensions.height} data={mockStatData} unit={unit} />\n </ChartsThemeProvider>\n );\n };\n\n const mockStatData: StatChartData = {\n calculatedValue: 7.72931659687181,\n name: 'Example Stat Chart',\n seriesData: {\n name: '(((count(count(node_cpu_seconds_total{job=\"example\"}) by (cpu))',\n values: [\n [1654006170000, 7.736401673473903],\n [1654006185000, 7.733891213538757],\n [1654006200000, 7.731101813010433],\n [1654006215000, 7.722454672079215],\n [1654006230000, 7.722733612256738],\n ],\n },\n };\n\n it('render default options (no sparkline)', () => {\n const unit: UnitOptions = {\n kind: 'Decimal',\n decimal_places: 2,\n };\n renderChart(unit);\n expect(screen.getByText('7.73')).toBeInTheDocument();\n });\n\n it('show value with bytes unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Bytes',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 bytes')).toBeInTheDocument();\n });\n\n it('show value with seconds time unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Seconds',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 seconds')).toBeInTheDocument();\n });\n\n it('show value with months time unit formatting', () => {\n const unit: UnitOptions = {\n kind: 'Months',\n };\n renderChart(unit);\n expect(screen.getByText('7.73 months')).toBeInTheDocument();\n });\n});\n"],"names":["render","screen","ChartsThemeProvider","testChartsTheme","StatChart","describe","renderChart","unit","contentDimensions","width","height","chartsTheme","data","mockStatData","calculatedValue","name","seriesData","values","it","kind","decimal_places","expect","getByText","toBeInTheDocument"],"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,MAAM,EAAEC,MAAM,QAAQ,wBAAwB,CAAC;AACxD,SAASC,mBAAmB,QAAQ,gCAAgC,CAAC;AAErE,SAASC,eAAe,QAAQ,eAAe,CAAC;AAChD,SAASC,SAAS,QAAuB,aAAa,CAAC;AAEvDC,QAAQ,CAAC,WAAW,EAAE,IAAM;IAC1B,MAAMC,WAAW,GAAG,CAACC,IAAiB,GAAK;QACzC,MAAMC,iBAAiB,GAAG;YACxBC,KAAK,EAAE,GAAG;YACVC,MAAM,EAAE,GAAG;SACZ,AAAC;QACFV,MAAM,eACJ,KAACE,mBAAmB;YAACS,WAAW,EAAER,eAAe;sBAC/C,cAAA,KAACC,SAAS;gBAACK,KAAK,EAAED,iBAAiB,CAACC,KAAK;gBAAEC,MAAM,EAAEF,iBAAiB,CAACE,MAAM;gBAAEE,IA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/D,CAAC,CAAC,CAAC;IAEHL,EAAE,CAAC,6CAA6C,EAAE,IAAM;QACtD,MAAMX,IAAI,GAAgB;YACxBY,IAAI,EAAE,QAAQ;SACf,AAAC;QACFb,WAAW,CAACC,IAAI,CAAC,CAAC;QAClBc,MAAM,CAACpB,MAAM,CAACqB,SAAS,CAAC,aAAa,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StatChart/index.ts"],"sourcesContent":["// Copyright 2022 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 './StatChart';\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,aAAa,CAAC"}
1
+ {"version":3,"sources":["../../src/StatChart/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 './StatChart';\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,aAAa,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- interface SeriesInfoProps {
2
+ export interface SeriesInfoProps {
3
3
  seriesName: string;
4
4
  y: number;
5
5
  formattedY: string;
@@ -8,5 +8,4 @@ interface SeriesInfoProps {
8
8
  wrapLabels?: boolean;
9
9
  }
10
10
  export declare function SeriesInfo(props: SeriesInfoProps): JSX.Element;
11
- export {};
12
11
  //# sourceMappingURL=SeriesInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeriesInfo.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesInfo.tsx"],"names":[],"mappings":";AAkBA,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,eAuEhD"}
@@ -0,0 +1,89 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Box } from '@mui/material';
15
+ import { SeriesMarker } from './SeriesMarker';
16
+ import { SeriesLabelsStack } from './SeriesLabelsStack';
17
+ import { TOOLTIP_LABELS_MAX_WIDTH } from './tooltip-model';
18
+ export function SeriesInfo(props) {
19
+ const { seriesName , formattedY , markerColor , totalSeries , wrapLabels } = props;
20
+ // metric __name__ comes before opening curly brace, ignore if not populated
21
+ // ex with metric name: node_load15{env="demo",job="node"}
22
+ // ex without metric name: {env="demo",job="node"}
23
+ const splitName = seriesName.split('{');
24
+ var ref;
25
+ const seriesLabels = (ref = splitName[1]) !== null && ref !== void 0 ? ref : seriesName;
26
+ // remove curly braces that wrap labels
27
+ const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');
28
+ // determine whether to show labels on separate lines
29
+ const splitLabels = formattedSeriesLabels.split(',');
30
+ if (totalSeries === 1 && splitLabels.length > 1) {
31
+ const metricName = splitName[0] ? `${splitName[0]}:` : 'value:';
32
+ return /*#__PURE__*/ _jsx(SeriesLabelsStack, {
33
+ formattedY: formattedY,
34
+ metricName: metricName,
35
+ metricLabels: splitLabels,
36
+ markerColor: markerColor
37
+ });
38
+ }
39
+ // add space after commas when more than one focused series
40
+ const inlineSeriesLabels = formattedSeriesLabels.replace(/[,]/g, ', ');
41
+ return /*#__PURE__*/ _jsxs(Box, {
42
+ sx: {
43
+ display: 'table-row',
44
+ paddingTop: 0.5
45
+ },
46
+ children: [
47
+ /*#__PURE__*/ _jsxs(Box, {
48
+ sx: {
49
+ display: 'table-cell',
50
+ maxWidth: '520px'
51
+ },
52
+ children: [
53
+ /*#__PURE__*/ _jsx(SeriesMarker, {
54
+ markerColor: markerColor,
55
+ sx: {
56
+ marginTop: 0.5
57
+ }
58
+ }),
59
+ /*#__PURE__*/ _jsx(Box, {
60
+ component: "span",
61
+ sx: (theme)=>({
62
+ display: 'inline-block',
63
+ width: 'calc(100% - 20px)',
64
+ minWidth: 150,
65
+ maxWidth: TOOLTIP_LABELS_MAX_WIDTH,
66
+ overflow: 'hidden',
67
+ color: theme.palette.common.white,
68
+ textOverflow: 'ellipsis',
69
+ whiteSpace: wrapLabels ? 'normal' : 'nowrap'
70
+ }),
71
+ children: inlineSeriesLabels
72
+ })
73
+ ]
74
+ }),
75
+ /*#__PURE__*/ _jsx(Box, {
76
+ sx: {
77
+ display: 'table-cell',
78
+ paddingLeft: 1.5,
79
+ textAlign: 'right',
80
+ verticalAlign: 'top',
81
+ fontWeight: '700'
82
+ },
83
+ children: formattedY
84
+ })
85
+ ]
86
+ });
87
+ }
88
+
89
+ //# sourceMappingURL=SeriesInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesInfo.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 } from '@mui/material';\nimport { SeriesMarker } from './SeriesMarker';\nimport { SeriesLabelsStack } from './SeriesLabelsStack';\nimport { TOOLTIP_LABELS_MAX_WIDTH } from './tooltip-model';\n\nexport interface SeriesInfoProps {\n seriesName: string;\n y: number;\n formattedY: string;\n markerColor: string;\n totalSeries: number;\n wrapLabels?: boolean;\n}\n\nexport function SeriesInfo(props: SeriesInfoProps) {\n const { seriesName, formattedY, markerColor, totalSeries, wrapLabels } = props;\n\n // metric __name__ comes before opening curly brace, ignore if not populated\n // ex with metric name: node_load15{env=\"demo\",job=\"node\"}\n // ex without metric name: {env=\"demo\",job=\"node\"}\n const splitName = seriesName.split('{');\n const seriesLabels = splitName[1] ?? seriesName;\n\n // remove curly braces that wrap labels\n const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');\n\n // determine whether to show labels on separate lines\n const splitLabels = formattedSeriesLabels.split(',');\n if (totalSeries === 1 && splitLabels.length > 1) {\n const metricName = splitName[0] ? `${splitName[0]}:` : 'value:';\n return (\n <SeriesLabelsStack\n formattedY={formattedY}\n metricName={metricName}\n metricLabels={splitLabels}\n markerColor={markerColor}\n />\n );\n }\n\n // add space after commas when more than one focused series\n const inlineSeriesLabels = formattedSeriesLabels.replace(/[,]/g, ', ');\n return (\n <Box\n sx={{\n display: 'table-row',\n paddingTop: 0.5,\n }}\n >\n <Box\n sx={{\n display: 'table-cell',\n maxWidth: '520px',\n }}\n >\n <SeriesMarker markerColor={markerColor} sx={{ marginTop: 0.5 }} />\n <Box\n component=\"span\"\n sx={(theme) => ({\n display: 'inline-block',\n width: 'calc(100% - 20px)',\n minWidth: 150,\n maxWidth: TOOLTIP_LABELS_MAX_WIDTH,\n overflow: 'hidden',\n color: theme.palette.common.white,\n textOverflow: 'ellipsis',\n whiteSpace: wrapLabels ? 'normal' : 'nowrap',\n })}\n >\n {inlineSeriesLabels}\n </Box>\n </Box>\n <Box\n sx={{\n display: 'table-cell',\n paddingLeft: 1.5,\n textAlign: 'right',\n verticalAlign: 'top',\n fontWeight: '700',\n }}\n >\n {formattedY}\n </Box>\n </Box>\n );\n}\n"],"names":["Box","SeriesMarker","SeriesLabelsStack","TOOLTIP_LABELS_MAX_WIDTH","SeriesInfo","props","seriesName","formattedY","markerColor","totalSeries","wrapLabels","splitName","split","seriesLabels","formattedSeriesLabels","replace","splitLabels","length","metricName","metricLabels","inlineSeriesLabels","sx","display","paddingTop","maxWidth","marginTop","component","theme","width","minWidth","overflow","color","palette","common","white","textOverflow","whiteSpace","paddingLeft","textAlign","verticalAlign","fontWeight"],"mappings":"AAAA,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ourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesInfo.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
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 { render } from '@testing-library/react';
15
+ import { screen } from '@testing-library/dom';
16
+ import { SeriesInfo } from './SeriesInfo';
17
+ describe('SeriesInfo', ()=>{
18
+ const renderComponent = (props)=>{
19
+ render(/*#__PURE__*/ _jsx(SeriesInfo, {
20
+ ...props
21
+ }));
22
+ };
23
+ it('render metric __name__ beside formattedY value', ()=>{
24
+ const seriesInfo = {
25
+ seriesName: 'node_load1{env="demo",instance="demo.do.prometheus.io:9100",job="node"}',
26
+ y: 0.28,
27
+ formattedY: '28.0%',
28
+ markerColor: 'hsla(1016196180,50%,50%,0.8)',
29
+ totalSeries: 1,
30
+ wrapLabels: true
31
+ };
32
+ renderComponent(seriesInfo);
33
+ expect(screen.getByText('node_load1:')).toBeInTheDocument();
34
+ expect(screen.getByText('28.0%')).toBeInTheDocument();
35
+ expect(screen.getByText('demo.do.prometheus.io:9100')).toBeInTheDocument(); // TODO: remove quotes
36
+ });
37
+ it('render preformatted series name beside formattedY value', ()=>{
38
+ const seriesInfo = {
39
+ seriesName: 'Node memory total',
40
+ y: 552341504,
41
+ formattedY: '526.75 MB',
42
+ markerColor: 'hsla(-1756459732,50%,50%,0.8)',
43
+ totalSeries: 2,
44
+ wrapLabels: true
45
+ };
46
+ renderComponent(seriesInfo);
47
+ expect(screen.getByText('Node memory total')).toBeInTheDocument();
48
+ expect(screen.getByText('526.75 MB')).toBeInTheDocument();
49
+ });
50
+ });
51
+
52
+ //# sourceMappingURL=SeriesInfo.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesInfo.test.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 { render } from '@testing-library/react';\nimport { screen } from '@testing-library/dom';\nimport { SeriesInfo, SeriesInfoProps } from './SeriesInfo';\n\ndescribe('SeriesInfo', () => {\n const renderComponent = (props: SeriesInfoProps) => {\n render(<SeriesInfo {...props} />);\n };\n\n it('render metric __name__ beside formattedY value', () => {\n const seriesInfo: SeriesInfoProps = {\n seriesName: 'node_load1{env=\"demo\",instance=\"demo.do.prometheus.io:9100\",job=\"node\"}',\n y: 0.28,\n formattedY: '28.0%',\n markerColor: 'hsla(1016196180,50%,50%,0.8)',\n totalSeries: 1,\n wrapLabels: true,\n };\n renderComponent(seriesInfo);\n expect(screen.getByText('node_load1:')).toBeInTheDocument();\n expect(screen.getByText('28.0%')).toBeInTheDocument();\n expect(screen.getByText('demo.do.prometheus.io:9100')).toBeInTheDocument(); // TODO: remove quotes\n });\n\n it('render preformatted series name beside formattedY value', () => {\n const seriesInfo: SeriesInfoProps = {\n seriesName: 'Node memory total',\n y: 552341504,\n formattedY: '526.75 MB',\n markerColor: 'hsla(-1756459732,50%,50%,0.8)',\n totalSeries: 2,\n wrapLabels: true,\n };\n renderComponent(seriesInfo);\n expect(screen.getByText('Node memory total')).toBeInTheDocument();\n expect(screen.getByText('526.75 MB')).toBeInTheDocument();\n });\n});\n"],"names":["render","screen","SeriesInfo","describe","renderComponent","props","it","seriesInfo","seriesName","y","formattedY","markerColor","totalSeries","wrapLabels","expect","getByText","toBeInTheDocument"],"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,MAAM,QAAQ,wBAAwB,CAAC;AAChD,SAASC,MAAM,QAAQ,sBAAsB,CAAC;AAC9C,SAASC,UAAU,QAAyB,cAAc,CAAC;AAE3DC,QAAQ,CAAC,YAAY,EAAE,IAAM;IAC3B,MAAMC,eAAe,GAAG,CAACC,KAAsB,GAAK;QAClDL,MAAM,eAAC,KAACE,UAAU;YAAE,GAAGG,KAAK;UAAI,CAAC,CAAC;IACpC,CAAC,AAAC;IAEFC,EAAE,CAAC,gDAAgD,EAAE,IAAM;QACzD,MAAMC,UAAU,GAAoB;YAClCC,UAAU,EAAE,yEAAyE;YACrFC,CAAC,EAAE,IAAI;YACPC,UAAU,EAAE,OAAO;YACnBC,WAAW,EAAE,8BAA8B;YAC3CC,WAAW,EAAE,CAAC;YACdC,UAAU,EAAE,IAAI;SACjB,AAAC;QACFT,eAAe,CAACG,UAAU,CAAC,CAAC;QAC5BO,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,aAAa,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;QAC5DF,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,OAAO,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;QACtDF,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,4BAA4B,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC,CAAC,sBAAsB;IACpG,CAAC,CAAC,CAAC;IAEHV,EAAE,CAAC,yDAAyD,EAAE,IAAM;QAClE,MAAMC,UAAU,GAAoB;YAClCC,UAAU,EAAE,mBAAmB;YAC/BC,CAAC,EAAE,SAAS;YACZC,UAAU,EAAE,WAAW;YACvBC,WAAW,EAAE,+BAA+B;YAC5CC,WAAW,EAAE,CAAC;YACdC,UAAU,EAAE,IAAI;SACjB,AAAC;QACFT,eAAe,CAACG,UAAU,CAAC,CAAC;QAC5BO,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;QAClEF,MAAM,CAACb,MAAM,CAACc,SAAS,CAAC,WAAW,CAAC,CAAC,CAACC,iBAAiB,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export interface SeriesLabelsStackProps {
3
+ formattedY: string;
4
+ metricName: string;
5
+ metricLabels: string[];
6
+ markerColor: string;
7
+ }
8
+ export declare function SeriesLabelsStack(props: SeriesLabelsStackProps): JSX.Element;
9
+ //# sourceMappingURL=SeriesLabelsStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeriesLabelsStack.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesLabelsStack.tsx"],"names":[],"mappings":";AAgBA,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAiE9D"}
@@ -0,0 +1,99 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Box, Divider, Stack, Typography } from '@mui/material';
15
+ import { SeriesMarker } from './SeriesMarker';
16
+ export function SeriesLabelsStack(props) {
17
+ const { formattedY , markerColor , metricName , metricLabels } = props;
18
+ return /*#__PURE__*/ _jsxs(Stack, {
19
+ spacing: 0.5,
20
+ children: [
21
+ /*#__PURE__*/ _jsxs(Box, {
22
+ sx: (theme)=>({
23
+ display: 'flex',
24
+ height: '16px',
25
+ flexDirection: 'row',
26
+ alignItems: 'center',
27
+ justifyContent: 'left',
28
+ color: theme.palette.common.white,
29
+ fontSize: '11px'
30
+ }),
31
+ children: [
32
+ /*#__PURE__*/ _jsx(SeriesMarker, {
33
+ markerColor: markerColor,
34
+ sx: {
35
+ marginTop: 0.25
36
+ }
37
+ }),
38
+ /*#__PURE__*/ _jsxs(Box, {
39
+ component: "span",
40
+ children: [
41
+ metricName,
42
+ /*#__PURE__*/ _jsx(Box, {
43
+ component: "span",
44
+ sx: (theme)=>({
45
+ color: theme.palette.common.white,
46
+ fontWeight: 700,
47
+ paddingLeft: '2px'
48
+ }),
49
+ children: formattedY
50
+ })
51
+ ]
52
+ })
53
+ ]
54
+ }),
55
+ /*#__PURE__*/ _jsx(Divider, {
56
+ sx: (theme)=>({
57
+ borderColor: theme.palette.grey['500']
58
+ })
59
+ }),
60
+ /*#__PURE__*/ _jsx(Box, {
61
+ sx: (theme)=>({
62
+ color: theme.palette.common.white
63
+ }),
64
+ children: metricLabels.map((label)=>{
65
+ // show labels on separate lines when many labels and only one focused series
66
+ if (label) {
67
+ const [name, value] = label.split('=');
68
+ const formattedName = value !== undefined ? `${name}: ` : name;
69
+ const formattedValue = value !== undefined ? value.replace(/(^"|"$)/g, '') : value;
70
+ return /*#__PURE__*/ _jsxs(Box, {
71
+ sx: {
72
+ display: 'flex',
73
+ gap: '4px'
74
+ },
75
+ children: [
76
+ /*#__PURE__*/ _jsx(Typography, {
77
+ sx: {
78
+ fontSize: '11px'
79
+ },
80
+ children: formattedName
81
+ }),
82
+ /*#__PURE__*/ _jsx(Typography, {
83
+ sx: (theme)=>({
84
+ color: theme.palette.common.white,
85
+ fontWeight: 700,
86
+ fontSize: '11px'
87
+ }),
88
+ children: formattedValue
89
+ })
90
+ ]
91
+ }, label);
92
+ }
93
+ })
94
+ })
95
+ ]
96
+ });
97
+ }
98
+
99
+ //# sourceMappingURL=SeriesLabelsStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesLabelsStack.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, Divider, Stack, Typography } from '@mui/material';\nimport { SeriesMarker } from './SeriesMarker';\n\nexport interface SeriesLabelsStackProps {\n formattedY: string;\n metricName: string;\n metricLabels: string[];\n markerColor: string;\n}\n\nexport function SeriesLabelsStack(props: SeriesLabelsStackProps) {\n const { formattedY, markerColor, metricName, metricLabels } = props;\n return (\n <Stack spacing={0.5}>\n <Box\n sx={(theme) => ({\n display: 'flex',\n height: '16px',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'left',\n color: theme.palette.common.white,\n fontSize: '11px',\n })}\n >\n <SeriesMarker markerColor={markerColor} sx={{ marginTop: 0.25 }} />\n <Box component=\"span\">\n {metricName}\n <Box\n component=\"span\"\n sx={(theme) => ({\n color: theme.palette.common.white,\n fontWeight: 700,\n paddingLeft: '2px',\n })}\n >\n {formattedY}\n </Box>\n </Box>\n </Box>\n <Divider\n sx={(theme) => ({\n borderColor: theme.palette.grey['500'],\n })}\n />\n <Box\n sx={(theme) => ({\n color: theme.palette.common.white,\n })}\n >\n {metricLabels.map((label) => {\n // show labels on separate lines when many labels and only one focused series\n if (label) {\n const [name, value] = label.split('=');\n const formattedName = value !== undefined ? `${name}: ` : name;\n const formattedValue = value !== undefined ? value.replace(/(^\"|\"$)/g, '') : value;\n return (\n <Box key={label} sx={{ display: 'flex', gap: '4px' }}>\n <Typography sx={{ fontSize: '11px' }}>{formattedName}</Typography>\n <Typography\n sx={(theme) => ({\n color: theme.palette.common.white,\n fontWeight: 700,\n fontSize: '11px',\n })}\n >\n {formattedValue}\n </Typography>\n </Box>\n );\n }\n })}\n </Box>\n </Stack>\n );\n}\n"],"names":["Box","Divider","Stack","Typography","SeriesMarker","SeriesLabelsStack","props","formattedY","markerColor","metricName","metricLabels","spacing","sx","theme","display","height","flexDirection","alignItems","justifyContent","color","palette","common","white","fontSize","marginTop","component","fontWeight","paddingLeft","borderColor","grey","map","label","name","value","split","formattedName","undefined","formattedValue","replace","gap"],"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,OAAO,EAAEC,KAAK,EAAEC,UAAU,QAAQ,eAAe,CAAC;AAChE,SAASC,YAAY,QAAQ,gBAAgB,CAAC;AAS9C,OAAO,SAASC,iBAAiB,CAACC,KAA6B,EAAE;IAC/D,MAAM,EAAEC,UAAU,CAAA,EAAEC,WAAW,CAAA,EAAEC,UAAU,CAAA,EAAEC,YAAY,CAAA,EAAE,GAAGJ,KAAK,AAAC;IACpE,qBACE,MAACJ,KAAK;QAACS,OAAO,EAAE,GAAG;;0BAC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,aAAa,GAAGF,KAAK,KAAKG,SAAS,GAAG,CAAC,EAAEJ,IAAI,CAAC,EAAE,CAAC,GAAGA,IAAI,AAAC;wBAC/D,MAAMK,cAAc,GAAGJ,KAAK,KAAKG,SAAS,GAAGH,KAAK,CAACK,OAAO,aAAa,EAAE,CAAC,GAAGL,KAAK,AAAC;wBACnF,qBACE,MAACjC,GAAG;4BAAaY,EAAE,EAAE;gCAAEE,OAAO,EAAE,MAAM;gCAAEyB,GAAG,EAAE,KAAK;6BAAE;;8CAClD,KAACpC,UAAU;oCAACS,EAAE,EAAE;wCAAEW,QAAQ,EAAE,MAAM;qCAAE;8CAAGY,aAAa;kCAAc;8CAClE,KAAChC,UAAU;oCACTS,EAAE,EAAE,CAACC,KAAK,GAAM,CAAA;4CACdM,KAAK,EAAEN,KAAK,CAACO,OAAO,CAACC,MAAM,CAACC,KAAK;4CACjCI,UAAU,EAAE,GAAG;4CACfH,QAAQ,EAAE,MAAM;yCACjB,CAAA,AAAC;8CAEDc,cAAc;kCACJ;;2BAVLN,KAAK,CAWT,CACN;oBACJ,CAAC;gBACH,CAAC,CAAC;cACE;;MACA,CACR;AACJ,CAAC"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- interface SeriesMarkerProps {
2
+ import { BoxProps } from '@mui/material';
3
+ interface SeriesMarkerProps extends BoxProps<'div'> {
3
4
  markerColor: string;
4
5
  }
5
6
  export declare function SeriesMarker(props: SeriesMarkerProps): JSX.Element;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SeriesMarker.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesMarker.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,UAAU,iBAAkB,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAkBpD"}