SupplyChainModel

The SupplyChainModel provides common functionality to interact with the SupplyChain component.

Props

NameDescriptionType
applyLayout
Refreshes the supply chain 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: SupplyChainItem[],
fixedItem: SupplyChainItem,
fitViewport: boolean
) => Promise<void>
canClearConnectedItemsHighlight
Whether there is currently a connected items highlight visualized in the graph that can be cleared.
() => boolean
canCollapseItem
Whether an item can be collapsed. An item can be collapsed when it is a grouping item, and it is in the expanded state.
(
item: SupplyChainItem
) => boolean
canExpandItem
Whether an item can be expanded. An item can be expanded when it is a grouping item, and it is in the collapsed state.
(
item: SupplyChainItem
) => boolean
canShowAll
Whether there are any hidden items to show.
() => boolean
clearConnectedItemsHighlight
Clears the connected items highlight visualization.
() => void
collapseItem
Collapses an item and all it’s children recursively.
(
item: SupplyChainItem
) => void
expandItem
Expands an item and all it’s children recursively.
(
item: SupplyChainItem
) => void
exportToPng
Exports the supply chain 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 supply chain 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>
filterForConnectedItems
Filters the graph for all items that are connected to the given item. In contrast to SupplyChainModel.showGenealogy, this method does not clear the filtering state before calculating the genealogy and thus allows for a drill-down in the currently displayed filtered state.
(
item: SupplyChainItem
) => void
fitContent
Fits the chart inside the viewport.
(insets: number) => void
getChildren
Returns all children of an item recursively.
(
item: SupplyChainItem
) => SupplyChainItem[]
getSearchHits
Retrieves the items that match the search currently.
() => SupplyChainItem[]
graphComponent
The yFiles GraphComponent used by the SupplyChain component to display the graph. This property is intended for advanced users who have a familiarity with the yFiles for HTML library.
GraphComponent
highlightConnectedItems
Highlights an item and all other items connected to it. Two items are connected when there exists an edge path between them, even if there are several hops (items) on the path.
(
item: SupplyChainItem
) => void
isConnection
Whether the item is a connection.
(
item: any
) => item is
| SupplyChainConnection
| FoldingConnection
isFoldingConnection
Whether a connection groups multiple “simple” connections. See FoldingConnection.
(
item: any
) => item is FoldingConnection
isGroupItem
Whether the item can have children.
(
item: SupplyChainItem
) => boolean
print
Exports and prints the supply chain 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
showAll
Shows all items in the supply chain.
() => void
showGenealogy
Filters the graph for all items that are connected to the given item. Connections can be over multiple hops.
(
item: SupplyChainItem
) => void
showLevel
Expands/collapses the graph to the given level. The top level is 1.
(level: number) => void
toggleExpansionState
Toggles the expansion state of a grouping item.
(
item: SupplyChainItem
) => 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: (
| SupplyChainItem
| SupplyChainConnection
| FoldingConnection
)[]
) => void
zoomToOriginal
Resets the zoom level to 1.
() => void