Class: DiagramView#
@deathbeds/ipydrawio.DiagramView
A renderer for a Diagram.
Hierarchy#
BoxView
↳
DiagramView
Constructors#
constructor#
• new DiagramView(options?
)
Public constructor.
Parameters#
Name |
Type |
---|---|
|
|
Inherited from#
BoxView.constructor
Defined in#
node_modules/@jupyter-widgets/base/lib/widget.d.ts:201
Properties#
diagram#
• Protected
diagram: Diagram
Defined in#
model#
• model: DiagramModel
Overrides#
BoxView.model
Defined in#
diagrmManager#
▪ Static
diagrmManager:
IDiagramManager
Defined in#
Accessors#
app#
• get
app(): IMXApp
The drawio App
Returns#
Defined in#
graph#
• get
graph(): IMXGraph
The drawio Graph
Returns#
Defined in#
graphModel#
• get
graphModel():
IMXGraphModel
The drawio Graph Model
Returns#
Defined in#
Methods#
getCellIds#
▸ Protected
getCellIds(): string
[]
Extract the cell or page ids
Returns#
string
[]
Defined in#
idGetter#
▸ Protected
idGetter(cellOrPage
): string
convenience method for frequently-called loops
Parameters#
Name |
Type |
---|---|
|
Returns#
string
Defined in#
initDiagram#
▸ Protected
initDiagram(): void
Initialize the actual Diagram renderer.
Returns#
void
Defined in#
onAppChanged#
▸ Protected
onAppChanged(): void
Handle the drawio app actually being ready, connecting events, etc.
Returns#
void
Defined in#
onDrawioEvent#
▸ Protected
onDrawioEvent(sender
, event
): void
handle subscribed “native” mxEvents
These are found throughout the code in the mxEvent
namespace, though some magic
strings do appear duplicated in a numebr of placess
Parameters#
Name |
Type |
---|---|
|
|
|
Returns#
void
Defined in#
onModelGridColor#
▸ Protected
onModelGridColor(): void
Handle a grid color change from the kernel
Returns#
void
Defined in#
onModelGridEnabled#
▸ Protected
onModelGridEnabled(): void
Handle a grid change from the kernel
Returns#
void
Defined in#
onModelGridSize#
▸ Protected
onModelGridSize(): void
Handle a grid size change from the kernel
Returns#
void
Defined in#
onModelPageFormat#
▸ Protected
onModelPageFormat(): void
Handle a page format change from the kernel
Returns#
void
Defined in#
onModelPageSelected#
▸ Protected
onModelPageSelected(): void
Handle a page selection change from the kernel
Returns#
void
Defined in#
onModelScroll#
▸ Protected
onModelScroll(): void
Handle a scroll change from the kernel
Returns#
void
Defined in#
onModelSelectedCells#
▸ Protected
onModelSelectedCells(): void
Handle a selected cell change from the kernel
Returns#
void
Defined in#
onModelSourceChange#
▸ Protected
onModelSourceChange(): void
Handle the XML source changing in the kernel, subscribe to its value changing.
Returns#
void
Defined in#
onModelZoom#
▸ Protected
onModelZoom(): void
Handle a zoom change from the kernel
Returns#
void
Defined in#
onSourceValue#
▸ Protected
onSourceValue(): void
Handle the XML source’s value changing
Returns#
void
Defined in#
render#
▸ render(): void
Render the diagram, and schedule re-rerendering for when actually displayed.
Returns#
void
Overrides#
BoxView.render
Defined in#
translateToScroll#
▸ translateToScroll(): Object
Translate drawio view translation to scroll offsets
Ideally this would be the center of the viewport to allow for synced views
Returns#
Object
Name |
Type |
---|---|
|
|
|
|
Defined in#
waitForDisplayed#
▸ Protected
waitForDisplayed(): void
A low-tech way to wait until we are quite sure the diagram is displayed.
Returns#
void
Defined in#
xml#
▸ Protected
xml(value?
): any
Set or get the source.
Parameters#
Name |
Type |
---|---|
|
|
Returns#
any
Defined in#
packages/ipydrawio/src/widgets.ts:283
Copyright 2022 ipydrawio contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.