Skip to content

Commit

Permalink
Merge branch 'hotfix/2.0.0-beta.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Jul 30, 2015
2 parents bb0d850 + 7db8510 commit 4d195d1
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '0.10'
- '0.12'
sudo: false
script:
- 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then grunt ci; else grunt ci-pull; fi'
Expand Down
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 2.0 Series
## 2.0.0 beta 14
* Fix a test for IE and add svg subpath matcher, for #894

## 2.0.0 beta 13
* Pie chart radius padding, by Matt Traynham ([#894](https://github.com/dc-js/dc.js/pull/894))
* Example of a table showing group-aggregated data, by Ion Alberdi ([#929](https://github.com/dc-js/dc.js/pull/929))
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dc.js",
"repository": "dc-js/dc.js",
"description": "Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js",
"version": "2.0.0-beta.13",
"version": "2.0.0-beta.14",
"keywords": [
"visualization",
"svg",
Expand Down
6 changes: 3 additions & 3 deletions dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dc.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dc",
"version": "2.0.0-beta.13",
"version": "2.0.0-beta.14",
"license": "Apache-2.0",
"copyright": "2014",
"description": "A multi-dimensional charting library built to work natively with crossfilter and rendered using d3.js ",
Expand Down
66 changes: 45 additions & 21 deletions spec/helpers/custom_matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,42 +59,61 @@ function compareWithinDelta(actual, expected, delta){
return result;
}

// note: to make this reusable as a boolean predicate, it only returns the first
// note: to make these reusable as boolean predicates, they only returns the first
// failure instead of using expect
function comparePaths(actual, expected, delta) {
delta = delta || 1; // default delta of 1px
var got = parsePath(actual),
wanted = parsePath(expected);
if(got.length != wanted.length)
return {
pass: false,
message: "actual number of path cmds " + actual.length +
" did not match expected number " + expected.length
};
for(var i = 0; i!=got.length; ++i) {
var command_num = "path command #" + i;
if(got[i].op.toUpperCase() != wanted[i].op.toUpperCase())

function compareSubPath(got, wanted, i, j, delta) {
for(var k = 0; k!=wanted.length; ++k) {
var command_num = "path command #" + i+k;
if(got[i+k].op.toUpperCase() != wanted[j+k].op.toUpperCase())
return {
pass: false,
message: command_num + " actual '" + got[i].op.toUpperCase() +
"' != expected '" + wanted[i].op.toUpperCase() + "'"
message: command_num + " actual '" + got[i+k].op.toUpperCase() +
"' != expected '" + wanted[j+k].op.toUpperCase() + "'"
};
if(got[i].args.length != wanted[i].args.length)
if(got[i+k].args.length != wanted[j+k].args.length)
return {
pass: false,
message: command_num + " number of arguments " +
got[i].args.length + " != expected " + wanted[i].args.length
got[i+k].args.length + " != expected " + wanted[j+k].args.length
};
for(var j = 0; j<got[i].args.length; ++j) {
var result = compareWithinDelta(got[i].args[j], wanted[i].args[j], delta);
for(var h = 0; h<got[i+k].args.length; ++h) {
var result = compareWithinDelta(got[i+k].args[h], wanted[j+k].args[h], delta);
if(!result.pass) {
result.message = command_num + ": " + result.message;
result.message = command_num + ", element " + h + ": " + result.message;
return result;
}
}
}
return {pass: true};
}
function comparePaths(actual, expected, delta) {
delta = delta || 1; // default delta of 1px
var got = parsePath(actual),
wanted = parsePath(expected);
if(got.length != wanted.length)
return {
pass: false,
message: "actual number of path cmds " + actual.length +
" did not match expected number " + expected.length
};
return compareSubPath(got, wanted, 0, 0, delta);
}
function findSubPath(actual, expected, delta) {
delta = delta || 1; // default delta of 1px
var got = parsePath(actual),
wanted = parsePath(expected),
end = got.length - wanted.length;
for(var i = 0; i<end; ++i) {
var result = compareSubPath(got, wanted, i, 0, delta);
if(result.pass)
return result;
}
return {
pass: false,
message: "did not find expected subpath '" + expected + "' in actual path '" + actual + "'"
};
}

beforeEach(function(){
jasmine.addMatchers({
Expand Down Expand Up @@ -143,6 +162,11 @@ beforeEach(function(){
return {
compare: comparePaths
};
},
toContainPath: function() {
return {
compare: findSubPath
};
}
});
});
2 changes: 1 addition & 1 deletion spec/pie-chart-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('dc.pieChart', function() {
expect(chart.select("svg g").attr("transform")).toMatchTranslate(defaultCenter.x, defaultCenter.y);
});
it('should decrease outer radius', function() {
expect(chart.select("svg g.pie-slice path").attr('d')).toMatch(/A83,83/);
expect(chart.select("svg g.pie-slice path").attr('d')).toContainPath("A83,83 0 0,1 78,-25");
});
});

Expand Down
2 changes: 1 addition & 1 deletion web/docs/api-latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* [Heat Map](#heat-map)
* [Box Plot](#box-plot)

#### Version 2.0.0-beta.13
#### Version 2.0.0-beta.14
The entire dc.js library is scoped under the **dc** name space. It does not introduce anything else
into the global name space.
#### Function Chaining
Expand Down
2 changes: 1 addition & 1 deletion web/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h1 id="dc-api">DC API</h1>
<li><a href="#heat-map">Heat Map</a></li>
<li><a href="#box-plot">Box Plot</a></li>
</ul>
<h4 id="version-2-0-0-beta-13">Version 2.0.0-beta.13</h4>
<h4 id="version-2-0-0-beta-14">Version 2.0.0-beta.14</h4>
<p>The entire dc.js library is scoped under the <strong>dc</strong> name space. It does not introduce anything else
into the global name space.</p>
<h4 id="function-chaining">Function Chaining</h4>
Expand Down
6 changes: 3 additions & 3 deletions web/js/dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/js/dc.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/js/dc.min.js

Large diffs are not rendered by default.

0 comments on commit 4d195d1

Please sign in to comment.