Class

SpotfireDocumentEditor

SpotfireDocumentEditor(serverUrl, documentPath, onDocumentOpenedHandler)

Represents the state to be applied to the TIBCO Spotfire® document, using a collection of pages, markings and filters. The SpotfireDocumentEditor object works as a buffer of actions. Every action you add is pushed to the stack but not applied to the document. To do so you need to call applyState or applyStateAsync. The actions stack is then applied to the document and flushed. This means that the SpotfireDocumentEditor is not a representation of the actual Spotfire Document. This allows to apply all stacked actions at once and avoid unnecessary update of the actual Spotfire Document.

Constructor

new SpotfireDocumentEditor(serverUrl, documentPath, onDocumentOpenedHandler)

Parameters:
Name Type Description
serverUrl String

The TIBCO Spotfire® server URL to be connected to.

documentPath String

The document to be opened. Mandatory to use in a mashup using the TIBCO Spotfire® Web Player. Optional for the TIBCO Spotfire® Analyst.

onDocumentOpenedHandler onDocumentOpenedEventHandler

Handler to be executed on the openedDocument event.

Methods

addBarChart([barChartDescription]) → {this}

Adds a Bar Chart to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
[ barChartDescription ] Object

The bar chart description. See SpotfireBarChart for details.

this
Examples

Example of a trellised bar chart with multiple scales on the Value axis:

spotfireDocument.editor.addPage({title:'MyPage'}).addBarChart({
    general: { title: 'Bar Chart' },
    appearance: { layout: 'sideBySide' },
    trellis: {
        trellisMode: 'Panels',
        panelAxis: { columns: ['CODE'] }
    }
})
.addBarChart({
    general: { title: 'Bar Chart' },
    valueAxis: {
        individualScalingMode: 'Trellis',
        ranges: [{
            scale: 'SPB 07552',
            min: 0,
            max: 10
        }]
    }
})
.applyStateAsync();

Example of a colored Bar Chart, using a color scheme saved in the library:

spotfireDocument.editor.addBarChart({
    general: { title: 'Bar Chart' },
    data: { dataTable: 'Asinex' },
    colors: {
        columns: 'ALogP',
        templateLibraryPath: '/Discngine/Client Automation/Asinex_color_scheme_ALogP'
    }
}).applyStateAsync();

Example of a Bar Chart with labels:

spotfireDocument.editor.addBarChart({
    general: { title: 'Bar Chart' },
    labels: {
        showLabelsFor: "All",
        labelOrientation: "Vertical",
        completeBar: true,
        barSegments: true,
        labelType: "Percentage",
        maxNumberOfLabels: 20,
        barPercentageDecimals: 3
    }
}).applyStateAsync();

addBoxPlot(boxPlotDescription) → {this}

Adds a Box Plot to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
boxPlotDescription Object

The box plot properties. See SpotfireBoxPlot for details.

this
Example

Example of a colored Box Plot, using a color scheme saved in the library:

spotfireDocument.editor.addBoxPlot({
    data: { dataTable: 'Asinex' },
    colors: {
        columns: 'ALogP',
        templateLibraryPath: '/Discngine/Client Automation/Asinex_color_scheme_ALogP'
    }
}).applyStateAsync();

addColumnMatchings(columnRelations)

Adds a match between two columns from two different data tables.

Parameters:
Name Type Description
columnRelations Array.<SpotfireColumnRelation>

Array of column relation descriptions.

Example
spotfireDocument.editor
    .addColumnMatchings([
        {
            leftColumn: {
                tableName: 'firstDataTable',
                name: 'a column of firstDataTable',
                transformation: SpotfireColumnTransformation.integer
            },
            rightColumn: {
                tableName: 'secondDataTable',
                name: 'a column of secondDataTable',
                transformation: SpotfireColumnTransformation.integer
            }
        }
    ])
    .applyState();

// Same as
const columnRelation = new SpotfireColumnRelation(
  'firstDataTable',
  'a column of firstDataTable',
  'secondDataTable',
  'a column of secondDataTable',
  SpotfireColumnTransformation.integer,
  SpotfireColumnTransformation.integer);
spotfireDocument.editor.addColumnMatchings([columnRelation]);

addColumnRelations(columnRelationsDescription, getMethod, destinationArray)

Adds/replaces a relation between two columns of two data tables. Used to add data table relations and column matchings for adding linked data.

Parameters:
Name Type Description
columnRelationsDescription Array.<ColumnRelationDescription>

Array of descriptions of the relations between data columns.

getMethod function

The method to use when getting the corresponding relations.

destinationArray Array.<SpotfireColumnRelation>

The array of SpotfireColumnRelation where to push/modify the column relation.

Example
spotfireDocument.editor.loadDataTableFromUrl('oneTable',urlToImport)
.loadDataTableFromUrl('secondTable',urlToImport)
.addColumnRelations([
{
       leftColumn : {
          tableName: 'oneDataTable',
          name: 'Activity',
          transformation: SpotfireColumnTransformations.string
      },
      rightColumn : {
          tableName: 'secondDataTable',
          name: 'Activity',
          transformation: SpotfireColumnTransformations.string
      }
  }
]).applyState()

addColumnsFromUrl(importedDataAsColumnDescription) → {this}

Adds data to be imported as columns in a data table.

Parameters:
Name Type Description
importedDataAsColumnDescription ImportedDataAsColumnDefinition

The definition of the columns to import

urlSource String

The URL of the source containing the columns to be imported.

dataTableTarget String

The name of the data table in which new columns will be imported.

targetIdColumn String

The name of the column in the target data table to use for the matching.

sourceIdColumn String

The name of the column in the source data table to use for the matching.

[ sourceExtension ] String

The extension of the source file.

[ otherColumnsMatching ] Array.<ColumnMatching>

Array of the description of other column matches.

[].targetColumn String

The name of the column in the target data table to use for the matching.

[].sourceColumn String

The name of the column in the source data table to use for the matching.

[ replaceCommonColumns = false ] Boolean

Specifies whether the columns in the target data table should be replaced by the imported columns if they are common. Otherwise, the name of imported columns will be indexed.

columnsToReplace Array.<String>

Columns to be replaced by the imported data.

this

addCombinationChart(combinationChartDescription)

Adds a SpotfireCombinationChart to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
combinationChartDescription Object

The combination chart properties (see SpotfireCombinationChart for details).

Example

Example of a Combination Chart with labels:

