I use jupyter notebooks to visualise data, and have some routines for generating complex SVG images, the size of which make it difficult see as an overview without losing sight of the detail.
What I'd like to do is import this SVG image into a wrapper like folium or ipyleaflet and use their really smooth mouse-scroll and panning functionality to enable someone to navigate my SVG.
Note, I'm not doing anything Geo-located here, I only want to leverage the UI/navigation features of these libraries so a person can zoom in and out, pan and look around a complex "picture" - and later perhaps, be able to interact with elements of it.
I've tried a few different things, but can't seem to get either of these libraries to accept my SVG as an image:
One option I've tried and had work is taking a screenprint of my html-rendered svg and inserting that into a map:
def create_tree_map():
base_map = folium.Map(crs='Simple', zoom_start=1, tiles=None)
overlay = folium.raster_layers.ImageOverlay(
image="dag_map.png",
bounds=[[0, 0], [500, 500]],
zindex=1)
overlay.add_to(base_map)
base_map.fit_bounds(bounds=[[0, 0], [500, 500]])
base_map.save('test.folium')
return base_map
But I either have to store that png as a large file-size, or lose resolution when I zoom in. Ideally, I'd like the SVG in as un-corrupted a form as possible.
The other angle would be to create a "tileset" but having looked around, am yet to find any documentation on how you go about doing that.