render()

in modules/graph-builder/src/index.js [48:103]


  render() {
    if (!this.state.graph) {
      return null;
    }
    return (
      <div
        style={{
          background: '#fff',
          position: 'relative',
          width: '100%',
          height: '100%',
        }}
      >
        <GraphGL
          graph={this.state.graph}
          layout={new D3ForceLayout()}
          nodeEvents={{
            onClick: this.props.onNodeClick,
          }}
          nodeStyle={[
            {
              type: NODE_TYPE.MARKER,
              size: this.props.nodeSize,
              fill: this.props.nodeColor,
              marker: 'circle-filled',

              ':hover': {
                fill: 'orange',
              },
            },
            {
              type: NODE_TYPE.LABEL,
              text: node => String(node.id).substring(0, 6),
              color: 'black',
              fontSize: 15,
              offset: [0, 12],
              scaleWithZoom: true,

              ':hover': {
                text: 'hover',
                color: 'white',
              },
            },
          ]}
          enableDragging
          edgeEvents={{
            onClick: this.props.onEdgeClick,
          }}
          edgeStyle={{
            stroke: this.props.edgeColor,
            strokeWidth: this.props.edgeWidth,
          }}
        />
      </div>
    );
  }