tetratech / baytrendsmap

Shiny app to create maps on-the-fly from output of the baytrends package.
https://tetratech.github.io/baytrendsmap/
MIT License
4 stars 2 forks source link

Range map only shows bins that have data #51

Closed jharcum closed 2 years ago

jharcum commented 3 years ago

Describe the bug If bins are specified for the range map, then all bins should be assigned a color. This will facilitate comparison of range maps for two different time periods.

To Reproduce Steps to reproduce the behavior:

  1. select 'Non-linear Trend (full period)'
  2. filter to surface TN annual
  3. go to plot baseline mean in range map
  4. set Custom classes (comma delimited) to: .2, .4, .8, 1, 1.5, 2, 3, 5, 8
  5. set color palette to "OrRd"
  6. save figure
  7. Repeat the above but use current mean
  8. save figure

Issue Notice the difference in the legend. since current mean max value is <3, the last two bins 3-5 and 5-8 are not shown; however, the 2-3 bin takes on the darkest color (same as baseline mean of 5-8). So this makes a visual comparison more difficult.

Desired behavior If user specifies bins then display all specified bins even if there are no observations

Screenshots image

leppott commented 3 years ago

Use "drop = FALSE" inside of scale_fill_brewer() in server.R when creating/updating range map.

leppott commented 3 years ago

Side by Side

baseline current

FULL IMAGES

map_range_20210809_144148_baseline

map_range_20210809_144239_Current

leppott commented 3 years ago

Update in development branch. Can close once review and then merge in to main branch.

leppott commented 3 years ago

Confirmed the dynamic (leaflet) map works fine (shows all 8 categories) for current mean.

Baseline image

Current image