Newton Graph Library

Newton Graph Library

Global

Type Definitions

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 String

    Reference identifier to source node

  • target String

    Reference 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 String

    Identifier referenced in Links.

  • label String

    Text label for the Node.

  • status String

    This can be up, down or deploying and is used for styling.