widget.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:altair_widgets 作者: altair-viz 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号