Skip to main content

Interface: GanttOptionsBase<TProps>

Defined in: api/gantt.ts:126

Type Parameters​

TProps​

TProps = unknown

Properties​

a11yLabel?​

optional a11yLabel?: string

Defined in: api/gantt.ts:168

Live (S1.10). Default 'Gantt'; sets aria-label on the container.


barLabels?​

optional barLabels?: BarLabels

Defined in: api/gantt.ts:265

Live. Where the default bar label paints — ignored once barRenderer's output takes over a bar's content. Short form is a BarLabelPolicy (see its own doc for the five values); default 'fitBar'.


barRenderer?​

optional barRenderer?: BarRenderer

Defined in: api/gantt.ts:285

Live (S5.4). Customization ladder level 3 (plans/02 §4). One function, over every bar no variant paints. undefined returned from it keeps the library's own bar output.

A rule that names the rows it covers answers first, and the library's own summary rule is such a rule. So this never paints a row with children, which the library paints as a summary. To paint those too, claim them with a rule of your own: variants: [{ name: 'summary', when: (entry) => entry.hasChildren, paint }] — a consumer's rule outranks the library's.

To paint one kind of row and leave the rest alone, write a variant instead: variants: [{ name, when, paint }] (ADR 0018). That is what the retired per-kind map form was for, and a variant says which rows it covers in the same object.


capabilities?​

optional capabilities?: Capabilities

Defined in: api/gantt.ts:234

