@oliasoft-open-source/charts-library 2.5.6 → 2.5.8

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.6",
3
+ "version": "2.5.8",
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.8
4
+
5
+ - Disable tooltip animations in `performanceMode`
6
+
7
+ ## 2.5.7
8
+
9
+ - Allow stretchy headerComponent in controls
10
+
3
11
  ## 2.5.6
4
12
 
5
13
  - Removed resizeDelay, fixed double data labels set position
@@ -201,17 +201,14 @@ const BarChart = (props) => {
201
201
  onHover,
202
202
  indexAxis: isVertical(options.direction) ? AxisType.X : AxisType.Y,
203
203
  maintainAspectRatio: chartStyling.maintainAspectRatio,
204
- animation: {
205
- duration: chartStyling.performanceMode
206
- ? ANIMATION_DURATION.NO
207
- : ANIMATION_DURATION.FAST,
208
- },
204
+ animation: chartStyling.performanceMode
205
+ ? false
206
+ : {
207
+ duration: ANIMATION_DURATION.FAST,
208
+ },
209
209
  hover: {
210
210
  mode: ChartHoverMode.Nearest,
211
211
  intersect: true,
212
- animationDuration: chartStyling.performanceMode
213
- ? ANIMATION_DURATION.NO
214
- : ANIMATION_DURATION.SLOW,
215
212
  },
216
213
  elements: {
217
214
  bar: { pointStyle: PointStyle.Circle },
@@ -37,7 +37,7 @@ const Controls = ({
37
37
  return (
38
38
  <>
39
39
  <div className={styles.controls}>
40
- <div>{headerComponent || <Text bold>{chart.options.title}</Text>}</div>
40
+ {headerComponent || <Text bold>{chart.options.title}</Text>}
41
41
  <div className={styles.buttons}>
42
42
  {!showTable && (
43
43
  <>
@@ -435,17 +435,14 @@ const LineChart = (props) => {
435
435
  onHover,
436
436
  maintainAspectRatio: chartStyling.maintainAspectRatio,
437
437
  aspectRatio: chartStyling.squareAspectRatio ? 1 : null, // 1 equals square aspect ratio
438
- animation: {
439
- duration: chartStyling.performanceMode
440
- ? ANIMATION_DURATION.NO
441
- : ANIMATION_DURATION.FAST,
442
- },
438
+ animation: chartStyling.performanceMode
439
+ ? false
440
+ : {
441
+ duration: ANIMATION_DURATION.FAST,
442
+ },
443
443
  hover: {
444
444
  mode: ChartHoverMode.Nearest,
445
445
  intersect: true,
446
- animationDuration: chartStyling.performanceMode
447
- ? ANIMATION_DURATION.NO
448
- : ANIMATION_DURATION.SLOW,
449
446
  },
450
447
  elements: {
451
448
  line: {
@@ -522,6 +522,15 @@ export const HeaderComponent = (args) => {
522
522
  );
523
523
  };
524
524
 
525
+ export const HeaderComponentFullWidth = Template.bind({});
526
+ HeaderComponentFullWidth.args = {
527
+ headerComponent: (
528
+ <div style={{ flexGrow: 1, minWidth: 150 }}>
529
+ <Slider max={100} min={0} onChange={() => {}} showArrows value={50} />
530
+ </div>
531
+ ),
532
+ };
533
+
525
534
  export const SubheaderComponent = Template.bind({});
526
535
  SubheaderComponent.args = {
527
536
  subheaderComponent: (
@@ -15,6 +15,7 @@ import zoomPlugin from 'chartjs-plugin-zoom';
15
15
  import dataLabelsPlugin from 'chartjs-plugin-datalabels';
16
16
  import { Pie } from 'react-chartjs-2';
17
17
 
18
+ import { ANIMATION_DURATION } from '../../helpers/chart-consts';
18
19
  import styles from './pie-chart.module.less';
19
20
  import { colors, generateRandomColor } from './pie-chart-utils';
20
21
  import { getDefaultProps, PieChartPropTypes } from './pie-chart-prop-types';
@@ -404,13 +405,14 @@ const PieChart = (props) => {
404
405
  onClick,
405
406
  responsive: true, // Defaults to true, should be removed
406
407
  maintainAspectRatio: options.chartStyling.maintainAspectRatio,
407
- animation: {
408
- duration: options.chartStyling.performanceMode ? 0 : 1000,
409
- },
408
+ animation: options.chartStyling.performanceMode
409
+ ? false
410
+ : {
411
+ duration: ANIMATION_DURATION.FAST,
412
+ },
410
413
  hover: {
411
414
  mode: 'nearest',
412
415
  intersect: 'true',
413
- animationDuration: options.chartStyling.performanceMode ? 0 : 400,
414
416
  },
415
417
  onHover,
416
418
  elements: {