Enable Data Change Insights and Use Related APIs
As an application or story designer, you can enable Data Change Insights for a story and its specific charts. As a developer, you can use related technical objects with APIs to allow for more activities, such as
saving a snapshot to capture any state of the analytic application or optimized story for data comparison.
If you're a viewer, for more information about Data Change Insights, see Subscribe to and View Data Change Insights.
Enable Data Change Insights
To enable Data Change Insights for an analytic application, from File in the edit time toolbar, select .
Similarly, to enable Data Change Insights for an optimized story, from File in the edit time toolbar, select .
Then, to enable data change insights for an individual chart in the story, in its Styling panel select Data
Change Insights under Quick Menus. In view time Data Change Insights
will then be available in the chart's context menu for viewers to select the subscription mode.
Note
To ensure that viewers receive notifications after subscription, you need to add an Export to PDF technical object.
Add a Data Change Insights Technical Object and Use Script APIs
You can add a Data Change Insights technical object and use related APIs to allow for more functionalities.
Procedure
-
To add a Data Change Insights technical object, in the Scripting section of the
Outline panel, (for analytic applications) choose right next to
Data Change Insights, or (for optimized stories) choose .
The right side panel opens with a default name DataChangeInsights_1 displayed. You can change the name there.
-
Select a version type of the Data Change Insights technical object:
- Auto Saved File Version (Default): The version of the Data Change Insights technical object
uses the timestamp when the application or story is saved.
- Manually Defined Version: Enter an integer for the version of the Data Change Insights
technical object.
If you change the version number or version type, the previous snapshots of applications or stories for data comparison
become invalid.
-
Select Done.
-
You can use APIs related to Data Change Insights to allow for more functionalities in view time.
Code Syntax
APIs for snapshots of applications or stories for data
comparison:
// Save a snapshot. One application or story can have only one snapshot per day, and the later one will override previous one within the same day.
saveSnapshot(): Boolean
// Gets a date list which represents there is a snapshot of application or story saved at that date. Maximum is 10 in backend service configuration.
listRecentSnapshotDates(maximumNumber?: integer): Date[]
// Compares current application or story state with a previous snapshot.
compareApplicationStateWithSnapshot(target: Date, options?: DataChangeInsightsComparisonOptions {
top?: Integer, // limit number of returned DataChangeInsight
}): DataChangeInsightsResult
// Compares snapshots of two different dates.
compareSnapshots(source: Date, target: Date, options?: DataChangeInsightsComparisonOptions {
top?: Integer, // limit number of returned DataChangeInsight
}): DataChangeInsightsResult
//Returns the version of Data Change Insights technical object.
getVersion(): integer
// Returns whether the Data Change Insights snapshot task is running.
isRunBySnapshotGeneration(): Boolean
Code Syntax
APIs for Data Change Insights
subscription:
// Opens subscription dialog. Not support on mobile.
openSubscriptionDialog();
//Sets the subscription level of chart.
setSubscriptionLevel(subscriptionLevel: DataChangeInsightsSubscriptionLevel): void
//Gets the subscription level chart.
getSubscriptionLevel(): DataChangeInsightsSubscriptionLevel
//Sets the value range for triggering data change insights.
setSubscriptionRange(subscriptionRange: DataChangeInsightsSubscriptionRange JSON): void
//Gets the value range for triggering data change insights.
getSubscriptionRange(): DataChangeInsightsSubscriptionRange