@oliasoft-open-source/charts-library 2.5.23 → 2.5.25

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": "@oliasoft-open-source/charts-library",
3
- "version": "2.5.23",
3
+ "version": "2.5.25",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/release-notes.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Charts Library Release Notes
2
2
 
3
+ ## 2.5.25
4
+
5
+ - Fix axis ranges updating when new chart data and ranges is passed
6
+
7
+ ## 2.5.24
8
+
9
+ - Add performance test case
10
+
3
11
  ## 2.5.23
4
12
 
5
13
  - Patch minor regression in axis limits introduced in 2.5.22
@@ -97,6 +97,7 @@ export const LineChartPropTypes = {
97
97
  onLegendClick: PropTypes.func,
98
98
  onPointHover: PropTypes.func,
99
99
  onPointUnhover: PropTypes.func,
100
+ onAnimationComplete: PropTypes.func,
100
101
  }),
101
102
  }),
102
103
  }).isRequired,
@@ -193,6 +194,8 @@ export const getDefaultProps = (props) => {
193
194
  onLegendClick: props.chart.options.interactions.onLegendClick,
194
195
  onPointHover: props.chart.options.interactions.onPointHover,
195
196
  onPointUnhover: props.chart.options.interactions.onPointUnhover,
197
+ onAnimationComplete:
198
+ props.chart.options.interactions.onAnimationComplete,
196
199
  },
197
200
  },
198
201
  };
@@ -99,7 +99,6 @@ const LineChart = (props) => {
99
99
  const chart = getDefaultProps(props);
100
100
  const { options, testId } = chart;
101
101
  const { headerComponent, subheaderComponent, table } = props;
102
-
103
102
  const {
104
103
  additionalAxesOptions,
105
104
  annotations,
@@ -130,6 +129,24 @@ const LineChart = (props) => {
130
129
  initialState,
131
130
  );
132
131
 
132
+ useEffect(() => {
133
+ const { range } = props.chart.options.additionalAxesOptions;
134
+ if (range) {
135
+ const axes = Object.entries(range).map(([key, { min, max }]) => {
136
+ return {
137
+ id: key,
138
+ min: min ?? 0,
139
+ max: max ?? 0,
140
+ };
141
+ });
142
+
143
+ dispatch({
144
+ type: UPDATE_AXES_RANGES,
145
+ payload: { axes },
146
+ });
147
+ }
148
+ }, [props.chart.options.additionalAxesOptions.range]);
149
+
133
150
  useEffect(() => {
134
151
  if (chartOptions.enablePan !== true) {
135
152
  dispatch({ type: TOGGLE_PAN });
@@ -450,6 +467,7 @@ const LineChart = (props) => {
450
467
  ? false
451
468
  : {
452
469
  duration: ANIMATION_DURATION.FAST,
470
+ onComplete: interactions.onAnimationComplete,
453
471
  },
454
472
  hover: {
455
473
  mode: ChartHoverMode.Nearest,