Refresh Graph
This commit is contained in:
parent
b0d79adc8e
commit
8b7ee2ca95
1 changed files with 195 additions and 193 deletions
|
@ -5,14 +5,23 @@
|
||||||
*/
|
*/
|
||||||
mainApp.controller('homeCtrl', ['$scope', 'Compute', '$rootScope', 'Loading', 'Identity', 'Image', function ($scope, Compute, $rootScope, Loading, Identity, Image)
|
mainApp.controller('homeCtrl', ['$scope', 'Compute', '$rootScope', 'Loading', 'Identity', 'Image', function ($scope, Compute, $rootScope, Loading, Identity, Image)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
graph = new joint.dia.Graph;
|
||||||
|
paper = new joint.dia.Paper({
|
||||||
|
el: $('#graphHolder'),
|
||||||
|
width: $('#graphHolder').width(),
|
||||||
|
//height: test.height,
|
||||||
|
model: graph,
|
||||||
|
gridSize: 1,
|
||||||
|
eractive: false
|
||||||
|
});
|
||||||
|
|
||||||
$scope.raiseShowMachineCreationEvent = function () {
|
$scope.raiseShowMachineCreationEvent = function () {
|
||||||
$rootScope.$broadcast("showMachineCreationEvent", Compute.getData().axioms);
|
$rootScope.$broadcast("showMachineCreationEvent", Compute.getData().axioms);
|
||||||
};
|
};
|
||||||
|
|
||||||
var displayMachine = function () {
|
var displayMachine = function () {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var machineNames = [];
|
var machineNames = [];
|
||||||
var i = 0;
|
var i = 0;
|
||||||
$.each(Compute.getData().machines, function () {
|
$.each(Compute.getData().machines, function () {
|
||||||
|
@ -47,20 +56,13 @@ mainApp.controller('homeCtrl', ['$scope', 'Compute', '$rootScope', 'Loading', 'I
|
||||||
}, joint.shapes.basic.Rect.prototype.defaults)
|
}, joint.shapes.basic.Rect.prototype.defaults)
|
||||||
});
|
});
|
||||||
|
|
||||||
var graph = new joint.dia.Graph;
|
|
||||||
var paper = new joint.dia.Paper({
|
this.paper.$el.css('pointer-events', 'none');
|
||||||
el: $('#graphHolder'),
|
|
||||||
width: $('#graphHolder').width(),
|
|
||||||
//height: test.height,
|
|
||||||
model: graph,
|
|
||||||
gridSize: 1,
|
|
||||||
eractive: false
|
|
||||||
});
|
|
||||||
paper.$el.css('pointer-events', 'none');
|
|
||||||
var cells = buildGraphFromAdjacencyList(vmList);
|
var cells = buildGraphFromAdjacencyList(vmList);
|
||||||
|
|
||||||
graph.addCells(cells);
|
this.graph.addCells(cells);
|
||||||
var test = joint.layout.DirectedGraph.layout(graph, {
|
console.log(this.graph);
|
||||||
|
var test = joint.layout.DirectedGraph.layout(this.graph, {
|
||||||
etLinkVertices: false,
|
etLinkVertices: false,
|
||||||
//Top to bottom generation
|
//Top to bottom generation
|
||||||
ankDir: "TB",
|
ankDir: "TB",
|
||||||
|
@ -69,7 +71,7 @@ mainApp.controller('homeCtrl', ['$scope', 'Compute', '$rootScope', 'Loading', 'I
|
||||||
ankSep: 50
|
ankSep: 50
|
||||||
});
|
});
|
||||||
|
|
||||||
paper.setDimensions(test.width, test.height);
|
this.paper.setDimensions(test.width, test.height);
|
||||||
|
|
||||||
$(".Member").bind('click', function () {
|
$(".Member").bind('click', function () {
|
||||||
$scope.raiseShowMachineDetailsEvent($(this).attr('model-id'));
|
$scope.raiseShowMachineDetailsEvent($(this).attr('model-id'));
|
||||||
|
|
Loading…
Add table
Reference in a new issue