SparseMatrix Class
Packages > fluid-framework > SparseMatrix
Deprecated
SparseMatrix is an abandoned prototype. Use SharedMatrix instead.
Signature:
export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment>
Extends: SharedSegmentSequenceMatrixSegment
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(document, id, attributes) | Constructs a new instance of the SparseMatrix class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
id | |||
numRows |
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 | ||
id | ||
attributes |
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 | ||
col | ||
props |
Returns:
create
Create a new sparse matrix
Signature:
static create(runtime: IFluidDataStoreRuntime, id?: string): SparseMatrix;
Parameters
Parameter | Type | Description |
---|---|---|
runtime | data store runtime the new sparse matrix belongs to | |
id | 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>;
Parameters
Parameter | Type | Description |
---|---|---|
row | ||
col |
Returns:
getPositionProperties
Signature:
getPositionProperties(row: number, col: number): PropertySet;
Parameters
Parameter | Type | Description |
---|---|---|
row | ||
col |
Returns:
getTag
Signature:
getTag(row: number, col: number): any;
Parameters
Parameter | Type | Description |
---|---|---|
row | ||
col |
Returns:
insertCols
Signature:
insertCols(col: number, numCols: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
col | ||
numCols |
Returns:
insertRows
Signature:
insertRows(row: number, numRows: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | ||
numRows |
Returns:
removeCols
Signature:
removeCols(col: number, numCols: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
col | ||
numCols |
Returns:
removeRows
Signature:
removeRows(row: number, numRows: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | ||
numRows |
Returns:
setItems
Signature:
setItems(row: number, col: number, values: SparseMatrixItem[], props?: PropertySet): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | ||
col | ||
values | SparseMatrixItem | |
props |
Returns:
setTag
Signature:
setTag(row: number, col: number, tag: any): void;
Parameters
Parameter | Type | Description |
---|---|---|
row | ||
col | ||
tag |
Returns: