egenn commited on
Commit
abde1d6
Β·
1 Parent(s): fea540e
Files changed (3) hide show
  1. README.md +6 -5
  2. app.R +3 -40
  3. www/globals.js +0 -9
README.md CHANGED
@@ -1,11 +1,12 @@
1
  ---
2
- title: Rtemisxt
3
- emoji: πŸ“š
4
- colorFrom: blue
5
- colorTo: yellow
6
  sdk: docker
7
  pinned: false
8
  license: gpl-3.0
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: rtemisXt
3
+ emoji: 🌊
4
+ colorFrom: gray
5
+ colorTo: indigo
6
  sdk: docker
7
  pinned: false
8
  license: gpl-3.0
9
  ---
10
 
11
+ xtlive on Huggingface Spaces
12
+ part of [rtemis](rtemis.org)
app.R CHANGED
@@ -2,22 +2,6 @@
2
  # ::rtemislive::
3
  # 2024 EDG rtemis.org
4
 
5
- # [ Shiny ]
6
- # https://shiny.posit.co/r/getstarted/shiny-basics/lesson1/
7
- # https://posit-dev.github.io/r-shinylive/
8
- # to run shiny app:
9
- # shiny::runApp("./")
10
- #
11
- # [ bslib ]
12
- # https://rstudio.github.io/bslib/
13
- # Theming variables: https://rstudio.github.io/bslib/articles/bs5-variables/index.html
14
- #
15
- # [ Bootstrap icons ]
16
- # https://icons.getbootstrap.com
17
- #
18
- # [ Huggingface Spaces]
19
- # https://huggingface.co/docs/hub/en/spaces-sdks-docker-shiny
20
-
21
  # Setup
22
  library(shiny)
23
  library(bslib)
@@ -40,8 +24,7 @@ secondary <- "#704071"
40
  info <- helpcol <- "#FEB2E0"
41
  success <- "#B4DC55"
42
 
43
- #' Create timeseries visualization shinylive app
44
- #'
45
  #' Visualize timeseries data using `dplot3_xt()`
46
  #'
47
  #' Set verbosity to 1 to monitor app progress
@@ -51,7 +34,7 @@ success <- "#B4DC55"
51
  #'
52
  #' @author EDG
53
  #' @export
54
- #' @return A shiny app that can be converted to a shinylive app
55
 
