render()

in src/TreeMap.js [152:200]


  render() {
    const {
      width,
      height,
      nodeStyle,
      labelStyle,
      getLabel,
      minLabelWidth,
      minLabelHeight,
      onClickNode,
      onMouseEnterNode,
      onMouseLeaveNode,
      onMouseMoveNode,
      NodeComponent,
      NodeLabelComponent,
    } = this.props;

    const { rootNode, tree } = this.state;

    const nodes = TreeMap.initTreemap(rootNode, tree, this.props);

    const style = { position: 'relative', width, height };

    const parentNames = uniq(map(nodes, 'parent.data.name'));

    return (
      <div className="rct-tree-map" {...{ style }}>
        {nodes.map((node, i) => (
          <NodeComponent
            {...{
              node,
              nodeStyle,
              minLabelWidth,
              minLabelHeight,
              labelStyle,
              getLabel,
              parentNames,
              NodeLabelComponent,
              onClickNode,
              onMouseEnterNode,
              onMouseLeaveNode,
              onMouseMoveNode,
              key: `node-${i}`,
            }}
          />
        ))}
      </div>
    );
  }