Title: HTML Widget to Show File Differences
Version: 0.1.2
Description: A HTML widget that shows differences between files (text, images, and data frames).
License: MIT + file LICENSE
Depends: R (≥ 3.6.0)
Imports: htmlwidgets, jsonlite
Suggests: covr, shiny
Config/Needs/website: tidyverse/tidytemplate
Encoding: UTF-8
RoxygenNote: 7.3.1
NeedsCompilation: no
Packaged: 2024年06月12日 16:12:51 UTC; hadleywickham
Author: Hadley Wickham [aut, cre], Joshua Kunst [aut], Winston Chang [aut], Posit Software, PBC [cph, fnd], Paul Fitzpatrick [cph] (Author of included daff.js library), Rodrigo Fernandes [cph] (Author of included diff2html library), JQuery Foundation [cph] (Author of included jquery library), Kevin Decker [cph] (Author of included jsdiff library), Matthew Holt [cph] (Author of incldued PapaParse library), Huddle [cph] (Author of included resemble library)
Maintainer: Hadley Wickham <hadley@posit.co>
Repository: CRAN
Date/Publication: 2024年06月12日 21:00:14 UTC

diffviewer: HTML Widget to Show File Differences

Description

A HTML widget that shows differences between files (text, images, and data frames).

Author(s)

Maintainer: Hadley Wickham hadley@posit.co

Authors:

Other contributors:

  • Posit Software, PBC [copyright holder, funder]

  • Paul Fitzpatrick (Author of included daff.js library) [copyright holder]

  • Rodrigo Fernandes (Author of included diff2html library) [copyright holder]

  • JQuery Foundation (Author of included jquery library) [copyright holder]

  • Kevin Decker (Author of included jsdiff library) [copyright holder]

  • Matthew Holt (Author of incldued PapaParse library) [copyright holder]

  • Huddle (Author of included resemble library) [copyright holder]

See Also

Useful links:


HTML widget to visually compare two files

Description

Currently supports:

  • image diffs for .svg and .png

  • tabular diffs for .csv

  • text diffs for everything else

Usage

visual_diff(file_old, file_new, width = NULL, height = NULL)

Arguments

file_old, file_new

Paths to files to compare

width, height

Output size

Value

A HTML widget

See Also

visual_diff_output() for use within Shiny apps

Examples

path1 <- tempfile()
path2 <- tempfile()
writeLines(letters, path1)
writeLines(letters[-13], path2)
if (interactive()) {
 visual_diff(path1, path2)
}

Shiny bindings for visual_diff()

Description

Use visual_diff_output() in ui and render_visual_diff(visual_diff(...)) in the server function.

Usage

visual_diff_output(outputId, width = "100%", height = "400px")
visual_diff_render(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

expr

An expression that generates a visual_diff

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

Value

Components for use inside a Shiny app.

Examples

if (require("shiny") && interactive()) {
ui <- fluidPage(
 visual_diff_output("diff")
)
server <- function(input, output, session) {
 path1 <- tempfile()
 path2 <- tempfile()
 writeLines(letters, path1)
 writeLines(letters[-13], path2)
 output$diff <- visual_diff_render(visual_diff(path1, path2))
}
shinyApp(ui, server)
}

AltStyle によって変換されたページ (->オリジナル) /