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 Neo4j and visualisations.

{
	id          	: Integer,  	// Node ID
	labels      	: [String], 	// Array of label names
	properties  	: {}        	// Properties of the node
	meta        	: {         	// Node metadata
		store   : String    		// Neo4j store this node exists in
	}
	px		: Integer				// X-coordinate of node position in visualization
	py		: Integer				// Y-coordinate of node position in visualization
}

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        : {         	// Relation metadata
		store   : String    	// Neo4j store this relation exists in
	}
}

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.