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

doc: add example interactive aggregation #3260

Merged
merged 4 commits into from
Nov 11, 2023
Merged

Conversation

mattijn
Copy link
Contributor

@mattijn mattijn commented Nov 9, 2023

This PR adds a new example showing interactive aggregation. The example is heavily inspired by this example by @dwootton.

image

@dwootton, I modified your example a little bit, could you review the introduced changes? I'm not sure if my changes make the goal of the chart more intuitive.

@dwootton
Copy link
Contributor

Thanks for putting this together!

Love that you also added the constant size scale and filtered out the aggregate points from the view.

Some nits that don't block the PR but are worth considering:

  1. IMO, the different color breaks the visual connection between aggregated marks and their disaggregated counterparts. returning aggregate marks to the steel blue color could help to convey that these are the same data, but just at different levels of aggregation.
  2. I personally liked the ability to set a float filter value rather than integer steps; however, totally understand that filtering out the aggregate points on the right side of the slider makes these in-between states look weird.

@mattijn
Copy link
Contributor Author

mattijn commented Nov 10, 2023

Thanks for the review @dwootton! I think the current approach is in line what you describe. See also Open the Chart in the Vega Editor. Agreed?

@binste
Copy link
Contributor

binste commented Nov 11, 2023

This is really cool! Thank you both :) Just one small comment, should one filter statement include the actual threshold value? Else, observations with the exact same IMDB rating as the threshold are dropped.

Copy link
Contributor

@joelostblom joelostblom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is really neat, love it!

),

alt.Chart().mark_rule(color="gray").encode(
strokeWidth=alt.StrokeWidth(value=6),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of the new syntax we just discovered =) We should probably document this somewhere eventually and decide on one to favor in the docs, but that's another issue.

@mattijn
Copy link
Contributor Author

mattijn commented Nov 11, 2023

Thanks for the reviews! Especially thanks to @dwootton for exploring this type of interactive visualizations (and sharing these with the world!👍)
Merging!

@mattijn mattijn merged commit f3453f9 into main Nov 11, 2023
20 checks passed
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.

None yet

4 participants