question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tooltips for selected mark are not evaluated

See original GitHub issue
Screen Shot 2020-04-25 at 16 25 12

This 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:open
  • Created 3 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jheercommented, May 23, 2020

Re-opening and transferring to Vega-Lite per @marcprux’s request.

0reactions
hk7mathcommented, Jul 26, 2021

After implementing the touch selection #4208 (comment) , the tooltips are gone on mobile

It turns out the hidden tooltips can be manually turned on simply by setting this in config

"events": {
  "defaults": {
    "allow": true
  }
}
Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found