Miso.Dataset. Column

new Column ( options )

Miso.Dataset.Column objects make up the columns contained in a dataset and are returned by some methods such as .column on Miso.Dataset and Miso.Dataset.DataView

You can edit the code in this block and rerun it.

Parameters

  • options Object required
    Properties
    • name String required

      Column name

    • type Object optional

      Column type (from Miso.types)

    • data Object optional

      A set of data. By default, set to an empty array.

    • before function optional

      A function to pre-process a column's value before it is coerced. Signature is function(value)

    • format function optional

      Optional. Only set if time type. The moment.js format describing the input dates.

    • id Number optional

      Sets a custom column _id. We assign one by default.

Source

Methods

coerce ( )

Coerces all the data in the column's data array to the appropriate type.

You can edit the code in this block and rerun it.
Source

compute ( row, i )

If this is a computed column, it calculates the value for this column and adds it to the data.

Parameters

  • row Object required

    the row from which column is computed.

  • i Number optional

    the index at which this value will get added.

Returns

the computed value

Source

isComputed ( )

Returns: Boolean

Returns

true if this is a computed column. False otherwise.

Type: Boolean
Source

numericAt ( index )

Returns: Number

Internal function used to return the numeric value of a given input in a column. Index is used as this is currently the return value for numeric coercion of string values.

You can edit the code in this block and rerun it.

Parameters

  • index Number required

    index position of the row you want the numeric value for

Returns

Type: Number
Source

toNumeric ( value )

Returns: Number

Converts any value to this column's type for a given position in some source array.

Parameters

  • value mixed required

Returns

Type: Number
Source