misoproject / d3.chart

A framework for creating reusable charts with d3.js.
http://misoproject.com/d3-chart
MIT License
730 stars 93 forks source link

compatibility with d3.js version 4? #121

Open jebeck opened 8 years ago

jebeck commented 8 years ago

I was just trying to investigate whether d3.chart will be compatible with d3.js version 4, and I've not yet found the answer. My concern is that the change to immutable selections may have implications for d3.chart, but I'm just not sure!

First I tried creating a sample bl.ock but got this when adding d3.chart on top of the default d3 v4 distribution:

screenshot 2016-07-04 16 58 39

So then I made a local clone of d3.chart in order to comment out the version check, and I decided it'd be good to start with trying to run the tests in both versions. After installing all deps, ran tests successfully with the specified npm and bower d3 v3 deps. Then installed d3 v4 via both npm and bower and tests errored out with Warning: PhantomJS timed out, possibly due to a missing Mocha run() call. Use --force to continue. I started digging into this a bit, and it looks like the first problem is changes in how d3 is exposed through the bower dist. I fiddled around a bit with how test/index.html is pulling in the bower dep, but couldn't get it to work within the timeframe I had for investigation.

Would love to know whether you've investigated the upgrade to d3 v4 yet or what your timeline is for doing so if not. Thanks!

jgalb commented 8 years ago

I have been working in my spare time on a v4 retro-fit and currently have it passing 75% to 80% of unit tests. I will submit a PR after I finish it for good, unless someone beats me to it.

jebeck commented 8 years ago

Awesome @jgalb! When you have a PR, I'd be happy to test it out with our code as well, see if there are any gotchas not caught by tests, so perhaps ping me when you open it?

jgalb commented 8 years ago

@jebeck, absolutely, I will keep you posted.

andreas-marschke commented 8 years ago

@jgalb Last I looked (maybe Saturday?) d3-chart was using a simple RegEx comparison against d3.version to check if it's v3 or not and complain about it.

This could be approved upon I think.

Besides that, if you have branch/repo you work on we can help too?

jgalb commented 8 years ago

@andreas-marschke Yes, that is the first error you will run into trying to run d3 v4 with d3-chart. It should definitely be there since major releases (ex. 4.0.0) will most likely change how d3-chart needs to function.

With the changes to d3-selection as a whole, and addition of d3-merge, there are various changes that need to take place. d3-transition is another module that is now quite a bit different so it's behaving awkwardly.

I will push up a fork once I feel like I am headed in the correct direction. Then we can collaborate.

Thanks

enjalot commented 8 years ago

any progress with this @jgalb? my guess would be the new pattern of immutable selections makes for the biggest changes.

victor-xiong commented 7 years ago

What's the current progress on this? I can also provide help if needed.