Skip to content

Data Model

Source code
src/components/gantt/GanttBasic.ts
import { defineCustomElements } from '@revolist/revogrid/loader';
defineCustomElements();
import { GanttPlugin, createDefaultTaskTableColumn } from '@revolist/gantt';
import { currentTheme } from '../composables/useRandomData';
import {
calendars,
dependencies,
ganttConfig,
initiallyHiddenColumnProps,
tasks,
taskTableColumnProps,
} from './gantt-basic-data';
import './gantt-basic.css';
const { isDark } = currentTheme();
const columns = taskTableColumnProps.map((prop) =>
createDefaultTaskTableColumn(prop),
);
export function load(parentSelector: string) {
const parent = document.querySelector(parentSelector);
if (!parent) {
return () => {};
}
const root = document.createElement('section');
const grid = document.createElement('revo-grid');
root.className = 'gantt-basic-demo';
grid.className = 'gantt-basic-grid';
grid.theme = isDark() ? 'darkCompact' : 'compact';
grid.hideAttribution = true;
grid.canMoveColumns = true;
grid.plugins = [GanttPlugin];
grid.gantt = ganttConfig;
grid.ganttCalendars = calendars;
grid.ganttDependencies = dependencies;
grid.columns = columns;
grid.hideColumns = [...initiallyHiddenColumnProps];
root.appendChild(grid);
parent.appendChild(root);
grid.source = tasks.map((task) => ({ ...task }));
return () => root.remove();
}

This page is for wiring the minimum data surface.

Required entry points on HTMLRevoGridElement:

  • gantt: project config (GanttPluginConfig)
  • source: flat task rows
  • ganttCalendars: CalendarEntity[]

Optional linked collections:

  • ganttDependencies: DependencyEntity[]
  • ganttResources: ResourceEntity[]
  • ganttAssignments: AssignmentEntity[]
  • ganttBaselines: BaselineSnapshot[]

Public shape is declared in:

  • packages/gantt/src/gantt/grid/gantt-plugin.types.ts
  • packages/gantt/src/gantt/core/domain.ts

Gantt reads task data from flat grid rows. Required fields are id, name, startDate, and either duration or endDate.

The public source row names match task-table editing conventions:

  • duration maps to internal duration.
  • percentDone maps to internal progressPercent.
  • taskMode maps to internal manuallyScheduled (manual or auto).
  • workflowStatus stores the optional authored workflow key: not-started, in-progress, done, or blocked.
  • status is calculated after scheduling from % Done, actual finish, scheduled dates, calendars, splits, and the project statusDate; it is not authored or editable.

When both duration and endDate are present, duration is the scheduling input and Gantt resolves endDate from startDate + duration. This matches task-table editing, where duration edits drive the finish date. Use endDate without duration when the finish date should be the authored input.

Projected grid rows remain display-ready. GanttGridRow.status is the calculated human-readable label, while GanttGridRow.statusKey and statusIndicator contain complete, on-schedule, late, or future-task. The authored workflow value is projected separately as workflowStatus and workflowStatusKey. Custom source fields are preserved by task id across recalculation and structural task changes unless the row is replaced without those fields.

Legacy source or JSON tasks that contain one of the old workflow values in status are migrated to workflowStatus when the new field is absent. New serialization emits only workflowStatus.

Task temporal fields (startDate, endDate, actualStartDate, actualFinishDate) accept:

  • ISO date: YYYY-MM-DD
  • UTC ISO datetime: YYYY-MM-DDTHH:mm:ss.sssZ

Runtime normalization rules:

  • Datetime input is preserved and used for intraday scheduling precision.
  • Date-only input is normalized to T00:00:00Z.

For new integrations, prefer explicit UTC datetime values when you need hour/minute planning behavior.

Server hydration uses the complete authored graph, custom task rows and optional backend revision. See Gantt queries and configuration types for GanttProjectData, atomic setProjectSnapshot, native polling and shared-view lifecycle, and Gantt commands for write receipts and compensating history. ProjectSnapshot.version remains the schema version.