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

Update node dependencies to latest. Fix styling issues #1233

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@
"requireReturnTypes": true,
"checkTypes": "capitalizedNativeCase",
"checkRedundantAccess": true
},
"esnext": true
}
}
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"freeze": true,
"immed": true,
"indent": 4,
"latedef": true,
"latedef": false,
"newcap": true,
"noarg": true,
"nonbsp": true,
Expand Down
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:
- '0.12'
- '6'
script:
- 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then grunt ci; else grunt ci-pull; fi'
env:
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,35 @@
"d3": "^3"
},
"devDependencies": {
"grunt": "~0.4",
"grunt": "~1.0",
"grunt-browserify": "~5.0",
"grunt-cli": "~1.2",
"grunt-contrib-concat": "~1.0",
"grunt-contrib-connect": "~1.0",
"grunt-contrib-copy": "~1.0",
"grunt-contrib-cssmin": "~1.0",
"grunt-contrib-jasmine": "~1.0",
"grunt-contrib-jshint": "~0.11.0",
"grunt-contrib-uglify": "~1.0",
"grunt-contrib-jshint": "~1.1",
"grunt-contrib-uglify": "~2.0",
"grunt-contrib-watch": "~1.0",
"grunt-docco2": "~0.2",
"grunt-fileindex": "~0.1",
"grunt-gh-pages": "~2",
"grunt-jscs": "~2.8",
"grunt-jsdoc": "~2.0",
"grunt-jsdoc-to-markdown": "~1.2",
"grunt-jscs": "~3.0",
"grunt-jsdoc": "~2.1",
"grunt-jsdoc-to-markdown": "~2.0",
"grunt-lib-phantomjs": "~1.1",
"grunt-markdown": "~0.7",
"grunt-sass": "~1.1.0",
"grunt-saucelabs": "~8.6",
"grunt-shell": "~1.3",
"grunt-template-jasmine-istanbul": "~0.4",
"ink-docstrap": "~1.1",
"grunt-sass": "~1.2",
"grunt-saucelabs": "~9.0",
"grunt-shell": "~2.1",
"grunt-template-jasmine-istanbul": "~0.5",
"ink-docstrap": "~1.3",
"jsdifflib": "~1.1",
"load-grunt-tasks": "~3.5",
"marked": "~0.3",
"time-grunt": "~1.3",
"uglify-js": "~2.6",
"time-grunt": "~1.4",
"uglify-js": "~2.7",
"file-saver": "^1.3.0"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions spec/bar-chart-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ describe('dc.barChart', function () {
});

it('should redraw the x-axis scale and ticks', function () {
expect(xAxisText().slice(0,4)).toEqual(['Mon 11', 'Wed 13', 'Fri 15', 'Jun 17']);
expect(xAxisText().slice(0, 4)).toEqual(['Mon 11', 'Wed 13', 'Fri 15', 'Jun 17']);
});

it('should set its focus flag', function () {
Expand All @@ -630,7 +630,7 @@ describe('dc.barChart', function () {
expect(chart.refocused()).toBeFalsy();
expect(chart.x().domain()).toEqual([makeDate(2012, 0, 1), makeDate(2012, 11, 31)]);

expect(xAxisText().slice(0,4)).toEqual(['2012', 'February', 'March', 'April']);
expect(xAxisText().slice(0, 4)).toEqual(['2012', 'February', 'March', 'April']);
}

function xAxisText () {
Expand Down
10 changes: 5 additions & 5 deletions spec/base-mixin-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ describe('dc.baseMixin', function () {
});

it('should set the height to the div size', function () {
expect(chart.height()).toBeCloseTo(220,1);
expect(chart.height()).toBeCloseTo(220, 1);
});

it('should set the width to the div size', function () {
expect(chart.width()).toBeCloseTo(230,1);
expect(chart.width()).toBeCloseTo(230, 1);
});

describe('and redrawn', function () {
Expand All @@ -387,7 +387,7 @@ describe('dc.baseMixin', function () {
});

it('should keep the size the same', function () {
expect(chart.height()).toEqual(h0,1);
expect(chart.height()).toEqual(h0, 1);
expect(chart.width()).toEqual(w0);
});
});
Expand All @@ -399,11 +399,11 @@ describe('dc.baseMixin', function () {
});

it('should set the height to the minimum', function () {
expect(chart.height()).toBeCloseTo(234,1);
expect(chart.height()).toBeCloseTo(234, 1);
});

it('should set the width to the minimum', function () {
expect(chart.width()).toBeCloseTo(976,1);
expect(chart.width()).toBeCloseTo(976, 1);
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions spec/box-plot-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ describe('dc.boxPlot', function () {
});

it('should create an offset box for each dimension in the group', function () {
expect(box(0).attr('transform')).toMatchTranslate(50,0);
expect(box(1).attr('transform')).toMatchTranslate(150,0);
expect(box(0).attr('transform')).toMatchTranslate(50, 0);
expect(box(1).attr('transform')).toMatchTranslate(150, 0);
});

it('should correctly place median line', function () {
Expand Down
14 changes: 7 additions & 7 deletions spec/bubble-chart-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ describe('dc.bubbleChart', function () {
it('calculates right cx for each bubble', function () {
chart.selectAll('g.node').each(function (d, i) {
if (i === 0) {
expect(d3.select(this).attr('transform')).toMatchTranslate(601.3333333333334,155,3);
expect(d3.select(this).attr('transform')).toMatchTranslate(601.3333333333334, 155, 3);
}
if (i === 1) {
expect(d3.select(this).attr('transform')).toMatchTranslate(541.2,155);
expect(d3.select(this).attr('transform')).toMatchTranslate(541.2, 155);
}
});
});
Expand All @@ -122,10 +122,10 @@ describe('dc.bubbleChart', function () {
it('calculates right r for each bubble', function () {
chart.selectAll('circle.bubble').each(function (d, i) {
if (i === 0) {
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(49.33333333333333,3);
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(49.33333333333333, 3);
}
if (i === 1) {
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(49.33333333333333,3);
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(49.33333333333333, 3);
}
});
});
Expand Down Expand Up @@ -424,7 +424,7 @@ describe('dc.bubbleChart', function () {
it('renders without errors', function () {
chart.render();
chart.selectAll('g.node').each(function (d, i) {
expect(d3.select(this).attr('transform')).toMatchTranslate(0,0);
expect(d3.select(this).attr('transform')).toMatchTranslate(0, 0);
});
});
});
Expand All @@ -439,10 +439,10 @@ describe('dc.bubbleChart', function () {
it('shows smaller bubbles', function () {
chart.selectAll('circle.bubble').each(function (d, i) {
if (i === 0) {
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(41.83333333333333,3);
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(41.83333333333333, 3);
}
if (i === 1) {
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(41.83333333333333,3);
expect(Number(d3.select(this).attr('r'))).toBeCloseTo(41.83333333333333, 3);
}
});
});
Expand Down
16 changes: 8 additions & 8 deletions spec/color-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ describe('dc.colorMixin', function () {
});

it('default', function () {
expect(colorTest(chart,domain)).toEqual(['#3182bd','#6baed6','#9ecae1','#c6dbef','#e6550d']);
expect(colorTest(chart, domain)).toEqual(['#3182bd','#6baed6','#9ecae1','#c6dbef','#e6550d']);
});

it('custom', function () {
chart.colors(d3.scale.category10());
expect(colorTest(chart,domain)).toEqual(['#1f77b4','#ff7f0e','#2ca02c','#d62728','#9467bd']);
expect(colorTest(chart, domain)).toEqual(['#1f77b4','#ff7f0e','#2ca02c','#d62728','#9467bd']);
});

it('ordinal', function () {
chart.ordinalColors(['red','green','blue']);
expect(colorTest(chart,domain)).toEqual(['red','green','blue','red','green']);
expect(colorTest(chart, domain)).toEqual(['red','green','blue','red','green']);
});

it('linear', function () {
// GIGO: mapping ordinal domain to linear scale is nonsensical
// actually it gets scaled to NaN and then d3 corrects it
chart.linearColors(['#FF0000','#00FF00']);
expect(colorTest(chart,domain)).toEqual(['#000000', '#000000', '#000000', '#000000', '#000000']);
expect(colorTest(chart, domain)).toEqual(['#000000', '#000000', '#000000', '#000000', '#000000']);
});
});
describe('with numeric domain' , function () {
Expand All @@ -48,22 +48,22 @@ describe('dc.colorMixin', function () {
});

it('default', function () {
expect(colorTest(chart,domain,test)).toEqual(['#9ecae1','#3182bd','#c6dbef','#6baed6','#e6550d','#3182bd']);
expect(colorTest(chart, domain, test)).toEqual(['#9ecae1','#3182bd','#c6dbef','#6baed6','#e6550d','#3182bd']);
});

it('custom', function () {
chart.colors(d3.scale.category10());
expect(colorTest(chart,domain,test)).toEqual(['#2ca02c', '#1f77b4', '#d62728', '#ff7f0e', '#9467bd', '#1f77b4']);
expect(colorTest(chart, domain, test)).toEqual(['#2ca02c', '#1f77b4', '#d62728', '#ff7f0e', '#9467bd', '#1f77b4']);
});

it('ordinal', function () {
chart.ordinalColors(['red','green','blue']);
expect(colorTest(chart,domain,test)).toEqual(['blue', 'red', 'red', 'green', 'green', 'red']);
expect(colorTest(chart, domain, test)).toEqual(['blue', 'red', 'red', 'green', 'green', 'red']);
});

it('linear', function () {
chart.linearColors(['#4575b4','#ffffbf']);
expect(colorTest(chart,domain,test)).toEqual(['#4773b3', '#4575b4', '#4dc6c1', '#ffffbf', '#ffffc0', '#4575b4']);
expect(colorTest(chart, domain, test)).toEqual(['#4773b3', '#4575b4', '#4dc6c1', '#ffffbf', '#ffffc0', '#4575b4']);
});
});
describe('calculateColorDomain' , function () {
Expand Down
52 changes: 26 additions & 26 deletions spec/composite-chart-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ describe('dc.compositeChart', function () {
});

it('should place the x axis at the bottom', function () {
expect(chart.select('svg g g.x').attr('transform')).toMatchTranslate(30,120);
expect(chart.select('svg g g.x').attr('transform')).toMatchTranslate(30, 120);
});

it('should place the y axis to the left', function () {
expect(chart.select('svg g g.y').attr('transform')).toMatchTranslate(30,10);
expect(chart.select('svg g g.y').attr('transform')).toMatchTranslate(30, 10);
});

it('should create a separate g for each subchart', function () {
Expand All @@ -164,16 +164,16 @@ describe('dc.compositeChart', function () {
expect(chart.selectAll('g.sub path.line').size()).not.toBe(0);
chart.selectAll('g.sub path.line').each(function (d, i) {
switch (i) {
case 0:
expect(d3.select(this).attr('d'))
.toMatchPath('M24.137931034482758,110L91.72413793103448,108L101.37931034482757,103L202.75862068965515,' +
'108L246.20689655172413,104L395.8620689655172,105');
break;
case 1:
expect(d3.select(this).attr('d'))
.toMatchPath('M24.137931034482758,92L91.72413793103448,82L101.37931034482757,52L202.75862068965515,' +
'91L246.20689655172413,83L395.8620689655172,75');
break;
case 0:
expect(d3.select(this).attr('d'))
.toMatchPath('M24.137931034482758,110L91.72413793103448,108L101.37931034482757,103L202.75862068965515,' +
'108L246.20689655172413,104L395.8620689655172,105');
break;
case 1:
expect(d3.select(this).attr('d'))
.toMatchPath('M24.137931034482758,92L91.72413793103448,82L101.37931034482757,52L202.75862068965515,' +
'91L246.20689655172413,83L395.8620689655172,75');
break;
}
});
});
Expand All @@ -186,18 +186,18 @@ describe('dc.compositeChart', function () {
expect(chart.selectAll('g.sub rect.bar').size()).not.toBe(0);
chart.selectAll('g.sub rect.bar').each(function (d, i) {
switch (i) {
case 0:
expect(d3.select(this).attr('x')).toBeCloseTo('22.637931034482758', 3);
expect(d3.select(this).attr('y')).toBe('93');
expect(d3.select(this).attr('width')).toBe('3');
expect(d3.select(this).attr('height')).toBe('17');
break;
case 5:
expect(d3.select(this).attr('x')).toBeCloseTo('394.3620689655172', 3);
expect(d3.select(this).attr('y')).toBe('80');
expect(d3.select(this).attr('width')).toBe('3');
expect(d3.select(this).attr('height')).toBe('30');
break;
case 0:
expect(d3.select(this).attr('x')).toBeCloseTo('22.637931034482758', 3);
expect(d3.select(this).attr('y')).toBe('93');
expect(d3.select(this).attr('width')).toBe('3');
expect(d3.select(this).attr('height')).toBe('17');
break;
case 5:
expect(d3.select(this).attr('x')).toBeCloseTo('394.3620689655172', 3);
expect(d3.select(this).attr('y')).toBe('80');
expect(d3.select(this).attr('width')).toBe('3');
expect(d3.select(this).attr('height')).toBe('30');
break;
}
});
});
Expand Down Expand Up @@ -232,7 +232,7 @@ describe('dc.compositeChart', function () {
describe('the chart brush', function () {

it('should be positioned with the chart left margin', function () {
expect(chart.select('g.brush').attr('transform')).toMatchTranslate(chart.margins().left,10);
expect(chart.select('g.brush').attr('transform')).toMatchTranslate(chart.margins().left, 10);
});

it('should have a resize handle', function () {
Expand Down Expand Up @@ -306,7 +306,7 @@ describe('dc.compositeChart', function () {
});

it('should be placed according to its own legend option, ignoring the sub-charts', function () {
expect(chart.select('g.dc-legend').attr('transform')).toMatchTranslate(200,10);
expect(chart.select('g.dc-legend').attr('transform')).toMatchTranslate(200, 10);
});

it('should generate legend labels with their associated group text', function () {
Expand Down
Loading