Comments (11)
How do you want this to look? Do you want it to be like the handsontable implementation on paulfitz.github.io/daff? I think this would be a good start and happy to start putting together.
from daff.
The other project I have been experimenting with heavily is https://github.com/benjamine/jsondiffpatch.
from daff.
Seems fine to me to start with the implementation of daff (note that render_diff
does exactly that).
For a later version I may be nice to use bootstrap3 css style, so it integrates nicely with shiny/rmarkdown.
from daff.
I was not familiar with this project (https://github.com/benjamine/jsondiffpatch), looks nice!
from daff.
Aim of the projects is similar, but jsondiffpatch
more focused on non-tabular. What is nice about jsondiffpatch
is the built in html renderer, so making a htmlwidget is much easier.
from daff.
Just wanted to circle back to this. There are lots of easy improvements without even a full htmlwidget
implementation. I think a full implementation would be nice, but for now I'll submit a pull with the simple change. Sorry it has taken me so long.
from daff.
Here is the non-htmlwidget implementation https://github.com/timelyportfolio/daff/tree/feature/htmltools using just the helpful htmltools
from RStudio. The quick win here is now render_diff
will show up in rmarkdown
documents, which I demonstrated with this silly vignette.
Also, here is an example in Shiny.
library(shiny)
library(daff)
ui <- fluidPage( uiOutput("daff") )
server <- function(input,output,session){
output$daff <- renderUI({
y <- iris[1:3,]
x <- y
invalidateLater(1000, session)
x[,1] <- jitter(y[,1])
patch <- diff_data(y, x)
render_diff(patch, fragment = F)
})
}
shinyApp(ui,server)
I would enjoy your thoughts on this. Thanks.
from daff.
Hi, is there any progress on this one? I think render_diff is pretty close to the htmlwidget convention, just last mile to wrap in the standard format
from daff.
This is excellent work, thank you. Any progress on embedding render_diff
output within an rmarkdown document?
from daff.
Here is my local hack to get daff chunks into rmarkdown HTML documents:
- add a "style.css" with a copy of the daff CSS to the YAML header
- wrap chunks with this function:
# temp hack to get daff chunks into an rmarkdown doc
wrapDaffHTML <- function(chunkHTML, chunkTitle) {
cat("<div class='highlighter' style='align:center; font-size:80%;'>")
cat(paste0("<h3>", chunkTitle, "</h3>"))
cat(chunkHTML)
cat("</div><br><br>")
}
I am sure there is a better way, but this seems to work OK. It would be nice to get the summary HTML chunks, but I can live without those for now.
from daff.
Thx for your suggestions! I will work on rendering to markdown next week.
from daff.
Related Issues (20)
- Add tolerance to comparison when it's numeric values
- feature request: summary HOT 4
- Daff doesn't correctly detect added columns that share the same name
- inconsistent behavior when replacing values with NA HOT 1
- lines doubly printed ico small nr of patches HOT 2
- Issue with modified or inserted/deleted row HOT 2
- data_diff objects fail on round trip to Rdata files HOT 1
- Activate id parameter in diff_data function
- HTML rendering does not escape passed data HOT 2
- Encoding Issue with Windows and Daff HOT 1
- Unknown error "Cannot set property '14' of undefined
- daff removed from CRAN HOT 6
- `render_diff(use.DataTables = TRUE)` broken
- diff_data detects changes in primary keys, even if ids is specified HOT 4
- "Primary Key Id' issue
- Implement `ids` and `ignore` columns HOT 1
- Handle NAs HOT 5
- Handle class HOT 6
- Consider integrating with objectdiff HOT 2
- Error: "Ordering took too long, something went wrong" when calling diff_data with large dataset inputs HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daff.