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)
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
def test(a): return 'ABC' if a else BkDiv(text='Test')
def test(a): return a if a else BkDiv(text='Test')
def test(a): return BkParagraph(text='Pre Test') if a else BkDiv(text='Test')
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