summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/view/graph_view.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index 8baa1adc..63b1a075 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -1118,7 +1118,11 @@ function GraphView(spec) {
return "translate(" + x + "," + y + ")";
}
- function transform(d) { return translate(d.bx, d.by); }
+ function transform(d, istext) {
+ var bbox = $('#' + d.id)[0].getBBox();
+
+ return translate(d.bx - bbox.width / 2, d.by - bbox.height / 2);
+ }
// transform nodes first to record bubble x & y (bx & by)
node.attr("transform", transform);
node_text.attr("transform", transform);