def _generate_controller(self, ndims):
marks = _get_marks()
# mark button
mark_choose = widgets.Dropdown(options=marks, description='Marks')
mark_choose.observe(self._update, names='value')
mark_choose.layout.width = '20%'
mark_choose.row = -1
mark_choose.title = 'mark'
# mark options button
mark_but = widgets.Button(description='options')
mark_but.layout.width = '10%'
mark_but.row = -1
mark_but.title = 'mark_button'
# Mark options
mark_opt = widgets.VBox(children=[], visible=False)
mark_but.on_click(self._show_advanced)
mark_opt.title = 'mark_options'
mark_opt.layout.width = '300px'
add_dim = widgets.Button(description='add encoding')
add_dim.on_click(self._add_dim)
to_altair = widgets.Button(description='chart.to_altair()')
to_altair.on_click(self._to_altair)
dims = [self._create_shelf(i=i) for i in range(ndims)]
choices = dims + [widgets.HBox([add_dim, to_altair, mark_choose,
mark_but, mark_opt])]
return widgets.VBox(choices)
评论列表
文章目录