Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sankeys made of a single node with a circular link #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions dist/d3-sankey-circular.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function sankeyCircular () {
y1 = y1 * scaleY;

graph.nodes.forEach(function (node) {
node.x0 = x0 + node.column * ((x1 - x0 - dx) / maxColumn);
node.x0 = maxColumn > 0 ? x0 + node.column * ((x1 - x0 - dx) / maxColumn) : x0;
node.x1 = node.x0 + dx;
});

Expand Down Expand Up @@ -1474,7 +1474,6 @@ function fillHeight(graph, y0, y1) {
}
}


function resolveNodesOverlap(graph, y0, py) {
var columns = nest().key(function (d) {
return d.column;
Expand Down Expand Up @@ -1511,4 +1510,3 @@ function resolveNodesOverlap(graph, y0, py) {
}

export { sankeyCircular, addCircularPathData, center as sankeyCenter, left as sankeyLeft, right as sankeyRight, justify as sankeyJustify };

2 changes: 1 addition & 1 deletion dist/d3-sankey-circular.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
y1 = y1 * scaleY;

graph.nodes.forEach(function (node) {
node.x0 = x0 + node.column * ((x1 - x0 - dx) / maxColumn);
node.x0 = maxColumn > 0 ? x0 + node.column * ((x1 - x0 - dx) / maxColumn) : x0;
node.x1 = node.x0 + dx;
});

Expand Down
2 changes: 1 addition & 1 deletion src/sankeyCircular.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ import findCircuits from "elementary-circuits-directed-graph";
y1 = y1 * scaleY;

graph.nodes.forEach(function (node) {
node.x0 = x0 + (node.column * ((x1 - x0 - dx) / maxColumn))
node.x0 = maxColumn > 0 ? (x0 + (node.column * ((x1 - x0 - dx) / maxColumn))) : x0;
node.x1 = node.x0 + dx
})

Expand Down