I've been trying to create a smooth map-like experience for exploring a big chart I've made using D3.js
Every node on the chart is linked to a particular webpage and I plan to add info-bubbles to display english translation. You can see some results below. (1) is very laggy when using the D3 function zoom and drag, but gives the appropriate result in terms of interactivity. Using libvips I was able to create custom PNG tiles to experiment with leaflet and openLayer. This works very nicely but have no interactivity at all. I was able to do a small openLayer app to display the entire SVG (6), but the result is laggy.
I imagine it is possible to transfer the interactive data from the original SVG (I could use <a>
element instead of .on("click")
) and create a layer on top of the PNG tiles. But I have no idea how to do that. The other alternative I thought was to create SVG tiles or vector tiles, but I could not find anything about that or any library/software that would slice a SVG in tiled SVG files.
SVG mapper sounds promising when I read the description, but seems too specific to geo data to be useful. (Here is their working exemple, although the tiles are missing in the background and zoom is broken)
This leaflet + D3 is interesting also. (with improvement)
Any advice is welcome as I'm a bit stuck at the moment. Thanks !
I ended up adding markers on top of the PNG tiles with OpenLayers. One has to be careful when extracting the coordinates of the markers in D3 to match the coordinate system in OpenLayers.
The final code is in this repo in main.js. The resulting app is here