Skip to content

Commit 6c0e0fa

Browse files
committed
Fix conditional show bin selector
1 parent 30a7cd3 commit 6c0e0fa

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

panel/app.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,7 @@ def n_bins_auto(res):
147147

148148

149149
def display_n_bins(kind):
150-
if kind != "Stacked histogram":
151-
return
152-
153-
return selector_n_bins
150+
return False if kind != "Stacked histogram" else True
154151

155152

156153
def figure(res, palette, n_bins, kind, output_name):
@@ -264,6 +261,7 @@ def tableau_states(res, states):
264261
name="Switch histogram - boxplot",
265262
options=["Stacked histogram", "Boxplot"],
266263
)
264+
show_n_bins = pn.bind(display_n_bins, switch_histogram_boxplot)
267265

268266
interactive_n_bins_auto = pn.bind(n_bins_auto, interactive_decomposition)
269267
selector_n_bins = pn.widgets.EditableIntSlider(
@@ -274,8 +272,8 @@ def tableau_states(res, states):
274272
step=10,
275273
# bar_color="#FFFFFF", # does not work
276274
format=PrintfTickFormatter(format="%d bins"),
275+
visible=show_n_bins,
277276
)
278-
conditional_selector_n_bins = pn.bind(display_n_bins, switch_histogram_boxplot)
279277

280278

281279
interactive_figure = pn.bind(
@@ -313,7 +311,7 @@ def tableau_states(res, states):
313311
indicator_explained_variance,
314312
pn.pane.Markdown("## Visualization", styles={"color": blue_color}),
315313
switch_histogram_boxplot,
316-
conditional_selector_n_bins,
314+
selector_n_bins,
317315
# pn.Row(logout),
318316
max_width=350,
319317
sizing_mode="stretch_width",

0 commit comments

Comments
 (0)