UNPKG

@antv/f2

Version:

Charts for mobile visualization.

32 lines (31 loc) 1.69 kB
"use strict"; var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.cubehelixLong = void 0; var _src = require("../../d3-color/src"); var _color = _interopRequireWildcard(require("./color.js")); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } function cubehelix(hue) { return function cubehelixGamma(y) { y = +y; function cubehelix(start, end) { var h = hue((start = (0, _src.cubehelix)(start)).h, (end = (0, _src.cubehelix)(end)).h), s = (0, _color.default)(start.s, end.s), l = (0, _color.default)(start.l, end.l), opacity = (0, _color.default)(start.opacity, end.opacity); return function (t) { start.h = h(t); start.s = s(t); start.l = l(Math.pow(t, y)); start.opacity = opacity(t); return start + ''; }; } cubehelix.gamma = cubehelixGamma; return cubehelix; }(1); } var _default = exports.default = cubehelix(_color.hue); var cubehelixLong = exports.cubehelixLong = cubehelix(_color.default);