@univerjs/engine-render v0.4.2 • Docs
Class: SpreadsheetSkeleton
Extends
Constructors
new SpreadsheetSkeleton()
new SpreadsheetSkeleton(
worksheet,
_worksheetData,
_cellData,
_styles,
_localeService,
_contextService,
_configService): SpreadsheetSkeleton
Parameters
Parameter | Type | Description |
---|---|---|
worksheet | Worksheet | - |
_worksheetData | IWorksheetData | Deprecated avoid use IWorksheetData directly, use API provided by Worksheet , otherwise ViewModel will be not working. |
_cellData | ObjectMatrix <Nullable <ICellData >> | - |
_styles | Styles | - |
_localeService | LocaleService | - |
_contextService | IContextService | - |
_configService | IConfigService | - |
Returns
Overrides
Defined in
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Skeleton ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
_localService | readonly | LocaleService | undefined | Skeleton ._localService | submodules/univer/packages/engine-render/src/components/skeleton.ts:26 (opens in a new tab) |
worksheet | readonly | Worksheet | undefined | - | submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:296 (opens in a new tab) |
Accessors
columnHeaderHeight
get columnHeaderHeight(): number
Returns
number
Defined in
columnHeaderHeightAndMarginTop
get columnHeaderHeightAndMarginTop(): number
Returns
number
Defined in
columnTotalWidth
get columnTotalWidth(): number
Returns
number
Defined in
columnWidthAccumulation
get columnWidthAccumulation(): number[]
Returns
number
[]
Defined in
dirty
get dirty(): boolean
Returns
boolean
Inherited from
Defined in
submodules/univer/packages/engine-render/src/components/skeleton.ts:32 (opens in a new tab)
mergeData
get mergeData(): IRange[]
Returns
IRange
[]
Defined in
overflowCache
get overflowCache(): ObjectMatrix<IRange>
Returns
Defined in
rowColumnSegment
get rowColumnSegment(): IRowColumnRange
Range of visible area(range in viewBounds)
Returns
IRowColumnRange
Defined in
rowHeaderWidth
get rowHeaderWidth(): number
Returns
number
Defined in
rowHeaderWidthAndMarginLeft
get rowHeaderWidthAndMarginLeft(): number
Returns
number
Defined in
rowHeightAccumulation
get rowHeightAccumulation(): number[]
Returns
number
[]
Defined in
rowTotalHeight
get rowTotalHeight(): number
Returns
number
Defined in
showGridlines
get showGridlines(): BooleanNumber
Returns
Defined in
stylesCache
get stylesCache(): IStylesCache
Returns
Defined in
Methods
_getBounding()
protected _getBounding(
rowHeightAccumulation,
columnWidthAccumulation,
viewBound?): IRange
Parameters
Parameter | Type | Description |
---|---|---|
rowHeightAccumulation | number [] | Row layout information |
columnWidthAccumulation | number [] | Column layout information |
viewBound ? | IBoundRectNoAngle | The range of the visible area of the canvas |
Returns
The range cell index of the canvas visible area
Defined in
_getMeasuredWidthByCell()
_getMeasuredWidthByCell(cell, currColWidth): number
For _calculateColMaxWidth
Parameters
Parameter | Type |
---|---|
cell | ICellDataForSheetInterceptor |
currColWidth | number |
Returns
number
width
Defined in
_setBgStylesCache()
_setBgStylesCache(
row,
col,
style,
options): void
Parameters
Parameter | Type |
---|---|
row | number |
col | number |
style | Nullable <IStyleData > |
options | undefined | { cacheItem : ICacheItem ; mergeRange : IRange ; } |
Returns
void
Defined in
_setBorderStylesCache()
_setBorderStylesCache(
row,
col,
style,
options): void
Parameters
Parameter | Type |
---|---|
row | number |
col | number |
style | Nullable <IStyleData > |
options | undefined | { cacheItem : ICacheItem ; mergeRange : IRange ; } |
Returns
void
Defined in
_setFontStylesCache()
_setFontStylesCache(
row,
col,
cell): void
Parameters
Parameter | Type |
---|---|
row | number |
col | number |
cell | Nullable <ICellData > |
Returns
void
Defined in
appendToOverflowCache()
appendToOverflowCache(
row,
column,
startColumn,
endColumn): void
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
startColumn | number |
endColumn | number |
Returns
void
Defined in
calculate()
calculate(bounds?): Nullable<SpreadsheetSkeleton>
Parameters
Parameter | Type |
---|---|
bounds ? | IViewportInfo |
Returns
Defined in
calculateAutoHeightInRange()
calculateAutoHeightInRange(ranges): IRowAutoHeightInfo[]
Calc all auto height by getDocsSkeletonPageSize in ranges
Parameters
Parameter | Type |
---|---|
ranges | Nullable <IRange []> |
Returns
result
Defined in
calculateAutoWidthInRange()
calculateAutoWidthInRange(ranges): IColAutoWidthInfo[]
Parameters
Parameter | Type |
---|---|
ranges | Nullable <IRange []> |
Returns
Defined in
calculateCellIndexByPosition()
calculateCellIndexByPosition(
offsetX,
offsetY,
scaleX,
scaleY,
scrollXY): Nullable<ISelectionCellWithMergeInfo>
Get cell by pos(offsetX, offsetY).
Parameters
Parameter | Type | Description |
---|---|---|
offsetX | number | HTML coordinate system, mouse position x. |
offsetY | number | HTML coordinate system, mouse position y. |
scaleX | number | render scene scale x-axis, scene.getAncestorScale |
scaleY | number | render scene scale y-axis, scene.getAncestorScale |
scrollXY | object | render viewport scroll {x, y}, scene.getScrollXYByRelativeCoords, scene.getScrollXY |
scrollXY.x | number | - |
scrollXY.y | number | - |
Returns
Nullable
<ISelectionCellWithMergeInfo
>
Selection data with coordinates
Defined in
convertTransformToOffsetX()
convertTransformToOffsetX(
offsetX,
scaleX,
scrollXY): number
Parameters
Parameter | Type |
---|---|
offsetX | number |
scaleX | number |
scrollXY | object |
scrollXY.x | number |
scrollXY.y | number |
Returns
number
Defined in
convertTransformToOffsetY()
convertTransformToOffsetY(
offsetY,
scaleY,
scrollXY): number
Parameters
Parameter | Type |
---|---|
offsetY | number |
scaleY | number |
scrollXY | object |
scrollXY.x | number |
scrollXY.y | number |
Returns
number
Defined in
dispose()
dispose(): void
Returns
void
Overrides
Defined in
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)
getBlankCellDocumentModel()
getBlankCellDocumentModel(cell): IDocumentLayoutObject
Parameters
Parameter | Type |
---|---|
cell | Nullable <ICellData > |
Returns
Defined in
getCellByIndex()
getCellByIndex(row, column): ISelectionCellWithMergeInfo
Return cell information corresponding to the current coordinates, including the merged cell object.
Parameters
Parameter | Type | Description |
---|---|---|
row | number | Specified Row Coordinate |
column | number | Specified Column Coordinate |
Returns
Defined in
getCellByIndexWithNoHeader()
getCellByIndexWithNoHeader(row, column): ISelectionCellWithMergeInfo
New merge info, but position without header.
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
cellInfo with merge info
Defined in
getCellDocumentModelWithFormula()
getCellDocumentModelWithFormula(cell): Nullable<IDocumentLayoutObject>
Parameters
Parameter | Type |
---|---|
cell | ICellData |
Returns
Nullable
<IDocumentLayoutObject
>
Defined in
getCellPositionByOffset()
getCellPositionByOffset(
offsetX,
offsetY,
scaleX,
scaleY,
scrollXY,
closeFirst?): {
column: number;
row: number;
}
Parameters
Parameter | Type | Description |
---|---|---|
offsetX | number | HTML coordinate system, mouse position x. |
offsetY | number | HTML coordinate system, mouse position y. |
scaleX | number | render scene scale x-axis, scene.getAncestorScale |
scaleY | number | render scene scale y-axis, scene.getAncestorScale |
scrollXY | object | render viewport scroll {x, y}, scene.getScrollXYByRelativeCoords, scene.getScrollXY |
scrollXY.x | number | - |
scrollXY.y ? | number | - |
closeFirst ? | boolean | - |
Returns
{
column: number;
row: number;
}
Hit cell coordinates
Defined in
getColumnCount()
getColumnCount(): number
Returns
number
Defined in
getColumnPositionByOffsetX()
getColumnPositionByOffsetX(
offsetX,
scaleX,
scrollXY,
closeFirst?): number
Parameters
Parameter | Type | Description |
---|---|---|
offsetX | number | scaled offset x |
scaleX | number | scale x |
scrollXY | object | - |
scrollXY.x | number | - |
scrollXY.y ? | number | - |
closeFirst ? | boolean | - |
Returns
number
Defined in
getCurrentRowColumnSegmentMergeData()
getCurrentRowColumnSegmentMergeData(range?): IRange[]
get the current row and column segment visible merge data
Parameters
Parameter | Type |
---|---|
range ? | IRange |
Returns
IRange
[]
The visible merge data
Defined in
getDecomposedOffset()
getDecomposedOffset(offsetX, offsetY): {
column: number;
columnOffset: number;
row: number;
rowOffset: number;
}
Parameters
Parameter | Type |
---|---|
offsetX | number |
offsetY | number |
Returns
{
column: number;
columnOffset: number;
row: number;
rowOffset: number;
}
Defined in
getFont()
getFont(rowIndex, columnIndex): Nullable<IFontCacheItem>
Parameters
Parameter | Type |
---|---|
rowIndex | number |
columnIndex | number |
Returns
Defined in
getFontLocale()
getFontLocale(): IFontLocale
Returns
Inherited from
Defined in
submodules/univer/packages/engine-render/src/components/skeleton.ts:36 (opens in a new tab)
getLocation()
getLocation(): [string, string]
Get which Workbook and Worksheet this skeleton is attached to.
Returns
[string
, string
]
[unitId, sheetId]
Defined in
getMergeBounding()
getMergeBounding(
startRow,
startColumn,
endRow,
endColumn): IRange
Parameters
Parameter | Type |
---|---|
startRow | number |
startColumn | number |
endRow | number |
endColumn | number |
Returns
Defined in
getNoMergeCellPositionByIndex()
getNoMergeCellPositionByIndex(rowIndex, columnIndex): IPosition
Parameters
Parameter | Type |
---|---|
rowIndex | number |
columnIndex | number |
Returns
Defined in
getNoMergeCellPositionByIndexWithNoHeader()
getNoMergeCellPositionByIndexWithNoHeader(rowIndex, columnIndex): IPosition
Parameters
Parameter | Type |
---|---|
rowIndex | number |
columnIndex | number |
Returns
Defined in
getOffsetByPositionX()
getOffsetByPositionX(column): number
Parameters
Parameter | Type |
---|---|
column | number |
Returns
number
Defined in
getOffsetByPositionY()
getOffsetByPositionY(row): number
Parameters
Parameter | Type |
---|---|
row | number |
Returns
number
Defined in
getOverflowPosition()
getOverflowPosition(
contentSize,
horizontalAlign,
row,
column,
columnCount): IColumnRange
Parameters
Parameter | Type |
---|---|
contentSize | Required <ISize > |
horizontalAlign | HorizontalAlign |
row | number |
column | number |
columnCount | number |
Returns
Defined in
getRowColumnSegment()
getRowColumnSegment(bounds?): IRange
Parameters
Parameter | Type |
---|---|
bounds ? | IViewportInfo |
Returns
Defined in
getRowColumnSegmentByViewBound()
getRowColumnSegmentByViewBound(bound?): IRange
Parameters
Parameter | Type |
---|---|
bound ? | IBoundRectNoAngle |
Returns
Defined in
getRowCount()
getRowCount(): number
Returns
number
Defined in
getRowPositionByOffsetY()
getRowPositionByOffsetY(
offsetY,
scaleY,
scrollXY,
closeFirst?): number
Parameters
Parameter | Type | Description |
---|---|---|
offsetY | number | scaled offset y |
scaleY | number | scale y |
scrollXY | object | - |
scrollXY.x | number | - |
scrollXY.y ? | number | - |
closeFirst ? | boolean | - |
Returns
number
Defined in
getSelectionMergeBounding()
getSelectionMergeBounding(
startRow,
startColumn,
endRow,
endColumn): IRange
Parameters
Parameter | Type |
---|---|
startRow | number |
startColumn | number |
endRow | number |
endColumn | number |
Returns
Defined in
getTransformOffsetX()
getTransformOffsetX(
offsetX,
scaleX,
scrollXY): number
Parameters
Parameter | Type |
---|---|
offsetX | number |
scaleX | number |
scrollXY | object |
scrollXY.x | number |
scrollXY.y | number |
Returns
number
Defined in
getTransformOffsetY()
getTransformOffsetY(
offsetY,
scaleY,
scrollXY): number
Parameters
Parameter | Type |
---|---|
offsetY | number |
scaleY | number |
scrollXY | object |
scrollXY.x | number |
scrollXY.y | number |
Returns
number
Defined in
getWorksheetConfig()
getWorksheetConfig(): IWorksheetData
Returns
Deprecated
should never expose a property that is provided by another module!
Defined in
getsStyles()
getsStyles(): Styles
Returns
Deprecated
should never expose a property that is provided by another module!
Defined in
intersectMergeRange()
intersectMergeRange(row, column): boolean
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
boolean
Defined in
makeDirty()
makeDirty(state): void
Parameters
Parameter | Type |
---|---|
state | boolean |
Returns
void
Inherited from
Defined in
submodules/univer/packages/engine-render/src/components/skeleton.ts:40 (opens in a new tab)
resetCache()
resetCache(): void
Returns
void
Defined in
setMarginLeft()
setMarginLeft(left): void
Parameters
Parameter | Type |
---|---|
left | number |
Returns
void
Defined in
setMarginTop()
setMarginTop(top): void
Parameters
Parameter | Type |
---|---|
top | number |
Returns
void
Defined in
setOverflowCache()
setOverflowCache(value): void
Parameters
Parameter | Type |
---|---|
value | ObjectMatrix <IRange > |
Returns
void
Defined in
setStylesCache()
setStylesCache(bounds?): Nullable<SpreadsheetSkeleton>
Set border background and font to this._stylesCache by visible range, which derives from bounds)
Parameters
Parameter | Type | Description |
---|---|---|
bounds ? | IViewportInfo | viewBounds |
Returns
Defined in
updateVisibleRange()
updateVisibleRange(bounds?): boolean
Get range in visible area (range in viewbounds) and set into this._rowColumnSegment.
Parameters
Parameter | Type |
---|---|
bounds ? | IViewportInfo |
Returns
boolean
boolean
Defined in
visibleRangeByViewportKey()
visibleRangeByViewportKey(viewportKey): Nullable<IRowColumnRange>
Parameters
Parameter | Type |
---|---|
viewportKey | SHEET_VIEWPORT_KEY |
Returns
Nullable
<IRowColumnRange
>