Ejemplo n.º 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)
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
 def test(a):
     return 'ABC' if a else BkDiv(text='Test')
Ejemplo n.º 4
0
 def test(a):
     return a if a else BkDiv(text='Test')
Ejemplo n.º 5
0
 def test(a):
     return BkParagraph(text='Pre Test') if a else BkDiv(text='Test')
Ejemplo n.º 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