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

Correct the method-based syntax for a few more gallery examples #3005

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

joelostblom
Copy link
Contributor

No description provided.

Copy link
Contributor

@mattijn mattijn left a comment

Choose a reason for hiding this comment

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

Two inline comments/suggestions

@@ -69,7 +69,7 @@
alt.Chart(source).mark_point(filled=True, opacity=1, size=100).encode(
alt.X('x:O').axis(None),
alt.Y('animal:O').axis(None),
alt.Row('country:N').header(title=''),
alt.Row('country:N').title(''),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
alt.Row('country:N').title(''),
alt.Row('country:N').title(None),

I prefer None over ''.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is interesting. I think None is more semantically correct but '' is more convenient to type and I remember that when I started to use Altair a few years ago, there was some context where None didn't work, but '' did. It is possible that I was just doing something wrong back then, but I will see if I can find it again.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be, I can remember something similar. But I would consider that as a limitation of Vega-Lite at that moment.

@@ -11,7 +11,7 @@
source = data.seattle_weather()

base = alt.Chart(source).encode(
alt.X('month(date):T').axis(title=None)
alt.X('month(date):T').title('')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
alt.X('month(date):T').title('')
alt.X('month(date):T').title(None)

Or there is another reason why you opt for ''?

@joelostblom joelostblom reopened this Oct 19, 2023
@joelostblom
Copy link
Contributor Author

@mattijn I forgot about this for some while, but I noticed it now and went ahead with your suggestion of using None instead of "" as I agree that it is more idomatic.

@mattijn mattijn merged commit cf76f03 into main Oct 19, 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

2 participants