react-chartjs-2
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -18,7 +18,5 @@ var gulp = require('gulp'); | ||
dependencies: [ | ||
'classnames', | ||
'react', | ||
'react-dom', | ||
'chart.js', | ||
'uid' | ||
'chart.js' | ||
], | ||
@@ -25,0 +23,0 @@ lib: 'lib' |
@@ -30,6 +30,2 @@ 'use strict'; | ||
var _uid = require('uid'); | ||
var _uid2 = _interopRequireDefault(_uid); | ||
var ChartComponent = _react2['default'].createClass({ | ||
@@ -64,3 +60,2 @@ | ||
this.chart_instance = undefined; | ||
this.chart_uid = (0, _uid2['default'])(10); | ||
}, | ||
@@ -94,3 +89,3 @@ | ||
var node = _reactDom2['default'].findDOMNode(this.refs[this.getRefKey()]); | ||
var node = _reactDom2['default'].findDOMNode(this); | ||
@@ -104,6 +99,2 @@ this.chart_instance = new _chartJs2['default'](node, { | ||
getRefKey: function getRefKey() { | ||
return 'chart-' + this.chart_uid; | ||
}, | ||
render: function render() { | ||
@@ -116,5 +107,3 @@ var _props2 = this.props; | ||
height: height, | ||
width: width, | ||
ref: this.getRefKey(), | ||
key: this.chart_uid | ||
width: width | ||
}); | ||
@@ -121,0 +110,0 @@ } |
{ | ||
"name": "react-chartjs-2", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "react-chartjs-2", | ||
@@ -16,5 +16,3 @@ "main": "lib/Chart.js", | ||
"dependencies": { | ||
"chart.js": "^2.1.0", | ||
"classnames": "^2.1.2", | ||
"uid": "0.0.2" | ||
"chart.js": "^2.1.0" | ||
}, | ||
@@ -21,0 +19,0 @@ "devDependencies": { |
@@ -5,4 +5,2 @@ import React, {PropTypes} from 'react'; | ||
import uid from 'uid'; | ||
const ChartComponent = React.createClass({ | ||
@@ -37,3 +35,2 @@ | ||
this.chart_instance = undefined; | ||
this.chart_uid = uid(10); | ||
}, | ||
@@ -62,3 +59,3 @@ | ||
const {data, options, legend, type} = this.props; | ||
const node = ReactDOM.findDOMNode(this.refs[this.getRefKey()]); | ||
const node = ReactDOM.findDOMNode(this); | ||
@@ -72,6 +69,2 @@ this.chart_instance = new Chart(node, { | ||
getRefKey() { | ||
return `chart-${this.chart_uid}`; | ||
}, | ||
render() { | ||
@@ -84,4 +77,2 @@ const {height, width} = this.props; | ||
width={width} | ||
ref={this.getRefKey()} | ||
key={this.chart_uid} | ||
/> | ||
@@ -88,0 +79,0 @@ ); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
2
4
24336
593
1
- Removedclassnames@^2.1.2
- Removeduid@0.0.2
- Removedclassnames@2.5.1(transitive)
- Removeduid@0.0.2(transitive)