From eaa572aafe439daeb0bb5a747a36a564de38baab Mon Sep 17 00:00:00 2001 From: Tyler Long Date: Tue, 6 Mar 2018 18:05:03 +0800 Subject: [PATCH] Fix git graph --- src/diagrams/gitGraph/gitGraphRenderer.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/diagrams/gitGraph/gitGraphRenderer.js b/src/diagrams/gitGraph/gitGraphRenderer.js index 3d3b247fd..930e6ee8d 100644 --- a/src/diagrams/gitGraph/gitGraphRenderer.js +++ b/src/diagrams/gitGraph/gitGraphRenderer.js @@ -52,16 +52,19 @@ function svgCreateDefs (svg) { } function svgDrawLine (svg, points, colorIdx, interpolate) { - interpolate = interpolate || 'basis' + let curve = d3.curveBasis + if (interpolate === 'linear') { + curve = d3.curveLinear + } const color = config.branchColors[colorIdx % config.branchColors.length] - const lineGen = d3.svg.line() + const lineGen = d3.line() .x(function (d) { return Math.round(d.x) }) .y(function (d) { return Math.round(d.y) }) - .interpolate(interpolate) + .curve(curve) svg .append('svg:path')