コード例 #1
0
def Div(**kwargs):
    # Hack to work around issues with Div height in notebooks
    div = BkDiv(**kwargs)
    box_kws = {
        k: v
        for k, v in kwargs.items() if k in ['width', 'height', 'sizing_mode']
    }
    return BkWidgetBox(div, **box_kws)
コード例 #2
0
ファイル: annotation.py プロジェクト: yuhongjiu/holoviews
    def initialize_plot(self, ranges=None, plot=None, plots=None, source=None):
        """
        Initializes a new plot object with the last available frame.
        """
        # Get element key and ranges for frame
        element = self.hmap.last
        key = self.keys[-1]
        self.current_frame = element
        self.current_key = key

        data, _, _ = self.get_data(element, ranges, {})
        div = BkDiv(text=data, width=self.width, height=self.height)
        self.handles['plot'] = div
        self._execute_hooks(element)
        self.drawn = True
        return div
コード例 #3
0
 def test(a):
     return 'ABC' if a else BkDiv(text='Test')
コード例 #4
0
 def test(a):
     return a if a else BkDiv(text='Test')
コード例 #5
0
ファイル: test_interact.py プロジェクト: codeaudit/panel
 def test(a):
     return BkParagraph(text='Pre Test') if a else BkDiv(text='Test')
コード例 #6
0
def Div(**kwargs):
    # Hack to work around issues with Div height in notebooks
    div = BkDiv(**kwargs)
    if 'height' in kwargs:
        return BkRow(div, BkSpacer(height=kwargs['height']))
    return div