Commit 4c9f77d2 by Mike Bostock

### The quantile scale should ignore null, too.

parent 92c9d9d8
 ... ... @@ -7703,9 +7703,7 @@ } scale.domain = function(x) { if (!arguments.length) return domain; domain = x.filter(function(d) { return !isNaN(d); }).sort(d3_ascending); domain = x.filter(d3_number).sort(d3_ascending); return rescale(); }; scale.range = function(x) { ... ...
This source diff could not be displayed because it is too large. You can view the blob instead.
 import "../arrays/ascending"; import "../arrays/bisect"; import "../arrays/quantile"; import "../math/number"; import "scale"; d3.scale.quantile = function() { ... ... @@ -24,7 +25,7 @@ function d3_scale_quantile(domain, range) { scale.domain = function(x) { if (!arguments.length) return domain; domain = x.filter(function(d) { return !isNaN(d); }).sort(d3_ascending); domain = x.filter(d3_number).sort(d3_ascending); return rescale(); }; ... ...
 ... ... @@ -30,7 +30,7 @@ suite.addBatch({ assert.deepEqual(x.domain(), [3, 6, 7, 8, 8, 10, 13, 15, 16, 20]); }, "non-numeric domain values are ignored": function(quantile) { var x = quantile().domain([6, 3, NaN, undefined, 7, 8, 8, 13, 20, 15, 16, 10, NaN]); var x = quantile().domain([6, 3, NaN, undefined, 7, 8, 8, 13, null, 20, 15, 16, 10, NaN]); assert.deepEqual(x.domain(), [3, 6, 7, 8, 8, 10, 13, 15, 16, 20]); }, "quantiles returns the inner thresholds": function(quantile) { ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!