Options
All
  • Public
  • Public/Protected
  • All
Menu

Class JSONModel

A data model implementation for in-memory JSON data. The namespace for the JSONModel class statics.

Hierarchy

Index

Type aliases

Static CellRegion

CellRegion: "body" | "row-header" | "column-header" | "corner-header"

A type alias for the data model cell regions.

Static CellsChangedArgs

CellsChangedArgs: object

An arguments object for the changed signal.

Notes

Data models should emit the changed signal with this args object type when cells are changed in-place.

Type declaration

Static ChangedArgs

A type alias for the args objects of the changed signal.

Static ColumnRegion

ColumnRegion: "body" | "row-header"

A type alias for the data model column regions.

Static ColumnsChangedArgs

ColumnsChangedArgs: object

An arguments object for the changed signal.

Notes

Data models should emit the changed signal with this args object type when columns are inserted or removed.

Type declaration

Static ColumnsMovedArgs

ColumnsMovedArgs: object

An arguments object for the changed signal.

Notes

Data models should emit the changed signal with this args object type when columns are moved.

Type declaration

Static DataSource

DataSource: ReadonlyArray<ReadonlyJSONObject>

A type alias for a data source for a JSON data model.

A data source is an array of JSON object records which represent the rows of the table. The keys of the records correspond to the field names of the columns.

Static Field

Field: object

An object which describes a column of data in the model.

Notes

This is based on the JSON Table Schema specification: https://specs.frictionlessdata.io/table-schema/

Type declaration

Static Metadata

Metadata: object

The metadata for a column in a data model.

Type declaration

  • [key: string]: any

Static ModelResetArgs

ModelResetArgs: object

An arguments object for the changed signal.

Notes

Data models should emit the changed signal with this args object type when the model has changed in a fashion that cannot be easily expressed by the other args object types.

This is the "big hammer" approach, and will cause any associated data grid to perform a full reset. The other changed args types should be used whenever possible.

Type declaration

Static RowRegion

RowRegion: "body" | "column-header"

A type alias for the data model row regions.

Static RowsChangedArgs

RowsChangedArgs: object

An arguments object for the changed signal.

Notes

Data models should emit the changed signal with this args object type when rows are inserted or removed.

Type declaration

Static RowsMovedArgs

RowsMovedArgs: object

An arguments object for the changed signal.

Notes

Data models should emit the changed signal with this args object type when rows are moved.

Type declaration

Static Schema

Schema: object

An object when specifies the schema for a data model.

Notes

This is based on the JSON Table Schema specification: https://specs.frictionlessdata.io/table-schema/

Type declaration

Constructors

constructor

Properties

Private _bodyFields

_bodyFields: Field[]

Private _data

_data: DataSource

Private _headerFields

_headerFields: Field[]

Private _missingValues

_missingValues: Private.MissingValuesMap | null

Static emptyMetadata

emptyMetadata: Metadata = Object.freeze({})

A singleton empty metadata object.

Accessors

changed

Methods

columnCount

data

  • data(region: CellRegion, row: number, column: number): any
  • Get the data value for a cell in the data model.

    Parameters

    • region: CellRegion

      The cell region of interest.

    • row: number

      The row index of the cell of interest.

    • column: number

      The column index of the cell of interest.

    Returns any

    • The data value for the specified cell.

    Notes

    A missingValue as defined by the schema is converted to null.

Protected emitChanged

group

groupCount

metadata

  • Get the metadata for a cell in the data model.

    Parameters

    • region: CellRegion

      The cell region of interest.

    • row: number

      The row index of the cell of of interest.

    • column: number

      The column index of the cell of interest.

    Returns Metadata

    The metadata for the cell.

rowCount

Generated using TypeDoc