@univerjsengine-renderReadme

@univerjs/engine-render v0.5.0-beta.1Docs


@univerjs/engine-render

Enumerations

EnumerationDescription
BORDER_TYPE-
BreakType-
CanvasRenderModecanvas render mode
CURSOR_TYPEhttps://developer.mozilla.org/en-US/docs/Web/CSS/cursor
DeviceInputEventTypeEvent Types
DeviceTypeEnum for Device Types
DOCUMENT_CONTEXT_CLIP_TYPE-
DocumentEditArea-
DocumentSkeletonPageType-
GlyphType-
LineType-
LINK_VIEW_PORT_TYPE-
ObjectType-
ORIENTATION_TYPE-
PageLayoutTypeDetermining the text layout, whether it’s vertical or horizontal, data storage is primarily horizontal, and vertical layout is supported through rendering and drawing.
PointerInputEnum for All Pointers (Touch/Mouse)
RENDER_CLASS_TYPE-
ScrollTimerType-
SHAPE_TYPECopyright 2023-present DreamNum Inc.
SHEET_EXTENSION_TYPE-
SHEET_VIEWPORT_KEY-
ShowGridlinesState-
SkeletonType-
SLIDE_NAVIGATION_KEY-
TRANSFORM_CHANGE_OBSERVABLE_TYPE-

Classes

ClassDescription
Background-
BaseObject-
Border-
CanvasView Renderer constructor. It is a wrapper around native canvas element. Usually you don’t need to use it manually.
Checkbox-
Circle-
ColumnHeaderLayoutColumn Header Bar, include a lot of columns header
ComponentExtension-
ControlCopyright 2023-present DreamNum Inc.
Custom-
CustomObject-
DashedRect-
DataStreamTreeNode-
DocBackground-
Documents-
DocumentSkeleton-
DocumentViewModel-
DrawingCopyright 2023-present DreamNum Inc.
Engine-
EventConstantsConstants used for Events
Font-
FontCache-
Group-
HitCanvasView Renderer constructor. It is a wrapper around native canvas element. Usually you don’t need to use it manually.
Image-
Layer-
Liquid-
Marker-
Path-
Path2-
PerformanceMonitorPerformance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
Rect-
RegularPolygon-
RenderComponent-
RenderManagerService-
RenderUnitThis class is necessary for Univer to render several units in the same webpage. It encapsulates the rendering context and rendering modules for a specific unit.
RichText-
RollingAverageRollingAverage
RowHeaderLayout-
Scene-
SceneCanvasView Renderer constructor. It is a wrapper around native canvas element. Usually you don’t need to use it manually.
SceneViewer-
ScrollBar-
ScrollTimer-
Shape-
SheetComponent-
SheetExtension-
Skeleton-
Slide-
Spreadsheet-
SpreadsheetColumnHeader-
SpreadsheetHeader-
SpreadsheetRowHeader-
SpreadsheetSkeleton-
ThinEngine-
ThinScene-
Transform-
UniverPrintingContext-
UniverRenderConfigServiceThis service carries managers render config that would be passed to every widget, so some rendering could be optimized.
UniverRenderEnginePluginPlug-in base class, all plug-ins must inherit from this base class. Provide basic methods.
UniverRenderingContext-
UniverRenderingContext2D-
Vector2-
Viewport-

Interfaces

