MyNixOS website logo
Description

A Histogram Slider Input for 'Shiny'.

A histogram slider input binding for use in 'Shiny'. Currently supports creating histograms from numeric, date, and 'date-time' vectors.

histoslider

CRANstatus Lifecycle:experimental R buildstatus

A Shiny input binding wrapper for the histoslider React component.

Installation

Install the stable release of histoslider on CRAN:

install.packages("histoslider")

Example usage

input_histoslider() currently supports creating histogram sliders from numeric, date, datetime vectors. The histogram bins may be customized through the breaks argument of an implicit call to hist().

library(shiny)
library(histoslider)

numerics <- rnorm(100)
dates <- sample(
  seq(as.Date('2020-01-01'), as.Date('2030-01-01'), by = "1 month"),
  size = 500, replace = TRUE
)

datetimes <- sample(
  seq(as.POSIXct('2020-01-01 00:01'), as.POSIXct('2030-01-01 00:01'), by = "1 month"),
  size = 500, replace = TRUE
)

ui <- bslib::page_fixed(
  input_histoslider("numeric", "Numeric", numerics, start = -1, end = 1),
  input_histoslider("date", "Date", dates, breaks = 15),
  input_histoslider("datetime", "Date Time", datetimes),
  verbatimTextOutput("values")
)

server <- function(input, output) {
  output$values <- renderPrint({
    str(list(
      numeric = input$numeric,
      date = input$date,
      datetime = input$datetime
    ))
  })
}

shinyApp(ui, server)

An input_histoslider() can also be updated programmatically via update_histoslider(). For example usage, see the inst/examples folder.

Metadata

Version

0.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows