zingchart-react
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -82,2 +82,4 @@ import React, { Component } from 'react'; | ||
'postzoom', | ||
'zingchart.plugins.dragging.update', | ||
'zingchart.plugins.dragging.complete', | ||
'heatmap.mousemove', | ||
@@ -388,15 +390,27 @@ 'zingchart.plugins.selection-tool.mouseup', | ||
}, { | ||
key: 'bindEvent', | ||
value: function bindEvent(eventName, originalEventName) { | ||
var _this2 = this; | ||
if (EVENT_NAMES$1.includes(eventName)) { | ||
// Filter through the provided events list, then register it to zingchart. | ||
window.zingchart.bind(this.id, eventName, function (result) { | ||
_this2.props[originalEventName || eventName](result); | ||
}); | ||
return true; | ||
} else { | ||
return false; | ||
} } | ||
}, { | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
var _this2 = this; | ||
var _this3 = this; | ||
// Bind all events registered. | ||
Object.keys(this.props).forEach(function (eventName) { | ||
if (EVENT_NAMES$1.includes(eventName)) { | ||
// Filter through the provided events list, then register it to zingchart. | ||
window.zingchart.bind(_this2.id, eventName, function (result) { | ||
_this2.props[eventName](result); | ||
}); | ||
} | ||
}); | ||
if (!_this3.bindEvent(eventName)) { | ||
// Replace '_' with '.' and attempt again | ||
var newEventName = eventName.replace(/\_/g, '.'); | ||
_this3.bindEvent(newEventName, eventName); | ||
} }); | ||
@@ -445,7 +459,7 @@ this.renderChart(); | ||
value: function renderChart() { | ||
var _this3 = this; | ||
var _this4 = this; | ||
var renderObject = {}; | ||
Object.keys(this.props).forEach(function (prop) { | ||
renderObject[prop] = _this3.props[prop]; | ||
renderObject[prop] = _this4.props[prop]; | ||
}); | ||
@@ -452,0 +466,0 @@ // Overwrite some existing props. |
@@ -87,2 +87,4 @@ 'use strict'; | ||
'postzoom', | ||
'zingchart.plugins.dragging.update', | ||
'zingchart.plugins.dragging.complete', | ||
'heatmap.mousemove', | ||
@@ -393,15 +395,27 @@ 'zingchart.plugins.selection-tool.mouseup', | ||
}, { | ||
key: 'bindEvent', | ||
value: function bindEvent(eventName, originalEventName) { | ||
var _this2 = this; | ||
if (EVENT_NAMES$1.includes(eventName)) { | ||
// Filter through the provided events list, then register it to zingchart. | ||
window.zingchart.bind(this.id, eventName, function (result) { | ||
_this2.props[originalEventName || eventName](result); | ||
}); | ||
return true; | ||
} else { | ||
return false; | ||
} } | ||
}, { | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
var _this2 = this; | ||
var _this3 = this; | ||
// Bind all events registered. | ||
Object.keys(this.props).forEach(function (eventName) { | ||
if (EVENT_NAMES$1.includes(eventName)) { | ||
// Filter through the provided events list, then register it to zingchart. | ||
window.zingchart.bind(_this2.id, eventName, function (result) { | ||
_this2.props[eventName](result); | ||
}); | ||
} | ||
}); | ||
if (!_this3.bindEvent(eventName)) { | ||
// Replace '_' with '.' and attempt again | ||
var newEventName = eventName.replace(/\_/g, '.'); | ||
_this3.bindEvent(newEventName, eventName); | ||
} }); | ||
@@ -450,7 +464,7 @@ this.renderChart(); | ||
value: function renderChart() { | ||
var _this3 = this; | ||
var _this4 = this; | ||
var renderObject = {}; | ||
Object.keys(this.props).forEach(function (prop) { | ||
renderObject[prop] = _this3.props[prop]; | ||
renderObject[prop] = _this4.props[prop]; | ||
}); | ||
@@ -457,0 +471,0 @@ // Overwrite some existing props. |
{ | ||
"name": "zingchart-react", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "ZingChart React Component wrapper to allow native react syntax for javascript charts, chart events, chart methods and chart styling.", | ||
@@ -5,0 +5,0 @@ "author": "ZingSoft Inc.", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2946788
6628