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

Sankey Diagram layout error with 'too many' nodes #103

Open
benjmyers opened this issue Aug 14, 2014 · 2 comments
Open

Sankey Diagram layout error with 'too many' nodes #103

benjmyers opened this issue Aug 14, 2014 · 2 comments

Comments

@benjmyers
Copy link

First off, thanks for the existing work on this plugin!

In using the plugin, I've found that if the number of nodes is large enough and the passed in height small enough, the layout will fail. I initially noticed this by trying to increase nodePadding from its default value. This 'bug' occurs inside initializeNodeDepth() when ky becomes negative.

  var ky = d3.min(nodesByBreadth, function(nodes) {
    return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);
  });

While mathematically this isn't a bug, I would expect the layout to either not rely on a hard coded height or throw an error if there is not enough vertical space for the quantity of nodes.

@mmmtoasted
Copy link

I have also encountered this issue, is there an plan to enhance this feature allow the ky to account for the height and width of the svg?

@ckathleen
Copy link

I am having the same problem

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

3 participants