Skip to content
This repository was archived by the owner on Nov 7, 2018. It is now read-only.
This repository was 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

Description

@Yanz2015

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions