Plotly Geo Maps FULLY Offline - Not for Dash

Hello all,

I am attempting to generate choropleth maps fully offline (not using dash). The purpose is to create a custom PBI map that can be used by the whole org with custom region/division boundaries (that is significantly faster than just using PBI’s geojson built in function).

However, I am running into an issue where plotly is always trying to connect to the internet (which is not allowed in the PBI runtime and I also cannot reference other files). Specifically, it is trying to reach: https://cdn.plot.ly/world_110m.json. I know this has been discussed at length on the forums with regards to Dash, however these work arounds are not an option for my circumstances. In this capacity, I need to be able to directly embedded the base image and my own custom geojson directly into the same file as the plotly map.

I am wondering if there is a way to do this, short of cloning the plotly repo, editing the fetch function, and using my own variation.

Let me know your thoughts!

Did you ever figure this out? I figured it out. Open the plotly.js file and replace the proto.fetchTopojsopn function like this. Where you hard the contents of the https://cdn.plot.ly/world_110m.json file.

proto.fetchTopojson = function () {
  var _this = this;
  var topojsonPath = topojsonUtils.getTopojsonPath(_this.topojsonURL, _this.topojsonName);
  return new Promise(function (resolve, reject) {
    /*d3.json(topojsonPath, function (err, topojson) {
      if (err) {
        if (err.status === 404) {
          return reject(new Error(['plotly.js could not find topojson file at', topojsonPath + '.', 'Make sure the *topojsonURL* plot config option', 'is set properly.'].join(' ')));
        } else {
          return reject(new Error(['unexpected error while fetching topojson file at', topojsonPath].join(' ')));
        }
      }*/
      var topojson = ***copy paste contents here ***

      PlotlyGeoAssets.topojson[_this.topojsonName] = topojson;
      resolve();
    });
};