Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add missing semicolons.

  • Loading branch information...
commit 56f25a3b54446c921e23a7360f1a0dea2508870f 1 parent 5caed3e
@jasondavies jasondavies authored
View
4 box/box.js
@@ -187,8 +187,8 @@ d3.box = function() {
boxTick.enter().append("text")
.attr("class", "box")
.attr("dy", ".3em")
- .attr("dx", function(d, i) { return i & 1 ? 6 : -6 })
- .attr("x", function(d, i) { return i & 1 ? width : 0 })
+ .attr("dx", function(d, i) { return i & 1 ? 6 : -6; })
+ .attr("x", function(d, i) { return i & 1 ? width : 0; })
.attr("y", x0)
.attr("text-anchor", function(d, i) { return i & 1 ? "start" : "end"; })
.text(format)
View
63 force_labels/force_labels.js
@@ -1,56 +1,57 @@
(function() {
d3.force_labels = function force_labels() {
- var labels = d3.layout.force()
+ var labels = d3.layout.force();
// Update the position of the anchor based on the center of bounding box
function updateAnchor() {
- if (!labels.selection) return
+ if (!labels.selection) return;
labels.selection.each(function(d) {
var bbox = this.getBBox(),
- x=bbox.x+bbox.width/2,
- y=bbox.y+bbox.height/2
+ x = bbox.x + bbox.width / 2,
+ y = bbox.y + bbox.height / 2;
- d.anchorPos.x=x
- d.anchorPos.y=y
+ d.anchorPos.x = x;
+ d.anchorPos.y = y;
// If a label position does not exist, set it to be the anchor position
- if (d.labelPos.x==null) {
- d.labelPos.x=x
- d.labelPos.y=y
+ if (d.labelPos.x == null) {
+ d.labelPos.x = x;
+ d.labelPos.y = y;
}
- })
+ });
}
//The anchor position should be updated on each tick
- labels.on("tick.labels",updateAnchor)
+ labels.on("tick.labels", updateAnchor);
// This updates all nodes/links - retaining any previous labelPos on updated nodes
labels.update = function(selection) {
- labels.selection = selection
- var nodes=[],links=[];
+ labels.selection = selection;
+ var nodes = [], links = [];
selection[0].forEach(function(d) {
if(d && d.__data__) {
- var data = d.__data__
+ var data = d.__data__;
- if (!d.labelPos) d.labelPos = {fixed:false}
- if (!d.anchorPos) d.anchorPos = {fixed:true}
+ if (!d.labelPos) d.labelPos = {fixed: false};
+ if (!d.anchorPos) d.anchorPos = {fixed: true};
// Place position objects in __data__ to make them available through
// d.labelPos/d.anchorPos for different elements
- data.labelPos = d.labelPos
- data.anchorPos = d.anchorPos
+ data.labelPos = d.labelPos;
+ data.anchorPos = d.anchorPos;
- links.push({target:d.anchorPos,source:d.labelPos})
- nodes.push(d.anchorPos)
- nodes.push(d.labelPos)
+ links.push({target: d.anchorPos, source: d.labelPos});
+ nodes.push(d.anchorPos);
+ nodes.push(d.labelPos);
}
- })
- labels.stop()
- .nodes(nodes)
- .links(links)
- updateAnchor()
- labels.start()
- }
- return labels
- }
-})()
+ });
+ labels
+ .stop()
+ .nodes(nodes)
+ .links(links);
+ updateAnchor();
+ labels.start();
+ };
+ return labels;
+ };
+})();
View
2  urlencode/urlencode-test.js
@@ -24,7 +24,7 @@ suite.addBatch({
"can be modified via array methods, albeit unsafely": function(urlencode) {
var u = urlencode("foo", 1).and("bar", 2).and("baz", 3);
u.splice(1, 1);
- u.push("unsafe=true")
+ u.push("unsafe=true");
u.sort();
assert.strictEqual(u + "", "baz=3&foo=1&unsafe=true");
},
Please sign in to comment.
Something went wrong with that request. Please try again.