Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data visualisation #46

Merged
merged 10 commits into from
Oct 7, 2024
Merged

Data visualisation #46

merged 10 commits into from
Oct 7, 2024

Conversation

juliendiot42
Copy link
Collaborator

I added a new menu "Data visualisation".

For now this is a generic data-viz feature that can plot the data of a file uploaded by the user.

I pushed a working example on docker hub juliendiot/plantbreedgame:development.

The expected file format is the same as the phenotype data the user can download (ie. tsv file)

This can be used to visualized for example the phenotypes data from the app directly, but also any other data the user can generate (eg. BLUPs, predictions...)

The type of plots is automatically determined by the nature of the selected variables on X and Y axis:

  • 1 variable: Histogram / Bar plot
  • 2 quantitative variables: Scatter plot (eg. the image below)
  • 1 quantitative variable and 1 categorical variable: box plot
  • 2 categorical variable: not implemented

Below the plot there is a data-table. Currently there is no "selection/highlight" feature that link the selected element of the table and the plot. I may think about implementing that if requested.

There is a screenshot example (for 2 quantitative variables trait1 and trait2 colored by year):

image

Currently, only players with the "tester" status can access it to keep "the gameplay" unchanged. @timflutre Let me know if you think I should rather make it available to all players.

Since I am planning on adding new feature to make the game easier, I may have to work on another system for managing the game's features' permissions. Instead of having different player "status" it would be more "feature access" oriented. When we create a new player, we select which feature it can have access to.

cc. @chabrault

@chabrault
Copy link

Thanks for the work you did, I can try to test your enhancement.

I don't know if you have heard about the esquisse R package (https://dreamrs.github.io/esquisse/). It's an R addins that allows the user to load their data, and build/visualize/ customize the plots based on that. It's a Shiny App so if you want to, it might be easy to directly integrate some modules.

@juliendiot42
Copy link
Collaborator Author

Thank you for the recommendation. At first glance "esquisse", seems to be for ggplot2, not plotly (which I like a lot).
I'll check deeper to see indeed if I can incorporate some of their modules but I still want to make the feature rather simple.

@timflutre
Copy link
Owner

Thanks Julien, it looks nice!

Maybe the admin player could decide if he/she wants the players to have access to this, or not.

  • One argument to give access: it makes it easier to visualize things
  • One argument against: well, it makes it easier to visualize things ;) For master and PhD students, it may be better to force them to code this kind of things by themselves when they play in groups of 4-5.

Can I merge?

@juliendiot42
Copy link
Collaborator Author

juliendiot42 commented Oct 1, 2024

@timflutre

Maybe the admin player could decide if he/she wants the players to have access to this, or not.

Yes, I totally agree ! That's why I need to rethink the "player status" system. Having "Admin" / "tester" / "player" is not strong enough if we add other "helping" feature like so.

A "permission system" where the admin can give permission to different features at the user creation would be better I think. For example it can look like this in the UI:

User's permissions:

  • Run evaluation
  • Time-constraints
  • Data-viz
  • Admin

Then the game master can adapt according to the game's audience.

This have not been implemented yet, so i choose the "difficult way" (ie. only "tester" have access).

Can I merge?

This is ready, but If possible, I would prefer if you could "approve" the PR rather than merging (I guess GitHub has such feature). Then I will merge my self. I think it is better this way because sometime we could realise that something is missing after marking the PR as ready. So giving the "merge responsibility" to the PR creator is safer in my opinion as this person is more familiar with the PR's code.
Also, I like to have a final look at the branch and I sometime rebase the branch or potentially clean the commit history etc...

@timflutre
Copy link
Owner

Ok, perfect.

I can only click on "merge pull request". Maybe it would be easier if you also have the right to write on master directly, without make pull request at all? If you want to write to me, you can open an issue on a given topic and work on another branch, and once we agree, then you merge onto master. Would it be ok for you?

Previoulsy, `data_from_file` depended on both `input$categ_variables`
and `input$quant_variables`. This cause the plot to be calculated 2
times because when the user change a variable "type", eg. `Var_1` from
"categorical" to "quantitative" the following happens:
 - `data_from_file` is recalculated because `input$categ_variables`
 had changed
 - an observer update the value of `input$quant_variables`
 - `data_from_file` is again recalculated because `input$quant_variables`
 had changed

Now I have removed this dependency since all variables that are not
categorical are quantitative.

Note: the `input$quant_variables` input is not actually used anymore
and is here only as information for users.
@juliendiot42
Copy link
Collaborator Author

I am much more familiar with GitLab where we have an approve button.

It seems with github it can be done through comment:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

image

Maybe it would be easier if you also have the right to write on master directly

I have the permission already. I often do it when I do small changes that do not affect much the gameplay. For bigger changes I like to do a PR to, first, have your approval, and also notify you about those changes.

I'll merge, thank you.

@juliendiot42 juliendiot42 merged commit b23a5cd into master Oct 7, 2024
6 checks passed
@juliendiot42 juliendiot42 deleted the data_vis branch October 7, 2024 00:05
@timflutre
Copy link
Owner

Ok thank you, I will try to find this button for your next pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants