Skip to main content

Class: Gantt<TProps>

Defined in: api/gantt.ts:355

Type Parameters​

TProps​

TProps = unknown

Constructors​

Constructor​

new Gantt<TProps>(options): Gantt<TProps>

Defined in: api/gantt.ts:363

Parameters​

options​

GanttOptions<TProps>

Returns​

Gantt<TProps>

Accessors​

a11yLabel​

Get Signature​

get a11yLabel(): string

Defined in: api/gantt.ts:557

Returns​

string

Set Signature​

set a11yLabel(value): void

Defined in: api/gantt.ts:561

Parameters​
value​

string

Returns​

void


barLabels​

Get Signature​

get barLabels(): BarLabels

Defined in: api/gantt.ts:653

Live. gantt.barLabels = 'outside'. Where the default bar label paints — ignored once barRenderer's own output takes over a bar's content. Default 'fitBar'.

Returns​

BarLabels

Set Signature​

set barLabels(value): void

Defined in: api/gantt.ts:657

Parameters​
value​

BarLabels

Returns​

void


barRenderer​

Get Signature​

get barRenderer(): BarRenderer | undefined

Defined in: api/gantt.ts:662

Live (S5.4). Assigning repaints every bar with no remount (I8).

Returns​

BarRenderer | undefined

Set Signature​

set barRenderer(renderer): void

Defined in: api/gantt.ts:666

Parameters​
renderer​

BarRenderer | undefined

Returns​

void


canZoomIn​

Get Signature​

get canZoomIn(): boolean

Defined in: api/gantt.ts:1054

Returns​

boolean


canZoomOut​

Get Signature​

get canZoomOut(): boolean

Defined in: api/gantt.ts:1058

Returns​

boolean


capabilities​

Get Signature​

get capabilities(): Capabilities

Defined in: api/gantt.ts:999

Live (S3): re-resolves immediately, so a stricter rule hides a handle or refuses a gesture without waiting for the next pointer move.

Returns​

Capabilities

Set Signature​

set capabilities(next): void

Defined in: api/gantt.ts:1003

Parameters​
next​

Capabilities

Returns​

void


collapsed​

Get Signature​

get collapsed(): readonly RowId[]

Defined in: api/gantt.ts:806

Returns​

readonly RowId[]

Set Signature​

set collapsed(ids): void

Defined in: api/gantt.ts:810

Parameters​
ids​

readonly (string | RowId)[]

Returns​

void


commands​

Get Signature​

get commands(): CommandRegistry<TProps>

Defined in: api/gantt.ts:1163

S5.2: the one command registry. freegantt.* is the core namespace — core registers its own commands (collapse/expand, zoom, pan, selection, undo/redo, and keyboard navigation) before any plugin, so a plugin's own registration always wins for a shared id. run(id) silently no-ops when the command's when declines, the same posture as a disabled menu item. Read-only — register lives on the registry itself.

Returns​

CommandRegistry<TProps>


convenienceChords​

Get Signature​

get convenienceChords(): ConvenienceChords

Defined in: api/gantt.ts:1046

