@@ -147,10 +147,7 @@ def n_bins_auto(res):
147147
148148
149149def 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
156153def 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
268266interactive_n_bins_auto = pn .bind (n_bins_auto , interactive_decomposition )
269267selector_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
281279interactive_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