spotfireDocument.editor.addCombinationChart({
    general: { title: 'Combination Chart' },
    labels: {
        showLabelsFor: 'Marked rows',
        showBarLabels: true,
        labelOrientation: 'Horizontal",
        showLineMarkerLabels: true,
        maxNumberOfLabels: 5
    }
}).applyStateAsync();

addCrossTable(crossTableDescription) → {this}

Adds a SpotfireCrossTable to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
crossTableDescription Object

The cross table properties (see SpotfireCrossTable for details).

this

addCustomScript(customScriptText, [atTheEnd]) → {this}

Adds an IronPython custom script to the SpotfireDocumentEditor, using the TIBCO Spotfire® IronPython API. This script can be executed after the last created element (DataTable, Page, Visualization) or at the very end of the script.

NB: in your custom script, if atTheEnd == false (default) you can directly access the latest element created by the editor using this convention:

  • dataviz: the variable containing the last visualization created,
  • pageToModify: the variable containing the last page created,
  • currentDataTable: the variable containing the last data table created.

NBB: if the SpotfireDocumentEditor does not create a data table, a page or a visualization when calling addCustomScript, the script will be executed with this context:

  • dataviz = None
  • pageToModify = Document.ActivePageReference
  • currentDataTable = None
Parameters:
Name Type Description
customScriptText String

The custom Iron Python script to execute.

[ atTheEnd = false ] Boolean

Specifies whether the script should be added at the end of the state or not. If true, the script will be executed at the very end of all instructions (Creation of Data Tables, Pages, Visualizations, etc.).

this
Examples

Modify the name of a data table after its creation:

spotfireDocument.editor
     .loadDataTableFromUrl('A New Table', 'https://anURI/aSBDF.sbdf')
     .addCustomScript('currentDataTable.Name = "My New Table (modified using a custom script)"')
     .applyState()

Modify the name of a line chart using a custom script and then add a bar chart using the API:

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

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

spotfireDocument.editor
     .addPage('MyLastPage')
     .addCustomScript('pageToModify.Title = "My Last Page (modified using a custom script)"')
     .applyState()

Modify the name of the current page using a custom script:

spotfireDocument.editor
     .addCustomScript('pageToModify.Title = "My Last Page (modified using a custom script)"')
     .applyState()

Modify the name of the page named 'MyPage' using a custom script added at the end of the state:

spotfireDocument.editor
     .addCustomScript('for page in Document.Pages:\n' +
                       '    if(page.Title == "MyPage"):\n' +
                       '        pageToModify = page\n' +
                       '    break\n' +
                       'pageToModify.Title = "My Last Page (modified using a custom script)"', true)
     .addPage('MyPage')
     .applyState()

addDataFunction(dataFunctionDescription) → {this}

Adds and executes a data function registered in the library in the current document.
Note that using this function in the Web Player, you may have an error if TIBCO Spotfire Statistics Services or TERR Service are not deployed. See support.tibco.com and docs.tibco.com for more details.

Parameters:
Name Type Description
dataFunctionDescription DataFunctionDescription

The description of the data function.

path String

Library path of the registered data function.

inputs Array.<Object>

Input parameters of the data function.

[].name String

Name of the input parameter.

[].handler SpotfireDataFunctionInputHandlers

Handler to use for the input parameter. Note that which input handlers are authorized depends on the type of the input parameter (Value, Column or Table).

columns String

Columns input handler. Authorized only if input parameter type is 'Table'.
Other accepted value: 'Columns'.

column String

Column input handler. Authorized only if input parameter type is 'Column'.
Other accepted value: 'Column'.

documentProperty String

Document property input handler. Authorized only if input parameter type is 'Value'.
Other accepted value: 'Document property'.

tableProperty String

Data table property input handler. Authorized only if input parameter type is 'Value'.
Other accepted values: 'Table property' and 'Data table property'.

columnProperty String

Column property input handler. Authorized only if input parameter type is 'Value'.
Other accepted values: 'Column property' and 'Data column property'.

expression String

Expression input handler.
Other accepted value: 'Expression'.

none String

No input handler.
Other accepted value: 'None'.

[].table String

Data table name. Must be filled in if handler is 'columns', 'column', 'tableProperty' or 'columnProperty'.

[].columns Array.<String>

List of column names. Can be filled in if handler is 'columns'. If not, use 'expression' to search for columns.

[].column String

Column name. Must be filled in if handler is 'column' or 'columnProperty'.

[].property String

Property name. Must be filled in if handler is 'documentProperty', 'tableProperty' or 'columnProperty'.

[].expression String

Expression to apply. Must be filled in if handler is 'expression'. If expression refers to table properties or columns, specify the data table. If expression is a simple string value, set the string in quotes. Can optionally be filled in if handler is 'columns', and will be considered as search expression.

outputs Array.<Object>

Output parameters of the data function.

[].name String

Name of the output parameter.

[].handler SpotfireDataFunctionOutputHandlers

Handler to use for the output parameter. Note that which output handlers are authorized depends on the type of the output parameter (Value, Column or Table).

table String

Table output handler.
Other accepted value: 'Data table'.

columns String

Columns output handler.
Other accepted value: 'Columns'.

rows String

Rows output handler.
Other accepted value: 'Rows'.

documentProperty String

Document property output handler. Authorized only if input parameter type is 'Value'.
Other accepted value: 'Document Property'.

tableProperty String

Data table property output handler. Authorized only if input parameter type is 'Value'.
Other accepted values: 'Table property' and 'Data table property'.

columnProperty String

Column property output handler. Authorized only if input parameter type is 'Value'.
Other accepted values: 'Column property' and 'Data column property'.

none String

No output handler.
Other accepted value: 'None'.

[].table String

Data table name. Must be filled in if handler is 'table', 'rows', 'columns', 'tableProperty' or 'columnProperty'.

[].column String

Column name. Must be filled in if handler is 'columnProperty'.

[].property String

Property name. Must be filled in if handler is 'documentProperty', 'tableProperty' or 'columnProperty'.

[ replaceIfExisting ] Boolean

Whether or not the data function must be updated if already in the analysis. Default to false.

[ refreshAutomatically ] Boolean

Whether or not to update the results from the data function automatically each time the input settings are changed. Default to false.

[ executeSynchronously ] Boolean

Whether or not to execute the data function synchronously. Default to false.

