inbo / reporting-rshiny-grofwildjacht

Rshiny app for grofwildjacht
https://grofwildjacht.inbo.be/
MIT License
1 stars 1 forks source link

Updates v0.3.5 #484

Open mvarewyck opened 3 weeks ago

mvarewyck commented 3 weeks ago

Include latest changes before re-designing the app.

mvarewyck commented 3 weeks ago

R CMD check fails with error below. It indicates there are some regions for which there are observations in the data, but no shape data are available for plotting them in maps.

 ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('testWildschade.R:67:9'): Number of cases per region level ───────────
  Error in `mapFlanders(allSpatialData = spatialData, regionLevel = regionLevel, 
      colorScheme = c("white", suppressWarnings(RColorBrewer::brewer.pal(n = nlevels(spaceData$data$group) - 
          1, name = "YlOrBr"))), summaryData = spaceData$data, 
      legend = "topright", species = iSpecies)`: De geo-data kan niet gematcht worden aan de shape data.
  Backtrace:
      ▆
   1. └─reportingGrofwild::mapFlanders(...) at testWildschade.R:67:9
> summaryData$locatie[!summaryData$locatie %in% spatialData$NAAM]
[1] "1_Mol"      "9_Overijse" "9_Wellen"  
SanderDevisscher commented 3 weeks ago

I'm checking the pre upload files if they are ok I'll upload them again and check the upload flow in the process.

SanderDevisscher commented 3 weeks ago

@mvarewyck am I correct this issue occurs with schade data ? The combo's "1_Mol", "9_Overijse" & "9_Wellen" are not correct. 1_Mol image 9_Overijse image 9_Wellen image

SanderDevisscher commented 3 weeks ago

The issue does occur in the pre upload data. This is a data issue and should be fixed by the next update (see https://github.com/inbo/backoffice-wild-analyse/issues/1157)

mvarewyck commented 2 weeks ago

@mvarewyck am I correct this issue occurs with schade data ?

Yes it is.

SanderDevisscher commented 2 weeks ago

I'm having some issues testing the PR in docker 😢 The docker builds succesfull but its seems to be unable to plot the first map, no error nor warning are logged by docker. I'm looking into fixing the issue. This PR however does run without a hitch in R. In R there seems to be a issue with FIGUUR: Leeggewicht per leeftijdscategorie en geslacht (INBO of Meldingsformulier), see below: newplot The error does occur with wild boar & roedeer.

SanderDevisscher commented 2 weeks ago

R prints the following warning: Warning: 'layout' objects don't have these attributes: 'boxmode'

Valid attributes include:
'_deprecated', 'activeshape', 'annotations', 'autosize', 'autotypenumbers', 'calendar', 'clickmode', 'coloraxis', 'colorscale', 'colorway', 'computed', 'datarevision', 'dragmode', 'editrevision', 'editType', 'font', 'geo', 'grid', 'height', 'hidesources', 'hoverdistance', 'hoverlabel', 'hovermode', 'images', 'legend', 'mapbox', 'margin', 'meta', 'metasrc', 'modebar', 'newshape', 'paper_bgcolor', 'plot_bgcolor', 'polar', 'scene', 'selectdirection', 'selectionrevision', 'separators', 'shapes', 'showlegend', 'sliders', 'smith', 'spikedistance', 'template', 'ternary', 'title', 'transition', 'uirevision', 'uniformtext', 'updatemenus', 'width', 'xaxis', 'yaxis', 'barmode', 'bargap', 'mapType'
SanderDevisscher commented 2 weeks ago

The issue seems to affect all boxplot plots like FIGUUR: Gewicht per jaar en FIGUUR: Onderkaaklengte per jaar (INBO of Meldingsformulier)

SanderDevisscher commented 2 weeks ago

I'm having some issues testing the PR in docker 😢 The docker builds succesfull but its seems to be unable to plot the first map, no error nor warning are logged by docker. I'm looking into fixing the issue.

Its seems the RAM usage of my docker explodes to > 11Gb of the 12Gb available.

SanderDevisscher commented 2 weeks ago

I was able to reduce the inflation of my docker RAM by switching from wsl2 to hyper-V however the issue with loading the Landkaart remains. when looking at the chrome devtools I see the following error:

VM163:162 Uncaught ReferenceError: Plotly is not defined
    at Object.renderValue (<anonymous>:162:18)
    at shinyBinding.renderValue (<anonymous>:541:20)
    at Object.onValueChange (output_binding.js:16:10)
    at delegator.<computed> [as onValueChange] (<anonymous>:112:23)
    at OutputBindingAdapter.onValueChange (output_binding_adapter.js:21:18)
    at ShinyApp.bindOutput (shinyapp.js:346:15)
    at init_shiny.js:44:18
    at r (init_shiny.js:236:5)
    at Object.bindAll (init_shiny.js:246:29)
    at Object.renderContent (output_binding_html.js:51:13)

PS run command:

"docker run --name wildapp_public -p 3600:3838 inbo/grofwild R -e \"Sys.setenv('AWS_DEFAULT_REGION'='eu-west-1', 'AWS_ACCESS_KEY_ID'='', 'AWS_SECRET_ACCESS_KEY'='');reportingGrofwild::runWildApp(public=TRUE)"
SanderDevisscher commented 2 weeks ago

Ok important to know "Gerapporteerd aantal schadegevallen" of the same docker build does load. As does the wbe map however it only loads after switching the wbe displayed. Does this indicates the app needs user input to start loading?

mvarewyck commented 1 week ago

@mvarewyck the app apperently needs user input before loading some graphs/maps while other like the main landkaart doesn't seem te load at all, see #484 (comment) & #484 (comment)

It's all due to this commit 262589e3805f1d0b7193e88afa0182ed5485b891, including lightweight plotly . I'm looking into it (reverting or fixing). Known issue: https://github.com/plotly/plotly.R/issues/2119

mvarewyck commented 1 week ago

@SanderDevisscher Docker image works fine for me now. I reverted the commit, given there is no easy solution and the planned re-design of the app.