Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add just a smidge more awesome to the dependencies graph and add a da…
…shboard link just for funs
  • Loading branch information
gashcrumb committed Sep 30, 2013
1 parent eff76b0 commit e599882
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
Expand Up @@ -87,16 +87,17 @@ module ForceGraph {
var canvas = $($element);

// TODO: determine the canvas size dynamically
var h = 800;
var w = 1024;
var h = canvas.height();
var w = canvas.width();
var i = 0;

canvas.children("svg").remove();

// First we create the top level SVG object
// TODO maybe pass in the width/height
$scope.svg = d3.select(canvas[0]).append("svg")
.attr("width", w)
.attr("height", h);
.attr("width", "100%")
.attr("height", "90%");

// The we add the markers for the arrow tips
$scope.svg.append("svg:defs").selectAll("marker")
Expand Down Expand Up @@ -201,4 +202,4 @@ module ForceGraph {
};

};
}
}
Expand Up @@ -70,14 +70,19 @@
</style>

<div ng-controller="Osgi.ServiceDependencyController">
<div ng-hide="inDashboard" class="add-link">
<a ng-href="{{addToDashboardLink()}}" title="Add this view to a Dashboard"><i class="icon-share"></i></a>
</div>

<div id="pop-up">
<div id="pop-up-title"></div>
<div id="pop-up-content"></div>
</div>

<div id="canvas">
<div hawtio-force-graph graph="graph" link-distance="100" charge="-300" nodesize="10"></div>
<div class="row-fluid">
<div class="span12 canvas">
<div hawtio-force-graph graph="graph" link-distance="100" charge="-300" nodesize="10" style="min-height: 800px"></div>
</div>
</div>

</div>
13 changes: 13 additions & 0 deletions hawtio-web/src/main/webapp/app/osgi/js/svc-dependencies.ts
Expand Up @@ -6,6 +6,19 @@ module Osgi {
Core.$apply($scope);
});

$scope.addToDashboardLink = () => {
var href="#/osgi/dependencies";
var title="OSGi Dependencies";
var size = angular.toJson({
size_x: 2,
size_y: 2
});
return "#/dashboard/add?tab=dashboard" +
"&href=" + encodeURIComponent(href) +
"&size=" + encodeURIComponent(size) +
"&title=" + encodeURIComponent(title);
};

createGraph()

function createGraph() {
Expand Down
13 changes: 13 additions & 0 deletions hawtio-web/src/main/webapp/css/site-base.css
Expand Up @@ -1995,3 +1995,16 @@ a.dashboard-link:hover {
font-weight: bold;
font-size: 20px;
}

.add-link {
position: absolute;
right: 20px;
top: 130px;
background: white;
border-radius: 4px;
width: 22px;
height: 19px;
border: 1px solid #d4d4d4;
text-align: center;

}

0 comments on commit e599882

Please sign in to comment.