Skip to content

Mark synced tooltip coordinate with an 'x' and position label adaptively#258

Merged
maread99 merged 3 commits into
mainfrom
claude/tooltip-mark-positioning-17drsd
Jun 26, 2026
Merged

Mark synced tooltip coordinate with an 'x' and position label adaptively#258
maread99 merged 3 commits into
mainfrom
claude/tooltip-mark-positioning-17drsd

Conversation

@maread99

@maread99 maread99 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Changes the synchronised tooltip implementation so that the (y, x) coordinate a synced tooltip corresponds with is now marked with an 'x', and the tooltip's text label is positioned next to it, adaptively to best assure it renders fully within the visible plot.


Manual: full review and doc revisions.
Generated by Claude Code

claude and others added 3 commits June 26, 2026 16:15
Mark the (x, y) coordinate that a synchronised tooltip describes with an
'x' (a `bq.Scatter` crosshair marker) and place the tooltip's text label
adjacent to that mark, offset towards the centre of the chart.

The label is placed to the left of the mark when the bar is in the upper
(right) half of the plotted x-ticks (otherwise to the right) and below
the mark when the y value is in the upper half of the visible y-range
(otherwise above), accounting for a log y-scale. This best assures the
label's text renders fully within the visible plot area.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lb2GqjyQL6RWPhaNxNu6wT
Add `_synced_tooltip_cross_color`, a hook a host can override to colour
the synced tooltip's 'x' marker differently to the label. It defaults to
the label colour (`_tooltip_color`), so existing behaviour is unchanged.

Add a test asserting the 'x' marker is placed at the bar's (x, y)
coordinate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lb2GqjyQL6RWPhaNxNu6wT
@maread99 maread99 added the enhancement New feature or request label Jun 26, 2026
@maread99 maread99 merged commit 5ada82c into main Jun 26, 2026
8 checks passed
@maread99 maread99 deleted the claude/tooltip-mark-positioning-17drsd branch June 26, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants