dreamrs / tuicalendr Goto Github PK
View Code? Open in Web Editor NEW:calendar: R htmlwidget for tui-calendar
Home Page: https://dreamrs.github.io/tuicalendr/
License: Other
:calendar: R htmlwidget for tui-calendar
Home Page: https://dreamrs.github.io/tuicalendr/
License: Other
I am creating a calendar in a Shiny application which generates entries based on timelines of certain milestone events. These are in a dataframe and I am able to display details in the body
column. However, is there some way of editing the event which includes the columns that are custom defined. For example, I want the user to change the status of the activity by marking it as "Completed", "In Progress" or "Closed". Is there some way of adding additional fields to the popup which comes up while editing a schedule?
Has anyone noticed an issue when using the package in Safari?
reprex:
library(shiny)
library(tuicalendr)
ui <- fluidPage(
calendarOutput(outputId = "calendar")
)
server <- function(input, output, session) {
output$calendar <- renderCalendar({
calendar(defaultView = "month", useNav = TRUE) %>%
add_schedule(
title = "R - introduction",
body = "What is R?",
start = sprintf("%s 08:00:00", Sys.Date()),
end = sprintf("%s 12:30:00", Sys.Date()),
category = "time"
)
})
}
shinyApp(ui, server)
Hello dreamRs
Your calendar is great. Id really love to be able to allow a user to select an event on the calendar ( ie click on an event displayed in the calendar) so that the event data was available for further processing. Is this possible?
Hey @pvictor,
While trying to check the selection of dates from the server side, I have noticed that _dates
does not update when clicking the previous and next buttons?
reprex:
library(tuicalendr)
library(shiny)
# App ----
ui <- fluidPage(
calendarOutput(outputId = "cal")
)
server <- function(input, output, session) {
output$cal <- renderCalendar({
calendar(defaultView = "month", useNav = TRUE, taskView = TRUE, scheduleView = c("time", "allday"))
})
observeEvent(input$cal_prev, {
print(input$cal_dates)
})
}
shinyApp(ui, server)
Hello,
I've encountered a weird behiavior from my calendar when I use it in a Shiny app with dynamic input.
Here's a reprex :
library(shiny)
library(shinyWidgets)
library(tuicalendr)
library(dplyr)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
pickerInput("filter_id",
label = "Filter",
selected = "id1",
choices = c("id1", "id2")
)
),
mainPanel(
calendarOutput("agenda")
)
)
)
server <- function(input, output) {
output$agenda <- renderCalendar({
calendarProps <- data.frame(
id = c("1"),
name = c("test"),
color = c("#000000"),
bgColor = c("#fcba03"),
borderColor = c("#fcba03")
)
# useless data for example
df = data.frame("id" = c("id1", "id2"),
"calendarId" = rep(1, 2),
"title" = rep("title1", 2),
"start" = rep(Sys.time(), 2),
"end" = rep(Sys.time() + 60 * 60 * 2, 2),
"category" = rep("time", 2)
)
df = df %>%
filter(id == input$filter_id)
calendar(defaultView = "week",
taskView = F,
scheduleView = "time",
useNav = T) %>%
set_calendars_props_df(calendarProps) %>%
add_schedule_df(df)
})
}
shinyApp(ui = ui, server = server)
When you're in the app, select "id2" in the pickerInput then start navigating between weeks, you will notice that some days are skipped.
Thanks!
is it possible to select text from the pop-up box when a calendar event is clicked? There is text I would like to highlight and copy but this seems to be disabled.
Hello,
I'm looking for a calendar to add in my shiny app and your calendar it seems the best, but I need a calendar with a "year view". Is it possible?
Hello. The edit schedules example is great and exactly what I need. However, I don't seem to be able to figure out how to delete a schedule using the proxy method? It doesn't seem to be covered in the example. Have tried using 'input$my_calendar_delete' in conjunction with cal_proxy_delete but can't seem to make progress. Any ideas if this is possible? Thanks!
Sorry for all the questions but this is the best package for R calendars I have found in a long time so keen to explore more....
Is there a way of searching the calendar for events - like a simple keyword search or something? I've looked on the javascript docs and I cant seem to find this so just wondered if you knew....?
Hi! Really cool package!
Is it possible to somehow add an actionButton()
to the pop up?
Hello, I am interested in how to edit an entry in a weekly calendar. Options for doing this include:
When I use the set_events()
function to console.log(event)
I can see the data for the destination where I moved the data in the dev console. I am new to this area of shiny so I am unsure how to solve this myself; how do I get the data of the edited object (using on of the methods mentioned), send it to R, update the calendar, and have that new data accessible for sending to a DT or saving the data as a csv?
I will provide a script that I am using for a weekly calendar view and chunks from your examples in the repo. With the actual data I cannot share, I have employee entries populating this calendar, however, the group leader may choose to edit the entries that better fit the team working on the project at hand.
library(shiny)
library(tuicalendr)
ui <- fluidPage(
textOutput("text1"),
tableOutput("show_inputs"),
calendarOutput("continutiy_tab_calendar")
)
server <- function(input, output) {
output$continutiy_tab_calendar <- renderCalendar({
## Create Calendar
cal <- calendar(
defaultDate = Sys.Date(),
useNav = TRUE,
readOnly = FALSE
) %>%
set_month_options(narrowWeekend = TRUE)
## Example from README
cal %>%
add_schedule(
calendarId = "courses",
title = "R - introduction",
body = "What is R?",
start = sprintf("%s 08:00:00", Sys.Date()),
end = sprintf("%s 12:30:00", Sys.Date()),
category = "time"
) %>%
add_schedule(
calendarId = "courses",
title = "R - Stats",
body = "Stats with R",
start = sprintf("%s 10:00:00", Sys.Date() + 1),
end = sprintf("%s 14:00:00", Sys.Date() + 1),
category = "time"
) %>%
set_events(
beforeUpdateSchedule = JS("function(event) {console.log(event);}")
)
})
}
# Run the application
shinyApp(ui = ui, server = server)
I appreciate the example for creating a schedule entry, that solves one part of my project I am working on! :)
@pvictor at the outset, thank you so much for making this. I had been on the lookout for a good calendar functionality in Shiny and tuicalendr
ticks most boxes!
I was wondering if there is a way of changing the weekend to Friday and Saturday. I noticed that the Toast UI Calendar too doesn't have this feature as of now and is probably planned for release in version 2. In the interim do you have any workaround for changing the days of the weekend?
Hi!
first of all, thanks for an awesome widget. I very quickly got it working and in general fixing the appearance to what I wanted.
I have a couple of tweaks I'm struggling with and hope you might help. Bear with me, my JS skills are horrible, and I'm still a little unsure what is lack of JS-skills and what is not understanding how the package functions connect to the underlying js.
I'd like to change the colour of the bullets at the top of month view, the nav-items, to another colour than blue. Same with the circle around todays date. I could not find what theme items would control that.
According to issue 380 in the tui.calendar github repo, the popupDetailsBody should be able to render html, but for me it is still rendering in plain text. Is there any particular trick to getting that working?
Thanks for any help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.