plotly / plotly/plotly.py

make error messages more helpful when choropleth features and data don't match

Open
#4,529 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

I teach a class for students that are new to coding. We use plotly, and I'm happy to have a package that gets students good-looking graphs in so little code.

I introduce plotly's choropleth maps, and have repeatedly run into the issue where the students get confused by what the featureidkey is referring to and how that relates to the locations. I do my best to explain this, but they are (understandably) confused working across CSVs and GeoJSON. One student just hit an issue where they were trying to use FIPS codes, but their locations column had leading whitespace. When the rows are unable to be matched to a feature, it fails silently.

My feature request is to provide a warning when the featureidkey and locations have zero matches.

I haven't contributed to the plotly codebase before, but I'd be open to doing so if the maintainers are open to receiving this. Presumably the place to add this check is one of the validators?

Thanks!

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

Start in packages/python/plotly/plotly/validators/choropleth, which the issue identifies as a possible location for the check. Reproduce a choropleth using GeoJSON feature identifiers and locations with no matches, including leading whitespace in FIPS codes. Done means the zero-match case produces a clear warning instead of failing silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.