score:2

Accepted answer

You update everything in the refresh function except the lines, you just need to update those as well.

You can't use svg.selectAll(".lines").attr("d", lineToLondon) because you have a g with a class lines holding all the paths with that class. Instead you can use:

 svg.selectAll("path.lines").attr("d", lineToLondon);

One thing to note is that you don't need these lines in your code:

svg.selectAll(".lines").attr("d", (d) => {
  if (d) {
    return lineToLondon(d);
  }
});

Here's an updated fiddle with those changes.


Related Query