Category: Spotfire ironpython api

Spotfire ironpython api

Welcome to my second IronPython post this week. If you missed the first one, start here. The first post introduced the code and provided information on how to modify it for other use cases.

This post builds on that by focusing on navigating the Spotfire API reference. The next post will then explain how and why the code is written. This code is grabbing a particular filter in the filter panel a checkbox filter and unchecking all the boxes. I am going to walk thru the API one reference at a time. Note, I am NOT going to explain exactly what the code is doing yet. The next post will explain what the code is doing and why.

Lines 1, 3, and 5 import namespaces and classes from the Spotfire. Filters namespace. Line 1 imports the Spotfire. If you are in the API referencethis namespace is 8 lines down at the highest level of the hierarchy.

Change Visualization Titles with IronPython

Application namespace as shown below. As you can see in the API reference, this namespace works with filters and filtering schemes in the filter panel. That is exactly what we are doing — modifying a filter. Line 7 references the Document classwhich is a class in the Spotfire.

Maison a louer gatineau

Application namespace. Now, the ActivePageReference gets or sets the currently active Pa ge. Line 7 essentially ends in the Filter Panel.

TIBCO support helped by showing me this flow chart. In order to access filters in the filter panel, you must use the TableGroup, even if there is only one table in your DXP.

Qmc5883l datasheet

TableGroup is the path to the FilterHandle, which accesses the filter. Groups in the filter panel would be accessed via TableGroup. So, line 11 hits three different classes and multiple properties.

This gets the Filter that fits this FilterHandle reference. If you click on Filter as circled belowit takes you to the Filter class. Line 13 is just as busy as Line Remeber, Line 1 created the filters object, which was equal to the Spotfire.Now that the JSON data has been converted into a string, it now can be converted into a stream format that can then be added into a Spotfire Data Table.

In order for the data table to appear inside the Spotfire Interface, it has to be added to the Document. Tables object. If the table already exists, it can be replaced. Attached is a working example dxp that uses this code. Hi, this is really good. Do you have any insight? I updated the script to add the reference to System. This is a wiki so anyone can correct it. Skip to main content. By: Hector Martinez.

Last updated: am Nov 14, Web Service.

Ford tractor lights wiring harness diagram diagram base website

Create New Page. IO import StreamReader import clr clr. AddReference 'System. Extensions' from System. Write textData writer. Flush stream. Seek 0, SeekOrigin. AddColumnNameRow 0 readerSettings. SetDataType 0, DataType. String readerSettings.

SetDataType 1, DataType. SetDataType 2, DataType. SetDataType 3, DataType. SetDataType 4, DataType. SetDataType 5, DataType. SetDataType 6, DataType. Date readerSettings.Keyword Index. Direct Link. CreateDataWriter Method.

spotfire ironpython api

CreateFileDataSource Method. Exit Method. GetService Method Type. Open Method Open Method String. Open Method DataSource. Save Method Save Method. Save Method String. AnalysisApplication Properties Document Property. DocumentMetadata Property. ImportContext Property. Toolbox Property. DocumentClosing Event. DocumentSaving Event. Exiting Event.

Update Method. Bookmark Properties CreatedBy Property. CreatedDate Property.

Call Tables with IronPython in Spotfire

Description Property. DisplayName Property. Id Property. IsBroken Property. ModifiedDate Property. CreatedDate Field. Description Field.Back to Extending Spotfire page. Scripts in analysis files that are shared via the library by licensed script authors are considered as trusted.

For security reasons you should always examine and approve a script that is not listed as trusted before executing it. The Spotfire add-in mechanism for C extensionswhich enables developers to extend the Spotfire feature set, is designed for the developers with access to a full-fledged development environment. Scripting does not replace this framework. It rather supplements the heavy-lifting programming with a light-weight option to configure Spotfire and extend its behaviors, a convenient and powerful means to solve simple as well as complex tasks.

Many of the script examples below are applicable also when creating custom tools and other extensions as embedded IronPython scripts or converted to C. It is not intended to be used "As Is" in a Production environment. Always test in a Development environment.

Make modifications to the script per your implementation specifications that suit best your business requirements. All scripts on this page are covered by this license. Hi Magnus, any chance you can add a link to an example I wrote? I created this one to help one of our users who is building a form for editing database records in Spotfire who knows why! Is there any functionality or existing IronPython-Script for the export of all changes being made to a specific data table in the data canvas?

Is this what you are looking for "Importing Python libraries from local directory"? I've been searching all over for an example on how we import additional packages e. Any ideas? Skip to main content. By: Magnus Rylander. Last updated: am Jun 01, Create New Page. Table of Contents 1 1. Feedback 4 Hi Magnus, any chance you can add a link to an example I wrote?

Learn IronPython for Spotfire…Navigating the API

