Skip to content
D
Documentation

GrafloriaDashboardComponent

reference
2 min readUpdated

Import it from @grafloria/angular.

<grafloria-dashboard> — the dashboard kit, the Angular way.

The kit is DATA-FIRST: [views] (or [widgets] for a single unnamed view) declare the whole board, the kit wires the pack grid, gestures, and undo. This component adds the Angular idioms on top:

html
<grafloria-dashboard [views]="views" [(activeView)]="tab"
    (ready)="handle = $event" (layoutChange)="persist($event)">
  <ng-template grafloriaWidget="orders" let-data="data">…</ng-template>
</grafloria-dashboard>

snapshot() returns toJSON() — feed it back to [views]/[options] to rebuild the identical board (the kit's round-trip contract).

ts
@Component({
  selector: 'grafloria-dashboard',
  template: '',
  styles: [':host { display: block; position: relative; }'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class GrafloriaDashboardComponent implements AfterViewInit, OnDestroy

Use it as <grafloria-dashboard> in a template.

Inputs

NameTypeDefaultDescription
views?DashboardViewSpec[] | undefinedMulti-view (tabbed) board. Mutually exclusive with widgets.
widgets?DashboardWidgetSpec[] | undefinedSingle-view shorthand.
options?Partial<DashboardOptions>Board options: columns, gap, sizing, rtl, responsive, binder…
activeView?string | undefinedTwo-way active view id — the tab pattern. Two-way: also emits its change.
layout?'grid' | 'split' | undefinedLIVE SWITCHES — the toolbar toggles as inputs: applied at mount (over
sizing?'fit' | 'grow' | undefined
static?boolean | undefinedStatic board: the viewer's mode — no drag, no resize, no handles.

Outputs

  • activeViewChange
  • ready — The typed DashboardHandle, once the board is live.
  • layoutChange — Mirrors the kit's committed gestures (drag, resize, add, remove).

Properties

NameTypeDefaultDescription
viewsMulti-view (tabbed) board. Mutually exclusive with widgets.
widgetsSingle-view shorthand.
optionsBoard options: columns, gap, sizing, rtl, responsive, binder…
activeViewTwo-way active view id — the tab pattern.
layoutLIVE SWITCHES — the toolbar toggles as inputs: applied at mount (over [options]) and, when they change, through the handle (setLayout / setSizing / setStatic), never by remounting. 'split' is the DevExpress splitter tree; 'grid' the cell grid.
sizing
staticStatic board: the viewer's mode — no drag, no resize, no handles.
readyThe typed DashboardHandle, once the board is live.
layoutChangeMirrors the kit's committed gestures (drag, resize, add, remove).

Methods

  • constructor()
  • ngAfterViewInit(): void
  • getHandle(): DashboardHandle | undefined — The live handle (undefined before the first paint).
  • snapshot(): DashboardSnapshot | null — toJSON() — the whole board as plain data, ready to feed back in.
  • ngOnDestroy(): void

Was this page helpful?