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

d3.v2 loads but not d3.v3 #25

Closed
phoebebright opened this issue Mar 4, 2014 · 10 comments
Closed

d3.v2 loads but not d3.v3 #25

phoebebright opened this issue Mar 4, 2014 · 10 comments
Labels
Milestone

Comments

@phoebebright
Copy link

This code runs ok for d3.v2 but if I try to load d3.v3 I get d3 is undefined in aight.d3. Same error if I d3.html in examples.

BUT - I am running a http://crossbrowsertesting.com emulator. Is it possible this is the problem?

    <script type="text/javascript"  src=" http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript"  src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>


    <!--[if lt IE 9]>
    <script type="text/javascript" src="/shared_static/js/aight.js"></script>
    IE8j
    <![endif]-->

   <script src="http://d3js.org/d3.v2.min.js" charset="utf-8"></script>
<script type="text/javascript" src="/shared_static/js/aight.d3.min.js"></script>
Loaded
@phoebebright
Copy link
Author

Just done a few more checks.
Same issue on proper windows machine, so not an emulator issue.
Switching to d3.v2 for the example makes it run ok for me.

@shawnbot
Copy link
Owner

shawnbot commented Mar 4, 2014

Which browser are you using? The only reason that aight.d3 wouldn't be able to find d3 is if d3.v3 threw an error and never exported d3 to the global namespace. Did d3.v3 throw an error? Can you get a reference to d3 in the console? The more info that you can provide, the easier this will be to figure out.

@clintharris
Copy link

@shawnbot I'm also seeing this issue (i.e., d3.v3 results in "d3 is undefined" error, but d3.v2 works.

Did d3.v3 throw an error?

No, not seeing any other errors in the console. Very strange.

@shawnbot shawnbot mentioned this issue Sep 13, 2014
Merged
8 tasks
@shawnbot shawnbot modified the milestone: v2 Sep 22, 2014
@ghost
Copy link

ghost commented Oct 29, 2014

I just tried running the code in the example (https://github.com/shawnbot/aight/blob/master/examples/d3.html) in IE8 on Windows 7, and I get all the "d3 is not defined" errors. If I change to d3.v2 as mentioned above, I get "object does not support this property or method." I've also tried just embedded aight as shown in the template with a simple d3 example and get the same issues. Any ideas? Should I use an older version of something?

@buunguyen
Copy link

This has something to do with this d3/d3#2099.

@shawnbot
Copy link
Owner

This is not yet fixed in aight v2, unfortunately. See d3/d3#2209 for more info, which is a PR that resolves d3/d3#2099. D3 is a moving target, and if Mike and Jason reject my PR I might have to commit to maintaining an IE8-compatible build on my fork. For now you can grab my build or the minified one.

I'm going to add a note to the README and close this when I hear back from the D3 maintainers.

@shawnbot shawnbot added bug d3 and removed bug labels Jan 28, 2015
@shawnbot
Copy link
Owner

OK, so this might be crazy, but v2.0.5 introduces an aight script that you can use to build an IE8-friendly version of D3, just in case my PR is rejected. This might actually be a better option anyway, because after running it on the latest d3.js and running a diff, it's obvious that there are many other places in the code that need this "shimming".

@shawnbot
Copy link
Owner

I'm going to close this now that we've got both the aight script and an IE8-friendly D3 build.

@buunguyen
Copy link

@shawnbot great job, thanks!

@shawnbot
Copy link
Owner

Hey @phoebebright @buunguyen @travis5555 @clintharris: if you're still using aight and d3, would you mind testing out the latest? Here's the deal:

  1. Grab d3.ie8.js or the minified build.

  2. Update your <head> to include this snippet with the appropriate paths:

    <!--[if lte IE 9]><script src="aight.js"></script><![endif]-->
    <script src="d3.v3.min.js"></script>
    <!--[if IE 8]><script src="d3.ie8.js"></script><![endif]-->

The unit tests all pass in IE8 and 9 and I've confirmed that the most basic d3 APIs all function as expected in the d3 test, including the opacity shim. I'm very interested in knowing how this works for people with existing projects.

Thank you!

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

No branches or pull requests

4 participants