-
Notifications
You must be signed in to change notification settings - Fork 799
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
Prefer method-based syntax in docs and add tabbed interface for method and attribute syntax in gallery #2983
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome to have the whole documentation show the method-based approach! I use the new syntax myself all the time and find it very convenient.
Although it's still a draft, I already reviewed the suggested changes so far. I can go through the interactivity section as well once it's ready.
).properties( | ||
title='By Channel' | ||
) | ||
|
||
# Sort according to another field | ||
sortfield = base.encode( | ||
alt.X(field='site', type='nominal', | ||
sort=alt.EncodingSortField(field='yield', op='min')) | ||
alt.X('site:N').sort(field='yield', op='max') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it an intentional change from op='min'
to max
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you! I accepted all your changes and will ping once the interactive part is merged and I have updated this PR.
).properties( | ||
title='By Channel' | ||
) | ||
|
||
# Sort according to another field | ||
sortfield = base.encode( | ||
alt.X(field='site', type='nominal', | ||
sort=alt.EncodingSortField(field='yield', op='min')) | ||
alt.X('site:N').sort(field='yield', op='max') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ctoy and note when the code is the same
Co-authored-by: Stefan Binder <binder_stefan@outlook.com>
8112ee0
to
3a3a224
Compare
@binste I updated the interactive page in the docs now too, so this PR is ready for full review. |
I've this error/warning while building the docs locally:
That is around here: https://github.com/altair-viz/altair/blob/master/doc/user_guide/marks/errorbar.rst?plain=1#L157 Not sure why this leads to a syntax error. You do not have this message? |
Good catch, fix in #3004 |
Following up on the discussion in #2599 (reply in thread) to make the method-based channel option syntax the default in the docs. This PR prefers that syntax throughout the narrative documentation and includes both the method-based and attribute-syntax for the gallery examples in a tabbed interface so that there are some examples for users prefer this syntax (and since we will preserve these snippets for testing purposes anyways). The only thing left to update is the interactivity section, which I can address after #2981 is merged.
Example of how the gallery looks now: