Column Scope Technical Reference

View as Markdown

Column Scope

ColumnScope

Which columns an object applies to. Set exactly one shape.

One of

Matches every column. All must be true.

{ DataTypes }

('text' | 'number' | 'boolean' | 'date' | 'textArray' | 'numberArray')[]

Data types to match, for example ['number'] or ['text', 'textArray']. Object, tuple and unknown columns are not scope data types. Name those columns with ColumnIds.

Column ids to match. These are AG Grid colId values.

AG Grid column type names, the strings set on colDef.type.


Column Scope API

ColumnScopeApi

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

True if all selected columns are boolean

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)
returns

string | undefined

Gets any ColumnId from the Scope

getColumnIdsInScope(scope)
returns

string[] | undefined

Returns all the ColumnIds in the Scope

Returns list of all Columns in the given Scope

getColumnTypesInScope(scope)
returns

string[] | undefined

Returns all the ColumnTypes in the Scope

getDataTypesInScope(scope)
returns

ScopeDataType[] | undefined

Returns all the DataTypes in the Scope

Provides a description for the Scope

Gets string representation of the Scope

getSingleColumnInScope(scope)
returns

string | undefined

Gets the only Column in given Scope

True if Scope has Data DataType which contains Column

True if Scope has Numeric DataType containing Column

True if Column is in given Scope

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

True if Scope has text DataType containing Column

Whether PK column is included in Scope's column section

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

True if Scope contains just 1 boolean Column

True if Scope contains just 1 ColumnId

True if Scope contains just 1 numeric Column

True if Scope contains ColumnIds

True if Scope contains ColumnTypes

True if Scope contains DataTypes

True if Scope is DataTypes and contains just 'Boolean'

scopeIsAll(scope)
returns

boolean

True if Scope is 'All'

scopeIsEmpty(scope)
returns

boolean

True if Scope is empty