summaryrefslogtreecommitdiff
path: root/media
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-05 15:51:06 -0500
committerDan McGee <dan@archlinux.org>2011-10-05 15:51:06 -0500
commitf867f9469f3baead53dbf8dc7547a318541efece (patch)
tree512e0a5341faf0d0e86d80d964dffce52c0da7ce /media
parentd5063bd1d2cae79df7ce6e826c7413fed61ff9db (diff)
JSLint cleanupsrelease_2011-10-05
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'media')
-rw-r--r--media/visualize.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/media/visualize.js b/media/visualize.js
index c1ea598b..c47033ab 100644
--- a/media/visualize.js
+++ b/media/visualize.js
@@ -1,8 +1,8 @@
function packages_treemap(chart_id, orderings, default_order) {
var jq_div = $(chart_id),
color = d3.scale.category20();
- key_func = function(d) { return d.key; },
- value_package_count = function(d) { return d.count; };
+ var key_func = function(d) { return d.key; };
+ var value_package_count = function(d) { return d.count; };
var treemap = d3.layout.treemap()
.size([jq_div.width(), jq_div.height()])
@@ -23,8 +23,12 @@ function packages_treemap(chart_id, orderings, default_order) {
var prop_px = function(prop, offset) {
return function(d) {
var dist = d[prop] + offset;
- if (dist > 0) return dist + "px";
- else return "0px";
+ if (dist > 0) {
+ return dist + "px";
+ }
+ else {
+ return "0px";
+ }
};
};
@@ -36,10 +40,11 @@ function packages_treemap(chart_id, orderings, default_order) {
var fetch_for_ordering = function(order) {
d3.json(order.url, function(json) {
- var nodes = d3_div.data([json]).selectAll("div").data(treemap.nodes, key_func);
+ var nodes = d3_div.data([json]).selectAll("div")
+ .data(treemap.nodes, key_func);
/* start out new nodes in the center of the picture area */
var w_center = jq_div.width() / 2;
- var h_center = jq_div.height() / 2;
+ h_center = jq_div.height() / 2;
nodes.enter().append("div")
.attr("class", "treemap-cell")
.attr("title", function(d) { return d.name; })