_renderYAxis()

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


  _renderYAxis() {
    const {
      height,
      padding: {bottom, left, top},
    } = this.props;
    const yScale = this._getYScale();
    const format = d3Format('.1f');

    return (
      <React.Fragment>
        <line
          x1={left}
          y1={height - bottom}
          x2={left}
          y2={top}
          stroke="black"
          strokeWidth={1}
        />
        {yScale.ticks(10).map(t => {
          const y = yScale(t);
          return (
            <React.Fragment key={t}>
              <line
                x1={left}
                y1={y}
                x2={left - 4}
                y2={y}
                stroke="black"
                strokeWidth={1}
              />
              <text
                x={left - 6}
                y={y}
                dominantBaseline="middle"
                textAnchor="end"
                fontSize={10}
              >
                {format(t)}
              </text>
            </React.Fragment>
          );
        })}
      </React.Fragment>
    );
  }