expect_visual_equal_with_diff | R Documentation |
This tinytest
-compatible expectation compares two plots supplied as files (which
should be png files) and returns visual difference in a plot file (for which the
designated file has to be supplied).
The labels “old” (for the reference plot compared against), “new” (for
the candidate plot, and “diff” can be set as value to the global option
tinysnapshot_plot_diff_style
. For example settings c("old", "new", "diff")
shows all three, setting c("new", "diff")
just these two. The default is to only show
the ‘diff’ plot.
expect_visual_equal_with_diff(proposed, reference, difference, ...)
proposed |
Character value with filename of proposed solution, should be png |
reference |
Character value with filename of reference plot, should be png |
difference |
Character value with filename for difference plot (if plots differ) |
... |
Passes on to |
The tinytest
result object where the diff
attribute contains the
suitable value that can be passed onto the JSON output, i.e. a character string beginning
with "date:image/png;base64,"
followed with the base64 encoded file. The class
attribute is set to c("ttvd", "tinytest")
to signal that it is a 'visual diff' result.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.