backtrader.bokeh.tab module¶
Tab base class.
Provides extensible tab architecture for creating custom tabs.
- class backtrader.bokeh.tab.BokehTab[source]¶
Bases:
objectTab base class.
Abstract base class for creating custom tabs. Subclasses must implement _is_useable and _get_panel methods.
- _app¶
BacktraderBokeh application instance
- _figurepage¶
Figure page instance
- _client¶
Client instance (optional, for live mode)
- _panel¶
Bokeh Panel instance
Example
- class MyCustomTab(BokehTab):
- def _is_useable(self):
return True
- def _get_panel(self):
from bokeh.models import Div div = Div(text=’<h1>My Content</h1>’) return div, ‘My Tab’
- __init__(app, figurepage, client=None)[source]¶
Initialize tab.
- Parameters:
app – BacktraderBokeh application instance
figurepage – Figure page instance
client – Client instance (optional)
- is_useable()[source]¶
Public interface: Check if tab is useable.
- Returns:
Whether tab is useable
- Return type:
- get_panel()[source]¶
Public interface: Get Bokeh Panel.
- Returns:
Bokeh Panel instance
- Return type:
Panel
- property strategy¶
Get strategy instance.
- property scheme¶
Get theme instance.