kanban-shiny {shinykanban}R Documentation

Shiny bindings for Kanban Board

Description

Output and render functions for using Kanban Board within Shiny.

Usage

kanbanOutput(outputId, width = "100%", height = "400px")

renderKanban(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

Output variable to read the value from

width, height

A valid CSS unit (like "100%", "400px", "auto") or a number, which will be coerced to a string and have "px" appended.

expr

An expression that generates kanban board with shinykanban::kanban()

env

The parent environment for the reactive expression.

quoted

If it is TRUE, then the quote()ed value of expr will be used when expr is evaluated.

Value

kanbanOutput() returns a kanban output element that can be included in a Shiny UI.

renderKanban() returns a kanban render function that can be assigned to a Shiny output slot.

Examples

if(interactive()){
library(shiny)
library(shinykanban)
library(bsicons)

ui <- fluidPage(
 kanbanOutput("kanban_board")
)

server <- function(input, output, session) {

 kanban_data <- reactiveVal(
  list(
  "To Do" = list(
    name = "To Do",
    items = list(
     list(
       id = "task1",
       title = "Task 1",
       subtitle = "abc"
     ),
      list(
       id = "task2",
       title = "Task 2"
     )
   ),
    listPosition = 1
   ),
  "In Progress" = list(
   name = "In Progress",
   items = list(
     list(
      id = "task3",
      title = "Task 3"
    )
   ),
     listPosition = 2
    )
   ))

 output$kanban_board <- renderKanban({
  kanban(data = kanban_data())
 })

 # Get any change from kanban and update the data
 observeEvent(input$kanban_board, {
 new_list <- input$kanban_board
 new_list$`_timestamp` <- NULL
    kanban_data(new_list)
 })
}
shinyApp(ui, server)
}

[Package shinykanban version 0.0.1 Index]