external docs linked and updated

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-01-16 12:23:39 +01:00
commit 83fac94266
No known key found for this signature in database
9 changed files with 103 additions and 154 deletions

View file

@ -123,7 +123,7 @@ library(shiny)
# structure(match(splitter, names(labs)), levels = labs, class = "factor")
# }
#' Title
#' Extended cutting function
#'
#' @param x an object inheriting from class "hms"
#' @param ... passed on
@ -808,7 +808,7 @@ add_sparkline <- function(grid, column = "vals", color.main = "#2a8484", color.s
#'
#' @param data vector
#'
#' @returns
#' @returns logical
#' @export
#'
#' @examples
@ -915,6 +915,10 @@ create_overview_datagrid <- function(data) {
#' @export
#'
#' @examples
#' mtcars |>
#' overview_vars() |>
#' toastui::datagrid() |>
#' add_class_icon()
add_class_icon <- function(grid, column = "class") {
out <- toastui::grid_format(
grid = grid,
@ -2180,20 +2184,21 @@ custom_theme <- function(...,
version = 5,
primary = "#1E4A8F",
secondary = "#FF6F61",
bootswatch = "united",
base_font = bslib::font_google("Montserrat"),
heading_font = bslib::font_google("Public Sans",wght = "700"),
code_font = bslib::font_google("Open Sans")
# success = "#1E4A8F",
# info = ,
# warning = ,
# danger = ,
# fg = "#000",
# bg="#fff",
bootswatch = "united",
base_font = bslib::font_google("Montserrat"),
# base_font = bslib::font_google("Alice"),
# heading_font = bslib::font_google("Jost", wght = "800"),
# heading_font = bslib::font_google("Noto Serif"),
# heading_font = bslib::font_google("Alice"),
heading_font = bslib::font_google("Public Sans",wght = "700"),
code_font = bslib::font_google("Open Sans")){
){
bslib::bs_theme(
...,
version = version,
@ -2599,8 +2604,14 @@ add_var_toset <- function(data, var_name, default = "") {
data[, datanames]
}
#' @importFrom toastui datagrid grid_columns grid_format grid_style_column
#' grid_style_column grid_editor grid_editor_opts grid_selection_row
#' Modified from the datamods pacakge
#'
#' @param data data
#'
#' @param height height
#' @param selectionId selectionId
#' @param buttonId buttonId
#'
#' @examples
#' mtcars |>
#' summary_vars() |>
@ -3018,9 +3029,10 @@ ui_elements <- list(
shiny::column(
width = 9,
shiny::tags$p(
"Below is a short summary table of the provided data.
"Below is a short summary table of the provided data.
On the right hand side you have the option to create filters.
At the bottom you'll find a raw overview of the original vs the modified data.")
At the bottom you'll find a raw overview of the original vs the modified data."
)
)
),
fluidRow(
@ -3121,8 +3133,8 @@ ui_elements <- list(
title = "Browser",
tags$h3("Browse the provided data"),
shiny::tags$p(
"Below is a data table with all the modified data provided to browse and understand data."
),
"Below is a data table with all the modified data provided to browse and understand data."
),
shinyWidgets::html_dependency_winbox(),
# fluidRow(
# column(
@ -3306,12 +3318,21 @@ ui_elements <- list(
######### Documentation panel
#########
##############################################################################
"docs" = bslib::nav_panel(
title = "Documentation",
# shiny::tags$iframe("www/docs.html", height=600, width=535),
shiny::htmlOutput("docs_file"),
shiny::br()
"docs" = bslib::nav_item(
# shiny::img(shiny::icon("book")),
shiny::tags$a(
href = "https://agdamsbo.github.io/freesearcheR/",
"Docs (external)",
target = "_blank",
rel = "noopener noreferrer"
)
)
# bslib::nav_panel(
# title = "Documentation",
# # shiny::tags$iframe("www/docs.html", height=600, width=535),
# shiny::htmlOutput("docs_file"),
# shiny::br()
# )
)
# Initial attempt at creating light and dark versions
@ -3344,6 +3365,7 @@ ui <- bslib::page_fixed(
ui_elements$import,
ui_elements$overview,
ui_elements$analyze,
bslib::nav_spacer(),
ui_elements$docs,
# bslib::nav_spacer(),
# bslib::nav_item(shinyWidgets::circleButton(inputId = "mode", icon = icon("moon"),status = "primary")),