shyft.dashboard.examples.selector_model

Example how to implement a data selector model using the SelectorModelBase

Classes

CompSelectorModelExample(thread_pool[, ...])

Init of base app

TimesElevenPlusFiveSelector(presenter, ...)

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

class shyft.dashboard.examples.selector_model.TimesElevenPlusFiveSelector(presenter, 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 …

Parameters:

presenter (SelectorPresenter)

__init__(presenter, sleep_time, logger=None)[source]
Parameters:

presenter (SelectorPresenter)

Return type:

None

on_change_selected(new_values)[source]
Parameters:

new_values (List[str])

process_selection_evaluation(*args, **kwargs)
loading_function(*args, **kwargs)
class shyft.dashboard.examples.selector_model.CompSelectorModelExample(thread_pool, app_kwargs=None)[source]

Bases: AppBase

Init of base app

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

  • app_kwargs (Dict[str, Any] | None) – Optional keyword arguments provided to the app through the start_bokeh_apps methods

__init__(thread_pool, app_kwargs=None)[source]

Init of base app

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

  • app_kwargs (Dict[str, Any] | None) – 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, logger=None)[source]

This function returns the full page layout for the app

Parameters:
  • doc (bokeh.document.Document)

  • logger (LoggerBox | None)

Return type:

bokeh.layouts.LayoutDOM