From efb540572a5e63fe6faa8a58e89af21d7a62a552 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Tue, 5 Nov 2013 13:05:15 +0100 Subject: [PATCH] Group support on data level, refs #43 --- the-graph-group/the-graph-group.html | 11 +++++++++++ the-graph-groups/the-graph-groups.html | 15 +++++++++++++++ the-graph/the-graph.html | 24 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 the-graph-group/the-graph-group.html create mode 100644 the-graph-groups/the-graph-groups.html diff --git a/the-graph-group/the-graph-group.html b/the-graph-group/the-graph-group.html new file mode 100644 index 00000000..471b9e49 --- /dev/null +++ b/the-graph-group/the-graph-group.html @@ -0,0 +1,11 @@ + + + + + diff --git a/the-graph-groups/the-graph-groups.html b/the-graph-groups/the-graph-groups.html new file mode 100644 index 00000000..2bd24d72 --- /dev/null +++ b/the-graph-groups/the-graph-groups.html @@ -0,0 +1,15 @@ + + + + + + + diff --git a/the-graph/the-graph.html b/the-graph/the-graph.html index 5c45297a..b8316757 100644 --- a/the-graph/the-graph.html +++ b/the-graph/the-graph.html @@ -1,4 +1,5 @@ + @@ -27,6 +28,11 @@ + + + @@ -59,6 +65,7 @@ edges: [], initials: [], exports: [], + groups: [], library: null, ready: function () { this._pan = { x: 0, y: 0 }; @@ -396,6 +403,7 @@ this.edges = []; this.initials = []; this.exports = []; + this.groups = []; // Convert processes to an array for (var index in this.graph.processes) { var p = this.graph.processes[index]; @@ -429,6 +437,12 @@ this.graph.exports.forEach(function (exp) { this.exports.push(exp); }.bind(this)); + if (!this.graph.groups) { + this.graph.groups = []; + } + this.graph.groups.forEach(function (group) { + this.groups.push(group); + }.bind(this)); this.calcMinMax(); }, @@ -534,6 +548,7 @@ var definition = { properties: this.graph.properties, exports: [], + groups: [], processes: {}, connections: [] }; @@ -582,6 +597,15 @@ public: exp.public }); }); + this.$.groups.getGroups().forEach(function(group) { + definition.groups.push({ + name: group.name, + nodes: group.nodes, + metadata: { + label: group.label + } + }); + }); return definition; } });