OrbPro2 a Cesium distribution

GanttTimeline

new Cesium.GanttTimeline(container, clock, options)

A Gantt-style timeline widget for visualizing temporal events organized in rows or categories. Provides interactive pan, zoom, and selection capabilities with full Cesium clock synchronization. This is a wrapper around the Svelte-based GanttTimeline component that provides a Timeline-compatible API for use in the Cesium Viewer.
Name Type Description
container Element | string The DOM element or ID that will contain the widget
clock Clock The Cesium Clock instance to synchronize with
options Object optional Optional configuration
Name Type Default Description
rows Array.<Object> [] optional Initial row definitions
events Array.<Object> [] optional Initial events
categoryEvents Array.<Object> [] optional Initial category events
focusRange Object optional Initial visible time range
Name Type Description
start Date | string | JulianDate optional Start of focus range
end Date | string | JulianDate optional End of focus range
styles GanttTimelineStyles optional Style customization options
autoScaleWithMultiplier boolean true optional When true, automatically adjusts the visible time range based on the clock multiplier to maintain a consistent visual animation rate
baseTimeSpanSeconds number 60 optional The base time span (in seconds) at 1x multiplier when autoScaleWithMultiplier is enabled. The visible span will be baseTimeSpanSeconds * |multiplier|
interactive boolean true optional When true, enables user pan, zoom, resize, tooltip, row, and event interactions.
Example:
const gantt = new GanttTimeline('container', viewer.clock, {
  rows: [
    { id: 'sat1', label: 'Satellite Alpha' },
    { id: 'sat2', label: 'Satellite Beta' }
  ],
  events: [
    {
      id: 'pass1',
      rowId: 'sat1',
      start: new Date('2024-01-15T10:00:00Z'),
      end: new Date('2024-01-15T10:15:00Z'),
      label: 'Ground Pass',
      color: '#4CAF50'
    }
  ],
  styles: {
    nowIndicatorColor: '#ff0000',
    nowIndicatorWidth: 3
  }
});

Members

Gets the parent container.
Gets or sets whether the gantt body is expanded (visible). When expanded, the gantt body with rows and events is shown below the header. When collapsed, only the timeline header with dates is visible.
Gets the time change event that fires when the user scrubs the timeline.

Methods

addEventListener(type, listener, useCapture)

Adds an event listener. Compatible with Cesium Timeline API.
Name Type Default Description
type string Event type ('settime')
listener function Event listener callback
useCapture boolean false optional Whether to use capture (ignored)
Appends category events to the timeline.
Name Type Description
items Object | Array.<Object> Events to append
Clears all events from the timeline.
Collapses the gantt timeline to show only the header with dates.
Destroys the widget.
Expands the gantt timeline to show the body with rows and events.
Returns true if this object was destroyed; otherwise, false.
Returns:
True if destroyed, false otherwise

removeEventListener(type, listener, useCapture)

Removes an event listener. Compatible with Cesium Timeline API.
Name Type Default Description
type string Event type
listener function Event listener callback
useCapture boolean false optional Whether to use capture (ignored)

replaceCategoryEvents(categoryEvents)

Replaces all category events immediately, bypassing Svelte prop batching.
Name Type Description
categoryEvents Array.<Object> Category event definitions
Resizes the widget to fit its container.

setAutoScaleWithMultiplier(enabled, baseTimeSpanSeconds)

Enables or disables auto-scaling of the timeline range based on the clock multiplier. When enabled, the visible time range adjusts proportionally to the multiplier, maintaining a consistent visual animation rate regardless of playback speed.
Name Type Description
enabled boolean Whether to enable auto-scaling
baseTimeSpanSeconds number optional Optional base time span in seconds at 1x multiplier (default: 60)
Example:
// Enable with default 60-second base span
gantt.setAutoScaleWithMultiplier(true);

// Enable with custom 30-second base span
gantt.setAutoScaleWithMultiplier(true, 30);

// At 1x multiplier, shows 30 seconds
// At 10x multiplier, shows 300 seconds
// At 100x multiplier, shows 3000 seconds

setCategoryEvents(categoryEvents)

Sets the category events for the timeline.
Name Type Description
categoryEvents Array.<Object> Category event definitions
Sets the events for the timeline.
Name Type Description
events Array.<Object> Event definitions
Sets the rows for the timeline.
Name Type Description
rows Array.<Object> Row definitions
Sets the style options for the timeline. Allows customization of colors, sizes, and other visual properties.
Name Type Description
styles GanttTimelineStyles Style customization options
Example:
gantt.setStyles({
  nowIndicatorColor: '#ff0000',
  nowIndicatorWidth: 3,
  containerBackground: 'rgba(0, 0, 0, 0.95)',
  gridLineColor: 'rgba(255, 255, 255, 0.2)'
});
Toggles the expanded/collapsed state of the gantt timeline.
Returns:
The new expanded state
Synchronizes the visible timeline state with the attached Cesium clock. The Svelte timeline already observes the provided clock directly, so the compatibility surface used by Viewer only needs a no-op implementation.
Zooms the timeline to show the specified time range. Compatible with Cesium Timeline API.
Name Type Description
startTime JulianDate Start of the time range
stopTime JulianDate End of the time range
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.