(layers)
| 429 | } |
| 430 | |
| 431 | _drawLabels (layers) { |
| 432 | const chart = this; |
| 433 | layers.each(function (data, layerIndex) { |
| 434 | const layer = select(this); |
| 435 | const labels = layer.selectAll('text.lineLabel') |
| 436 | .data(data.values, pluck('x')); |
| 437 | |
| 438 | const labelsEnterModify = labels |
| 439 | .enter() |
| 440 | .append('text') |
| 441 | .attr('class', 'lineLabel') |
| 442 | .attr('text-anchor', 'middle') |
| 443 | .merge(labels); |
| 444 | |
| 445 | transition(labelsEnterModify, chart.transitionDuration()) |
| 446 | .attr('x', d => utils.safeNumber(chart.x()(d.x))) |
| 447 | .attr('y', d => { |
| 448 | const y = chart.y()(d.y + d.y0) - LABEL_PADDING; |
| 449 | return utils.safeNumber(y); |
| 450 | }) |
| 451 | .text(d => chart.label()(d)); |
| 452 | |
| 453 | transition(labels.exit(), chart.transitionDuration()) |
| 454 | .attr('height', 0) |
| 455 | .remove(); |
| 456 | }); |
| 457 | } |
| 458 | |
| 459 | _createRefLines (g) { |
| 460 | const yRefLine = g.select(`path.${Y_AXIS_REF_LINE_CLASS}`).empty() ? |
no test coverage detected