custom light and dark colors
Browse files- app.R +19 -22
- globals.R +17 -12
- www/rtemislive.scss +67 -5
app.R
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
# shiny::runApp("./")
|
6 |
# Setup
|
7 |
-
rtemisseq_version <- "0.2.
|
8 |
library(rtemis)
|
9 |
library(rtemisbio)
|
10 |
library(shiny)
|
@@ -33,8 +33,8 @@ success <- "#B4DC55"
|
|
33 |
#' @export
|
34 |
#' @return A shiny app that can be converted to a shinylive app
|
35 |
|
36 |
-
|
37 |
-
default_theme = "
|
38 |
protein_plotly_height = "900px",
|
39 |
jsonedit_height = "900px",
|
40 |
verbosity = 0) {
|
@@ -91,12 +91,12 @@ seqvizlive <- function(
|
|
91 |
theme = bslib::bs_theme(
|
92 |
bg = "#fff",
|
93 |
fg = "#000",
|
94 |
-
primary = primary,
|
95 |
secondary = "#704071",
|
96 |
success = success,
|
97 |
-
info = info,
|
98 |
-
`tooltip-bg` = "#303030",
|
99 |
-
`tooltip-color` = helpcol,
|
100 |
`tooltip-opacity` = 1,
|
101 |
`tooltip-border-radius` = "10px",
|
102 |
`tooltip-padding-x` = "1rem",
|
@@ -419,19 +419,16 @@ seqvizlive <- function(
|
|
419 |
style = "text-align: right;",
|
420 |
class = "rtanihi"
|
421 |
),
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
),
|
433 |
-
style = "text-align: left;"
|
434 |
-
), # /div rt-tooltip
|
435 |
placement = "bottom"
|
436 |
) # /tooltip
|
437 |
}) # /ui_a3_tooltip
|
@@ -518,6 +515,6 @@ seqvizlive <- function(
|
|
518 |
|
519 |
# Shiny app ----
|
520 |
shiny::shinyApp(ui = ui, server = server, enableBookmarking = "url")
|
521 |
-
} #
|
522 |
|
523 |
-
|
|
|
4 |
|
5 |
# shiny::runApp("./")
|
6 |
# Setup
|
7 |
+
rtemisseq_version <- "0.2.8"
|
8 |
library(rtemis)
|
9 |
library(rtemisbio)
|
10 |
library(shiny)
|
|
|
33 |
#' @export
|
34 |
#' @return A shiny app that can be converted to a shinylive app
|
35 |
|
36 |
+
rtemisseq <- function(
|
37 |
+
default_theme = "light",
|
38 |
protein_plotly_height = "900px",
|
39 |
jsonedit_height = "900px",
|
40 |
verbosity = 0) {
|
|
|
91 |
theme = bslib::bs_theme(
|
92 |
bg = "#fff",
|
93 |
fg = "#000",
|
94 |
+
# primary = primary,
|
95 |
secondary = "#704071",
|
96 |
success = success,
|
97 |
+
# info = info,
|
98 |
+
# `tooltip-bg` = "#303030",
|
99 |
+
# `tooltip-color` = helpcol,
|
100 |
`tooltip-opacity` = 1,
|
101 |
`tooltip-border-radius` = "10px",
|
102 |
`tooltip-padding-x` = "1rem",
|
|
|
419 |
style = "text-align: right;",
|
420 |
class = "rtanihi"
|
421 |
),
|
422 |
+
rthelplist(
|
423 |
+
c(
|
424 |
+
"Select Data Source (built-in or upload)",
|
425 |
+
"Click 'Plot dataset' to render the plot - repeat after changing datasets.",
|
426 |
+
"Hover over plot to see annotations.",
|
427 |
+
"Click on legend items to toggle visibility of annotations.",
|
428 |
+
"Double-click on legend items to isolate a single annotation type.",
|
429 |
+
"Click on top-right gear icon to change plot settings."
|
430 |
+
)
|
431 |
+
),
|
|
|
|
|
|
|
432 |
placement = "bottom"
|
433 |
) # /tooltip
|
434 |
}) # /ui_a3_tooltip
|
|
|
515 |
|
516 |
# Shiny app ----
|
517 |
shiny::shinyApp(ui = ui, server = server, enableBookmarking = "url")
|
518 |
+
} # rtemisseq
|
519 |
|
520 |
+
rtemisseq()
|
globals.R
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# globals.R
|
2 |
-
#
|
3 |
# EDG rtemis.org
|
4 |
|
5 |
# Themes ----
|
@@ -56,12 +56,26 @@ rthelp_inline <- function(..., title = NULL, class = "rthelp-inline") {
|
|
56 |
rthelp(..., title = title, class = class)
|
57 |
} # rtemislive::rthelp_inline
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
bold <- function(x) {
|
60 |
paste0("<b>", x, "</b>")
|
61 |
}
|
62 |
|
63 |
hilite <- function(x) {
|
64 |
-
paste0("<span style='color:
|
65 |
}
|
66 |
|
67 |
nannot <- function(n) {
|
@@ -95,13 +109,4 @@ summarize_a3 <- function(x) {
|
|
95 |
if (!is.null(x$Reference)) a("Reference", href = x$Reference, target = "_blank")
|
96 |
)
|
97 |
)
|
98 |
-
} #
|
99 |
-
|
100 |
-
# Create list using custom bullet
|
101 |
-
rhelplist <- function(x, bullet = bsicons::bs_icon("arrow-right-short")) {
|
102 |
-
htmltools::HTML(
|
103 |
-
paste0(
|
104 |
-
bullet, "<i>", x, "</i>", "<br>"
|
105 |
-
)
|
106 |
-
)
|
107 |
-
} # seqvizlive::rtlist
|
|
|
1 |
# globals.R
|
2 |
+
# ::rtemisseq::
|
3 |
# EDG rtemis.org
|
4 |
|
5 |
# Themes ----
|
|
|
56 |
rthelp(..., title = title, class = class)
|
57 |
} # rtemislive::rthelp_inline
|
58 |
|
59 |
+
#' Create bulleted list
|
60 |
+
#'
|
61 |
+
#' @return div
|
62 |
+
rthelplist <- function(x, bullet = bsicons::bs_icon("arrow-right-short"), class = "rthelplist") {
|
63 |
+
div(
|
64 |
+
htmltools::HTML(
|
65 |
+
paste0(
|
66 |
+
bullet, "<i>", x, "</i>", "<br>"
|
67 |
+
)
|
68 |
+
),
|
69 |
+
class = class
|
70 |
+
)
|
71 |
+
} # rtemisseq::rthelplist
|
72 |
+
|
73 |
bold <- function(x) {
|
74 |
paste0("<b>", x, "</b>")
|
75 |
}
|
76 |
|
77 |
hilite <- function(x) {
|
78 |
+
paste0("<span style='color: var(--bs-primary);font-weight: bold;'>", x, "</span>")
|
79 |
}
|
80 |
|
81 |
nannot <- function(n) {
|
|
|
109 |
if (!is.null(x$Reference)) a("Reference", href = x$Reference, target = "_blank")
|
110 |
)
|
111 |
)
|
112 |
+
} # rtemisseq::summarize_a3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
www/rtemislive.scss
CHANGED
@@ -1,12 +1,46 @@
|
|
1 |
/* rtemislive.scss */
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/* rthelp */
|
4 |
.rthelp {
|
5 |
position: fixed !important;
|
6 |
top: 33% !important;
|
7 |
left: 50% !important;
|
8 |
transform: translate(-50%, -50%);
|
9 |
-
color:
|
10 |
margin: 11px;
|
11 |
border: 0.5px solid transparent;
|
12 |
border-radius: 10px;
|
@@ -15,7 +49,7 @@
|
|
15 |
|
16 |
.rthelp-inline {
|
17 |
display: inline-block;
|
18 |
-
color:
|
19 |
margin: 11px;
|
20 |
border: 0.5px solid transparent;
|
21 |
border-radius: 10px;
|
@@ -23,6 +57,13 @@
|
|
23 |
text-align: left;
|
24 |
}
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
// modify bs link color only for body links
|
27 |
// card-body a {
|
28 |
// color: $primary !important;
|
@@ -47,15 +88,18 @@
|
|
47 |
|
48 |
@keyframes highlight-border {
|
49 |
0% {
|
50 |
-
border-color: transparent;
|
|
|
|
|
51 |
}
|
52 |
|
53 |
50% {
|
54 |
-
border-color:
|
55 |
}
|
56 |
|
57 |
100% {
|
58 |
-
border-color: transparent;
|
|
|
59 |
}
|
60 |
}
|
61 |
|
@@ -64,3 +108,21 @@
|
|
64 |
margin-top: auto;
|
65 |
margin-bottom: auto;
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/* rtemislive.scss */
|
2 |
|
3 |
+
// Define your custom colors
|
4 |
+
// primary color
|
5 |
+
$light-primary: #1295D8;
|
6 |
+
$dark-primary: #72CDF4;
|
7 |
+
// info color
|
8 |
+
$light-info: #E44C9A; // Default Bootstrap info color
|
9 |
+
$dark-info: #FEB2E0; // Darker shade for better contrast in dark mode
|
10 |
+
// tooltip-bg
|
11 |
+
$light-tooltipbg: #cdcdcd;
|
12 |
+
$dark-tooltipbg: #333333;
|
13 |
+
|
14 |
+
// Customize the theme colors
|
15 |
+
@include color-mode(light) {
|
16 |
+
// primary color
|
17 |
+
--bs-primary: #{$light-primary};
|
18 |
+
--bs-primary-rgb: #{red($light-primary)}, #{green($light-primary)}, #{blue($light-primary)};
|
19 |
+
// info color
|
20 |
+
--bs-info: #{$light-info};
|
21 |
+
--bs-info-rgb: #{red($light-info)}, #{green($light-info)}, #{blue($light-info)};
|
22 |
+
|
23 |
+
--rt-tooltipbg: #{$light-tooltipbg};
|
24 |
+
}
|
25 |
+
|
26 |
+
@include color-mode(dark) {
|
27 |
+
// primary color
|
28 |
+
--bs-primary: #{$dark-primary};
|
29 |
+
--bs-primary-rgb: #{red($dark-primary)}, #{green($dark-primary)}, #{blue($dark-primary)};
|
30 |
+
// info color
|
31 |
+
--bs-info: #{$dark-info};
|
32 |
+
--bs-info-rgb: #{red($dark-info)}, #{green($dark-info)}, #{blue($dark-info)};
|
33 |
+
|
34 |
+
--rt-tooltipbg: #{$dark-tooltipbg};
|
35 |
+
}
|
36 |
+
|
37 |
/* rthelp */
|
38 |
.rthelp {
|
39 |
position: fixed !important;
|
40 |
top: 33% !important;
|
41 |
left: 50% !important;
|
42 |
transform: translate(-50%, -50%);
|
43 |
+
color: var(--bs-info) !important;
|
44 |
margin: 11px;
|
45 |
border: 0.5px solid transparent;
|
46 |
border-radius: 10px;
|
|
|
49 |
|
50 |
.rthelp-inline {
|
51 |
display: inline-block;
|
52 |
+
color: var(--bs-info) !important;
|
53 |
margin: 11px;
|
54 |
border: 0.5px solid transparent;
|
55 |
border-radius: 10px;
|
|
|
57 |
text-align: left;
|
58 |
}
|
59 |
|
60 |
+
.rthelplist {
|
61 |
+
color: var(--bs-info) !important;
|
62 |
+
background-color: var(--rt-tooltipbg) !important;
|
63 |
+
text-align: left;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
// modify bs link color only for body links
|
68 |
// card-body a {
|
69 |
// color: $primary !important;
|
|
|
88 |
|
89 |
@keyframes highlight-border {
|
90 |
0% {
|
91 |
+
// border-color: transparent;
|
92 |
+
// Make border-color var(--bs-info) at 10% transparency
|
93 |
+
border-color: rgba(var(--bs-info-rgb), 0.10);
|
94 |
}
|
95 |
|
96 |
50% {
|
97 |
+
border-color: var(--bs-info);
|
98 |
}
|
99 |
|
100 |
100% {
|
101 |
+
// border-color: transparent;
|
102 |
+
border-color: rgba(var(--bs-info-rgb), 0.10);
|
103 |
}
|
104 |
}
|
105 |
|
|
|
108 |
margin-top: auto;
|
109 |
margin-bottom: auto;
|
110 |
}
|
111 |
+
|
112 |
+
// Bootstrap tooltips
|
113 |
+
// set tooltip, tooltip-inner and tooltip-arrow colors to rt-tooltipbg
|
114 |
+
.tooltip {
|
115 |
+
--bs-tooltip-bg: var(--rt-tooltipbg);
|
116 |
+
--bs-tooltip-arrow-color: var(--rt-tooltipbg);
|
117 |
+
border-radius: 10px;
|
118 |
+
}
|
119 |
+
|
120 |
+
.tooltip-inner {
|
121 |
+
background-color: var(--rt-tooltipbg);
|
122 |
+
color: var(--bs-info) !important;
|
123 |
+
}
|
124 |
+
|
125 |
+
// Remove underscore from all links
|
126 |
+
a {
|
127 |
+
text-decoration: none;
|
128 |
+
}
|