Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use crosstalk with formattable? #124

Open
shashj opened this issue Jan 4, 2020 · 1 comment
Open

Can we use crosstalk with formattable? #124

shashj opened this issue Jan 4, 2020 · 1 comment

Comments

@shashj
Copy link

shashj commented Jan 4, 2020

Hi, I had a query, don't know where to ask. Can we use formattable with crosstalk? Is it also possible to use datatables, crosstalk and formattable together?

@renkun-ken

@daattali
Copy link

daattali commented Apr 14, 2023

For context: The {crosstalk} package allows different shiny widgets on a page to interact with each other

Here is an example of code that should work once crosstalk is enabled:

library(shiny)

df <- crosstalk::SharedData$new(cars)

ui <- fluidPage(
  crosstalk::filter_slider("speed", NULL, df, "speed"),
  d3scatter::d3scatterOutput("plot"),
  formattable::formattableOutput("table")
)

server <- function(input, output, session) {
  output$plot <- d3scatter::renderD3scatter({
    d3scatter::d3scatter(df, ~speed, ~dist)
  })
  output$table <- formattable::renderFormattable({
    formattable::formattable(df)
  })
}

shinyApp(ui, server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants