Jump to content
  • How to execute any IronPython script from the JavaScript (mashup API) in Spotfire®


    An IronPython script stored in a Spotfire® analysis can be configured to be triggered when a document property in changes. Using this technique we can execute IronPythin scripts from the JavaScript API. This allows a user to use the full power of the Spotfire scripting capabilities inside the JavaScript mashups. Note that scripting is not enabled on Spotfire Cloud web clients

    Introduction

    An IronPython script stored in a Spotfire® analysis can be configured to be triggered when a document property in changes. Using this technique we can execute IronPython scripts from the JavaScript API. This allows a user to use the full power of the Spotfire scripting capabilities inside the JavaScript mashups. Note that scripting is not enabled on Spotfire Cloud web clients.

    Step-by-step description:

    1. Define the selected IronPython script to execute when the property is updated.
    2. Create a new document property in the Spotfire Analyst client and define a script trigger.

       

      converted-file.thumb.png.d3a18639a2f257e39dbef63582109742.png

    3. Modify the property by calling the Document.setDocumentProperty method in the JavaScript code where you want the script to trigger.
    // Define the Spotfire handle
    var webPlayer = new spotfire.webPlayer.Application(server, customization);
    webPlayer.onOpened(onOpenedCallback);
    ...
    
    // Callback triggered after analysis is opened
    function onOpenedCallback(analysisDocument)
    {
    	// Modify property to trigger Spotfire script xyz
    	analysisDocument.setDocumentProperty("abc", "someValue");
    }
     
     
     

    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...