keplergl / keplergl/kepler.gl

Mapbox Token Usage in Kepler.gl HTML Exports

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
12k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
66

Description

Mapbox has changed their policies for discounted access tokens they're offering to our Open Visualization projects, and they've requested we rotate our tokens. In reviewing our token usage, I've noticed that the kepler-jupyter package embeds a token into all maps, including maps that are exported to HTML. Going forward, I think we should assume we will only be able to use tokens on sites we host.

Unfortunately, in my testing I've found that kepler.gl isn't able to gracefully handle an invalid token, and so we're in a situation where old maps using mapbox styles will be broken once the tokens are rotated. This will affect most exports since the default "light" style is a Mapbox style. This isn't ideal, so I'm hoping we can find a solution together to at least help people fix their HTML files, and to prevent this issue for new maps going forward.

Brainstorming solutions for old maps I've come up with a few options so far:

  • Ask affected users to make their own Mapbox account, and replace the tokens used in their HTML files (any valid token will work, and the free-tier works should be suitable).
  • Ask Mapbox to grant usage for this kepler use case forever (their service is advertised with an annotation, so maybe they'd do it -- but it's unlikely)
  • Cut a patch of kepler 2.5, 3.0, 3.1 that switches basemaps to a token-less alternative, like Carto, and show affected users how to update the version numbers in their HTML files.

Either way, going forward I'd recommend removing these mapbox styles from Jupyter package, and finding another a free solution. I'd also recommend implementing a more graceful response to an invalid map style (like switching to the "No Basemap" option if there's an error, since no one can guarantee a URL will be live forever.

Contributor guide

No contributing guide indexed for this repository

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

Start with the token embedded in bindings/kepler.gl-jupyter/js/lib/keplergl/components/app.js and the Mapbox styles in src/constants/src/default-settings.ts. Reproduce an exported HTML map with an invalid token, then determine how old exports and new Jupyter maps should behave. Done means old HTML files have a documented recovery path and new maps no longer depend on unsupported hosted tokens.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jupyter-notebook, typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.