Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-lib/diffviewer
HTML widget to visually compare files
https://github.com/r-lib/diffviewer
diff htmlwidgets r
Last synced: 11 days ago
JSON representation
HTML widget to visually compare files
- Host: GitHub
- URL: https://github.com/r-lib/diffviewer
- Owner: r-lib
- License: other
- Created: 2020-07-26T13:18:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T21:26:18.000Z (5 months ago)
- Last Synced: 2024-09-14T18:04:47.624Z (about 2 months ago)
- Topics: diff, htmlwidgets, r
- Language: JavaScript
- Homepage: http://diffviewer.r-lib.org
- Size: 1.27 MB
- Stars: 58
- Watchers: 5
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-shiny-extensions - diffviewer - HTML widget to visually compare files (text, images, and data frames). (UI Components / Code Diff)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# diffviewer
[![Codecov test coverage](https://codecov.io/gh/r-lib/diffviewer/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/diffviewer?branch=main)
[![R-CMD-check](https://github.com/r-lib/diffviewer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/diffviewer/actions/workflows/R-CMD-check.yaml)diffviewer provides an HTML widget for visually comparing files. It currently wraps three javascript libraries:
* [resemble.js](https://rsmbl.github.io/Resemble.js/) for comparing images.
* [daff.js](https://paulfitz.github.io/daff/) for comparing data frames.
* [jsdiff](https://github.com/kpdecker/jsdiff) for everything else.It extracts out common UI provided by [shinytest](https://rstudio.github.io/shinytest/index.html) and [vdiffr](https://vdiffr.r-lib.org).
## Installation
You can install the released version of diffviewer from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("diffviewer")
```## Example
This is a basic example which shows you how to solve a common problem:
```{r example, eval = FALSE}
library(diffviewer)
path1 <- tempfile()
writeLines(letters, path1)
path2 <- tempfile()
writeLines(letters[-(10:11)], path2)visual_diff(path1, path2)
```