(node, x, yScales, showIslands, metric)
| 529 | g.selectAll('line.performance-edge').remove(); |
| 530 | // Helper to get x/y for a node (handles NaN and valid nodes) |
| 531 | function getNodeXY(node, x, yScales, showIslands, metric) { |
| 532 | // Returns [x, y] for a node, handling both valid and NaN nodes |
| 533 | if (!node) return [null, null]; |
| 534 | const y = yScales[showIslands ? node.island : null](node.generation); |
| 535 | if (node.metrics && typeof node.metrics[metric] === 'number') { |
| 536 | return [x(node.metrics[metric]), y]; |
| 537 | } else if (typeof node._nanX === 'number') { |
| 538 | return [node._nanX, y]; |
| 539 | } else { |
| 540 | // fallback: center of NaN box if _nanX not set |
| 541 | // This should not happen, but fallback for safety |
| 542 | return [x.range()[0] - 100, y]; |
| 543 | } |
| 544 | } |
| 545 | g.selectAll('line.performance-edge') |
| 546 | .data(edges, d => d.target.id) |
| 547 | .enter() |
no outgoing calls
no test coverage detected