Tooltips for selected mark are not evaluated
See original GitHub issueThis comes from the “Interactive Average” sample with tooltips enabled in the config:
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.11.0.json",
"data": {"url": "data/seattle-weather.csv"},
"config": {
"mark": {
"tooltip": { "content": "encoding" }
}
},
"layer": [{
"selection": {
"brush": {
"type": "interval",
"encodings": ["x"]
}
},
"mark": "bar",
"encoding": {
"x": {
"timeUnit": "month",
"field": "date",
"type": "ordinal"
},
"y": {
"aggregate": "mean",
"field": "precipitation",
"type": "quantitative"
},
"opacity": {
"condition": {
"selection": "brush", "value": 1
},
"value": 0.7
}
}
}, {
"transform": [{
"filter": {"selection": "brush"}
}],
"mark": "rule",
"encoding": {
"y": {
"aggregate": "mean",
"field": "precipitation",
"type": "quantitative"
},
"color": {"value": "firebrick"},
"size": {"value": 3}
}
}]
}
The tooltips over unselected marks show the correct values for the tooltip
field, but any selected marks will show the unprocessed value of the tooltip config setting, regardless of the value (e.g., true
, false
, { "content": "data" }
).
If, instead, tooltip
is specified in the mark
def rather than in the config
, then the tooltip isn’t shown at all for any marks that are selected (but they are still displayed properly for unselected marks). I.e.:
"mark": {
"type": "bar",
"tooltip": { "content": "encoding" }
}
FTR, I’ve noticed this behavior with vegaEmbed when passing "tooltip": true
in the options.config
parameter (in other to enable default tooltips), but I don’t know if that is a bug with vega-embed
, vega-lite
, or vega
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Why aren't my tooltips working right? - Tableau Community
I'd like to be able to show information in my tooltip that isn't displayed on my viz. Is that possible? You can drop...
Read more >python - altair: mark_geoshape tooltips disabled when adding ...
As I was working on a reproducible example, I realized that I just had to add ".add_selection(bland_selection)" to the map_-chart. – Simon. Feb ......
Read more >Solved: Tooltips not working properly in Power BI Service
Solved: Hi All, With the help of Report Page i am showing a tooltip for a grid which is working fine in Power...
Read more >EVERYTHING you wanted to know about Power BI tooltips
Power BI tooltips can add a lot of context to a visual. Patrick shows you everything you need to know about tooltips in...
Read more >Tableau Tooltips - Full beginners guide including Viz in Tooltips.
Tooltips are additional data details that display when you hover over one or more marks in the view. When you select one or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Re-opening and transferring to Vega-Lite per @marcprux’s request.
It turns out the hidden tooltips can be manually turned on simply by setting this in
config