Skip to content

Commit

Permalink
Compatibility with d3v4
Browse files Browse the repository at this point in the history
Squashed from #1363

pie-charts all test cases passing with d3v4

Better alignment to build infrastructure

.selectAll('anything')[0] -> .selectAll('anything').nodes()

interpolate and tension semantics have changed.

Updated for semantics of D3v4 .enter()
Fixed test cases

Discovered that more D3 functions that are used.

Updated for semantics of D3v4 .enter()

Updated for semantics of D3v4 .enter() and fixed test cases.

All test cases for number display and row chart passing

Tests passing

Axis, Scales - temp

Added d3-compat to examples

Brushing - initial work

Many examples working :)

Zoom and focus working

Home page charts works (issue with brushes)

Fixing some of the specs

X Axis brushing

Brushing for Scatter Plot

Brush extents and background color

Brush extent specs

Brushing works :)

Current status

Bar width corrected

Area is working

geoChoroplethChart

Functional completeness

dispatch directly implemented, compatibility code discarded.
base-mixin test cases passing

All specs passing

All specs passing

Merged D3v3-compat

Minor cleanup

Merge d3 compat

Cleanup brush related code

Updated test case

Travis

Inline docs - d3 documentation links and minor changes

Language correction

Upgrade guide draft

Update copyright notice

Cleanup
  • Loading branch information
kum-deepak authored and gordonwoodhull committed Mar 21, 2018
1 parent ddbc7eb commit 796c04d
Show file tree
Hide file tree
Showing 113 changed files with 2,013 additions and 1,220 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sudo: false
language: node_js
node_js:
- '6'
- '8'
script:
- 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then grunt ci; else grunt ci-pull; fi'
env:
Expand Down
35 changes: 35 additions & 0 deletions D3v4 Upgrade Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
##Non working examples

- http://localhost:8888/web/examples/filter-stacks.html
(fading is peculiar)
- http://localhost:8888/web/zoom/restrict-panning.html
Need to increase height of range chart - currently height of
brushable area is zero. New implementation needs it be more than zero.
- http://localhost:8888/web/
Range brushing inconsistent with previous version
If the range chart is brushed first it works correctly
If the Focus chart is zoomed first, brushing range chart fails.


##Issues to be fixed

- Peculiar fading in filter-stacks.html (Medium)


##Before release

- All High priority issues
- Possibly Medium priority issues
- Prepare upgrade guide (Initial version ready)


### Next set of pull requests

- Cleanup of zoom behavior. Testing of restrict panning etc.
- dc.event.trigger
- exit/enter/update sequence
- Additional test cases for dc.util.add and dc.util.subtract
- One for each new chart type - original PRs from community
- Consider removing transitions for zooming and brushing
- d3 stack to D3v4
- Changing .tension call in lineChart
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ module.exports = function (grunt) {
'<%= conf.pkg.name %>.js.map',
'<%= conf.pkg.name %>.min.js',
'<%= conf.pkg.name %>.min.js.map',
'node_modules/d3/d3.js',
'node_modules/d3/build/d3.js',
'node_modules/crossfilter2/crossfilter.js',
'node_modules/queue-async/build/queue.js',
'node_modules/grunt-saucelabs/examples/jasmine/lib/jasmine-jsreporter/jasmine-jsreporter.js',
Expand Down Expand Up @@ -452,6 +452,7 @@ module.exports = function (grunt) {

module.exports.jsFiles = [
'src/banner.js', // NOTE: keep this first
'src/d3v3-compat.js',
'src/core.js',
'src/errors.js',
'src/utils.js',
Expand Down
22 changes: 22 additions & 0 deletions docs/dc-v3-upgrade-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# dc v3 Upgrade Guide

The dc has undergone significant internal changes while moving to v3.
Effort has been made to keep the API as close as possible.

d3 team has released version 4 which is not backward compatible with
their version 3. dc relies very heavily on d3. It is quite likely that
your code uses bits of d3.

Outline of the upgrade process:

- First of all update all d3 functions calls in your code. Most of these
would start with d3. Check https://github.com/d3/d3/blob/master/CHANGES.md
for new function name corresponding to old functions.
- dc.lineChart .interpolate earlier took string parameter, these will get
replaced by specialized curve functions. For example 'step-before'
changes to `d3.curveStepBefore` and 'cardinal' to `d3.curveCardinal`.
See https://github.com/d3/d3/blob/master/CHANGES.md#shapes-d3-shape
for equivalent function calls.
- For dc.geoChoroplethChart earlier `d3.geoAlbersUsa()` was the default
for .projection. If you are plotting US states please call
`.projection(d3.geoAlbersUsa())` explicitly on your chart.
2 changes: 1 addition & 1 deletion jsdoc.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"outputSourcePath": true,
"systemName": "dc.js",
"footer": "",
"copyright": "dc.js Copyright © 2012-2016 Copyright 2012-2016 Nick Zhu & the dc.js Developers",
"copyright": "dc.js Copyright © 2012-2018 Nick Zhu & the dc.js Developers",
"navType": "vertical",
"theme": "cosmo",
"linenums": true,
Expand Down
Loading

0 comments on commit 796c04d

Please sign in to comment.