Skip to content

Commit 6852230

Browse files
committed
respect themes
1 parent f987a2b commit 6852230

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

chartlets.js/CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Version 0.0.30 (in development)
22

3-
* The `Plot` component now respects the current MUI theme mode `"dark"`. (#XX)
3+
* The `Plot` component now respects a `theme` property. If not given,
4+
it will respect the current MUI theme mode `"dark"`.
45

56
## Version 0.0.29 (from 2024/11/26)
67

chartlets.py/CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* The `Plot` component now respects a `theme` property. If not given,
2+
it will respect the current MUI theme mode `"dark"`.
3+
14
## Version 0.0.29 (from 2024/11/26)
25

36
* Fixed a bug that prevents using annotations of type `dict` or `dict[str, T]`.

chartlets.py/chartlets/components/plot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class Plot(Component):
1111
"""The plot component is a container for a
1212
[Vega Altair](https://altair-viz.github.io/) chart."""
1313

14+
theme: str | None = None
15+
"""A [Vega theme name](https://vega.github.io/vega-themes/)."""
16+
1417
chart: alt.Chart | None = None
1518
"""The Vega Altair
1619
[chart object](https://altair-viz.github.io/user_guide/generated/toplevel/altair.Chart.html)."""

chartlets.py/chartlets/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.0.29"
1+
version = "0.0.30"

chartlets.py/tests/components/plot_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ def test_is_json_serializable(self):
2626
)
2727

2828
self.assert_is_json_serializable(
29-
self.cls(id="plot", chart=self.chart),
29+
self.cls(id="plot", theme="dark", chart=self.chart),
3030
{
31+
"theme": "dark",
3132
"chart": {
3233
"$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
3334
"config": {

0 commit comments

Comments
 (0)