MCPcopy Create free account
hub / github.com/idank/explainshell / d3_scale_threshold

Function d3_scale_threshold

explainshell/web/static/js/d3.v3.js:6777–6795  ·  view source on GitHub ↗
(domain, range)

Source from the content-addressed store, hash-verified

6775 return d3_scale_threshold([ .5 ], [ 0, 1 ]);
6776 };
6777 function d3_scale_threshold(domain, range) {
6778 function scale(x) {
6779 return range[d3.bisect(domain, x)];
6780 }
6781 scale.domain = function(_) {
6782 if (!arguments.length) return domain;
6783 domain = _;
6784 return scale;
6785 };
6786 scale.range = function(_) {
6787 if (!arguments.length) return range;
6788 range = _;
6789 return scale;
6790 };
6791 scale.copy = function() {
6792 return d3_scale_threshold(domain, range);
6793 };
6794 return scale;
6795 }
6796 d3.scale.identity = function() {
6797 return d3_scale_identity([ 0, 1 ]);
6798 };

Callers 1

d3.v3.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected