Giter Club home page Giter Club logo

Comments (5)

Swechhya avatar Swechhya commented on September 1, 2024

@GoodMorgon Thank you for reporting the issue. This was a side effect of adding get_selected_data function. The input$table is always triggered regardless the value is changed or selected. When the value is changed in the table excel_to_R(input$table) would now give the entire table while upon selection it would give NULL as there is no change in the table.

from excelr.

marciz avatar marciz commented on September 1, 2024

@Swechhya I think it is still breaking change in modified example

library(shiny)
library(excelR)
shinyApp(
  ui = fluidPage(excelOutput("table")),
  server = function(input, output, session) {
    rv <- reactiveValues(
      dt =  head(iris)
    )
    output$table <- renderExcel(excelTable(data = rv$dt))
    observeEvent(input$table,{
      rv$dt <- excel_to_R(input$table)
    })
  }
)

Also, is it possible to turn off trigger for selection change if it is not necessary? I guess this might slow down & cause issues in shiny

from excelr.

Swechhya avatar Swechhya commented on September 1, 2024

@marciz I agree with you on that, we could add a parameter in excelTable to specify if we want to get selected values and based on that we could turn on the trigger for selection. Also, with the current changes in this version you might want to check for NULL before printing the table. Code will be something like this:

library(excelR)
shinyApp(
  ui = fluidPage(excelOutput("table")),
  server = function(input, output, session) {
    rv <- reactiveValues(
      dt =  head(iris)
    )
    output$table <- renderExcel(excelTable(data = rv$dt))
    observeEvent(input$table,{
      table_val <- excel_to_R(input$table)
      if(!is.null(table_val)){
        rv$dt <- table_val
      }
     
    })
  }
)

What do you think about this approach? We have to do this because we use Shiny.setInputValue for both excel_to_R and get_selected_data.

As for turning off trigger for selection change I'll add getSelectedData parameter in excelTable function which on default would be FALSE.

from excelr.

marciz avatar marciz commented on September 1, 2024

@Swechhya, I agree - parameter getSelectedData sounds good.
I haven't looked at recent changes in details, but what if getSelectedData = TRUE and I need to change the input data? Possible solution would be excel_to_R to return something like list(data = ..., selectedData = ...)

from excelr.

Swechhya avatar Swechhya commented on September 1, 2024

@GoodMorgon @marciz the issue mentioned in this PR has been fixed in the latest development version. The excel_to_R behaviour is as in the earlier versions. Feel free to open it if you think the issue still persists.

from excelr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.