Specify custom topojson for geo plot

By default plotlyjs uses https://cdn.plot.ly/world_110m.json for its geo plots for creating country borders etc. I’d like to specify a different path for this topojson file - can this be done on a case by case basis for different plots in the data or layout portion used to create a plot?


There has to be a way to change this value without editing the source code, right? I’m just trying to get a different topojson file from an endpoint that’s not cdn.plot.ly/…

The topojson files plotly.js uses are generated here: https://github.com/etpinard/sane-topojson

You could try to generate your own files, but you’ll need to make the layer names match, if not plotly.js won’t be able to process them.

That’s totally fine, but how do I change the endpoint that plotly is using to get those topojson files? I want to have a different location where I am hosting such a file. Instead of cdn.plot.ly/… I would like to have a different endpoint that I have set up to serve a plotlyjs compatible topojson file.


for example

Plotly.setPlotConfig({ topojsonURL: */ /url/to/your/topojson/folder/ */ })

Perfect, thank you - that has everything working

1 Like

How do you do this with plotly for python? I can’t find a way to set the configuration from a script.