react-d3-shape
Advanced tools
Comparing version 0.2.21 to 0.2.22
@@ -56,3 +56,3 @@ "use strict"; | ||
null, | ||
dataset.map(function (area) { | ||
dataset.map(function (area, i) { | ||
return _react2.default.createElement('path', { | ||
@@ -62,3 +62,4 @@ className: areaClassName + ' area', | ||
d: that._setAxes(area.data), | ||
style: area.style | ||
style: area.style, | ||
key: i | ||
}); | ||
@@ -65,0 +66,0 @@ }) |
@@ -87,4 +87,4 @@ "use strict"; | ||
'g', | ||
{ className: 'bargroup' }, | ||
barGroup.data.map(function (bar) { | ||
{ className: 'bargroup', key: i }, | ||
barGroup.data.map(function (bar, j) { | ||
return _react2.default.createElement('rect', { | ||
@@ -99,3 +99,4 @@ className: barClassName + ' bar', | ||
onMouseOver: that.triggerOver.bind(_this2, bar), | ||
style: barGroup.style | ||
style: barGroup.style, | ||
key: j | ||
}); | ||
@@ -102,0 +103,0 @@ }) |
@@ -82,5 +82,6 @@ "use strict"; | ||
'g', | ||
{ className: 'bargroup' }, | ||
barGroup.data.map(function (bar) { | ||
{ className: 'bargroup', key: i }, | ||
barGroup.data.map(function (bar, j) { | ||
return _react2.default.createElement('rect', { | ||
key: j, | ||
className: barClassName + ' bar', | ||
@@ -87,0 +88,0 @@ width: x1.bandwidth(), |
@@ -71,3 +71,3 @@ "use strict"; | ||
null, | ||
dataset.data.map(function (bar) { | ||
dataset.data.map(function (bar, i) { | ||
return _react2.default.createElement('rect', { | ||
@@ -82,3 +82,4 @@ className: barClassName + ' bar', | ||
onMouseOut: that.triggerOut.bind(_this2, bar), | ||
onMouseOver: that.triggerOver.bind(_this2, bar) | ||
onMouseOver: that.triggerOver.bind(_this2, bar), | ||
key: i | ||
}); | ||
@@ -85,0 +86,0 @@ }) |
@@ -80,3 +80,3 @@ "use strict"; | ||
null, | ||
_setStack(dataset).map(function (barGroup) { | ||
_setStack(dataset).map(function (barGroup, i) { | ||
return _react2.default.createElement( | ||
@@ -87,5 +87,6 @@ 'g', | ||
fill: barGroup.color, | ||
style: barGroup.style | ||
style: barGroup.style, | ||
key: i | ||
}, | ||
barGroup.data.map(function (bar) { | ||
barGroup.data.map(function (bar, j) { | ||
return _react2.default.createElement('rect', { | ||
@@ -98,3 +99,4 @@ className: barClassName + ' bar', | ||
onMouseOut: that.triggerOut.bind(_this2, bar), | ||
onMouseOver: that.triggerOver.bind(_this2, bar) | ||
onMouseOver: that.triggerOver.bind(_this2, bar), | ||
key: j | ||
}); | ||
@@ -101,0 +103,0 @@ }) |
@@ -82,10 +82,11 @@ "use strict"; | ||
null, | ||
_setStack(dataset).map(function (barGroup) { | ||
_setStack(dataset).map(function (barGroup, i) { | ||
return _react2.default.createElement( | ||
'g', | ||
{ | ||
key: j, | ||
className: 'barGroup', | ||
fill: barGroup.color, | ||
style: barGroup.style }, | ||
barGroup.data.map(function (bar) { | ||
barGroup.data.map(function (bar, j) { | ||
return _react2.default.createElement('rect', { | ||
@@ -99,3 +100,4 @@ className: barClassName + ' bar', | ||
onMouseOver: that.triggerOver.bind(_this2, bar), | ||
onClick: that.triggerClick.bind(_this2, bar) | ||
onClick: that.triggerClick.bind(_this2, bar), | ||
key: j | ||
}); | ||
@@ -102,0 +104,0 @@ }) |
@@ -43,2 +43,7 @@ "use strict"; | ||
}, { | ||
key: 'triggerClick', | ||
value: function triggerClick(data, e) { | ||
this.props.onClick(e, data); | ||
} | ||
}, { | ||
key: '_mkBar', | ||
@@ -73,3 +78,3 @@ value: function _mkBar() { | ||
null, | ||
dataset.data.map(function (bar) { | ||
dataset.data.map(function (bar, i) { | ||
return _react2.default.createElement('rect', { | ||
@@ -84,3 +89,5 @@ className: barClassName + ' bar', | ||
onMouseOut: that.triggerOut.bind(_this2, bar), | ||
onMouseOver: that.triggerOver.bind(_this2, bar) | ||
onMouseOver: that.triggerOver.bind(_this2, bar), | ||
onClick: that.triggerClick.bind(_this2, bar), | ||
key: i | ||
}); | ||
@@ -109,4 +116,5 @@ }) | ||
onMouseOut: function onMouseOut(d) {}, | ||
onClick: function onClick(d) {}, | ||
barClassName: 'react-d3-basic__bar' | ||
}; | ||
exports.default = Bar; |
{ | ||
"name": "react-d3-shape", | ||
"version": "0.2.21", | ||
"version": "0.2.22", | ||
"description": "react shape component", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
813130
14889