A data model implementation for in-memory delimiter-separated data.

This model handles data with up to 2**32 characters.

Hierarchy

  • DataModel
    • DSVModel

Implements

Constructors

Accessors

  • get changed(): ISignal<this, ChangedArgs>
  • A signal emitted when the data model has changed.

    Returns ISignal<this, ChangedArgs>

Methods

  • Get the body row of a row number, as shown in the row header.

    Rows above the first data row and comment rows have no number.

    Parameters

    • rowNumber: number

    Returns number

  • Get the column count for a region in the data model.

    Parameters

    • region: ColumnRegion

      The column region of interest.

    Returns number

    • The column count for the region.
  • 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 string

    • The data value for the specified cell.
  • Emit the changed signal for the data model.

    Subclasses should call this method whenever the data model has changed so that attached data grids can update themselves.

    Parameters

    • args: ChangedArgs

    Returns void

  • Get the index in the data string for the first character of a row and column.

    Parameters

    • row: number

      The row of the data item.

    • column: number

      The column of the data item.

    Returns number

    • The index into the data string where the data item starts.
  • Get the merged cell group which spans a comment row.

    Parameters

    • region: CellRegion
    • groupIndex: number

    Returns null | CellGroup

  • Get the count of merged cell groups: one per merged comment row.

    The grid scans every group for each cell it paints, so only the first comment rows are merged.

    Parameters

    • region: CellRegion

    Returns number

  • Get the metadata for a cell: { comment: true } for comment rows, with merged: true when the row is merged across the columns.

    Parameters

    • region: CellRegion
    • row: number
    • column: number

    Returns Metadata

  • Parse the data string asynchronously.

    It can take several seconds to parse a several hundred megabyte string, so we parse the first 500 rows to get something up on the screen, then we parse the full data string asynchronously.

    Returns void

  • Get the row count for a region in the data model.

    Parameters

    • region: RowRegion

      The row region of interest.

    Returns number

    • The row count for the region.