Skip to content

Commit 5f89d78

Browse files
committed
fix indentation
1 parent bde2a79 commit 5f89d78

File tree

2 files changed

+21
-29
lines changed

2 files changed

+21
-29
lines changed

src/traces/sankey/convert-to-d3-sankey.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function(trace) {
2424
var i;
2525
for(i = 0; i < linkSpec.value.length; i++) {
2626
var val = linkSpec.value[i];
27-
// remove negative values, but keep zeros with special treatment
27+
// remove negative values, but keep zeros with special treatment
2828
var source = linkSpec.source[i];
2929
var target = linkSpec.target[i];
3030
if(!(val > 0 && isIndex(source, nodeCount) && isIndex(target, nodeCount))) {
@@ -62,7 +62,7 @@ module.exports = function(trace) {
6262
} else removedNodes = true;
6363
}
6464

65-
// need to re-index links now, since we didn't put all the nodes in
65+
// need to re-index links now, since we didn't put all the nodes in
6666
if(removedNodes) {
6767
for(i = 0; i < links.length; i++) {
6868
links[i].source = nodeIndices[links[i].source];

src/traces/sankey/d3-sankey.js

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ module.exports = function() {
149149
y1a = d.target.y + d.ty,
150150
y1b = y1a + d.dy;
151151
return 'M' + x0 + ',' + y0a +
152-
'C' + x2 + ',' + y0a +
153-
' ' + x3 + ',' + y1a +
154-
' ' + x1 + ',' + y1a +
155-
'L' + x1 + ',' + y1b +
156-
'C' + x3 + ',' + y1b +
157-
' ' + x2 + ',' + y0b +
158-
' ' + x0 + ',' + y0b +
159-
'Z';
152+
'C' + x2 + ',' + y0a +
153+
' ' + x3 + ',' + y1a +
154+
' ' + x1 + ',' + y1a +
155+
'L' + x1 + ',' + y1b +
156+
'C' + x3 + ',' + y1b +
157+
' ' + x2 + ',' + y0b +
158+
' ' + x0 + ',' + y0b +
159+
'Z';
160160
}
161161

162162
link.curvature = function(_) {
@@ -168,8 +168,8 @@ module.exports = function() {
168168
return link;
169169
};
170170

171-
// Populate the sourceLinks and targetLinks for each node.
172-
// Also, if the source and target are not objects, assume they are indices.
171+
// Populate the sourceLinks and targetLinks for each node.
172+
// Also, if the source and target are not objects, assume they are indices.
173173
function computeNodeLinks() {
174174
nodes.forEach(function(node) {
175175
node.sourceLinks = [];
@@ -186,7 +186,7 @@ module.exports = function() {
186186
});
187187
}
188188

189-
// Compute the value (size) of each node by summing the associated links.
189+
// Compute the value (size) of each node by summing the associated links.
190190
function computeNodeValues() {
191191
nodes.forEach(function(node) {
192192
node.value = Math.max(
@@ -196,10 +196,10 @@ module.exports = function() {
196196
});
197197
}
198198

199-
// Iteratively assign the breadth (x-position) for each node.
200-
// Nodes are assigned the maximum breadth of incoming neighbors plus one;
201-
// nodes with no incoming links are assigned breadth zero, while
202-
// nodes with no outgoing links are assigned the maximum breadth.
199+
// Iteratively assign the breadth (x-position) for each node.
200+
// Nodes are assigned the maximum breadth of incoming neighbors plus one;
201+
// nodes with no incoming links are assigned breadth zero, while
202+
// nodes with no outgoing links are assigned the maximum breadth.
203203
function computeNodeDepths() {
204204
var remainingNodes = nodes,
205205
nextNodes,
@@ -228,14 +228,6 @@ module.exports = function() {
228228
scaleNodeBreadths((size[0] - dx) / (x - 1));
229229
}
230230

231-
// function moveSourcesRight() {
232-
// nodes.forEach(function(node) {
233-
// if (!node.targetLinks.length) {
234-
// node.x = min(node.sourceLinks, function(d) { return d.target.x; }) - 1;
235-
// }
236-
// });
237-
// }
238-
239231
function moveSinksRight(x) {
240232
nodes.forEach(function(node) {
241233
if(!node.sourceLinks.length) {
@@ -258,7 +250,7 @@ module.exports = function() {
258250
.entries(nodes)
259251
.map(function(d) { return d.values; });
260252

261-
//
253+
//
262254
initializeNodeDepth();
263255
resolveCollisions();
264256
for(var alpha = 1; iterations > 0; --iterations) {
@@ -320,7 +312,7 @@ module.exports = function() {
320312
n = nodes.length,
321313
i;
322314

323-
// Push any overlapping nodes down.
315+
// Push any overlapping nodes down.
324316
nodes.sort(ascendingDepth);
325317
for(i = 0; i < n; ++i) {
326318
node = nodes[i];
@@ -329,12 +321,12 @@ module.exports = function() {
329321
y0 = node.y + node.dy + py;
330322
}
331323

332-
// If the bottommost node goes outside the bounds, push it back up.
324+
// If the bottommost node goes outside the bounds, push it back up.
333325
dy = y0 - py - size[1];
334326
if(dy > 0) {
335327
y0 = node.y -= dy;
336328

337-
// Push any overlapping nodes back up.
329+
// Push any overlapping nodes back up.
338330
for(i = n - 2; i >= 0; --i) {
339331
node = nodes[i];
340332
dy = node.y + node.dy + py - y0;

0 commit comments

Comments
 (0)