pysepal.sepalwidgets.vue_app.MapApp#
- class pysepal.sepalwidgets.vue_app.MapApp(*args, **kwargs)[source]#
The map application shell. Render it with
MapApp.element(...).An application is a Solara component, and this is the shell it renders:
MapApp.element(...)mounts the language selector and lets every nested element follow the locale. Constructing the widget directly gives the bare layout only – no selector, and nothing that follows a language change, because outside a render there is no render loop. It is not a way to assemble an application.Instantiate the MapApp class.
- Parameters:
theme_toggle (ThemeToggle, optional) – Theme toggle widget
theme_state (ThemeState, optional) – Shared theme state; defaults to the current scope’s.
locales (iterable of str, optional) – Locale codes the selector
MapApp.elementmounts will offer, normallymessages.available_locales(). Unused when alanguage_selectoris supplied, and by the bare widget, which mounts no selector.initial_step (int, optional) – Initial step to display
model (HasTraits, optional) – Deprecated. Links matching traitlets with this model, but only the model given at construction:
MapApp.elementignores a new one on a later render. Passcurrent_step/on_current_stepandstep_open/on_step_openinstead.**kwargs – Additional parameters
Attributes
app_iconA trait for unicode strings.
app_titleA trait for unicode strings.
current_stepAn integer trait.
dialog_fullscreenA boolean (True, False) trait.
dialog_widthAn integer trait.
docs_urlA trait for unicode strings.
drawer_widthCurrent drawer pixel width (collapsed or expanded).
initial_stepAn integer trait.
is_pinnedA boolean (True, False) trait.
language_selectorAn instance of a Python list.
main_mapAn instance of a Python list.
repo_urlA trait for unicode strings.
right_panelAn instance of a Python list.
right_panel_configAn instance of a Python dict.
right_panel_contentAn instance of a Python list.
right_panel_footerWidgets pinned below the scrolling sections, e.g. a persistent action bar.
right_panel_openA boolean (True, False) trait.
right_panel_widthAn integer trait.
step_openA boolean (True, False) trait.
steps_dataAn instance of a Python list.
template_fileA trait for unicode strings.
theme_toggleAn instance of a Python list.
window_heightBrowser window size, pushed from Vue on mount and resize.
window_widthAn integer trait.
Methods
Instantiate the MapApp class.
Let Reacton render the selector before constructing the widget shell.
Set or change the bound model.
Remove all model links and cleanup.
Handle right panel actions from step activation.
Handle step activation from Vue component.
Handle step activation/deactivation from Vue component.
Handle step deactivation from Vue component.
Receive the real drawer pixel width from Vue on mount/mini-toggle.
Receive the real browser window size from Vue on mount/resize.
- MapApp.__init__(theme_toggle=None, theme_state=None, locales=None, initial_step=None, model=None, **kwargs)[source]#
Instantiate the MapApp class.
- Parameters:
theme_toggle (ThemeToggle, optional) – Theme toggle widget
theme_state (ThemeState, optional) – Shared theme state; defaults to the current scope’s.
locales (iterable of str, optional) – Locale codes the selector
MapApp.elementmounts will offer, normallymessages.available_locales(). Unused when alanguage_selectoris supplied, and by the bare widget, which mounts no selector.initial_step (int, optional) – Initial step to display
model (HasTraits, optional) – Deprecated. Links matching traitlets with this model, but only the model given at construction:
MapApp.elementignores a new one on a later render. Passcurrent_step/on_current_stepandstep_open/on_step_openinstead.**kwargs – Additional parameters
- classmethod MapApp.element(**kwargs)[source]#
Let Reacton render the selector before constructing the widget shell.
- MapApp.set_model(model)[source]#
Set or change the bound model.
- Parameters:
model (HasTraits) – New model to bind with
deprecated: (..) – 4.2.0: MapApp(model=…) is deprecated and binds only the model passed on the first render. Drive the steps with props instead: MapApp.element(current_step=step.value, on_current_step=step.set), and the same for step_open.
- MapApp.unlink_model()[source]#
Remove all model links and cleanup.
Deprecated since version 4.2.0: MapApp(model=…) is deprecated and binds only the model passed on the first render. Drive the steps with props instead: MapApp.element(current_step=step.value, on_current_step=step.set), and the same for step_open.
- MapApp.vue_handle_right_panel_action(action)[source]#
Handle right panel actions from step activation.
- MapApp.vue_handle_step_activation(step_id)[source]#
Handle step activation from Vue component.
- Parameters:
step_id (int) – The ID of the step being activated
- MapApp.vue_handle_step_change(step_id, is_open)[source]#
Handle step activation/deactivation from Vue component.
- Parameters:
step_id (int) – The ID of the step being changed
is_open (bool) – Whether the step is being opened or closed