shyft.dashboard.examples.selector_model

Example how to implement a data selector model using the SelectorModelBase

Classes

CompSelectorModelExample(thread_pool[, ...])

TimesElevenPlusFiveSelector(presenter, ...)

Simple selector which takes a dom obj: Dict[str, int]

class shyft.dashboard.examples.selector_model.TimesElevenPlusFiveSelector(presenter: SelectorPresenter, sleep_time, logger=None)[source]

Bases: SelectorModelBase

Simple selector which takes a dom obj: Dict[str, int]

When a selection is made we want to return a new dom obj whitch contains a new dom obj for all the selected entries where the value_new = value_old + 11 * 5.

In addition since calculating takes long time, we will wait for sleep_time before we send the results.

This is just for the purpose of …

__init__(presenter: SelectorPresenter, sleep_time, logger=None) None[source]
on_change_selected(new_values: List[str])[source]
process_selection_evaluation(*args, **kwargs)
loading_function(*args, **kwargs)
class shyft.dashboard.examples.selector_model.CompSelectorModelExample(thread_pool, app_kwargs: Dict[str, Any] | None = None)[source]

Bases: AppBase

__init__(thread_pool, app_kwargs: Dict[str, Any] | None = None)[source]

Init of base app

Parameters:
  • thread_pool – Optional thread pool used for async calls within the app

  • app_kwargs – Optional keyword arguments provided to the app through the start_bokeh_apps methods

property name: str

This property returns the name of the app

get_layout(doc: bokeh.document.Document, logger: LoggerBox | None = None) bokeh.layouts.LayoutDOM[source]

This function returns the full page layout for the app