this
Example
spotfireDocument.editor.addDataFunction({
     path: 'Data Function/Add columns example',
     inputs: [
         {name: 'input1', handler: SpotfireDataFunctionInputHandlers.expression, expression: '[tableName1].[columnName]+${tableName1}.{propertyName}'},
         {name: 'input2', handler: SpotfireDataFunctionInputHandlers.column, table: 'tableName2', column: 'columnName'}
     ],
     outputs: [{name: 'output1', handler: SpotfireDataFunctionOutputHandlers.columns, table: 'tableName1'}]
}).applyState();

addDataTable(dataTableDescription) → {this}

Adds a data table to the current document. If the specified Data Table exists (Data Table with the same name), it will be updated with the new description.

Parameters:
Name Type Description
dataTableDescription DataTableDescription

The description of the data table.

name String

The name of the data table.

[ fromUrl ] String

The URL of the source.

[ sourceExtension ] String

The extension of the source file.

[ fromLibrary ] String

The Spotfire library path of the source.

[ fromInformationLink ] String

The information link to be used to load the data table.

[ informationLinkParameters ] String

The parameters of the information link.

[ addedColumnsDefinitions ] Array.<AddedColumnsDefinition>

Array of columns to add (calculated column, etc ...).

[].type SpotfireDataColumnsTypes

The type of the column to add from enum SpotfireDataColumnsTypes.

calculatedDataColumn String

Calculated data column type.

hierarchyDataColumn String

Hierarchy data column type.

[].name String

The name of the column to add.

[].expression String

The expression to be used to calculate the column.

[].levels String

The columns to be used as levels to create the hierarchy.

[ importedDataAsColumns ] Array.<ImportedDataAsColumnDefinition>

Array of columns to import.

[].urlSource String

The URL of the source containing the columns to be imported.

[].dataTableTarget String

The name of the data table in which new columns will be imported.

[].targetIdColumn String

The name of the column in the target data table to use for the matching.

[].sourceIdColumn String

The name of the column in the source data table to use for the matching.

[ [].sourceExtension ] String

The extension of the source file.

[ [].otherColumnsMatching ] Array.<ColumnMatching>

Array of the description of other column matches.

[].targetColumn String

The name of the column in the target data table to use for the matching.

[].sourceColumn String

The name of the column in the source data table to use for the matching.

[ [].replaceCommonColumns = false ] Boolean

Specifies whether the columns in the target data table should be replaced by the imported columns if they are common. Otherwise, the name of imported columns will be indexed.

[].columnsToReplace Array.<String>

Columns to be replaced by the imported data.

[ importedDataAsRows ] Array.<ImportedDataAsRowDefinition>

Array of rows to import.

[].urlSource String

The URL of the source containing the columns to be imported.

[].dataTableTarget String

The name of the data table in which new rows will be imported.

[ [].ignoredColumn ] Array.<String>

The list of columns to be ignored during importation.

[ [].rowSourceColumn ] String

The column that identifies the origin of the row.

[ [].rowSourceValue ] String

The value that identifies the source of the row from the imported source.

[ [].originalRowSourceValue ] String

The value that identifies the source of the row from the target data table.

[ [].mappings ] Array.<ColumnMatching>

The list of columns to map between imported rows to existing rows. If not set, all common columns are merged. If set, common columns will be created with an indexed name.

[].targetColumn String

The name of the column in the target data table to use for the matching.

[].sourceColumn String

The name of the column in the source data table to use for the matching.

[ transformationsOperations ] Array.<OperationDefinition>

Array of operations.

[].item Array.<AddedTransformationDefinition>

Array of data transformations.

[].type SpotfireDataTransformationTypes

The type of the transformation.

replaceColumn String

Transformation used to replace an existing column with a calculated column.
See setReplaceColumn. Other accepted value: 'Calculate and replace column'.

addCalculatedColumn String

Transformation used to create a new calculated column.
See setAddCalculatedColumn. Other accepted value: 'Calculate new column'.

renameColumns String

Transformation used to change the name of a set of columns according to an expression.
See setRenameColumns. Other accepted value: 'Change column names'.

changeDataType String

Transformation used to change the DataType of one or more columns.
See setChangeDataType. Other accepted value: 'Change data types'.

dataFunction String

Transformation using a previously registered data function.
See setDataFunction. Other accepted value: 'Data function'.

excludeColumns String

Transformation used to exclude a set of columns.
See setExcludeColumns. Other accepted value: 'Exclude columns'.

filterRows String

Transformation used to only keep the rows that match a given expression.
See setFilterRows. Other accepted value: 'Filter rows'.

pivot String

Transformation used to pivot tall-skinny data into short-wide data.
See setPivot. Other accepted value: 'Pivot'.

replaceSpecificValue String

Transformation used to replace values on specific rows, or on a single specific row.
See setReplaceSpecificValue. Other accepted value: 'Replace specific value'.

replaceValues String

Transformation used to replace all values in a column that match a given value.
See setReplaceValues. Other accepted value: 'Replace value'.

unpivot String

Transformation used to unpivot short-wide data into tall-skinny data.
See setUnpivot. Other accepted value: 'Unpivot'.

[].description Object

The description of the transformation to be added (see the methods set<TransformationType> of SpotfireDataTransformation for details).

[ properties ] Array.<DataTablePropertyDefinition>

Array of data table properties.

[].name String
[].value string | boolean | number
this

addDataTableColumns(dataTableName, addedColumnsDefinitions) → {this}

Adds columns to a data table.

Parameters:
Name Type Description
dataTableName String

The name of the data table.

addedColumnsDefinitions Array.<AddedColumnsDefinition>

The definition of columns to be added.

[].type SpotfireDataColumnsTypes

The type of the column to add from enum SpotfireDataColumnsTypes.

calculatedDataColumn String

Calculated data column type.

hierarchyDataColumn String

Hierarchy data column type.

[].name String

The name of the column to add.

[].expression String

The expression to be used to calculate the column.

[].levels String

The columns to be used as levels to create the hierarchy.

this
Example

Adds a calculated column and a hierarchy to a data table.

spotfireDocument.editor.addDataTableColumns('dummyTable', [
 {
     type: SpotfireDataColumnsTypes.calculatedDataColumn,
     name: 'MyCalculatedColumn',
     expression: 'SUM([Col1])'
 },
 {
     type: SpotfireDataColumnsTypes.hierarchyDataColumn,
     name: 'MyHierarchy',
     levels: ['[Type]', '[SubType]']
 }
 ]).applyStateAsync()

