-
Notifications
You must be signed in to change notification settings - Fork 297
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
Vega plots rendered in VS Code are not aware of the themes #11292
Comments
Fixed, this should now work. Note: vega supports light and dark themes, hence if you use light or dark themes, the vega output will change accrodingly.Testing instructions:
import altair as alt
from vega_datasets import data
# Show an image where the interactive plot is not supported
alt.renderers.enable('mimetype')
source = data.cars()
alt.Chart(source).mark_boxplot().encode(
x='Origin',
y=alt.Y(alt.repeat('column'), type='quantitative'),
).repeat(column=['Horsepower', 'Weight_in_lbs'])
from IPython.display import display
display({
"application/vnd.vegalite.v3+json": {
"$schema": "https://vega.github.io/schema/vega-lite/v3.json",
"description": "A simple bar chart with embedded data.",
"data": {
"values": [
{"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
{"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
{"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
]
},
"mark": "bar",
"encoding": {
"x": {"field": "a", "type": "ordinal"},
"y": {"field": "b", "type": "quantitative"}
}
}
}, raw=True)
|
@DonJayamanne Is it possible to use a light theme for vegalite/altair when the dark theme is enabled in VS Code? This is a quite important use case since it allows you to see what the plot would look like for others outside the editor. It seems like setting it back to "default" does not work and it is still dark: Also see vega/vega-themes#413 |
@joelostblom |
@DonJayamanne Follow up here #11670 |
Whether we're using dark or light them, the plot is still a light styled plot.
In JLab it changes based on the theme.
Should we change this, what if user want the old light style plots even in dard vscode themes?
The text was updated successfully, but these errors were encountered: