Specify custom topojson for geo plot


#1

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?


#2

Bump.

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/…


#3

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.


#4

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.


#5

Using

for example

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

#6

Perfect, thank you - that has everything working


#7

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