addDataTableProperty(dataTableName, dataTablePropertyName, dataTablePropertyValue)

Adds/updates a property in the specified data table.

Parameters:
Name Type Description
dataTableName String

The name of the data table to be updated.

dataTablePropertyName String

The name of the data table property to be added/updated.

dataTablePropertyValue String | Boolean | Number

The value of the data table property to be added/updated.

addDataTableRelations(dataTableRelations) → {this}

Adds a relation between two columns from two different data tables.

Parameters:
Name Type Description
dataTableRelations Array.<SpotfireColumnRelation>

Array of column relation descriptions.

this
Example

Example of a new data table relation (column names are escaped thanks to the brackets, "Value" is used as placeholder for <tableName>.<name> in the transformation):

spotfireDocument.editor
    .addDataTableRelations([
        {
            leftColumn: {
                tableName: 'firstDataTable',
                name: '[a column of firstDataTable]',
                transformation: 'Integer(Value)'
            },
            rightColumn: {
                tableName: 'secondDataTable',
                name: '[a column of secondDataTable]',
                transformation: 'Integer(Value)'
            },
            whenExisting: SpotfireWhenExistingBehaviors.replace
        }
    ])
    .applyState();

addDataTransformations(dataTableName, transformationsDescription) → {this}

Adds transformations on a given data table in a single block.

Parameters:
Name Type Description
dataTableName String

The name of the data table to transform.

transformationsDescription Array.<AddedTransformationDefinition>

Array of data transformation descriptions.

[].type SpotfireDataTransformationTypes

The type of the transformation.

replaceColumn String

Transformation used to replace an existing column with a calculated column.
See setReplaceColumn. Other accepted value: 'Calculate and replace column'.

addCalculatedColumn String

Transformation used to create a new calculated column.
See setAddCalculatedColumn. Other accepted value: 'Calculate new column'.

renameColumns String

Transformation used to change the name of a set of columns according to an expression.
See setRenameColumns. Other accepted value: 'Change column names'.

changeDataType String

Transformation used to change the DataType of one or more columns.
See setChangeDataType. Other accepted value: 'Change data types'.

dataFunction String

Transformation using a previously registered data function.
See setDataFunction. Other accepted value: 'Data function'.

excludeColumns String

Transformation used to exclude a set of columns.
See setExcludeColumns. Other accepted value: 'Exclude columns'.

filterRows String

Transformation used to only keep the rows that match a given expression.
See setFilterRows. Other accepted value: 'Filter rows'.

pivot String

Transformation used to pivot tall-skinny data into short-wide data.
See setPivot. Other accepted value: 'Pivot'.

replaceSpecificValue String

Transformation used to replace values on specific rows, or on a single specific row.
See setReplaceSpecificValue. Other accepted value: 'Replace specific value'.

replaceValues String

Transformation used to replace all values in a column that match a given value.
See setReplaceValues. Other accepted value: 'Replace value'.

unpivot String

Transformation used to unpivot short-wide data into tall-skinny data.
See setUnpivot. Other accepted value: 'Unpivot'.

[].description Object

The description of the transformation to be added (see the methods set<TransformationType> of SpotfireDataTransformation for details).

this
Example
spotfireDocument.editor
    .addDataTransformations('tableName', [
        {
            type: SpotfireDataTransformationTypes.unpivot,
            description: {
                identityColumns: ['firstColumnToPass', 'secondColumnToPass'],
                valueColumns: ['firstColumnToTransform', 'secondColumnToTransform'],
                categoryColumn: {name: 'Category', type: 'String'},
                resultColumn: {name: 'Result', type: SpotfireDataTypes.string}
            }
        }, {
            type: SpotfireDataTransformationTypes.pivot,
            description: {
                identityColumns: ['firstColumnToPass'],
                categoryColumns: ['Category'],
                valueColumns: [{name:'Result', aggregation:'Sum'}],
                transferColumns: [{name:'secondColumnToPass', aggregation: 'UniqueConcatenate'}],
                resultNamingExpression: '%M(%C)',
                transferNamingExpression: '%A(%T)'
            }
        }
    ])
    .applyState();

addFilter(filterDescription)

Adds a filter in the current state to be applied to the current document.

Parameters:
Name Type Description
filterDescription FilterDescription

The description of the filter.

type SpotfireFiltersTypes

The type of the filter.

rangeFilter String

The Range Filter type, see SpotfireRangeFilter for details on this filter.

itemFilter String

The Item Filter type, see SpotfireItemFilter for details on this filter.

radioButtonFilter String

The Radio Button Filter type, see SpotfireRadioButtonFilter for details on this filter.

checkBoxFilter String

The Check Box Filter type, see SpotfireCheckBoxFilter for details on this filter.

textFilter String

The Text Filter type, see SpotfireTextFilter for details on this filter.

listBoxFilter String

The List Box Filter type, see SpotfireListBoxFilter for details on this filter.

[ filteringScheme ] String

The name of the filtering scheme in which the filter is added. If not specified, the active filtering scheme will be used.

[ dataTable ] String

The name of the data table on which the filter is applied. If not specified, the active data table will be used.

column String

The name of the column on which the filter is applied.

[ reset = true ] Boolean

Specifies whether the filter should be reset before applying the value.

value Object

The value to be set. The format of this parameter depends on the SpotfireFiltersTypes.

[ valueDataRange ] Object

A range definition to use the RangeFilter. For RangeFilter

[ min ] string | number

The minimum value of the range.

[ max ] string | number

The maximum value of the range.

[ includeEmpty ] boolean

Specifies if the filter must include empty values.

[ visualScale ] string

Specifies the visual scale for values.

[ checkBoxModeEnabled ] boolean

Indicates if the checkBox is enabled. For ListBoxFilter.

[ height ] number

The height of the list box. For ListBox Filter.

[ includeAllValues ] boolean

Specifies if all values must be included.

[ searchExpression ] string

Specifies the search expression. For ListBox Filter.

[ searchFieldVisible ] boolean

Specifies if the search fields is visible in the list box. For ListBox Filter.

Example
spotfireDocument.editor.addFilter({
    type: "Range Filter",
    column: "ALogP",
    value: {
        min: "1",
        max: "5"
    },
    valueDataRange: {
        min: "0",
        max: "8"
    },
    includeEmpty: true
}).applyState();

addFiltering(filteringName)

Adds a filtering scheme in the current state to be applied to the current document.

Parameters:
Name Type Description
filteringName string

