ctmm-initiative / ctmmweb

Web app for analyzing animal tracking data, built upon ctmm R package
http://biology.umd.edu/movement.html
GNU General Public License v3.0
32 stars 21 forks source link

For data with multiple individuals > 20 #11

Closed xhdong-umd closed 7 years ago

xhdong-umd commented 7 years ago

I found the visualizations we used can only deal with individuals <= 20. Higher count will have the coloring by individual and facet useless. My plan is:

For visualization When individual count > 20

If user selected some individuals in the data summary table, everything should work like before. The individuals can be selected with clicking on rows, or have a range slider to select individual index range.

For analysis, user could select single animal to analysis, or batch process all. For outlier detection, I'm trying to make it work with multiple individuals at the same time.

vestlink commented 7 years ago

Maybe you could think about making tabs of individuals =< 20 and add new tab(s) for the remaining number of animals?

xhdong-umd commented 7 years ago

I'm not sure if my understanding of tabs is correct. Do you mean put several tabs in the UI, each tab will show 20 individuals? So the UI will show

And there are quite several plots, facets need to be adjusted.

jmcalabrese commented 7 years ago

I assume "vestlink" is Mike? Mike suggested the "tabs" idea the other day when we spoke. I think the idea is to set some number max number of individuals (say M=6, or 8, or whatever still looks reasonable in a facet plot), and then if N > M, make facet plots only for the first M. Then give the user the option move through the entire dataset M individuals at a time. That could be accomplished by having N/M separate tabs, or by just giving the user some kind of navigation controls (maybe like the page number and arrow arrangement you see at the bottom of a google search) to move through the dataset.

xhdong-umd commented 7 years ago

Having too many tabs could clutter the UI, especially when the tab count is not fixed. Set a page number and move through data seemed like a good idea.

I'm thinking use a range slider like this

screen shot 2017-03-31 at 10 13 09 am

In "free mode", user could select any range in a big number easily to check selected individuals.

In "page mode", user can set the slider range to 1-10 (slider default to 1-10, user can also set to 1-6 if he want bigger plot), then use a button to "move to next 10", which will move the slider to 11-20 also update the plots.

jmcalabrese commented 7 years ago

Sounds reasonable. Give it a try and we'll see how it works.

xhdong-umd commented 7 years ago

I just realized the slider selection will conflict with the row selection in data summary table, because the data summary table have all individuals listed, a slider will need to update the summary table too otherwise there will be individuals outside of slider range listed in table.

Actually the data summary table is a perfect control for "page through" already. We just plot the individuals shown in first page of summary table, then user move to next page will update the plots with individuals of next page. The page length can be adjusted in UI. This is just like the "page control in google search".

This will be very intuitive and no other control is needed. Thanks for the comments, this generated a much better design than before.

jmcalabrese commented 7 years ago

That sounds great, let's go with that.

xhdong-umd commented 7 years ago

@jmcalabrese We can keep the issue open, until I implemented the feature and everybody tested with it. This way it's easier to track the open tasks.

jmcalabrese commented 7 years ago

Ok

xhdong-umd commented 7 years ago

I just pushed the updated code to repo. You can play with it to see the effect. All plots should respond to the current page in Individuals table. The count per page can be changed, so with buffalo data you can change count to 4 or 2. Now you can also select whether to overlay all individuals in background.

Thanks @vestlink @jmcalabrese for the great discussion.

vestlink commented 7 years ago

No problem. I really enjoy following these discussions :) btw i'm not Mike but Nicolai from Norway :D

chfleming commented 7 years ago

Looks good to me.

jmcalabrese commented 7 years ago

Just went to check this, and seems like this part of the shiny app is currently broken, so unable to verify.

xhdong-umd commented 7 years ago

@jmcalabrese what's the error? Do you have a screenshot?

I just updated the online app so you can check that one without installation.

jmcalabrese commented 7 years ago

Digging into it a bit, the error seems to be with ctmm:

Error in get(method, envir = home) : lazy-load database '/home/justin/R/x86_64-pc-linux-gnu-library/3.3/ctmm/R/ctmm.rdb' is corrupt

I've had this a couple of times before, both on mac and linux, but haven't figured out why it occurs or the specific conditions that trigger it. The particular install of ctmm that did this worked fine on Fri afternoon when I last used it. Removing and reinstalling eventually worked, but I had to do 3 consecutive times before the problem went away. Any ideas?

chfleming commented 7 years ago

I don't know what causes that, but it happens enough that I had already put it in the FAQ: https://ctmm-initiative.github.io/ctmm/reference/ctmm-FAQ.html Uninstall, restart, install, works every time for me.

jmcalabrese commented 7 years ago

RE using the Individuals table to control the content of the plots, I agree with Chris that it looks good and works well.

What is the default number of individuals per page when the total number of inds in the dataset >20?

xhdong-umd commented 7 years ago

That could came from the package was not installed/uninstalled properly. When a package is loaded in R session, installing a new version need to unload/detach it first. It's pretty often that the package was uninstalled but not detached properly when there are dependency packages in use. So to upgrade a package, the safest method is always remove the package, restart R session, install new version.

As for the individuals per page, I used 6 as default which apply to all datasets. You can change it to any of 2,4,6,8,10,20 manually. Of course all of these can be changed. What's your preference?

It's also possible to change it dynamically based on dataset but I'm not sure if that will surprise users.

jmcalabrese commented 7 years ago

Like I said, that happened this time on an install of ctmm that had previously (last week) worked fine, so I don't think it was related to the installation process per se. In the past, though, I have also seen that problem immediately after newly installing ctmm. Will watch out for it going forward to try to nail down the conditions that cause it.

A default of 6 per page is reasonable. We can, of course, refine that after further testing if necessary.