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

Penguins example looks funny #163

Open
jhofman opened this issue Mar 31, 2022 · 15 comments
Open

Penguins example looks funny #163

jhofman opened this issue Mar 31, 2022 · 15 comments
Assignees
Labels
gemini vega(lite) visualizing-verbs has to do with how a data analysis verb is represented visually

Comments

@jhofman
Copy link
Contributor

jhofman commented Mar 31, 2022

Here's another one that looks strange, the bars are misaligned, there are missing grid panels, and the points go beyond the y-axis range

library(datamations)
library(palmerpenguins)

penguins <- palmerpenguins::penguins

"penguins %>%
  group_by(species, island, sex) %>%
  summarize(mean = mean(bill_length_mm, na.rm = TRUE))" %>%
  datamation_sanddance()

Screen.Recording.2022-03-31.at.9.32.06.AM.mov

Any idea what's up and how to fix this?

(this was run after a fresh devtools::install_github("microsoft/datamations") of datamations this morning)

@jhofman jhofman added visualizing-verbs has to do with how a data analysis verb is represented visually vega(lite) gemini labels Mar 31, 2022
@jhofman
Copy link
Contributor Author

jhofman commented Mar 31, 2022

this might have to do with facet sorting in the spec?

@giorgi-ghviniashvili
Copy link
Collaborator

giorgi-ghviniashvili commented Mar 31, 2022

@willdebras can you remove facet.column.sort and facet.row.sort array on R side? That causes the issue.

image

@willdebras
Copy link
Collaborator

Viewer.Zoom.2022-03-31.16-07-11.mp4

Removing these sort calls fixes this. It looks like it doesn't introduce issues in other places, so I am going to just commit this to main.

@giorgi-ghviniashvili
Copy link
Collaborator

@willdebras that's great. Could you please also make sure that the y axis titles are not bigger than the facet height? Instead of mean(bill_length_mm), use ["mean", "bill_length_mm"] and it will be fully fixed.

@willdebras
Copy link
Collaborator

Yep :) It's like this in main now after merge from yesterday, returning ["mean of", "variablename"]. Just hadn't pulled those changes yet.

@jhofman
Copy link
Contributor Author

jhofman commented Apr 1, 2022

almost there---sorting of the rows changes part way through, see here:

Screen.Recording.2022-04-01.at.9.42.11.AM.mov

@willdebras
Copy link
Collaborator

Might need to revert this, as it keeps the sorting consistent with group_by and mutate frames 1ac1cf5

@giorgi-ghviniashvili
Copy link
Collaborator

@willdebras alright, right now, I brought back the sorting and trying to fix the other way around.

@giorgi-ghviniashvili
Copy link
Collaborator

giorgi-ghviniashvili commented Apr 1, 2022

@jhofman @willdebras I found out that vega-lite facet sort does not work at all and that's why it has this issues.

The issue: vega/vega-lite#5937

The image:
Screen Shot 2022-04-01 at 19 51 07

So I guess it is better to remove sorting, unless we hack that too :D

Play with this vega example

@willdebras
Copy link
Collaborator

What's your recommendation as far as specs, @giorgi-ghviniashvili? Should I remove all sorting? Removing the facet sorting from summarize spec generation de-syncs it from the group_by(). It seems if we sort all, we get the weird grid. If we unsort in this step, we get the weird shifts from the group_by().

@giorgi-ghviniashvili
Copy link
Collaborator

@willdebras this pr #169 removes sorting from generateGrid (group_by()), so I think it worths testing and if that works, then we are good to go. Since the facet sorting does not work in vega-lite at all, we don't need them. Please test that PR and let me know if that syncs up with the other steps.

@willdebras
Copy link
Collaborator

Thanks! I will test in the morning my time and confirm all is good.

@jhofman
Copy link
Contributor Author

jhofman commented Apr 4, 2022 via email

@willdebras
Copy link
Collaborator

@giorgi-ghviniashvili's PR looks like it works fine from my testing, but I want to spend another 30-45 minutes today or tomorrow testing that it doesn't cause issues with the new mutate stuff, i.e. that we don't accidentally trigger a rearrange with the grouped mutations. going into a faceted summarize. I can confirm tomorrow that that is good to merge and then we are all set!

@willdebras
Copy link
Collaborator

I've tested this a bit more and it looks good to go to merge Giorgi's PR. This should be fixed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gemini vega(lite) visualizing-verbs has to do with how a data analysis verb is represented visually
Projects
None yet
Development

No branches or pull requests

3 participants