UNPKG

bytev-charts

Version:

基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;

1,444 lines (1,298 loc) 82.2 kB
import _typeof from "@babel/runtime-corejs2/helpers/typeof"; import "core-js/modules/es.date.to-string.js"; import "core-js/modules/es.object.to-string.js"; import "core-js/modules/es.regexp.to-string.js"; import "core-js/modules/es.regexp.exec.js"; import "core-js/modules/es.string.match.js"; import "core-js/modules/es.promise.js"; import "core-js/modules/es.number.to-fixed.js"; import "core-js/modules/es.array.for-each.js"; import "core-js/modules/es.array.slice.js"; import "core-js/modules/web.dom-collections.for-each.js"; import "core-js/modules/es.function.bind.js"; import "core-js/modules/web.timers.js"; import "core-js/modules/es.string.split.js"; import "core-js/modules/es.array.index-of.js"; import "core-js/modules/es.string.replace.js"; import "core-js/modules/es.array.join.js"; import "core-js/modules/es.array.splice.js"; import "core-js/modules/es.regexp.constructor.js"; import "core-js/modules/es.function.name.js"; import "core-js/modules/es.array.concat.js"; import _Object$defineProperty from "@babel/runtime-corejs2/core-js/object/define-property"; import _parseInt from "@babel/runtime-corejs2/core-js/parse-int"; import _parseFloat from "@babel/runtime-corejs2/core-js/parse-float"; import _Object$keys from "@babel/runtime-corejs2/core-js/object/keys"; import _Array$isArray from "@babel/runtime-corejs2/core-js/array/is-array"; import _Object$create from "@babel/runtime-corejs2/core-js/object/create"; import _Object$setPrototypeOf from "@babel/runtime-corejs2/core-js/object/set-prototype-of"; import _JSON$stringify from "@babel/runtime-corejs2/core-js/json/stringify"; import _Symbol from "@babel/runtime-corejs2/core-js/symbol"; import _Symbol$iterator from "@babel/runtime-corejs2/core-js/symbol/iterator"; import _Object$defineProperties from "@babel/runtime-corejs2/core-js/object/define-properties"; /** * dat-gui JavaScript Controller Library * https://github.com/dataarts/dat.gui * * Copyright 2016 Data Arts Team, Google Creative Lab * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 */ !function (e, t) { "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && "object" == (typeof module === "undefined" ? "undefined" : _typeof(module)) ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ? exports.dat = t() : e.dat = t(); }(this, function () { return function (e) { function t(o) { if (n[o]) return n[o].exports; var i = n[o] = { exports: {}, id: o, loaded: !1 }; return e[o].call(i.exports, i, i.exports, t), i.loaded = !0, i.exports; } var n = {}; return t.m = e, t.c = n, t.p = "", t(0); }([function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } var i = n(1), r = o(i); e.exports = r["default"]; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } t.__esModule = !0; var i = n(2), r = o(i), a = n(6), l = o(a), s = n(3), u = o(s), d = n(7), c = o(d), f = n(8), _ = o(f), p = n(10), h = o(p), m = n(11), b = o(m), g = n(12), v = o(g), y = n(13), w = o(y), x = n(14), E = o(x), C = n(15), A = o(C), S = n(16), k = o(S), O = n(9), T = o(O), R = n(17), L = o(R); t["default"] = { color: { Color: r["default"], math: l["default"], interpret: u["default"] }, controllers: { Controller: c["default"], BooleanController: _["default"], OptionController: h["default"], StringController: b["default"], NumberController: v["default"], NumberControllerBox: w["default"], NumberControllerSlider: E["default"], FunctionController: A["default"], ColorController: k["default"] }, dom: { dom: T["default"] }, gui: { GUI: L["default"] }, GUI: L["default"] }; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t, n) { _Object$defineProperty(e, t, { get: function get() { return "RGB" === this.__state.space ? this.__state[t] : (h.recalculateRGB(this, t, n), this.__state[t]); }, set: function set(e) { "RGB" !== this.__state.space && (h.recalculateRGB(this, t, n), this.__state.space = "RGB"), this.__state[t] = e; } }); } function a(e, t) { _Object$defineProperty(e, t, { get: function get() { return "HSV" === this.__state.space ? this.__state[t] : (h.recalculateHSV(this), this.__state[t]); }, set: function set(e) { "HSV" !== this.__state.space && (h.recalculateHSV(this), this.__state.space = "HSV"), this.__state[t] = e; } }); } t.__esModule = !0; var l = n(3), s = o(l), u = n(6), d = o(u), c = n(4), f = o(c), _ = n(5), p = o(_), h = function () { function e() { if (i(this, e), this.__state = s["default"].apply(this, arguments), this.__state === !1) throw new Error("Failed to interpret color arguments"); this.__state.a = this.__state.a || 1; } return e.prototype.toString = function () { return (0, f["default"])(this); }, e.prototype.toHexString = function () { return (0, f["default"])(this, !0); }, e.prototype.toOriginal = function () { return this.__state.conversion.write(this); }, e; }(); h.recalculateRGB = function (e, t, n) { if ("HEX" === e.__state.space) e.__state[t] = d["default"].component_from_hex(e.__state.hex, n);else { if ("HSV" !== e.__state.space) throw new Error("Corrupted color state"); p["default"].extend(e.__state, d["default"].hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v)); } }, h.recalculateHSV = function (e) { var t = d["default"].rgb_to_hsv(e.r, e.g, e.b); p["default"].extend(e.__state, { s: t.s, v: t.v }), p["default"].isNaN(t.h) ? p["default"].isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h; }, h.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"], r(h.prototype, "r", 2), r(h.prototype, "g", 1), r(h.prototype, "b", 0), a(h.prototype, "h"), a(h.prototype, "s"), a(h.prototype, "v"), _Object$defineProperty(h.prototype, "a", { get: function get() { return this.__state.a; }, set: function set(e) { this.__state.a = e; } }), _Object$defineProperty(h.prototype, "hex", { get: function get() { return "HEX" !== !this.__state.space && (this.__state.hex = d["default"].rgb_to_hex(this.r, this.g, this.b)), this.__state.hex; }, set: function set(e) { this.__state.space = "HEX", this.__state.hex = e; } }), t["default"] = h; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } t.__esModule = !0; var i = n(4), r = o(i), a = n(5), l = o(a), s = [{ litmus: l["default"].isString, conversions: { THREE_CHAR_HEX: { read: function read(e) { var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); return null !== t && { space: "HEX", hex: _parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString(), 0) }; }, write: r["default"] }, SIX_CHAR_HEX: { read: function read(e) { var t = e.match(/^#([A-F0-9]{6})$/i); return null !== t && { space: "HEX", hex: _parseInt("0x" + t[1].toString(), 0) }; }, write: r["default"] }, CSS_RGB: { read: function read(e) { var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); return null !== t && { space: "RGB", r: _parseFloat(t[1]), g: _parseFloat(t[2]), b: _parseFloat(t[3]) }; }, write: r["default"] }, CSS_RGBA: { read: function read(e) { var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); return null !== t && { space: "RGB", r: _parseFloat(t[1]), g: _parseFloat(t[2]), b: _parseFloat(t[3]), a: _parseFloat(t[4]) }; }, write: r["default"] } } }, { litmus: l["default"].isNumber, conversions: { HEX: { read: function read(e) { return { space: "HEX", hex: e, conversionName: "HEX" }; }, write: function write(e) { return e.hex; } } } }, { litmus: l["default"].isArray, conversions: { RGB_ARRAY: { read: function read(e) { return 3 === e.length && { space: "RGB", r: e[0], g: e[1], b: e[2] }; }, write: function write(e) { return [e.r, e.g, e.b]; } }, RGBA_ARRAY: { read: function read(e) { return 4 === e.length && { space: "RGB", r: e[0], g: e[1], b: e[2], a: e[3] }; }, write: function write(e) { return [e.r, e.g, e.b, e.a]; } } } }, { litmus: l["default"].isObject, conversions: { RGBA_OBJ: { read: function read(e) { return !!(l["default"].isNumber(e.r) && l["default"].isNumber(e.g) && l["default"].isNumber(e.b) && l["default"].isNumber(e.a)) && { space: "RGB", r: e.r, g: e.g, b: e.b, a: e.a }; }, write: function write(e) { return { r: e.r, g: e.g, b: e.b, a: e.a }; } }, RGB_OBJ: { read: function read(e) { return !!(l["default"].isNumber(e.r) && l["default"].isNumber(e.g) && l["default"].isNumber(e.b)) && { space: "RGB", r: e.r, g: e.g, b: e.b }; }, write: function write(e) { return { r: e.r, g: e.g, b: e.b }; } }, HSVA_OBJ: { read: function read(e) { return !!(l["default"].isNumber(e.h) && l["default"].isNumber(e.s) && l["default"].isNumber(e.v) && l["default"].isNumber(e.a)) && { space: "HSV", h: e.h, s: e.s, v: e.v, a: e.a }; }, write: function write(e) { return { h: e.h, s: e.s, v: e.v, a: e.a }; } }, HSV_OBJ: { read: function read(e) { return !!(l["default"].isNumber(e.h) && l["default"].isNumber(e.s) && l["default"].isNumber(e.v)) && { space: "HSV", h: e.h, s: e.s, v: e.v }; }, write: function write(e) { return { h: e.h, s: e.s, v: e.v }; } } } }], u = void 0, d = void 0, c = function c() { d = !1; var e = arguments.length > 1 ? l["default"].toArray(arguments) : arguments[0]; return l["default"].each(s, function (t) { if (t.litmus(e)) return l["default"].each(t.conversions, function (t, n) { if (u = t.read(e), d === !1 && u !== !1) return d = u, u.conversionName = n, u.conversion = t, l["default"].BREAK; }), l["default"].BREAK; }), d; }; t["default"] = c; }, function (e, t) { "use strict"; t.__esModule = !0, t["default"] = function (e, t) { var n = e.__state.conversionName.toString(), o = Math.round(e.r), i = Math.round(e.g), r = Math.round(e.b), a = e.a, l = Math.round(e.h), s = e.s.toFixed(1), u = e.v.toFixed(1); if (t || "THREE_CHAR_HEX" === n || "SIX_CHAR_HEX" === n) { for (var d = e.hex.toString(16); d.length < 6;) { d = "0" + d; } return "#" + d; } return "CSS_RGB" === n ? "rgb(" + o + "," + i + "," + r + ")" : "CSS_RGBA" === n ? "rgba(" + o + "," + i + "," + r + "," + a + ")" : "HEX" === n ? "0x" + e.hex.toString(16) : "RGB_ARRAY" === n ? "[" + o + "," + i + "," + r + "]" : "RGBA_ARRAY" === n ? "[" + o + "," + i + "," + r + "," + a + "]" : "RGB_OBJ" === n ? "{r:" + o + ",g:" + i + ",b:" + r + "}" : "RGBA_OBJ" === n ? "{r:" + o + ",g:" + i + ",b:" + r + ",a:" + a + "}" : "HSV_OBJ" === n ? "{h:" + l + ",s:" + s + ",v:" + u + "}" : "HSVA_OBJ" === n ? "{h:" + l + ",s:" + s + ",v:" + u + ",a:" + a + "}" : "unknown format"; }; }, function (e, t) { "use strict"; t.__esModule = !0; var n = Array.prototype.forEach, o = Array.prototype.slice, i = { BREAK: {}, extend: function extend(e) { return this.each(o.call(arguments, 1), function (t) { var n = this.isObject(t) ? _Object$keys(t) : []; n.forEach(function (n) { this.isUndefined(t[n]) || (e[n] = t[n]); }.bind(this)); }, this), e; }, defaults: function defaults(e) { return this.each(o.call(arguments, 1), function (t) { var n = this.isObject(t) ? _Object$keys(t) : []; n.forEach(function (n) { this.isUndefined(e[n]) && (e[n] = t[n]); }.bind(this)); }, this), e; }, compose: function compose() { var e = o.call(arguments); return function () { for (var t = o.call(arguments), n = e.length - 1; n >= 0; n--) { t = [e[n].apply(this, t)]; } return t[0]; }; }, each: function each(e, t, o) { if (e) if (n && e.forEach && e.forEach === n) e.forEach(t, o);else if (e.length === e.length + 0) { var i = void 0, r = void 0; for (i = 0, r = e.length; i < r; i++) { if (i in e && t.call(o, e[i], i) === this.BREAK) return; } } else for (var a in e) { if (t.call(o, e[a], a) === this.BREAK) return; } }, defer: function defer(e) { setTimeout(e, 0); }, debounce: function debounce(e, t) { var n = void 0; return function () { function o() { n = null; } var i = this, r = arguments, a = !n; clearTimeout(n), n = setTimeout(o, t), a && e.apply(i, r); }; }, toArray: function toArray(e) { return e.toArray ? e.toArray() : o.call(e); }, isUndefined: function isUndefined(e) { return void 0 === e; }, isNull: function isNull(e) { return null === e; }, isNaN: function (e) { function t(t) { return e.apply(this, arguments); } return t.toString = function () { return e.toString(); }, t; }(function (e) { return isNaN(e); }), isArray: _Array$isArray || function (e) { return e.constructor === Array; }, isObject: function isObject(e) { return e === Object(e); }, isNumber: function isNumber(e) { return e === e + 0; }, isString: function isString(e) { return e === e + ""; }, isBoolean: function isBoolean(e) { return e === !1 || e === !0; }, isFunction: function isFunction(e) { return "[object Function]" === Object.prototype.toString.call(e); } }; t["default"] = i; }, function (e, t) { "use strict"; t.__esModule = !0; var n = void 0, o = { hsv_to_rgb: function hsv_to_rgb(e, t, n) { var o = Math.floor(e / 60) % 6, i = e / 60 - Math.floor(e / 60), r = n * (1 - t), a = n * (1 - i * t), l = n * (1 - (1 - i) * t), s = [[n, l, r], [a, n, r], [r, n, l], [r, a, n], [l, r, n], [n, r, a]][o]; return { r: 255 * s[0], g: 255 * s[1], b: 255 * s[2] }; }, rgb_to_hsv: function rgb_to_hsv(e, t, n) { var o = Math.min(e, t, n), i = Math.max(e, t, n), r = i - o, a = void 0, l = void 0; return 0 === i ? { h: NaN, s: 0, v: 0 } : (l = r / i, a = e === i ? (t - n) / r : t === i ? 2 + (n - e) / r : 4 + (e - t) / r, a /= 6, a < 0 && (a += 1), { h: 360 * a, s: l, v: i / 255 }); }, rgb_to_hex: function rgb_to_hex(e, t, n) { var o = this.hex_with_component(0, 2, e); return o = this.hex_with_component(o, 1, t), o = this.hex_with_component(o, 0, n); }, component_from_hex: function component_from_hex(e, t) { return e >> 8 * t & 255; }, hex_with_component: function hex_with_component(e, t, o) { return o << (n = 8 * t) | e & ~(255 << n); } }; t["default"] = o; }, function (e, t) { "use strict"; function n(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } t.__esModule = !0; var o = function () { function e(t, o) { n(this, e), this.initialValue = t[o], this.domElement = document.createElement("div"), this.object = t, this.property = o, this.__onChange = void 0, this.__onFinishChange = void 0; } return e.prototype.onChange = function (e) { return this.__onChange = e, this; }, e.prototype.onFinishChange = function (e) { return this.__onFinishChange = e, this; }, e.prototype.setValue = function (e) { return this.object[this.property] = e, this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this; }, e.prototype.getValue = function () { return this.object[this.property]; }, e.prototype.updateDisplay = function () { return this; }, e.prototype.isModified = function () { return this.initialValue !== this.getValue(); }, e; }(); t["default"] = o; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } t.__esModule = !0; var l = n(7), s = o(l), u = n(9), d = o(u), c = function (e) { function t(n, o) { function a() { s.setValue(!s.__prev); } i(this, t); var l = r(this, e.call(this, n, o)), s = l; return l.__prev = l.getValue(), l.__checkbox = document.createElement("input"), l.__checkbox.setAttribute("type", "checkbox"), d["default"].bind(l.__checkbox, "change", a, !1), l.domElement.appendChild(l.__checkbox), l.updateDisplay(), l; } return a(t, e), t.prototype.setValue = function (t) { var n = e.prototype.setValue.call(this, t); return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.__prev = this.getValue(), n; }, t.prototype.updateDisplay = function () { return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"), this.__checkbox.checked = !0) : this.__checkbox.checked = !1, e.prototype.updateDisplay.call(this); }, t; }(s["default"]); t["default"] = c; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e) { if ("0" === e || a["default"].isUndefined(e)) return 0; var t = e.match(u); return a["default"].isNull(t) ? 0 : _parseFloat(t[1]); } t.__esModule = !0; var r = n(5), a = o(r), l = { HTMLEvents: ["change"], MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"], KeyboardEvents: ["keydown"] }, s = {}; a["default"].each(l, function (e, t) { a["default"].each(e, function (e) { s[e] = t; }); }); var u = /(\d+(\.\d+)?)px/, d = { makeSelectable: function makeSelectable(e, t) { void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function () { return !1; } : function () {}, e.style.MozUserSelect = t ? "auto" : "none", e.style.KhtmlUserSelect = t ? "auto" : "none", e.unselectable = t ? "on" : "off"); }, makeFullscreen: function makeFullscreen(e, t, n) { var o = n, i = t; a["default"].isUndefined(i) && (i = !0), a["default"].isUndefined(o) && (o = !0), e.style.position = "absolute", i && (e.style.left = 0, e.style.right = 0), o && (e.style.top = 0, e.style.bottom = 0); }, fakeEvent: function fakeEvent(e, t, n, o) { var i = n || {}, r = s[t]; if (!r) throw new Error("Event type " + t + " not supported."); var l = document.createEvent(r); switch (r) { case "MouseEvents": var u = i.x || i.clientX || 0, d = i.y || i.clientY || 0; l.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, u, d, !1, !1, !1, !1, 0, null); break; case "KeyboardEvents": var c = l.initKeyboardEvent || l.initKeyEvent; a["default"].defaults(i, { cancelable: !0, ctrlKey: !1, altKey: !1, shiftKey: !1, metaKey: !1, keyCode: void 0, charCode: void 0 }), c(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode); break; default: l.initEvent(t, i.bubbles || !1, i.cancelable || !0); } a["default"].defaults(l, o), e.dispatchEvent(l); }, bind: function bind(e, t, n, o) { var i = o || !1; return e.addEventListener ? e.addEventListener(t, n, i) : e.attachEvent && e.attachEvent("on" + t, n), d; }, unbind: function unbind(e, t, n, o) { var i = o || !1; return e.removeEventListener ? e.removeEventListener(t, n, i) : e.detachEvent && e.detachEvent("on" + t, n), d; }, addClass: function addClass(e, t) { if (void 0 === e.className) e.className = t;else if (e.className !== t) { var n = e.className.split(/ +/); n.indexOf(t) === -1 && (n.push(t), e.className = n.join(" ").replace(/^\s+/, "").replace(/\s+$/, "")); } return d; }, removeClass: function removeClass(e, t) { if (t) { if (e.className === t) e.removeAttribute("class");else { var n = e.className.split(/ +/), o = n.indexOf(t); o !== -1 && (n.splice(o, 1), e.className = n.join(" ")); } } else e.className = void 0; return d; }, hasClass: function hasClass(e, t) { return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1; }, getWidth: function getWidth(e) { var t = getComputedStyle(e); return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width); }, getHeight: function getHeight(e) { var t = getComputedStyle(e); return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height); }, getOffset: function getOffset(e) { var t = e, n = { left: 0, top: 0 }; if (t.offsetParent) do { n.left += t.offsetLeft, n.top += t.offsetTop, t = t.offsetParent; } while (t); return n; }, isActive: function isActive(e) { return e === document.activeElement && (e.type || e.href); } }; t["default"] = d; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } t.__esModule = !0; var l = n(7), s = o(l), u = n(9), d = o(u), c = n(5), f = o(c), _ = function (e) { function t(n, o, a) { i(this, t); var l = r(this, e.call(this, n, o)), s = a, u = l; return l.__select = document.createElement("select"), f["default"].isArray(s) && !function () { var e = {}; f["default"].each(s, function (t) { e[t] = t; }), s = e; }(), f["default"].each(s, function (e, t) { var n = document.createElement("option"); n.innerHTML = t, n.setAttribute("value", e), u.__select.appendChild(n); }), l.updateDisplay(), d["default"].bind(l.__select, "change", function () { var e = this.options[this.selectedIndex].value; u.setValue(e); }), l.domElement.appendChild(l.__select), l; } return a(t, e), t.prototype.setValue = function (t) { var n = e.prototype.setValue.call(this, t); return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), n; }, t.prototype.updateDisplay = function () { return d["default"].isActive(this.__select) ? this : (this.__select.value = this.getValue(), e.prototype.updateDisplay.call(this)); }, t; }(s["default"]); t["default"] = _; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } t.__esModule = !0; var l = n(7), s = o(l), u = n(9), d = o(u), c = function (e) { function t(n, o) { function a() { u.setValue(u.__input.value); } function l() { u.__onFinishChange && u.__onFinishChange.call(u, u.getValue()); } i(this, t); var s = r(this, e.call(this, n, o)), u = s; return s.__input = document.createElement("input"), s.__input.setAttribute("type", "text"), d["default"].bind(s.__input, "keyup", a), d["default"].bind(s.__input, "change", a), d["default"].bind(s.__input, "blur", l), d["default"].bind(s.__input, "keydown", function (e) { 13 === e.keyCode && this.blur(); }), s.updateDisplay(), s.domElement.appendChild(s.__input), s; } return a(t, e), t.prototype.updateDisplay = function () { return d["default"].isActive(this.__input) || (this.__input.value = this.getValue()), e.prototype.updateDisplay.call(this); }, t; }(s["default"]); t["default"] = c; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } function l(e) { var t = e.toString(); return t.indexOf(".") > -1 ? t.length - t.indexOf(".") - 1 : 0; } t.__esModule = !0; var s = n(7), u = o(s), d = n(5), c = o(d), f = function (e) { function t(n, o, a) { i(this, t); var s = r(this, e.call(this, n, o)), u = a || {}; return s.__min = u.min, s.__max = u.max, s.__step = u.step, c["default"].isUndefined(s.__step) ? 0 === s.initialValue ? s.__impliedStep = 1 : s.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(s.initialValue)) / Math.LN10)) / 10 : s.__impliedStep = s.__step, s.__precision = l(s.__impliedStep), s; } return a(t, e), t.prototype.setValue = function (t) { var n = t; return void 0 !== this.__min && n < this.__min ? n = this.__min : void 0 !== this.__max && n > this.__max && (n = this.__max), void 0 !== this.__step && n % this.__step !== 0 && (n = Math.round(n / this.__step) * this.__step), e.prototype.setValue.call(this, n); }, t.prototype.min = function (e) { return this.__min = e, this; }, t.prototype.max = function (e) { return this.__max = e, this; }, t.prototype.step = function (e) { return this.__step = e, this.__impliedStep = e, this.__precision = l(e), this; }, t; }(u["default"]); t["default"] = f; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } function l(e, t) { var n = Math.pow(10, t); return Math.round(e * n) / n; } t.__esModule = !0; var s = n(12), u = o(s), d = n(9), c = o(d), f = n(5), _ = o(f), p = function (e) { function t(n, o, a) { function l() { var e = _parseFloat(m.__input.value); _["default"].isNaN(e) || m.setValue(e); } function s() { m.__onFinishChange && m.__onFinishChange.call(m, m.getValue()); } function u() { s(); } function d(e) { var t = b - e.clientY; m.setValue(m.getValue() + t * m.__impliedStep), b = e.clientY; } function f() { c["default"].unbind(window, "mousemove", d), c["default"].unbind(window, "mouseup", f), s(); } function p(e) { c["default"].bind(window, "mousemove", d), c["default"].bind(window, "mouseup", f), b = e.clientY; } i(this, t); var h = r(this, e.call(this, n, o, a)); h.__truncationSuspended = !1; var m = h, b = void 0; return h.__input = document.createElement("input"), h.__input.setAttribute("type", "text"), c["default"].bind(h.__input, "change", l), c["default"].bind(h.__input, "blur", u), c["default"].bind(h.__input, "mousedown", p), c["default"].bind(h.__input, "keydown", function (e) { 13 === e.keyCode && (m.__truncationSuspended = !0, this.blur(), m.__truncationSuspended = !1, s()); }), h.updateDisplay(), h.domElement.appendChild(h.__input), h; } return a(t, e), t.prototype.updateDisplay = function () { return this.__input.value = this.__truncationSuspended ? this.getValue() : l(this.getValue(), this.__precision), e.prototype.updateDisplay.call(this); }, t; }(u["default"]); t["default"] = p; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } function l(e, t, n, o, i) { return o + (i - o) * ((e - t) / (n - t)); } t.__esModule = !0; var s = n(12), u = o(s), d = n(9), c = o(d), f = function (e) { function t(n, o, a, s, u) { function d(e) { document.activeElement.blur(), c["default"].bind(window, "mousemove", f), c["default"].bind(window, "mouseup", _), f(e); } function f(e) { e.preventDefault(); var t = h.__background.getBoundingClientRect(); return h.setValue(l(e.clientX, t.left, t.right, h.__min, h.__max)), !1; } function _() { c["default"].unbind(window, "mousemove", f), c["default"].unbind(window, "mouseup", _), h.__onFinishChange && h.__onFinishChange.call(h, h.getValue()); } i(this, t); var p = r(this, e.call(this, n, o, { min: a, max: s, step: u })), h = p; return p.__background = document.createElement("div"), p.__foreground = document.createElement("div"), c["default"].bind(p.__background, "mousedown", d), c["default"].addClass(p.__background, "slider"), c["default"].addClass(p.__foreground, "slider-fg"), p.updateDisplay(), p.__background.appendChild(p.__foreground), p.domElement.appendChild(p.__background), p; } return a(t, e), t.prototype.updateDisplay = function () { var t = (this.getValue() - this.__min) / (this.__max - this.__min); return this.__foreground.style.width = 100 * t + "%", e.prototype.updateDisplay.call(this); }, t; }(u["default"]); t["default"] = f; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } t.__esModule = !0; var l = n(7), s = o(l), u = n(9), d = o(u), c = function (e) { function t(n, o, a) { i(this, t); var l = r(this, e.call(this, n, o)), s = l; return l.__button = document.createElement("div"), l.__button.innerHTML = void 0 === a ? "Fire" : a, d["default"].bind(l.__button, "click", function (e) { return e.preventDefault(), s.fire(), !1; }), d["default"].addClass(l.__button, "button"), l.domElement.appendChild(l.__button), l; } return a(t, e), t.prototype.fire = function () { this.__onChange && this.__onChange.call(this), this.getValue().call(this.object), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()); }, t; }(s["default"]); t["default"] = c; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } function r(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" != _typeof(t) && "function" != typeof t ? e : t; } function a(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + _typeof(t)); e.prototype = _Object$create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (_Object$setPrototypeOf ? _Object$setPrototypeOf(e, t) : e.__proto__ = t); } function l(e, t, n, o) { e.style.background = "", g["default"].each(y, function (i) { e.style.cssText += "background: " + i + "linear-gradient(" + t + ", " + n + " 0%, " + o + " 100%); "; }); } function s(e) { e.style.background = "", e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);", e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);", e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; } t.__esModule = !0; var u = n(7), d = o(u), c = n(9), f = o(c), _ = n(2), p = o(_), h = n(3), m = o(h), b = n(5), g = o(b), v = function (e) { function t(n, o) { function a(e) { h(e), f["default"].bind(window, "mousemove", h), f["default"].bind(window, "mouseup", u); } function u() { f["default"].unbind(window, "mousemove", h), f["default"].unbind(window, "mouseup", u), _(); } function d() { var e = (0, m["default"])(this.value); e !== !1 ? (y.__color.__state = e, y.setValue(y.__color.toOriginal())) : this.value = y.__color.toString(); } function c() { f["default"].unbind(window, "mousemove", b), f["default"].unbind(window, "mouseup", c), _(); } function _() { y.__onFinishChange && y.__onFinishChange.call(y, y.__color.toOriginal()); } function h(e) { e.preventDefault(); var t = y.__saturation_field.getBoundingClientRect(), n = (e.clientX - t.left) / (t.right - t.left), o = 1 - (e.clientY - t.top) / (t.bottom - t.top); return o > 1 ? o = 1 : o < 0 && (o = 0), n > 1 ? n = 1 : n < 0 && (n = 0), y.__color.v = o, y.__color.s = n, y.setValue(y.__color.toOriginal()), !1; } function b(e) { e.preventDefault(); var t = y.__hue_field.getBoundingClientRect(), n = 1 - (e.clientY - t.top) / (t.bottom - t.top); return n > 1 ? n = 1 : n < 0 && (n = 0), y.__color.h = 360 * n, y.setValue(y.__color.toOriginal()), !1; } i(this, t); var v = r(this, e.call(this, n, o)); v.__color = new p["default"](v.getValue()), v.__temp = new p["default"](0); var y = v; v.domElement = document.createElement("div"), f["default"].makeSelectable(v.domElement, !1), v.__selector = document.createElement("div"), v.__selector.className = "selector", v.__saturation_field = document.createElement("div"), v.__saturation_field.className = "saturation-field", v.__field_knob = document.createElement("div"), v.__field_knob.className = "field-knob", v.__field_knob_border = "2px solid ", v.__hue_knob = document.createElement("div"), v.__hue_knob.className = "hue-knob", v.__hue_field = document.createElement("div"), v.__hue_field.className = "hue-field", v.__input = document.createElement("input"), v.__input.type = "text", v.__input_textShadow = "0 1px 1px ", f["default"].bind(v.__input, "keydown", function (e) { 13 === e.keyCode && d.call(this); }), f["default"].bind(v.__input, "blur", d), f["default"].bind(v.__selector, "mousedown", function () { f["default"].addClass(this, "drag").bind(window, "mouseup", function () { f["default"].removeClass(y.__selector, "drag"); }); }); var w = document.createElement("div"); return g["default"].extend(v.__selector.style, { width: "122px", height: "102px", padding: "3px", backgroundColor: "#222", boxShadow: "0px 1px 3px rgba(0,0,0,0.3)" }), g["default"].extend(v.__field_knob.style, { position: "absolute", width: "12px", height: "12px", border: v.__field_knob_border + (v.__color.v < .5 ? "#fff" : "#000"), boxShadow: "0px 1px 3px rgba(0,0,0,0.5)", borderRadius: "12px", zIndex: 1 }), g["default"].extend(v.__hue_knob.style, { position: "absolute", width: "15px", height: "2px", borderRight: "4px solid #fff", zIndex: 1 }), g["default"].extend(v.__saturation_field.style, { width: "100px", height: "100px", border: "1px solid #555", marginRight: "3px", display: "inline-block", cursor: "pointer" }), g["default"].extend(w.style, { width: "100%", height: "100%", background: "none" }), l(w, "top", "rgba(0,0,0,0)", "#000"), g["default"].extend(v.__hue_field.style, { width: "15px", height: "100px", border: "1px solid #555", cursor: "ns-resize", position: "absolute", top: "3px", right: "3px" }), s(v.__hue_field), g["default"].extend(v.__input.style, { outline: "none", textAlign: "center", color: "#fff", border: 0, fontWeight: "bold", textShadow: v.__input_textShadow + "rgba(0,0,0,0.7)" }), f["default"].bind(v.__saturation_field, "mousedown", a), f["default"].bind(v.__field_knob, "mousedown", a), f["default"].bind(v.__hue_field, "mousedown", function (e) { b(e), f["default"].bind(window, "mousemove", b), f["default"].bind(window, "mouseup", c); }), v.__saturation_field.appendChild(w), v.__selector.appendChild(v.__field_knob), v.__selector.appendChild(v.__saturation_field), v.__selector.appendChild(v.__hue_field), v.__hue_field.appendChild(v.__hue_knob), v.domElement.appendChild(v.__input), v.domElement.appendChild(v.__selector), v.updateDisplay(), v; } return a(t, e), t.prototype.updateDisplay = function () { var e = (0, m["default"])(this.getValue()); if (e !== !1) { var t = !1; g["default"].each(p["default"].COMPONENTS, function (n) { if (!g["default"].isUndefined(e[n]) && !g["default"].isUndefined(this.__color.__state[n]) && e[n] !== this.__color.__state[n]) return t = !0, {}; }, this), t && g["default"].extend(this.__color.__state, e); } g["default"].extend(this.__temp.__state, this.__color.__state), this.__temp.a = 1; var n = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0, o = 255 - n; g["default"].extend(this.__field_knob.style, { marginLeft: 100 * this.__color.s - 7 + "px", marginTop: 100 * (1 - this.__color.v) - 7 + "px", backgroundColor: this.__temp.toHexString(), border: this.__field_knob_border + "rgb(" + n + "," + n + "," + n + ")" }), this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px", this.__temp.s = 1, this.__temp.v = 1, l(this.__saturation_field, "left", "#fff", this.__temp.toHexString()), this.__input.value = this.__color.toString(), g["default"].extend(this.__input.style, { backgroundColor: this.__color.toHexString(), color: "rgb(" + n + "," + n + "," + n + ")", textShadow: this.__input_textShadow + "rgba(" + o + "," + o + "," + o + ",.7)" }); }, t; }(d["default"]), y = ["-moz-", "-o-", "-webkit-", "-ms-", ""]; t["default"] = v; }, function (e, t, n) { "use strict"; function o(e) { return e && e.__esModule ? e : { "default": e }; } function i(e, t, n) { var o = document.createElement("li"); return t && o.appendChild(t), n ? e.__ul.insertBefore(o, n) : e.__ul.appendChild(o), e.onResize(), o; } function r(e, t) { var n = e.__preset_select[e.__preset_select.selectedIndex]; t ? n.innerHTML = n.value + "*" : n.innerHTML = n.value; } function a(e, t, n) { if (n.__li = t, n.__gui = e, U["default"].extend(n, { options: function options(t) { if (arguments.length > 1) { var o = n.__li.nextElementSibling; return n.remove(), s(e, n.object, n.property, { before: o, factoryArgs: [U["default"].toArray(arguments)] }); } if (U["default"].isArray(t) || U["default"].isObject(t)) { var i = n.__li.nextElementSibling; return n.remove(), s(e, n.object, n.property, { before: i, factoryArgs: [t] }); } }, name: function name(e) { return n.__li.firstElementChild.firstElementChild.innerHTML = e, n; }, listen: function listen() { return n.__gui.listen(n), n; },