Mark synced tooltip coordinate with an 'x' and position label adaptively#258
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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