Skip to content

Commit

Permalink
fix: update tooltip positioning for CSP (#714)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominik Moritz <[email protected]>
  • Loading branch information
mayagbarnes and domoritz authored Nov 18, 2022
1 parent 1fff0a2 commit f551864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ vegaEmbed("#vis", spec, {tooltip: {theme: 'dark'}})
.catch(console.error);
```

If you want to ue a different version of the tooltip handler, you can override the default handler with the handler from Vega Tooltip (and you need to install it separately).
If you want to use a different version of the tooltip handler, you can override the default handler with the handler from Vega Tooltip (and you need to install it separately).

```js
var handler = new vegaTooltip.Handler();
Expand Down
3 changes: 2 additions & 1 deletion src/Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class Handler {
this.options.offsetY
);

this.el.setAttribute('style', `top: ${y}px; left: ${x}px`);
this.el.style.top = `${y}px`;
this.el.style.left = `${x}px`;
}
}

0 comments on commit f551864

Please sign in to comment.