Flag as Inappropriate. Janine, Is this what you are looking for "Importing Python libraries from local directory"? Haven't found what you are looking for? Ask a Question. Set Preferences SET.Last week, my post explained a script from the Spotfire IronPython Quick Reference website that will add a bar chart to a page with IronPython. The original code I discussed is shown below.

Unfortunately, when applied, this piece of code returned a blank visualization. I made modifications to get a different result, but my explanation of the code walked through the simple version.

This week, I want to get into the details of the modified code because it works differently. Because the two code snippets work different, I wanted to completely understand them. The snippet above uses a parameter to connect the code to the visualization.

The modified code calls the tables with IronPython. So, the code works down from the document, to the page, to the visual, to the specific visualization. In conclusion, the code snippet I discussed today achieved the same outcome as the previous piece of code. However, this code snippet used so much more of the API. How to change visualization titles with IronPython.

Your email address will not be published. Differences in the Code Because the two code snippets work different, I wanted to completely understand them. Code Summary First, line 1 and line 2 import the required classes from 2 different namespaces.

Visuals import BarChart from Spotfire. Application namespace. Data is a property of the Document class. Tables is a property of the DataManager class in the Spotfire. Data namespace. Next, line 4 creates an object called myVis that is a new bar chart.

spotfire ironpython api

ActivePageReference is a property of the Document class. Visuals is a property from the Page class in the Spotfire. AddNew is a method from the VisualCollection class in the Spotfire. BarChart is a class from the Spotfire. Visuals namespace. Namespaces Used Spotfire. Application loaded automatically Spotfire. Visuals Spotfire. Visuals Document class from Spotfire. Application Page class from Spotfire. Application Visual class from Spotfire.

Application VisualCollection class from Spotfire. Application VisualizationData class from Spotfire.

spotfire ironpython api

Visuals DataManager class from Spotfire. Data namespace Properties Used ActivePageReference is a property of the Document class Visuals property from the Page class Title property from the Visual class Tables property from the DataManager class Methods AddNew method from the VisualCollection class Developer created objects myVis table In conclusion, the code snippet I discussed today achieved the same outcome as the previous piece of code.Inheritance Hierarchy.

Creates an IndexSet as a copy of another IndexSet. Creates an IndexSet with specified capacity and initial content.

Quiet headset

Adds the index to the set. If the index is already in the set, nothing is changed. Note: the method changes the internal state of this IndexSet. Copies the content of the specified IndexSet into this one. Assigns the indexes from the specified array of indexes encoded as bits.

The length of the bits array must be Copy. Copies the complement of the specified IndexSet into this one. Determines whether this IndexSet contains all indexes of that IndexSet.

Copies the indexes in the set to the array starting at the offset. Deletes a range of index positions. Existing indexes from Copy. Tests if this IndexSet and that IndexSet have the same Capacity and contain exactly the same indexes. Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

Fills the specified array with the indexes encoded as bits. Gets the number of indexes in a subset defined by the startIndex and endIndex arguments. Makes room for more indexes. Existing indexes from startIndex and above are moved up. Determines whether this and that IndexSet have any indexes in common. Inverts the set.

Any index that was included in the set will be excluded and vice versa. Returns a new IndexSet that is the complement of the specified source set. Any index that is included in the source set will be excluded and vice versa. Gets the Nth smallest index.

Consume REST API's from Spotfire

Caution: This method is slow linear timeso you must ensure that your algorithm or the one using your algorithm never calls this method many times, which could result in quadratic time. Performs a logical OR between this and that IndexSet.In October last year, I committed to spending hours learning IronPython.

This code snippet shows you how to reference a visualization and change the title. Note, MyVis is an object created by the developer. MyVis could be anything you want it to be.

Because of that, you must also set it up as a parameter and map it to the visualization whose title you want to change. Title is a property of the Visual Class, which is part of the Spotfire. Application namespace. It is used to get or set the title, which is exactly what we are doing. The visual class represents a visualization or a text area.

If you want to modify a visualization, learn more about the visual class.

Dr. Spotfire - Using API Script Controls to Automate Shortcuts in Spotfire

To change the title, you must go into the code, which is actually harder than just double-clicking on the title to change it. To make it more useful, we can swap out the desired title a string with a connection to a property control.

In this second code snippet, I have incorporated an object called TitleInput that is mapped via a parameter to an input property control also called TitleInput. Separately, I added a button and connected it to the script. This was all pretty easy, although I will warn you I had issues with the parameter mapping dropping. I would map the parameters to the vis and the property control, only to see the mapping disappear later on.

That concludes this post on how to change visualization titles with IronPython. Your email address will not be published. They are still to ….

Volvo 240 oil pan removal

Code Snippet 1 Note, MyVis is an object created by the developer. Post Views: Tags: code snippet property controls spotfire api. Leave a Reply Cancel reply Your email address will not be published.

Author: Bashicage

thoughts on “Spotfire ironpython api

Leave a Reply

Your email address will not be published. Required fields are marked *