med-material / d3-rshiny-vis

Example project of making D3.js visualizations within R shiny
MIT License
0 stars 0 forks source link

Controller Visualization: Implement Mole Pattern Visualization #4

Closed bastianilso closed 1 year ago

bastianilso commented 1 year ago

We should try to use the column Event with the events Mole Spawned and Mole Hit / Mole Expired together with columns MoleIndexX and MoleIndexY to identify when to show moles on the wall (color them green vs grey) in the Controller Visualization.

aldsanms commented 1 year ago

Alright, I'm starting to code the different features we're going to need.

However I don't have a .CSV containing mole states. could you send me one?

bastianilso commented 1 year ago

@aldsanms try cloning

https://github.com/bastianilso/WhackAMoleWinterTest2022

and open the wamwinter22_analysis.R script. Use ctrl+Enter to execute the line

load('data_wam.rda')

this will load a dataset for you, which contain all columns you need. Be aware that the dataset contains data from multiple sessions though. You can filter the data by doing:

MoleData = D %>%  filter(Participant == 0, Condition == "Test Condition 2")

feel free to take this code and put it inside your own script, or copy over the RDA file.

aldsanms commented 1 year ago

Today I had a problem with my computer (it kept restarting and the screen had very big bugs). I spent the morning looking for the fault and I think I found it.

A piece of the cover above the RAM bars was broken. its functionality is to press a button when the hatch is closed, if the button is not activated the computer does not start or shuts down. When I moved the computer, the RAM had to be disconnected and then reconnected, so the computer should no longer know where it was.

I think I solved the problem, the computer seems to be working fine for the moment.

aldsanms commented 1 year ago

Today I successfully uploaded mole state data with the wamwinter22_analysis.R.

I can now display the moles and have them change color with a transition based on the values present in the data.

Is missing a mole on the .CSV generated by the wamwinter22_analysis.R , I have generated them several times and the result is the same.

https://user-images.githubusercontent.com/73821252/196958972-7d3017c0-74ce-42f8-87a4-d7028dadee6a.mp4

My code doesn't follow the real time present in the data yet, the laser and the appearance/disappearance of moles are not fully in sync.

bastianilso commented 1 year ago

@aldsanms if a mole was not activated it may not be present in MoleIndexX and MoleIndexY. But we have columns to log how large the grid was, which you can use to render the number of walls in X and Y directions called WallColumnCount and WallRowCount. Hope this helps.

bastianilso commented 1 year ago

@aldsanms What is the status on this issue, do you have work left to do regarding the mole pattern visualization? Let me know if all bugs have been cleared and I will close this issue.

aldsanms commented 1 year ago

I am now able to read mole states from the csv and plot it on a wall and I have no more bugs for this problem.

Here is a video of another issue where you can see the purpose of this issue:

https://user-images.githubusercontent.com/73821252/201043380-d901c396-f827-47c0-be71-20ca81e7317b.mp4

I think this issue can be closed.