Skip to content 

SparseMatrix Class

Packages > @fluidframework/sequence > SparseMatrix

Signature:

export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment> 

Extends: SharedSegmentSequence<MatrixSegment>

Constructors

List of constructors for this class
Constructor Modifiers Description
(constructor)(document, id, attributes) Constructs a new instance of the SparseMatrix class

Properties

List of properties for this class
Property Modifiers Type Description
id string
numRows number

Methods

List of methods on this class
Method Modifiers Description
annotatePosition(row, col, props)
create(runtime, id) static Create a new sparse matrix
getFactory() static Get a factory for SharedMap to register with the data store.
getItem(row, col)
getPositionProperties(row, col)
getTag(row, col)
insertCols(col, numCols)
insertRows(row, numRows)
removeCols(col, numCols)
removeRows(row, numRows)
setItems(row, col, values, props)
setTag(row, col, tag)

Constructors

SparseMatrix.(constructor)

Constructs a new instance of the SparseMatrix class

Signature:

constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);

Parameters

List of parameters
Parameter Type Description
document IFluidDataStoreRuntime
id string
attributes IChannelAttributes

Properties

id

Signature:

id: string;

numRows

Signature:

get numRows(): number;

Methods

annotatePosition

Signature:

annotatePosition(row: number, col: number, props: PropertySet): void;

Parameters

List of parameters
Parameter Type Description
row number
col number
props PropertySet

Returns:

void

create

Create a new sparse matrix

Signature:

static create(runtime: IFluidDataStoreRuntime, id?: string): SparseMatrix;

Parameters

List of parameters
Parameter Type Description
runtime IFluidDataStoreRuntime data store runtime the new sparse matrix belongs to
id string optional name of the sparse matrix

Returns:

SparseMatrix

newly create sparse matrix (but not attached yet)

getFactory

Get a factory for SharedMap to register with the data store.

Signature:

static getFactory(): IChannelFactory;

Returns:

IChannelFactory

a factory that creates and load SharedMap

getItem

Signature:

getItem(row: number, col: number): Jsonable<string | number | boolean | IFluidHandle<import("@fluidframework/core-interfaces").IFluidObject & import("@fluidframework/core-interfaces").IFluidLoadable>>;

Parameters

List of parameters
Parameter Type Description
row number
col number

Returns:

Jsonable<string | number | boolean | IFluidHandle<import("@fluidframework/core-interfaces”).IFluidObject & import("@fluidframework/core-interfaces”).IFluidLoadable>>

getPositionProperties

Signature:

getPositionProperties(row: number, col: number): PropertySet;

Parameters

List of parameters
Parameter Type Description
row number
col number

Returns:

PropertySet

getTag

Signature:

getTag(row: number, col: number): any;

Parameters

List of parameters
Parameter Type Description
row number
col number

Returns:

any

insertCols

Signature:

insertCols(col: number, numCols: number): void;

Parameters

List of parameters
Parameter Type Description
col number
numCols number

Returns:

void

insertRows

Signature:

insertRows(row: number, numRows: number): void;

Parameters

List of parameters
Parameter Type Description
row number
numRows number

Returns:

void

removeCols

Signature:

removeCols(col: number, numCols: number): void;

Parameters

List of parameters
Parameter Type Description
col number
numCols number

Returns:

void

removeRows

Signature:

removeRows(row: number, numRows: number): void;

Parameters

List of parameters
Parameter Type Description
row number
numRows number

Returns:

void

setItems

Signature:

setItems(row: number, col: number, values: SparseMatrixItem[], props?: PropertySet): void;

Parameters

List of parameters
Parameter Type Description
row number
col number
values SparseMatrixItem[]
props PropertySet

Returns:

void

setTag

Signature:

setTag(row: number, col: number, tag: any): void;

Parameters

List of parameters
Parameter Type Description
row number
col number
tag any

Returns:

void