The name of the filtering scheme to be added.

addFilterings(arrayOfFilteringNames)

Adds one or more filtering schemes in the current state to be applied to the current document.

Parameters:
Name Type Description
arrayOfFilteringNames Array.<string>

The array of filtering schemes to be added.

addGraphicalTable(graphicalTableDescription) → {this}

Adds a SpotfireGraphicalTable to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
graphicalTableDescription Object

The graphical table properties (see SpotfireGraphicalTable for details).

this

addHeatMap(heatMapDescription) → {this}

Adds a SpotfireHeatMap to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
heatMapDescription Object

The heat map properties (see SpotfireHeatMap for details).

this

addKPIChart(kpiChartDescription) → {this}

Adds a SpotfireKPIChart to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
kpiChartDescription Object

The KPI chart properties (see SpotfireKPIChart for details).

this

addLineChart(lineChartDescription) → {this}

Adds a SpotfireLineChart to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
lineChartDescription Object

The line chart properties (see SpotfireLineChart for details).

this
Examples

Example of a colored Line Chart, using a color scheme saved in the library:

spotfireDocument.editor.addLineChart({
    general: { title: 'Line Chart' },
    data: { dataTable: 'Asinex' },
    colors: {
        columns: 'ALogP',
        templateLibraryPath: '/Discngine/Client Automation/Asinex_color_scheme_ALogP'
    }
}).applyStateAsync();

Example of a Line Chart with labels:

spotfireDocument.editor.addLineChart({
    general: { title: 'Line Chart' },
    labels: {
        showLineIdentifier: true,
        showIndividualValues: true,
        showLabelsFor: 'Marked rows',
        maxNumberOfLabels: 5
    }
}).applyStateAsync();

addMapChart(mapChartDescription) → {this}

Adds a SpotfireMapChart to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
mapChartDescription Object

The map chart properties (see SpotfireMapChart for details).

this
Example

Example of a Map Chart with map and marker layers:

spotfireDocument.editor.addMapChart({
    general: { title: 'Map Chart', autoConfigureLayers: false },
    interactiveLayer: { type: 'MarkerLayer', name:'Second Layer' },
    layers: [
        {
            type: SpotfireMapChartLayers.standardTileLayer,
            general: { name: 'First Layer' },
            map: { type: 'Rich map' }
        },
        {
            type: SpotfireMapChartLayers.markerLayer,
            general: { name: 'Second Layer' },
            data: { dataTable: 'Asinex' },
            positioning: {
                xAxis: { columns: ["Longitude"] },
                yAxis: { columns: ["Latitude"] },
                method: SpotfirePositioningMethods.longitudeLatitude
            }
        }
    ]
}).applyStateAsync();

addMarking(markingDescription)

Adds or updates a marking in the current Spotfire document.

Parameters:
Name Type Description
markingDescription MarkingDescription

Description of the marking to be created/modified.

name String

The name of the marking.

[ color ] String | MarkingColor

The color of the marking either as a MarkingColor object or as a hexadecimal code or as a color name.

[ a ] number

The alpha component of the color. Must be between 0 and 255.

[ r ] number

The red component of the color. Must be between 0 and 255.

[ g ] number

The green component of the color. Must be between 0 and 255.

[ b ] number

The blue component of the color. Must be between 0 and 255.

addMarkings(arrayOfMarkingDescription)

Adds or updates one or more markings to the current state to be applied to the current document.

Parameters:
Name Type Description
arrayOfMarkingDescription Array.<MarkingDescription>

Array of marking descriptions.

[].name String

The name of the marking.

[ [].color ] String | MarkingColor

The color of the marking either as a MarkingColor object or as a hexadecimal code or as a color name.

[ a ] number

The alpha component of the color. Must be between 0 and 255.

[ r ] number

The red component of the color. Must be between 0 and 255.

[ g ] number

The green component of the color. Must be between 0 and 255.

[ b ] number

The blue component of the color. Must be between 0 and 255.

addPage(pageDescription) → {this}

Adds a page to the current state to be applied to the current Spotfire document.
If the page does not exist, it is created with Web Panel shown by default.
If the page exists, it is edited by changing tile mode or panels visibility.

Parameters:
Name Type Description
pageDescription String | PageDescription

The title or the complete description of the page to be added.

title String

The title of the page.

[ tileMode ] String

The tile mode that defines the layout of the page.

[ panels ] Object

Specifies whether the panels should be visible using key<SpotfirePanelTypes>:value<Boolean> objects.
Using this method, the panels will be docked.

[ customLayout ] String

Script to apply a custom layout instead of tile mode.
In the script, the layout is in the object "layout", and the list of visualizations for the page in the object "visuals". The method getVisual can be used to retrieve a visualization by its name and type. See TIBCO Spotfire API - VisualTypeIdentifiers for the list of available types and TIBCO Spotfire API - LayoutDefinition for layout examples.

[ showWebPanel ] Boolean

Obsolete. Specifies whether the Web Panel should be visible.

this
Examples

Adds a new page to the current Spotfire document with Filters Panel opened and Web Panel closed:

spotfireDocument.editor.addPage({
    title: 'MyPage',
    panels: {webPanel: false, filters: true}
}).applyState()

Adds a new page to the current Spotfire document with 4 visualizations and a custom layout.

const layoutScript = `
# For the getVisual method, a unique combination of visualization name and type is required.
layout.BeginStackedSection();
layout.BeginSideBySideSection();
layout.Add(getVisual(visuals, 'Main', VisualTypeIdentifiers.ScatterPlot));
layout.Add(getVisual(visuals, None, VisualTypeIdentifiers.BarChart));
layout.Add(getVisual(visuals, 'Additional', None));
layout.EndSection();
layout.Add(getVisual(visuals, 'Main', VisualTypeIdentifiers.Table));
layout.EndSection();
`
spotfireDocument.editor
    .addPage({ title: 'MyPage', customLayout: layoutScript })
    .addTable({ general: { title: 'Main' } })
    .addScatterPlot({ general: { title: 'Main' } })
    .addScatterPlot({ general: { title: 'Additional' } })
    .addBarChart({ general: { title: 'Drill-Down' } })
.applyStateAsync();

addParallelCoordinatePlot(parallelCoordinatePlotDescription) → {this}

Adds a SpotfireParallelCoordinatePlot to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
parallelCoordinatePlotDescription Object

The parallel coordinate plot properties (see SpotfireParallelCoordinatePlot for details).

