Title: | Create Kanban Board in Shiny Applications |
---|---|
Description: | Provides an interactive Kanban board widget for 'shiny' applications. It allows users to manage tasks using a drag-and-drop interface and offers customizable styling options. 'shinykanban' is ideal for project management, task tracking, and agile workflows within 'shiny' apps. |
Authors: | Ugur Dar [aut, cre], Brian Pillmore [aut, cph] |
Maintainer: | Ugur Dar <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2025-03-05 07:10:21 UTC |
Source: | CRAN |
Retrieves the details of a card that was clicked on the Kanban board.
getSelectedCard(outputId, session = NULL)
getSelectedCard(outputId, session = NULL)
outputId |
A character string specifying the ID of the Kanban output. |
session |
The Shiny session object. |
A list with the selected card's details as a list (listName, title, id, position, clickCount)
This function creates an interactive Kanban board as an HTML widget.
kanban( data, styleOptions = list(headerBg = "#fff", headerBgHover = "#fff", headerColor = "#353535", headerFontSize = "1rem", listNameFontSize = "1rem", cardTitleFontSize = "1rem", cardTitleFontWeight = 600, cardSubTitleFontSize = "0.8rem", cardSubTitleFontWeight = 300, addCardBgColor = "#999", deleteList = list(backgroundColor = "#fff", color = "#353535", icon = bsicons::bs_icon("x"), size = "1rem"), deleteCard = list(backgroundColor = "#fff", color = "#353535", icon = bsicons::bs_icon("trash"), size = "1rem"), addButtonText = "Add", cancelButtonText = "Cancel", addCardButtonText = "Add Card", cancelCardButtonText = "Cancel"), width = NULL, height = NULL, elementId = NULL )
kanban( data, styleOptions = list(headerBg = "#fff", headerBgHover = "#fff", headerColor = "#353535", headerFontSize = "1rem", listNameFontSize = "1rem", cardTitleFontSize = "1rem", cardTitleFontWeight = 600, cardSubTitleFontSize = "0.8rem", cardSubTitleFontWeight = 300, addCardBgColor = "#999", deleteList = list(backgroundColor = "#fff", color = "#353535", icon = bsicons::bs_icon("x"), size = "1rem"), deleteCard = list(backgroundColor = "#fff", color = "#353535", icon = bsicons::bs_icon("trash"), size = "1rem"), addButtonText = "Add", cancelButtonText = "Cancel", addCardButtonText = "Add Card", cancelCardButtonText = "Cancel"), width = NULL, height = NULL, elementId = NULL )
data |
A named list representing the board data. |
styleOptions |
A named list of style options. |
width , height
|
Optional widget dimensions. |
elementId |
DOM element ID. |
A kanban board.
Output and render functions for using Kanban Board within Shiny.
kanbanOutput(outputId, width = "100%", height = "400px") renderKanban(expr, env = parent.frame(), quoted = FALSE)
kanbanOutput(outputId, width = "100%", height = "400px") renderKanban(expr, env = parent.frame(), quoted = FALSE)
outputId |
Output variable to read the value from |
width , height
|
A valid CSS unit (like |
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. |
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.
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) }
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) }
Update the data for a Kanban input on the client.
updateKanban(session, inputId, data)
updateKanban(session, inputId, data)
session |
The Shiny session object. |
inputId |
The ID of the input object. |
data |
The data to set. |
None