in src/AreaBarChart.js [126:174]
render() {
const {
xScale,
yScale,
data,
horizontal,
x,
xEnd,
y,
yEnd,
barClassName,
barStyle,
} = this.props;
return (
<g>
{data.map((d, i) => {
const [onMouseEnter, onMouseMove, onMouseLeave] = [
'onMouseEnterBar',
'onMouseMoveBar',
'onMouseLeaveBar',
].map(eventName => {
// partially apply this bar's data point as 2nd callback argument
const callback = get(this.props, eventName);
return isFunction(callback) ? bindTrailingArgs(callback, d) : null;
});
return (
<RangeRect
{...{
xScale,
yScale,
className: `rct-chart-area-bar ${getValue(barClassName, d, i)}`,
style: getValue(barStyle, d, i),
x: horizontal ? 0 : getValue(x, d, i),
xEnd: horizontal ? getValue(x, d, i) : getValue(xEnd, d, i),
y: !horizontal ? 0 : getValue(y, d, i),
yEnd: !horizontal ? getValue(y, d, i) : getValue(yEnd, d, i),
key: `rct-chart-area-bar-${i}`,
onMouseEnter,
onMouseMove,
onMouseLeave,
}}
/>
);
})}
</g>
);
}