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

NVD3 Recipe: undefined is not a function with NVD3 v1.7.1 and D3 v3.5.5 #15

Closed
anujsrc opened this issue May 6, 2015 · 2 comments
Closed

Comments

@anujsrc
Copy link

anujsrc commented May 6, 2015

The NVD3 recipe of line chart fails with undefined is not a function at the last line of this snippet-

...
(.addGraph
    js/nv
    (fn []
      (let [chart (.. js/nv -models lineChart
...

To reproduce this issue, just bump the version of NVD3 and D3 as shown below-

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <div id="app"> Loading... </div>
    <!-- nvd3 -->
    <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.js"></script>
    <link href="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.7.1/nv.d3.css" rel="stylesheet">
    <script src="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.7.1/nv.d3.js"></script>

    <script src="/js/app.js"></script>
  </body>
</html>

Now, if you access the demo it will fail with Uncaught TypeError: undefined is not a function. Here are the screenshots that show the error in console and code at the specified line number-

selection_037
selection_038

@gadfly361
Copy link
Member

I was able to reproduce your error. To investigate, I tried dropping nvd3 down to version 1.6.0 and I saw this warning:

lineChart.transitionDuration` has been deprecated.

Then I found this issue. The comment by eddiejaoude on March 24 suggests to remove the .transitionDuration(350).

So if you remove this line, everything should work.

@anujsrc
Copy link
Author

anujsrc commented May 6, 2015

Thanks @gadfly361 👍 That solves the problem.

@anujsrc anujsrc closed this as completed May 6, 2015
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