@trackunit/react-chart-components 1.3.95 → 1.3.97

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-chart-components",
3
- "version": "1.3.95",
3
+ "version": "1.3.97",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,10 +9,12 @@
9
9
  "dependencies": {
10
10
  "echarts": "5.6.0",
11
11
  "react": "19.0.0",
12
- "@trackunit/ui-design-tokens": "1.3.79",
13
- "@trackunit/shared-utils": "1.5.79",
14
- "@trackunit/css-class-variance-utilities": "1.3.79",
15
- "@trackunit/react-components": "1.4.95"
12
+ "@trackunit/date-and-time-utils": "1.3.80",
13
+ "@trackunit/react-date-and-time-hooks": "1.3.91",
14
+ "@trackunit/ui-design-tokens": "1.3.80",
15
+ "@trackunit/shared-utils": "1.5.80",
16
+ "@trackunit/css-class-variance-utilities": "1.3.80",
17
+ "@trackunit/react-components": "1.4.96"
16
18
  },
17
19
  "module": "./index.esm.js",
18
20
  "main": "./index.cjs.js",
@@ -0,0 +1,54 @@
1
+ import { CommonProps } from "@trackunit/react-components";
2
+ import { ReactElement } from "react";
3
+ export interface ChartData<TProps extends object = object> {
4
+ /**
5
+ * Unique ID for this entry. Not visible for the user
6
+ */
7
+ date: string;
8
+ /**
9
+ * The value to show for to the user
10
+ */
11
+ value?: number;
12
+ /**
13
+ * If selected, it'll be highlighted
14
+ */
15
+ selected?: boolean;
16
+ /**
17
+ * Supply the original object that this chart data item was constructed from. It'll be available on callbacks
18
+ */
19
+ original?: TProps;
20
+ }
21
+ export interface SeriesData<TProps extends object> {
22
+ name: string;
23
+ color?: string;
24
+ data: ChartData<TProps>[];
25
+ }
26
+ export interface BarChartProps<TProps extends object> extends CommonProps {
27
+ /**
28
+ * Array of series of data points to show
29
+ */
30
+ series: SeriesData<TProps> | SeriesData<TProps>[] | undefined;
31
+ /**
32
+ * onClick handler which includes the data object clicked on
33
+ */
34
+ onClick?: (data: ChartData<TProps>) => void;
35
+ /**
36
+ * Show chart as loading
37
+ */
38
+ loading?: boolean;
39
+ /**
40
+ * The units to show in the chart
41
+ */
42
+ units?: string;
43
+ /**
44
+ * Show data zoom
45
+ */
46
+ showDataZoom?: boolean;
47
+ }
48
+ /**
49
+ * Create a BarChart with legends. Based on Chart component
50
+ *
51
+ * @param {BarChartProps} props - The props for the Chart component
52
+ * @returns {ReactElement} Chart component
53
+ */
54
+ export declare const BarChart: <TProps extends object>({ series, loading, onClick, className, dataTestId, units, showDataZoom, }: BarChartProps<TProps>) => ReactElement;
@@ -0,0 +1 @@
1
+ export * from "./BarChart";