View on GitHub

Attack Graphs Plugin for Draw.io

An Attack Graphs Extension for Draw.io

Graph Updates

There are serveral events that trigger an update of the graph or parts of the graph. Most of the events this plugin listens for are mxEvents, namely mxEvent.CHANGE, mxEvent.CELLS_REMOVED, mxEvent.CELLS_ADDED and mxEvent.ROOT. Other events are triggered when the user applies a global dialog and therewith changes settings that could affect the whole graph.

Trigger events

partly update

whole graph update

Calculations

During an update of parts of the graph, cell values will be recalculated from leafs to the roots of a graph. The recalculation consists of the execution of the aggregation function of the cell, followed by the execution of the computed attributes function of the cell. After the recalculation is done, mxGraph.refresh() is triggered which re-renders the graph.

Recalculated values are stored in the XML file of the graph. Calculations are done asynchronously using web-workers. Inside the web-workers, functions are evaluated in a sandbox using an implementation of a js interpreter supporting ES5.