Class

SpotfireDataTable

SpotfireDataTable(dataTableDescription)

Represents a data table in the SpotfireDocumentEditor state to be created when calling applyState.

Constructor

new SpotfireDataTable(dataTableDescription)

Parameters:
Name Type Description
dataTableDescription DataTableDescription
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

Members

Array.<Object>

addedColumns

String

dataTableName

String

extension

String

filePath

Array.<Object>

importedDataAsColumns

Array.<Object>

importedDataAsRows

String

informationLink

Array.<InformationLinkParameter>

informationLinkParameters

Array.<Object>

properties

Array.<Array>

transformationsOperations

String

url

Methods

setAddedColumns(columnDefinitionsArray)

Set or update a definition of column to add for the applyState

Parameters:
Name Type Description
columnDefinitionsArray Array.<Object>

array of columns description to be added

[].name String

the name of the column to be added.

[].type String

the type descriptor of the column to be added.

[ [].expression ] String

Mandatory for SpotfireDataColumnTypes.calculatedDataColumn. Define the expression to calculate the value

[ [].isFrozen = false ] Boolean

set if the calculated column is frozen or not

[ [].levels ] String

Mandatory for SpotfireDataColumnTypes.hierarchyDataColumn. Define the column to use as levels

setImportedDataAsColumns(importedColumnsDefinitionsArray)

Set the list of imported data as columns definition.

Parameters:
Name Type Description
importedColumnsDefinitionsArray Array.<ImportedDataAsColumnDefinition>

The list of the import description.

[].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.

setImportedDataAsRows(importedRowsDefinitionsArray)

Set the list of imported data as rows definition.

Parameters:
Name Type Description
importedRowsDefinitionsArray Array.<ImportedDataAsRowDefinition>

The list of the import description.

[].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.

setProperties(arrayOfProperties)

Set the list of properties to be added to the data table.

Parameters:
Name Type Description
arrayOfProperties Array.<Object>

the list of properties to be added

[].name String

the name of the property to be added

[].value String | Boolean | Number

the value of the property to be added

setTransformationsOperations(operationsDefinitionsArray)

Set the list of operations of transformations definition.

Parameters:
Name Type Description
operationsDefinitionsArray Array.<OperationDefinition>

The list of the operations of transformations description.

[].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).