react-chartjs-2
Advanced tools
Comparing version 3.0.4 to 3.0.5
@@ -127,3 +127,3 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
}); | ||
if (!currentDataSet || !newDataSet.data) return newDataSet; | ||
if (!currentDataSet || !newDataSet.data) return _extends({}, newDataSet); | ||
@@ -137,5 +137,6 @@ if (!currentDataSet.data) { | ||
assign(currentDataSet.data, newDataSet.data); | ||
return _extends({}, currentDataSet, newDataSet, { | ||
assign(currentDataSet, _extends({}, newDataSet, { | ||
data: currentDataSet.data | ||
}); | ||
})); | ||
return currentDataSet; | ||
}); | ||
@@ -142,0 +143,0 @@ chart.update(); |
@@ -124,3 +124,3 @@ import React, { forwardRef, useRef, useMemo, useState, useImperativeHandle, useEffect } from 'react'; | ||
}); | ||
if (!currentDataSet || !newDataSet.data) return newDataSet; | ||
if (!currentDataSet || !newDataSet.data) return _extends({}, newDataSet); | ||
@@ -134,5 +134,6 @@ if (!currentDataSet.data) { | ||
assign(currentDataSet.data, newDataSet.data); | ||
return _extends({}, currentDataSet, newDataSet, { | ||
assign(currentDataSet, _extends({}, newDataSet, { | ||
data: currentDataSet.data | ||
}); | ||
})); | ||
return currentDataSet; | ||
}); | ||
@@ -139,0 +140,0 @@ chart.update(); |
@@ -124,6 +124,5 @@ (function (global, factory) { | ||
assign(chart.config.data, newChartData); | ||
console.log(chart.config.data.datasets); | ||
currentDataSets.forEach(function (currentDataSet) { | ||
var newDataSet = find(newDataSets, function (d) { | ||
return d.label === currentDataSet.label && d.type === currentDataSet.type; | ||
chart.config.data.datasets = newDataSets.map(function (newDataSet) { | ||
var currentDataSet = find(currentDataSets, function (d) { | ||
return d.label === newDataSet.label && d.type === newDataSet.type; | ||
}); | ||
@@ -138,5 +137,3 @@ if (!currentDataSet || !newDataSet.data) return newDataSet; | ||
console.log(currentDataSet.data); | ||
assign(currentDataSet.data, newDataSet.data); | ||
console.log(currentDataSet.data); | ||
return _extends({}, currentDataSet, newDataSet, { | ||
@@ -143,0 +140,0 @@ data: currentDataSet.data |
/// <reference types="react" /> | ||
import Chart from 'chart.js/auto'; | ||
import type * as Chart from 'chart.js'; | ||
export interface Props extends React.CanvasHTMLAttributes<HTMLCanvasElement> { | ||
@@ -13,3 +13,3 @@ id?: string; | ||
fallbackContent?: React.ReactNode; | ||
plugins?: Chart.PluginServiceRegistrationOptions[]; | ||
plugins?: Chart.PluginOptionsByType<Chart.ChartType>; | ||
getDatasetAtEvent?: (dataset: Array<{}>, event: React.MouseEvent<HTMLCanvasElement>) => void; | ||
@@ -16,0 +16,0 @@ getElementAtEvent?: (element: [{}], event: React.MouseEvent<HTMLCanvasElement>) => void; |
{ | ||
"name": "react-chartjs-2", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "React components for Chart.js", | ||
@@ -44,3 +44,3 @@ "source": "src/index.tsx", | ||
"peerDependencies": { | ||
"chart.js": "^3.1.0", | ||
"chart.js": "^3.5.0", | ||
"react": "^16.8.0 || ^17.0.0" | ||
@@ -82,2 +82,2 @@ }, | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
282773
2
5282