ColumnScopeApi

View as Markdown

Whether a column is inside a Column Scope, and the columns, types and data types a scope contains.

TypeScript
export interface

Methods

MethodReturnsDescription
areAllBooleanColumnsInScope(scope)booleanTrue if all selected columns are boolean
createCellColorRangesForScope(scope)CellColorRange[]Creates a default single CellColorRange for Styled Column wizards (Gradient,
Percent Bar, Bullet Chart): Col-Min → Col-Max with neutral gray, matching
the colour used when adding a range in the Ranges UI. If the column has no
sample values yet, returns one 0 → 0 gray range.
getAnyColumnIdForScope(scope)string | undefinedGets any ColumnId from the Scope
getColumnIdsInScope(scope)string[] | undefinedReturns all the ColumnIds in the Scope
getColumnsInScope(scope)AdaptableColumn[]Returns list of all Columns in the given Scope
getColumnTypesInScope(scope)string[] | undefinedReturns all the ColumnTypes in the Scope
getDataTypesInScope(scope)ScopeDataType[] | undefinedReturns all the DataTypes in the Scope
getScopeDescription(scope)stringProvides a description for the Scope
getScopeToString(scope)stringGets string representation of the Scope
getSingleColumnInScope(scope)string | undefinedGets the only Column in given Scope
isColumnInDateScope(column, scope)booleanTrue if Scope has Data DataType which contains Column
isColumnInNumericScope(column, scope)booleanTrue if Scope has Numeric DataType containing Column
isColumnInScope(column, scope)booleanTrue if Column is in given Scope
isColumnInScopeColumns(column, scope)booleanTrue if Column is in Scope's 'ColumnIds' section
isColumnInTextScope(column, scope)booleanTrue if Scope has text DataType containing Column
isPrimaryKeyColumnInScopeColumns(scope)booleanWhether PK column is included in Scope's column section
isScopeInScope(scopeA, scopeB)booleanTrue if first scope is in second Scope

Scope A | Scope B | Result
===========================================================================
All * true
* All true
DataTypes DataTypes all DataTypes from A should be in B
ColumnIds ColumnIds all ColumnIds from A should be in B
ColumnIds DataTypes all DataTypes of ColumnIds from A should be in B
DataTypes ColumnIds false
isSingleBooleanColumnScope(scope)booleanTrue if Scope contains just 1 boolean Column
isSingleColumnScope(scope)booleanTrue if Scope contains just 1 ColumnId
isSingleNumericColumnScope(scope)booleanTrue if Scope contains just 1 numeric Column
scopeHasColumns(scope)booleanTrue if Scope contains ColumnIds
scopeHasColumnType(scope)booleanTrue if Scope contains ColumnTypes
scopeHasDataType(scope)booleanTrue if Scope contains DataTypes
scopeHasOnlyBooleanDataType(scope)booleanTrue if Scope is DataTypes and contains just 'Boolean'
scopeIsAll(scope)booleanTrue if Scope is 'All'
scopeIsEmpty(scope)booleanTrue if Scope is empty

Method Details

areAllBooleanColumnsInScope

True if all selected columns are boolean

