Skip to content

Commit

Permalink
fix: add markDef.tooltip for interactive check (#9237)
Browse files Browse the repository at this point in the history
close #9190 

For the original fail case, I found that adding tooltip in the encoding
field can solve the issue.
My assumption is the interactiveFlag missed to check markDef.tooltip
field, and thus add it in this PR
```
"encoding": {
        "x": {
          "field": "date",
          "type": "temporal",
          "scale": {"domain": {"param": "brush"}},
          "axis": {"title": ""}
        },
        "y": {"field": "price", "type": "quantitative"},
        "tooltip": [
          {"field": "price", "type": "quantitative"},
          {"field": "date", "type": "temporal"}
        ]
      }
```

https://github.com/vega/vega-lite/blob/ffec017f638103c37d0dbe72cac7d44f4f44b9d6/src/compile/mark/mark.ts#L377-L381

---------

Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
  • Loading branch information
ChiaLingWeng and GitHub Actions Bot committed Jan 30, 2024
1 parent ffec017 commit 3891832
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile/mark/mark.ts
Expand Up @@ -376,7 +376,7 @@ function interactiveFlag(model: UnitModel) {
}
return parentCount
? {
interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip
interactive: unitCount > 0 || model.mark === 'geoshape' || !!model.encoding.tooltip || !!model.markDef.tooltip
}
: null;
}

0 comments on commit 3891832

Please sign in to comment.