_renderLegends()

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


  _renderLegends() {
    const {
      data,
      width,
      padding: {right, top},
    } = this.props;
    if (!data || !data.lines) {
      return null;
    }
    return data.lines.map((d, i) => (
      <React.Fragment key={i}>
        <text
          x={width - right - 23}
          y={top + 5 + 15 * i}
          dominantBaseline="middle"
          textAnchor="end"
          fontSize={10}
        >
          {d.name}
        </text>
        <line
          x1={width - right - 20}
          y1={top + 5 + 15 * i}
          x2={width - right - 5}
          y2={top + 5 + 15 * i}
          stroke={colorScale(i)}
          strokeWidth={2}
        />
      </React.Fragment>
    ));
  }