OrgChartModel

The OrgChartModel provides common functionality to interact with the OrgChart component.

Props

NameDescriptionType
addGraphUpdatedListener
Adds a listener called whenever organization chart items are shown or hidden.
(
listener: () => void
) => void
applyLayout
Refreshes the organization chart layout. If the incremental parameter is set to true, the layout considers certain items as fixed and arranges only the items contained in the incrementalItems array.
(
incremental: boolean,
incrementalItems: OrgChartItem[]
) => void
canHideSubordinates
Whether the subordinates of the given item are visible.
(
item: OrgChartItem
) => boolean
canHideSuperior
Whether the superior of the given item is visible.
(
item: OrgChartItem
) => boolean
canShowAll
Whether there are any hidden organization chart items to show.
() => boolean
canShowSubordinates
Whether the subordinates of the given item are hidden.
(
item: OrgChartItem
) => boolean
canShowSuperior
Whether the superior of the given item is hidden.
(
item: OrgChartItem
) => boolean
exportToPng
Exports the organization chart to a PNG Image. @throws Exception if the diagram cannot be exported. The exception may occur when the diagram contains images from cross-origin sources. In this case, disable ExportSettings.inlineImages and encode the icons manually to base64.
(
exportSettings: ExportSettings
) => Promise<void>
exportToSvg
Exports the organization chart to an SVG file. @throws Exception if the diagram cannot be exported. The exception may occur when the diagram contains images from cross-origin sources. In this case, disable ExportSettings.inlineImages and encode the icons manually to base64.
(
exportSettings: ExportSettings
) => Promise<void>
fitContent
Fits the organization chart inside the viewport.
() => void
getSearchHits
Retrieves the items that match the search currently.
() => OrgChartItem[]
getVisibleItems
Returns the currently visible items of the organization chart.
() => OrgChartItem[]
graphComponent
The yFiles GraphComponent used by the OrgChart component to display the graph. This property is intended for advanced users who have a familiarity with the yFiles for HTML library.
GraphComponent
hideSubordinates
Hides the subordinates of the given item.
(
item: OrgChartItem
) => Promise<void>
hideSuperior
Hides the superior of the given item.
(
item: OrgChartItem
) => Promise<void>
print
Exports and prints the organization chart.
(
printSettings: PrintSettings
) => Promise<void>
refresh
Triggers a re-rendering of the chart. This may become useful if properties in the data change and the visualization should update accordingly.
() => void
removeGraphUpdatedListener
Removes a listener added in OrgChartModel.addGraphUpdatedListener.
(
listener: () => void
) => void
showAll
Shows all items in the organization chart.
() => Promise<void>
showSubordinates
Shows the subordinates of the given item.
(
item: OrgChartItem
) => Promise<void>
showSuperior
Shows the superior of the given item.
(
item: OrgChartItem
) => Promise<void>
zoomIn
Increases the zoom level.
() => void
zoomOut
Decreases the zoom level.
() => void
zoomTo
Pans the viewport to the center of the given items.
(
items: (
| OrgChartItem
| OrgChartConnection
)[]
) => void
zoomToItem
Pans the viewport to center the given item.
(
item:
| OrgChartItem
| OrgChartConnection
) => void
zoomToOriginal
Resets the zoom level to 1.
() => void