API Reference
@univerjs
@univerjs/engine-render
classes
Spreadsheetskeleton

@univerjs/engine-render v0.4.2Docs


Class: SpreadsheetSkeleton

Extends

Constructors

new SpreadsheetSkeleton()

new SpreadsheetSkeleton(
   worksheet, 
   _worksheetData, 
   _cellData, 
   _styles, 
   _localeService, 
   _contextService, 
   _configService): SpreadsheetSkeleton

Parameters

ParameterTypeDescription
worksheetWorksheet-
_worksheetDataIWorksheetDataDeprecated avoid use IWorksheetData directly, use API provided by Worksheet, otherwise ViewModel will be not working.
_cellDataObjectMatrix<Nullable<ICellData>>-
_stylesStyles-
_localeServiceLocaleService-
_contextServiceIContextService-
_configServiceIConfigService-

Returns

SpreadsheetSkeleton

Overrides

Skeleton.constructor

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:295 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseSkeleton._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
_localServicereadonlyLocaleServiceundefinedSkeleton._localServicesubmodules/univer/packages/engine-render/src/components/skeleton.ts:26 (opens in a new tab)
worksheetreadonlyWorksheetundefined-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

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:337 (opens in a new tab)


columnHeaderHeightAndMarginTop

get columnHeaderHeightAndMarginTop(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:376 (opens in a new tab)


columnTotalWidth

get columnTotalWidth(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:329 (opens in a new tab)


columnWidthAccumulation

get columnWidthAccumulation(): number[]

Returns

number[]

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:325 (opens in a new tab)


dirty

get dirty(): boolean

Returns

boolean

Inherited from

Skeleton.dirty

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

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:368 (opens in a new tab)


overflowCache

get overflowCache(): ObjectMatrix<IRange>

Returns

ObjectMatrix<IRange>

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:360 (opens in a new tab)


rowColumnSegment

get rowColumnSegment(): IRowColumnRange

Range of visible area(range in viewBounds)

Returns

IRowColumnRange

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:344 (opens in a new tab)


rowHeaderWidth

get rowHeaderWidth(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:333 (opens in a new tab)


rowHeaderWidthAndMarginLeft

get rowHeaderWidthAndMarginLeft(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:372 (opens in a new tab)


rowHeightAccumulation

get rowHeightAccumulation(): number[]

Returns

number[]

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:317 (opens in a new tab)


rowTotalHeight

get rowTotalHeight(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:321 (opens in a new tab)


showGridlines

get showGridlines(): BooleanNumber

Returns

BooleanNumber

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:364 (opens in a new tab)


stylesCache

get stylesCache(): IStylesCache

Returns

IStylesCache

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:356 (opens in a new tab)

Methods

_getBounding()

protected _getBounding(
   rowHeightAccumulation, 
   columnWidthAccumulation, 
   viewBound?): IRange

Parameters

ParameterTypeDescription
rowHeightAccumulationnumber[]Row layout information
columnWidthAccumulationnumber[]Column layout information
viewBound?IBoundRectNoAngleThe range of the visible area of the canvas

Returns

IRange

The range cell index of the canvas visible area

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1668 (opens in a new tab)


_getMeasuredWidthByCell()

_getMeasuredWidthByCell(cell, currColWidth): number

For _calculateColMaxWidth

Parameters

ParameterType
cellICellDataForSheetInterceptor
currColWidthnumber

Returns

number

width

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:809 (opens in a new tab)


_setBgStylesCache()

_setBgStylesCache(
   row, 
   col, 
   style, 
   options): void

Parameters

ParameterType
rownumber
colnumber
styleNullable<IStyleData>
optionsundefined | { cacheItem: ICacheItem; mergeRange: IRange; }

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1989 (opens in a new tab)


_setBorderStylesCache()

_setBorderStylesCache(
   row, 
   col, 
   style, 
   options): void

Parameters

ParameterType
rownumber
colnumber
styleNullable<IStyleData>
optionsundefined | { cacheItem: ICacheItem; mergeRange: IRange; }

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1955 (opens in a new tab)


_setFontStylesCache()

_setFontStylesCache(
   row, 
   col, 
   cell): void

Parameters

ParameterType
rownumber
colnumber
cellNullable<ICellData>

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:2013 (opens in a new tab)


appendToOverflowCache()

appendToOverflowCache(
   row, 
   column, 
   startColumn, 
   endColumn): void

Parameters

ParameterType
rownumber
columnnumber
startColumnnumber
endColumnnumber

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:997 (opens in a new tab)


calculate()

calculate(bounds?): Nullable<SpreadsheetSkeleton>

Parameters

ParameterType
bounds?IViewportInfo

Returns

Nullable<SpreadsheetSkeleton>

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:536 (opens in a new tab)


calculateAutoHeightInRange()

calculateAutoHeightInRange(ranges): IRowAutoHeightInfo[]

Calc all auto height by getDocsSkeletonPageSize in ranges

Parameters

ParameterType
rangesNullable<IRange[]>

Returns

IRowAutoHeightInfo[]

result

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:567 (opens in a new tab)


calculateAutoWidthInRange()

calculateAutoWidthInRange(ranges): IColAutoWidthInfo[]

Parameters

ParameterType
rangesNullable<IRange[]>

Returns

IColAutoWidthInfo[]

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:681 (opens in a new tab)


calculateCellIndexByPosition()

calculateCellIndexByPosition(
   offsetX, 
   offsetY, 
   scaleX, 
   scaleY, 
scrollXY): Nullable<ISelectionCellWithMergeInfo>

Get cell by pos(offsetX, offsetY).

Parameters

ParameterTypeDescription
offsetXnumberHTML coordinate system, mouse position x.
offsetYnumberHTML coordinate system, mouse position y.
scaleXnumberrender scene scale x-axis, scene.getAncestorScale
scaleYnumberrender scene scale y-axis, scene.getAncestorScale
scrollXYobjectrender viewport scroll {x, y}, scene.getScrollXYByRelativeCoords, scene.getScrollXY
scrollXY.xnumber-
scrollXY.ynumber-

Returns

Nullable<ISelectionCellWithMergeInfo>

Selection data with coordinates

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1113 (opens in a new tab)


convertTransformToOffsetX()

convertTransformToOffsetX(
   offsetX, 
   scaleX, 
   scrollXY): number

Parameters

ParameterType
offsetXnumber
scaleXnumber
scrollXYobject
scrollXY.xnumber
scrollXY.ynumber

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1343 (opens in a new tab)


convertTransformToOffsetY()

convertTransformToOffsetY(
   offsetY, 
   scaleY, 
   scrollXY): number

Parameters

ParameterType
offsetYnumber
scaleYnumber
scrollXYobject
scrollXY.xnumber
scrollXY.ynumber

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1352 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Skeleton.dispose

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:380 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Skeleton.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Skeleton.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


getBlankCellDocumentModel()

getBlankCellDocumentModel(cell): IDocumentLayoutObject

Parameters

ParameterType
cellNullable<ICellData>

Returns

IDocumentLayoutObject

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1365 (opens in a new tab)


getCellByIndex()

getCellByIndex(row, column): ISelectionCellWithMergeInfo

Return cell information corresponding to the current coordinates, including the merged cell object.

Parameters

ParameterTypeDescription
rownumberSpecified Row Coordinate
columnnumberSpecified Column Coordinate

Returns

ISelectionCellWithMergeInfo

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1269 (opens in a new tab)


getCellByIndexWithNoHeader()

getCellByIndexWithNoHeader(row, column): ISelectionCellWithMergeInfo

New merge info, but position without header.

Parameters

ParameterType
rownumber
columnnumber

Returns

ISelectionCellWithMergeInfo

cellInfo with merge info

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1313 (opens in a new tab)


getCellDocumentModelWithFormula()

getCellDocumentModelWithFormula(cell): Nullable<IDocumentLayoutObject>

Parameters

ParameterType
cellICellData

Returns

Nullable<IDocumentLayoutObject>

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1406 (opens in a new tab)


getCellPositionByOffset()

getCellPositionByOffset(
   offsetX, 
   offsetY, 
   scaleX, 
   scaleY, 
   scrollXY, 
   closeFirst?): {
  column: number;
  row: number;
}

Parameters

ParameterTypeDescription
offsetXnumberHTML coordinate system, mouse position x.
offsetYnumberHTML coordinate system, mouse position y.
scaleXnumberrender scene scale x-axis, scene.getAncestorScale
scaleYnumberrender scene scale y-axis, scene.getAncestorScale
scrollXYobjectrender viewport scroll {x, y}, scene.getScrollXYByRelativeCoords, scene.getScrollXY
scrollXY.xnumber-
scrollXY.y?number-
closeFirst?boolean-

Returns

{
  column: number;
  row: number;
}

Hit cell coordinates

NameTypeDefined in
columnnumbersubmodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1143 (opens in a new tab)
rownumbersubmodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1143 (opens in a new tab)

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1136 (opens in a new tab)


getColumnCount()

getColumnCount(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1006 (opens in a new tab)


getColumnPositionByOffsetX()

getColumnPositionByOffsetX(
   offsetX, 
   scaleX, 
   scrollXY, 
   closeFirst?): number

Parameters

ParameterTypeDescription
offsetXnumberscaled offset x
scaleXnumberscale x
scrollXYobject-
scrollXY.xnumber-
scrollXY.y?number-
closeFirst?boolean-

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1161 (opens in a new tab)


getCurrentRowColumnSegmentMergeData()

getCurrentRowColumnSegmentMergeData(range?): IRange[]

get the current row and column segment visible merge data

Parameters

ParameterType
range?IRange

Returns

IRange[]

The visible merge data

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1913 (opens in a new tab)


getDecomposedOffset()

getDecomposedOffset(offsetX, offsetY): {
  column: number;
  columnOffset: number;
  row: number;
  rowOffset: number;
}

Parameters

ParameterType
offsetXnumber
offsetYnumber

Returns

{
  column: number;
  columnOffset: number;
  row: number;
  rowOffset: number;
}
NameTypeDefined in
columnnumbersubmodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1515 (opens in a new tab)
columnOffsetnumbersubmodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1515 (opens in a new tab)
rownumbersubmodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1515 (opens in a new tab)
rowOffsetnumbersubmodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1515 (opens in a new tab)

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1515 (opens in a new tab)


getFont()

getFont(rowIndex, columnIndex): Nullable<IFontCacheItem>

Parameters

ParameterType
rowIndexnumber
columnIndexnumber

Returns

Nullable<IFontCacheItem>

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:452 (opens in a new tab)


getFontLocale()

getFontLocale(): IFontLocale

Returns

IFontLocale

Inherited from

Skeleton.getFontLocale

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

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:423 (opens in a new tab)


getMergeBounding()

getMergeBounding(
   startRow, 
   startColumn, 
   endRow, 
   endColumn): IRange

Parameters

ParameterType
startRownumber
startColumnnumber
endRownumber
endColumnnumber

Returns

IRange

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:933 (opens in a new tab)


getNoMergeCellPositionByIndex()

getNoMergeCellPositionByIndex(rowIndex, columnIndex): IPosition

Parameters

ParameterType
rowIndexnumber
columnIndexnumber

Returns

IPosition

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1043 (opens in a new tab)


getNoMergeCellPositionByIndexWithNoHeader()

getNoMergeCellPositionByIndexWithNoHeader(rowIndex, columnIndex): IPosition

Parameters

ParameterType
rowIndexnumber
columnIndexnumber

Returns

IPosition

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1084 (opens in a new tab)


getOffsetByPositionX()

getOffsetByPositionX(column): number

Parameters

ParameterType
columnnumber

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1233 (opens in a new tab)


getOffsetByPositionY()

getOffsetByPositionY(row): number

Parameters

ParameterType
rownumber

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1249 (opens in a new tab)


getOverflowPosition()

getOverflowPosition(
   contentSize, 
   horizontalAlign, 
   row, 
   column, 
   columnCount): IColumnRange

Parameters

ParameterType
contentSizeRequired<ISize>
horizontalAlignHorizontalAlign
rownumber
columnnumber
columnCountnumber

Returns

IColumnRange

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1014 (opens in a new tab)


getRowColumnSegment()

getRowColumnSegment(bounds?): IRange

Parameters

ParameterType
bounds?IViewportInfo

Returns

IRange

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:916 (opens in a new tab)


getRowColumnSegmentByViewBound()

getRowColumnSegmentByViewBound(bound?): IRange

Parameters

ParameterType
bound?IBoundRectNoAngle

Returns

IRange

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:929 (opens in a new tab)


getRowCount()

getRowCount(): number

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1010 (opens in a new tab)


getRowPositionByOffsetY()

getRowPositionByOffsetY(
   offsetY, 
   scaleY, 
   scrollXY, 
   closeFirst?): number

Parameters

ParameterTypeDescription
offsetYnumberscaled offset y
scaleYnumberscale y
scrollXYobject-
scrollXY.xnumber-
scrollXY.y?number-
closeFirst?boolean-

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1192 (opens in a new tab)


getSelectionMergeBounding()

getSelectionMergeBounding(
   startRow, 
   startColumn, 
   endRow, 
   endColumn): IRange

Parameters

ParameterType
startRownumber
startColumnnumber
endRownumber
endColumnnumber

Returns

IRange

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1360 (opens in a new tab)


getTransformOffsetX()

getTransformOffsetX(
   offsetX, 
   scaleX, 
   scrollXY): number

Parameters

ParameterType
offsetXnumber
scaleXnumber
scrollXYobject
scrollXY.xnumber
scrollXY.ynumber

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1215 (opens in a new tab)


getTransformOffsetY()

getTransformOffsetY(
   offsetY, 
   scaleY, 
   scrollXY): number

Parameters

ParameterType
offsetYnumber
scaleYnumber
scrollXYobject
scrollXY.xnumber
scrollXY.ynumber

Returns

number

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1224 (opens in a new tab)


getWorksheetConfig()

getWorksheetConfig(): IWorksheetData

Returns

IWorksheetData

Deprecated

should never expose a property that is provided by another module!

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:925 (opens in a new tab)


getsStyles()

getsStyles(): Styles

Returns

Styles

Deprecated

should never expose a property that is provided by another module!

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:415 (opens in a new tab)


intersectMergeRange()

intersectMergeRange(row, column): boolean

Parameters

ParameterType
rownumber
columnnumber

Returns

boolean

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1890 (opens in a new tab)


makeDirty()

makeDirty(state): void

Parameters

ParameterType
stateboolean

Returns

void

Inherited from

Skeleton.makeDirty

Defined in

submodules/univer/packages/engine-render/src/components/skeleton.ts:40 (opens in a new tab)


resetCache()

resetCache(): void

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:1930 (opens in a new tab)


setMarginLeft()

setMarginLeft(left): void

Parameters

ParameterType
leftnumber

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:444 (opens in a new tab)


setMarginTop()

setMarginTop(top): void

Parameters

ParameterType
topnumber

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:448 (opens in a new tab)


setOverflowCache()

setOverflowCache(value): void

Parameters

ParameterType
valueObjectMatrix<IRange>

Returns

void

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:440 (opens in a new tab)


setStylesCache()

setStylesCache(bounds?): Nullable<SpreadsheetSkeleton>

Set border background and font to this._stylesCache by visible range, which derives from bounds)

Parameters

ParameterTypeDescription
bounds?IViewportInfoviewBounds

Returns

Nullable<SpreadsheetSkeleton>

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:493 (opens in a new tab)


updateVisibleRange()

updateVisibleRange(bounds?): boolean

Get range in visible area (range in viewbounds) and set into this._rowColumnSegment.

Parameters

ParameterType
bounds?IViewportInfo

Returns

boolean

boolean

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:469 (opens in a new tab)


visibleRangeByViewportKey()

visibleRangeByViewportKey(viewportKey): Nullable<IRowColumnRange>

Parameters

ParameterType
viewportKeySHEET_VIEWPORT_KEY

Returns

Nullable<IRowColumnRange>

Defined in

submodules/univer/packages/engine-render/src/components/sheets/sheet-skeleton.ts:348 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.