-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Changes in dc.js version 3.0
Version 3 is compatible with D3 versions 3 and 4. Thanks to Deepak Kumar for all his effort on the port.
We've made every effort to keep the library backward compatible. Most of the changes you will need to make are due to the great namespace flattening of D3V4, documented in d3/CHANGES.md.
However in a few places the dc.js API or behavior has changed due to the upgrade. We also deprecated a few things, and you'll get browser console warnings unless you change your code.
We'll document those changes here. Since this is a wiki, feel free to add any changes we've missed!
D3v4 requires us to use d3.scaleBands
instead of d3.scaleOrdinal
for coordinate grid charts. If you use d3.scaleOrdinal
it should be converted automatically with a warning.
Instead of d3.svg.axis.orient()
, d3 now provides separate classes d3.axisLeft
, d3.axisRight
, etc. dc.js will attempt to guess which one you meant, but this means you need to call useRightAxis
before fetching/manipulating .xAxis
dc.js 3.0 introduces dc.config.defaultColors() for setting the palette of all ordinal charts in one place. For backward compatibility, dc.js 3.0 maintains a copy of the old d3.schemeCategory20c
that was removed in D3v5. You'll be warned if you don't change the default colors.
The new d3.stack
is much more powerful. dc.stackMixin
converts data under the hood back and forth to the new data format and it seems to be compatible with streamgraphs and positive/negative stacks. However, if you were modifying d3.layout.stack
through .stackLayout()
that obviously won't work anymore since the API is completely different.
d3.brush
and d3.zoom
are quite different from the old d3.svg.brush
and d3.behavior.zoom
. We think we have reproduced the old behavior faithfully, but there are likely to be differences or bugs.