Skip to content

Commit 39d5cb7

Browse files
committed
Updated component docs
1 parent f657a5d commit 39d5cb7

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

chartlets.py/chartlets/components/button.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55

66
@dataclass(frozen=True)
77
class Button(Component):
8+
"""Buttons allow users to take actions, and make choices,
9+
with a single tap."""
10+
811
text: str | None = None
12+
"""The button text."""

chartlets.py/chartlets/components/checkbox.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55

66
@dataclass(frozen=True)
77
class Checkbox(Component):
8+
"""Checkboxes allow the user to select one or more items from a set.
9+
They can be used to turn an option on or off."""
10+
811
value: bool | None = None
12+
"""The checkbox value."""
13+
914
label: str = ""
15+
"""The checkbox label."""

chartlets.py/chartlets/components/dropdown.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55

66
@dataclass(frozen=True)
77
class Dropdown(Component):
8+
"""Dropdown components are used for collecting user provided
9+
information from a list of options."""
10+
811
options: list[tuple[str, str | int | float]] = field(default_factory=list)
12+
"""The options given as a list of (label, value) pairs."""

chartlets.py/chartlets/components/plot.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88

99
@dataclass(frozen=True)
1010
class Plot(Component):
11+
"""The plot component is a container for a
12+
[Vega Altair](https://altair-viz.github.io/) chart."""
13+
1114
chart: alt.Chart | None = None
15+
"""The Vega Altair
16+
[chart object](https://altair-viz.github.io/user_guide/generated/toplevel/altair.Chart.html)."""
1217

1318
def to_dict(self) -> dict[str, Any]:
1419
d = super().to_dict()

chartlets.py/chartlets/components/typography.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,14 @@
55

66
@dataclass(frozen=True)
77
class Typography(Component):
8+
"""Use typography to present your design and content as clearly
9+
and efficiently as possible."""
10+
811
text: str | None = None
12+
"""Optional text to be displayed."""
13+
14+
color: str | None = None
15+
"""The color of the component."""
16+
17+
variant: str | None = None
18+
"""Applies the theme typography styles."""

0 commit comments

Comments
 (0)