@connectif/ui-components 2.0.9 → 2.0.10

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.
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import './EchartsConfig';
2
3
  import ReactEChartsCore from 'echarts-for-react/lib/core';
3
4
  import { sizes } from '../../theme/Typography';
@@ -42,6 +43,10 @@ export type BarChartProps = {
42
43
  * Formatter function used to format values shown in tooltip.
43
44
  */
44
45
  tooltipEntryFormatter?: ChartTooltipEntryFormatter;
46
+ /**
47
+ * Reference to chart component
48
+ */
49
+ chartRef?: React.RefObject<ReactEChartsCore>;
45
50
  /**
46
51
  * The series to display in the chart.
47
52
  */
@@ -97,5 +102,5 @@ export type BarChartProps = {
97
102
  /**
98
103
  * A bar chart component to display numeric data grouped by categories and series.
99
104
  */
100
- declare const BarChart: ({ style, isLoading, series, categories, labelColor, gridLineColor, gridLabelSize, yAxisLabelFormatter, tooltipEntryFormatter, onClick }: BarChartProps) => import("react/jsx-runtime").JSX.Element;
105
+ declare const BarChart: ({ style, isLoading, series, categories, labelColor, gridLineColor, gridLabelSize, chartRef, yAxisLabelFormatter, tooltipEntryFormatter, onClick }: BarChartProps) => import("react/jsx-runtime").JSX.Element;
101
106
  export default BarChart;
@@ -1,4 +1,6 @@
1
+ import * as React from 'react';
1
2
  import './EchartsConfig';
3
+ import ReactEChartsCore from 'echarts-for-react/lib/core';
2
4
  import { CategorizedChartProps } from './CategorizedChartProps';
3
5
  import { IconId } from '../icon/Icon';
4
6
  import { IncrementLabelType } from '../../propTypes/IncrementLabel';
@@ -110,10 +112,14 @@ export type LineChartProps = CategorizedChartProps & {
110
112
  * Margin to add between labels and x axis. It will be in px
111
113
  */
112
114
  xAxisMargin?: number;
115
+ /**
116
+ * Reference to chart component
117
+ */
118
+ chartRef?: React.RefObject<ReactEChartsCore>;
113
119
  };
114
120
  /**
115
121
  * A line chart component to display numeric data grouped by categories and series.
116
122
  * Commonly, categories use to be sorted dates.
117
123
  */
118
- declare const LineChart: ({ style, isLoading, series, categories, yAxisLabelFormatter, ySecondaryAxisLabelFormatter, onClick, disableSeriesNames, disableAxes, disableSplitLine, fullGrid, axisFontSize, axisFontColor, yAxisPosition, xAxisMargin }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
124
+ declare const LineChart: ({ style, isLoading, series, categories, yAxisLabelFormatter, ySecondaryAxisLabelFormatter, onClick, disableSeriesNames, disableAxes, disableSplitLine, fullGrid, axisFontSize, axisFontColor, yAxisPosition, xAxisMargin, chartRef }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
119
125
  export default LineChart;
package/dist/index.js CHANGED
@@ -12020,6 +12020,7 @@ var BarChart2 = ({
12020
12020
  labelColor = grey400,
12021
12021
  gridLineColor = grey200,
12022
12022
  gridLabelSize = "sm",
12023
+ chartRef,
12023
12024
  yAxisLabelFormatter = (value) => `${value}`,
12024
12025
  tooltipEntryFormatter = ({ data }) => ({
12025
12026
  text: `${data.tooltipName}: ${data.tooltipValue}`
@@ -12271,6 +12272,7 @@ var BarChart2 = ({
12271
12272
  ) : /* @__PURE__ */ jsx67(AutoSizer, { style: { height: "100%", width: "100%" }, children: ({ width: width2 }) => /* @__PURE__ */ jsx67(
12272
12273
  ReactEChartsCore,
12273
12274
  {
12275
+ ref: chartRef,
12274
12276
  style: style3,
12275
12277
  echarts: echarts2,
12276
12278
  option: getEchartsOptions(width2),
@@ -12304,7 +12306,8 @@ var LineChart2 = ({
12304
12306
  axisFontSize = "11px",
12305
12307
  axisFontColor = grey400,
12306
12308
  yAxisPosition = "right",
12307
- xAxisMargin
12309
+ xAxisMargin,
12310
+ chartRef
12308
12311
  }) => {
12309
12312
  const theme2 = useTheme3();
12310
12313
  const cursor2 = onClick ? "pointer" : "default";
@@ -12674,6 +12677,7 @@ var LineChart2 = ({
12674
12677
  children: /* @__PURE__ */ jsx68(
12675
12678
  ReactEChartsCore2,
12676
12679
  {
12680
+ ref: chartRef,
12677
12681
  notMerge: true,
12678
12682
  style: style3,
12679
12683
  echarts: echarts3,