How to use the recharts/lib/util/ReactUtils.getPresentationAttributes function in recharts

To help you get started, we’ve selected a few recharts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Vizzuality / gfw / app / javascript / components / charts / sankey-chart / sankey-component.js View on Github external
{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)}
github Vizzuality / gfw / app / javascript / components / charts / sankey-chart / sankey-component.js View on Github external
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>
github Vizzuality / gfw / app / javascript / components / charts / sankey-chart / sankey-component.js View on Github external
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)}
            
          );
        })}