Live (#262): the next keystroke reads the new flags; no remount.

Returns​

ConvenienceChords

Set Signature​

set convenienceChords(next): void

Defined in: api/gantt.ts:1050

Parameters​
next​

ConvenienceChords

Returns​

void


dataset​

Get Signature​

get dataset(): Dataset<TProps>

Defined in: api/gantt.ts:528

The Dataset this Gantt was built on (#226). Call: gantt.dataset.on('change', …) for writes, or gantt.dataset.on('historyChange', …) for Undo/Redo chrome — an undo that only forgets steps fires no change. It carries the consumer's own TProps, so a helper that needs both objects takes the Gantt alone — mountGanttToolbar({ gantt, container }) — instead of taking the pair and trusting the caller to keep it matched.

Read-only on purpose. A Gantt binds its Dataset once, at construction: the shell seeds its viewport from those entries, subscribes to that Dataset's change, and hands it to every plugin and command context. Swapping it is a new capability — teardown and rebind of all of that — not a getter's mirror, so it stays out until something asks for it. Build a second Gantt instead.

Returns​

Dataset<TProps>


dateLineLabelPlacement​

Get Signature​

get dateLineLabelPlacement(): DateLineLabelPlacement

Defined in: api/gantt.ts:942

Returns​

DateLineLabelPlacement

Set Signature​

set dateLineLabelPlacement(placement): void

Defined in: api/gantt.ts:947

Live. See GanttOptions.dateLineLabelPlacement.

Parameters​
placement​

DateLineLabelPlacement

Returns​

void


dateLines​

Get Signature​

get dateLines(): readonly DateLine[]

Defined in: api/gantt.ts:932

Getter returns what was resolved (S4-1), same precedent as todayLine/range above: every placeAt reads back an Instant, so diffMs(gantt.dateLines[0].placeAt, now()) type-checks with no re-narrowing.

Returns​

readonly DateLine[]

Set Signature​

set dateLines(lines): void

Defined in: api/gantt.ts:938

Live (S1.13). Loose on the way in: every placeAt is read through the dataset's zone via toInstant.

Parameters​
lines​

readonly DateLineInput[]

Returns​

void


fit​

Get Signature​

get fit(): TimeScaleFit

Defined in: api/gantt.ts:899

How dense the time axis is — see TimeScaleFit. Default 'pane' fits the measured pane width. Every mode floors at the showing preset's minTickWidthPx: a range wider than the floor allows scrolls instead of compressing further. To see more, set a coarser preset — the library never picks one for you (#477).

Returns​

TimeScaleFit

Set Signature​

set fit(f): void

Defined in: api/gantt.ts:903

Parameters​
f​

TimeScaleFit

Returns​

void


formatContext​

Get Signature​

get formatContext(): FormatContext

Defined in: api/gantt.ts:647

Call: gantt.formatContext. The FormatContext a Grid cell, a bar label, and formatFieldValue all format through. Live: its locale is this Gantt's own, then the Dataset's, then the runtime's own. A caller that formats a value with its own Formatter, such as formatStartAndEnd, takes this instead of assembling a second { timeZone, locale }.

Returns​

FormatContext


gridCellRenderer​

Get Signature​

get gridCellRenderer(): GridCellRenderer | undefined

Defined in: api/gantt.ts:702

Live (S5.4). Assigning repaints every cell with no remount (I8).

Returns​

GridCellRenderer | undefined

Set Signature​

set gridCellRenderer(renderer): void

Defined in: api/gantt.ts:706

Parameters​
renderer​

GridCellRenderer | undefined

Returns​

void


gridColumns​

Get Signature​

get gridColumns(): readonly GridColumnInput[]

Defined in: api/gantt.ts:603

Returns​

readonly GridColumnInput[]

Set Signature​

set gridColumns(columns): void

Defined in: api/gantt.ts:607

Parameters​
columns​

readonly GridColumnInput[]

Returns​

void


gridResizable​

Get Signature​

get gridResizable(): boolean

Defined in: api/gantt.ts:595

Live (#432). false locks the splitter and every column's resizer grip; see the option's own doc for what "locks" means.

Returns​

boolean

Set Signature​

set gridResizable(resizable): void

Defined in: api/gantt.ts:599

Parameters​
resizable​

boolean

Returns​

void


gridWidth​

Get Signature​

get gridWidth(): number

Defined in: api/gantt.ts:565

Returns​

number

Set Signature​

set gridWidth(width): void

Defined in: api/gantt.ts:571

Live. 'fitColumns' stands until something else sets a width — a later assignment, or a splitter drag (#157).

Parameters​
width​

GridWidth

Returns​

void


headerRenderer​

Get Signature​

get headerRenderer(): HeaderRenderer | undefined

Defined in: api/gantt.ts:711

Live (S5.4).

Returns​

HeaderRenderer | undefined

Set Signature​

set headerRenderer(renderer): void

Defined in: api/gantt.ts:715

Parameters​
renderer​

HeaderRenderer | undefined

Returns​

void


hiddenGridColumns​

Get Signature​

get hiddenGridColumns(): readonly FieldKey[]

Defined in: api/gantt.ts:613

Which columns are hidden, by field key — what a column chooser reads to draw its own checkboxes. Reports the columns this Gantt was configured with, never a plugin's own.

Returns​

readonly FieldKey[]


locale​

Get Signature​

get locale(): LocalesArgument

Defined in: api/gantt.ts:907

Returns​

LocalesArgument

Set Signature​

set locale(l): void

Defined in: api/gantt.ts:913

Live (S1.12): every header label and every screen-reader date re-reads in the new locale, live, with no remount.

Parameters​
l​

LocalesArgument

Returns​

void


minGridWidth​

Get Signature​

get minGridWidth(): number

Defined in: api/gantt.ts:575

Returns​

number

Set Signature​

set minGridWidth(px): void

Defined in: api/gantt.ts:579

Parameters​
px​

number

Returns​

void


overscan​

Get Signature​

get overscan(): Overscan

Defined in: api/gantt.ts:585

Live (#435). gantt.overscan = { verticalRows: 4 }. See the option's own doc for what the buffer holds mounted.

Returns​

Overscan

Set Signature​

set overscan(o): void

Defined in: api/gantt.ts:589

Parameters​
o​

Overscan

Returns​

void


plugins​

Get Signature​

get plugins(): readonly ChromePlugin<unknown>[]

Defined in: api/gantt.ts:1125

Live (S5.1, #404). See GanttOptions.plugins. Assigning diffs by id: a new id sets up, a missing one disposes, and a fresh object under an installed id replaces that occupant — so gantt.plugins = [timeShading(next)] applies the new rules. Handing back the same object ([...gantt.plugins, extra]) runs nothing again.

This Gantt's own chrome plugins, and only those: a plugin installed on the Dataset stays off this list, because this Gantt cannot drop it (ADR 0019).

Returns​

readonly ChromePlugin<unknown>[]

Set Signature​

set plugins(next): void

Defined in: api/gantt.ts:1129

Parameters​
next​

readonly ChromePlugin<unknown>[]

Returns​

void


pointerActivation​

Get Signature​

get pointerActivation(): PointerActivation

Defined in: api/gantt.ts:1037

Live (#434): the next click or double-click reads the new option.

Returns​

PointerActivation

Set Signature​

set pointerActivation(next): void

Defined in: api/gantt.ts:1041

Parameters​
next​

PointerActivation

Returns​

void


preset​

Get Signature​

get preset(): ViewPreset

Defined in: api/gantt.ts:843

Returns​

ViewPreset

Set Signature​

set preset(ref): void

Defined in: api/gantt.ts:847

Parameters​
ref​

PresetRef

Returns​

void


range​

Get Signature​

get range(): TimeSpan | "fitDataset"

Defined in: api/gantt.ts:871

Getter returns the resolved TimeSpan — matching how Dataset reads EntryInput once at ingest.

This is the whole scrollable content extent, never the window. Read visibleSpan for what is on screen right now (issue #461).

Returns​

TimeSpan | "fitDataset"

Set Signature​

set range(r): void

Defined in: api/gantt.ts:877

Loose input (S1.12): a string, a Date, an epoch number or an Instant all work on start/end, read through the dataset's zone.

Parameters​
r​

"fitDataset" | { end: InstantInput; start: InstantInput; }

Returns​

void


resolvedTheme​

Get Signature​

get resolvedTheme(): ResolvedTheme

Defined in: api/gantt.ts:545

#330. Never 'auto' — the answer theme resolved to, once an ancestor's own pin (#271) or the OS actually settles it one way or the other. Computed on every read, never cached (#375), so it is always correct synchronously, including right after an ancestor's own pin changed. Fires themeChange when this answer moves — synchronously for a theme write or an OS flip, one task later for an ancestor's pin (GanttEventMap's own doc on themeChange).

Returns​

ResolvedTheme


rowSource​

Get Signature​

get rowSource(): ResolvedRowSource

Defined in: api/gantt.ts:760

Live (S4.6). Assigning re-resolves rows with no remount. The config object is a value (#187): assign a copy after a change, not the object already held.

Reads back resolved (#248 S4-2): filterPolicy and tree (Entries sources) come back filled, never omitted — a reader never has to know layout/'s own defaults. The resolve runs here, cached against the setter's own authored object, so two reads with no write between them stay === and the setter keeps assigning the plain RowSource the shell already compares by identity (#187) — resolving inside that comparison would break it instead.

To change one setting, spread the value you read back (#254). The resolved source extends the source you authored, so it assigns straight back with one key replaced. Pass undefined to turn a setting off:

const current = gantt.rowSource;
if (current.source === 'entries') {
gantt.rowSource = { ...current, sort: { field: 'name' } }; // sort on, filter kept
gantt.rowSource = { ...current, sort: undefined }; // sort off, filter kept
}

The source check is not ceremony. This getter returns a union of all three row sources, and a 'custom' source carries no filter, sort, filterPolicy or tree — it resolves its own rows, so it has nothing for those keys to act on. Narrowing tells the compiler which of the three you hold. Read nestsRows(gantt.rowSource) when the question is whether rows nest.

Hold no local copy of a setting this getter answers. gantt.rowSource.sort !== undefined is the one source of truth for "is a sort on", and a second copy beside it can disagree. The one thing this getter cannot answer is a value captured inside a filter closure — the closure comes back, the value it closed over does not.

Worked example and the toolbar use case: docs/07-row-source-updates.md.

Returns​

ResolvedRowSource

Set Signature​

set rowSource(next): void

Defined in: api/gantt.ts:771

Loose on the way in, same as every other setter (#248 S4-2): stores the RowSource exactly as authored, so the shell's own Object.is re-assignment check keeps comparing what the caller actually passed.

Parameters​
next​

RowSource

Returns​

void


selectedEntries​

Get Signature​

get selectedEntries(): readonly Entry<TProps>[]

Defined in: api/gantt.ts:988

The Selection as records — the bound dataset's Entry for each id in selectedEntryIds, in the same order. Re-reads the store on every access, so field edits show up without a selection change. An id that no longer exists in the store is skipped — for example after dataset.entries.remove left a stale id in the selection set. To change which entries are selected, assign selectedEntryIds; this getter is read-only.

Returns​

readonly Entry<TProps>[]


selectedEntryIds​

Get Signature​

get selectedEntryIds(): readonly EntryId[]

Defined in: api/gantt.ts:975

The Selection itself (ADR 0010, ADR 0025, #212, #421) — which Entries a click, the keyboard, or an assignment selected. The pane a click lands in picks the unit: the timeline selects the Entry the clicked bar draws, and the grid pane selects every Entry the row owns. Loose in, branded out — the same asymmetry dataset.entries.get/update/remove already ship. Live: assignment runs the same cancelable beforeSelectionChange → selectionChange sequence a click runs.

Returns​

readonly EntryId[]

Set Signature​

set selectedEntryIds(ids): void

Defined in: api/gantt.ts:979

Parameters​
ids​

readonly (string | EntryId)[]

Returns​

void


snap​

Get Signature​

get snap(): SnapSetting

Defined in: api/gantt.ts:854

What a drag snaps to right now: this Gantt's own setting when it states one, else the showing preset's, else 'tick'. A gesture resolves 'tick' against the preset it measures, so the answer follows a zoom without the caller writing anything.

Returns​

SnapSetting

Set Signature​

set snap(next): void

Defined in: api/gantt.ts:862

Live. Call: gantt.snap = { unit: 'day', increment: 2 }. It states the snap for this Gantt, over whatever preset is showing, and it survives a zoom. undefined hands the answer back to the preset. The old spelling — gantt.preset = { ...gantt.preset, snap } — built a one-off copy of a shipped preset, and the next zoomIn() threw the snap away with it.

Parameters​
next​

SnapSetting | undefined

Returns​

void


theme​

Get Signature​

get theme(): Theme

Defined in: api/gantt.ts:532

Returns​

Theme

Set Signature​

set theme(value): void

Defined in: api/gantt.ts:536

Parameters​
value​

Theme

Returns​

void


todayLine​

Get Signature​

get todayLine(): boolean | Instant

Defined in: api/gantt.ts:919

Getter returns what was resolved (S1.13, S4-1) — a boolean passes straight through; any other setting reads back the Instant it was pinned to, never the loose input.

Returns​

boolean | Instant

Set Signature​

set todayLine(on): void

Defined in: api/gantt.ts:925

Live (S1.12/S1.13). true/false pass straight through; any other InstantInput is read once through the dataset's zone and pins the line with no clock read.

Parameters​
on​

boolean | InstantInput

Returns​

void


todayLineMarginTicks​

Get Signature​

get todayLineMarginTicks(): number

Defined in: api/gantt.ts:951

Returns​

number

Set Signature​

set todayLineMarginTicks(ticks): void

Defined in: api/gantt.ts:956

Live. See GanttOptions.todayLineMarginTicks.

Parameters​
ticks​

number

Returns​

void


tooltipRenderer​

Get Signature​

get tooltipRenderer(): TooltipRenderer | undefined

Defined in: api/gantt.ts:720

Live (S5.4).

Returns​

TooltipRenderer | undefined

Set Signature​

set tooltipRenderer(renderer): void

Defined in: api/gantt.ts:724

Parameters​
renderer​

TooltipRenderer | undefined

Returns​

void


variants​

Get Signature​

get variants(): readonly EntryVariant<TProps>[]

Defined in: api/gantt.ts:676

Live (ADR 0018). Assigning replaces this Gantt's own variant list. Every row resolves its variant again, and a row whose rule no longer answers falls back to whatever wins next. A plugin's own variants stand, and they still lose to these.

A variant list is a value, not a mutable object (#187): push onto the array you already assigned and nothing repaints. Assign a copy — [...gantt.variants, myVariant].

Returns​

readonly EntryVariant<TProps>[]

Set Signature​

set variants(next): void

Defined in: api/gantt.ts:680

Parameters​
next​

readonly EntryVariant<TProps>[]

Returns​

void


viewportGestures​

Get Signature​

get viewportGestures(): ViewportGestures

Defined in: api/gantt.ts:1028

Live (S3.7): the next wheel or key reads the new flags; no remount.

Returns​

ViewportGestures

Set Signature​

set viewportGestures(next): void

Defined in: api/gantt.ts:1032

Parameters​
next​

ViewportGestures

Returns​

void


visibleSpan​

Get Signature​

get visibleSpan(): TimeSpan

Defined in: api/gantt.ts:891

The time span on screen right now (issue #461). range is the whole scrollable content extent instead. A pan, a zoom, a pane resize or a splitter drag moves this and leaves range alone.

Half-open, end exclusive, like every other stored span. Clamped to the content extent, because there is no time outside the content. Pixel-derived: an edge lands where the pane's own edge lands, mid-tick, never snapped.

This excludes the overscan buffer. DecorationContext.span includes it on purpose (layout/decoration.ts), so that one reads wider. The two are not interchangeable.

Returns​

TimeSpan


zoomPresets​

Get Signature​

get zoomPresets(): readonly ViewPreset[]

Defined in: api/gantt.ts:961

The ordered set zoomIn/zoomOut step through, finest first (S1.12). Live.

Returns​

readonly ViewPreset[]

Set Signature​

set zoomPresets(refs): void

Defined in: api/gantt.ts:965

Parameters​
refs​

readonly PresetRef[]

Returns​

void

Methods​

checkResolvedTheme()​

checkResolvedTheme(): ResolvedTheme

Defined in: api/gantt.ts:553

#394. The getter above is always correct. But re-parenting this Gantt's own container under a differently-pinned wrapper fires no themeChange — no data-fg-theme attribute changed for the library to notice. Call this right after such a move: it re-resolves now and fires themeChange if the answer moved, and returns that answer either way.

Returns​

ResolvedTheme


clearCapabilityRule()​

clearCapabilityRule(capability): void

Defined in: api/gantt.ts:1023

Call: gantt.clearCapabilityRule('resize'). It takes this Gantt's own rule off one gesture, so a plugin's kind defaults and the library's per-kind table answer it again. This is not setCapabilityRule('resize', true): true is a rule of its own, and it would also make a rolled-up parent and a milestone resizable. Clearing a gesture that carries no rule does nothing.

Parameters​

capability​

keyof Capabilities

Returns​

void


collapse()​

collapse(id): void

Defined in: api/gantt.ts:814

Parameters​

id​

string | RowId

Returns​

void


collapseAll()​

collapseAll(): void

Defined in: api/gantt.ts:835

Returns​

void


collapseStateOf()​

collapseStateOf(id): CollapseState | undefined

Defined in: api/gantt.ts:831

Call: gantt.collapseStateOf('p1') → 'collapsed' | 'expanded' | 'leaf'. A row a collapsed ancestor hides still answers its own state — the answer comes from the row tree, not from what the current frame draws. undefined for an id no current row holds: a removed row, or a stale id, so "no such row" stays apart from 'leaf'. A grouping header row answers by the same rule as any other row.

Parameters​

id​

string | RowId

Returns​

CollapseState | undefined


destroy()​

destroy(): void

Defined in: api/gantt.ts:1178

Returns​

void


expand()​

expand(id): void

Defined in: api/gantt.ts:818

Parameters​

id​

string | RowId

Returns​

void


expandAll()​

expandAll(): void

Defined in: api/gantt.ts:839

Returns​

void


filterRows()​

filterRows(filter): void

Defined in: api/gantt.ts:789

Call: gantt.filterRows((entry) => entry.read('team') === 'core') — "filter rows by this predicate, keep every other row-source setting." The shorthand for the read-back-and-spread pattern docs/07-row-source-updates.md teaches: reads gantt.rowSource back, replaces its filter key, and assigns the result, so a sort or a childrenAsSegments rule set through a different control survives untouched.

gantt.filterRows((entry) => entry.read('team') === 'core'); // filter on
gantt.filterRows(undefined); // filter off, sort kept

Throws CustomRowSourceNotFilterableOrSortableError when gantt.rowSource.source === 'custom' — that source resolves its own rows through resolve and carries no filter key to replace. Filter inside resolve instead.

Parameters​

filter​

RowFilter | undefined

Returns​

void


formatFieldValue()​

formatFieldValue(entry, key): string

Defined in: api/gantt.ts:639

Call: gantt.formatFieldValue(entry, 'cost'). The text a Field shows for one Entry, outside the grid — a status line, a CSV row, a tooltip. Reads the same door a Grid cell and a bar label read through, and follows gantt.locale live. Works for a Field with no column, a hidden column, and a compute Field. Throws UnknownFieldError for a key no Field declares. It reads through dataset.formatFieldValue with this Gantt's own locale first, then the Dataset's (#583), then the runtime's own.

Parameters​

entry​

Entry<TProps>

key​

FieldKey

Returns​

string


hasPlugin()​

hasPlugin(plugin): boolean

Defined in: api/gantt.ts:1145

Call: gantt.hasPlugin('harness.logging'). It answers whether that plugin is installed right now — what a toggle reads before it decides which verb to call. Identity is the id, so an object with an installed plugin's id answers true.

Parameters​

plugin​

string | ChromePlugin<unknown>

Returns​

boolean


hideGridColumn()​

hideGridColumn(field): void

Defined in: api/gantt.ts:623

Call: gantt.hideGridColumn('cost'). It takes one column off the screen. It leaves every other column alone, with the width and the order the user gave them. The caller restates no list and splices nothing back later. The hidden column stays in gridColumns as { field, hidden: true }, so a saved list restores it hidden. It raises the same cancelable beforeGridColumnsChange/gridColumnsChange pair a resize raises. It throws UnknownGridColumnError when no declared column names the field.

Parameters​

field​

FieldKey

Returns​

void


installPlugin()​

installPlugin(plugin): void

Defined in: api/gantt.ts:1138

Call: gantt.installPlugin(tooltips()). It installs one plugin and leaves every plugin already running alone, so a caller never restates the installed set to add to it. A plugin whose id is already installed throws DuplicatePluginIdError: this verb adds, and says so when there is nothing to add. To change an installed plugin's options, assign the list — gantt.plugins = [timeShading(next)] replaces the occupant of that id (#404).

Parameters​

plugin​

ChromePlugin

Returns​

void


off()​

off<K>(name, handler): void

Defined in: api/gantt.ts:1174

Type Parameters​

K​

K extends keyof GanttEventMap

Parameters​

name​

K

handler​

GanttEventHandler<K>

Returns​

void


on()​

on<K>(name, handler): Disposer

Defined in: api/gantt.ts:1170

Every plugin registration seam returns a Disposer that removes exactly its own registration (I2); on is that seam for a Gantt event. off(name, handler) still works too, for a caller that already held both. Calling the Disposer twice is safe, the same as calling off twice.

Type Parameters​

K​

K extends keyof GanttEventMap

Parameters​

name​

K

handler​

GanttEventHandler<K>

Returns​

Disposer


panToDate()​

panToDate(date, align?): void

Defined in: api/gantt.ts:1095

Pans so date sits at align within the pane (S1.12). Loose input: a string, a Date, an epoch number or an Instant all work, read through the dataset's zone.

Parameters​

date​

InstantInput

align?​

"start" | "center"

Returns​

void


panToToday()​

panToToday(align?): void

Defined in: api/gantt.ts:1104

Pans to now() (time/ owns the clock read, I10), leaving todayLineMarginTicks' worth of margin to the left at align: 'start' (the default) so the today line reads as "near the start" rather than sitting flush on the pane's own edge. align: 'center' is unaffected: already centred, a margin has nothing to add. Off the dataset's own range, panTo's clamp lands at whichever edge is closest instead of throwing.

Parameters​

align?​

"start" | "center"

Returns​

void


reveal()​

reveal(id): void

Defined in: api/gantt.ts:1113

Brings into view what this id draws (#295). An EntryId reveals every bar or marker that Entry paints right now, as one rectangle. A row that paints nothing at the named dates reveals those dates instead. An id the Dataset reads as neither throws RevealTargetNotFoundError (ADR 0010, #227). A plain string is legal. The Dataset resolves the reading; nothing reads the brand.

Parameters​

id​

string | EntryId

Returns​

void


setCapabilityRule()​

setCapabilityRule<K>(capability, rule): void

Defined in: api/gantt.ts:1014

Call: gantt.setCapabilityRule('resize', false). It writes the rule for one gesture and leaves the rules for the others exactly as they are. gantt.capabilities = { resize: false } drops them instead. A gesture rule is a boolean, or a predicate the resolver runs per entry — gantt.setCapabilityRule('move', (entry) => entry.kind !== 'milestone'). The edit rule is the one that takes a cell (#256): gantt.setCapabilityRule('edit', (entry, field) => (field === 'end' ? false : undefined)), where undefined leaves that cell to the rules below. It re-resolves at once, so a stricter rule hides a handle without waiting for the next pointer move.

Type Parameters​

K​

K extends keyof Capabilities

Parameters​

capability​

K

rule​

NonNullable<Capabilities[K]>

Returns​

void


showGridColumn()​

showGridColumn(field): void

Defined in: api/gantt.ts:629

Call: gantt.showGridColumn('cost'). Puts a hidden column back where it was, with the width it had. Showing a column that is already on screen changes nothing.

Parameters​

field​

FieldKey

Returns​

void


sortRows()​

sortRows(sort): void

Defined in: api/gantt.ts:800

Call: gantt.sortRows({ field: 'name' }) — the same read-back-and-spread shorthand filterRows above takes, for sort. gantt.sortRows(undefined) turns sorting off and keeps the current filter. Throws CustomRowSourceNotFilterableOrSortableError on a 'custom' source, for the same reason filterRows does.

Parameters​

sort​

RowSort | undefined

Returns​

void


toggleCollapse()​

toggleCollapse(id): void

Defined in: api/gantt.ts:822

Parameters​

id​

string | RowId

Returns​

void


uninstallPlugin()​

uninstallPlugin(plugin): void

Defined in: api/gantt.ts:1154

Call: gantt.uninstallPlugin(popup), or gantt.uninstallPlugin('harness.logging'). It disposes that one plugin and leaves the rest running. Identity is the id in both forms, the same identity the assignment form diffs by. A plugin nothing installs throws PluginNotInstalledError, so a misspelled id is not a silent no-op.

Parameters​

plugin​

string | ChromePlugin<unknown>

Returns​

void


variantFor()​

variantFor(entry): ResolvedVariant

Defined in: api/gantt.ts:697

The whole variant this Gantt resolved for one row (ADR 0018, ADR 0022 §3) — one door, and it answers the object, never a name a caller looks up again (itemsFor/paintFor do not exist; variantOf retired for the same reason). Call: gantt.variantFor(entry).name, or read .paint/.can/.css off the same answer.

Not entry.variant. An Entry belongs to a Dataset; a variant resolves per Gantt. I2 lets two Gantts on one Dataset paint the same row differently, so entry.variant would have to pick one answer and be wrong on the other Gantt.

The parameter keeps TProps; the answer does not — ResolvedVariant's own doc says why.

Parameters​

entry​

Entry<TProps>

Returns​

ResolvedVariant


zoomBy()​

zoomBy(factor, anchorX?): void

Defined in: api/gantt.ts:1078

Parameters​

factor​

number

anchorX?​

number

Returns​

void


zoomIn()​

zoomIn(anchorX?): void

Defined in: api/gantt.ts:1065

Next finer entry of zoomPresets; no-op at the finest (S1.12). anchorX defaults to pane centre. Steps the preset only — under fit: 'pane', density stays pane-fill until the floor bites.

Parameters​

anchorX?​

number

Returns​

void


zoomOut()​

zoomOut(anchorX?): void

Defined in: api/gantt.ts:1070

Next coarser entry of zoomPresets; no-op at the coarsest (S1.12).

Parameters​

anchorX?​

number

Returns​

void


zoomTo()​

zoomTo(pxPerMs, anchorX?): void

Defined in: api/gantt.ts:1074

Parameters​

pxPerMs​

number

anchorX?​

number

Returns​

void


zoomToSpan()​

zoomToSpan(span): void

Defined in: api/gantt.ts:1085

Resolves the density that makes span exactly fill the pane, then pans so span.start sits at the pane's left edge — both inside one batch, one notification (S1.12). Floored, so a span too long to be legible fills the pane only as far as the floor allows.

Parameters​

span​
end​

InstantInput

start​

InstantInput

Returns​

void