Data Structures

Graphileon uses a few data structures, objects of information, structured in a predetermined and consistent way. If any Function uses such data structure, you can be sure it contains at least the properties described in the structure definition on this page (it is, however, possible that Functions add their own properties to these structures).

Node

The node structure can be used to pass around graph nodes between stores and visualisations.

{
	id          	: Integer,  	// Node ID
	labels      	: [String], 	// Array of label names
	properties  	: {}        	// Properties of the node
	meta        	: {         	// (optional) Node metadata
		store   : String    		// (optional) The name of the store this node exists in. If omitted, defaults to 'application'.
	}
}

Note More properties may be added to the node structure for visualization purposes (e.g. in NetworkView and YFilesView).

Relation

The relation structure represents relations between nodes.

{
	id          : Integer,  	// Relation ID
	type        : String,   	// Single relation type
	properties  : {},       	// Properties of the relation
	source      : Integer,  	// Node ID this relation originates from
	target      : Integer,  	// Node ID this relation is directed towards
	meta        : {         	// (optional) Relation metadata
		store   : String    	// (optional) The name of the store this relation exists in. If omitted, defaults to 'application'.
	}
}

Note More properties may be added to the relation structure for visualization purposes (e.g. in NetworkView and YFilesView).

The group structure represents a group of nodes.

{
	id          : Integer,  	// Group ID
	name		: String,		// Name of the group
	children 	: []       		// Nodes in the group (array of Node objects) 
}

Columns

Some Functions use tabular data, which can be fine-tuned using column definitions.

A valid column definition is as follows:

{
	index	: Number|String,	// Determines the position of the index, starting at 0 (e.g. index 2 will be the 3rd column)
	label	: String,			// Human-readable name of the column
	values	: String			// Key of each object in the original data array to use for this column
}

As Function parameter, each column gets its own key (to be chosen freely). Full column example with data:

{
	"#data": [
		{name: "John", age: 42},
		{name: "Sophie", age: 37}
	],
	"$columns.myFirstColumn.index": 0,
	"$columns.myFirstColumn.label": "First Name",
	"$columns.myFirstColumn.values": "name",
	"$columns.mySecondColumn.values": "age"
}

The column definition properties 'label' and 'index' can be ommitted. The index defaults to 0; the label to the 'values' property.

Selectors

Some Functions can target specific data points, e.g. to apply styling or filters. Selectors are css-like strings to match specific nodes, relations or other entities. The syntax for selectors is as follows:

Selector Description
node: applies to any node
node:MyLabel applies to any node with a :MyLabel label.
node[myParam] applies to any node with a .myParam property.
node[myParam=abc] applies to any node with the .myParam property having the specific value 'abc'. Besides the = operator, supported operators are >, <, >=, <=, and !=
node{myParam=abc} applies to any node with .myParam set directly on the node root (as opposed to properties), with the value 'abc'. This can be used e.g. for node positions (x, y, fixed), meta.store and other visualisation properties. The same operators are supported as for properties.
{any entity} applies to any entity of the specified type. E.g. rel would match any relation, group would match any group (if supported by the Function). Label/type, property and root selectors apply to any entity (if applicable for that entity).

Filters

Some Functions can use Filters to show/hide or highlight objects. The definition of such filters is as follows:

{
    filters.{name1}.filter  : Selector                              // a valid node/rel selector (see Selectors)
    filters.{name1}.status  : -1 (hide), 0 (inactive) or 1 (show)
    filters.{name2}.filter  : Selector                              // a valid node/rel selector (see Selectors)
    filters.{name2}.status  : -1 (hide), 0 (inactive) or 1 (show)
    ...etc
}

Styles

Some Functions can apply GraphStyles locally.

A valid style definitions object is an object with selectors as keys and style objects as values. Example:

{
    'node:MyLabel[name=MyName]': {
        fillColor: '#ff0000',
        display: 'rectangle'
    },
    'rel:MyType[myProperty=MyValue]': {
        width: 3
    }
}