InterfaceDescription
BorderCache-
BorderCacheItem-
IAdjustability-
IAfterRender$Info-
IBasicFrameInfo-
IBoundRect-
IBoundRectNoAngle-
IBounds-
ICacheItem-
IChangeObserverConfig-
ICheckboxProps-
ICircleProps-
IColumnsHeaderCfgParam-
IColumnStyleCfg-
IContext2D-
IDocsConfig-
IDocSelectionInnerParam-
IDocumentLayoutObject-
IDocumentOffsetConfig-
IDocumentSkeletonBoundingBox-
IDocumentSkeletonBullet-
IDocumentSkeletonCached-
IDocumentSkeletonColumn-
IDocumentSkeletonDivide-
IDocumentSkeletonDrawing-
IDocumentSkeletonDrawingAnchor-
IDocumentSkeletonFontStyle-
IDocumentSkeletonGlyph-
IDocumentSkeletonHeaderFooter-
IDocumentSkeletonLine-
IDocumentSkeletonPage-
IDocumentSkeletonRow-
IDocumentSkeletonSection-
IDocumentSkeletonTable-
IDragEventNative friendly interface for DragEvent Object
IDrawInfo-
IEventNative friendly interface for Event Obj ect
IExtendFrameInfo-
IExtensionConfig-
IFindNodeRestrictions-
IFontCacheItem-
IFontCreateConfig-
IFontLocale-
IFooterIds-
IGetPosByRowColOptions-
IGetRowColByPosOptions-
IHeaderIds-
IImageProps-
IKeyboardEventNative friendly interface for KeyboardEvent Object
IMeasureTextCache-
IMouseEventNative friendly interface for MouseEvent Object
INodeInfo-
INodePosition-
INodeSearch-
IObjectFullState-
IPageRenderConfig-
IPaintForRefresh-
IPaintForScrolling-
IParagraphConfig-
IParagraphTableCache-
IPathProps-
IPoint-
IPointerEventNative friendly interface for PointerEvent Object
IRectCopyright 2023-present DreamNum Inc.
IRectProps-
IRectRangeWithStyle-
IRegularPolygonProps-
IRenderPublic interface of a RenderUnit.
IRenderContextNecessary context for a render module.This interface would be the first argument of render modules’ constructor functions.
IRenderManagerService-
IRenderModuleEvery render module should implement this interface.
IRichTextProps-
IRowsHeaderCfgParam-
IRowStyleCfg-
ISceneInputControlOptions-
ISceneTransformStateCopyright 2023-present DreamNum Inc.
IScrollObserverParam-
ISectionBreakConfigBasics properties of doc style
IShapeProps-
ISkeletonResourceReference-
IStylesCache-
ISummaryFrameInfo-
ISummaryMetric-
ITempCellDataCell data
ITextRangeWithStyle-
ITextSelectionStyle-
ITransformChangeState-
IUIEventNative friendly interface for UIEvent Object
IViewportInfo-
IViewportInfos-
IWheelEventNative friendly interface for WheelEvent Object

Type Aliases

Type aliasDescription
DataArrayAlias for types that can be used by a Buffer or VertexBuffer.
DeepImmutableType modifier to make all the properties of an object Readonly recursively
DeepImmutableObjectType modifier to make object properties readonly.
doubleAlias type for number that are doubles.
floatAlias type for number that are floats
FloatArrayAlias type for number array or Float32Array
IAColumnCfg-
IAColumnCfgObj-
IARowCfg-
IARowCfgObj-
ImmutableType modifier to make all the properties of an object Readonly
IndicesArrayAlias type for number array or Float32Array or Int32 Array or Uint32Array or Uint16Array
int-
ISuccinctDocRangeParam-
ITimeMetric-
LineCap-
LineJoin-
PaintFirst-
RenderComponentType-
RichtextObjectJSONType-

Variables

VariableDescription
BASE_OBJECT_ARRAY-
CHECK_OBJECT_ARRAY-
CIRCLE_OBJECT_ARRAY-
COLOR_BLACK_RGB-
DEFAULT_DOCUMENT_FONTSIZE-
DEFAULT_FONTFACE_PLANE-
DEFAULT_FRAME_LIST_SIZE-
DEFAULT_FRAME_SAMPLE_SIZE-
DEFAULT_MEASURE_TEXT-
DEFAULT_OFFSET_SPACING-
DEFAULT_PADDING_DATA-
DEFAULT_SKELETON_FOOTER-
DEFAULT_SKELETON_HEADER-
DocumentsSpanAndLineExtensionRegistry-
DRAWING_OBJECT_LAYER_INDEX-
DRAWING_OBJECT_LOWER_LAYER_INDEX-
DRAWING_OBJECT_UPPER_LAYER_INDEX-
EMOJI_REG-
FIX_ONE_PIXEL_BLUR_OFFSET-
INITIAL_MATRIX-
INITIAL_Path2-
MAIN_VIEW_PORT_KEY-
MAXIMUM_COL_WIDTH-
MAXIMUM_ROW_HEIGHT-
MIDDLE_CELL_POS_MAGIC_NUMBER-
MIN_COL_WIDTH-
NORMAL_TEXT_SELECTION_PLUGIN_STYLE-
PATH_OBJECT_ARRAY-
RECT_OBJECT_ARRAY-
REGULAR_POLYGON_OBJECT_ARRAY-
RENDER_RAW_FORMULA_KEY-
RICHTEXT_OBJECT_ARRAY-
SHAPE_OBJECT_ARRAY-
SHEET_EXTENSION_PREFIXfor distinguish doc & slides extensions, now only used when metric performance.
SheetColumnHeaderExtensionRegistry-
SheetRowHeaderExtensionRegistry-
SpreadsheetExtensionRegistry-
VERTICAL_ROTATE_ANGLE-

