Skip to main content

SplitPaneChartLayout

ComplexChart panels<co-split-pane-chart-layout>

SplitPaneChartLayout is the three-pane chart workspace: a resizable left section nav, the note in the middle and a resizable right context panel that can close.

import { SplitPaneChartLayout } from 'health-components';

Examples​

Showcase​

Storybook

Collapsed​

Storybook

Wide Context​

Storybook

Usage​

<SplitPaneChartLayout nav={<SectionNav />} context={<ResultsTrendPanel groups={g} />} rightTitle="Results">{note}</SplitPaneChartLayout>

When to use​

  • Writing a note while looking at results, medications or a CDS card.

When not to use​

  • Phone width: panes stack. Simple pages: use the page layout.

Variants and states​

VariantWhat it is
defaultLeft 220px, right 300px.
left collapsed44px rail with an expand button.
right closedA floating button reopens it.
resizingDrag the divider, or focus it and use Left and Right (Shift for bigger steps).

Clinical values​

Every number renders through CareOS.ClinicalValue and CareOS.fmt (the clinical-values builder), matched by LOINC; measures that table lacks (NT-proBNP, lactate, vancomycin trough, CrCl, PHQ-9, per-kg doses) use a local table with the same rules: tabular figures, the unit always shown, fixed decimals per measure (potassium 1, sodium 0, creatinine 2), the reference range in the title or beside it, and H, L, HH or LL flags in words for screen readers. The flag says where the number sits against the adult reference range in the rules table; it does not say the number was measured correctly.

Accessibility​

  • Dividers are role separator with aria-valuenow and keyboard resizing.
  • Each pane is a landmark: nav, main, aside.

Do and don't​

  • Do: Keep the patient banner above the layout.
  • Don't: Put a second scroll bar inside the note.

Props​

PropTypeDefaultDescription
navReactNodenoneLeft pane: chart section navigation
childrenReactNode—Middle pane: the note
contextReactNodenoneRight pane: context (results, CDS cards)
rightTitlestring'Context'Right pane title
mainLabelstring'Note'Accessible name of the middle pane
leftWidthnumber220Initial left pane width in px (160 to 360)
rightWidthnumber300Initial right pane width in px (240 to 520)
onLeftWidthChange(width: number) => voidnoneCalled with the left width after a resize
onRightWidthChange(width: number) => voidnoneCalled with the right width after a resize
leftCollapsedbooleanuncontrolledLeft pane collapsed to a rail (controlled)
defaultLeftCollapsedbooleanfalseLeft pane starts collapsed
onLeftCollapsedChange(collapsed: boolean) => voidnoneCalled when the left pane collapses or expands
rightOpenbooleanuncontrolledRight pane open (controlled)
defaultRightOpenbooleantrueRight pane starts open
onRightOpenChange(open: boolean) => voidnoneCalled when the right pane opens or closes
heightnumber420Layout height in px
rangeContextRangeContextIdthe global context, else 'outpatient'Which shared reference range flags use; the lab range on a result still wins

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-split-pane-chart-layout>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-split-pane-chart-layout right-title="…" main-label="…" [defaultValue]="defaultValue" (co-left-width-change)="onLeftWidthChange($event.detail)">…</co-split-pane-chart-layout>
KindNameDescription
attributeright-title / rightTitleRight pane title; default 'Context'
attributemain-label / mainLabelAccessible name of the middle pane; default 'Note'
attributeleft-width / leftWidthInitial left pane width in px (160 to 360); default 220
attributeright-width / rightWidthInitial right pane width in px (240 to 520); default 300
attributeleft-collapsed / leftCollapsedLeft pane collapsed to a rail (controlled); default uncontrolled
attributedefault-left-collapsed / defaultLeftCollapsedLeft pane starts collapsed; default false
attributeright-open / rightOpenRight pane open (controlled); default uncontrolled
attributedefault-right-open / defaultRightOpenRight pane starts open; default true
attributeheightLayout height in px; default 420
attributerange-context / rangeContextWhich shared reference range flags use; the lab range on a result still wins; default the global context, else 'outpatient'
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-left-width-changeCalled with the left width after a resize; default none (React: onLeftWidthChange)
eventco-right-width-changeCalled with the right width after a resize; default none (React: onRightWidthChange)
eventco-left-collapsed-changeCalled when the left pane collapses or expands; default none (React: onLeftCollapsedChange)
eventco-right-open-changeCalled when the right pane opens or closes; default none (React: onRightOpenChange)
slotnavLeft pane: chart section navigation; default none Plain text also works as the `nav` attribute.
slot(default)Middle pane: the note
slotcontextRight pane: context (results, CDS cards); default none Plain text also works as the `context` attribute.