Class

SpotfireObjectWithScripts

SpotfireObjectWithScripts()

This class describes a TIBCO Spotfire® object that will be scripted. Exposes the possibility to add custom scripts that will be applied.

Constructor

new SpotfireObjectWithScripts()

Methods

addCustomScript()

Adds a script to be applied after creation of the current object.

Examples

Modify the name of a datatable using a custom script after its creation

spotfireDocument.editor.loadDataTableFromUrl('A New Table', 'https://someuri/someSBDF.sbdf');
var currentDataTable = spotfireDocument.editor.lastElementCreated;
currentDataTable.addCustomScript('currentDataTable.Name = "My New Table (modified in custom)"');
spotfireDocument.editor.applyState()

Modify the name of a dataviz using a custom script after its creation

spotfireDocument.editor.addLineChart({ general: { title: "MyLineChart"}});
var currentDataviz = spotfireDocument.editor.lastElementCreated;
currentDataviz.addCustomScript('dataviz.Title = "My Line Chart (modified in custom)"');
spotfireDocument.editor.applyState()

Modify the name of a page using a custom script after its creation

spotfireDocument.editor.addPage('MyLastPage');
var currentPage = spotfireDocument.editor.lastElementCreated;
currentPage.addCustomScript('pageToModify.Title = "My Last Page (modified in custom)"');
spotfireDocument.editor.applyState()