ssb_dash_framework.tabs package

ssb_dash_framework.tabs.aarsregnskap_tab module

class AarsregnskapTab

Bases: TabImplementation, Aarsregnskap

AarsregnskapTab is an implementation of the Aarsregnskap module as a tab in a Dash application.

ssb_dash_framework.tabs.altinn_components module

class AltinnComponents(time_units)

Bases: object

Components for the Altinn Skjemadata Editor.

Includes: - layout (The main layout) - Offcanvas for kontaktinfo and controls - Modals - Function for creating ag grids

Parameters:

time_units (int)

create_ag_grid(component_id)

Returns a non-editable AgGrid component with a dark alpine theme.

Return type:

AgGrid

Parameters:

component_id (str)

create_cards()

Return a list of dbc.Card components dynamically generated for each time unit.

Return type:

list[Card]

enhetsinfomodal()

Returns a modal component containing a table with enhetsinfo.

Return type:

Modal

historikkmodal()

Retuns a modal component containing a table with the editing history.

Return type:

Modal

hjelpetabellmodal()

Return a modal component containing tab content. Future versions may support adding new tabs.

Return type:

Modal

kommentarmodal()

Returns a modal component containing editing comments.

Return type:

Modal

kontaktcanvas()

Retuns an offcanvas component containing a table with contact information.

Return type:

Div

layout()

Generate the layout for the Pi memorizer tab.

Return type:

Div

offcanvas_kontrollutslag()

Returns an offcanvas component containing a table for kontrollutslag.

Return type:

Div

skjemaversjonsmodal()

Returns a modal component with a table containing all the skjema versions.

Return type:

Modal

ssb_dash_framework.tabs.altinn_editor module

class AltinnSkjemadataEditor(time_units, variable_connection, conn)

Bases: AltinnComponents

A tab for editing skjemadata.

This module provides: - A sidebar what contains information about the enhet - How many forms the enhet has sent to SSB, with a unique version ID and a datetime. - An editable table that contains the skjemadata. - Kontrollutslag, kontaktinformasjon etc-

Parameters:
  • time_units (list[str])

  • variable_connection (dict)

  • conn (object)

label

The label for the tab, set to “🗊 skjemadata_viewer”.

Type:

str

conn

EimerDB

Type:

eimerdb

layout()

Generates the layout for the skjemadataViewer tab.

callbacks()

Registers the Dash callbacks for handling user interactions.

Return type:

None

callbacks()

Register Dash callbacks for the Pi memorizer tab.

Return type:

None

Notes

  • The update_input callback handles the interaction between the numeric keypad and the current sequence, score, and high score.

create_callback_components(input_type='Input')

Generates a list of dynamic Dash Input or State components.

create_partition_select(skjema=None, **kwargs)
get_skjemadata_table_names()

Retrieves the names of all the skjemadata-tables in the eimerdb.

update_partition_select(partition_dict, key_to_update)

Updates the dictionary by adding the previous value (N-1) to the list for a single specified key.

Parameters:
  • partition_dict – Dictionary containing lists of values

  • key_to_update – Key to update by appending (N-1)

Returns:

Updated dictionary

ssb_dash_framework.tabs.bofregistry module

ssb_dash_framework.tabs.freesearch_tab module

class FreeSearchTab(database)

Bases: TabImplementation, FreeSearch

Implementation of the FreeSearch module as a tab in the application.

This class extends the FreeSearch base class and provides a layout specific to the tab interface.

Parameters:

database (Any)

ssb_dash_framework.tabs.pi_memorizer module

class Pimemorizer

Bases: object

A tab for testing and improving memory of the digits of π (Pi).

This component provides: - A text box to display the digits entered so far. - A numeric keypad to input digits. - A scoring system to track the current and high scores.

label

The label for the tab, set to “𝝅 Pi memorizer”.

Type:

str

layout()

Generates the layout for the Pi memorizer tab.

Return type:

Div

callbacks()

Registers the Dash callbacks for handling user interactions.

Return type:

None

callbacks()

Register Dash callbacks for the Pi memorizer tab.

Return type:

None

Notes

  • The update_input callback handles the interaction between the numeric keypad and the current sequence, score, and high score.

layout()

Generate the layout for the Pi memorizer tab.

Returns:

A Div element containing:
  • A text area to display the user’s current input sequence.

  • A numeric keypad for entering digits.

  • Score and high score displays to track progress.

Return type:

html.Div

ssb_dash_framework.tabs.skjemapdfviewer_tab module

class SkjemapdfViewerTab(pdf_folder_path, form_identifier='skjemaversjon')

Bases: TabImplementation, SkjemapdfViewer

SkjemapdfViewerTab is an implementation of the SkjemapdfViewer module as a tab in a Dash application.

Parameters:
  • pdf_folder_path (str)

  • form_identifier (str)

ssb_dash_framework.tabs.tables_tab module

class EditingTableTab(label, inputs, states, get_data_func, update_table_func=None, output=None, output_varselector_name=None)

Bases: TabImplementation, EditingTable

A class to implement a module inside a tab.

Parameters:
  • label (str)

  • inputs (list[str])

  • states (list[str])

  • get_data_func (Callable[[...], Any])

  • update_table_func (Callable[[...], Any] | None)

  • output (str | None)

  • output_varselector_name (str | None)