score:1

Accepted answer

Create a g element for the y-axis outside the update function.

In the update

g_y_axis.call(yaxis);

Why do you have all that code duplication inside the update function?

Put it all in a function and call it with a selection to update the selection.


Related Query

More Query from same tag