r-lib / diffviewer

HTML widget to visually compare files
http://diffviewer.r-lib.org
Other
58 stars 7 forks source link

SVGs generated by vdiffr are not displayed #8

Closed lionel- closed 3 years ago

lionel- commented 3 years ago

With svglite this works:

file1 <- tempfile(fileext = ".svg")
file2 <- tempfile(fileext = ".svg")

svglite::svglite(file1); plot(1:3); dev.off()
svglite::svglite(file2); plot(2:4); dev.off()

diffviewer::visual_diff(file1, file2)

But SVGs generated by vdiffr are not displayed:

file3 <- tempfile(fileext = ".svg")
file4 <- tempfile(fileext = ".svg")

vdiffr::write_svg(function() plot(1:3), file3, "plot1")
vdiffr::write_svg(function() plot(2:4), file4, "plot2")

diffviewer::visual_diff(file3, file4)

I don't know if the SVGs generated by @thomasp85's version of the vdiffr engine work with diffviewer. Do you have this branch online Thomas?

Even if the new engine works, it would be nice for vdiffr users to be able to compare the old SVGs to the new ones when they transition to vdiffr 1.0. Or we just assume the SVGs to be equivalent?

lionel- commented 3 years ago

Fixed by Thomas' update of the SVG engine in r-lib/vdiffr#106.