Column<T, TInit>
Strongly-typed column. Use get and set to access elements by index.
Extended by
Type parameters
| Type parameter | Value |
|---|---|
T | any |
TInit | T |
Constructors
new Column()
new Column<
T,TInit>(dart):Column<T,TInit>
Parameters
| Parameter | Type |
|---|---|
dart | any |
Returns
Column<T, TInit>
Source
Properties
| Property | Modifier | Type |
|---|---|---|
_meta | private | undefined | ColumnMetaHelper |
dart | public | any |
tags | public | any |
temp | public | any |
Accessors
categories
getcategories():string[]
Returns all unique strings in a sorted order. Applicable to string column only.
Returns
string[]
Source
colors
getcolors():ColumnColorHelper
Returns
Source
dataFrame
getdataFrame():DataFrame
Parent table
Returns
Source
dialogs
getdialogs():ColumnDialogHelper
Returns
Source
isCategorical
getisCategorical():boolean
Is the column categorical (string, boolean)
Returns
boolean
Source
isEmpty
getisEmpty():boolean
Returns whether all values in the columns are empty.
Returns
boolean
Source
isNumerical
getisNumerical():boolean
Is the column numerical (float, int, bigint, qnum)
Returns
boolean
Source
isVirtual
getisVirtual():boolean
Is this column virtual
Returns
boolean
Source
layoutColumnId
getlayoutColumnId():string
Layout column ID
setlayoutColumnId(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
length
getlength():number
Number of elements
Returns
number
Source
markers
getmarkers():ColumnMarkerHelper
Returns
Source
max
getmax():number
Column's maximum value. The result is cached.
Returns
number
Source
meta
getmeta():ColumnMetaHelper
Returns
Source
min
getmin():number
Column's minimum value. The result is cached.
Returns
number
Source
name
getname():string
setname(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
semType
getsemType():string
Semantic type
setsemType(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
stats
getstats():Stats
Basic descriptive statistics. The result is cached.
Returns
Source
type
gettype():"string"|"bigint"|"object"|"int"|"double"|"bool"|"byte_array"|"datetime"|"qnum"|"dataframe"
Column data type.
Returns
"string" | "bigint" | "object" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe"
Source
valueComparer
getvalueComparer():null|Comparer
Value comparison function to be used for sorting. Null means default sorting. Sample: https://public.datagrok.ai/js/samples/data-frame/sorting/custom-comparer
setvalueComparer(cmp):void
Parameters
| Parameter | Type |
|---|---|
cmp | null | Comparer |
Returns
null | Comparer
Source
version
getversion():number
Version of the column. Increases each time the column was changed
Returns
number
Source
Methods
aggregate()
aggregate(
type):any
Aggregates a column using the [type] function, which corresponds to
- [DG.AGG] for int, bigint, float, qnum columns,
- [DG.STR_AGG] and [DG.STAT_COUNTS] for string columns,
- [DG.STAT_COUNTS], [DG.AGG.MIN], [DG.AGG.MAX], [DG.AGG.AVG] for datetime columns,
- [DG.AGG.TOTAL_COUNT] and [DG.AGG.MISSING_VALUE_COUNT] for virtual columns.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
any
Source
applyFormula()
applyFormula(
formula,type,treatAsString):Promise<null|Column<any,any>>
Applies the specified formula to a calculated column. Returns a new column object, if applied successfully, and null otherwise.
Parameters
| Parameter | Type | Default value |
|---|---|---|
formula | string | undefined |
type | null | "string" | "bigint" | "object" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | null |
treatAsString | boolean | false |
Returns
Promise<null | Column<any, any>>
Source
asDoubleList()
asDoubleList():
Float32Array
Returns
Float32Array
- typed array of float values representing the column. Does not guarantee to perform a copy of the underlying data.
Source
clone()
clone(
mask?):Column<T,T>
Performs deep cloning, optionally taking mask of the rows to be included. Note that the cloned colum is not added to this column's dataframe.
Parameters
| Parameter | Type |
|---|---|
mask? | BitSet |
Returns
Column<T, T>
Source
compact()
compact():
any
Compacts the internal column representation. Currently, it only affects string columns where values were modified.
Returns
any
Source
convertTo()
convertTo(
newType,format):Column<any,any>
Creates and returns a new column by converting [column] to the specified [newType].
Parameters
| Parameter | Type | Default value |
|---|---|---|
newType | string | undefined |
format | null | string | null |
Returns
Column<any, any>
Source
fireValuesChanged()
fireValuesChanged():
void
Call this method after setting elements without notifications via set
Returns
void
Source
get()
get(
row):null|T
Gets i-th value
Parameters
| Parameter | Type | Description |
|---|---|---|
row | number | row index |
Returns
null | T
- or null if isNone(i)
Source
getCategory()
getCategory(
categoryIndex):string
Returns i-th category. Applicable to string column only.
Parameters
| Parameter | Type |
|---|---|
categoryIndex | number |
Returns
string
Source
getCategoryOrder()
getCategoryOrder():
string[]
Gets order of categories
Returns
string[]