r-lib / vdiffr

Visual regression testing and graphical diffing with testthat
https://vdiffr.r-lib.org
Other
180 stars 31 forks source link

manage_cases(): StartTag: invalid element name #94

Closed ltalluto closed 3 years ago

ltalluto commented 3 years ago

When I run manage_cases() on a new figure, I am getting a warning on the console as follows:

Warning: Error in read_xml.raw: StartTag: invalid element name [68] 103: read_xml.raw 102: read_xml.character 100: .f 99: map 98: widget 96: func 83: origRenderFunc 82: output$slide 2: shiny::runApp 1: manage_cases

Moreover, the new plot shows up as a broken image icon. A file is created in figs/plotting, but it's just an image of the error:

Screenshot 2020-10-22 at 15 04 11

This is only affecting plots using ggplot2; if I create a new plot in base graphics, it works fine. I also tried deleting figs, anything using base graphics is fine, anything using ggplot2 breaks. Any ideas what could be causing this? This is on ggplot2 v3.3.2, vdiffr 0.3.3, RStudio 1.3.959, R 4.0.1. Using the base R GUI or RStudio makes no difference.

lionel- commented 3 years ago

What do you get when you try to plot with svglite?

ltalluto commented 3 years ago

Works perfectly with svglite

lionel- commented 3 years ago

Might be fixed when we next update the copy of svglite that is embedded in vdiffr then.

But I'll need a minimal and reproducible example so I can make sure.

pat-s commented 3 years ago

Here's a reprex for a plotly object:

test_that("test", {
  vdiffr::expect_doppelganger(
    "test plotly",
    plotly::plot_ly())
})

I've seen there were multiple issues/PRs related to plotly already, not sure what the current status/plan is.

lionel- commented 3 years ago

Should be fixed by #106 which updated the embedded copy of svglite.