plotly / plotly/dash

[Feature Request] customisable dcc.Tooltip position/direction

Open
#3,087 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

  • Add the possibility to combine the existing directions: direction="bottom+right". dbc.Tooltip already includes this in their placement argument: https://dash-bootstrap-components.opensource.faculty.ai/docs/components/tooltip/
  • (maybe) add an offset argument that allows developers to specify the distance between the hover point and the hover box. Some developers want the box to be further from the data point so that it (the data point) and its context can be seen better. It could look something like dcc.Tooltip(..., offset={"x":"15px", "y":"0px"})

Related requests:

Relevant code:

Workaround with css

assets/styles.css

/* makes the hover box go to the bottom right corner */
.hover-content[class^="jsx-"] {
    transform: translate(0%,0%) !important;
}

Image

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 in components/dash-core-components/src/components/Tooltip.react.js, especially the direction handling around lines 44-98 and the hover-right/hover-bottom transforms. Trace how dcc.Tooltip exposes direction and determine the scope of combining directions and optionally adding offset; done means the requested placement behavior works without relying on the CSS workaround described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, python, react
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.