Iāve created a scattergeo plot with plotly offline & Python to be used in an offline html dashboard.
The plot uses the default world map; the topojson file āworld_110m.json,ā which is clearly retrieved from cdn.plot.ly.
Iāve downloaded the world_110m.json from cdn.plot.ly.
Iād like to place this .json in a folder ātopojson,ā in the same directory as the local html copy of my scattergeo plot in order for the map to load without an internet connection.
Does anyone have any idea how to achieve this?
I didnāt expect it to work; but so far I tried specifying the following in the plot configuration: {ātopojsonURLā:ā./topojson/ā}
With this method; opening the plot with chrome I get the following error messages in the browser console:
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Error: unexpected error while fetching topojson file at ./topojson/world_110m.json
Youāve got the right idea, the trouble is youāre running in to your browserās same-origin policy, which prevents loading generic data files (like json) from the file system. The three.js project has nice page covering this concept and some ways to work around it (see https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally).
Basically you can open the html file using a webserver (not as involved as it may sound, you can do this using a single Python command) or change your browsers security settings.