56
  xtlive <- function(
57
  default_theme = "dark",
@@ -64,7 +47,7 @@ xtlive <- function(
64
  # Version
65
  xtl <- paste0(
66
  "xtlive v.0.0.2",
67
- # " | ", "rtemis v.0.97.3", utils::packageVersion("rtemis"), # doesn't work in shinylive
68
  " | R v.", version$major, ".", version$minor,
69
  " | running on ", sessionInfo()[[2]]
70
  )
@@ -114,7 +97,6 @@ xtlive <- function(
114
  window_title = "rtemis xtlive",
115
  # Language ----
116
  lang = "en",
117
- # tags$script(src = "globals.js"),
118
  # Nav Panels ----
119
  ## [] Welcome ----
120
  bslib::nav_panel(
@@ -234,7 +216,6 @@ xtlive <- function(
234
  # busy indicators ----
235
  shinybusy::add_busy_spinner(
236
  spin = "orbit",
237
- # color = "#72CDF4",
238
  color = "#00ffff",
239
  timeout = 200,
240
  position = "bottom-left",
@@ -405,7 +386,6 @@ xtlive <- function(
405
  bindEvent(input$xt_plot_button, input$xt_plot_update_button)
406
 
407
  # Create variable clicked that is TRUE after input$xt_plot_button is clicked
408
- # clicked <- shiny::reactiveVal(TRUE)
409
  clicked <- shiny::reactiveVal(FALSE)
410
  shiny::observeEvent(input$xt_plot_button, {
411
  clicked(TRUE)
@@ -421,16 +401,6 @@ xtlive <- function(
421
  class = "rtanihi"
422
  ),
423
  div(
424
- # HTML(
425
- # paste0(
426
- # "<ul>",
427
- # "<li>Hover over plot to see annotations.",
428
- # "<li>Click on legend items to toggle visibility of annotations.",
429
- # "<li>Double-click on legend items to isolate a single annotation type.",
430
- # "<li>Click on top-right gear icon to change plot settings.",
431
- # "</ul>"
432
- # )
433
- # ),
434
  rthelplist(
435
  c(
436
  "Hover over plot to see spike lines",
@@ -470,12 +440,6 @@ xtlive <- function(
470
  label = "Plot background",
471
  selected = ifelse(input$dark_mode == "dark", "#191919", "#FFFFFF")
472
  ),
473
- # shinyWidgets::colorPickr(
474
- # "marker.col",
475
- # label = "Marker color",
476
- # selected = ifelse(input$dark_mode == "dark", "#3f3f3f", "#dfdfdf")
477
- # ),
478
- # tags$i("Click on 'Plot dataset' to update render after changing settings."),
479
  bslib::input_task_button(
480
  "xt_plot_update_button",
481
  "Update rendering",
@@ -487,7 +451,6 @@ xtlive <- function(
487
  ),
488
  title = "Plot settings",
489
  placement = "auto"
490
- # options = list(trigger = "hover focus click")
491
  ) # /popover
492
  }
493
  }) # /ui_xt_popover
 
2
  # ::rtemislive::
3
  # 2024 EDG rtemis.org
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  # Setup
6
  library(shiny)
7
  library(bslib)
 
24
  info <- helpcol <- "#FEB2E0"
25
  success <- "#B4DC55"
26
 
27
+ #' Create timeseries visualization shiny
 
28
  #' Visualize timeseries data using `dplot3_xt()`
29
  #'
30
  #' Set verbosity to 1 to monitor app progress
 
34
  #'
35
  #' @author EDG
36
  #' @export
37
+ #' @return A shiny app
38
 
39
  xtlive <- function(
40
  default_theme = "dark",
 
47
  # Version
48
  xtl <- paste0(
49
  "xtlive v.0.0.2",
50
+ " | ", "rtemis v.", utils::packageVersion("rtemis"), # doesn't work in shinylive
51
  " | R v.", version$major, ".", version$minor,
52
  " | running on ", sessionInfo()[[2]]
53
  )
 
97
  window_title = "rtemis xtlive",
98
  # Language ----
99
  lang = "en",
 
100
  # Nav Panels ----
101
  ## [] Welcome ----
102
  bslib::nav_panel(
 
216
  # busy indicators ----
217
  shinybusy::add_busy_spinner(
218
  spin = "orbit",
 
219
  color = "#00ffff",
220
  timeout = 200,
221
  position = "bottom-left",
 
386
  bindEvent(input$xt_plot_button, input$xt_plot_update_button)
387
 
388
  # Create variable clicked that is TRUE after input$xt_plot_button is clicked
 
389
  clicked <- shiny::reactiveVal(FALSE)
390
  shiny::observeEvent(input$xt_plot_button, {
391
  clicked(TRUE)
 
401
  class = "rtanihi"
402
  ),
403
  div(
 
 
 
 
 
 
 
 
 
 
404
  rthelplist(
405
  c(
406
  "Hover over plot to see spike lines",
 
440
  label = "Plot background",
441
  selected = ifelse(input$dark_mode == "dark", "#191919", "#FFFFFF")
442
  ),
 
 
 
 
 
 
443
  bslib::input_task_button(
444
  "xt_plot_update_button",
445
  "Update rendering",
 
451
  ),
452
  title = "Plot settings",
453
  placement = "auto"
 
454
  ) # /popover
455
  }
456
  }) # /ui_xt_popover
www/globals.js DELETED
@@ -1,9 +0,0 @@
1
- // highlight object on load using CSS animation
2
- // window.addEventListener("load", function () {
3
- // const elementToHighlight = document.querySelector(".rthelp"); // Replace with your element's CSS selector
4
-
5
- // if (elementToHighlight) {
6
- // elementToHighlight.style.borderColor = "transparent"; // Set initial transparent border
7
- // elementToHighlight.classList.add("highlight-animation"); // Add animation class
8
- // }
9
- // });