novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.14k forks source link

Support D3 v4 #1681

Open jfsiii opened 8 years ago

jfsiii commented 8 years ago

D3 is being broken up into smaller modules (e.g. d3-scale, d3-selection, etc) and there are some API changes.

Discuss version support & approach. Should nvd3 support d3 v3 and v4 or only one of them? One option to support both is a jQuery-style approach where 1.x supports v3 and 2.x supports v4.

vovkvlad commented 8 years ago

@jfsiii Hi! So currently nvd3 does not support d3 v4, did I got it right?

melgaafary commented 8 years ago

@vovkvlad No it does not. I just tried it now it does not work.

liquidpele commented 8 years ago

Interesting. I think we'll need to make a d3v4 branch and get it working first to see how different it is. That'll tell us if a full major version change is needed or if we can support both v3 and v4 together.

smoitra87 commented 8 years ago

Any updates to this? D3 is on V4.2.2 now.

vladislav-karamfilov commented 8 years ago

Any news on D3 v4 support ❓

liquidpele commented 8 years ago

I haven't had time to really dig into this... if anyone wants to get a chart working with d3 v4 send a pull request and lets see how big the changes are :)

jfsiii commented 7 years ago

@liquidpele I'm willing to give this a shot. What's a good a) simple and b) medium or complex chart to convert?

liquidpele commented 7 years ago

simple chart would just be any of the examples that are not charts, but just the underlying graph... i.e. any of the examples that don't have 'Chart' in the name.

medium would probably just be the lineChart

complex would be multiChart as that includes multiple graph objects so it's basically everything.

scottmmjackson commented 7 years ago

This is kind of an epic size task. nvd3 has abstracted parts of the d3v3 API that are completely gone. The easy part is polyfilling rebind and using the flatter api structure, harder parts are dealing with the brush abstractions and other things that d3v4 has changed completely.

I'm currently trying to do it in my fork for just one type of chart, to see if it will fix a serious performance issue with an application consuming nvd3.

BastiTee commented 7 years ago

Isn't there a company (Novus partners) behind it? As far as I understood the webpage, the project is part of a framework they use commercially in the financial sector. So if the company's subteam has no plans of porting it for over a year, I'd be careful with one-man "epic size tasks". Plus 450 open issues for ~15 basic to intermediate chart types. Don't get me wrong, they look gorgeous and the interfaces are nice, but we're talking line, bubbles, bars here.

Sounds to me, main maintenance will stay on v3 and even if anyone ports it, who's gonna test and make sure it'll be merged and the main maintainer will adopt v4 - especially for commercial projects. d3v4 was a huge API breaker - no question!

Not telling anyone how to spend their free time though.

liquidpele commented 7 years ago

Well, it was mostly written by one guy at novus who isn't even employed there anymore. I forked and rewrote some of it and they added me to their org, but I mostly just accept pull requests at this point.

Perhaps a d3v4 branch is needed if it's this complicated.

scottmmjackson commented 7 years ago

@liquidpele I'd definitely say a branch and major version bump is appropriate... It's definitely going to break your API (and therefore, consuming packages like angular-nvd3).

Having examined a handful of similar libraries recently, this stuff is hard to get right. "lines, bubbles, bars" is all fine and good until I'm staring at the Chromium profiler into the wee hours of the night with multiple different libs trying to figure out where everything went so wrong.

One secret I've learned is that Chrome in particular has a serious memory leak problem when it comes to SVG. This is true with the most recent version of nvd3 in an app with two graphs- the heap size for the page stays at a slim 30MB or so (per devtools), but the tab's footprint explodes to around the 2-3GB range over the course of an evening.

BastiTee commented 7 years ago

@liquidpele @scottmmjackson Completely agree that a branch and major bump is recommended. I didn't even knew that there are angular packages built on top of it.

I stumbled upon nvd3 because of the convincing examples and a good selection of diagrams you'd need first. but decided not to go for it, because v4 was out and I knew about the API breaker stuff. Would be a pity if community development and adoption declines because of such considerations.

bgth commented 7 years ago

Can you please check #2082 and see if anyone can spare some time on the migration to v4? Thanks in advance..

liquidpele commented 7 years ago

I created a branch to merge d3 v4 work into.

https://github.com/novus/nvd3/tree/dev/D3v4

rpwils commented 6 years ago

Will this be merged into master?

liquidpele commented 6 years ago

Hi gents. I've decided to make moving to d3 v4 a breaking change from the novus repo. I have no control under the novus org, and I'd like to have more help but can't add anyone! So, I've acquired the "nvd3" organization from another user and plan to use that for the d3 v4 break. If you'd like to help, let me know and I'll add you to the new organization :)

https://github.com/nvd3/nvd3

KidA78 commented 6 years ago

@liquidpele Is this repo the most current version of NVD3? What is happening with novus and will features be developed there that would need to be ported over?