Heat.js - Documentation - Binding Options - Custom Triggers

Below is a list of all the binding options custom triggers supported in Heat.js, which are fired when specific actions occur.

Download Now

v3.1.0 - 2nd Apr 2024
Option Triggers

For Rendering:

options.events.onRefresh( element ):

Fires when a rendered heat map is refreshed.
Parameter: element: Object - The element that was refreshed.

options.events.onBeforeRender( element ):

Fires before the rendering of an element.
Parameter: element: object - The DOM element that is going to be rendered.

options.events.onRenderComplete( element ):

Fires when the rendering of an element is complete.
Parameter: element: object - The DOM element that was rendered.

options.events.onDestroy( element ):

Fires when the element is destroyed (reverted back to its original state).
Parameter: element: object - The DOM element that was destroyed.

options.events.onDayToolTipRender( date, count ):

Fires when a tooltip for a specific day is rendered.
Parameter: date: Date - The date of the day.
Parameter: count: number - The number of activities for the day.




For Year Selections:

options.events.onBackYear( year ):

Fires when the year is moved back.
Parameter: year: number - The year that is now being viewed.

options.events.onNextYear( year ):

Fires when the year is moved forward.
Parameter: year: number - The year that is now being viewed.

options.events.onSetYear( year ):

Fires when the year is manually set.
Parameter: year: number - The year that is now being viewed.



For Day Clicking:

options.events.onDayClick( date, count ):

Fires when a day is clicked in the "map" or "chart" views.
Parameter: date: Date - The date that was clicked.
Parameter: count: number - The number of items for the date available.

options.events.onStatisticClick( colorRange ):

Fires when a statistic is clicked in the "statistics" view.
Parameter: colorRange: Object - The statistic color range details.

options.events.onWeekDayClick( dayNumber, dayCount ):

Fires when a statistic is clicked in the "statistics" view.
Parameter: dayNumber: number - The week day number.
Parameter: dayCount: number - The number of items for the weekday available.



For Data:

options.events.onAdd( element ):

Fires when data for an element is added.
Parameter: element: Object - The element that the data was added for.

options.events.onRemove( element ):

Fires when data for an element is reset.
Parameter: element: Object - The element that the data was reset for.

options.events.onReset( element ):

Fires when the data for an element is exported.
Parameter: element: Object - The element that the data was exported for.

options.events.onExport( element ):

Fires when the data for an element is exported.
Parameter: element: Object - The element that the data was exported for.

options.events.onImport( element ):

Fires when data for an element is imported.
Parameter: element: Object - The element that the data was imported for.

options.events.onDataFetch( element ):

Fires when an element requests a data pull (will return all the data in an object). When set, all data adding/removing is disabled, including Local Storage support.
Parameter: element: Object - The element that the data is being fetched for.
Returns: Object - An object of data.

options.events.onClear( element ):

Fires when a date for an element is cleared.
Parameter: element: Object - The element that the date was cleared for.

options.events.onUpdate( element ):

Fires when a date for an element is updated.
Parameter: element: Object - The element that the date was updated for.



For Views:

options.events.onTypeSwitch( type ):

Fires when the trend type being viewed is switched.
Parameter: type: string - The trend type selected.

options.events.onViewSwitch( view ):

Fires when the view is switched.
Parameter: view: string - The view selected.

options.events.onColorRangeTypeToggle( id, visible ):

Fires when a color range type is toggled on/off.
Parameter: id: string - The ID of the color range.
Parameter: visible: boolean - States if the color range is visible.



For Options:

options.events.onOptionsUpdate( element, options ):

Fires when a date for an element is updated.
Parameter: element: Object - The element that the options was updated for.
Parameter: options: Object - The updated options.