inst/tinytest/test-geom_point_interactive.R

library(tinytest)
library(ggiraph)
library(ggplot2)
library(xml2)
source("setup.R")

# geom_point_interactive ----
{
  eval(test_geom_layer, envir = list(name = "geom_point_interactive"))
}

# hover_nearest ---
{
  gr <- ggplot(mtcars, aes(x =mpg, y = disp, hover_nearest = TRUE)) +
    geom_point_interactive()
  doc <- dsvg_doc({
    print(gr)
  })

  expect_equal(xml_attr(xml_find_first(doc, ".//circle"), "nearest"), "true")
}

Try the ggiraph package in your browser

Any scripts or data that you put into this service are public.

ggiraph documentation built on March 31, 2023, 9:53 p.m.