Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{nodes.map((node, i) => {
const { x, y, dx, dy } = node;
const nodeProps = {
...getPresentationAttributes(nodeContent),
x: x + left,
y: y + top,
width: dx,
height: dy,
index: i,
payload: node
};
const events = {
onMouseEnter: this.handleMouseEnter.bind(this, nodeProps, 'node'),
onMouseLeave: this.handleMouseLeave.bind(this, nodeProps, 'node'),
onClick: this.handleClick.bind(this, nodeProps, 'node')
};
return (
{this.constructor.renderNodeItem(nodeContent, nodeProps)}
} = props;
return (
render() {
if (!validateWidthHeight(this)) {
return null;
}
const { width, height, className, style, children, ...others } = this.props;
const { links, nodes } = this.state;
const attrs = getPresentationAttributes(others);
return (
<div height="" style="{{">
{filterSvgElements(children)}
{this.renderLinks(links, nodes)}
{this.renderNodes(nodes)}</div>
const sourceY = source.y + sourceRelativeY + linkWidth / 2 + top;
const targetY = target.y + targetRelativeY + linkWidth / 2 + top;
const linkProps = {
sourceX,
targetX,
sourceY,
targetY,
sourceControlX,
targetControlX,
sourceRelativeY,
targetRelativeY,
linkWidth,
index: i,
payload: { ...link, source, target },
...getPresentationAttributes(linkContent)
};
const events = {
onMouseEnter: this.handleMouseEnter.bind(this, linkProps, 'link'),
onMouseLeave: this.handleMouseLeave.bind(this, linkProps, 'link'),
onClick: this.handleClick.bind(this, linkProps, 'link')
};
return (
{this.constructor.renderLinkItem(linkContent, linkProps)}
);
})}