Skip to content

Commit

Permalink
Fix GUI when dmSVG is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 27, 2022
1 parent da65e86 commit 35d723a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion R/gui-dmSVG.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dmSVG <- function(dm, viewBox = TRUE, node_to_zoom = NULL, nodes_to_select = NUL
#'
#' @noRd
dmSVGOutput <- function(outputId, width = "100%", height = "400px") {
htmlwidgets::shinyWidgetOutput(outputId, "dmSVG", width, height, package = "dmSVG")
htmlwidgets::shinyWidgetOutput(outputId, "dmSVG", width, height, package = "dm")
}

#' @rdname dmSVG-shiny
Expand Down
6 changes: 3 additions & 3 deletions R/gui-gui_global.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ reactable_column <- function(data, table_name) {
style = list(float = "right"),
dplyr::if_else(
data$is_pk[index],
list(htmltools::span(style = "margin-right: 10px;", title = "Primary key", shiny::icon("key"))),
list(htmltools::span(style = "margin-right: 10px;", title = "Primary key", shiny::icon(verify_fa = FALSE, "key"))),
NULL
),
dplyr::if_else(
data$is_child_fk[index],
list(htmltools::span(style = "margin-right: 10px;", title = "Child in foreign key", shiny::icon("angle-double-right"))),
list(htmltools::span(style = "margin-right: 10px;", title = "Child in foreign key", shiny::icon(verify_fa = FALSE, "angle-double-right"))),
NULL
),
dplyr::if_else(
data$is_parent_key[index],
list(htmltools::span(style = "margin-right: 10px;", title = "Parent key", shiny::icon("angle-double-left"))),
list(htmltools::span(style = "margin-right: 10px;", title = "Parent key", shiny::icon(verify_fa = FALSE, "angle-double-left"))),
NULL
),
shiny::span(class = "tag", style = "color: #999; border-color: #999;", title = paste0("Data type: ", data$type[index]), data$type[index])
Expand Down
24 changes: 12 additions & 12 deletions R/gui-gui_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ html_header <- function() {
class = "navbar-custom-menu",
shiny::tags$ul(
class = "nav navbar-nav",
shiny::tags$li(actionButton2("i_undo", label = NULL, icon = shiny::icon("undo"), class = "btn btn-default", style = "margin-top: 9px; margin-right: 15px;")),
shiny::tags$li(actionButton2("i_redo", label = NULL, icon = shiny::icon("redo"), class = "btn btn-default", style = "margin-top: 9px; margin-right: 15px;")),
shiny::tags$li(actionButton2("i_undo", label = NULL, icon = shiny::icon(verify_fa = FALSE, "undo"), class = "btn btn-default", style = "margin-top: 9px; margin-right: 15px;")),
shiny::tags$li(actionButton2("i_redo", label = NULL, icon = shiny::icon(verify_fa = FALSE, "redo"), class = "btn btn-default", style = "margin-top: 9px; margin-right: 15px;")),
shiny::tags$li(shiny::tags$button(
id = "i_return", style = "margin-top: 9px; margin-right: 15px;", href = "#", type = "button",
class = "btn btn-primary btn action-button btn-navbar",
shiny::icon("fas fa-sign-out-alt", ), "To Console"
shiny::icon(verify_fa = FALSE, "fas fa-sign-out-alt", ), "To Console"
))
)
)
Expand Down Expand Up @@ -97,11 +97,11 @@ gui_ui <- function(ns, select_tables = TRUE) {
dmSVGOutput("o_svg", height = "626px")
},
footer = shiny::tagList(
actionButton2("i_zoom_to_selected", "Zoom", icon = shiny::icon("binoculars"), class = "btn btn-info btn-app"),
actionButton2("i_rm_tbl", "Delete table", icon = shiny::icon("trash-alt"), class = "btn btn-info btn-app"),
actionButton2("i_select_tbl", "Select table", icon = shiny::icon("table"), class = "btn btn-info btn-app"),
actionButton2("i_rm_fk", "Remove foreign key", icon = shiny::icon("unlink"), class = "btn btn-info btn-app"),
actionButton2("i_disentangle", "Remove cycles", icon = shiny::icon("circle-notch"), class = "btn btn-info btn-app"),
actionButton2("i_zoom_to_selected", "Zoom", icon = shiny::icon(verify_fa = FALSE, "binoculars"), class = "btn btn-info btn-app"),
actionButton2("i_rm_tbl", "Delete table", icon = shiny::icon(verify_fa = FALSE, "trash-alt"), class = "btn btn-info btn-app"),
actionButton2("i_select_tbl", "Select table", icon = shiny::icon(verify_fa = FALSE, "table"), class = "btn btn-info btn-app"),
actionButton2("i_rm_fk", "Remove foreign key", icon = shiny::icon(verify_fa = FALSE, "unlink"), class = "btn btn-info btn-app"),
actionButton2("i_disentangle", "Remove cycles", icon = shiny::icon(verify_fa = FALSE, "circle-notch"), class = "btn btn-info btn-app"),
shiny::tags$style(htmltools::HTML("
#colorpicker-user>.shiny-input-container {
display: inline-block !important;
Expand Down Expand Up @@ -153,9 +153,9 @@ gui_ui <- function(ns, select_tables = TRUE) {
shiny::conditionalPanel(
condition = "output.is_one_table_selected",
shiny::tagList(
actionButton2("i_add_pk", "Add primary key", icon = shiny::icon("key"), class = "btn btn-info btn-app"),
actionButton2("i_add_pk", "Add primary key", icon = shiny::icon(verify_fa = FALSE, "key"), class = "btn btn-info btn-app"),
# actionButton("i_rename_col", "Rename columns"),
actionButton2("i_rm_col", "Delete column", icon = shiny::icon("trash"), class = "btn btn-app")
actionButton2("i_rm_col", "Delete column", icon = shiny::icon(verify_fa = FALSE, "trash"), class = "btn btn-app")
)
)
)
Expand All @@ -172,8 +172,8 @@ gui_ui <- function(ns, select_tables = TRUE) {
),
footer = shiny::tagList(
# p("Select two tables to manage the relationship between them."),
actionButton2("i_add_fk", "Add foreign key", icon = shiny::icon("link"), class = "btn btn-info btn-app"),
actionButton2("i_switch_tbls", "Switch tables", icon = shiny::icon("exchange-alt"), class = "btn btn-info btn-app")
actionButton2("i_add_fk", "Add foreign key", icon = shiny::icon(verify_fa = FALSE, "link"), class = "btn btn-info btn-app"),
actionButton2("i_switch_tbls", "Switch tables", icon = shiny::icon(verify_fa = FALSE, "exchange-alt"), class = "btn btn-info btn-app")
)
)
)
Expand Down

0 comments on commit 35d723a

Please sign in to comment.