拓展 / GraphRenderer
抽象接口: GraphRenderer
方法
clearEmphasis()
abstractclearEmphasis():void
返回值
void
clearForecast()
abstractclearForecast():void
返回值
void
clearHighlightedElements()
abstractclearHighlightedElements():void
返回值
void
destroy()
destroy():
void
在拆卸时释放渲染器拥有的资源(观察者、侦听器)。默认无操作;持有此类资源的渲染器会覆盖此内容。
返回值
void
emphasiseElements()
abstractemphasiseElements(elements):void
参数
elements
返回值
void
enterNoteEditMode()
abstractenterNoteEditMode(note):void
参数
note
返回值
void
fitAndCenter()
abstractfitAndCenter(forceScale?):void
参数
forceScale?
number
返回值
void
fitAndCenterWhenSettled()
fitAndCenterWhenSettled(
forceScale?):Promise<void>
内容停止调整大小后调整并居中。 sim 停止后在多个帧上布局的渲染器(例如扩展集群)会覆盖此设置以等待稳定的 bbox;默认值立即适合。应用拟合后即可解决。
参数
forceScale?
number
返回值
Promise<void>
focusElement()
abstractfocusElement(element):void
参数
element
返回值
void
getCanvas()
getCanvas():
HTMLElement
返回值
HTMLElement
getCanvasSelection()
abstractgetCanvasSelection():unknown
返回值
unknown
getClosestElementToCursor()
abstractgetClosestElementToCursor(maxDistance?):Node|Edge|Note|null
参数
maxDistance?
number
返回值
getContentBounds()
abstractgetContentBounds():GraphBounds|null
返回值
GraphBounds | null
getEdgeStyle()
abstractgetEdgeStyle(edge):EdgeStyle
参数
edge
返回值
getGraphInteraction()
abstractgetGraphInteraction():GraphInteractions<unknown>
返回值
GraphInteractions<unknown>
getNodeClosestToCursor()
abstractgetNodeClosestToCursor(maxDistance?):Node|null
参数
maxDistance?
number
返回值
Node | null
getNodeStyle()
abstractgetNodeStyle(node,tier?):NodeStyle
node 绘画风格。使用 tier 时,该绘图的样式而不是缩放选择的样式:-1 表示地板样式,或节点 tiers 的索引。
参数
node
tier?
number
返回值
getOptions()
abstractgetOptions():GraphRendererOptions
返回值
getRootContainer()
getRootContainer():
HTMLElement
图表的根容器——一切,包括 chrome。故意与 getCanvas 区分开来:只要 chrome 打开(侧边栏、数据坞),画布就会收缩,而容器仅在其周围的页面变化时才会变化。任何不能对 Chrome 做出反应的东西都会对此进行测量。
返回值
HTMLElement
getSelectionBox()
abstractgetSelectionBox():AbstractSelectionBox|null
返回值
AbstractSelectionBox | null
getShadowEdgeEnd()
getShadowEdgeEnd():
Point|null
预览边缘结束的图形空间点,或未绘制时的 null。
返回值
Point | null
getZoomBehavior()
abstractgetZoomBehavior():unknown
返回值
unknown
getZoomGroup()
abstractgetZoomGroup():HTMLElement|SVGElement|null
返回值
HTMLElement | SVGElement | null
graphToScreenCoordinates()
abstractgraphToScreenCoordinates(graphX,graphY):Point
参数
graphX
number
graphY
number
返回值
Point
hideShadowEdge()
abstracthideShadowEdge():void
返回值
void
highlightElement()
abstracthighlightElement(element):void
参数
element
返回值
void
init()
abstractinit():void
返回值
void
nextTick()
abstractnextTick():void
返回值
void
nextTickFor()
abstractnextTickFor(nodes):void
参数
nodes
Node[]
返回值
void
screenToGraphCoordinates()
abstractscreenToGraphCoordinates(screenX,screenY):Point
参数
screenX
number
screenY
number
返回值
Point
setupRendering()
setupRendering():
void
返回值
void
setViewport()
abstractsetViewport(target):void
参数
target
返回值
void
showForecast()
abstractshowForecast(forecast):void
参数
forecast
返回值
void
showShadowEdge()
abstractshowShadowEdge(params):void
参数
params
invalid?
boolean
source
targetNode?
targetPosition?
{ x: number; y: number; }
targetPosition.x
number
targetPosition.y
number
返回值
void
toggleLassoMode()
abstracttoggleLassoMode(enabled):void
参数
enabled
boolean
返回值
void
unHighlightElement()
abstractunHighlightElement(element):void
参数
element
返回值
void
update()
abstractupdate(dataChanged):void
参数
dataChanged
boolean
返回值
void
updateLayoutProgress()
updateLayoutProgress(
progress,elapsedTime,progressType):void
参数
progress
number
elapsedTime
number
progressType
ProgressType
返回值
void
zoomIn()
abstractzoomIn():void
返回值
void
zoomOut()
abstractzoomOut():void
返回值
void