Skip to content

Understanding Application Structure

Equation applications are configured through EquationWebClientSettings and one or more EquationWebClientTabSettings entries.

Overview

An Equation app configuration has:

  • Application settings (EquationWebClientSettings): app-level name, route, and tab collection
  • Tab settings (EquationWebClientTabSettings): per-tab layout, trigger behavior, and endpoint wiring

Application Settings

python
from haskoning_equation import EquationWebClientSettings, EquationWebClientTabSettings

settings = EquationWebClientSettings(
    app_name="Nereda Process Calculations",
    route="/nereda",
    tabs=[
        EquationWebClientTabSettings(
            tab_name="Process Design",
            tab_icon="mdi-calculator",
            trigger_type="automatic",
            layout_type="split",
            core_endpoints=["/calculate", "/validate"],
        )
    ],
)

Key EquationWebClientSettings Properties

  • app_name: Display name of the application
  • route: Route where the app is mounted (useful for multiple apps)
  • tabs: List of EquationWebClientTabSettings; if omitted, Equation creates a default tab

Tab Configuration

EquationWebClientTabSettings controls tab behavior and UI composition.

python
from haskoning_equation import EquationWebClientTabSettings

tab = EquationWebClientTabSettings(
    tab_name="Results",
    tab_icon="mdi-chart-line",
    trigger_type="manual",
    layout_type="combined",
    on_mount_endpoints=["/load_results"],
    core_endpoints=["/calculate"],
    unit_conversion_endpoint="/convert_units",
)

Key EquationWebClientTabSettings Properties

  • tab_name: Tab label in the UI
  • tab_icon: Optional icon identifier
  • trigger_type: "manual" or "automatic"
  • layout_type: "stacked", "combined", "split", or "parametric"
  • core_endpoints: Endpoints used by the tab
  • on_mount_endpoints / on_unmount_endpoints: Lifecycle endpoints; functions that run only once when opening or closing the tab.
  • unit_conversion_endpoint: Endpoint for unit conversions
  • receive_speckle_endpoint / send_speckle_endpoint: Speckle integration endpoints
  • shape_diver_ticket: ShapeDiver ticket
  • include_schema_in_selection_tree: Include schema nodes in selection tree
  • disabled / hidden: Tab visibility and availability flags

Multiple Apps in One FastAPI Service

python
from fastapi import FastAPI
from haskoning_equation import apply_equation_web_client_settings, EquationWebClientSettings

app = FastAPI()

settings_app1 = EquationWebClientSettings(app_name="Nereda", route="/nereda")
settings_app2 = EquationWebClientSettings(app_name="Hycalc", route="/hycalc")

apply_equation_web_client_settings(app, [settings_app1, settings_app2])

Best Practices

  1. Pick layout_type based on user workflow, not implementation convenience.
  2. Use automatic trigger for lightweight calculations and manual for expensive runs.
  3. Keep endpoint responsibilities clear (core, lifecycle, unit conversion, integrations).
  4. Use route explicitly when hosting multiple apps.

Next Steps