midrc_react.gui.dash package

Submodules

midrc_react.gui.dash.dataselectiongroupbox module

This module contains the DataSelectionGroupBox class, which represents a group box widget for data selection.

class midrc_react.gui.dash.dataselectiongroupbox.DataSelectionGroupBox(jsd_model, app: Dash)

Bases: GroupBoxData

This class represents a group box widget for data selection. It provides functionality for creating labels and combo boxes for data files and a category combo box. The class has methods for setting up the layout, updating the category combo box, and initializing the widget.

Variables:
  • _file_comboboxes (list) – A list of file comboboxes.

  • _category_combobox (dcc.Dropdown) – A category combo box.

  • _num_fileboxes_combobox (dcc.Dropdown) – A number of fileboxes combo box.

  • _file_upload (dcc.Upload) – A file upload component.

  • layout (html.Div) – The layout of the group box.

  • jsd_model (JSDTableModel) – The JSDTableModel object.

  • num_fileboxes (int) – The number of file boxes.

property category_combobox

Get the category combobox.

Returns:

The category combobox.

Return type:

dcc.Dropdown

display()

Returns the layout of the group box.

Returns:

The layout of the group box.

Return type:

html.Div

property file_comboboxes

Get the file combo boxes.

Returns:

A list of file combo boxes.

Return type:

list

on_category_changed(value, previous_value=None)

Handles the category changing.

Parameters:
  • value (str) – The new category.

  • previous_value (str, optional) – The previous category. Defaults to None.

Returns:

The new category.

Return type:

str

on_file_selection_changed(value=None, previous_value=None)

Handles the file selection changing.

Parameters:
  • value (str, optional) – The new file selection. Defaults to None.

  • previous_value (str, optional) – The previous file selection. Defaults to None.

Returns:

The new file selection.

Return type:

str

on_num_fileboxes_changed(value, previous_value=None)

Handles the number of file boxes changing.

Parameters:
  • value (int) – The new number of file boxes.

  • previous_value (int, optional) – The previous number of file boxes. Defaults to None.

Returns:

The new number of file boxes.

Return type:

int

update_category_combobox()

Update the category combobox based on the selected data sources.

update_filebox_layout(num_fileboxes: int)

Dynamically updates the displayed fileboxes based on new data sources being available

Parameters:

num_fileboxes (int) – The number of file boxes to display in the GUI

midrc_react.gui.dash.jsdview_dash module

This module contains the JSDViewDash class, which represents a Dash view for JSD.

class midrc_react.gui.dash.jsdview_dash.JSDViewDash(jsd_model: JSDTableModel, config: dict)

Bases: JsdViewBase

This class represents a Dash view for JSD. It provides functionality for creating a Dash app and handling file uploads. The class has methods for setting up the layout, updating the category combo box, and initializing the widget.

__init__(jsd_model: JSDTableModel, config: dict)

Initialize the JSDViewDash main GUI

Parameters:
  • jsd_model (JSDTableModel) – The data model used for displaying graphs and tables

  • config (dict) – A dict from JSDConfig that contains the configuration info

get_categories()

Get the categories from the controller.

Returns:

A list of categories.

Return type:

list

handle_excel_file_uploaded(data_source_dict)

Handles the file upload.

Parameters:

data_source_dict (dict) – The data source dictionary.

run()

Runs the Dash app.

setup_layout()

Sets up the layout of the Dash app.

update_area_chart(category)

Updates the area chart with the specified category.

Parameters:

category (str) – The category to update the chart with.

Returns:

True if the chart was updated, False if there was no data to update.

Return type:

bool

update_timeline_chart(category)

Updates the timeline chart with the specified category.

Parameters:

category (str) – The category to update the chart with.

Returns:

True if the chart was updated, False if there was no data to update.

Return type:

bool

Module contents