Functions

FunctionDescription
calculateRectRotate-
cancelRequestFrame-
checkStyle-
clampRange-
clearLineByBorderType-
convertTextRotation-
createCanvasElement-
createImageElement-
degToRad-
drawDiagonalLineByBorderType-
drawLineByBorderType-
expandRangeIfIntersectsIf there is an intersection in ranges to the mainRanges, extend it to the first set of ranges.
fixLineWidthByScaleWhen drawing lines, it is necessary to align their precision. performance testing var time = performance.now(); for(let i=0;i<100000000;i++){ fixLineWidthByScale(i, 0.666); }; console.log(performance.now()-time);
generateRandomKey-
getCellByIndexWithMergeInfo-
getCellPositionByIndex-
getCellWithCoordByIndexCore-
getCharSpaceApply-
getColor-
getCurrentScrollXY-
getDevicePixelRatio-
getDocsSkeletonPageSizeObtain the height and width of a cell’s text, taking into account scenarios with rotated text.
getDPI-
getFontStyleString-
getGroupState-
getLastLine-
getLineOffset-
getLineWidth-
getLineWith-
getNumberUnitValue-
getOffsetRectForDom-
getPageFromPath-
getParagraphByGlyph-
getPointerPrefixGets the pointer prefix to use
getRotateOffsetAndFarthestHypotenuse-
getRotateOrientation-
getScale-
getSizeForDom-
getSystemHighlightColor-
getTableIdAndSliceIndex-
getTranslateInSpreadContextWithPixelRatioAlign the resolution, an alignment needs to be done in special cases where the resolution is 1.5, 1.25, etc.
getValueType-
glyphIterator-
hasAllLatin-
hasArabic-
hasBasicLatin-
hasCJK-
hasCJKPunctuation-
hasCJKText-
hasLatinExtendedA-
hasLatinExtendedB-
hasLatinOneSupplement-
hasListGlyph-
hasSpace-
hasTibetan-
hasUnMergedCellInRowDetermine whether there are any cells in a row that are not in the merged cells, mainly used for the calculation of auto height
inCurrentAndAboveViewRanges在非下方区域中
injectStyle-
inRowViewRangesrow 在任意一个 Range 中
inViewRanges当前单元格在任意一个 viewRanges 中
IRenderingEngineThe global rendering engine.
IRenderManagerService-
isArray-
isCjkCenterAlignedPunctuation-
isCjkLeftAlignedPunctuation-
isCjkRightAlignedPunctuation-
isDate-
isFirstGlyph-
isFunction-
isIndentByGlyph-
isLastGlyph-
isNumber-
isObject-
isPlaceholderOrSpace-
isRectIntersect-
isRegExp-
IsSafariUtility function to detect if the current user agent is Safari
isSameLine-
isString-
lineIterator-
mergeInfoOffset-
parseDataStreamToTree-
pixelToPt-
precisionTo-
ptToMM-
ptToPixel-
ptToPx-
pxToInch-
pxToNum-
pxToPt-
radToDeg-
requestNewFrameQueue a new function into the requested animation frame pool (ie. this function will be executed byt the browser for the next frame)
setLineType-
startWithEmoji-
toPx-
transformObjectOutOfGroup-