Skip to content

Commit

Permalink
fix: do not share the Expr for text_color and background_color
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Feb 10, 2023
1 parent 061975d commit a553265
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ipydatagrid/cellrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ class TextRenderer(CellRenderer):
).tag(sync=True, **widget_serialization)
text_color = Union(
(Color(), Instance(VegaExpr), Instance(ColorScale)),
default_value=Expr("default_value"),
).tag(sync=True, **widget_serialization)
background_color = Union(
(Color(), Instance(VegaExpr), Instance(ColorScale)),
default_value=Expr("default_value"),
).tag(sync=True, **widget_serialization)
vertical_alignment = Union(
(
Expand All @@ -98,6 +96,14 @@ class TextRenderer(CellRenderer):
)
missing = Unicode("").tag(sync=True)

@default('text_color')
def _default_text_color(self):
return Expr("default_value")

@default('background_color')
def _default_background_color(self):
return Expr("default_value")


class BarRenderer(TextRenderer):
_model_name = Unicode("BarRendererModel").tag(sync=True)
Expand Down

0 comments on commit a553265

Please sign in to comment.