Skip to content

Main

Root layout component. Manages viewport dimensions and orchestrates child regions.

Location

src/lib/svelte/layout/Main.svelte

Purpose

Full-viewport Box container that positions Controls, Details, and Graph regions with Separator components between them. Responds to window resize.

Layout

╭─────────────────────────────────────────────────────╮
│                     Controls                        │
│                     (48px)                          │
├═════════════════════════════════════════════════════┤
│            Horizontal Separator (8px)               │
├───────────────╦═════════════════════════════════════┤
│               ║                                     │
│    Details    ║              Graph                  │
│   (280px)     ║            (flex: 1)                │
│               ║                                     │
│               ║  Vertical Separator (8px)           │
│               ║                                     │
╰───────────────╩═════════════════════════════════════╯
                Box (full viewport, 8px border)

Props

None.

State

NameTypeDefaultDescription
widthnumberwindow.innerWidthViewport width
heightnumberwindow.innerHeightViewport height
showDetailsbooleantrueToggle details visibility

Constants

NameValueDescription
separatorThickness8Thickness of separator bars
boxThickness8Thickness of outer Box border

Derived

NameTypeDescription
controlsHeightnumberFixed at 48px
detailsWidthnumberFixed at 280px
innerWidthnumberwidth - boxThickness * 2
innerHeightnumberheight - boxThickness * 2
mainHeightnumberinnerHeight - controlsHeight - separatorThickness
graphWidthnumberRemaining width after details + separator

CSS Classes

ClassPurpose
.panelRoot container, fixed position
.mainFlex row for details + separator + graph
.regionShared base for all content areas
.controlsTop bar region
.graphMain content region, flex: 1
.detailsLeft sidebar region, flex-shrink: 0

Children

  • Box — outer border with gull wings on all sides
    • Controls — top bar
    • Separator (horizontal) — below controls, with gull wings
    • Details — left sidebar (conditional on showDetails)
    • Separator (vertical) — between details and graph (conditional)
    • Graph — main canvas area

Events

  • svelte:window onresize — updates width/height state