httpgd icon indicating copy to clipboard operation
httpgd copied to clipboard

incomplete plots/thumbnails in safari

Open r2evans opened this issue 11 months ago • 0 comments

Describe the bug

Sometimes plots (I'm using ggplot2, not sure if that's a factor) and/or thumbnails can provide incomplete renderings in Safari.

To Reproduce

library(ggplot2)
httpgd::hgd()
# httpgd server running at:
#   http://127.0.0.1:63230/live?token=pYdC5XjA
n <- 1e4
set.seed(42)
dat <- data.frame(x=runif(n), y=rnorm(n), w=sample(1:7, size=n, replace=TRUE), z=sample(1:3, size=n, replace=TRUE))
head(dat)
#           x           y w z
# 1 0.9148060  0.07122244 1 2
# 2 0.9370754  0.97029003 2 1
# 3 0.2861395  0.31003525 3 2
# 4 0.8304476 -0.13954856 1 2
# 5 0.6417455 -0.32631113 4 3
# 6 0.5190959 -0.11880951 4 1
ggplot(dat, aes(x, y)) + geom_point() + facet_grid(w ~ z, scales = "free")

I tried the above ggplot(..) expression repeatedly, and safari looks like this:

Image
  • Clicking on a different thumbnail and clicking back to the most recent always fixes the main-plot, but thumbnails still look off.
  • Reloading the whole page fixes the issue for all plots and thumbnails.

Chrome never had a problem with any plots or thumbnails.

(Incidentally, the wider-looking thumbnail is because I opened the same httpgd server in Chrome (on a different monitor) between plot attempts, which must have upset the notion of thumbnail-size. I am not considering that a bug atm.)

Expected behavior

Complete plot rendering for all plots and thumbnails.

Environment

  • OS: MacOS 15.2
  • Browser: Safari 18.2 20620.1.16.11.8; Chrome 132.0.6834.160 (Official Build) (arm64)
  • R version: 4.3.3
  • httpgd version: 2.0.2

r2evans avatar Feb 01 '25 19:02 r2evans