sabinesin / nuclear-vis

Nuclear Detonations InfoVis
1 stars 0 forks source link

Panning / Tooltips #24

Open Tanner opened 11 years ago

Tanner commented 11 years ago

As of 66cceb1c202e91506e8f32dd0f955a1bccfa3f00, tooltips and panning both coexist.

However, it's not a happy coexistence. Panning only occurs when the mouse is over the ocean.

I've tried to fix it by moving the overlay rect around in the SVG layers. The overlay controls the pan/zoom of the map. The tooltips are shown when a country (in countries) is moused over.

One way of solving it is by putting the overlay above the map, i.e. the drawn countries, and below the detonations. That way you can move the map and still get tooltips.

<g id="viewer" ...>
   <g id="map">...</g>
   <rect class="overlay" ...></rect>
   <g id="countries">...</g>
</g>

However, you get a weird jank effect.

recording

Everything else seems fine though.

I think the jank is caused by the overlay (receiving and handling the zoom/pan events) being in the viewer which is being translated/zoomed.

I'm not sure what to do right now, but once this is figured out we can do a real fix for #17. What we have now is at least working.