SplitPaneChartLayout
<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
Collapsed
Wide Context
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
| Variant | What it is |
|---|---|
| default | Left 220px, right 300px. |
| left collapsed | 44px rail with an expand button. |
| right closed | A floating button reopens it. |
| resizing | Drag 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
| Prop | Type | Default | Description |
|---|---|---|---|
nav | ReactNode | none | Left pane: chart section navigation |
children | ReactNode | — | Middle pane: the note |
context | ReactNode | none | Right pane: context (results, CDS cards) |
rightTitle | string | 'Context' | Right pane title |
mainLabel | string | 'Note' | Accessible name of the middle pane |
leftWidth | number | 220 | Initial left pane width in px (160 to 360) |
rightWidth | number | 300 | Initial right pane width in px (240 to 520) |
onLeftWidthChange | (width: number) => void | none | Called with the left width after a resize |
onRightWidthChange | (width: number) => void | none | Called with the right width after a resize |
leftCollapsed | boolean | uncontrolled | Left pane collapsed to a rail (controlled) |
defaultLeftCollapsed | boolean | false | Left pane starts collapsed |
onLeftCollapsedChange | (collapsed: boolean) => void | none | Called when the left pane collapses or expands |
rightOpen | boolean | uncontrolled | Right pane open (controlled) |
defaultRightOpen | boolean | true | Right pane starts open |
onRightOpenChange | (open: boolean) => void | none | Called when the right pane opens or closes |
height | number | 420 | Layout height in px |
rangeContext | RangeContextId | the 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.
<co-split-pane-chart-layout right-title="…" main-label="…" [defaultValue]="defaultValue" (co-left-width-change)="onLeftWidthChange($event.detail)">…</co-split-pane-chart-layout>
| Kind | Name | Description |
|---|---|---|
| attribute | right-title / rightTitle | Right pane title; default 'Context' |
| attribute | main-label / mainLabel | Accessible name of the middle pane; default 'Note' |
| attribute | left-width / leftWidth | Initial left pane width in px (160 to 360); default 220 |
| attribute | right-width / rightWidth | Initial right pane width in px (240 to 520); default 300 |
| attribute | left-collapsed / leftCollapsed | Left pane collapsed to a rail (controlled); default uncontrolled |
| attribute | default-left-collapsed / defaultLeftCollapsed | Left pane starts collapsed; default false |
| attribute | right-open / rightOpen | Right pane open (controlled); default uncontrolled |
| attribute | default-right-open / defaultRightOpen | Right pane starts open; default true |
| attribute | height | Layout height in px; default 420 |
| attribute | range-context / rangeContext | Which shared reference range flags use; the lab range on a result still wins; default the global context, else 'outpatient' |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-left-width-change | Called with the left width after a resize; default none (React: onLeftWidthChange) |
| event | co-right-width-change | Called with the right width after a resize; default none (React: onRightWidthChange) |
| event | co-left-collapsed-change | Called when the left pane collapses or expands; default none (React: onLeftCollapsedChange) |
| event | co-right-open-change | Called when the right pane opens or closes; default none (React: onRightOpenChange) |
| slot | nav | Left pane: chart section navigation; default none Plain text also works as the `nav` attribute. |
| slot | (default) | Middle pane: the note |
| slot | context | Right pane: context (results, CDS cards); default none Plain text also works as the `context` attribute. |