this
Example

Example of a Parallel Coordinate Plot with labels:

spotfireDocument.editor.addParallelCoordinatePlot({
    general: { title: 'Parallel Coordinate Plot' },
    labels: {
        showLineIdentifier: true,
        showIndividualValues: true,
        showLabelsFor: 'Marked rows',
        maxNumberOfLabels: 5
    }
}).applyStateAsync();

addPieChart(pieChartDescription) → {this}

Adds a SpotfirePieChart to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
pieChartDescription Object

The pie chart properties (see SpotfirePieChart for details).

this
Example

Example of a Pie Chart with labels:

spotfireDocument.editor.addPieChart({
    general: { title: 'Pie Chart' },
    labels: {
        showSectorPercentage: true,
        showSectorValue: true,
        showSectorCategory: true,
        labelPosition: 'Outside pie',
        showLabelsFor: 'Marked rows',
        maxNumberOfLabels: 5,
        sectorPercentageThreshold: 3,
        sectorPercentageDecimals: 2
    }
}).applyStateAsync();

addRowsFromUrl(importedDataAsRowsDescription)

Add data from url as rows in a data table.

Parameters:
Name Type Description
importedDataAsRowsDescription ImportedDataAsRowDefinition
urlSource String

The URL of the source containing the columns to be imported.

dataTableTarget String

The name of the data table in which new rows will be imported.

[ ignoredColumn ] Array.<String>

The list of columns to be ignored during importation.

[ rowSourceColumn ] String

The column that identifies the origin of the row.

[ rowSourceValue ] String

The value that identifies the source of the row from the imported source.

[ originalRowSourceValue ] String

The value that identifies the source of the row from the target data table.

[ mappings ] Array.<ColumnMatching>

The list of columns to map between imported rows to existing rows. If not set, all common columns are merged. If set, common columns will be created with an indexed name.

[].targetColumn String

The name of the column in the target data table to use for the matching.

[].sourceColumn String

The name of the column in the source data table to use for the matching.

addScatterPlot(scatterPlotDescription) → {this}

Adds a SpotfireScatterPlot to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
scatterPlotDescription Object

The scatter plot properties (see SpotfireScatterPlot for details).

this
Examples

Example of a colored Scatter Plot, using a color scheme saved in the library:

spotfireDocument.editor.addScatterPlot({
    general: { title: 'Scatter Plot' },
    data: { dataTable: 'Asinex' },
    colors: {
        columns: 'ALogP',
        templateLibraryPath: '/Discngine/Client Automation/Asinex_color_scheme_ALogP'
    }
}).applyStateAsync();

Example of a Scatter Plot with Drawing Order properties (column names are escaped thanks to the brackets):

spotfireDocument.editor.addScatterPlot({
    data: { dataTable: 'Asinex' },
    drawingOrder: {
        columns: ['[CLUSTER]', '[IDNUMBER]'],
        reverse: true
    }
}).applyStateAsync();

Example of a Scatter Plot with basic text labels:

spotfireDocument.editor.addScatterPlot({
    general: { title: 'Scatter Plot' },
    data: { dataTable: 'Asinex' },
    labels: {
        labelBy: 'CLUSTER',
        showAs: {
            type: 'Text'
        }
    }
}).applyStateAsync();

Example of a Scatter Plot with images from URL as labels:

spotfireDocument.editor.addScatterPlot({
    general: { title: 'Scatter Plot' },
    data: { dataTable: 'Asinex' },
    labels: {
        labelBy: 'IDNUMBER',
        showLabelsFor: 'All',
        maxNumberOfLabels: 5,
        centerLabelsOnItems: true,
        showEmptyLabels: true,
        showAs: {
            type: 'Image from URL',
            url: '{$}'
        },
        size: 50
    }
}).applyStateAsync();

addScatterPlot3D(scatterPlot3DDescription) → {this}

Adds a SpotfireScatterPlot3D to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
scatterPlot3DDescription Object

The scatter plot 3D properties (see SpotfireScatterPlot3D for details).

this
Example

Example of a Scatter Plot 3d with labels:

spotfireDocument.editor.addScatterPlot3D({
    general: { title: 'Scatter Plot 3D' },
    data: { dataTable: 'Asinex' },
    labels: {
        labelBy: 'CLUSTER',
        showLabelsFor: 'Marked rows',
        maxNumberOfLabels: 10
    }
}).applyStateAsync();

addSummaryTable(summaryTableDescription) → {this}

Adds a SpotfireSummaryTable to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
summaryTableDescription Object

The summary table properties (see SpotfireSummaryTable for details).

this

addTable(tableDescription) → {this}

Adds a Table Plot to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
tableDescription Object

The table plot description. See SpotfireTable for details.

this
Examples

Example of a colored Table Plot, using color rules and color points:

spotfireDocument.editor.addTable({
    data: { dataTable: 'Asinex' },
    colors: {
        colorSchemeGroupings: [{
            name: 'New grouping 1',
            mappings: ['CLUSTER', 'CL_SIZE'],
            colorMode: 'Gradient',
            colorRules: [{
                type: 'Top',
                value: 5,
                displayName: 'Top 5',
                color: '#FF0000'
            },
            {
                type: 'Equal to',
                value: '1',
                color: '#FFA200'
            }],
            colorPoints: [{
                type: 'Average',
                color: '#FF5733'
            },
            {
                type: 'Percent',
                value: 10,
                 color: '#33FF42'
            }]
        },
        {
            name: 'New grouping 2',
            mappings: 'IDNUMBER',
            colorMode: 'Unique values',
            applyTo: 'Text',
            colorRules: [{
                type: 'Contains',
                value: '00007',
                displayName: 'Molecules named with 00007',
                color: '#cc00ff'
            },
            {
                type: 'Equal to',
                value: 'BAS 0001287',
                color: '#FF0000'
            }]
        }]
    }
}).applyStateAsync();

Example of a colored Table Plot, using a color scheme saved in the library:

spotfireDocument.editor.addTable({
    data: { dataTable: 'Asinex' },
    colors: {
        colorSchemeGroupings: [{
            name: 'New grouping 1',
            mappings: ['CLUSTER', 'CL_SIZE'],
            templateLibraryPath: '/myLibraryFolder/Asinex_color_scheme'
        }]
    }
}).applyStateAsync();

addTreemap(treemapDescription) → {this}

Adds a SpotfireTreemap to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
treemapDescription Object

