@oliasoft-open-source/charts-library 2.5.0 → 2.5.2

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.0",
3
+ "version": "2.5.2",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "main": "index.js",
6
6
  "files": [
package/release-notes.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Charts Library Release Notes
2
2
 
3
+ ## 2.5.1
4
+
5
+ - Fix crashes when type a non number into the axis range - add validation in getLinechartAxis method
6
+
7
+ ## 2.5.1
8
+
9
+ - Added resize delay for performance
10
+
3
11
  ## 2.5.0
4
12
 
5
13
  - Separate controls for points/lines, axes options, legend, download
@@ -199,6 +199,7 @@ const BarChart = (props) => {
199
199
  options={{
200
200
  onClick,
201
201
  onHover,
202
+ resizeDelay: 50,
202
203
  indexAxis: isVertical(options.direction) ? AxisType.X : AxisType.Y,
203
204
  maintainAspectRatio: chartStyling.maintainAspectRatio,
204
205
  animation: {
@@ -57,8 +57,12 @@ const getLineChartAxis = (options, axisType, state, currentScales, i = 0) => {
57
57
  reverse: axisType === AxisType.Y ? additionalAxesOptions.reverse : false,
58
58
  suggestedMax: additionalAxesOptions.suggestedMax,
59
59
  suggestedMin: additionalAxesOptions.suggestedMin,
60
- min: stateAxis.min?.value || additionalAxesOptions?.range?.[axisType]?.min,
61
- max: stateAxis.max?.value || additionalAxesOptions?.range?.[axisType]?.max,
60
+ min: stateAxis.min?.valid
61
+ ? stateAxis.min?.value
62
+ : additionalAxesOptions?.range?.[axisType]?.min,
63
+ max: stateAxis.max?.valid
64
+ ? stateAxis.max?.value
65
+ : additionalAxesOptions?.range?.[axisType]?.max,
62
66
  title: {
63
67
  display: axisData.label?.length,
64
68
  text: axisData.label,
@@ -104,6 +108,7 @@ const getLineChartScales = (options, state) => {
104
108
  const yAxes = hasMultipleYAxes
105
109
  ? getLineChartAxes(options, AxisType.Y, state)
106
110
  : { y: getLineChartAxis(options, AxisType.Y, state) };
111
+
107
112
  return {
108
113
  ...xAxes,
109
114
  ...yAxes,
@@ -432,6 +432,7 @@ const LineChart = (props) => {
432
432
  options={{
433
433
  onClick,
434
434
  onHover,
435
+ resizeDelay: 50,
435
436
  maintainAspectRatio: chartStyling.maintainAspectRatio,
436
437
  aspectRatio: chartStyling.squareAspectRatio ? 1 : null, // 1 equals square aspect ratio
437
438
  animation: {
@@ -413,6 +413,7 @@ const PieChart = (props) => {
413
413
  animationDuration: options.chartStyling.performanceMode ? 0 : 400,
414
414
  },
415
415
  onHover,
416
+ resizeDelay: 50,
416
417
  elements: {
417
418
  pie: {
418
419
  pointStyle: 'circle',