gantt-renderer
    Preparing search index...

    Class GanttChart<TTaskData, TLinkData>

    Progressive-enhancement Gantt chart component. Validates input, builds a DOM tree, and renders a full interactive chart inside the given container element.

    const chart = new GanttChart(document.getElementById('chart')!, {
    locale: 'de-DE',
    theme: 'dark',
    });

    Type Parameters

    • TTaskData = never

      The type of the optional data property on tasks. Defaults to never.

    • TLinkData = never

      The type of the optional data property on links. Defaults to never.

    Implements

    Index
    • Constructs a new chart, builds the DOM, and wires internal event handling. Data must be loaded via update before the chart renders. Callbacks must be set via setCallbacks before user interactions are handled.

      Type Parameters

      • TTaskData = never

        The type of the optional data property on tasks. Defaults to never.

      • TLinkData = never

        The type of the optional data property on links. Defaults to never.

      Parameters

      • container: HTMLElement

        The host HTMLElement the chart will be appended to.

      • opts: GanttOptions = {}

        Configuration options.

      Returns GanttChart<TTaskData, TLinkData>

    • Collapses all expandable groups in the task tree.

      Parameters

      • fireCallback: boolean = false

        Whether to fire the onExpandCollapseAll callback. Default false.

      Returns void

      When the instance has been destroyed.

    • Removes the chart DOM and internal listeners, rendering the instance unusable. Subsequent calls to any public method will throw.

      Returns void

    • Expands all expandable groups in the task tree.

      Parameters

      • fireCallback: boolean = false

        Whether to fire the onExpandCollapseAll callback. Default false.

      Returns void

      When the instance has been destroyed.

    • Returns the current expand/collapse state of every expandable node (project tasks that have children). The result is ordered by the input task list order.

      Returns { id: number; open: boolean }[]

      An array of {id, open} objects for expandable nodes only.

      When the instance has been destroyed.

    • Programmatically selects or deselects a task.

      Parameters

      • id: number | null

        The task ID to select, or null to clear the selection.

      • fireCallback: boolean = false

        Whether to fire the onTaskClick callback. Default false.

      Returns void

      When the instance has been destroyed.

    • Merges the supplied options into the current configuration and re-renders only the panes affected by the changed options.

      Parameters

      • opts: Partial<GanttOptions>

        A partial GanttOptions object. Only the keys present in this parameter are updated; missing keys keep their previous values.

      Returns void

      When the instance has been destroyed.