plotly / plotly/plotly.js

choropleth: when geojson is set, the geojson file from cdn.plot.ly is still loaded first

Open
#6,767 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2 sev-4
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

When using type: choropleth and setting a geojson url, the geojosn file from cdn.plot.ly still is loaded first.
I'd expect that only the specified geojson file is loaded and used.

(This would be useful to e.g. implement a strict CSP on a site using plotly)


Example: https://codepen.io/lucavazz/pen/jOdrWgV
(baed on https://codepen.io/lucavazz/pen/poGbybw / #4267)

var data = [{
   // ...
   geojson: 'https://unpkg.com/sane-topojson@4.0.0/dist/world_110m.json' 
   // this url is an example, in practice this would point to a relative assets path
}]

image


Is this intended behavior / is some configuration missing in the example to only use the provided geojson or is this a bug in the implementation?

Thanks in advance :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior in the linked CodePen with a choropleth trace using the provided geojson URL. Trace the choropleth geojson loading path and verify which requests occur; done means the configured geojson is used without first loading the cdn.plot.ly file, while preserving the example's rendering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.