Skip to content

Commit

Permalink
support for 3 image defs in Heatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
xtianpoli committed Nov 19, 2024
1 parent 743ad2e commit d1a53e2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ipyprogressivis/widgets/chaining/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
WidgetType = AnyType
_l = ipw.Label

DIM = 512
MAX_DIM = 512


def make_float(
Expand All @@ -37,6 +37,7 @@ def make_float(

class HeatmapW(VBoxTyped):
class Typed(TypedBase):
choice_dim: ipw.Dropdown
choice_x: ipw.Dropdown
choice_y: ipw.Dropdown
# freeze_ck: ipw.Checkbox
Expand Down Expand Up @@ -69,6 +70,13 @@ def initialize(self) -> None:
for (col, (c, t)) in self.col_typed_names.items()
if (t.startswith("float") or t.startswith("int"))
]
self.child.choice_dim = ipw.Dropdown(
options=[("512*512", "512"), ("256*256", "256"), ("128*128", "128")],
value="512",
description="Definition",
disabled=False,
# layout={"width": "initial"},
)
self.child.choice_x = ipw.Dropdown(
options=num_cols + [""],
value="",
Expand Down Expand Up @@ -110,7 +118,8 @@ def init_heatmap(self, ctx) -> None:
col_x = ctx["X"]
col_y = ctx["Y"]
print("XY", ctx)
self.child.image = ipw.Image(value=b"\x00", width=DIM, height=DIM)
DIM = int(self.child.choice_dim.value)
self.child.image = ipw.Image(value=b"\x00", width=MAX_DIM, height=MAX_DIM)
s = self.input_module.scheduler()
query = quantiles = self.input_module
with s:
Expand Down

0 comments on commit d1a53e2

Please sign in to comment.