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

chargeDistance is not a function #575

Open
dschere opened this issue Jun 17, 2016 · 2 comments
Open

chargeDistance is not a function #575

dschere opened this issue Jun 17, 2016 · 2 comments

Comments

@dschere
Copy link

dschere commented Jun 17, 2016

This code below:

Alchemy.prototype.generateLayout = function(instance) {
var a;
a = instance;
return function(start) {
var conf;
if (start == null) {
start = false;
}
conf = a.conf;
a.layout = new Layout(a);

  return a.force = d3.layout.force().size([conf.graphWidth(), conf.graphHeight()]).theta(1.0).gravity(a.layout.gravity()).friction(a.layout.friction()).nodes(a.elements.nodes.d3).links(a.elements.edges.d3).linkDistance(function(link) {
    return a.layout.linkDistancefn(link);
  }).linkStrength(function(link) {
    return a.layout.linkStrength(link);
  }).charge(a.layout.charge()).chargeDistance(a.layout.chargeDistance());
};

};

Throws the following exception:

Uncaught TypeError: d3.layout.force(...).size(...).theta(...).gravity(...).friction(...).nodes(...).links(...).linkDistance(...).linkStrength(...).charge(...).chargeDistance is not a function

After tinkering around I narrowed it down to:

  }).charge(a.layout.charge()).   >>> chargeDistance <<<   (a.layout.chargeDistance());
@dschere
Copy link
Author

dschere commented Jun 17, 2016

Was able to work around by using a url for the dataSource and not an object.

@jchock
Copy link

jchock commented Jun 21, 2016

Could you tell me how you included your CDNs? I've attempted several combinations already, using both downloaded and URL methods. I seem to be having the same issue as the person in #574 . Thanks!

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

No branches or pull requests

2 participants