Skip to content

Commit 402ff2b

Browse files
committed
enabled selection and change of visualization type by binding the interactions
1 parent 3feca19 commit 402ff2b

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

app.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,12 @@ def bind_callbacks():
8484

8585
# Exploration chart callbacks
8686
for widget_key in ["question1", "question2", "chart_type1", "chart_type2"]:
87-
if "question" in widget_key:
88-
callback_idx = 0 if "1" in widget_key else 1
89-
target_chart = exploration_charts[callback_idx]
90-
widgets["exploration"][widget_key].param.watch(
91-
lambda event, target=target_chart, callback=callbacks["exploration"][callback_idx]: callback(target, event),
92-
"value"
93-
)
87+
callback_idx = 0 if "1" in widget_key else 1
88+
target_chart = exploration_charts[callback_idx]
89+
widgets["exploration"][widget_key].param.watch(
90+
lambda event, target=target_chart, callback=callbacks["exploration"][callback_idx]: callback(target, event),
91+
"value"
92+
)
9493

9594
# Global filter callbacks for exploration charts
9695
for i, callback in enumerate(callbacks["exploration"]):

0 commit comments

Comments
 (0)