Live (S3). A gesture rule is a boolean or a per-entry predicate; edit takes the cell and may answer "no opinion" (#256). Both sit over the per-kind default table. Default {}: every gesture resolves off the default table alone. Assignment replaces the whole config; gantt.setCapabilityRule/clearCapabilityRule write one rule.


collapsed?​

optional collapsed?: readonly (string | RowId)[]

Defined in: api/gantt.ts:261

Live (S4.6). Collapsed row ids, loose on the way in. Default [].


connectorArrow?​

optional connectorArrow?: ConnectorArrow

Defined in: api/gantt.ts:272

Live. Where a connector wears an arrowhead: 'end' draws one at the arrival end, pointing into the target bar. 'none' draws none. Default 'end'.


connectorRouting?​

optional connectorRouting?: ConnectorRouting

Defined in: api/gantt.ts:269

Live. How connector routes dodge bars: { avoidBars, maxAvoidRows }. Default { avoidBars: true, maxAvoidRows: 200 }. A vertical across more rows than maxAvoidRows keeps its default place.


container​

container: string | HTMLElement

Defined in: api/gantt.ts:129

Element or CSS selector (plans/02 §2) — resolved by GanttShell; a selector matching nothing throws (#38).


convenienceChords?​

optional convenienceChords?: ConvenienceChords

Defined in: api/gantt.ts:255

Live (#262). A convenience chord's default binding (Mod+Z, Mod+A, Delete, the pans, the zoom/today chords) does the same job a button, a menu item, or a public method already does, so an app author who wants that chord for something else may turn it off — false for all of them, or a per-command map ({ 'freegantt.undo': false }) for one at a time. Default {}: every convenience chord is on. An obligation chord (Escape, the column keys, Mod+Arrow reach, Enter) is not in the map's key type and stays bound either way — [S5-A4], WCAG 2.1.1. The command itself stays reachable through commands.run(id) regardless.


dataset​

dataset: Dataset<TProps>

Defined in: api/gantt.ts:133

The Dataset this Gantt reads and writes, for its whole life. It binds TProps: a Gantt built on a Dataset<{ team: string }, { cost: number }> hands that same typed Dataset back from gantt.dataset, so a page never carries the pair by hand (#226).


dateLineLabelPlacement?​

optional dateLineLabelPlacement?: DateLineLabelPlacement

Defined in: api/gantt.ts:219

Live (#318 follow-up to #225). Where a Date line's own label paints, relative to the sticky header. 'belowHeader' (the default) anchors below the header, clear of its ticks — the shape #225 shipped. It can still meet a bar: the header stays put while the timeline pane scrolls, so whichever row's bar is scrolled to the top sits right under it. 'inHeader' anchors inside the header instead, where no row can ever scroll under it, at the cost of #225's own ticks collision when the label's x lands on one. A number is a px offset from the header's own top edge, for a caller who wants neither shorthand.


dateLines?​

optional dateLines?: readonly DateLineInput[]

Defined in: api/gantt.ts:211

Live (S1.13). Default []. Extra Date lines beside the today wrapper — status/as-of dates, sprint or holiday markers, project start/finish. No id: index-keyed, like Header bands. The wrapper's own line never gets a Date line label; give one of these a label instead.


gridCellRenderer?​

optional gridCellRenderer?: GridCellRenderer

Defined in: api/gantt.ts:303

Live (S5.4). Gantt-wide; a per-column GridColumn.columnRenderer (S5.7) wins over this for its own column. ctx.column.field lets one function branch per column.


gridColumns?​

optional gridColumns?: readonly GridColumnInput[]

Defined in: api/gantt.ts:257

Live (S4.3). Field keys in display order, plus per-Gantt overrides. Default ['name'].


gridResizable?​

optional gridResizable?: boolean

Defined in: api/gantt.ts:156

Live (#432). Default true: the splitter drags, and a column paints its resizer grip whenever its own resizable (default true) says so. false locks the whole grid pane — the splitter no longer drags and shows no resize cursor, and no column paints a grip, no matter what its own resizable says. Neither beforeGridWidthChange nor beforeGridColumnsChange fires for a gesture that can no longer arm: this is a lock, not a veto. A programmatic write still lands — gantt.gridWidth = 240, gantt.gridColumns = […] — the same way capabilities.move: false never stops a Dataset write. This is what keeps a gridWidth: 'fitColumns' pane from turning into a fixed px width on a stray drag.


gridWidth?​

optional gridWidth?: GridWidth

Defined in: api/gantt.ts:143

Live. The grid pane's width in px (S1.8), or 'fitColumns' (#157) to sit it on its columns' own right edge and keep it there as the columns change. Reads back in px either way. Default: --fg-grid-pane-width, fallback 160. Never wider than the columns (#139); a splitter drag turns 'fitColumns' back into the width it was dragged to.


headerRenderer?​

optional headerRenderer?: HeaderRenderer

Defined in: api/gantt.ts:305

Live (S5.4). Grid column header chrome (S5.7 paints through it).


headerTickRenderer?​

optional headerTickRenderer?: HeaderTickRenderer

Defined in: api/gantt.ts:207

Live. Draws and flags one header tick. undefined from the function keeps the library text. content replaces the tick's text. flags become data-flag tokens, for example 'off' for a day the consumer's own calendar calls non-working. The library adds 'today' itself, to the tick that holds today. The context holds band, tick, time, locale and rangeStart.


lanes?​

optional lanes?: LaneRule

Defined in: api/gantt.ts:202

Live. Which Rows hold Lanes: { count: (entry) => 2, of: (entry) => 0 }. A Row with n Lanes grows to 2 * --fg-lane-padding + n * --fg-lane-height + (n - 1) * --fg-lane-gap, unless rowHeight answers taller. An empty Lane still counts. The Row draws one empty .fg-lane guide per Lane. Lane size comes from the tokens only.


locale?​

optional locale?: LocalesArgument

Defined in: api/gantt.ts:172

Live. undefined = this Gantt names no override. The effective locale is this Gantt's own, then the Dataset's, then the runtime's own. Feeds header labels and screen-reader dates alike, with no bar remount.


minGridWidth?​

optional minGridWidth?: number

Defined in: api/gantt.ts:147

Live (#127). The floor a splitter drag clamps gridWidth to. Default 40 — wide enough for one narrow column, so a drag cannot take the pane to nothing by accident. It bounds the drag only: an explicit gridWidth = 0 still collapses the grid pane on purpose.


overscan?​

optional overscan?: Overscan

Defined in: api/gantt.ts:161

Live (plans/02, "The culling buffer (overscan)"). The culling buffer around the visible window: verticalRows whole rows above and below, horizontalPx px left and right of the timeline pane. A row or a bar inside the buffer stays mounted while it is one scroll step from view, so a small scroll never shows a bare frame. Default { verticalRows: 2, horizontalPx: 128 }.


plugins?​

optional plugins?: readonly ChromePlugin<unknown>[]

Defined in: api/gantt.ts:323

Live (S5.1, #404). Values a consumer imports (tooltips(), contextMenu({...})), never names in a table. Assignment diffs by id, then by object identity: a new id sets up, a missing one disposes, the same object is left alone, and a fresh object under an installed id replaces that occupant — so one assignment reconfigures a plugin. Default []. gantt.installPlugin/uninstallPlugin add or drop one plugin without restating the set.

ADR 0019: chrome only. A data half declares what shapes the Dataset's own construction, and a Dataset installs its plugins once — so a plugin with a data half installs on the Dataset instead. data?: never on this arm is what stops the wrong one compiling here.

This Gantt holds each chrome plugin with its own props erased (ChromePlugin, no type argument), for the same reason the Dataset does (DatasetOptions.plugins): a plugin's type argument names its own keys, not this Gantt's TProps, so Gantt<TaskProps> installs a ChromePlugin<MarkProps> whatever TaskProps and MarkProps are.


pointerActivation?​

optional pointerActivation?: PointerActivation

Defined in: api/gantt.ts:240

Live (#434). Default 'click': entryActivate fires on a plain click of a bar or a row's own background. 'dblclick' replaces click as the pointer trigger: a single click only selects, and a double-click activates once. On a grid cell, 'dblclick' activates only a cell capabilities refuses to write — a writable cell's double-click stays inlineEditing()'s own (the same editable-cell-wins precedence Enter already gives the editor).


rowHeight?​

optional rowHeight?: RowHeight

Defined in: api/gantt.ts:197

Live. Default: --fg-row-height. A number sets one height in px for every Row. A function answers per Row, once per layout pass, from the Row's Entry, kind and depth: rowHeight: (ctx) => (ctx.depth === 0 ? 48 : 40). Give a height above 0. Any other answer falls back to the default. Bars centre in their Row.


rowSource?​

optional rowSource?: RowSource

Defined in: api/gantt.ts:259

Live (S4.6). Default { source: 'entries', tree: true }.


scroll?​

optional scroll?: ScrollAxes

Defined in: api/gantt.ts:138

Bound scroll axes (D9) — pass the same ScrollAxis as x (or y) to two Gantt instances to sync that direction; omit a direction to keep it private. Independent of scale/preset/range/fit: a Gantt may share its scroll position, its scale, both, or neither.


selectedEntryIds?​

optional selectedEntryIds?: readonly (string | EntryId)[]

Defined in: api/gantt.ts:229

Live (S3; ADR 0010, ADR 0025, #212, #421). Entry ids, loose on the way in; assignment runs the same cancelable sequence a click runs. Default [].


snap?​

optional snap?: SnapSetting

Defined in: api/gantt.ts:244

Live. What a drag and a keyboard nudge snap to: { unit, increment }, 'tick' for one tick of whatever preset is showing, or 'none'. Omitted, the showing preset's own snap decides — which is 'tick' for every shipped preset.


theme?​

optional theme?: Theme

Defined in: api/gantt.ts:166

Live (S1.10). Default 'auto': follows the nearest ancestor's data-fg-theme pin, else prefers-color-scheme. ADR 0029: an app with its own dark-mode signal pushes the answer — gantt.theme = isDark ? 'dark' : 'light' in its own toggle — or pins data-fg-theme on a wrapper once. The library never asks the app; it only reads what the app writes.


tickLines?​

optional tickLines?: TickLines

Defined in: api/gantt.ts:192

Live. Default 'tick': one body line per finest header tick. { unit: 'week' } draws one line per week start under a day-wide header. 'none' draws no line.


todayHighlight?​

optional todayHighlight?: TodayHighlight

Defined in: api/gantt.ts:189

Live. Default false. Tints one finest header tick: the tick of the finest header band that holds today, or the preset tick when the preset has no header band. true paints it under the bars. { layer: 'overBars' } paints it over the bars, for opaque bars. Colour, border and minimum width: --fg-today-highlight-bg, --fg-today-highlight-border, --fg-today-highlight-min-width. Part: .fg-today-highlight.


todayLine?​

optional todayLine?: boolean | InstantInput

Defined in: api/gantt.ts:179

Live (S1.12/S1.13). Default true: reads the clock on each render, so the line moves on the next render, not on a clock tick. It goes stale on a page left open past midnight until something else repaints. An app that wants a live line reassigns this on its own timer, e.g. setInterval(() => { gantt.todayLine = new Date(); }, 60_000), held in a plugin's ctx.disposables. false: off, no clock read. An InstantInput pins it with no clock read at all. To keep today visible, pan with panToToday() or grow range.


todayLineAt?​

optional todayLineAt?: TodayLineAt

Defined in: api/gantt.ts:183

Live. Where the clock-driven today line sits inside today. 'now' is the clock instant. 'dayCenter' is the middle of today's calendar day in the Dataset zone, so a day column holds the line at its center. A pinned todayLine Instant ignores it. Default 'now'.


todayLineMarginTicks?​

optional todayLineMarginTicks?: number

Defined in: api/gantt.ts:223

Live. How many of the current preset's own ticks panToToday() leaves between the pane's left edge and where it lands align: 'start' (the default) — the Today line margin (CONTEXT.md). Default 2; 0 restores the old flush landing. No effect on align: 'center'.


tooltipRenderer?​

optional tooltipRenderer?: TooltipRenderer

Defined in: api/gantt.ts:307

Live (S5.4). Replaces a tooltip's body (S5.5's tooltips() feature).


variants?​

optional variants?: readonly EntryVariant<TProps>[]

Defined in: api/gantt.ts:300

Live (ADR 0018). One variant is one object: when says which rows wear it, items what shape it draws, paint how it looks, and can what you can do to it.

variants: [{ name: 'milestone', when: { milestone: true }, paint: milestoneBar, can: { resize: false } }]

Nothing stores a variant. It is a rule, resolved per Gantt, so two Gantts on one Dataset may paint the same row differently (I2). To pin one named row, write the data — declare a Field, update(id, { milestone: true }), and let when read it back.

The rules here win over every plugin's, whatever order the plugins installed in, and both win over core's own parent/leaf. Of two rules on this list that both answer yes for one row, the later one wins. Default [].


viewportGestures?​

optional viewportGestures?: ViewportGestures

Defined in: api/gantt.ts:247

Live (S3.7). Wheel zoom, shift+wheel pan, and keyboard pan. Default {}: every viewport gesture is on. false turns them all off. Does not gate zoomBy / panToDate.


zoomPresets?​

optional zoomPresets?: readonly PresetRef[]

Defined in: api/gantt.ts:226

The ordered set zoomIn/zoomOut step through, finest first (S1.12). Live. Default: the shipped ten-rung set.