TypeScript
areAllBooleanColumnsInScope(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if all selected columns are boolean

boolean

createCellColorRangesForScope

Creates a default single CellColorRange for Styled Column wizards (Gradient, Percent Bar, Bullet Chart): Col-Min → Col-Max with neutral gray, matching the colour used when adding a range in the Ranges UI. If the column has no sample values yet, returns one 0 → 0 gray range.

TypeScript
createCellColorRangesForScope(scope: ColumnScope): CellColorRange[];
Parameters
ParameterTypeDescription
scopeColumnScopeScope to use (must resolve to a single column for range sampling)
Returns

A single CellColorRange for Styled Column wizards (Gradient, Percent Bar, Bullet Chart): Col-Min → Col-Max with neutral gray, matching the colour used when adding a range in the Ranges UI. If the column has no sample values yet, returns one 0 → 0 gray range

CellColorRange[]

getAnyColumnIdForScope

Gets any ColumnId from the Scope

TypeScript
getAnyColumnIdForScope(scope: ColumnScope): string | undefined;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

Any ColumnId from the Scope

string | undefined

getColumnIdsInScope

Returns all the ColumnIds in the Scope

TypeScript
getColumnIdsInScope(scope: ColumnScope): string[] | undefined;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

All the ColumnIds in the Scope

string[] | undefined

getColumnsInScope

Returns list of all Columns in the given Scope

TypeScript
getColumnsInScope(scope: ColumnScope): AdaptableColumn[];
Parameters
ParameterTypeDescription
scopeColumnScopethe Scope to check
Returns

List of all Columns in the given Scope

AdaptableColumn[]

getColumnTypesInScope

Returns all the ColumnTypes in the Scope

TypeScript
getColumnTypesInScope(scope: ColumnScope): string[] | undefined;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

All the ColumnTypes in the Scope

string[] | undefined

getDataTypesInScope

Returns all the DataTypes in the Scope

TypeScript
getDataTypesInScope(scope: ColumnScope): ScopeDataType[] | undefined;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

All the DataTypes in the Scope

ScopeDataType[] | undefined

getScopeDescription

Provides a description for the Scope

TypeScript
getScopeDescription(scope: ColumnScope): string;
Parameters
ParameterTypeDescription
scopeColumnScopeThe Scope to check
Returns

A description of the scope

string

getScopeToString

Gets string representation of the Scope

TypeScript
getScopeToString(scope: ColumnScope): string;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

String representation of the Scope

string

getSingleColumnInScope

Gets the only Column in given Scope

TypeScript
getSingleColumnInScope(scope: ColumnScope): string | undefined;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

The only Column in given Scope

string | undefined

isColumnInDateScope

True if Scope has Data DataType which contains Column

TypeScript
isColumnInDateScope(column: AdaptableColumn, scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
columnAdaptableColumnColumn to check
scopeColumnScopeScope to check
Returns

True if Scope has Data DataType which contains Column

boolean

isColumnInNumericScope

True if Scope has Numeric DataType containing Column

TypeScript
isColumnInNumericScope(column: AdaptableColumn, scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
columnAdaptableColumnColumn to check
scopeColumnScopeScope to check
Returns

True if Scope has Numeric DataType containing Column

boolean

isColumnInScope

True if Column is in given Scope

TypeScript
isColumnInScope(column: AdaptableColumn | undefined, scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
columnAdaptableColumn | undefinedColumn to check
scopeColumnScopeThe Scope to check
Returns

True if Column is in given Scope

boolean

isColumnInScopeColumns

True if Column is in Scope's 'ColumnIds' section

TypeScript
isColumnInScopeColumns(column: AdaptableColumn, scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
columnAdaptableColumnColumn to check
scopeColumnScopeScope to check
Returns

True if Column is in Scope's 'ColumnIds' section

boolean

isColumnInTextScope

True if Scope has text DataType containing Column

TypeScript
isColumnInTextScope(column: AdaptableColumn, scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
columnAdaptableColumnColumn to check
scopeColumnScopeScope to check
Returns

True if Scope has text DataType containing Column

boolean

isPrimaryKeyColumnInScopeColumns

Whether PK column is included in Scope's column section

TypeScript
isPrimaryKeyColumnInScopeColumns(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

true when PK column is included in Scope's column section

boolean

isScopeInScope

True if first scope is in second Scope

Scope A | Scope B | Result

All * true

  • All true DataTypes DataTypes all DataTypes from A should be in B ColumnIds ColumnIds all ColumnIds from A should be in B ColumnIds DataTypes all DataTypes of ColumnIds from A should be in B DataTypes ColumnIds false
TypeScript
isScopeInScope(scopeA: ColumnScope, scopeB: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeAColumnScopefirst Scope
scopeBColumnScopesecond Scope
Returns

True if first scope is in second Scope Scope A | Scope B | Result =========================================================================== All * true * All true DataTypes DataTypes all DataTypes from A should be in B ColumnIds ColumnIds all ColumnIds from A should be in B ColumnIds DataTypes all DataTypes of ColumnIds from A should be in B DataTypes ColumnIds false

boolean

isSingleBooleanColumnScope

True if Scope contains just 1 boolean Column

TypeScript
isSingleBooleanColumnScope(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope contains just 1 boolean Column

boolean

isSingleColumnScope

True if Scope contains just 1 ColumnId

TypeScript
isSingleColumnScope(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope contains just 1 ColumnId

boolean

isSingleNumericColumnScope

True if Scope contains just 1 numeric Column

TypeScript
isSingleNumericColumnScope(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope contains just 1 numeric Column

boolean

scopeHasColumns

True if Scope contains ColumnIds

TypeScript
scopeHasColumns(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope contains ColumnIds

boolean

scopeHasColumnType

True if Scope contains ColumnTypes

TypeScript
scopeHasColumnType(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope contains ColumnTypes

boolean

scopeHasDataType

True if Scope contains DataTypes

TypeScript
scopeHasDataType(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope contains DataTypes

boolean

scopeHasOnlyBooleanDataType

True if Scope is DataTypes and contains just 'Boolean'

TypeScript
scopeHasOnlyBooleanDataType(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope is DataTypes and contains just 'Boolean'

boolean

scopeIsAll

True if Scope is 'All'

TypeScript
scopeIsAll(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope is 'All'

boolean

scopeIsEmpty

True if Scope is empty

TypeScript
scopeIsEmpty(scope: ColumnScope): boolean;
Parameters
ParameterTypeDescription
scopeColumnScopeScope to check
Returns

True if Scope is empty

boolean