SparseMatrix Class
Packages > @fluidframework/sequence > SparseMatrix
Signature:
export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment>
Extends: SharedSegmentSequence<MatrixSegment>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(document, id, attributes) | Constructs a new instance of the SparseMatrix class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
id | string | ||
numRows | number |
Methods
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
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
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
Parameter | Type | Description |
---|---|---|
runtime | IFluidDataStoreRuntime | data store runtime the new sparse matrix belongs to |
id | string | optional name of the sparse matrix |
Returns:
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:
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
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
Parameter | Type | Description |
---|---|---|
row | number | |
col | number |
Returns:
PropertySet
getTag
Signature:
getTag(row: number, col: number): any;
Parameters
Parameter | Type | Description |
---|---|---|
row | number | |
col | number |
Returns:
any
insertCols
Signature:
insertCols(col: number, numCols: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
col | number | |
numCols | number |
Returns:
void
insertRows
Signature:
insertRows(row: number, numRows: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | number | |
numRows | number |
Returns:
void
removeCols
Signature:
removeCols(col: number, numCols: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
col | number | |
numCols | number |
Returns:
void
removeRows
Signature:
removeRows(row: number, numRows: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | number | |
numRows | number |
Returns:
void
setItems
Signature:
setItems(row: number, col: number, values: SparseMatrixItem[], props?: PropertySet): void;
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
Parameter | Type | Description |
---|---|---|
row | number | |
col | number | |
tag | any |
Returns:
void