Enhance Shiny Apps with Customizable Modules

Provides highly customizable modules to enhance your shiny apps. Includes layout independent collapsible boxes and value boxes, a very fast autocomplete input, rhandsontable extensions for filtering and paging and much more.


Travis buildstatus Codecov testcoverage CRANstatus Downloads

The goal of dqshiny is to provide highly customizable modules to enhance your shiny apps. Includes layout independent collapsable boxes and value boxes, a very fast autocomplete input, rhandsontable extensions for filtering and paging and much more.

Installation

dqshiny is on CRAN so it can be installed with:

install.packages("dqshiny")

You can install the latest development version of dqshiny using:

remotes::install_github("daqana/dqshiny")

Example

There’s a package demo dqshiny-base-features demonstrating some functionalities. Or you can start with this short example to see some simple boxes in action:

library(shiny)
library(dqshiny)
shinyApp(
  ui = fluidPage(
    fluidRow(
      dq_box(
        title = "Say Hello to my children", collapsed = TRUE, fill = FALSE,
        dq_infobox("Hello", 2, "World", icon("hashtag"), bg_color = "black", color = "#D00"),
        dq_box(title = "Box in the box", bg_color = "red", width = 8, dq_space())
      )
    )
  ),
  server = function(input, output) {}
)

If you have a bigger amount of selectable choices and still don’t want to use textInputs you may have a look at this:

library(shiny)
library(dqshiny)
# create 100k random words
opts <- sapply(1:100000, function(i) paste0(sample(letters, 7), collapse=""))
shinyApp(
  ui = fluidPage(
    fluidRow(
      column(3,
        autocomplete_input("auto1", "Unnamed:", opts, max_options = 1000),
        autocomplete_input("auto2", "Named:", max_options = 1000,
          structure(opts, names = opts[order(opts)]))
        # feel free to test this with select... and may get yourself a coffee
        # , selectInput("sel", "Select:", opts)
      ), column(3,
        tags$label("Value:"), verbatimTextOutput("val1", placeholder = TRUE),
        tags$label("Value:"), verbatimTextOutput("val2", placeholder = TRUE)
      )
    )
  ),
  server = function(input, output) {
    output$val1 <- renderText(as.character(input$auto1))
    output$val2 <- renderText(as.character(input$auto2))
  }
)

If you ever encountered the wish to have a paged or filtered rHandsontable, this example could be quite interesting:

library(shiny)
library(dqshiny)
shinyApp(
  ui = fluidPage(dq_handsontable_output("myTable", 9L)),
  server = function(input, output, session) {
    hw <- c("Hello", "my", "funny", "world!")
    data <- data.frame(A = rep(hw, 500L), B = hw[c(2:4, 1L)], C = 1:500, D = 500:1)
    dq_render_handsontable("myTable", data,
      filters = c("Sel", "Text", NA, "Auto"), sorting = TRUE,
      page_size = c(17L, 5L, 500L, 1000L),
      col_param = list(list(col = 3L, format = "0.00")),
      cell_param = list(list(row = 2:9, col = 2L, readOnly = TRUE))
    )
  }
)

News

dqshiny 0.0.3

  • Fix unit test for new V8 (PR #1).
  • Support dqhot dataset changes and reconsider proper filters.
  • Change default filter for factors.
  • Support lists for filters specifying type and value.
  • Fix horizontal scroll only.
  • Fix initial column width alignment.

dqshiny 0.0.2

  • Fix text filter to properly skip empty filters.
  • Add borders and headers to dq_htmltable.
  • Add 'base-features' demo.
  • Support reactiveVal as dq_hot data.
  • Support NA filter to detect proper filter values.
  • Fix autocomplete dropdown display for filtering.
  • Automatically update filter values when dq_hot data changes.

dqshiny 0.0.1

  • Initial release.
  • Added a NEWS.md file to track changes to the package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("dqshiny")

0.0.3 by Richard Kunze, 3 months ago


https://github.com/daqana/dqshiny


Report a bug at https://github.com/daqana/dqshiny/issues


Browse source code at https://github.com/cran/dqshiny


Authors: Richard Kunze , Mirjam Rehr


Documentation:   PDF Manual  


GPL (>= 3) license


Imports shiny, htmltools

Suggests testthat, extrafont, ggplot2, jsonlite, rhandsontable, V8, htmlwidgets, shinytest


See at CRAN