microsoft / datamations

https://microsoft.github.io/datamations/
Other
66 stars 14 forks source link

Port shiny app to jake's account #129

Open jhofman opened 2 years ago

jhofman commented 2 years ago

Looks like I'm having an renv issue running the shiny app. Here's the output from clicking "Run App: in app.R:

> shiny::runApp()
Loading required package: shiny
Warning in loadSupport(appDir, renv = sharedEnv, globalrenv = NULL) :
  Loading R/ subdirectory for Shiny application, but this directory appears to contain an R package. Sourcing files in R/ may cause unexpected behavior.
ℹ Loading datamations
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'dplyr' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'gganimate' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'magick' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'purrr' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'vegawidget' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'forcats' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'tidyselect' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'reactable' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'shinyWidgets' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'shinydashboard' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'shinyAce' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'palmerpenguins' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'golem' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'styler' not available.
Warning in (function (dep_name, dep_ver = "*")  :
  Dependency package 'shinyjs' not available.
Error: Dependency package(s) 'dplyr','gganimate','magick','purrr','vegawidget','forcats','tidyselect','reactable','shinyWidgets','shinydashboard','shinyAce','palmerpenguins','golem','styler','shinyjs' not available.
Run `rlang::last_error()` to see where the error occurred.
sharlagelfand commented 2 years ago

Sounds like you need to run the renv setup first to catch up your package library - renv::restore()

sharlagelfand commented 2 years ago

@giorgi-ghviniashvili here is the shiny app URL for debugging: https://sharlagelfand.shinyapps.io/datamations/

giorgi-ghviniashvili commented 2 years ago

Hi @sharlagelfand , I see that this function is not called at all when I click Go:

image

No breakpoints are hit and nothing is printed in console. Can you make sure that this function is fired and app is really initialized?

Also would be great to save app in window using window.app, but first make sure that it is really called.

sharlagelfand commented 2 years ago

thanks @giorgi-ghviniashvili - that's the issue I was seeing, that the JS code is not called at all in the deployed version. It works fine locally but somehow the function is never called when deployed. Thanks for confirming! Will see if I can debug any more today, or at least roll back to a version where it was working.

sharlagelfand commented 2 years ago

Not having any luck deploying earlier versions either, unfortunately (cc @jhofman) - even versions from the summer! Wondering if something is up with shinyapps.io

jhofman commented 2 years ago

That's super strange!

I can confirm that it works fine locally for me as well.

Do you think it's worth trying to get a simple reprex of this that we could post on the Shinyapps support form?

sharlagelfand commented 2 years ago

I have a repo here with a minimal example that I can't get deployed at all - curious if you can @jhofman, or if not could be a good candidate for debugging the deployment, then using as a minimal example for posting.

jhofman commented 2 years ago

interestingly it now looks like https://sharlagelfand.shinyapps.io/datamations/ is mostly working, but it generates a NULL legend for the default datamation that shouldn't be there. (unclear to me which version of datamations is actually pushed to sharla's shiny app account.)

this legend issue might be fixed in the gemini2 branch, but there's something else broken in the shiny app on that branch. (undefined type in spec.sequence.length and source.sequence.length).

@giorgi-ghviniashvili will run the shiny app locally in the gemini2 branch and debug these console error messages.

once we get that done we can push the shiny app to my account.

p.s. for future reference, we had to update the htmlwidgets yaml file to include custom-animation.

giorgi-ghviniashvili commented 2 years ago

@jhofman managed to run the app, but now getting this error. Do you have any idea what error it is?

"Invalid First Argument"

image

jhofman commented 2 years ago

i'm able to run the shiny app on both the main branch (commit 06aa36) and the gemini2 branch (commit 76d6b05).

@giorgi-ghviniashvili: can you try to debug and see what fittings[[1]] is set to when that breaks?

giorgi-ghviniashvili commented 2 years ago

@jhofman fittings[[1]] = small_salary

image

But when I do get(fittings[[1]]), it has an error:

image

My understanding is that maybe get function comes from a different version of R package. So version mismatch might be a problem and can't find out how to solve.

jhofman commented 2 years ago

@willdebras, can you check that this is working for you on shinyapps.io?

willdebras commented 2 years ago

FYI, the app itself runs fine for me, but I have been running into deployment errors:

Error: Unhandled Exception: Child Task 1101457254 failed: Error parsing manifest: GithubUsername must be specified for GitHub package source Execution halted

I can't quite isolate if there are issues with my renv environment. I've tried fresh restore of renv, updating and snapshotting of renv after updating rsconnect (since this issue seemed prominent in past versions).

https://github.com/rstudio/renv/issues/308

renv.lock file seems fine. Has anybody else ran into this error?

willdebras commented 2 years ago

Weirdly rsconnect::writeManifest does not write a json object for the datamations package. I'm not certain this is expected?

jhofman commented 2 years ago

we discussed a debugging strategy here to figure out if it's something about renv, about datamations, or something else.

current thinking is first to try to deploy the simplified test app that doesn't use renv at all: https://github.com/sharlagelfand/datamationstest

from there we can try the same but using renv to manage packages and then expand to the full shiny app both with and without renv if need be.

willdebras commented 2 years ago

Currently have the full demo app without renv and without golem deployed to shinyapps.io. Working on deploying the golem based application without renv and this version with renv to isolate issues with the environment.

jhofman commented 2 years ago

we still have the issue of @giorgi-ghviniashvili not being able to run the R code as per this earlier comment: https://github.com/microsoft/datamations/issues/129#issuecomment-1010864669

@giorgi-ghviniashvili, can you re-pull main and try to re-install the library?

steps for @giorgi-ghviniashvili:

  1. Re-run devtools::install_github("microsoft/datamations") or clone the repo and run R CMD build. More here for command line or using Rstudio.
  2. If there are errors, run sessionInfo() and paste that here so we know what package versions had trouble, along with the error message.

if it's still broken, @willdebras, can you see if you can help?

jhofman commented 2 years ago

@giorgi-ghviniashvili, can you post the error message you're getting from R here?

jhofman commented 2 years ago

@willdebras has redesigned the shiny app, will send instructions to @jhofman on how to run locally and on shinyapps.io