Я думаю, что в базовом решении вы можете создать собственный виджет / гаджет.Это своего рода начало для него - полностью функциональное - вы можете лучше его стилизовать под свои цели.
library(shiny)
library(miniUI)
library(highcharter)
library(tidyverse)
hightchart_filter <- function(data) {
ui <- miniPage(
miniContentPanel(
# Dates ####
dateInput("date_start", "start_date", value = "1900-01-01", width = "25%"),
dateInput("date_end", "end_date", value = "2100-01-01", width = "25%"),
# Highchart ####
highchartOutput("high_plot", height = "500px")
)
)
server <- function(input, output, session) {
# update for data boxes
updateDateInput(session, "date_start", value = data$date %>% min())
updateDateInput(session, "date_end", value = data$date %>% max())
# filter data
data_filtered <- reactive({
data %>% filter(between(date, input$date_start, input$date_end))
})
# Highchart ####
output$high_plot <- renderHighchart({
hchart(data_filtered(), "line", hcaes(x = "date", y = "value01", group = "variable"))
})
}
runGadget(ui, server)
}
и запустить его:
hightchart_filter(economics_long)