attr.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["attr"] = factory();
  8. else
  9. root["attr"] = factory();
  10. })(typeof self !== 'undefined' ? self : this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, {
  50. /******/ configurable: false,
  51. /******/ enumerable: true,
  52. /******/ get: getter
  53. /******/ });
  54. /******/ }
  55. /******/ };
  56. /******/
  57. /******/ // getDefaultExport function for compatibility with non-harmony modules
  58. /******/ __webpack_require__.n = function(module) {
  59. /******/ var getter = module && module.__esModule ?
  60. /******/ function getDefault() { return module['default']; } :
  61. /******/ function getModuleExports() { return module; };
  62. /******/ __webpack_require__.d(getter, 'a', getter);
  63. /******/ return getter;
  64. /******/ };
  65. /******/
  66. /******/ // Object.prototype.hasOwnProperty.call
  67. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  68. /******/
  69. /******/ // __webpack_public_path__
  70. /******/ __webpack_require__.p = "";
  71. /******/
  72. /******/ // Load entry module and return exports
  73. /******/ return __webpack_require__(__webpack_require__.s = 6);
  74. /******/ })
  75. /************************************************************************/
  76. /******/ ([
  77. /* 0 */
  78. /***/ (function(module, exports, __webpack_require__) {
  79. /**
  80. * @fileOverview the Attribute base class
  81. */
  82. var isString = __webpack_require__(4);
  83. var isArray = __webpack_require__(1);
  84. var mix = __webpack_require__(10);
  85. var each = __webpack_require__(3);
  86. function toScaleString(scale, value) {
  87. if (isString(value)) {
  88. return value;
  89. }
  90. return scale.invert(scale.scale(value));
  91. }
  92. /**
  93. * 所有视觉通道属性的基类
  94. * @class Attr
  95. */
  96. var AttributeBase =
  97. /*#__PURE__*/
  98. function () {
  99. function AttributeBase(cfg) {
  100. /**
  101. * 属性的类型
  102. * @type {String}
  103. */
  104. this.type = 'base';
  105. /**
  106. * 属性的名称
  107. * @type {String}
  108. */
  109. this.name = null;
  110. /**
  111. * 回调函数
  112. * @type {Function}
  113. */
  114. this.method = null;
  115. /**
  116. * 备选的值数组
  117. * @type {Array}
  118. */
  119. this.values = [];
  120. /**
  121. * 属性内部的度量
  122. * @type {Array}
  123. */
  124. this.scales = [];
  125. /**
  126. * 是否通过线性取值, 如果未指定,则根据数值的类型判定
  127. * @type {Boolean}
  128. */
  129. this.linear = null;
  130. mix(this, cfg);
  131. } // 获取属性值,将值映射到视觉通道
  132. var _proto = AttributeBase.prototype;
  133. _proto._getAttrValue = function _getAttrValue(scale, value) {
  134. var values = this.values;
  135. if (scale.isCategory && !this.linear) {
  136. var index = scale.translate(value);
  137. return values[index % values.length];
  138. }
  139. var percent = scale.scale(value);
  140. return this.getLinearValue(percent);
  141. };
  142. /**
  143. * 如果进行线性映射,返回对应的映射值
  144. * @protected
  145. * @param {Number} percent 百分比
  146. * @return {*} 颜色值、形状、大小等
  147. */
  148. _proto.getLinearValue = function getLinearValue(percent) {
  149. var values = this.values;
  150. var steps = values.length - 1;
  151. var step = Math.floor(steps * percent);
  152. var leftPercent = steps * percent - step;
  153. var start = values[step];
  154. var end = step === steps ? start : values[step + 1];
  155. var rstValue = start + (end - start) * leftPercent;
  156. return rstValue;
  157. };
  158. /**
  159. * 默认的回调函数
  160. * @param {*} value 回调函数的值
  161. * @type {Function}
  162. * @return {Array} 返回映射后的值
  163. */
  164. _proto.callback = function callback(value) {
  165. var self = this;
  166. var scale = self.scales[0];
  167. var rstValue = null;
  168. if (scale.type === 'identity') {
  169. rstValue = scale.value;
  170. } else {
  171. rstValue = self._getAttrValue(scale, value);
  172. }
  173. return rstValue;
  174. };
  175. /**
  176. * 根据度量获取属性名
  177. * @return {Array} dims of this Attribute
  178. */
  179. _proto.getNames = function getNames() {
  180. var scales = this.scales;
  181. var names = this.names;
  182. var length = Math.min(scales.length, names.length);
  183. var rst = [];
  184. for (var i = 0; i < length; i++) {
  185. rst.push(names[i]);
  186. }
  187. return rst;
  188. };
  189. /**
  190. * 根据度量获取维度名
  191. * @return {Array} dims of this Attribute
  192. */
  193. _proto.getFields = function getFields() {
  194. var scales = this.scales;
  195. var rst = [];
  196. each(scales, function (scale) {
  197. rst.push(scale.field);
  198. });
  199. return rst;
  200. };
  201. /**
  202. * 根据名称获取度量
  203. * @param {String} name the name of scale
  204. * @return {Scale} scale
  205. */
  206. _proto.getScale = function getScale(name) {
  207. var scales = this.scales;
  208. var names = this.names;
  209. var index = names.indexOf(name);
  210. return scales[index];
  211. };
  212. /**
  213. * 映射数据
  214. * @param {*} param1...paramn 多个数值
  215. * @return {Array} 映射的值组成的数组
  216. */
  217. _proto.mapping = function mapping() {
  218. var scales = this.scales;
  219. var callback = this.callback;
  220. for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
  221. params[_key] = arguments[_key];
  222. }
  223. var values = params;
  224. if (callback) {
  225. for (var i = 0, len = params.length; i < len; i++) {
  226. params[i] = this._toOriginParam(params[i], scales[i]);
  227. }
  228. values = callback.apply(this, params);
  229. }
  230. values = [].concat(values);
  231. return values;
  232. }; // 原始的参数
  233. _proto._toOriginParam = function _toOriginParam(param, scale) {
  234. var rst = param;
  235. if (!scale.isLinear) {
  236. if (isArray(param)) {
  237. rst = [];
  238. for (var i = 0, len = param.length; i < len; i++) {
  239. rst.push(toScaleString(scale, param[i]));
  240. }
  241. } else {
  242. rst = toScaleString(scale, param);
  243. }
  244. }
  245. return rst;
  246. };
  247. return AttributeBase;
  248. }();
  249. module.exports = AttributeBase;
  250. /***/ }),
  251. /* 1 */
  252. /***/ (function(module, exports, __webpack_require__) {
  253. var isType = __webpack_require__(2);
  254. var isArray = Array.isArray ? Array.isArray : function (value) {
  255. return isType(value, 'Array');
  256. };
  257. module.exports = isArray;
  258. /***/ }),
  259. /* 2 */
  260. /***/ (function(module, exports) {
  261. var toString = {}.toString;
  262. var isType = function isType(value, type) {
  263. return toString.call(value) === '[object ' + type + ']';
  264. };
  265. module.exports = isType;
  266. /***/ }),
  267. /* 3 */
  268. /***/ (function(module, exports, __webpack_require__) {
  269. var isObject = __webpack_require__(9);
  270. var isArray = __webpack_require__(1);
  271. var each = function each(elements, func) {
  272. if (!elements) {
  273. return;
  274. }
  275. var rst = void 0;
  276. if (isArray(elements)) {
  277. for (var i = 0, len = elements.length; i < len; i++) {
  278. rst = func(elements[i], i);
  279. if (rst === false) {
  280. break;
  281. }
  282. }
  283. } else if (isObject(elements)) {
  284. for (var k in elements) {
  285. if (elements.hasOwnProperty(k)) {
  286. rst = func(elements[k], k);
  287. if (rst === false) {
  288. break;
  289. }
  290. }
  291. }
  292. }
  293. };
  294. module.exports = each;
  295. /***/ }),
  296. /* 4 */
  297. /***/ (function(module, exports, __webpack_require__) {
  298. var isType = __webpack_require__(2);
  299. var isString = function isString(str) {
  300. return isType(str, 'String');
  301. };
  302. module.exports = isString;
  303. /***/ }),
  304. /* 5 */
  305. /***/ (function(module, exports, __webpack_require__) {
  306. /**
  307. * @fileOverview 颜色计算的辅助方法
  308. * @author dxq613@gmail.com
  309. */
  310. var isNumber = __webpack_require__(12);
  311. var isString = __webpack_require__(4);
  312. var each = __webpack_require__(3); // const RGB_REG = /rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/;
  313. var RGB_REG = /rgba?\(([\s.,0-9]+)\)/; // 创建辅助 tag 取颜色
  314. function createTmp() {
  315. var i = document.createElement('i');
  316. i.title = 'Web Colour Picker';
  317. i.style.display = 'none';
  318. document.body.appendChild(i);
  319. return i;
  320. } // 获取颜色之间的插值
  321. function getValue(start, end, percent, index) {
  322. var value = start[index] + (end[index] - start[index]) * percent;
  323. return value;
  324. } // 数组转换成颜色
  325. function arr2rgb(arr) {
  326. return '#' + toHex(arr[0]) + toHex(arr[1]) + toHex(arr[2]);
  327. } // 将数值从 0-255 转换成16进制字符串
  328. function toHex(value) {
  329. value = Math.round(value);
  330. value = value.toString(16);
  331. if (value.length === 1) {
  332. value = '0' + value;
  333. }
  334. return value;
  335. }
  336. function calColor(colors, percent) {
  337. if (isNaN(percent) || !isNumber(percent)) {
  338. percent = 0;
  339. }
  340. var steps = colors.length - 1;
  341. var step = Math.floor(steps * percent);
  342. var left = steps * percent - step;
  343. var start = colors[step];
  344. var end = step === steps ? start : colors[step + 1];
  345. var rgb = arr2rgb([getValue(start, end, left, 0), getValue(start, end, left, 1), getValue(start, end, left, 2)]);
  346. return rgb;
  347. } // rgb 颜色转换成数组
  348. function rgb2arr(str) {
  349. var arr = [];
  350. arr.push(parseInt(str.substr(1, 2), 16));
  351. arr.push(parseInt(str.substr(3, 2), 16));
  352. arr.push(parseInt(str.substr(5, 2), 16));
  353. return arr;
  354. }
  355. var colorCache = {};
  356. var iEl = null;
  357. var ColorUtil = {
  358. /**
  359. * 将颜色转换到 rgb 的格式
  360. * @param {String} color 颜色
  361. * @return {String} 将颜色转换到 '#ffffff' 的格式
  362. */
  363. toRGB: function toRGB(color) {
  364. // 如果已经是 rgb的格式
  365. if (color[0] === '#' && color.length === 7) {
  366. return color;
  367. }
  368. if (!iEl) {
  369. // 防止防止在页头报错
  370. iEl = createTmp();
  371. }
  372. var rst;
  373. if (colorCache[color]) {
  374. rst = colorCache[color];
  375. } else {
  376. iEl.style.color = color;
  377. rst = document.defaultView.getComputedStyle(iEl, '').getPropertyValue('color');
  378. var matchs = RGB_REG.exec(rst);
  379. var cArray = matchs[1].split(/\s*,\s*/);
  380. rst = arr2rgb(cArray);
  381. colorCache[color] = rst;
  382. }
  383. return rst;
  384. },
  385. rgb2arr: rgb2arr,
  386. /**
  387. * 获取渐变函数
  388. * @param {Array} colors 多个颜色
  389. * @return {String} 颜色值
  390. */
  391. gradient: function gradient(colors) {
  392. var points = [];
  393. if (isString(colors)) {
  394. colors = colors.split('-');
  395. }
  396. each(colors, function (color) {
  397. if (color.indexOf('#') === -1) {
  398. color = ColorUtil.toRGB(color);
  399. }
  400. points.push(rgb2arr(color));
  401. });
  402. return function (percent) {
  403. return calColor(points, percent);
  404. };
  405. }
  406. };
  407. module.exports = ColorUtil;
  408. /***/ }),
  409. /* 6 */
  410. /***/ (function(module, exports, __webpack_require__) {
  411. module.exports = {
  412. Position: __webpack_require__(7),
  413. Color: __webpack_require__(11),
  414. Shape: __webpack_require__(13),
  415. Size: __webpack_require__(14),
  416. Opacity: __webpack_require__(15),
  417. ColorUtil: __webpack_require__(5)
  418. };
  419. /***/ }),
  420. /* 7 */
  421. /***/ (function(module, exports, __webpack_require__) {
  422. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  423. var isNil = __webpack_require__(8);
  424. var isArray = __webpack_require__(1);
  425. var each = __webpack_require__(3);
  426. var Base = __webpack_require__(0);
  427. var Position =
  428. /*#__PURE__*/
  429. function (_Base) {
  430. _inheritsLoose(Position, _Base);
  431. function Position(cfg) {
  432. var _this;
  433. _this = _Base.call(this, cfg) || this;
  434. _this.names = ['x', 'y'];
  435. _this.type = 'position';
  436. return _this;
  437. }
  438. var _proto = Position.prototype;
  439. _proto.mapping = function mapping(x, y) {
  440. var scales = this.scales;
  441. var coord = this.coord;
  442. var scaleX = scales[0];
  443. var scaleY = scales[1];
  444. var rstX;
  445. var rstY;
  446. var obj;
  447. if (isNil(x) || isNil(y)) {
  448. return [];
  449. }
  450. if (isArray(y) && isArray(x)) {
  451. rstX = [];
  452. rstY = [];
  453. for (var i = 0, j = 0, xLen = x.length, yLen = y.length; i < xLen && j < yLen; i++, j++) {
  454. obj = coord.convertPoint({
  455. x: scaleX.scale(x[i]),
  456. y: scaleY.scale(y[j])
  457. });
  458. rstX.push(obj.x);
  459. rstY.push(obj.y);
  460. }
  461. } else if (isArray(y)) {
  462. x = scaleX.scale(x);
  463. rstY = [];
  464. each(y, function (yVal) {
  465. yVal = scaleY.scale(yVal);
  466. obj = coord.convertPoint({
  467. x: x,
  468. y: yVal
  469. });
  470. if (rstX && rstX !== obj.x) {
  471. if (!isArray(rstX)) {
  472. rstX = [rstX];
  473. }
  474. rstX.push(obj.x);
  475. } else {
  476. rstX = obj.x;
  477. }
  478. rstY.push(obj.y);
  479. });
  480. } else if (isArray(x)) {
  481. y = scaleY.scale(y);
  482. rstX = [];
  483. each(x, function (xVal) {
  484. xVal = scaleX.scale(xVal);
  485. obj = coord.convertPoint({
  486. x: xVal,
  487. y: y
  488. });
  489. if (rstY && rstY !== obj.y) {
  490. if (!isArray(rstY)) {
  491. rstY = [rstY];
  492. }
  493. rstY.push(obj.y);
  494. } else {
  495. rstY = obj.y;
  496. }
  497. rstX.push(obj.x);
  498. });
  499. } else {
  500. x = scaleX.scale(x);
  501. y = scaleY.scale(y);
  502. var point = coord.convertPoint({
  503. x: x,
  504. y: y
  505. });
  506. rstX = point.x;
  507. rstY = point.y;
  508. }
  509. return [rstX, rstY];
  510. };
  511. return Position;
  512. }(Base);
  513. module.exports = Position;
  514. /***/ }),
  515. /* 8 */
  516. /***/ (function(module, exports) {
  517. // isFinite,
  518. var isNil = function isNil(value) {
  519. /**
  520. * isNil(null) => true
  521. * isNil() => true
  522. */
  523. return value === null || value === undefined;
  524. };
  525. module.exports = isNil;
  526. /***/ }),
  527. /* 9 */
  528. /***/ (function(module, exports) {
  529. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  530. return typeof obj;
  531. } : function (obj) {
  532. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  533. };
  534. var isObject = function isObject(value) {
  535. /**
  536. * isObject({}) => true
  537. * isObject([1, 2, 3]) => true
  538. * isObject(Function) => true
  539. * isObject(null) => false
  540. */
  541. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  542. return value !== null && type === 'object' || type === 'function';
  543. };
  544. module.exports = isObject;
  545. /***/ }),
  546. /* 10 */
  547. /***/ (function(module, exports) {
  548. function _mix(dist, obj) {
  549. for (var key in obj) {
  550. if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {
  551. dist[key] = obj[key];
  552. }
  553. }
  554. }
  555. var mix = function mix(dist, src1, src2, src3) {
  556. if (src1) _mix(dist, src1);
  557. if (src2) _mix(dist, src2);
  558. if (src3) _mix(dist, src3);
  559. return dist;
  560. };
  561. module.exports = mix;
  562. /***/ }),
  563. /* 11 */
  564. /***/ (function(module, exports, __webpack_require__) {
  565. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  566. var isString = __webpack_require__(4);
  567. var ColorUtil = __webpack_require__(5);
  568. var Base = __webpack_require__(0);
  569. var Color =
  570. /*#__PURE__*/
  571. function (_Base) {
  572. _inheritsLoose(Color, _Base);
  573. function Color(cfg) {
  574. var _this;
  575. _this = _Base.call(this, cfg) || this;
  576. _this.names = ['color'];
  577. _this.type = 'color';
  578. _this.gradient = null;
  579. if (isString(_this.values)) {
  580. _this.linear = true;
  581. }
  582. return _this;
  583. }
  584. /**
  585. * @override
  586. */
  587. var _proto = Color.prototype;
  588. _proto.getLinearValue = function getLinearValue(percent) {
  589. var gradient = this.gradient;
  590. if (!gradient) {
  591. var values = this.values;
  592. gradient = ColorUtil.gradient(values);
  593. this.gradient = gradient;
  594. }
  595. return gradient(percent);
  596. };
  597. return Color;
  598. }(Base);
  599. module.exports = Color;
  600. /***/ }),
  601. /* 12 */
  602. /***/ (function(module, exports, __webpack_require__) {
  603. /**
  604. * 判断是否数字
  605. * @return {Boolean} 是否数字
  606. */
  607. var isType = __webpack_require__(2);
  608. var isNumber = function isNumber(value) {
  609. return isType(value, 'Number');
  610. };
  611. module.exports = isNumber;
  612. /***/ }),
  613. /* 13 */
  614. /***/ (function(module, exports, __webpack_require__) {
  615. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  616. var Base = __webpack_require__(0);
  617. var Shape =
  618. /*#__PURE__*/
  619. function (_Base) {
  620. _inheritsLoose(Shape, _Base);
  621. function Shape(cfg) {
  622. var _this;
  623. _this = _Base.call(this, cfg) || this;
  624. _this.names = ['shape'];
  625. _this.type = 'shape';
  626. _this.gradient = null;
  627. return _this;
  628. }
  629. /**
  630. * @override
  631. */
  632. var _proto = Shape.prototype;
  633. _proto.getLinearValue = function getLinearValue(percent) {
  634. var values = this.values;
  635. var index = Math.round((values.length - 1) * percent);
  636. return values[index];
  637. };
  638. return Shape;
  639. }(Base);
  640. module.exports = Shape;
  641. /***/ }),
  642. /* 14 */
  643. /***/ (function(module, exports, __webpack_require__) {
  644. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  645. var Base = __webpack_require__(0);
  646. var Size =
  647. /*#__PURE__*/
  648. function (_Base) {
  649. _inheritsLoose(Size, _Base);
  650. function Size(cfg) {
  651. var _this;
  652. _this = _Base.call(this, cfg) || this;
  653. _this.names = ['size'];
  654. _this.type = 'size';
  655. _this.gradient = null;
  656. return _this;
  657. }
  658. return Size;
  659. }(Base);
  660. module.exports = Size;
  661. /***/ }),
  662. /* 15 */
  663. /***/ (function(module, exports, __webpack_require__) {
  664. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  665. var Base = __webpack_require__(0);
  666. var Opacity =
  667. /*#__PURE__*/
  668. function (_Base) {
  669. _inheritsLoose(Opacity, _Base);
  670. function Opacity(cfg) {
  671. var _this;
  672. _this = _Base.call(this, cfg) || this;
  673. _this.names = ['opacity'];
  674. _this.type = 'opacity';
  675. _this.gradient = null;
  676. return _this;
  677. }
  678. return Opacity;
  679. }(Base);
  680. module.exports = Opacity;
  681. /***/ })
  682. /******/ ]);
  683. });
  684. //# sourceMappingURL=attr.js.map