The treemap properties (see SpotfireTreemap for details).

this
Example

Example of a Treemap with labels:

spotfireDocument.editor.addTreemap({
    general: { title: 'Treemap' },
    labels: {
        showHierarchyHeaders: true,
        showLabels: true
    }
}).applyStateAsync();

addWaterfallChart(waterfallDescription) → {this}

Adds a SpotfireWaterfallChart to the current state to be applied on the current Spotfire document.

Parameters:
Name Type Description
waterfallDescription Object

The waterfall chart properties (see SpotfireWaterfallChart for details).

this
Example

Example of a Waterfall Chart with labels:

spotfireDocument.editor.addWaterfallChart({
    general: { title: 'Waterfall Chart' },
    labels: {
        showLabelsFor: 'Marked rows',
        labelOrientation: 'Horizontal",
        showRunningTotals: true,
        showBlocks: true,
        maxNumberOfLabels: 5
    }
}).applyStateAsync();

async applyState(keepState, executeInTransaction) → {Promise.<SpotfireDocumentEditor>}

Commits all the stacked modifications to the document. No update will be applied to the document until you call this method or its asynchronous version SpotfireDocumentEditor#applyStateAsync

Deprecated:
  • Yes
Parameters:
Name Type Description
keepState = false boolean

if True, keep all structure in the current SpotfireDocumentEditor. Otherwise, clear the SpotfireDocumentEditor.

executeInTransaction = true Boolean

Execute all actions in a transaction or not. Default to true.

Promise.<SpotfireDocumentEditor>

async applyStateAsync(keepState, executeInTransaction) → {Promise}

Asynchronous version of SpotfireDocumentEditor#applyState

Parameters:
Name Type Description
keepState = false boolean

if True, keep all structure in the current SpotfireDocumentEditor. Otherwise, clear the SpotfireDocumentEditor.

executeInTransaction = true Boolean

Execute all actions in a transaction or not. Default to true.

Promise

getColumnMatchingRelation(leftColumn, rightColumn) → {Object|null}

Get the SpotfireColumnRelation from the columnMatchings collection having the same name for left and right column than the arg specified

Parameters:
Name Type Description
leftColumn ColumnDescription

the left column description for the column relation searched

name String

The name of the column. It can be escaped thanks to brackets.

tableName String

The name of the data table that owns the column.

transformation String

The transformation to apply on the column from enum SpotfireColumnTransformations.

rightColumn ColumnDescription

the right column description for the column relation searched

name String

The name of the column. It can be escaped thanks to brackets.

tableName String

The name of the data table that owns the column.

transformation String

The transformation to apply on the column from enum SpotfireColumnTransformations.

Object | null

getColumnRelation(leftColumn, rightColumn, columnRelationCollection) → {Object|null}

Get the corresponding column relation from the specified SpotfireColumnRelation collections having the same name for left and right column than the arg specified

Parameters:
Name Type Description
leftColumn ColumnDescription

the left column description for the column relation searched

name String

The name of the column. It can be escaped thanks to brackets.

tableName String

The name of the data table that owns the column.

transformation String

The transformation to apply on the column from enum SpotfireColumnTransformations.

rightColumn ColumnDescription

the right column description for the column relation searched

name String

The name of the column. It can be escaped thanks to brackets.

tableName String

The name of the data table that owns the column.

transformation String

The transformation to apply on the column from enum SpotfireColumnTransformations.

columnRelationCollection Array.<Object>

the SpotfireColumnRelation collection you are searching in

Object | null

getDataTable(dataTableName) → {SpotfireDataTable|null}

Returns the data table with the given name if it exists.

Parameters:
Name Type Description
dataTableName String

The name of the data table.

SpotfireDataTable | null

getDataTableRelation(leftColumn, rightColumn)

Get the SpotfireColumnRelation from the dataTableRelations collection having the same name for left and right column than the arg specified

Parameters:
Name Type Description
leftColumn ColumnDescription

the left column description for the column relation searched

name String

The name of the column. It can be escaped thanks to brackets.

tableName String

The name of the data table that owns the column.

transformation String

The transformation to apply on the column from enum SpotfireColumnTransformations.

rightColumn ColumnDescription

the right column description for the column relation searched

name String

The name of the column. It can be escaped thanks to brackets.

tableName String

The name of the data table that owns the column.

transformation String

The transformation to apply on the column from enum SpotfireColumnTransformations.

getMarking(markingDescription) → {SpotfireMarking|null}

Gets the marking in the current state to be applied having the same name as the MarkingDescription provided.

Parameters:
Name Type Description
markingDescription MarkingDescription

The marking description having the provided name.

name String

The name of the marking.

[ color ] String | MarkingColor

The color of the marking either as a MarkingColor object or as a hexadecimal code or as a color name.

[ a ] number

The alpha component of the color. Must be between 0 and 255.

[ r ] number

The red component of the color. Must be between 0 and 255.

[ g ] number

The green component of the color. Must be between 0 and 255.

[ b ] number

The blue component of the color. Must be between 0 and 255.

SpotfireMarking | null

getPage(pageDescription) → {SpotfirePage|undefined}

Gets the SpotfirePage having the same title as the provided pageDescription from the current state to be applied to the current SpotfireDocument.

Parameters:
Name Type Description
pageDescription String | PageDescription

The title or page description.

title String

The title of the page.

[ tileMode ] String

The tile mode that defines the layout of the page.

[ panels ] Object

Specifies whether the panels should be visible using key<SpotfirePanelTypes>:value<Boolean> objects.
Using this method, the panels will be docked.

[ customLayout ] String

Script to apply a custom layout instead of tile mode.
In the script, the layout is in the object "layout", and the list of visualizations for the page in the object "visuals". The method getVisual can be used to retrieve a visualization by its name and type. See TIBCO Spotfire API - VisualTypeIdentifiers for the list of available types and TIBCO Spotfire API - LayoutDefinition for layout examples.

[ showWebPanel ] Boolean

Obsolete. Specifies whether the Web Panel should be visible.

SpotfirePage | undefined

getPageByVisualDescription(visualDescription) → {SpotfirePage|undefined}

Get the SpotfirePage for the corresponding visualDescription (see SpotfireVisualization arg)

Parameters:
Name Type Description
visualDescription Object

the visual description with a pageTitle property

SpotfirePage | undefined

getSpotfireDocumentProperty(propertyName) → {SpotfireDocumentProperty|null}

