med-material / d3-rshiny-vis

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

Head Movement Visualization: Implement First Version Using D3 #5

Open bastianilso opened 1 year ago

bastianilso commented 1 year ago

image

Using the column HeadCameraRotEulerY show how the user rotated his head left and right.

aldsanms commented 1 year ago

Today I managed to:

01

bastianilso commented 1 year ago

@aldsanms great. then I think what remains is:

1) showing the remaining possible movement in white (like in the mockup)

and maybe that is it for "head rotation v1" (the first version). In next versions we can make it interactive, but for this one maybe we should start with a static visualization.

When the code is ready, please create a pull request.

aldsanms commented 1 year ago

@aldsanms great. then I think what remains is:

  1. showing the remaining possible movement in white (like in the mockup)

and maybe that is it for "head rotation v1" (the first version). In next versions we can make it interactive, but for this one maybe we should start with a static visualization.

When the code is ready, please create a pull request.


Today, I continued this issue. Here is a screenshot of the final render: 01

The code is made in such a way that the style is easily modified, we can then discuss afterwards so that I can adapt to your preferences.

I posted my code on Github but couldn't make a pull request.

Here is a link to the Github directory: https://github.com/med-material/d3-rshiny-vis/tree/main/Head_orientation_stat/headMovementStat01

Moreover, it is now possible for us to visualize the field of vision of the player during his game according to the data presented in a CSV. Here is an example :https://github.com/med-material/d3-rshiny-vis/issues/2#issuecomment-1298574014

I think this issue can be closed.

bastianilso commented 1 year ago

Preprocessing step in R for wrapping the head orientation data:

https://github.com/med-material/Whack_A_Mole_RShiny/blob/master/modules/plot_head_orientation_density_module.R#L18

D %>% mutate(
HeadCameraRotEulerY_wrap = ifelse(HeadCameraRotEulerY > 180, HeadCameraRotEulerY - 360, HeadCameraRotEulerY)
)
aldsanms commented 1 year ago

v1_2_1

Now: