@perses-dev/components 0.51.0-rc.0 → 0.51.0-rc.1

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 (146) hide show
  1. package/README.md +1 -8
  2. package/dist/EChart/EChart.d.ts.map +1 -1
  3. package/dist/EChart/EChart.js +13 -4
  4. package/dist/EChart/EChart.js.map +1 -1
  5. package/dist/TimeSeriesTooltip/index.d.ts +0 -1
  6. package/dist/TimeSeriesTooltip/index.d.ts.map +1 -1
  7. package/dist/TimeSeriesTooltip/index.js +0 -1
  8. package/dist/TimeSeriesTooltip/index.js.map +1 -1
  9. package/dist/cjs/EChart/EChart.js +11 -2
  10. package/dist/cjs/TimeSeriesTooltip/index.js +0 -1
  11. package/dist/cjs/context/ChartsProvider.js +3 -1
  12. package/dist/cjs/index.js +0 -7
  13. package/dist/cjs/test-utils/theme.js +1 -0
  14. package/dist/cjs/utils/axis.js +3 -18
  15. package/dist/cjs/utils/format.js +0 -21
  16. package/dist/context/ChartsProvider.d.ts +2 -0
  17. package/dist/context/ChartsProvider.d.ts.map +1 -1
  18. package/dist/context/ChartsProvider.js +3 -1
  19. package/dist/context/ChartsProvider.js.map +1 -1
  20. package/dist/index.d.ts +0 -7
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +0 -7
  23. package/dist/index.js.map +1 -1
  24. package/dist/model/graph.d.ts +0 -1
  25. package/dist/model/graph.d.ts.map +1 -1
  26. package/dist/model/graph.js.map +1 -1
  27. package/dist/test-utils/theme.d.ts.map +1 -1
  28. package/dist/test-utils/theme.js +1 -0
  29. package/dist/test-utils/theme.js.map +1 -1
  30. package/dist/utils/axis.d.ts +0 -4
  31. package/dist/utils/axis.d.ts.map +1 -1
  32. package/dist/utils/axis.js +0 -9
  33. package/dist/utils/axis.js.map +1 -1
  34. package/dist/utils/chart-actions.d.ts +0 -2
  35. package/dist/utils/chart-actions.d.ts.map +1 -1
  36. package/dist/utils/chart-actions.js.map +1 -1
  37. package/dist/utils/format.d.ts +0 -1
  38. package/dist/utils/format.d.ts.map +1 -1
  39. package/dist/utils/format.js +0 -20
  40. package/dist/utils/format.js.map +1 -1
  41. package/package.json +2 -7
  42. package/dist/BarChart/BarChart.d.ts +0 -16
  43. package/dist/BarChart/BarChart.d.ts.map +0 -1
  44. package/dist/BarChart/BarChart.js +0 -134
  45. package/dist/BarChart/BarChart.js.map +0 -1
  46. package/dist/BarChart/index.d.ts +0 -2
  47. package/dist/BarChart/index.d.ts.map +0 -1
  48. package/dist/BarChart/index.js +0 -15
  49. package/dist/BarChart/index.js.map +0 -1
  50. package/dist/GaugeChart/GaugeChart.d.ts +0 -23
  51. package/dist/GaugeChart/GaugeChart.d.ts.map +0 -1
  52. package/dist/GaugeChart/GaugeChart.js +0 -214
  53. package/dist/GaugeChart/GaugeChart.js.map +0 -1
  54. package/dist/GaugeChart/index.d.ts +0 -2
  55. package/dist/GaugeChart/index.d.ts.map +0 -1
  56. package/dist/GaugeChart/index.js +0 -15
  57. package/dist/GaugeChart/index.js.map +0 -1
  58. package/dist/LineChart/LineChart.d.ts +0 -22
  59. package/dist/LineChart/LineChart.d.ts.map +0 -1
  60. package/dist/LineChart/LineChart.js +0 -266
  61. package/dist/LineChart/LineChart.js.map +0 -1
  62. package/dist/LineChart/index.d.ts +0 -2
  63. package/dist/LineChart/index.d.ts.map +0 -1
  64. package/dist/LineChart/index.js +0 -15
  65. package/dist/LineChart/index.js.map +0 -1
  66. package/dist/PieChart/PieChart.d.ts +0 -14
  67. package/dist/PieChart/PieChart.d.ts.map +0 -1
  68. package/dist/PieChart/PieChart.js +0 -92
  69. package/dist/PieChart/PieChart.js.map +0 -1
  70. package/dist/PieChart/index.d.ts +0 -2
  71. package/dist/PieChart/index.d.ts.map +0 -1
  72. package/dist/PieChart/index.js +0 -15
  73. package/dist/PieChart/index.js.map +0 -1
  74. package/dist/StatChart/StatChart.d.ts +0 -21
  75. package/dist/StatChart/StatChart.d.ts.map +0 -1
  76. package/dist/StatChart/StatChart.js +0 -189
  77. package/dist/StatChart/StatChart.js.map +0 -1
  78. package/dist/StatChart/calculateFontSize.d.ts +0 -16
  79. package/dist/StatChart/calculateFontSize.d.ts.map +0 -1
  80. package/dist/StatChart/calculateFontSize.js +0 -49
  81. package/dist/StatChart/calculateFontSize.js.map +0 -1
  82. package/dist/StatChart/index.d.ts +0 -2
  83. package/dist/StatChart/index.d.ts.map +0 -1
  84. package/dist/StatChart/index.js +0 -15
  85. package/dist/StatChart/index.js.map +0 -1
  86. package/dist/StatChart/utils/formatStatChartValue.d.ts +0 -3
  87. package/dist/StatChart/utils/formatStatChartValue.d.ts.map +0 -1
  88. package/dist/StatChart/utils/formatStatChartValue.js +0 -26
  89. package/dist/StatChart/utils/formatStatChartValue.js.map +0 -1
  90. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts +0 -27
  91. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts.map +0 -1
  92. package/dist/StatusHistoryChart/StatusHistoryChart.js +0 -132
  93. package/dist/StatusHistoryChart/StatusHistoryChart.js.map +0 -1
  94. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts +0 -13
  95. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts.map +0 -1
  96. package/dist/StatusHistoryChart/StatusHistoryTooltip.js +0 -47
  97. package/dist/StatusHistoryChart/StatusHistoryTooltip.js.map +0 -1
  98. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts +0 -2
  99. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts.map +0 -1
  100. package/dist/StatusHistoryChart/get-formatted-axis-label.js +0 -41
  101. package/dist/StatusHistoryChart/get-formatted-axis-label.js.map +0 -1
  102. package/dist/StatusHistoryChart/index.d.ts +0 -3
  103. package/dist/StatusHistoryChart/index.d.ts.map +0 -1
  104. package/dist/StatusHistoryChart/index.js +0 -16
  105. package/dist/StatusHistoryChart/index.js.map +0 -1
  106. package/dist/StatusHistoryChart/utils/get-color.d.ts +0 -6
  107. package/dist/StatusHistoryChart/utils/get-color.d.ts.map +0 -1
  108. package/dist/StatusHistoryChart/utils/get-color.js +0 -100
  109. package/dist/StatusHistoryChart/utils/get-color.js.map +0 -1
  110. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts +0 -3
  111. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts.map +0 -1
  112. package/dist/StatusHistoryChart/utils/get-tooltip-position.js +0 -27
  113. package/dist/StatusHistoryChart/utils/get-tooltip-position.js.map +0 -1
  114. package/dist/TimeChart/TimeChart.d.ts +0 -24
  115. package/dist/TimeChart/TimeChart.d.ts.map +0 -1
  116. package/dist/TimeChart/TimeChart.js +0 -394
  117. package/dist/TimeChart/TimeChart.js.map +0 -1
  118. package/dist/TimeChart/index.d.ts +0 -2
  119. package/dist/TimeChart/index.d.ts.map +0 -1
  120. package/dist/TimeChart/index.js +0 -15
  121. package/dist/TimeChart/index.js.map +0 -1
  122. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +0 -21
  123. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +0 -1
  124. package/dist/TimeSeriesTooltip/LineChartTooltip.js +0 -101
  125. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +0 -1
  126. package/dist/cjs/BarChart/BarChart.js +0 -142
  127. package/dist/cjs/BarChart/index.js +0 -30
  128. package/dist/cjs/GaugeChart/GaugeChart.js +0 -227
  129. package/dist/cjs/GaugeChart/index.js +0 -30
  130. package/dist/cjs/LineChart/LineChart.js +0 -274
  131. package/dist/cjs/LineChart/index.js +0 -30
  132. package/dist/cjs/PieChart/PieChart.js +0 -100
  133. package/dist/cjs/PieChart/index.js +0 -30
  134. package/dist/cjs/StatChart/StatChart.js +0 -202
  135. package/dist/cjs/StatChart/calculateFontSize.js +0 -55
  136. package/dist/cjs/StatChart/index.js +0 -30
  137. package/dist/cjs/StatChart/utils/formatStatChartValue.js +0 -34
  138. package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +0 -140
  139. package/dist/cjs/StatusHistoryChart/StatusHistoryTooltip.js +0 -55
  140. package/dist/cjs/StatusHistoryChart/get-formatted-axis-label.js +0 -48
  141. package/dist/cjs/StatusHistoryChart/index.js +0 -31
  142. package/dist/cjs/StatusHistoryChart/utils/get-color.js +0 -125
  143. package/dist/cjs/StatusHistoryChart/utils/get-tooltip-position.js +0 -35
  144. package/dist/cjs/TimeChart/TimeChart.js +0 -407
  145. package/dist/cjs/TimeChart/index.js +0 -30
  146. package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +0 -114
