Skip to content

Commit

Permalink
remove premature updateLabels call
Browse files Browse the repository at this point in the history
and add a test that invokes the error spew of #1008
wish I could observe the errors from Jasmine!!

fixes #1008
closes #1024
  • Loading branch information
gordonwoodhull committed Jul 28, 2016
1 parent 71786ee commit f10302f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Improved implementation of alignYAxes, by Mohamed Gazal and Gordon Woodhull ([#1033](https://github.com/dc-js/dc.js/pull/1033))
* Examples of downloading the table data as it's formatted, and formatting legend items.
* `legend.legendText` documentation was missing.
* Stop error spew when row chart is emptied out, thanks Einar Norðfjörð and Fil ([#1008](https://github.com/dc-js/dc.js/issues/1008) / ([#1024](https://github.com/dc-js/dc.js/pull/1024))

## 2.0.0 beta 31
* Brush was sometimes not displaying, fix by Paul Briton ([#1134](https://github.com/dc-js/dc.js/issues/1134))
Expand Down
18 changes: 18 additions & 0 deletions spec/row-chart-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,24 @@ describe('dc.rowChart', function () {
});
});

describe('removing all the data and restoring the data', function () {
// this test mainly exists to produce console errors for #1008;
// I can't seem to find any way to detect invalid setAttribute calls
beforeEach(function () {
chart.render();
chart.group({all: function () { return []; }});
chart.redraw();
chart.group(groupHolder.group);
chart.redraw();
});

it('should restore the row chart', function () {
chart.selectAll('g.row rect').each(function (p) {
expect(d3.select(this).attr('width').indexOf('NaN') < 0).toBeTruthy();
});
});
});

describe('custom labels', function () {
beforeEach(function () {
chart.label(function () {
Expand Down
1 change: 0 additions & 1 deletion src/row-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ dc.rowChart = function (parent, chartGroup) {
rowEnter.append('rect').attr('width', 0);

createLabels(rowEnter);
updateLabels(rows);
}

function removeElements (rows) {
Expand Down

0 comments on commit f10302f

Please sign in to comment.