Insight Canvas Custom Events

Insights Canvas emits two custom events that you can listen for using JavaScript:

  • load
  • update - (only called when data changes)

You can target these events in your JavaScript to make dynamic changes to your Insights Canvas elements.

Load Event

The load event is emitted each time your Insight Canvas reloads (every five minutes). Use JavaScript to listen for this event and make dynamic changes to your canvas, if needed. For example:

$(document).ready(function(){
  var element = $("#exampleID");
  element.on("load", function(e){
  console.log("The canvas has reloaded", e);
  })
});

Update Event

The update event is emitted when your Insight Canvas reloads and data presented on the canvas has been updated since the last reload. This event is compatible with the following element types:

The update event sends the following parameters:

ParameterDescription
detail.newDataAn object of the changed data
detail.previousDataAn object of the data prior to the most recent update

Use JavaScript to listen for this event and make dynamic changes to your canvas, if needed. For example:

$(document).ready(function() {
  var element = $("#exampleID");
  element.on("update", function(e){
  //nps question example
  //below example will only work on modern browsers which support es6
  let { newData, previousData } = e.detail;
  if ( newData.nps_score > previousData.nps_score ) {
    element.css('color: green;');
  }
  console.log("The question's data has been updated", e);
  })
});


Basic Standard Market Research HR Professional Full Access Reporting
Free Individual Team & Enterprise
Feature Included In