Rare-Technology / FMA_Dashboard

Fisheries Management Assessment Tool
https://portal.rare.org/en/tools-and-data/fma/
MIT License
0 stars 1 forks source link

Error in size proportions plot #8

Closed zross closed 3 years ago

zross commented 3 years ago

There is an error in the following situation for default country etc

image

abelvaldivia commented 3 years ago

@zross I think this is happening because some issue with the data for the initial date in "select date range" , likely a 0 on the counts

abelvaldivia commented 3 years ago

I fixed the 0 issue in the counts in our database. So counts that previously have 0 are now NA. If you run the process_raw_data file you will get the new updated dataset

zross commented 3 years ago

For the code itself, you'll need to tackle this one since I don't understand what you're trying to do and making count == 0 into NA doesn't do it. The issue is in the annotation and the fact that x, y and label have different lengths. Line is here:

https://github.com/Rare-Technology/FMA_Dashboard/blob/ca65941bf41ba768b1967c9c9eb880429426c26b/R/plot_size_proportions.R#L82

For now (you can see the commit for "add example error handling" directly above here) the I've altered the code to:

  1. Add a try() statement so if the plot generates an error it's silent
  2. Changed the plotOutput() to a uiOutput() so we can render an error message instead of a plot
  3. Added some handling so if there is an error the plot is empty and it gives an error message.
zross commented 3 years ago

Until I go over details on how to work with the new application updates it might be best if you do the code update under the original app?

abelvaldivia commented 3 years ago

Until I go over details on how to work with the new application updates it might be best if you do the code update under the original app?

Sure, I can do that.

zross commented 3 years ago

Has this been done?

abelvaldivia commented 3 years ago

@zross I can't make the plots to show up in the app if I run it from my computer. Any ideas why is giving me this ? This is happening for all the figures...

image
zross commented 3 years ago

I'm moving this to a separate issue.