-
Notifications
You must be signed in to change notification settings - Fork 796
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
_PropertySetter("title", ...)
dynamic doc uses wrong class
#3122
Comments
Thanks for reporting, the reason is that Vega-Lite's Shorter examples: import altair as alt
from vega_datasets import data
source = data.seattle_weather()
alt.Chart(source).mark_point().encode(
alt.X('date').title('This should be red', color='red')
) alt.Chart(source).mark_point().encode(
alt.X('date').axis(title='This should be red', titleColor='red')
) |
Ok, thanks this makes sense now... |
.title()
does not support all the argument in axis(title=...)
but still lists them in the docstring
I just checked, it is still an issue with 5.2.0. |
Yes, this issue will be closed once a PR has been submitted to fix it. Feel free to create one if you have the time to get familiar with the code base. |
Closing as #3660 addresses this example |
@dangotbanned I'll reopen this because it is tracking the general feature of being able to use additional parameters inside |
@joelostblom that's fine with me. Has there been an issue opened upstream for this? IIRC we would have support for this added "for free" if the |
I was going to add one right now, but I realized that in the VegaLite spec, maybe this is not much of an advantage as it would be in Altair. E.g. take this spec: "x": {"field": "date", "title": "A title text", "type": "temporal"} With out suggestion we are saying it should be possible to pass a dictionary to the # These two options are equally convenient
"x": {"field": "date", "title": {"title": "A title text", "color": "red"}, "type": "temporal"}
"x": {"field": "date", "axis": {"title": "A title text", "color": "red"}, "type": "temporal"} The difference is more notable in altair since the actual text of the title is passed as a positional argument: alt.X('date').title("A title text", color="red")
alt.X('date').axis(title="A title text", color="red") Having that said, it is not a major advantage and I think the biggest issues is that altair suggests it is possible in the docstring to use all the parameters with I see two paths:
The second one would be nice, but if the first one is less work then that is a perfectly fine option to me. |
.title()
does not support all the argument in axis(title=...)
but still lists them in the docstring_PropertySetter("title", ...)
dynamic doc uses wrong class
Dear all,
I tried the example from https://altair-viz.github.io/gallery/layered_chart_with_dual_axis.html, both the Method syntax as well as the Attribute syntax.
On my setup (jupyterlab 4 + altair 5.0.1) only the attribute syntax colours the axis labels with the colours from the graph. The Method syntax colors the axis labels black.
I am happily using the Attribute syntax now. Is this a bug? Of the documentation? Of the library itself?
Thanks in advance,
Franz
Minimal Repro
_PropertySetter("title", ...)
dynamic doc uses wrong class #3122 (comment)The text was updated successfully, but these errors were encountered: