Comments (12)
I'm not seeing this error with shiny
v0.11.1.
from rhandsontable.
@jrowen I have v0.11.1.9000 which I believe is the working version where they migrated to jsonlite (they are planning soon to do the same with htmlwidgets).
The above message is particularly annoying as it is generated at every call of jsonlite i.e. twice each time you click on a checkbox, and I couldn't suppress it just with options(warn=-1).
from rhandsontable.
@jrowen correct: it does not happen with shiny
v0.11.1. Nevertheless as the issue is connected to shiny
migration to jsonlite
will need appropriate tlc...
from rhandsontable.
Can you post the example that generates an error?
from rhandsontable.
This is the code (imperfect - it is just for me to test the insurgence of endless loops):
options(warn=-1)
library(rhandsontable)
library(shiny)
options(warn=-1)
quantity <- id <- 1:20
label <- paste0("lab","-",quantity)
pick <- FALSE
iris_ <- data.frame(id=id,pick=pick, quantity=quantity,label=label,iris[1:20,] ,stringsAsFactors = FALSE)
iris_$Species <- NULL
cols <- colnames(iris_)
#---------------------------
ui <- fluidPage(
fluidRow(
column(8,rHandsontableOutput('demTb')),
column(3,uiOutput("demSli"))
)
)
server <- function(session, input, output) {
output$demSli <- renderUI({
if(is.null(input$demTb) ) return()
isolate({
df_ <- hot_to_r(input$demTb)
index <- which(df_$pick==T)
if(length(index)==0) return()
labs <- iris_$label[index]
pages <- "test"
iter <- length(labs)
buttn <- 1
valLabs <- sapply(1:iter, function(i) {
if(is.null(input[[paste0(pages,"d",labs[i],buttn)]] )) {
0
} else { as.numeric(input[[paste0(pages,"d",labs[i],buttn)]]) }
})
#
toRender <- lapply(1:iter, function(i) {
sliderInput(inputId = paste0(pages,"d",labs[i],buttn),
label = h6(paste0(labs[i],"")),
min = -100,
max = 100,
step = 1,
value = valLabs[i],
post="%",
ticks = FALSE, animate = FALSE)
})
})
return(toRender)
})
#--------------------
rds <- reactive({
if( is.null(input$demTb) ) return(iris_)
df_ <- hot_to_r(input$demTb)
isolate({
index <- which(df_$pick==T)
if(length(index)==0) return(df_)
labs <- iris_$label[index]
pages <- "test"
iter <- length(labs)
buttn <- 1
}) # end isolate
valLabs <- sapply(1:iter, function(i) {
if(is.null(input[[paste0(pages,"d",labs[i],buttn)]] )) {
0
} else {
as.numeric(input[[paste0(pages,"d",labs[i],buttn)]])/100
}
})
dft_ <- data.frame(label=labs, multi=valLabs, stringsAsFactors = FALSE)
dft_ <- merge(iris_,dft_,by="label", all.x=T)
dft_$quantity <- sapply(1:length(dft_$quantity), function(z) {
if( is.na( dft_$multi[z]) ) {
dft_$quantity[z]
} else { iris_$quantity[z]*(1 + dft_$multi[z]) }
})
dft_[with(dft_,order(as.numeric(id))),]
df_[with(df_,order(as.numeric(id))),]
df_$quantity <- df_$quantity
return(df_)
})
output$demTb <- renderRHandsontable({
if(is.null(rds() )) return()
df_ <- rds()
df_ <- df_[cols]
df_ <- df_[with(df_,order(as.numeric(id))),]
rhandsontable(df_, readOnly = FALSE, rowHeaders= NULL, useTypes= TRUE) %>%
hot_table(highlightCol = TRUE, highlightRow = TRUE) %>%
hot_validate_numeric(col = "quantity", min = 0, max = 50, exclude = 40)
})
}
shinyApp(ui, server)
from rhandsontable.
@jrowen If you could look kindly into this issue - as well as the validator logic issue (by typeof) I would love to test the widget more extensively with the idea to use it in one of my projects.
from rhandsontable.
I'd prefer to make any necessary updates once a new version of shiny
is stable and released.
from rhandsontable.
@jrowen fair enough - but what about the validator logic issue (by typeof)?
from rhandsontable.
@jrowen Not sure if you have seen this: ramnathv/htmlwidgets#28 (comment)
htmlwidget is ready to migrate to jsonlite. Sadly I'm really busy this weekend and I do not have much time for testing.
These are the packages you need:
devtools::install_github(c('jeroenooms/jsonlite', 'rstudio/shiny', 'yihui/htmlwidgets@jsonlite'))
from rhandsontable.
@jrowen I tried the shiny app posted here earlier and I cannot see anything anymore!
from rhandsontable.
I think we have a fix for the htmlwidgets move to jsonlite.
The informational message mentioned above still appears when a data.frame
is passed to the widget. rhandsontable doesn't set the keep_vec_names
parameter, so the message may be originating from htmlwidgets or shiny.
from rhandsontable.
FYI, I have fixed this issue in my PR #8.
from rhandsontable.
Related Issues (20)
- Multiple selection for dropdown
- Put in red cells modified
- NULL input for rhandsontable
- using colWidths argument produces duplicate columns HOT 2
- Option to replace the checkbox with fancier shinyWidget item ?
- How to deselect row? HOT 1
- Character column transformed to numeric in hot_to_r
- rhandsontable works locally, but flickering on cloud HOT 2
- Prevent auto arranging rows while editing with column sorting enabled
- Issue when more than 1 character in dropdown
- I did not find any document on Collapsing and expanding rows using rhandsontable in Rshiny. Or Do we even have this functionality? HOT 2
- Borders not updated
- hot_to_r fails to copy date data HOT 6
- Show different colHeaders than are used internally/in the code HOT 1
- Specifying a column type as numericInput with up/down arrows
- Custom dropdown menus
- How to enable paid features - formula support
- Potential conflict with dygraphs, moment.js
- `Download to CSV` function does not work if empty table values HOT 2
- Rhandsontable bouncing when processing a slow calculation
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 rhandsontable.