I simply want to draw a line which is attached to g with x1/y1 and to svg with the other end x2/y2.
The reason is because I have a div at the right side of my map and the line should point to it. Now when scrolling around in the map, the one end should always point to the div at the right side and the other end should point i.e. on california.
I've created a JSFiddle where you can change g to svg to see what I mean.
How can I use both?
g.append('line')
.style("stroke", "lightgreen")
.style("stroke-width", 10)
.attr("x1", 960)
.attr("y1", 200)
.attr("x2", 200)
.attr("y2", 400);
});