mapbox / mapbox/mapboxgl-jupyter

Tooltip for vector tile data-join should only show matching property, not all props from vector tile

Open
#116 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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'
)

```

![capture](https://user-images.githubusercontent.com/10450589/42690818-060c63e6-86a6-11e8-87a3-082212796446.PNG)

and
![capture2](https://user-images.githubusercontent.com/10450589/42690906-609f55f2-86a6-11e8-851f-d7df8a433347.PNG)

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.