Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const previousAreaGraph = area(previousScaledData);
const previousLineGraph = line(previousScaledData);
const areaGraph = area(scaledData);
const lineGraph = line(scaledData);
graph.selectAll("path").remove();
graph
.append("path")
.attr("class", "area")
.attr("d", previousAreaGraph)
.style("fill", previousColor.fill)
.transition()
.duration(transitionDuration)
.ease(TRANSITION.ease)
.attrTween("d", interpolatePath.bind(null, previousAreaGraph, areaGraph))
.style("fill", color.fill);
graph
.append("path")
.attr("class", "line")
.attr("d", previousLineGraph)
.style("stroke", previousColor.stroke)
.transition()
.duration(transitionDuration)
.ease(TRANSITION.ease)
.attrTween("d", interpolatePath.bind(null, previousLineGraph, lineGraph))
.style("stroke", color.stroke);
}
.style("fill", previousColor.fill)
.transition()
.duration(transitionDuration)
.ease(TRANSITION.ease)
.attrTween("d", interpolatePath.bind(null, previousAreaGraph, areaGraph))
.style("fill", color.fill);
graph
.append("path")
.attr("class", "line")
.attr("d", previousLineGraph)
.style("stroke", previousColor.stroke)
.transition()
.duration(transitionDuration)
.ease(TRANSITION.ease)
.attrTween("d", interpolatePath.bind(null, previousLineGraph, lineGraph))
.style("stroke", color.stroke);
}