Liferay.Loader.define("commerce-dashboard-web$d3-scale@2.2.2/src/threshold", ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    import { bisect } from "d3-array";
    import { slice } from "./array";
    import { initRange } from "./init";

    export default function threshold() {
      var domain = [0.5],
          range = [0, 1],
          unknown,
          n = 1;

      function scale(x) {
        return x <= x ? range[bisect(domain, x, 0, n)] : unknown;
      }

      scale.domain = function (_) {
        return arguments.length ? (domain = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();
      };

      scale.range = function (_) {
        return arguments.length ? (range = slice.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();
      };

      scale.invertExtent = function (y) {
        var i = range.indexOf(y);
        return [domain[i - 1], domain[i]];
      };

      scale.unknown = function (_) {
        return arguments.length ? (unknown = _, scale) : unknown;
      };

      scale.copy = function () {
        return threshold().domain(domain).range(range).unknown(unknown);
      };

      return initRange.apply(scale, arguments);
    }
  }
});
//# sourceMappingURL=threshold.js.map