Skip to content

Format computed dates and datetimes in ggplotly tooltips - #2512

Open
M-Colley wants to merge 1 commit into
plotly:masterfrom
M-Colley:fix/502-smooth-date-tooltips
Open

M-Colley wants to merge 1 commit into
plotly:masterfrom
M-Colley:fix/502-smooth-date-tooltips

Conversation

@M-Colley

@M-Colley M-Colley commented Dec 5, 2026

Copy link
Copy Markdown

Summary

Use the axis scale to restore dates and datetimes when a ggplot statistic supplies only transformed coordinates. Smooth-line hover text shows the date or local time while the trace retains its numeric coordinates.

Fixes #502.

Evidence

  • The regression tests reproduced an epoch-day label such as -915.0000 and an epoch-second label such as 1722878400. With the patch, the labels are 1967-07-01 and 2024-08-05 13:20:00 in the scale's timezone.
  • The ggplot conversion suite passed with the same six warnings and 27 skips as the base. The date tests also passed on ggplot2 3.5.2.

Merge impact

The change affects hover text generated from computed coordinates on date and datetime scales.

I used Codex to prepare and test this patch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hoverinfo shows milliseconds for geom_smooth() with date/datetime positional axis

1 participant