mapbox / mapbox/mapboxgl-jupyter
Tooltip for vector tile data-join should only show matching property, not all props from vector tile
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 681
- Forks
- 137
- PR merge metrics
- No merged PRs in 30d
Description
Some of the examples [here](https://nbviewer.jupyter.org/github/mapbox/mapboxgl-jupyter/blob/master/examples/notebooks/choropleth-viz-example.ipynb) have tooltips with multiple items in them. However when I create my visualization I only get the "vector_join_property" and "color_property" keys and values in the tooltip but not the others. In this case "year":2014 is missing. Any idea why?
```
data = [{'pfafid_30spfaf06':233036, "year":2014,"value":42}]
viz = mapboxgl.viz.ChoroplethViz(data = data,
vector_url='mapbox://rutgerhofste.hybas06_v04_V04',
vector_layer_name='hybas06_v04', # Warning should match name on mapbox.
vector_join_property='pfaf_id',
data_join_property= "pfafid_30spfaf06",
color_property="value",
color_function_type='match',
color_stops= color_stops_category,
line_color = 'rgba(0,0,0,0.05)',
line_width = 0.5,
opacity=0.7,
center=(5, 52),
zoom=4,
below_layer='waterway-label'
)
```

and

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the tooltip behavior in the linked choropleth-viz-example.ipynb using the supplied data and ChoroplethViz configuration. Inspect how the vector tile properties are selected for the tooltip, clarify whether year should appear alongside the join and color properties, and verify the resulting tooltip against the reported examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100