For Dashboard Designers Reference Data Structures
Friday, March 15, 2019 10:25 PMData Structures
InterActor 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 : int, // 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 : int // X-coordinate of node position in visualization
py : int // Y-coordinate of node position in visualization
}
Relation
The relation structure represents relations between nodes.
{
id : int, // Relation ID
type : string, // Single relation type
properties : {}, // Properties of the relation
source : int, // Node ID this relation originates from
target : int, // Node ID this relation is directed towards
meta : { // Relation metadata
store : string // Neo4j store this relation exists in
}
}
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 order of the columns (low indexes first)
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": -1,
"$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.