Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

instead of using size[0], width variable will trigger wrong size of the sankey diagram #144

Open
Yanz2015 opened this issue Jan 12, 2016 · 0 comments

Comments

@Yanz2015
Copy link

function computeNodeBreadths() {
var remainingNodes = nodes,
nextNodes,
x = 0;

while (remainingNodes.length) {
  nextNodes = [];
  remainingNodes.forEach(function(node) {
    node.x = x;
    node.dx = nodeWidth;
    node.sourceLinks.forEach(function(link) {
      nextNodes.push(link.target);
    });
  });
  remainingNodes = nextNodes;
  ++x;
}

//
moveSinksRight(x);
scaleNodeBreadths((width - nodeWidth) / (x - 1));

}

in this function the last line scaleNodeBreadthes, the variable width is using a context variable, but not the size[0], which is given to initialize the sankey diagram. so it will trigger wrong layout when the width variable is wrong evaluated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant