Optional CardCard display configuration for this group.
Defines how event cards are rendered.
If not set, uses the component's defaultCardConfig.
How data is provided to the timeline.
'array': Data is provided via the EntityObjects array (works with any object type)'entity': Data is loaded using MemberJunction's RunView (requires MJ core)'entity'
Field name for the event date. Used for chronological ordering and date display.
Optional DescriptionField name for the description/body text. Displayed in the card body when expanded.
Optional DisplayCustom color for this group's markers and accents.
Only used when DisplayColorMode is 'manual'.
Any valid CSS color value.
'#4caf50', 'rgb(66, 135, 245)', 'var(--primary-color)'
Color assignment mode.
'auto': System assigns colors based on group index'manual': Uses the color specified in DisplayColor'auto'
Optional DisplayCustom icon class (Font Awesome).
Only used when DisplayIconMode is 'custom'.
'fa-solid fa-check', 'fa-regular fa-calendar'
Icon display mode.
'standard': Uses a default icon based on the group index'custom': Uses the icon specified in DisplayIcon'standard'
Optional EntityThe MemberJunction entity name for this group.
Required when DataSourceType is 'entity'.
'Tasks', 'AI Agents', 'Users'
Pre-loaded data array.
Used when DataSourceType is 'array', or populated after loading when using 'entity'.
Optional EventCustom function to configure individual events. Allows per-event customization of icons, colors, and actions.
The source record
Configuration overrides for this event
group.EventConfigFunction = (task) => ({
icon: task.Priority === 'High' ? 'fa-solid fa-exclamation' : undefined,
color: task.IsOverdue ? '#f44336' : undefined,
actions: task.CanEdit ? [{ id: 'edit', label: 'Edit' }] : []
});
Optional FilterSQL WHERE clause filter for entity queries.
Only used when DataSourceType is 'entity'.
"Status = 'Open' AND Priority = 'High'"
Optional GroupHuman-readable label for this group. Used in legends, headers, or when distinguishing multiple groups.
'Completed Tasks', 'System Events', 'User Activities'
Optional IdField name for the unique record ID. Defaults to 'ID' or 'id' if not specified.
Optional ImageField name containing an image URL. When set, displays an image in the card.
Optional MaxMaximum number of records to load per batch. Used for virtual scrolling.
undefined (uses component's virtualScroll.batchSize)
Optional OrderSQL ORDER BY clause for entity queries.
Only used when DataSourceType is 'entity'.
'CreatedAt DESC', 'Priority ASC, DueDate DESC'
Optional SubtitleField name for the subtitle. Displayed below the title in smaller text.
Optional SummaryCustom function to generate the event summary/description.
Takes precedence over DescriptionFieldName.
The source record
HTML string or plain text to display
group.SummaryFunction = (task) => {
return `<strong>${task.Status}</strong>: ${task.Description}`;
};
Field name for the event title. This is the primary text displayed on each timeline card.
Gets the date from a record.
The source record
The date object
Gets the description from a record.
The source record
The description string, or undefined
Gets the effective card configuration, merging with defaults.
The merged card configuration
Gets the event configuration for a specific record.
The source record
The event configuration (from EventConfigFunction or defaults)
Gets the ID of a record in this group.
The source record
The record ID
Gets the image URL from a record.
The source record
The image URL, or undefined
Gets the subtitle from a record.
The source record
The subtitle string, or undefined
Gets the title from a record.
The source record
The title string
Extracts a field value from a record in this group.
The source record
The field name to extract
The field value
Static FromCreates a TimelineGroup from a plain array of objects.
This is a convenience method that sets up the group for array-based data.
Array of objects to display
Configuration for field mappings
Optional color?: stringOptional descriptionOptional groupOptional icon?: stringOptional idOptional imageOptional subtitleA configured TimelineGroup
const group = TimelineGroup.FromArray(myEvents, {
titleField: 'name',
dateField: 'eventDate',
descriptionField: 'details'
});
Static FromCreates a TimelineGroup from MemberJunction RunViewParams.
This is a convenience method for MemberJunction applications. It loads data immediately and returns a configured group.
Note: This method requires @memberjunction/core to be available.
It will throw an error if used in non-MJ applications.
RunView parameters for loading data
Optional EntityOptional ExtraOptional MaxOptional OrderA configured TimelineGroup with loaded data
const group = await TimelineGroup.FromView<TaskEntity>({
EntityName: 'Tasks',
ExtraFilter: "Status = 'Open'",
OrderBy: 'DueDate DESC'
});
group.TitleFieldName = 'Name';
group.DateFieldName = 'DueDate';
Configures a data source for the timeline component.
TimelineGroup defines how records are loaded, which fields to display, and how they should be styled. Multiple groups can be used to display different types of events on the same timeline.
Example: Basic usage with plain objects
Example: MemberJunction usage with BaseEntity
Example: With full configuration