Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions chartlets.js/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 0.1.7 (in development)

* Typology component now allows color and text arguments.
If a user uses text and children, the text argument replaces the
children.

## Version 0.1.6 (from 2025/06/18)

* Implemented dynamic resizing for Vega Charts when the side panel's
Expand Down
7 changes: 7 additions & 0 deletions chartlets.js/packages/lib/src/plugins/mui/Typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface TypographyState extends ComponentState {
gutterBottom?: boolean;
noWrap?: boolean;
variant?: TypographyVariant;
text?: string;
color?: string;
}

interface TypographyProps extends ComponentProps, TypographyState {}
Expand All @@ -20,9 +22,13 @@ export const Typography = ({
gutterBottom,
noWrap,
variant,
text,
color,
children: nodes,
onChange,
}: TypographyProps) => {
nodes = text ? [text] : nodes;

return (
<MuiTypography
id={id}
Expand All @@ -31,6 +37,7 @@ export const Typography = ({
gutterBottom={gutterBottom}
noWrap={noWrap}
variant={variant}
color={color}
>
<Children nodes={nodes} onChange={onChange} />
</MuiTypography>
Expand Down
14 changes: 7 additions & 7 deletions chartlets.py/demo/my_extension/my_panel_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def render_panel(
ariaDescribedBy="dialog-description",
)

info_text = Typography(id="info_text")
info_text = Typography(id="info_text", color="grey")

return Box(
style={
Expand All @@ -63,17 +63,17 @@ def dialog_on_open(ctx: Context, button) -> bool:
@panel.callback(
Input("okay_button", "clicked"),
Output("dialog", "open"),
Output("info_text", "children"),
Output("info_text", "text"),
)
def dialog_on_close(ctx: Context, button) -> tuple[bool, list[str]]:
return False, ["Okay button was clicked!"]
def dialog_on_close(ctx: Context, button) -> tuple[bool, str]:
return False, "Okay button was clicked!"


# noinspection PyUnusedLocal
@panel.callback(
Input("not_okay_button", "clicked"),
Output("dialog", "open"),
Output("info_text", "children"),
Output("info_text", "text"),
)
def dialog_on_close(ctx: Context, button) -> tuple[bool, list[str]]:
return False, ["Not okay button was clicked!"]
def dialog_on_close(ctx: Context, button) -> tuple[bool, str]:
return False, "Not okay button was clicked!"