Hello, thanks for your answer,
the code does not use d3.js, but the application to d3.js is quite obvious IMHO so I figured that it will interest people here :)
as for the question, I think I understand how event bubbling works, but it was not the question, my question was: how to create a mechanism that allows several layers that are not inside each other like with event-bubbling, but rather side-by-side (covering because of an absolute CSS position) to all get the mouse events one by one until one of them captures the event.
eg.
<svg id="id1">...</svg>
<svg id="id2">...</svg>
#id2 covers #id1, and the user clicks on an element in #id2, how do I "recreate" a click event at the right position in #id1 such that the element of id1 beneath the mouse gets the click event?
Right now I manage to recreate the click event in #id2 at the root, but for some reason the event does not seem to bubble up the other layers, so only #id1.on('click') is activated, and not event handlers of objects in #id1