Placeholder pages

Overview

Placeholder pages are used as templates for creating new pages in the Algomancy Content library. They provide a basic structure and functionality that can be customized by subclasses.

Reference

class algomancy_content.pages.showcasehomepage.ShowcaseHomePage[source]

Bases: BaseHomePage

ShowcaseHomePage is a subclass of BaseHomePage that provides a showcase of various HTML elements and their styling.

USAGE:
>>> config = AppConfig(
...     page_config=PageConfig(home_page="showcase"),
...     ...
... )
static register_callbacks()[source]

ShowcaseHomePage does not have any callbacks.

static create_content()[source]

Creates a div containing a broad set of common HTML UI elements for CSS styling checks.

Returns:

A container with examples of default/common elements.

Return type:

html.Div

class algomancy_content.pages.placeholderdatapage.PlaceholderDataPage[source]

Bases: BaseDataPage

PlaceholderDataPage is a subclass of BaseDataPage which provides placeholder data.

USAGE:
>>> config = AppConfig(
...     page_config=PageConfig(data_page="placeholder"),
...     ...
... )
static register_callbacks()[source]

PlaceholderDataPage does not have any callbacks.

static create_content(data)[source]

Prints some basic information about the data source

Parameters:

data (DataSource) – Data container that is used to display information. Should be an implementation of BaseDataSource.

Returns:

A list of HTML elements representing the data source information.

Return type:

list

class algomancy_content.pages.placeholderscenariopage.PlaceholderScenarioPage[source]

Bases: BaseScenarioPage

Placeholder content for the Scenario page - Secondary Results Component

USAGE:
>>> config = AppConfig(
...     page_config=PageConfig(scenario_page="placeholder"),
...     ...
... )
static register_callbacks()[source]

PlaceholderScenarioPage does not have any callbacks.

static create_content(s)[source]

Displays some basic information about the selected Scenario

Parameters:

s (Scenario) – Scenario instance to be displayed.

Returns:

Div

Return type:

html.Div

Placeholder content for the Compare page - Secondary Results Component

This module defines the secondary results section component for the compare dashboard page. It creates a collapsible section that displays additional results for the selected scenarios.

class algomancy_content.pages.placeholdercomparepage.PlaceholderComparePage[source]

Bases: BaseComparePage

Placeholder content for the Compare page - Secondary Results Component

USAGE:
>>> config = AppConfig(
...     page_config=PageConfig(compare_page="placeholder"),
...     ...
... )
static create_side_by_side_content(s, side)[source]

Create content for one side of the side-by-side comparison view.

This method generates the content for displaying a single scenario in the side-by-side comparison layout. The same method is called twice (once for each scenario) with the ‘side’ parameter indicating which side of the comparison is being rendered (typically “left” or “right”).

Parameters:
  • scenario – The Scenario object to display on this side of the comparison.

  • side (str) – A string identifier indicating which side of the comparison this is, typically “left” or “right”. Can be used for styling or layout purposes.

Returns:

A Dash Div component containing the scenario content for one

side of the comparison.

Return type:

html.Div

Raises:

NotImplementedError – Abstract method must be implemented

Example

>>> @staticmethod
>>> def create_side_by_side_content(scenario, side):
...     border_class = "left-border" if side == "left" else "right-border"
...     return html.Div([
...         html.H4(scenario.name, className="scenario-header"),
...         html.Div([
...             html.P(f"Status: {scenario.status}"),
...             dcc.Graph(figure=scenario.get_figure())
...         ])
...     ], className=f"compare-panel {border_class}")
static register_callbacks()[source]

PlaceholderComparePage does not have any callbacks.

static create_compare_section(s1, s2)[source]

Create a consolidated comparison section for both scenarios.

This method generates content that directly compares the two scenarios, typically highlighting key differences, similarities, or relative metrics. It provides a unified view of both scenarios for easy comparison.

Parameters:
  • left – The Scenario object displayed on the left side of the comparison.

  • right – The Scenario object displayed on the right side of the comparison.

Returns:

A Dash Div component containing the comparison content.

Return type:

html.Div

Raises:

NotImplementedError – Abstract method must be implemented

Example

>>> @staticmethod
>>> def create_compare_section(left, right):
...     return html.Div([
...         html.H3("Quick Comparison"),
...         html.Table([
...             html.Tr([
...                 html.Th("Metric"),
...                 html.Th(left.name),
...                 html.Th(right.name)
...             ]),
...             html.Tr([
...                 html.Td("Performance"),
...                 html.Td(f"{left.performance:.2f}"),
...                 html.Td(f"{right.performance:.2f}")
...             ])
...         ], className="comparison-table")
...     ])
static create_details_section(s1, s2)[source]

Create a detailed analysis section comparing both scenarios.

This method generates in-depth comparison content, potentially including statistical analysis, detailed parameter differences, or comprehensive result comparisons. It provides deeper insights beyond the quick comparison section.

Parameters:
  • left – The Scenario object displayed on the left side of the comparison.

  • right – The Scenario object displayed on the right side of the comparison.

Returns:

A Dash Div component containing the detailed comparison content.

Return type:

html.Div

Raises:

NotImplementedError – Abstract method must be implemented

Example

>>> @staticmethod
>>> def create_details_section(left, right):
...     diff = calculate_differences(left, right)
...     return html.Div([
...         html.H3("Detailed Analysis"),
...         html.Div([
...             html.H5("Parameter Differences"),
...             html.Ul([
...                 html.Li(f"{key}: {diff[key]}")
...                 for key in diff.keys()
...             ])
...         ]),
...         html.Div([
...             html.H5("Statistical Comparison"),
...             dcc.Graph(figure=create_comparison_chart(left, right))
...         ])
...     ], className="details-section")