react-chartjs-2
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -80,3 +80,3 @@ import React, { forwardRef, useRef, useEffect } from 'react'; | ||
function ChartComponent(param, ref) { | ||
let { height =150 , width =300 , redraw =false , datasetIdKey , type , data , options , plugins =[] , fallbackContent , ...props } = param; | ||
let { height =150 , width =300 , redraw =false , datasetIdKey , type , data , options , plugins =[] , fallbackContent , updateMode , ...props } = param; | ||
const canvasRef = useRef(null); | ||
@@ -131,3 +131,3 @@ const chartRef = useRef(); | ||
} else { | ||
chartRef.current.update(); | ||
chartRef.current.update(updateMode); | ||
} | ||
@@ -138,3 +138,4 @@ }, [ | ||
data.labels, | ||
data.datasets | ||
data.datasets, | ||
updateMode | ||
]); | ||
@@ -141,0 +142,0 @@ useEffect(()=>{ |
import type { CanvasHTMLAttributes, MutableRefObject, ReactNode } from 'react'; | ||
import type { Chart, ChartType, ChartData, ChartOptions, DefaultDataPoint, Plugin } from 'chart.js'; | ||
import type { Chart, ChartType, ChartData, ChartOptions, DefaultDataPoint, Plugin, UpdateMode } from 'chart.js'; | ||
export declare type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null; | ||
@@ -43,2 +43,7 @@ export interface ChartProps<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown> extends CanvasHTMLAttributes<HTMLCanvasElement> { | ||
fallbackContent?: ReactNode; | ||
/** | ||
* A mode string to indicate transition configuration should be used. | ||
* @see https://www.chartjs.org/docs/latest/developers/api.html#update-mode | ||
*/ | ||
updateMode?: UpdateMode; | ||
} | ||
@@ -45,0 +50,0 @@ /** |
{ | ||
"name": "react-chartjs-2", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "React components for Chart.js", | ||
@@ -5,0 +5,0 @@ "author": "Jeremy Ayerst", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
54941
469