Skip to content

Commit

Permalink
#790 use different sizes for brokers/destinations
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Nov 29, 2013
1 parent 0064351 commit 02804c9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Expand Up @@ -284,7 +284,7 @@

<div class="row-fluid">
<div class="span12 canvas">
<div hawtio-force-graph graph="graph" link-distance="50" charge="-120" nodesize="10"
<div hawtio-force-graph graph="graph" link-distance="150" charge="-600" nodesize="10"
style="min-height: 800px"></div>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions hawtio-web/src/main/webapp/app/fabric/js/brokerDiagram.ts
Expand Up @@ -16,6 +16,12 @@ module Fabric {
producer: true
};

$scope.shapeSize = {
broker: 20,
queue: 14,
topic: 14
};

var graphBuilder = new ForceGraph.GraphBuilder();

angular.forEach($scope.showFlags, (value, key) => {
Expand Down Expand Up @@ -282,6 +288,10 @@ module Fabric {
node['name'] = id;
}
if (node) {
var size = $scope.shapeSize[typeName];
if (size && !node['size']) {
node['size'] = size;
}
// lets not add nodes which are defined as being disabled
var enabled = $scope.showFlags[typeName];
if (enabled || !angular.isDefined(enabled)) {
Expand Down
1 change: 1 addition & 0 deletions hawtio-web/src/main/webapp/app/forcegraph/doc/developer.md
Expand Up @@ -86,6 +86,7 @@ Below is an example to build a bundle node within the OSGI dependency viewer:
name: bundle.SymbolicName,
type: "bundle",
navUrl: "#/osgi/bundle/" + bundle.Identifier,
size: 20,
image: {
url: "/hawtio/app/osgi/img/bundle.png",
width: 32,
Expand Down
Expand Up @@ -207,7 +207,9 @@ module ForceGraph {
.attr("class", (d) => {
return d.type;
})
.attr("r", $scope.nodesize);
.attr("r", (d) => {
return d.size || $scope.nodesize;
});

// Add the labels to the viewport
$scope.graphLabels = $scope.viewport.append("svg:g").selectAll("g")
Expand Down

0 comments on commit 02804c9

Please sign in to comment.