Type Definitions
Link
A link is an Object with references to source and target Nodes. Consider the following
const nodes = [
{ id: 'a', label: 'Frontend' },
{ id: 'b', label: 'Backend' },
{ id: 'c', label: 'Database' },
]
const links = [
{ source: 'a', target: 'b' }, // Frontend requires Backend
{ source: 'b', target: 'c' } // Backend requires Database
]
Note that identifiers must be Strings.
Type
-
Object
Properties
-
source
StringReference identifier to source node
-
target
StringReference identifier to target node
Node
A node is an Object with node properties e.g. name, status, etc. These attributes are user defined.
The standard and minimum attributes include:
let node = {
status: 'up', // used for styling
id: 'web-frontend', // identifier used in in links
label: 'Web Frontend' // text label
}
Note that ids must be unique and are used in referencing Links.
Type
-
Object
Properties
-
id
StringIdentifier referenced in Links.
-
label
StringText label for the Node.
-
status
StringThis can be
up,downordeployingand is used for styling.