package/README.md CHANGED
@@ -7,12 +7,5 @@ This [package](https://www.npmjs.com/package/@perses-dev/components) includes in
7
7
  To import components from the components package use the syntax below:
8
8
 
9
9
  ```typescript
10
- import { LineChart } from "@perses-dev/components";
10
+ import { ContentWithLegend } from "@perses-dev/components";
11
11
  ```
12
-
13
- For detailed examples of how to use certain components, see individual docs for:
14
-
15
- - [LineChart.md](./src/LineChart/LineChart.md)
16
- - [GaugeChart.md](./src/GaugeChart/GaugeChart.md)
17
- - [StatChart.md](./src/StatChart/StatChart.md)
18
- - [BarChart.md](./src/BarChart/BarChart.md)
@@ -1 +1 @@
1
- {"version":3,"file":"EChart.d.ts","sourceRoot":"","sources":["../../src/EChart/EChart.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAA4C,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAsB,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAO,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAcpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAiBxC,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,C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AA,MAAM,WAAW,gDAAiD,CAAC;AAEnE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,KAAK,cAAc,GAAG,UAAU,CAAC;AAIjC,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC3B,cAAc,IAAI,cAAc,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;CACxD,GAAG;KACD,cAAc,IAAI,cAAc,CAAC,CAAC,EAAE,oBAAoB;CAC1D,GAAG;KACD,SAAS,IAAI,cAAc,CAAC,CAAC,EAAE,MAAM,IAAI;CAC3C,CAAC;AAEF,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,MAAM,wIAUhB,aAAa,CAAC,CAAC,8CAsFhB,CAAC"}
@@ -16,21 +16,30 @@ import { init, connect, use } from 'echarts/core';
16
16
  import { Box } from '@mui/material';
17
17
  import isEqual from 'lodash/isEqual';
18
18
  import debounce from 'lodash/debounce';
19
- import { ScatterChart as EChartsScatterChart, CustomChart as EChartsCustomChart } from 'echarts/charts';
20
- import { DatasetComponent, DataZoomComponent, LegendComponent, GridComponent, TitleComponent, TooltipComponent } from 'echarts/components';
19
+ import { LineChart as EChartsLineChart, GaugeChart as EChartsGaugeChart, PieChart as EChartsPieChart, ScatterChart as EChartsScatterChart, CustomChart as EChartsCustomChart, HeatmapChart as EChartsHeatmapChart } from 'echarts/charts';
20
+ import { DatasetComponent, DataZoomComponent, LegendComponent, GridComponent, TitleComponent, TooltipComponent, VisualMapComponent, ToolboxComponent, MarkPointComponent, MarkAreaComponent, MarkLineComponent } from 'echarts/components';
21
21
  import { CanvasRenderer } from 'echarts/renderers';
22
- // Loading the ECharts extensions should happen in the respective plugin (in this case, the scatterplot + custom plugin).
22
+ // Loading the ECharts extensions should happen in the respective plugins.
23
23
  // This is a workaround for https://github.com/perses/plugins/issues/83.
24
24
  use([
25
25
  DatasetComponent,
26
26
  DataZoomComponent,
27
27
  LegendComponent,
28
+ EChartsLineChart,
29
+ EChartsGaugeChart,
30
+ EChartsPieChart,
28
31
  EChartsScatterChart,
29
32
  EChartsCustomChart,
33
+ EChartsHeatmapChart,
30
34
  GridComponent,
31
35
  TitleComponent,
36
+ ToolboxComponent,
32
37
  TooltipComponent,
33
- CanvasRenderer
38
+ CanvasRenderer,
39
+ VisualMapComponent,
40
+ MarkAreaComponent,
41
+ MarkLineComponent,
42
+ MarkPointComponent
34
43
  ]);
35
44
  const mouseEvents = [
36
45
  'click',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/EChart/EChart.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 { CSSProperties, memo, useEffect, useLayoutEffect, useRef } from 'react';\nimport { ECharts, EChartsCoreOption, init, connect, use } from 'echarts/core';\nimport { Box, SxProps, Theme } from '@mui/material';\nimport isEqual from 'lodash/isEqual';\nimport debounce from 'lodash/debounce';\n\nimport { ScatterChart as EChartsScatterChart, CustomChart as EChartsCustomChart } from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChartsTheme } from '../model';\n\n// Loading the ECharts extensions should happen in the respective plugin (in this case, the scatterplot + custom plugin).\n// This is a workaround for https://github.com/perses/plugins/issues/83.\nuse([\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n EChartsScatterChart,\n EChartsCustomChart,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n CanvasRenderer,\n]);\n\n// see docs for info about each property: https://echarts.apache.org/en/api.html#events\nexport interface MouseEventsParameters<T> {\n componentType: string;\n seriesType: string;\n seriesIndex: number;\n seriesName: string;\n name: string;\n dataIndex: number;\n data: Record<string, unknown> & T;\n dataType: string;\n value: number | number[];\n color: string;\n info: Record<string, unknown>;\n}\n\ntype OnEventFunction<T> = (\n params: MouseEventsParameters<T>,\n // This is potentially undefined for testing purposes\n instance?: ECharts\n) => void;\n\nconst mouseEvents = [\n 'click',\n 'dblclick',\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout',\n 'globalout',\n 'contextmenu',\n] as const;\n\nexport type MouseEventName = (typeof mouseEvents)[number];\n\n// batch event types\nexport interface DataZoomPayloadBatchItem {\n dataZoomId: string;\n // start and end not returned unless dataZoom is based on percentProp,\n // which is for cases when a dataZoom component controls multiple axes\n start?: number;\n end?: number;\n // startValue and endValue return data index for 'category' axes,\n // for axis types 'value' and 'time', actual values are returned\n startValue?: number;\n endValue?: number;\n}\n\nexport interface HighlightPayloadBatchItem {\n dataIndex: number;\n dataIndexInside: number;\n seriesIndex: number;\n // highlight action can effect multiple connected charts\n escapeConnect?: boolean;\n // whether blur state was triggered\n notBlur?: boolean;\n}\n\nexport interface BatchEventsParameters {\n type: BatchEventName;\n batch: DataZoomPayloadBatchItem[] & HighlightPayloadBatchItem[];\n}\n\ntype OnBatchEventFunction = (params: BatchEventsParameters) => void;\n\nconst batchEvents = ['datazoom', 'downplay', 'highlight'] as const;\n\nexport type BatchEventName = (typeof batchEvents)[number];\n\ntype ChartEventName = 'finished';\n\ntype EventName = MouseEventName | ChartEventName | BatchEventName;\n\nexport type OnEventsType<T> = {\n [mouseEventName in MouseEventName]?: OnEventFunction<T>;\n} & {\n [batchEventName in BatchEventName]?: OnBatchEventFunction;\n} & {\n [eventName in ChartEventName]?: () => void;\n};\n\nexport interface EChartsProps<T> {\n option: EChartsCoreOption;\n theme?: string | EChartsTheme;\n renderer?: 'canvas' | 'svg';\n sx?: SxProps<Theme>;\n style?: CSSProperties;\n onEvents?: OnEventsType<T>;\n _instance?: React.MutableRefObject<ECharts | undefined>;\n syncGroup?: string;\n onChartInitialized?: (instance: ECharts) => void;\n}\n\nexport const EChart = memo(function EChart<T>({\n option,\n theme,\n renderer,\n sx,\n style,\n onEvents,\n _instance,\n syncGroup,\n onChartInitialized,\n}: EChartsProps<T>) {\n const initialOption = useRef<EChartsCoreOption>(option);\n const prevOption = useRef<EChartsCoreOption>(option);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const chartElement = useRef<ECharts | null>(null);\n\n // Initialize chart, dispose on unmount\n useLayoutEffect(() => {\n if (containerRef.current === null || chartElement.current !== null) return;\n chartElement.current = init(containerRef.current, theme, { renderer: renderer ?? 'canvas' });\n if (chartElement.current === undefined) return;\n chartElement.current.setOption(initialOption.current, true);\n onChartInitialized?.(chartElement.current);\n if (_instance !== undefined) {\n _instance.current = chartElement.current;\n }\n return (): void => {\n if (chartElement.current === null) return;\n chartElement.current.dispose();\n chartElement.current = null;\n };\n }, [_instance, onChartInitialized, theme, renderer]);\n\n // When syncGroup is explicitly set, charts within same group share interactions such as crosshair\n useEffect(() => {\n if (!chartElement.current || !syncGroup) return;\n chartElement.current.group = syncGroup;\n connect([chartElement.current]); // more info: https://echarts.apache.org/en/api.html#echarts.connect\n }, [syncGroup, chartElement]);\n\n // Update chart data when option changes\n useEffect(() => {\n if (prevOption.current === undefined || isEqual(prevOption.current, option)) return;\n if (!chartElement.current) return;\n chartElement.current.setOption(option, true);\n prevOption.current = option;\n }, [option]);\n\n // Resize chart, cleanup listener on unmount\n useLayoutEffect(() => {\n const updateSize = debounce(() => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n }, 200);\n window.addEventListener('resize', updateSize);\n updateSize();\n return (): void => {\n window.removeEventListener('resize', updateSize);\n };\n }, []);\n\n // Bind and unbind chart events passed as prop\n useEffect(() => {\n const chart = chartElement.current;\n if (!chart || onEvents === undefined) return;\n bindEvents(chart, onEvents);\n return (): void => {\n if (chart === undefined) return;\n if (chart.isDisposed() === true) return;\n for (const event in onEvents) {\n chart.off(event);\n }\n };\n }, [onEvents]);\n\n // TODO: re-evaluate how this is triggered. It's technically working right\n // now because the sx prop is an object that gets re-created, but that also\n // means it runs unnecessarily some of the time and theoretically might\n // not run in some other cases. Maybe it should use a resize observer?\n useEffect(() => {\n // TODO: fix this debouncing. This likely isn't working as intended because\n // the debounced function is re-created every time this useEffect is called.\n const updateSize = debounce(\n () => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n },\n 200,\n {\n leading: true,\n }\n );\n updateSize();\n }, [sx, style]);\n\n return <Box ref={containerRef} sx={sx} style={style}></Box>;\n});\n\n// Validate event config and bind custom events\nfunction bindEvents<T>(instance: ECharts, events?: OnEventsType<T>): void {\n if (events === undefined) return;\n\n function bindEvent(eventName: EventName, OnEventFunction: unknown): void {\n if (typeof OnEventFunction === 'function') {\n if (isMouseEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params, instance));\n } else if (isBatchEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params));\n } else {\n instance.on(eventName, () => OnEventFunction(null, instance));\n }\n }\n }\n\n for (const eventName in events) {\n if (Object.prototype.hasOwnProperty.call(events, eventName)) {\n const customEvent = events[eventName as EventName] ?? null;\n if (customEvent) {\n bindEvent(eventName as EventName, customEvent);\n }\n }\n }\n}\n\nfunction isMouseEvent(eventName: EventName): eventName is MouseEventName {\n return (mouseEvents as readonly string[]).includes(eventName);\n}\n\nfunction isBatchEvent(eventName: EventName): eventName is BatchEventName {\n return (batchEvents as readonly string[]).includes(eventName);\n}\n"],"names":["memo","useEffect","useLayoutEffect","useRef","init","connect","use","Box","isEqual","debounce","ScatterChart","EChartsScatterChart","CustomChart","EChartsCustomChart","DatasetComponent","DataZoomComponent","LegendComponent","GridComponent","TitleComponent","TooltipComponent","CanvasRenderer","mouseEvents","batchEvents","EChart","option","theme","renderer","sx","style","onEvents","_instance","syncGroup","onChartInitialized","initialOption","prevOption","containerRef","chartElement","current","undefined","setOption","dispose","group","updateSize","resize","window","addEventListener","removeEventListener","chart","bindEvents","isDisposed","event","off","leading","ref","instance","events","bindEvent","eventName","OnEventFunction","isMouseEvent","on","params","isBatchEvent","Object","prototype","hasOwnProperty","call","customEvent","includes"],"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,SAAwBA,IAAI,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,QAAQ,QAAQ;AAChF,SAAqCC,IAAI,EAAEC,OAAO,EAAEC,GAAG,QAAQ,eAAe;AAC9E,SAASC,GAAG,QAAwB,gBAAgB;AACpD,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,cAAc,kBAAkB;AAEvC,SAASC,gBAAgBC,mBAAmB,EAAEC,eAAeC,kBAAkB,QAAQ,iBAAiB;AACxG,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,eAAe,EACfC,aAAa,EACbC,cAAc,EACdC,gBAAgB,QACX,qBA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AG;AAEH,+CAA+C;AAC/C,SAASoB,WAAcM,QAAiB,EAAEC,MAAwB;IAChE,IAAIA,WAAWjB,WAAW;IAE1B,SAASkB,UAAUC,SAAoB,EAAEC,eAAwB;QAC/D,IAAI,OAAOA,oBAAoB,YAAY;YACzC,IAAIC,aAAaF,YAAY;gBAC3BH,SAASM,EAAE,CAACH,WAAW,CAACI,SAAWH,gBAAgBG,QAAQP;YAC7D,OAAO,IAAIQ,aAAaL,YAAY;gBAClCH,SAASM,EAAE,CAACH,WAAW,CAACI,SAAWH,gBAAgBG;YACrD,OAAO;gBACLP,SAASM,EAAE,CAACH,WAAW,IAAMC,gBAAgB,MAAMJ;YACrD;QACF;IACF;IAEA,IAAK,MAAMG,aAAaF,OAAQ;QAC9B,IAAIQ,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACX,QAAQE,YAAY;YAC3D,MAAMU,cAAcZ,MAAM,CAACE,UAAuB,IAAI;YACtD,IAAIU,aAAa;gBACfX,UAAUC,WAAwBU;YACpC;QACF;IACF;AACF;AAEA,SAASR,aAAaF,SAAoB;IACxC,OAAO,AAACpC,YAAkC+C,QAAQ,CAACX;AACrD;AAEA,SAASK,aAAaL,SAAoB;IACxC,OAAO,AAACnC,YAAkC8C,QAAQ,CAACX;AACrD"}
1
+ {"version":3,"sources":["../../src/EChart/EChart.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 { CSSProperties, memo, useEffect, useLayoutEffect, useRef } from 'react';\nimport { ECharts, EChartsCoreOption, init, connect, use } from 'echarts/core';\nimport { Box, SxProps, Theme } from '@mui/material';\nimport isEqual from 'lodash/isEqual';\nimport debounce from 'lodash/debounce';\n\nimport {\n LineChart as EChartsLineChart,\n GaugeChart as EChartsGaugeChart,\n PieChart as EChartsPieChart,\n ScatterChart as EChartsScatterChart,\n CustomChart as EChartsCustomChart,\n HeatmapChart as EChartsHeatmapChart,\n} from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n VisualMapComponent,\n ToolboxComponent,\n MarkPointComponent,\n MarkAreaComponent,\n MarkLineComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChartsTheme } from '../model';\n\n// Loading the ECharts extensions should happen in the respective plugins.\n// This is a workaround for https://github.com/perses/plugins/issues/83.\nuse([\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n EChartsLineChart,\n EChartsGaugeChart,\n EChartsPieChart,\n EChartsScatterChart,\n EChartsCustomChart,\n EChartsHeatmapChart,\n GridComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n CanvasRenderer,\n VisualMapComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n]);\n\n// see docs for info about each property: https://echarts.apache.org/en/api.html#events\nexport interface MouseEventsParameters<T> {\n componentType: string;\n seriesType: string;\n seriesIndex: number;\n seriesName: string;\n name: string;\n dataIndex: number;\n data: Record<string, unknown> & T;\n dataType: string;\n value: number | number[];\n color: string;\n info: Record<string, unknown>;\n}\n\ntype OnEventFunction<T> = (\n params: MouseEventsParameters<T>,\n // This is potentially undefined for testing purposes\n instance?: ECharts\n) => void;\n\nconst mouseEvents = [\n 'click',\n 'dblclick',\n 'mousedown',\n 'mousemove',\n 'mouseup',\n 'mouseover',\n 'mouseout',\n 'globalout',\n 'contextmenu',\n] as const;\n\nexport type MouseEventName = (typeof mouseEvents)[number];\n\n// batch event types\nexport interface DataZoomPayloadBatchItem {\n dataZoomId: string;\n // start and end not returned unless dataZoom is based on percentProp,\n // which is for cases when a dataZoom component controls multiple axes\n start?: number;\n end?: number;\n // startValue and endValue return data index for 'category' axes,\n // for axis types 'value' and 'time', actual values are returned\n startValue?: number;\n endValue?: number;\n}\n\nexport interface HighlightPayloadBatchItem {\n dataIndex: number;\n dataIndexInside: number;\n seriesIndex: number;\n // highlight action can effect multiple connected charts\n escapeConnect?: boolean;\n // whether blur state was triggered\n notBlur?: boolean;\n}\n\nexport interface BatchEventsParameters {\n type: BatchEventName;\n batch: DataZoomPayloadBatchItem[] & HighlightPayloadBatchItem[];\n}\n\ntype OnBatchEventFunction = (params: BatchEventsParameters) => void;\n\nconst batchEvents = ['datazoom', 'downplay', 'highlight'] as const;\n\nexport type BatchEventName = (typeof batchEvents)[number];\n\ntype ChartEventName = 'finished';\n\ntype EventName = MouseEventName | ChartEventName | BatchEventName;\n\nexport type OnEventsType<T> = {\n [mouseEventName in MouseEventName]?: OnEventFunction<T>;\n} & {\n [batchEventName in BatchEventName]?: OnBatchEventFunction;\n} & {\n [eventName in ChartEventName]?: () => void;\n};\n\nexport interface EChartsProps<T> {\n option: EChartsCoreOption;\n theme?: string | EChartsTheme;\n renderer?: 'canvas' | 'svg';\n sx?: SxProps<Theme>;\n style?: CSSProperties;\n onEvents?: OnEventsType<T>;\n _instance?: React.MutableRefObject<ECharts | undefined>;\n syncGroup?: string;\n onChartInitialized?: (instance: ECharts) => void;\n}\n\nexport const EChart = memo(function EChart<T>({\n option,\n theme,\n renderer,\n sx,\n style,\n onEvents,\n _instance,\n syncGroup,\n onChartInitialized,\n}: EChartsProps<T>) {\n const initialOption = useRef<EChartsCoreOption>(option);\n const prevOption = useRef<EChartsCoreOption>(option);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const chartElement = useRef<ECharts | null>(null);\n\n // Initialize chart, dispose on unmount\n useLayoutEffect(() => {\n if (containerRef.current === null || chartElement.current !== null) return;\n chartElement.current = init(containerRef.current, theme, { renderer: renderer ?? 'canvas' });\n if (chartElement.current === undefined) return;\n chartElement.current.setOption(initialOption.current, true);\n onChartInitialized?.(chartElement.current);\n if (_instance !== undefined) {\n _instance.current = chartElement.current;\n }\n return (): void => {\n if (chartElement.current === null) return;\n chartElement.current.dispose();\n chartElement.current = null;\n };\n }, [_instance, onChartInitialized, theme, renderer]);\n\n // When syncGroup is explicitly set, charts within same group share interactions such as crosshair\n useEffect(() => {\n if (!chartElement.current || !syncGroup) return;\n chartElement.current.group = syncGroup;\n connect([chartElement.current]); // more info: https://echarts.apache.org/en/api.html#echarts.connect\n }, [syncGroup, chartElement]);\n\n // Update chart data when option changes\n useEffect(() => {\n if (prevOption.current === undefined || isEqual(prevOption.current, option)) return;\n if (!chartElement.current) return;\n chartElement.current.setOption(option, true);\n prevOption.current = option;\n }, [option]);\n\n // Resize chart, cleanup listener on unmount\n useLayoutEffect(() => {\n const updateSize = debounce(() => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n }, 200);\n window.addEventListener('resize', updateSize);\n updateSize();\n return (): void => {\n window.removeEventListener('resize', updateSize);\n };\n }, []);\n\n // Bind and unbind chart events passed as prop\n useEffect(() => {\n const chart = chartElement.current;\n if (!chart || onEvents === undefined) return;\n bindEvents(chart, onEvents);\n return (): void => {\n if (chart === undefined) return;\n if (chart.isDisposed() === true) return;\n for (const event in onEvents) {\n chart.off(event);\n }\n };\n }, [onEvents]);\n\n // TODO: re-evaluate how this is triggered. It's technically working right\n // now because the sx prop is an object that gets re-created, but that also\n // means it runs unnecessarily some of the time and theoretically might\n // not run in some other cases. Maybe it should use a resize observer?\n useEffect(() => {\n // TODO: fix this debouncing. This likely isn't working as intended because\n // the debounced function is re-created every time this useEffect is called.\n const updateSize = debounce(\n () => {\n if (!chartElement.current) return;\n chartElement.current.resize();\n },\n 200,\n {\n leading: true,\n }\n );\n updateSize();\n }, [sx, style]);\n\n return <Box ref={containerRef} sx={sx} style={style}></Box>;\n});\n\n// Validate event config and bind custom events\nfunction bindEvents<T>(instance: ECharts, events?: OnEventsType<T>): void {\n if (events === undefined) return;\n\n function bindEvent(eventName: EventName, OnEventFunction: unknown): void {\n if (typeof OnEventFunction === 'function') {\n if (isMouseEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params, instance));\n } else if (isBatchEvent(eventName)) {\n instance.on(eventName, (params) => OnEventFunction(params));\n } else {\n instance.on(eventName, () => OnEventFunction(null, instance));\n }\n }\n }\n\n for (const eventName in events) {\n if (Object.prototype.hasOwnProperty.call(events, eventName)) {\n const customEvent = events[eventName as EventName] ?? null;\n if (customEvent) {\n bindEvent(eventName as EventName, customEvent);\n }\n }\n }\n}\n\nfunction isMouseEvent(eventName: EventName): eventName is MouseEventName {\n return (mouseEvents as readonly string[]).includes(eventName);\n}\n\nfunction isBatchEvent(eventName: EventName): eventName is BatchEventName {\n return (batchEvents as readonly string[]).includes(eventName);\n}\n"],"names":["memo","useEffect","useLayoutEffect","useRef","init","connect","use","Box","isEqual","debounce","LineChart","EChartsLineChart","GaugeChart","EChartsGaugeChart","PieChart","EChartsPieChart","ScatterChart","EChartsScatterChart","CustomChart","EChartsCustomChart","HeatmapChart","EChartsHeatmapChart","DatasetComponent","DataZoomComponent","LegendComponent","GridComponent","TitleComponent","TooltipComponent","VisualMapComponent","ToolboxComponent","MarkPointComponent","MarkAreaComponent","MarkLineComponent","CanvasRenderer","mouseEvents","batchEvents","EChart","option","theme","renderer","sx","style","onEvents","_instance","syncGroup","onChartInitialized","initialOption","prevOption","containerRef","chartElement","current","undefined","setOption","dispose","group","updateSize","resize","window","addEventListener","removeEventListener","chart","bindEvents","isDisposed","event","off","leading","ref","instance","events","bindEvent","eventName","OnEventFunction","isMouseEvent","on","params","isBatchEvent","Object","prototype","hasOwnProperty","call","customEvent","includes"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAi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BACfX,UAAUC,WAAwBU;YACpC;QACF;IACF;AACF;AAEA,SAASR,aAAaF,SAAoB;IACxC,OAAO,AAACpC,YAAkC+C,QAAQ,CAACX;AACrD;AAEA,SAASK,aAAaL,SAAoB;IACxC,OAAO,AAACnC,YAAkC8C,QAAQ,CAACX;AACrD"}
@@ -1,4 +1,3 @@
1
- export * from './LineChartTooltip';
2
1
  export * from './SeriesInfo';
3
2
  export * from './SeriesLabelsStack';
4
3
  export * from './SeriesMarker';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/index.ts"],"names":[],"mappings":"AAaA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -10,7 +10,6 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './LineChartTooltip';
14
13
  export * from './SeriesInfo';
15
14
  export * from './SeriesLabelsStack';
16
15
  export * from './SeriesMarker';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/TimeSeriesTooltip/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 './LineChartTooltip';\nexport * from './SeriesInfo';\nexport * from './SeriesLabelsStack';\nexport * from './SeriesMarker';\nexport * from './TimeChartTooltip';\nexport * from './TooltipContent';\nexport * from './TooltipHeader';\nexport * from './nearby-series';\nexport * from './tooltip-model';\nexport * from './utils';\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,qBAAqB;AACnC,cAAc,eAAe;AAC7B,cAAc,sBAAsB;AACpC,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,UAAU"}
1
+ {"version":3,"sources":["../../src/TimeSeriesTooltip/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 './SeriesInfo';\nexport * from './SeriesLabelsStack';\nexport * from './SeriesMarker';\nexport * from './TimeChartTooltip';\nexport * from './TooltipContent';\nexport * from './TooltipHeader';\nexport * from './nearby-series';\nexport * from './tooltip-model';\nexport * from './utils';\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,eAAe;AAC7B,cAAc,sBAAsB;AACpC,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,UAAU"}
@@ -34,18 +34,27 @@ function _interop_require_default(obj) {
34
34
  default: obj
35
35
  };
36
36
  }
37
- // Loading the ECharts extensions should happen in the respective plugin (in this case, the scatterplot + custom plugin).
37
+ // Loading the ECharts extensions should happen in the respective plugins.
38
38
  // This is a workaround for https://github.com/perses/plugins/issues/83.
39
39
  (0, _core.use)([
40
40
  _components.DatasetComponent,
41
41
  _components.DataZoomComponent,
42
42
  _components.LegendComponent,
43
+ _charts.LineChart,
44
+ _charts.GaugeChart,
45
+ _charts.PieChart,
43
46
  _charts.ScatterChart,
44
47
  _charts.CustomChart,
48
+ _charts.HeatmapChart,
45
49
  _components.GridComponent,
46
50
  _components.TitleComponent,
51
+ _components.ToolboxComponent,
47
52
  _components.TooltipComponent,
48
- _renderers.CanvasRenderer
53
+ _renderers.CanvasRenderer,
54
+ _components.VisualMapComponent,
55
+ _components.MarkAreaComponent,
56
+ _components.MarkLineComponent,
57
+ _components.MarkPointComponent
49
58
  ]);
50
59
  const mouseEvents = [
51
60
  'click',
@@ -14,7 +14,6 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _export_star(require("./LineChartTooltip"), exports);
18
17
  _export_star(require("./SeriesInfo"), exports);
19
18
  _export_star(require("./SeriesLabelsStack"), exports);
20
19
  _export_star(require("./SeriesMarker"), exports);
@@ -78,18 +78,20 @@ function _interop_require_wildcard(obj, nodeInterop) {
78
78
  return newObj;
79
79
  }
80
80
  function ChartsProvider(props) {
81
- const { children, chartsTheme, enablePinning = false } = props;
81
+ const { children, chartsTheme, enablePinning = false, enableSyncGrouping = true } = props;
82
82
  const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = (0, _react.useState)(null);
83
83
  const ctx = (0, _react.useMemo)(()=>{
84
84
  return {
85
85
  chartsTheme,
86
86
  enablePinning,
87
87
  lastTooltipPinnedCoords,
88
+ enableSyncGrouping,
88
89
  setLastTooltipPinnedCoords
89
90
  };
90
91
  }, [
91
92
  chartsTheme,
92
93
  enablePinning,
94
+ enableSyncGrouping,
93
95
  lastTooltipPinnedCoords,
94
96
  setLastTooltipPinnedCoords
95
97
  ]);
package/dist/cjs/index.js CHANGED
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
17
  _export_star(require("./AlignSelector"), exports);
18
- _export_star(require("./BarChart"), exports);
19
18
  _export_star(require("./ColorPicker"), exports);
20
19
  _export_star(require("./ContentWithLegend"), exports);
21
20
  _export_star(require("./controls"), exports);
@@ -28,21 +27,17 @@ _export_star(require("./ErrorAlert"), exports);
28
27
  _export_star(require("./ErrorBoundary"), exports);
29
28
  _export_star(require("./FontSizeSelector"), exports);
30
29
  _export_star(require("./FormEditor"), exports);
31
- _export_star(require("./GaugeChart"), exports);
32
30
  _export_star(require("./InfoTooltip"), exports);
33
31
  _export_star(require("./JSONEditor"), exports);
34
32
  _export_star(require("./Legend"), exports);
35
- _export_star(require("./LineChart"), exports);
36
33
  _export_star(require("./LinksEditor"), exports);
37
34
  _export_star(require("./ModeSelector"), exports);
38
35
  _export_star(require("./OptionsEditorLayout"), exports);
39
36
  _export_star(require("./Overlay"), exports);
40
37
  _export_star(require("./SettingsAutocomplete"), exports);
41
38
  _export_star(require("./SortSelector"), exports);
42
- _export_star(require("./StatChart"), exports);
43
39
  _export_star(require("./Table"), exports);
44
40
  _export_star(require("./ThresholdsEditor"), exports);
45
- _export_star(require("./TimeChart"), exports);
46
41
  _export_star(require("./TimeRangeSelector"), exports);
47
42
  _export_star(require("./TimeSeriesTooltip"), exports);
48
43
  _export_star(require("./ToolbarIconButton"), exports);
@@ -55,8 +50,6 @@ _export_star(require("./test-utils"), exports);
55
50
  _export_star(require("./theme"), exports);
56
51
  _export_star(require("./TransformsEditor"), exports);
57
52
  _export_star(require("./RefreshIntervalPicker"), exports);
58
- _export_star(require("./PieChart"), exports);
59
- _export_star(require("./StatusHistoryChart"), exports);
60
53
  _export_star(require("./ValueMappingEditor"), exports);
61
54
  function _export_star(from, to) {
62
55
  Object.keys(from).forEach(function(k) {
@@ -55,6 +55,7 @@ const testChartsTheme = (0, _utils.generateChartsTheme)((0, _material.createThem
55
55
  const mockChartsContext = {
56
56
  chartsTheme: testChartsTheme,
57
57
  enablePinning: false,
58
+ enableSyncGrouping: true,
58
59
  lastTooltipPinnedCoords: null,
59
60
  setLastTooltipPinnedCoords: ()=>null
60
61
  };
@@ -14,17 +14,9 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- function _export(target, all) {
18
- for(var name in all)Object.defineProperty(target, name, {
19
- enumerable: true,
20
- get: all[name]
21
- });
22
- }
23
- _export(exports, {
24
- getDateRange: function() {
25
- return getDateRange;
26
- },
27
- getFormattedAxis: function() {
17
+ Object.defineProperty(exports, "getFormattedAxis", {
18
+ enumerable: true,
19
+ get: function() {
28
20
  return getFormattedAxis;
29
21
  }
30
22
  });
@@ -53,10 +45,3 @@ function getFormattedAxis(axis, unit) {
53
45
  (0, _merge.default)(AXIS_DEFAULT, axis)
54
46
  ];
55
47
  }
56
- function getDateRange(data) {
57
- const defaultRange = 3600000; // hour in ms
58
- if (data.length === 0) return defaultRange;
59
- const lastDatum = data[data.length - 1];
60
- if (data[0] === undefined || lastDatum === undefined) return defaultRange;
61
- return lastDatum - data[0];
62
- }
@@ -32,9 +32,6 @@ _export(exports, {
32
32
  },
33
33
  getFormattedAxisLabel: function() {
34
34
  return getFormattedAxisLabel;
35
- },
36
- getFormattedDate: function() {
37
- return getFormattedDate;
38
35
  }
39
36
  });
40
37
  const _datefnstz = require("date-fns-tz");
@@ -67,24 +64,6 @@ function formatWithTimeZone(date, formatString, timeZone) {
67
64
  return (0, _datefnstz.formatInTimeZone)(date, lowerTimeZone === 'utc' ? 'UTC' : timeZone, formatString);
68
65
  }
69
66
  }
70
- function getFormattedDate(value, rangeMs, timeZone) {
71
- const dateFormatOptions = dateFormatOptionsWithTimeZone({
72
- hour: 'numeric',
73
- minute: 'numeric',
74
- hourCycle: 'h23'
75
- }, timeZone);
76
- const thirtyMinMs = 1800000;
77
- const dayMs = 86400000;
78
- if (rangeMs <= thirtyMinMs) {
79
- dateFormatOptions.second = 'numeric';
80
- } else if (rangeMs >= dayMs) {
81
- dateFormatOptions.month = 'numeric';
82
- dateFormatOptions.day = 'numeric';
83
- }
84
- const DATE_FORMAT = new Intl.DateTimeFormat(undefined, dateFormatOptions);
85
- // remove comma when month / day present
86
- return DATE_FORMAT.format(value).replace(/, /g, ' ');
87
- }
88
67
  function getFormattedAxisLabel(rangeMs) {
89
68
  const dayMs = 86400000;
90
69
  const monthMs = 2629440000;
@@ -4,11 +4,13 @@ import { CursorCoordinates } from '../TimeSeriesTooltip';
4
4
  export interface ChartsProviderProps {
5
5
  chartsTheme: PersesChartsTheme;
6
6
  enablePinning?: boolean;
7
+ enableSyncGrouping?: boolean;
7
8
  children?: React.ReactNode;
8
9
  }
9
10
  export interface SharedChartsState {
10
11
  chartsTheme: PersesChartsTheme;
11
12
  enablePinning: boolean;
13
+ enableSyncGrouping: boolean;
12
14
  lastTooltipPinnedCoords: CursorCoordinates | null;
13
15
  setLastTooltipPinnedCoords: (lastTooltipPinnedCoords: CursorCoordinates | null) => void;
14
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsProvider.d.ts","sourceRoot":"","sources":["../../src/context/ChartsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAiB,YAAY,EAAiC,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClD,0BAA0B,EAAE,CAAC,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CACzF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAevE;AAED,eAAO,MAAM,kBAAkB,8CAA0D,CAAC;AAE1F,wBAAgB,gBAAgB,IAAI,iBAAiB,CAMpD;AAED,wBAAgB,cAAc,IAAI,iBAAiB,CAGlD"}
1
+ {"version":3,"file":"ChartsProvider.d.ts","sourceRoot":"","sources":["../../src/context/ChartsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAiB,YAAY,EAAiC,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClD,0BAA0B,EAAE,CAAC,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CACzF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAgBvE;AAED,eAAO,MAAM,kBAAkB,8CAA0D,CAAC;AAE1F,wBAAgB,gBAAgB,IAAI,iBAAiB,CAMpD;AAED,wBAAgB,cAAc,IAAI,iBAAiB,CAGlD"}
@@ -13,18 +13,20 @@
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import React, { createContext, useContext, useMemo, useState } from 'react';
15
15
  export function ChartsProvider(props) {
16
- const { children, chartsTheme, enablePinning = false } = props;
16
+ const { children, chartsTheme, enablePinning = false, enableSyncGrouping = true } = props;
17
17
  const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = useState(null);
18
18
  const ctx = useMemo(()=>{
19
19
  return {
20
20
  chartsTheme,
21
21
  enablePinning,
22
22
  lastTooltipPinnedCoords,
23
+ enableSyncGrouping,
23
24
  setLastTooltipPinnedCoords
24
25
  };
25
26
  }, [
26
27
  chartsTheme,
27
28
  enablePinning,
29
+ enableSyncGrouping,
28
30
  lastTooltipPinnedCoords,
29
31
  setLastTooltipPinnedCoords
30
32
  ]);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/context/ChartsProvider.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, { createContext, ReactElement, useContext, useMemo, useState } from 'react';\nimport { PersesChartsTheme } from '../model';\nimport { CursorCoordinates } from '../TimeSeriesTooltip';\n\nexport interface ChartsProviderProps {\n chartsTheme: PersesChartsTheme;\n enablePinning?: boolean;\n children?: React.ReactNode;\n}\n\nexport interface SharedChartsState {\n chartsTheme: PersesChartsTheme;\n enablePinning: boolean;\n lastTooltipPinnedCoords: CursorCoordinates | null;\n setLastTooltipPinnedCoords: (lastTooltipPinnedCoords: CursorCoordinates | null) => void;\n}\n\nexport function ChartsProvider(props: ChartsProviderProps): ReactElement {\n const { children, chartsTheme, enablePinning = false } = props;\n\n const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = useState<CursorCoordinates | null>(null);\n\n const ctx = useMemo(() => {\n return {\n chartsTheme,\n enablePinning,\n lastTooltipPinnedCoords,\n setLastTooltipPinnedCoords,\n };\n }, [chartsTheme, enablePinning, lastTooltipPinnedCoords, setLastTooltipPinnedCoords]);\n\n return <ChartsThemeContext.Provider value={ctx}>{children}</ChartsThemeContext.Provider>;\n}\n\nexport const ChartsThemeContext = createContext<SharedChartsState | undefined>(undefined);\n\nexport function useChartsContext(): SharedChartsState {\n const ctx = useContext(ChartsThemeContext);\n if (ctx === undefined) {\n throw new Error('No ChartsThemeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useChartsTheme(): PersesChartsTheme {\n const ctx = useChartsContext();\n return ctx.chartsTheme;\n}\n"],"names":["React","createContext","useContext","useMemo","useState","ChartsProvider","props","children","chartsTheme","enablePinning","lastTooltipPinnedCoords","setLastTooltipPinnedCoords","ctx","ChartsThemeContext","Provider","value","undefined","useChartsContext","Error","useChartsTheme"],"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,OAAOA,SAASC,aAAa,EAAgBC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAiB1F,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,gBAAgB,KAAK,EAAE,GAAGH;IAEzD,MAAM,CAACI,yBAAyBC,2BAA2B,GAAGP,SAAmC;IAEjG,MAAMQ,MAAMT,QAAQ;QAClB,OAAO;YACLK;YACAC;YACAC;YACAC;QACF;IACF,GAAG;QAACH;QAAaC;QAAeC;QAAyBC;KAA2B;IAEpF,qBAAO,KAACE,mBAAmBC,QAAQ;QAACC,OAAOH;kBAAML;;AACnD;AAEA,OAAO,MAAMM,mCAAqBZ,cAA6Ce,WAAW;AAE1F,OAAO,SAASC;IACd,MAAML,MAAMV,WAAWW;IACvB,IAAID,QAAQI,WAAW;QACrB,MAAM,IAAIE,MAAM;IAClB;IACA,OAAON;AACT;AAEA,OAAO,SAASO;IACd,MAAMP,MAAMK;IACZ,OAAOL,IAAIJ,WAAW;AACxB"}
1
+ {"version":3,"sources":["../../src/context/ChartsProvider.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, { createContext, ReactElement, useContext, useMemo, useState } from 'react';\nimport { PersesChartsTheme } from '../model';\nimport { CursorCoordinates } from '../TimeSeriesTooltip';\n\nexport interface ChartsProviderProps {\n chartsTheme: PersesChartsTheme;\n enablePinning?: boolean;\n enableSyncGrouping?: boolean;\n children?: React.ReactNode;\n}\n\nexport interface SharedChartsState {\n chartsTheme: PersesChartsTheme;\n enablePinning: boolean;\n enableSyncGrouping: boolean;\n lastTooltipPinnedCoords: CursorCoordinates | null;\n setLastTooltipPinnedCoords: (lastTooltipPinnedCoords: CursorCoordinates | null) => void;\n}\n\nexport function ChartsProvider(props: ChartsProviderProps): ReactElement {\n const { children, chartsTheme, enablePinning = false, enableSyncGrouping = true } = props;\n\n const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = useState<CursorCoordinates | null>(null);\n\n const ctx = useMemo(() => {\n return {\n chartsTheme,\n enablePinning,\n lastTooltipPinnedCoords,\n enableSyncGrouping,\n setLastTooltipPinnedCoords,\n };\n }, [chartsTheme, enablePinning, enableSyncGrouping, lastTooltipPinnedCoords, setLastTooltipPinnedCoords]);\n\n return <ChartsThemeContext.Provider value={ctx}>{children}</ChartsThemeContext.Provider>;\n}\n\nexport const ChartsThemeContext = createContext<SharedChartsState | undefined>(undefined);\n\nexport function useChartsContext(): SharedChartsState {\n const ctx = useContext(ChartsThemeContext);\n if (ctx === undefined) {\n throw new Error('No ChartsThemeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useChartsTheme(): PersesChartsTheme {\n const ctx = useChartsContext();\n return ctx.chartsTheme;\n}\n"],"names":["React","createContext","useContext","useMemo","useState","ChartsProvider","props","children","chartsTheme","enablePinning","enableSyncGrouping","lastTooltipPinnedCoords","setLastTooltipPinnedCoords","ctx","ChartsThemeContext","Provider","value","undefined","useChartsContext","Error","useChartsTheme"],"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,OAAOA,SAASC,aAAa,EAAgBC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAmB1F,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,gBAAgB,KAAK,EAAEC,qBAAqB,IAAI,EAAE,GAAGJ;IAEpF,MAAM,CAACK,yBAAyBC,2BAA2B,GAAGR,SAAmC;IAEjG,MAAMS,MAAMV,QAAQ;QAClB,OAAO;YACLK;YACAC;YACAE;YACAD;YACAE;QACF;IACF,GAAG;QAACJ;QAAaC;QAAeC;QAAoBC;QAAyBC;KAA2B;IAExG,qBAAO,KAACE,mBAAmBC,QAAQ;QAACC,OAAOH;kBAAMN;;AACnD;AAEA,OAAO,MAAMO,mCAAqBb,cAA6CgB,WAAW;AAE1F,OAAO,SAASC;IACd,MAAML,MAAMX,WAAWY;IACvB,IAAID,QAAQI,WAAW;QACrB,MAAM,IAAIE,MAAM;IAClB;IACA,OAAON;AACT;AAEA,OAAO,SAASO;IACd,MAAMP,MAAMK;IACZ,OAAOL,IAAIL,WAAW;AACxB"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './AlignSelector';
2
- export * from './BarChart';
3
2
  export * from './ColorPicker';
4
3
  export * from './ContentWithLegend';
5
4
  export * from './controls';
@@ -12,21 +11,17 @@ export * from './ErrorAlert';
12
11
  export * from './ErrorBoundary';
13
12
  export * from './FontSizeSelector';
14
13
  export * from './FormEditor';
15
- export * from './GaugeChart';
16
14
  export * from './InfoTooltip';
17
15
  export * from './JSONEditor';
18
16
  export * from './Legend';
19
- export * from './LineChart';
20
17
  export * from './LinksEditor';
21
18
  export * from './ModeSelector';
22
19
  export * from './OptionsEditorLayout';
23
20
  export * from './Overlay';
24
21
  export * from './SettingsAutocomplete';
25
22
  export * from './SortSelector';
26
- export * from './StatChart';
27
23
  export * from './Table';
28
24
  export * from './ThresholdsEditor';
29
- export * from './TimeChart';
30
25
  export * from './TimeRangeSelector';
31
26
  export * from './TimeSeriesTooltip';
32
27
  export * from './ToolbarIconButton';
@@ -39,7 +34,5 @@ export * from './test-utils';
39
34
  export * from './theme';
40
35
  export * from './TransformsEditor';
41
36
  export * from './RefreshIntervalPicker';
42
- export * from './PieChart';
43
- export * from './StatusHistoryChart';
44
37
  export * from './ValueMappingEditor';
45
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,c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  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  export * from './AlignSelector';
14
- export * from './BarChart';
15
14
  export * from './ColorPicker';
16
15
  export * from './ContentWithLegend';
17
16
  export * from './controls';
@@ -24,21 +23,17 @@ export * from './ErrorAlert';
24
23
  export * from './ErrorBoundary';
25
24
  export * from './FontSizeSelector';
26
25
  export * from './FormEditor';
27
- export * from './GaugeChart';
28
26
  export * from './InfoTooltip';
29
27
  export * from './JSONEditor';
30
28
  export * from './Legend';
31
- export * from './LineChart';
32
29
  export * from './LinksEditor';
33
30
  export * from './ModeSelector';
34
31
  export * from './OptionsEditorLayout';
35
32
  export * from './Overlay';
36
33
  export * from './SettingsAutocomplete';
37
34
  export * from './SortSelector';
38
- export * from './StatChart';
39
35
  export * from './Table';
40
36
  export * from './ThresholdsEditor';
41
- export * from './TimeChart';
42
37
  export * from './TimeRangeSelector';
43
38
  export * from './TimeSeriesTooltip';
44
39
  export * from './ToolbarIconButton';
@@ -51,8 +46,6 @@ export * from './test-utils';
51
46
  export * from './theme';
52
47
  export * from './TransformsEditor';
53
48
  export * from './RefreshIntervalPicker';
54
- export * from './PieChart';
55
- export * from './StatusHistoryChart';
56
49
  export * from './ValueMappingEditor';
57
50
 
58
51
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/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 './AlignSelector';\nexport * from './BarChart';\nexport * from './ColorPicker';\nexport * from './ContentWithLegend';\nexport * from './controls';\nexport * from './Dialog';\nexport * from './DensitySelector';\nexport * from './DragAndDrop';\nexport * from './Drawer';\nexport * from './EChart';\nexport * from './ErrorAlert';\nexport * from './ErrorBoundary';\nexport * from './FontSizeSelector';\nexport * from './FormEditor';\nexport * from './GaugeChart';\nexport * from './InfoTooltip';\nexport * from './JSONEditor';\nexport * from './Legend';\nexport * from './LineChart';\nexport * from './LinksEditor';\nexport * from './ModeSelector';\nexport * from './OptionsEditorLayout';\nexport * from './Overlay';\nexport * from './SettingsAutocomplete';\nexport * from './SortSelector';\nexport * from './StatChart';\nexport * from './Table';\nexport * from './ThresholdsEditor';\nexport * from './TimeChart';\nexport * from './TimeRangeSelector';\nexport * from './TimeSeriesTooltip';\nexport * from './ToolbarIconButton';\nexport * from './FormatControls';\nexport * from './YAxisLabel';\nexport * from './context';\nexport * from './utils';\nexport * from './model';\nexport * from './test-utils';\nexport * from './theme';\nexport * from './TransformsEditor';\nexport * from './RefreshIntervalPicker';\nexport * from './PieChart';\nexport * from './StatusHistoryChart';\nexport * from './ValueMappingEditor';\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,kBAAkB;AAChC,cAAc,aAAa;AAC3B,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,aAAa;AAC3B,cAAc,WAAW;AACzB,cAAc,oBAAoB;AAClC,cAAc,gBAAgB;AAC9B,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,qBAAqB;AACnC,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,YAAY;AAC1B,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,0BAA0B;AACxC,cAAc,aAAa;AAC3B,cAAc,uBAAuB;AACrC,cAAc,uBAAuB"}
1
+ {"version":3,"sources":["../src/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 './AlignSelector';\nexport * from './ColorPicker';\nexport * from './ContentWithLegend';\nexport * from './controls';\nexport * from './Dialog';\nexport * from './DensitySelector';\nexport * from './DragAndDrop';\nexport * from './Drawer';\nexport * from './EChart';\nexport * from './ErrorAlert';\nexport * from './ErrorBoundary';\nexport * from './FontSizeSelector';\nexport * from './FormEditor';\nexport * from './InfoTooltip';\nexport * from './JSONEditor';\nexport * from './Legend';\nexport * from './LinksEditor';\nexport * from './ModeSelector';\nexport * from './OptionsEditorLayout';\nexport * from './Overlay';\nexport * from './SettingsAutocomplete';\nexport * from './SortSelector';\nexport * from './Table';\nexport * from './ThresholdsEditor';\nexport * from './TimeRangeSelector';\nexport * from './TimeSeriesTooltip';\nexport * from './ToolbarIconButton';\nexport * from './FormatControls';\nexport * from './YAxisLabel';\nexport * from './context';\nexport * from './utils';\nexport * from './model';\nexport * from './test-utils';\nexport * from './theme';\nexport * from './TransformsEditor';\nexport * from './RefreshIntervalPicker';\nexport * from './ValueMappingEditor';\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,kBAAkB;AAChC,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,aAAa;AAC3B,cAAc,WAAW;AACzB,cAAc,oBAAoB;AAClC,cAAc,gBAAgB;AAC9B,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,qBAAqB;AACnC,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,YAAY;AAC1B,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB"}
@@ -23,7 +23,6 @@ export type EChartsDataFormat = {
23
23
  rangeMs?: number;
24
24
  };
25
25
  export type ChartInstanceFocusOpts = {
26
- id?: string;
27
26
  name?: string;
28
27
  };
29
28
  export type ChartInstance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AC;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,eAAe,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAExD;;OAEG;IACH,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,eAAO,MAAM,wBAAwB,EAAE,gBAuBtC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/graph.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 { TimeSeriesValueTuple } from '@perses-dev/core';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport { LegendItem } from '../Legend';\n\n// adjust display when there are many time series to help with performance\nexport const OPTIMIZED_MODE_SERIES_LIMIT = 1000;\n\nexport type UnixTimeMs = number;\n\nexport interface GraphSeries {\n name: string;\n values: TimeSeriesValueTuple[];\n id?: string;\n}\n\nexport type EChartsValues = number | null | '-';\n\nexport interface LegacyTimeSeries extends Omit<LineSeriesOption, 'data'> {\n data: EChartsValues[];\n}\n\n// Used for TimeChart dataset support, each time series returned is mapped to series options using datasetIndex\n// - https://apache.github.io/echarts-handbook/en/concepts/dataset/#how-to-reference-several-datasets\nexport type TimeChartSeriesMapping = TimeSeriesOption[];\nexport type TimeChartLegendItems = LegendItem[];\n\nexport type TimeSeriesOption = LineSeriesOption | BarSeriesOption;\n\n// [DEPRECATED] used for legacy LineChart 'category' axis.\n// May delete in future when embed users migrate to TimeChart.\nexport type EChartsDataFormat = {\n timeSeries: LegacyTimeSeries[];\n xAxis: number[];\n legendItems?: LegendItem[];\n xAxisMax?: number | string;\n rangeMs?: number;\n};\n\n// Intentionally making this an object to start because it is plausible we will\n// want to support focusing by other attributes (e.g. index, name) in the future,\n// and starting with an object will make adding them a non-breaking change.\nexport type ChartInstanceFocusOpts = {\n id?: string; // LineChart uses id\n name?: string; // TimeChart uses name\n};\n\nexport type ChartInstance = {\n /**\n * Highlight the series associated with the specified options.\n */\n highlightSeries: (opts: ChartInstanceFocusOpts) => void;\n\n /**\n * Clear all highlighted series.\n */\n clearHighlightedSeries: () => void;\n};\n\nexport const PINNED_CROSSHAIR_SERIES_NAME = 'Pinned Crosshair';\n\nexport const DEFAULT_PINNED_CROSSHAIR: LineSeriesOption = {\n name: PINNED_CROSSHAIR_SERIES_NAME,\n type: 'line',\n // https://echarts.apache.org/en/option.html#series-line.markLine\n markLine: {\n data: [],\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n lineStyle: {\n width: 2,\n opacity: 1,\n },\n },\n blur: {\n lineStyle: {\n width: 2,\n opacity: 1,\n },\n },\n },\n};\n\nexport interface DatapointInfo {\n dataIndex: number;\n seriesIndex: number;\n seriesName: string;\n yValue: number;\n}\n"],"names":["OPTIMIZED_MODE_SERIES_LIMIT","PINNED_CROSSHAIR_SERIES_NAME","DEFAULT_PINNED_CROSSHAIR","name","type","markLine","data","lineStyle","width","emphasis","opacity","blur"],"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;AAMjC,0EAA0E;AAC1E,OAAO,MAAMA,8BAA8B,KAAK;AAqDhD,OAAO,MAAMC,+BAA+B,mBAAmB;AAE/D,OAAO,MAAMC,2BAA6C;IACxDC,MAAMF;IACNG,MAAM;IACN,iEAAiE;IACjEC,UAAU;QACRC,MAAM,EAAE;QACRC,WAAW;YACTH,MAAM;YACNI,OAAO;QACT;QACAC,UAAU;YACRF,WAAW;gBACTC,OAAO;gBACPE,SAAS;YACX;QACF;QACAC,MAAM;YACJJ,WAAW;gBACTC,OAAO;gBACPE,SAAS;YACX;QACF;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../src/model/graph.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 { TimeSeriesValueTuple } from '@perses-dev/core';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport { LegendItem } from '../Legend';\n\n// adjust display when there are many time series to help with performance\nexport const OPTIMIZED_MODE_SERIES_LIMIT = 1000;\n\nexport type UnixTimeMs = number;\n\nexport interface GraphSeries {\n name: string;\n values: TimeSeriesValueTuple[];\n id?: string;\n}\n\nexport type EChartsValues = number | null | '-';\n\nexport interface LegacyTimeSeries extends Omit<LineSeriesOption, 'data'> {\n data: EChartsValues[];\n}\n\n// Used for TimeChart dataset support, each time series returned is mapped to series options using datasetIndex\n// - https://apache.github.io/echarts-handbook/en/concepts/dataset/#how-to-reference-several-datasets\nexport type TimeChartSeriesMapping = TimeSeriesOption[];\nexport type TimeChartLegendItems = LegendItem[];\n\nexport type TimeSeriesOption = LineSeriesOption | BarSeriesOption;\n\nexport type EChartsDataFormat = {\n timeSeries: LegacyTimeSeries[];\n xAxis: number[];\n legendItems?: LegendItem[];\n xAxisMax?: number | string;\n rangeMs?: number;\n};\n\n// Intentionally making this an object to start because it is plausible we will\n// want to support focusing by other attributes (e.g. index, name) in the future,\n// and starting with an object will make adding them a non-breaking change.\nexport type ChartInstanceFocusOpts = {\n name?: string; // e.g the TimeSeriesChart plugin uses name\n};\n\nexport type ChartInstance = {\n /**\n * Highlight the series associated with the specified options.\n */\n highlightSeries: (opts: ChartInstanceFocusOpts) => void;\n\n /**\n * Clear all highlighted series.\n */\n clearHighlightedSeries: () => void;\n};\n\nexport const PINNED_CROSSHAIR_SERIES_NAME = 'Pinned Crosshair';\n\nexport const DEFAULT_PINNED_CROSSHAIR: LineSeriesOption = {\n name: PINNED_CROSSHAIR_SERIES_NAME,\n type: 'line',\n // https://echarts.apache.org/en/option.html#series-line.markLine\n markLine: {\n data: [],\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n lineStyle: {\n width: 2,\n opacity: 1,\n },\n },\n blur: {\n lineStyle: {\n width: 2,\n opacity: 1,\n },\n },\n },\n};\n\nexport interface DatapointInfo {\n dataIndex: number;\n seriesIndex: number;\n seriesName: string;\n yValue: number;\n}\n"],"names":["OPTIMIZED_MODE_SERIES_LIMIT","PINNED_CROSSHAIR_SERIES_NAME","DEFAULT_PINNED_CROSSHAIR","name","type","markLine","data","lineStyle","width","emphasis","opacity","blur"],"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;AAMjC,0EAA0E;AAC1E,OAAO,MAAMA,8BAA8B,KAAK;AAkDhD,OAAO,MAAMC,+BAA+B,mBAAmB;AAE/D,OAAO,MAAMC,2BAA6C;IACxDC,MAAMF;IACNG,MAAM;IACN,iEAAiE;IACjEC,UAAU;QACRC,MAAM,EAAE;QACRC,WAAW;YACTH,MAAM;YACNI,OAAO;QACT;QACAC,UAAU;YACRF,WAAW;gBACTC,OAAO;gBACPE,SAAS;YACX;QACF;QACAC,MAAM;YACJJ,WAAW;gBACTC,OAAO;gBACPE,SAAS;YACX;QACF;IACF;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/test-utils/theme.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAoB/C,eAAO,MAAM,eAAe,EAAE,iBAE5B,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,iBAK/B,CAAC"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/test-utils/theme.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAoB/C,eAAO,MAAM,eAAe,EAAE,iBAE5B,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,iBAM/B,CAAC"}
@@ -37,6 +37,7 @@ export const testChartsTheme = generateChartsTheme(createMuiTheme({}), {
37
37
  export const mockChartsContext = {
38
38
  chartsTheme: testChartsTheme,
39
39
  enablePinning: false,
40
+ enableSyncGrouping: true,
40
41
  lastTooltipPinnedCoords: null,
41
42
  setLastTooltipPinnedCoords: ()=>null
42
43
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test-utils/theme.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 { createTheme as createMuiTheme } from '@mui/material';\nimport { PersesChartsTheme, EChartsTheme } from '../model';\nimport { generateChartsTheme } from '../utils';\nimport { SharedChartsState } from '../context';\n\n// app specific echarts option overrides\nconst TEST_ECHARTS_THEME_OVERRIDES: EChartsTheme = {\n textStyle: { fontFamily: 'Lato' },\n categoryAxis: {\n splitLine: {\n show: false,\n },\n },\n timeAxis: {\n splitLine: {\n show: false,\n },\n },\n bar: {\n barCategoryGap: 2,\n },\n};\n\nexport const testChartsTheme: PersesChartsTheme = generateChartsTheme(createMuiTheme({}), {\n echartsTheme: TEST_ECHARTS_THEME_OVERRIDES,\n});\n\nexport const mockChartsContext: SharedChartsState = {\n chartsTheme: testChartsTheme,\n enablePinning: false,\n lastTooltipPinnedCoords: null,\n setLastTooltipPinnedCoords: () => null,\n};\n"],"names":["createTheme","createMuiTheme","generateChartsTheme","TEST_ECHARTS_THEME_OVERRIDES","textStyle","fontFamily","categoryAxis","splitLine","show","timeAxis","bar","barCategoryGap","testChartsTheme","echartsTheme","mockChartsContext","chartsTheme","enablePinning","lastTooltipPinnedCoords","setLastTooltipPinnedCoords"],"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,eAAeC,cAAc,QAAQ,gBAAgB;AAE9D,SAASC,mBAAmB,QAAQ,WAAW;AAG/C,wCAAwC;AACxC,MAAMC,+BAA6C;IACjDC,WAAW;QAAEC,YAAY;IAAO;IAChCC,cAAc;QACZC,WAAW;YACTC,MAAM;QACR;IACF;IACAC,UAAU;QACRF,WAAW;YACTC,MAAM;QACR;IACF;IACAE,KAAK;QACHC,gBAAgB;IAClB;AACF;AAEA,OAAO,MAAMC,kBAAqCV,oBAAoBD,eAAe,CAAC,IAAI;IACxFY,cAAcV;AAChB,GAAG;AAEH,OAAO,MAAMW,oBAAuC;IAClDC,aAAaH;IACbI,eAAe;IACfC,yBAAyB;IACzBC,4BAA4B,IAAM;AACpC,EAAE"}
1
+ {"version":3,"sources":["../../src/test-utils/theme.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 { createTheme as createMuiTheme } from '@mui/material';\nimport { PersesChartsTheme, EChartsTheme } from '../model';\nimport { generateChartsTheme } from '../utils';\nimport { SharedChartsState } from '../context';\n\n// app specific echarts option overrides\nconst TEST_ECHARTS_THEME_OVERRIDES: EChartsTheme = {\n textStyle: { fontFamily: 'Lato' },\n categoryAxis: {\n splitLine: {\n show: false,\n },\n },\n timeAxis: {\n splitLine: {\n show: false,\n },\n },\n bar: {\n barCategoryGap: 2,\n },\n};\n\nexport const testChartsTheme: PersesChartsTheme = generateChartsTheme(createMuiTheme({}), {\n echartsTheme: TEST_ECHARTS_THEME_OVERRIDES,\n});\n\nexport const mockChartsContext: SharedChartsState = {\n chartsTheme: testChartsTheme,\n enablePinning: false,\n enableSyncGrouping: true,\n lastTooltipPinnedCoords: null,\n setLastTooltipPinnedCoords: () => null,\n};\n"],"names":["createTheme","createMuiTheme","generateChartsTheme","TEST_ECHARTS_THEME_OVERRIDES","textStyle","fontFamily","categoryAxis","splitLine","show","timeAxis","bar","barCategoryGap","testChartsTheme","echartsTheme","mockChartsContext","chartsTheme","enablePinning","enableSyncGrouping","lastTooltipPinnedCoords","setLastTooltipPinnedCoords"],"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,eAAeC,cAAc,QAAQ,gBAAgB;AAE9D,SAASC,mBAAmB,QAAQ,WAAW;AAG/C,wCAAwC;AACxC,MAAMC,+BAA6C;IACjDC,WAAW;QAAEC,YAAY;IAAO;IAChCC,cAAc;QACZC,WAAW;YACTC,MAAM;QACR;IACF;IACAC,UAAU;QACRF,WAAW;YACTC,MAAM;QACR;IACF;IACAE,KAAK;QACHC,gBAAgB;IAClB;AACF;AAEA,OAAO,MAAMC,kBAAqCV,oBAAoBD,eAAe,CAAC,IAAI;IACxFY,cAAcV;AAChB,GAAG;AAEH,OAAO,MAAMW,oBAAuC;IAClDC,aAAaH;IACbI,eAAe;IACfC,oBAAoB;IACpBC,yBAAyB;IACzBC,4BAA4B,IAAM;AACpC,EAAE"}
@@ -1,8 +1,4 @@
1
1
  import type { XAXisComponentOption, YAXisComponentOption } from 'echarts';
2
2
  import { FormatOptions } from '@perses-dev/core';
3
3
  export declare function getFormattedAxis(axis?: YAXisComponentOption | XAXisComponentOption, unit?: FormatOptions): unknown[];
4
- /**
5
- * Calculate date range, used as a fallback when xAxis time range not passed as prop
6
- */
7
- export declare function getDateRange(data: number[]): number;
8
4
  //# sourceMappingURL=axis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/utils/axis.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAK9D,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,EAAE,CAYpH;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAMnD"}
1
+ {"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/utils/axis.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAK9D,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,EAAE,CAYpH"}