Gets a property of the document by name.

Parameters:
Name Type Description
propertyName String

The name of the property to retrieve.

SpotfireDocumentProperty | null

initOrClear() → {this}

Clears the structure in the editor that represents the action to be done on the document.

this

loadDataTableFromInformationLink(dataTableName, informationLink, informationLinkParameters, [addedColumnsDefinitions]) → {this}

Loads a data table from a TIBCO Spotfire® information link.

Parameters:
Name Type Description
dataTableName String

The name of the data table.

informationLink String

The complete path to the information link to be used.

informationLinkParameters Array.<InformationLinkParameter>

The parameters of the information link.

[].name String

The name of the parameter.

[].values Array.<Object>

The array of values to be applied for the parameter.

[ addedColumnsDefinitions ] Array.<AddedColumnsDefinition>

Array of definitions of the columns to be added.

[].type SpotfireDataColumnsTypes

The type of the column to add from enum SpotfireDataColumnsTypes.

calculatedDataColumn String

Calculated data column type.

hierarchyDataColumn String

Hierarchy data column type.

[].name String

The name of the column to add.

[].expression String

The expression to be used to calculate the column.

[].levels String

The columns to be used as levels to create the hierarchy.

this
Examples
spotfireDocument.editor.loadDataTableFromInformationLink('dataTable', '/path/to/the/information_link', null, null).applyState()
spotfireDocument.editor.loadDataTableFromInformationLink('dataTable', '/path/to/the/information_link', [
 {
     name: "a_string_parameter",
     values: "Europe"
 }, {
     name: "an_integer_parameter_with_multiple_values",
     values: [2, 4]
 }],
 null).applyStateAsync(true)

loadDataTableFromLibrary(dataTableName, path, [addedColumnsDefinitions]) → {this}

Loads a data table from the TIBCO Spotfire® Library.

Parameters:
Name Type Description
dataTableName String

The name of the data table.

path String

The library path of the source containing the data table.

[ addedColumnsDefinitions ] Array.<AddedColumnsDefinition>

Array of definitions of the columns to be added.

[].type SpotfireDataColumnsTypes

The type of the column to add from enum SpotfireDataColumnsTypes.

calculatedDataColumn String

Calculated data column type.

hierarchyDataColumn String

Hierarchy data column type.

[].name String

The name of the column to add.

[].expression String

The expression to be used to calculate the column.

[].levels String

The columns to be used as levels to create the hierarchy.

this
Example
spotfireDocument.editor.loadDataTableFromUrl('dummyTable', '/GeoAnalytics/Geocoding data tables/World/World Countries', [
 {
     type: SpotfireDataColumnsTypes.calculatedDataColumn,
     name: 'MyCalculatedColumn1',
     expression: 'SUM([Col1])'
 },
 {
     type: SpotfireDataColumnsTypes.calculatedDataColumn,
     name: 'MyCalculatedColumn2',
     expression: 'AVG([Col2])'
 }
 ]).applyStateAsync(true)

loadDataTableFromUrl(dataTableName, url, [addedColumnsDefinitions]) → {this}

Loads a data table from a URL.

Parameters:
Name Type Description
dataTableName String

The name of the data table.

url String

The URL of the source containing the data table.

[ addedColumnsDefinitions ] Array.<AddedColumnsDefinition>

Array of definitions of the columns to be added.

[].type SpotfireDataColumnsTypes

The type of the column to add from enum SpotfireDataColumnsTypes.

calculatedDataColumn String

Calculated data column type.

hierarchyDataColumn String

Hierarchy data column type.

[].name String

The name of the column to add.

[].expression String

The expression to be used to calculate the column.

[].levels String

The columns to be used as levels to create the hierarchy.

this
Example
spotfireDocument.editor.loadDataTableFromUrl('dummyTable', 'http://dummySource/url', [
 {
     type: SpotfireDataColumnsTypes.calculatedDataColumn,
     name: 'MyCalculatedColumn1',
     expression: 'SUM([Col1])'
 },
 {
     type: SpotfireDataColumnsTypes.calculatedDataColumn,
     name: 'MyCalculatedColumn2',
     expression: 'AVG([Col2])'
 }
 ]).applyStateAsync(true)

removeRowsFromDataTable(dataTable)

Removes all rows from a data table. This action will always be executed after all other actions on the last created data table of the state.

Parameters:
Name Type Description
dataTable String

The name of the data table in which all rows are to be removed. If not specified, the current data table of the state is used.

resetFilter(filterDescription)

Resets a filter in the current state to be applied to the current document.

Parameters:
Name Type Description
filterDescription filterDescription

The description of the filter.

type SpotfireFiltersTypes

The type of the filter.

rangeFilter String

The Range Filter type, see SpotfireRangeFilter for details on this filter.

itemFilter String

The Item Filter type, see SpotfireItemFilter for details on this filter.

radioButtonFilter String

The Radio Button Filter type, see SpotfireRadioButtonFilter for details on this filter.

checkBoxFilter String

The Check Box Filter type, see SpotfireCheckBoxFilter for details on this filter.

textFilter String

The Text Filter type, see SpotfireTextFilter for details on this filter.

listBoxFilter String

The List Box Filter type, see SpotfireListBoxFilter for details on this filter.

column String

The name of the column on which the filter is applied.

[ filteringScheme ] String

The name of the filtering scheme in which the filter is added. If not specified, the active filtering scheme will be used.

[ dataTable ] String

The name of the data table on which the filter is applied. If not specified, the active data table will be used.

[ reset = false ] Boolean

Indicates whether the filter should be reset or not.

Example
spotfireDocument.editor.resetFilter({
    column: "ALogP"
}).applyState();

setDocumentProperty(propertyName, value) → {this}

Sets a property of the document.

Parameters:
Name Type Description
propertyName String

The name of the property to set.

value String

The value of the property.

  • Returns this for chaining.
this

setFilterVisible(filterHandlerDescription)

Shows or hides a filter in the current state to be applied to the current document.

Parameters:
Name Type Description
filterHandlerDescription filterHandlerDescription

The description of the filter handler containing the filter to be displayed or hidden.

column String

The name of the column on which the filter is applied.

[ visible = true ] Boolean

Indicates whether the filter should be visible or not in the filter handler.

[ page ] String

The name of the page containing the filter handler. If not specified, the active page will be used.

[ dataTable ] String

The name of the data table on which the filter is applied. If not specified, the active data table will be used.