_renderLegend()

in bindings/jupyter-modules/jupyter-ma-causal/src/components/line-chart/index.js [43:74]


  _renderLegend() {
    const {
      data,
      name,
      width,
      padding: {right, top},
    } = this.props;
    if (!data) {
      return null;
    }
    return (
      <React.Fragment>
        <text
          x={width - right - 23}
          y={top + 5}
          dominantBaseline="middle"
          textAnchor="end"
          fontSize={10}
        >
          {name}
        </text>
        <line
          x1={width - right - 20}
          y1={top + 5}
          x2={width - right - 5}
          y2={top + 5}
          stroke="#3399ff"
          strokeWidth={2}
        />
      </React.Fragment>
    );
  }