sinkovit / Spatial-ecology

Space use software deployed in the Spatial Ecology Gateway
MIT License
2 stars 0 forks source link

Add Bob's new contour and polygon display code #32

Closed monaw closed 1 year ago

monaw commented 1 year ago

see code @

  1. https://github.com/sinkovit/Spatial-ecology/blob/Bob/seg-functions/minConvexPolygon.R
  2. https://github.com/sinkovit/Spatial-ecology/blob/Bob/seg-functions/createContour.R
monaw commented 1 year ago

@sinkovit - just want to double check that your code in the Bob branch for seg-functions minConvexPolygon.R and createContour.R are ready to go? if yes, is there an example of how to call it?

sinkovit commented 1 year ago

@monaw - I still need to wrap up a little work before they're callable. Close, but not quite there.

monaw commented 1 year ago

@sinkovit - ok thanks Bob; just let me know when your code is ready, thanks!

monaw commented 1 year ago

currently getting a runtime error:

Warning in proj4string(xy) :
  CRS object has comment, which is lost in output; in tests, see
https://cran.r-project.org/web/packages/sp/vignettes/CRS_warnings.html
Regions defined for each Polygons
monaw commented 1 year ago

Posted question here on how to change the existing table's selection from single to double...

monaw commented 1 year ago

Next:

monaw commented 1 year ago

Bob fixed issue with buffer value

monaw commented 1 year ago

now that we have 2 types of plot (mcp and mkde), we need a way to display the right one depending on which control tab is active. this proved to be harder than it seemed as the mkde plot wasn't redisplaying and the following 2 problems occurred:

  1. the mkde plot disappears if we shinyjs::hide() and enable it so that means if the user clicks away from the MKDE plot page and then returns, the original plot is not redisplayed
  2. the mkde plot doesn't stay if the user goes to the Data page

it appears that the mcp plot doesn't have the above redisplay problems, not really sure why...maybe the ggplot2 package is automatically redisplaying it?

after much trying, i stumbled upon a really simple solution that worked without having to change the logic of the current code; this solution simply calls shinyjs::click() to programmatically activate the mkde_plot_btn. now i consider this solution a bad hack and quite uncomfortable with this solution...but it works well and we want to have our 1.0 release soon....yeah i know...definitely not ideal.

i'm certainly we will need to implemented a better solution when a new need arises that conflicts with this solution. but for now, we will release with this solution.

sinkovit commented 1 year ago

Hi Mona - thanks for coming up with this hack. Let's discuss at the SEG call this afternoon. I'm okay with this solution for now as long as we're not redoing the MKDE calculation