Skip to content

Commit

Permalink
push local style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Oct 3, 2024
1 parent 6b23226 commit c3af5ae
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 33 deletions.
34 changes: 18 additions & 16 deletions R/plot_with_settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@ plot_with_settings_ui <- function(id) {
)
)),
include_css_files("plot_with_settings"),
tags$div(
bslib::card(
id = ns("plot-with-settings"),
tags$div(
class = "plot-settings-buttons",
type_download_ui(ns("downbutton")),
actionButton(
ns("expand"),
label = character(0),
icon = icon("up-right-and-down-left-from-center"),
class = "btn-sm"
tags$div(
class = "plot-settings-buttons",
type_download_ui(ns("downbutton")),
actionLink(
ns("expand"),
label = character(0),
icon = icon("up-right-and-down-left-from-center"),
class = "btn-sm"
),
bslib::popover(
icon("maximize"),
uiOutput(ns("slider_ui")),
uiOutput(ns("width_warning")),
options = list(triggers = "hover focus")
)
),
bslib::popover(
icon("maximize"),
uiOutput(ns("slider_ui")),
uiOutput(ns("width_warning")),
options = list(triggers = "hover focus")
)
),
uiOutput(ns("plot_out_main"), class = "plot_out_container", width = "100%")
uiOutput(ns("plot_out_main"), class = "plot_out_container", width = "100%")
)
)
)
}
Expand Down
29 changes: 12 additions & 17 deletions R/standard_layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,26 @@ standard_layout <- function(output,
# if encoding=NULL then forms is placed below output

tag_output <- tags$div(
class = "well",
tags$div(class = "pre-output", pre_output),
tags$div(class = "output", output),
tags$div(class = "post-output", post_output)
class = "teal-widgets standard-layout",
tags$div(class = "standard-layout-pre-output", pre_output),
tags$div(class = "standard-layout-output", output),
tags$div(class = "standard-layout-post-output", post_output)
)

tag_enc_out <- if (!is.null(encoding)) {
tagList(
column(
width = 3,
tags$div(class = "well", encoding),
bslib::layout_sidebar(
sidebar = bslib::sidebar(
encoding,
if (is.null(forms)) {
NULL
} else {
tagList(
tags$br(),
tags$div(class = "form-group", forms)
)
forms
}
),
column(width = 9, tag_output)
tag_output
)
} else {
column(
width = 12,
tags$div(
tag_output,
if (is.null(forms)) {
NULL
Expand All @@ -93,8 +88,8 @@ standard_layout <- function(output,
)
}

fluidRow(
class = "teal-widgets standard-layout",
bslib::page_fluid(
# class = "teal-widgets standard-layout",
tag_enc_out
)
}
32 changes: 32 additions & 0 deletions inst/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,35 @@
--bs-btn-padding-x: 1em;
--bs-btn-padding-y: 0.5em;
}

.teal-widgets.plot-modal .modal-body {
max-width: 90vw;
max-height: 70vh;
overflow: scroll;
}

.modal-footer {
padding: 1rem;
}

.plot-settings-buttons {
display: flex;
justify-content: flex-end;
align-items: center;
}

.plot-settings-buttons a {
color: black;
}

.plot-settings-buttons i {
margin: 0 0.5rem;
}

.teal-widgets.standard-layout > .standard-layout-output .card {
padding: 0;
}

.bslib-sidebar-layout > .sidebar > .sidebar-content {
padding-top: 2rem;
}

0 comments on commit c3af5ae

Please sign in to comment.