框架源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1798 lines
55 KiB

4 years ago
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 591);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 12:
  90. /***/ (function(module, exports) {
  91. /**
  92. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  93. * embed the css on the page. This breaks all relative urls because now they are relative to a
  94. * bundle instead of the current page.
  95. *
  96. * One solution is to only use full urls, but that may be impossible.
  97. *
  98. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  99. *
  100. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  101. *
  102. */
  103. module.exports = function (css) {
  104. // get current location
  105. var location = typeof window !== "undefined" && window.location;
  106. if (!location) {
  107. throw new Error("fixUrls requires window.location");
  108. }
  109. // blank or null?
  110. if (!css || typeof css !== "string") {
  111. return css;
  112. }
  113. var baseUrl = location.protocol + "//" + location.host;
  114. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  115. // convert each url(...)
  116. /*
  117. This regular expression is just a way to recursively match brackets within
  118. a string.
  119. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  120. ( = Start a capturing group
  121. (?: = Start a non-capturing group
  122. [^)(] = Match anything that isn't a parentheses
  123. | = OR
  124. \( = Match a start parentheses
  125. (?: = Start another non-capturing groups
  126. [^)(]+ = Match anything that isn't a parentheses
  127. | = OR
  128. \( = Match a start parentheses
  129. [^)(]* = Match anything that isn't a parentheses
  130. \) = Match a end parentheses
  131. ) = End Group
  132. *\) = Match anything and then a close parens
  133. ) = Close non-capturing group
  134. * = Match anything
  135. ) = Close capturing group
  136. \) = Match a close parens
  137. /gi = Get all matches, not the first. Be case insensitive.
  138. */
  139. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  140. // strip quotes (if they exist)
  141. var unquotedOrigUrl = origUrl
  142. .trim()
  143. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  144. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  145. // already a full url? no change
  146. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  147. return fullMatch;
  148. }
  149. // convert the url to a full url
  150. var newUrl;
  151. if (unquotedOrigUrl.indexOf("//") === 0) {
  152. //TODO: should we add protocol?
  153. newUrl = unquotedOrigUrl;
  154. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  155. // path should be relative to the base url
  156. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  157. } else {
  158. // path should be relative to current directory
  159. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  160. }
  161. // send back the fixed url(...)
  162. return "url(" + JSON.stringify(newUrl) + ")";
  163. });
  164. // send back the fixed css
  165. return fixedCss;
  166. };
  167. /***/ }),
  168. /***/ 15:
  169. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  170. "use strict";
  171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DEFAULT_THEME; });
  172. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DEFAULT_COLORS; });
  173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return HEAT_MAP_COLOR; });
  174. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return HEAT_BMAP_COLOR; });
  175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return itemPoint; });
  176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return STATIC_PROPS; });
  177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ECHARTS_SETTINGS; });
  178. var DEFAULT_THEME = {
  179. categoryAxis: {
  180. axisLine: { show: false },
  181. axisTick: { show: false },
  182. splitLine: { show: false }
  183. },
  184. valueAxis: {
  185. axisLine: { show: false }
  186. },
  187. line: {
  188. smooth: true
  189. },
  190. grid: {
  191. containLabel: true,
  192. left: 10,
  193. right: 10
  194. }
  195. };
  196. var DEFAULT_COLORS = ['#19d4ae', '#5ab1ef', '#fa6e86', '#ffb980', '#0067a6', '#c4b4e4', '#d87a80', '#9cbbff', '#d9d0c7', '#87a997', '#d49ea2', '#5b4947', '#7ba3a8'];
  197. var HEAT_MAP_COLOR = ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026'];
  198. var HEAT_BMAP_COLOR = ['blue', 'blue', 'green', 'yellow', 'red'];
  199. var itemPoint = function itemPoint(color) {
  200. return ['<span style="', 'background-color:' + color + ';', 'display: inline-block;', 'width: 10px;', 'height: 10px;', 'border-radius: 50%;', 'margin-right:2px;', '"></span>'].join('');
  201. };
  202. var STATIC_PROPS = ['initOptions', 'loading', 'dataEmpty', 'judgeWidth', 'widthChangeDelay'];
  203. var ECHARTS_SETTINGS = ['grid', 'dataZoom', 'visualMap', 'toolbox', 'title', 'legend', 'xAxis', 'yAxis', 'radar', 'tooltip', 'axisPointer', 'brush', 'geo', 'timeline', 'graphic', 'series', 'backgroundColor', 'textStyle'];
  204. /***/ }),
  205. /***/ 17:
  206. /***/ (function(module, exports) {
  207. module.exports = require("echarts/lib/echarts");
  208. /***/ }),
  209. /***/ 2:
  210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  211. "use strict";
  212. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  213. /* globals __VUE_SSR_CONTEXT__ */
  214. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  215. // This module is a runtime utility for cleaner component module output and will
  216. // be included in the final webpack user bundle.
  217. function normalizeComponent (
  218. scriptExports,
  219. render,
  220. staticRenderFns,
  221. functionalTemplate,
  222. injectStyles,
  223. scopeId,
  224. moduleIdentifier, /* server only */
  225. shadowMode /* vue-cli only */
  226. ) {
  227. // Vue.extend constructor export interop
  228. var options = typeof scriptExports === 'function'
  229. ? scriptExports.options
  230. : scriptExports
  231. // render functions
  232. if (render) {
  233. options.render = render
  234. options.staticRenderFns = staticRenderFns
  235. options._compiled = true
  236. }
  237. // functional template
  238. if (functionalTemplate) {
  239. options.functional = true
  240. }
  241. // scopedId
  242. if (scopeId) {
  243. options._scopeId = 'data-v-' + scopeId
  244. }
  245. var hook
  246. if (moduleIdentifier) { // server build
  247. hook = function (context) {
  248. // 2.3 injection
  249. context =
  250. context || // cached call
  251. (this.$vnode && this.$vnode.ssrContext) || // stateful
  252. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  253. // 2.2 with runInNewContext: true
  254. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  255. context = __VUE_SSR_CONTEXT__
  256. }
  257. // inject component styles
  258. if (injectStyles) {
  259. injectStyles.call(this, context)
  260. }
  261. // register component module identifier for async chunk inferrence
  262. if (context && context._registeredComponents) {
  263. context._registeredComponents.add(moduleIdentifier)
  264. }
  265. }
  266. // used by ssr in case component is cached and beforeCreate
  267. // never gets called
  268. options._ssrRegister = hook
  269. } else if (injectStyles) {
  270. hook = shadowMode
  271. ? function () {
  272. injectStyles.call(
  273. this,
  274. (options.functional ? this.parent : this).$root.$options.shadowRoot
  275. )
  276. }
  277. : injectStyles
  278. }
  279. if (hook) {
  280. if (options.functional) {
  281. // for template-only hot-reload because in that case the render fn doesn't
  282. // go through the normalizer
  283. options._injectStyles = hook
  284. // register for functional component in vue file
  285. var originalRender = options.render
  286. options.render = function renderWithStyleInjection (h, context) {
  287. hook.call(context)
  288. return originalRender(h, context)
  289. }
  290. } else {
  291. // inject component registration as beforeCreate hook
  292. var existing = options.beforeCreate
  293. options.beforeCreate = existing
  294. ? [].concat(existing, hook)
  295. : [hook]
  296. }
  297. }
  298. return {
  299. exports: scriptExports,
  300. options: options
  301. }
  302. }
  303. /***/ }),
  304. /***/ 260:
  305. /***/ (function(module, exports) {
  306. module.exports = require("echarts/lib/chart/sankey");
  307. /***/ }),
  308. /***/ 3:
  309. /***/ (function(module, exports) {
  310. module.exports = require("utils-lite");
  311. /***/ }),
  312. /***/ 31:
  313. /***/ (function(module, exports) {
  314. module.exports = require("numerify");
  315. /***/ }),
  316. /***/ 32:
  317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  318. "use strict";
  319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getFormated; });
  320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getStackMap; });
  321. /* unused harmony export $get */
  322. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getMapJSON; });
  323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getBmap; });
  324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getAmap; });
  325. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return setArrayValue; });
  326. /* harmony import */ var numerify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
  327. /* harmony import */ var numerify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(numerify__WEBPACK_IMPORTED_MODULE_0__);
  328. /* harmony import */ var utils_lite__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
  329. /* harmony import */ var utils_lite__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(utils_lite__WEBPACK_IMPORTED_MODULE_1__);
  330. var getFormated = function getFormated(val, type, digit) {
  331. var defaultVal = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
  332. if (isNaN(val)) return defaultVal;
  333. if (!type) return val;
  334. if (Object(utils_lite__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(type)) return type(val, numerify__WEBPACK_IMPORTED_MODULE_0___default.a);
  335. digit = isNaN(digit) ? 0 : ++digit;
  336. var digitStr = '.[' + new Array(digit).join(0) + ']';
  337. var formatter = type;
  338. switch (type) {
  339. case 'KMB':
  340. formatter = digit ? '0,0' + digitStr + 'a' : '0,0a';
  341. break;
  342. case 'normal':
  343. formatter = digit ? '0,0' + digitStr : '0,0';
  344. break;
  345. case 'percent':
  346. formatter = digit ? '0,0' + digitStr + '%' : '0,0.[00]%';
  347. break;
  348. }
  349. return numerify__WEBPACK_IMPORTED_MODULE_0___default()(val, formatter);
  350. };
  351. var getStackMap = function getStackMap(stack) {
  352. var stackMap = {};
  353. Object.keys(stack).forEach(function (item) {
  354. stack[item].forEach(function (name) {
  355. stackMap[name] = item;
  356. });
  357. });
  358. return stackMap;
  359. };
  360. var $get = function $get(url) {
  361. /* eslint-disable */
  362. return new Promise(function (resolve, reject) {
  363. var xhr = new XMLHttpRequest();
  364. xhr.open('GET', url);
  365. xhr.send(null);
  366. xhr.onload = function () {
  367. resolve(JSON.parse(xhr.responseText));
  368. };
  369. xhr.onerror = function () {
  370. reject(JSON.parse(xhr.responseText));
  371. };
  372. });
  373. };
  374. var mapPromise = {};
  375. var getMapJSON = function getMapJSON(_ref) {
  376. var position = _ref.position,
  377. positionJsonLink = _ref.positionJsonLink,
  378. beforeRegisterMapOnce = _ref.beforeRegisterMapOnce,
  379. mapURLProfix = _ref.mapURLProfix;
  380. var link = positionJsonLink || '' + mapURLProfix + position + '.json';
  381. if (!mapPromise[link]) {
  382. mapPromise[link] = $get(link).then(function (res) {
  383. if (beforeRegisterMapOnce) res = beforeRegisterMapOnce(res);
  384. return res;
  385. });
  386. }
  387. return mapPromise[link];
  388. };
  389. var bmapPromise = null;
  390. var amapPromise = null;
  391. var getBmap = function getBmap(key, v) {
  392. if (!bmapPromise) {
  393. bmapPromise = new Promise(function (resolve, reject) {
  394. var callbackName = 'bmap' + Date.now();
  395. window[callbackName] = resolve;
  396. var script = document.createElement('script');
  397. script.src = ['https://api.map.baidu.com/api?v=' + (v || '2.0'), 'ak=' + key, 'callback=' + callbackName].join('&');
  398. document.body.appendChild(script);
  399. });
  400. }
  401. return bmapPromise;
  402. };
  403. var getAmap = function getAmap(key, v) {
  404. if (!amapPromise) {
  405. amapPromise = new Promise(function (resolve, reject) {
  406. var callbackName = 'amap' + Date.now();
  407. window[callbackName] = resolve;
  408. var script = document.createElement('script');
  409. script.src = ['https://webapi.amap.com/maps?v=' + (v || '1.4.3'), 'key=' + key, 'callback=' + callbackName].join('&');
  410. document.body.appendChild(script);
  411. });
  412. }
  413. return amapPromise;
  414. };
  415. function setArrayValue(arr, index, value) {
  416. if (arr[index] !== undefined) {
  417. arr[index].push(value);
  418. } else {
  419. arr[index] = [value];
  420. }
  421. }
  422. /***/ }),
  423. /***/ 39:
  424. /***/ (function(module, exports, __webpack_require__) {
  425. var content = __webpack_require__(57);
  426. if(typeof content === 'string') content = [[module.i, content, '']];
  427. var transform;
  428. var insertInto;
  429. var options = {"hmr":true}
  430. options.transform = transform
  431. options.insertInto = undefined;
  432. var update = __webpack_require__(6)(content, options);
  433. if(content.locals) module.exports = content.locals;
  434. if(false) {}
  435. /***/ }),
  436. /***/ 40:
  437. /***/ (function(module, exports, __webpack_require__) {
  438. var content = __webpack_require__(59);
  439. if(typeof content === 'string') content = [[module.i, content, '']];
  440. var transform;
  441. var insertInto;
  442. var options = {"hmr":true}
  443. options.transform = transform
  444. options.insertInto = undefined;
  445. var update = __webpack_require__(6)(content, options);
  446. if(content.locals) module.exports = content.locals;
  447. if(false) {}
  448. /***/ }),
  449. /***/ 43:
  450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  451. "use strict";
  452. // EXTERNAL MODULE: external "echarts/lib/echarts"
  453. var echarts_ = __webpack_require__(17);
  454. var echarts_default = /*#__PURE__*/__webpack_require__.n(echarts_);
  455. // EXTERNAL MODULE: external "echarts/lib/component/tooltip"
  456. var tooltip_ = __webpack_require__(54);
  457. // EXTERNAL MODULE: external "echarts/lib/component/legend"
  458. var legend_ = __webpack_require__(55);
  459. // EXTERNAL MODULE: external "numerify"
  460. var external_numerify_ = __webpack_require__(31);
  461. var external_numerify_default = /*#__PURE__*/__webpack_require__.n(external_numerify_);
  462. // EXTERNAL MODULE: external "utils-lite"
  463. var external_utils_lite_ = __webpack_require__(3);
  464. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/utils/charts/components/loading.vue?vue&type=template&id=6d18fb16&
  465. var loadingvue_type_template_id_6d18fb16_render = function() {
  466. var _vm = this
  467. var _h = _vm.$createElement
  468. var _c = _vm._self._c || _h
  469. return _c("div", { staticClass: "v-charts-component-loading" }, [
  470. _c("div", { staticClass: "loader" }, [
  471. _c("div", { staticClass: "loading-spinner" }, [
  472. _c(
  473. "svg",
  474. { staticClass: "circular", attrs: { viewBox: "25 25 50 50" } },
  475. [
  476. _c("circle", {
  477. staticClass: "path",
  478. attrs: { cx: "50", cy: "50", r: "20", fill: "none" }
  479. })
  480. ]
  481. )
  482. ])
  483. ])
  484. ])
  485. }
  486. var staticRenderFns = []
  487. loadingvue_type_template_id_6d18fb16_render._withStripped = true
  488. // CONCATENATED MODULE: ./src/utils/charts/components/loading.vue?vue&type=template&id=6d18fb16&
  489. // EXTERNAL MODULE: ./src/utils/charts/components/loading.vue?vue&type=style&index=0&lang=css&
  490. var loadingvue_type_style_index_0_lang_css_ = __webpack_require__(56);
  491. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  492. var componentNormalizer = __webpack_require__(2);
  493. // CONCATENATED MODULE: ./src/utils/charts/components/loading.vue
  494. var script = {}
  495. /* normalize component */
  496. var component = Object(componentNormalizer["a" /* default */])(
  497. script,
  498. loadingvue_type_template_id_6d18fb16_render,
  499. staticRenderFns,
  500. false,
  501. null,
  502. null,
  503. null
  504. )
  505. /* hot reload */
  506. if (false) { var api; }
  507. component.options.__file = "src/utils/charts/components/loading.vue"
  508. /* harmony default export */ var loading = (component.exports);
  509. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/utils/charts/components/data-empty.vue?vue&type=template&id=1f2f0a80&
  510. var data_emptyvue_type_template_id_1f2f0a80_render = function() {
  511. var _vm = this
  512. var _h = _vm.$createElement
  513. var _c = _vm._self._c || _h
  514. return _c("div", { staticClass: "v-charts-data-empty" }, [
  515. _vm._v("\n 暂无数据\n")
  516. ])
  517. }
  518. var data_emptyvue_type_template_id_1f2f0a80_staticRenderFns = []
  519. data_emptyvue_type_template_id_1f2f0a80_render._withStripped = true
  520. // CONCATENATED MODULE: ./src/utils/charts/components/data-empty.vue?vue&type=template&id=1f2f0a80&
  521. // EXTERNAL MODULE: ./src/utils/charts/components/data-empty.vue?vue&type=style&index=0&lang=css&
  522. var data_emptyvue_type_style_index_0_lang_css_ = __webpack_require__(58);
  523. // CONCATENATED MODULE: ./src/utils/charts/components/data-empty.vue
  524. var data_empty_script = {}
  525. /* normalize component */
  526. var data_empty_component = Object(componentNormalizer["a" /* default */])(
  527. data_empty_script,
  528. data_emptyvue_type_template_id_1f2f0a80_render,
  529. data_emptyvue_type_template_id_1f2f0a80_staticRenderFns,
  530. false,
  531. null,
  532. null,
  533. null
  534. )
  535. /* hot reload */
  536. if (false) { var data_empty_api; }
  537. data_empty_component.options.__file = "src/utils/charts/components/data-empty.vue"
  538. /* harmony default export */ var data_empty = (data_empty_component.exports);
  539. // EXTERNAL MODULE: ./src/utils/charts/constants.js
  540. var constants = __webpack_require__(15);
  541. // CONCATENATED MODULE: ./src/utils/charts/modules/extend.js
  542. /* harmony default export */ var modules_extend = (function (options, extend) {
  543. Object.keys(extend).forEach(function (attr) {
  544. var value = extend[attr];
  545. if (~attr.indexOf('.')) {
  546. // eg: a.b.c a.1.b
  547. Object(external_utils_lite_["set"])(options, attr, value);
  548. } else if (typeof value === 'function') {
  549. // get callback value
  550. options[attr] = value(options[attr]);
  551. } else {
  552. // mixin extend value
  553. if (Object(external_utils_lite_["isArray"])(options[attr]) && Object(external_utils_lite_["isObject"])(options[attr][0])) {
  554. // eg: [{ xx: 1 }, { xx: 2 }]
  555. options[attr].forEach(function (option, index) {
  556. options[attr][index] = Object.assign({}, option, value);
  557. });
  558. } else if (Object(external_utils_lite_["isObject"])(options[attr])) {
  559. // eg: { xx: 1, yy: 2 }
  560. options[attr] = Object.assign({}, options[attr], value);
  561. } else {
  562. options[attr] = value;
  563. }
  564. }
  565. });
  566. });
  567. // CONCATENATED MODULE: ./src/utils/charts/modules/mark.js
  568. /* harmony default export */ var mark = (function (seriesItem, marks) {
  569. Object.keys(marks).forEach(function (key) {
  570. if (marks[key]) seriesItem[key] = marks[key];
  571. });
  572. });
  573. // CONCATENATED MODULE: ./src/utils/charts/modules/animation.js
  574. /* harmony default export */ var animation = (function (options, animation) {
  575. Object.keys(animation).forEach(function (key) {
  576. options[key] = animation[key];
  577. });
  578. });
  579. // CONCATENATED MODULE: ./src/utils/charts/core.js
  580. /* harmony default export */ var core = __webpack_exports__["a"] = ({
  581. render: function render(h) {
  582. return h('div', {
  583. class: [Object(external_utils_lite_["camelToKebab"])(this.$options.name || this.$options._componentTag)],
  584. style: this.canvasStyle
  585. }, [h('div', {
  586. style: this.canvasStyle,
  587. class: { 'v-charts-mask-status': this.dataEmpty || this.loading },
  588. ref: 'canvas'
  589. }), h(data_empty, {
  590. style: { display: this.dataEmpty ? '' : 'none' }
  591. }), h(loading, {
  592. style: { display: this.loading ? '' : 'none' }
  593. }), this.$slots.default]);
  594. },
  595. props: {
  596. data: { type: [Object, Array], default: function _default() {
  597. return {};
  598. }
  599. },
  600. settings: { type: Object, default: function _default() {
  601. return {};
  602. }
  603. },
  604. width: { type: String, default: 'auto' },
  605. height: { type: String, default: '400px' },
  606. beforeConfig: { type: Function },
  607. afterConfig: { type: Function },
  608. afterSetOption: { type: Function },
  609. afterSetOptionOnce: { type: Function },
  610. events: { type: Object },
  611. grid: { type: [Object, Array] },
  612. colors: { type: Array },
  613. tooltipVisible: { type: Boolean, default: true },
  614. legendVisible: { type: Boolean, default: true },
  615. legendPosition: { type: String },
  616. markLine: { type: Object },
  617. markArea: { type: Object },
  618. markPoint: { type: Object },
  619. visualMap: { type: [Object, Array] },
  620. dataZoom: { type: [Object, Array] },
  621. toolbox: { type: [Object, Array] },
  622. initOptions: { type: Object, default: function _default() {
  623. return {};
  624. }
  625. },
  626. title: [Object, Array],
  627. legend: [Object, Array],
  628. xAxis: [Object, Array],
  629. yAxis: [Object, Array],
  630. radar: Object,
  631. tooltip: Object,
  632. axisPointer: [Object, Array],
  633. brush: [Object, Array],
  634. geo: [Object, Array],
  635. timeline: [Object, Array],
  636. graphic: [Object, Array],
  637. series: [Object, Array],
  638. backgroundColor: [Object, String],
  639. textStyle: [Object, Array],
  640. animation: Object,
  641. theme: Object,
  642. themeName: String,
  643. loading: Boolean,
  644. dataEmpty: Boolean,
  645. extend: Object,
  646. judgeWidth: { type: Boolean, default: false },
  647. widthChangeDelay: { type: Number, default: 300 },
  648. tooltipFormatter: { type: Function },
  649. resizeable: { type: Boolean, default: true },
  650. resizeDelay: { type: Number, default: 200 },
  651. changeDelay: { type: Number, default: 0 },
  652. setOptionOpts: { type: [Boolean, Object], default: true },
  653. cancelResizeCheck: Boolean,
  654. notSetUnchange: Array,
  655. log: Boolean
  656. },
  657. watch: {
  658. data: {
  659. deep: true,
  660. handler: function handler(v) {
  661. if (v) {
  662. this.changeHandler();
  663. }
  664. }
  665. },
  666. settings: {
  667. deep: true,
  668. handler: function handler(v) {
  669. if (v.type && this.chartLib) this.chartHandler = this.chartLib[v.type];
  670. this.changeHandler();
  671. }
  672. },
  673. width: 'nextTickResize',
  674. height: 'nextTickResize',
  675. events: {
  676. deep: true,
  677. handler: 'createEventProxy'
  678. },
  679. theme: {
  680. deep: true,
  681. handler: 'themeChange'
  682. },
  683. themeName: 'themeChange',
  684. resizeable: 'resizeableHandler'
  685. },
  686. computed: {
  687. canvasStyle: function canvasStyle() {
  688. return {
  689. width: this.width,
  690. height: this.height,
  691. position: 'relative'
  692. };
  693. },
  694. chartColor: function chartColor() {
  695. return this.colors || this.theme && this.theme.color || constants["a" /* DEFAULT_COLORS */];
  696. }
  697. },
  698. methods: {
  699. dataHandler: function dataHandler() {
  700. if (!this.chartHandler) return;
  701. var data = this.data;
  702. var _data = data,
  703. _data$columns = _data.columns,
  704. columns = _data$columns === undefined ? [] : _data$columns,
  705. _data$rows = _data.rows,
  706. rows = _data$rows === undefined ? [] : _data$rows;
  707. var extra = {
  708. tooltipVisible: this.tooltipVisible,
  709. legendVisible: this.legendVisible,
  710. echarts: this.echarts,
  711. color: this.chartColor,
  712. tooltipFormatter: this.tooltipFormatter,
  713. _once: this._once
  714. };
  715. if (this.beforeConfig) data = this.beforeConfig(data);
  716. var options = this.chartHandler(columns, rows, this.settings, extra);
  717. if (options) {
  718. if (typeof options.then === 'function') {
  719. options.then(this.optionsHandler);
  720. } else {
  721. this.optionsHandler(options);
  722. }
  723. }
  724. },
  725. nextTickResize: function nextTickResize() {
  726. this.$nextTick(this.resize);
  727. },
  728. resize: function resize() {
  729. if (!this.cancelResizeCheck) {
  730. if (this.$el && this.$el.clientWidth && this.$el.clientHeight) {
  731. this.echartsResize();
  732. }
  733. } else {
  734. this.echartsResize();
  735. }
  736. },
  737. echartsResize: function echartsResize() {
  738. this.echarts && this.echarts.resize();
  739. },
  740. optionsHandler: function optionsHandler(options) {
  741. var _this = this;
  742. // legend
  743. if (this.legendPosition && options.legend) {
  744. options.legend[this.legendPosition] = 10;
  745. if (~['left', 'right'].indexOf(this.legendPosition)) {
  746. options.legend.top = 'middle';
  747. options.legend.orient = 'vertical';
  748. }
  749. }
  750. // color
  751. options.color = this.chartColor;
  752. // echarts self settings
  753. constants["c" /* ECHARTS_SETTINGS */].forEach(function (setting) {
  754. if (_this[setting]) options[setting] = _this[setting];
  755. });
  756. // animation
  757. if (this.animation) animation(options, this.animation);
  758. // marks
  759. if (this.markArea || this.markLine || this.markPoint) {
  760. var marks = {
  761. markArea: this.markArea,
  762. markLine: this.markLine,
  763. markPoint: this.markPoint
  764. };
  765. var series = options.series;
  766. if (Object(external_utils_lite_["isArray"])(series)) {
  767. series.forEach(function (item) {
  768. mark(item, marks);
  769. });
  770. } else if (Object(external_utils_lite_["isObject"])(series)) {
  771. mark(series, marks);
  772. }
  773. }
  774. // change inited echarts settings
  775. if (this.extend) modules_extend(options, this.extend);
  776. if (this.afterConfig) options = this.afterConfig(options);
  777. var setOptionOpts = this.setOptionOpts;
  778. // map chart not merge
  779. if ((this.settings.bmap || this.settings.amap) && !Object(external_utils_lite_["isObject"])(setOptionOpts)) {
  780. setOptionOpts = false;
  781. }
  782. // exclude unchange options
  783. if (this.notSetUnchange && this.notSetUnchange.length) {
  784. this.notSetUnchange.forEach(function (item) {
  785. var value = options[item];
  786. if (value) {
  787. if (Object(external_utils_lite_["isEqual"])(value, _this._store[item])) {
  788. options[item] = undefined;
  789. } else {
  790. _this._store[item] = Object(external_utils_lite_["cloneDeep"])(value);
  791. }
  792. }
  793. });
  794. if (Object(external_utils_lite_["isObject"])(setOptionOpts)) {
  795. setOptionOpts.notMerge = false;
  796. } else {
  797. setOptionOpts = false;
  798. }
  799. }
  800. if (this._isDestroyed) return;
  801. if (this.log) console.log(options);
  802. console.log('options------->', options);
  803. console.log('setOptions----->', setOptionOpts);
  804. // 设置一些基本参数
  805. options.legend.textStyle = {
  806. color: '#FFF'
  807. };
  808. this.echarts.setOption(options, setOptionOpts);
  809. this.$emit('ready', this.echarts, options, echarts_default.a);
  810. if (!this._once['ready-once']) {
  811. this._once['ready-once'] = true;
  812. this.$emit('ready-once', this.echarts, options, echarts_default.a);
  813. }
  814. if (this.judgeWidth) this.judgeWidthHandler(options);
  815. if (this.afterSetOption) this.afterSetOption(this.echarts, options, echarts_default.a);
  816. if (this.afterSetOptionOnce && !this._once['afterSetOptionOnce']) {
  817. this._once['afterSetOptionOnce'] = true;
  818. this.afterSetOptionOnce(this.echarts, options, echarts_default.a);
  819. }
  820. },
  821. judgeWidthHandler: function judgeWidthHandler(options) {
  822. var _this2 = this;
  823. var widthChangeDelay = this.widthChangeDelay,
  824. resize = this.resize;
  825. if (this.$el.clientWidth || this.$el.clientHeight) {
  826. resize();
  827. } else {
  828. this.$nextTick(function (_) {
  829. if (_this2.$el.clientWidth || _this2.$el.clientHeight) {
  830. resize();
  831. } else {
  832. setTimeout(function (_) {
  833. resize();
  834. if (!_this2.$el.clientWidth || !_this2.$el.clientHeight) {
  835. console.warn(' Can\'t get dom width or height ');
  836. }
  837. }, widthChangeDelay);
  838. }
  839. });
  840. }
  841. },
  842. resizeableHandler: function resizeableHandler(resizeable) {
  843. if (resizeable && !this._once.onresize) this.addResizeListener();
  844. if (!resizeable && this._once.onresize) this.removeResizeListener();
  845. },
  846. init: function init() {
  847. if (this.echarts) return;
  848. var themeName = this.themeName || this.theme || constants["b" /* DEFAULT_THEME */];
  849. this.echarts = echarts_default.a.init(this.$refs.canvas, themeName, this.initOptions);
  850. if (this.data) this.changeHandler();
  851. this.createEventProxy();
  852. if (this.resizeable) this.addResizeListener();
  853. },
  854. addResizeListener: function addResizeListener() {
  855. window.addEventListener('resize', this.resizeHandler);
  856. this._once.onresize = true;
  857. },
  858. removeResizeListener: function removeResizeListener() {
  859. window.removeEventListener('resize', this.resizeHandler);
  860. this._once.onresize = false;
  861. },
  862. addWatchToProps: function addWatchToProps() {
  863. var _this3 = this;
  864. var watchedVariable = this._watchers.map(function (watcher) {
  865. return watcher.expression;
  866. });
  867. Object.keys(this.$props).forEach(function (prop) {
  868. if (!~watchedVariable.indexOf(prop) && !~constants["f" /* STATIC_PROPS */].indexOf(prop)) {
  869. var opts = {};
  870. if (~['[object Object]', '[object Array]'].indexOf(Object(external_utils_lite_["getType"])(_this3.$props[prop]))) {
  871. opts.deep = true;
  872. }
  873. _this3.$watch(prop, function () {
  874. _this3.changeHandler();
  875. }, opts);
  876. }
  877. });
  878. },
  879. createEventProxy: function createEventProxy() {
  880. var _this4 = this;
  881. // 只要用户使用 on 方法绑定的事件都做一层代理,
  882. // 是否真正执行相应的事件方法取决于该方法是否仍然存在 events 中
  883. // 实现 events 的动态响应
  884. var self = this;
  885. var keys = Object.keys(this.events || {});
  886. keys.length && keys.forEach(function (ev) {
  887. if (_this4.registeredEvents.indexOf(ev) === -1) {
  888. _this4.registeredEvents.push(ev);
  889. _this4.echarts.on(ev, function (ev) {
  890. return function () {
  891. if (ev in self.events) {
  892. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  893. args[_key] = arguments[_key];
  894. }
  895. self.events[ev].apply(null, args);
  896. }
  897. };
  898. }(ev));
  899. }
  900. });
  901. },
  902. themeChange: function themeChange(theme) {
  903. this.clean();
  904. this.echarts = null;
  905. this.init();
  906. },
  907. clean: function clean() {
  908. if (this.resizeable) this.removeResizeListener();
  909. this.echarts.dispose();
  910. }
  911. },
  912. created: function created() {
  913. this.echarts = null;
  914. this.registeredEvents = [];
  915. this._once = {};
  916. this._store = {};
  917. this.resizeHandler = Object(external_utils_lite_["debounce"])(this.resize, this.resizeDelay);
  918. this.changeHandler = Object(external_utils_lite_["debounce"])(this.dataHandler, this.changeDelay);
  919. this.addWatchToProps();
  920. },
  921. mounted: function mounted() {
  922. this.init();
  923. },
  924. beforeDestroy: function beforeDestroy() {
  925. this.clean();
  926. },
  927. _numerify: external_numerify_default.a
  928. });
  929. /***/ }),
  930. /***/ 5:
  931. /***/ (function(module, exports, __webpack_require__) {
  932. "use strict";
  933. /*
  934. MIT License http://www.opensource.org/licenses/mit-license.php
  935. Author Tobias Koppers @sokra
  936. */
  937. // css base code, injected by the css-loader
  938. module.exports = function (useSourceMap) {
  939. var list = []; // return the list of modules as css string
  940. list.toString = function toString() {
  941. return this.map(function (item) {
  942. var content = cssWithMappingToString(item, useSourceMap);
  943. if (item[2]) {
  944. return '@media ' + item[2] + '{' + content + '}';
  945. } else {
  946. return content;
  947. }
  948. }).join('');
  949. }; // import a list of modules into the list
  950. list.i = function (modules, mediaQuery) {
  951. if (typeof modules === 'string') {
  952. modules = [[null, modules, '']];
  953. }
  954. var alreadyImportedModules = {};
  955. for (var i = 0; i < this.length; i++) {
  956. var id = this[i][0];
  957. if (id != null) {
  958. alreadyImportedModules[id] = true;
  959. }
  960. }
  961. for (i = 0; i < modules.length; i++) {
  962. var item = modules[i]; // skip already imported module
  963. // this implementation is not 100% perfect for weird media query combinations
  964. // when a module is imported multiple times with different media queries.
  965. // I hope this will never occur (Hey this way we have smaller bundles)
  966. if (item[0] == null || !alreadyImportedModules[item[0]]) {
  967. if (mediaQuery && !item[2]) {
  968. item[2] = mediaQuery;
  969. } else if (mediaQuery) {
  970. item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
  971. }
  972. list.push(item);
  973. }
  974. }
  975. };
  976. return list;
  977. };
  978. function cssWithMappingToString(item, useSourceMap) {
  979. var content = item[1] || '';
  980. var cssMapping = item[3];
  981. if (!cssMapping) {
  982. return content;
  983. }
  984. if (useSourceMap && typeof btoa === 'function') {
  985. var sourceMapping = toComment(cssMapping);
  986. var sourceURLs = cssMapping.sources.map(function (source) {
  987. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
  988. });
  989. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  990. }
  991. return [content].join('\n');
  992. } // Adapted from convert-source-map (MIT)
  993. function toComment(sourceMap) {
  994. // eslint-disable-next-line no-undef
  995. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  996. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  997. return '/*# ' + data + ' */';
  998. }
  999. /***/ }),
  1000. /***/ 54:
  1001. /***/ (function(module, exports) {
  1002. module.exports = require("echarts/lib/component/tooltip");
  1003. /***/ }),
  1004. /***/ 55:
  1005. /***/ (function(module, exports) {
  1006. module.exports = require("echarts/lib/component/legend");
  1007. /***/ }),
  1008. /***/ 56:
  1009. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1010. "use strict";
  1011. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_loading_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39);
  1012. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_loading_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_loading_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  1013. /* unused harmony reexport * */
  1014. /***/ }),
  1015. /***/ 57:
  1016. /***/ (function(module, exports, __webpack_require__) {
  1017. exports = module.exports = __webpack_require__(5)(false);
  1018. // Module
  1019. exports.push([module.i, "\n.v-charts-component-loading {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255, .9);\n}\n.v-charts-mask-status {\n filter: blur(1px);\n}\n.v-charts-component-loading .circular {\n width: 42px;\n height: 42px;\n animation: loading-rotate 2s linear infinite;\n}\n.v-charts-component-loading .path {\n animation: loading-dash 1.5s ease-in-out infinite;\n stroke-dasharray: 90,150;\n stroke-dashoffset: 0;\n stroke-width: 2;\n stroke: #20a0ff;\n stroke-linecap: round;\n}\n@keyframes loading-rotate {\n100% {\n transform: rotate(360deg);\n}\n}\n@keyframes loading-dash {\n0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n}\n50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -40px;\n}\n100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -120px;\n}\n}\n", ""]);
  1020. /***/ }),
  1021. /***/ 58:
  1022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1023. "use strict";
  1024. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_data_empty_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
  1025. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_data_empty_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_vue_loader_lib_index_js_vue_loader_options_data_empty_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  1026. /* unused harmony reexport * */
  1027. /***/ }),
  1028. /***/ 59:
  1029. /***/ (function(module, exports, __webpack_require__) {
  1030. exports = module.exports = __webpack_require__(5)(false);
  1031. // Module
  1032. exports.push([module.i, "\n.v-charts-data-empty {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255, .9);\n color: #888;\n font-size: 14px;\n}\n", ""]);
  1033. /***/ }),
  1034. /***/ 591:
  1035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1036. "use strict";
  1037. // ESM COMPAT FLAG
  1038. __webpack_require__.r(__webpack_exports__);
  1039. // EXTERNAL MODULE: external "echarts/lib/chart/sankey"
  1040. var sankey_ = __webpack_require__(260);
  1041. // EXTERNAL MODULE: ./src/utils/charts/utils.js
  1042. var utils = __webpack_require__(32);
  1043. // EXTERNAL MODULE: ./src/utils/charts/constants.js
  1044. var constants = __webpack_require__(15);
  1045. // CONCATENATED MODULE: ./packages/c-sankey/main.js
  1046. function getTooltip(args) {
  1047. var itemDataType = args.itemDataType,
  1048. linksDataType = args.linksDataType,
  1049. digit = args.digit;
  1050. return {
  1051. trigger: 'item',
  1052. formatter: function formatter(item) {
  1053. var tpl = [];
  1054. var name = item.name,
  1055. data = item.data,
  1056. value = item.value,
  1057. color = item.color;
  1058. tpl.push(Object(constants["g" /* itemPoint */])(color));
  1059. tpl.push(name + ' : ');
  1060. if (data && data.source) {
  1061. tpl.push(Object(utils["c" /* getFormated */])(value, linksDataType, digit) + '<br />');
  1062. } else {
  1063. tpl.push(Object(utils["c" /* getFormated */])(value, itemDataType, digit) + '<br />');
  1064. }
  1065. return tpl.join('');
  1066. }
  1067. };
  1068. }
  1069. function getSeries(args) {
  1070. var rows = args.rows,
  1071. dimension = args.dimension,
  1072. metrics = args.metrics,
  1073. links = args.links,
  1074. valueFull = args.valueFull,
  1075. useDataValue = args.useDataValue,
  1076. label = args.label,
  1077. itemStyle = args.itemStyle,
  1078. lineStyle = args.lineStyle;
  1079. var dataMap = {};
  1080. var seriesData = rows.map(function (row) {
  1081. dataMap[row[dimension]] = row[metrics];
  1082. return { name: row[dimension], value: row[metrics] };
  1083. });
  1084. var innerLinks = null;
  1085. if (useDataValue) {
  1086. innerLinks = links.map(function (link) {
  1087. return Object.assign({}, link, { value: dataMap[link.target] });
  1088. });
  1089. } else if (!valueFull) {
  1090. innerLinks = links.map(function (link) {
  1091. return link.value == null ? Object.assign({}, link, { value: dataMap[link.target] }) : link;
  1092. });
  1093. } else {
  1094. innerLinks = links;
  1095. }
  1096. var result = {
  1097. type: 'sankey',
  1098. data: seriesData,
  1099. links: innerLinks
  1100. };
  1101. if (label) result.label = label;
  1102. if (itemStyle) result.itemStyle = itemStyle;
  1103. if (lineStyle) result.lineStyle = lineStyle;
  1104. return [result];
  1105. }
  1106. var sankey = function sankey(columns, rows, settings, extra) {
  1107. var links = settings.links,
  1108. _settings$dimension = settings.dimension,
  1109. dimension = _settings$dimension === undefined ? columns[0] : _settings$dimension,
  1110. _settings$metrics = settings.metrics,
  1111. metrics = _settings$metrics === undefined ? columns[1] : _settings$metrics,
  1112. _settings$dataType = settings.dataType,
  1113. dataType = _settings$dataType === undefined ? ['normal', 'normal'] : _settings$dataType,
  1114. _settings$digit = settings.digit,
  1115. digit = _settings$digit === undefined ? 2 : _settings$digit,
  1116. _settings$valueFull = settings.valueFull,
  1117. valueFull = _settings$valueFull === undefined ? false : _settings$valueFull,
  1118. _settings$useDataValu = settings.useDataValue,
  1119. useDataValue = _settings$useDataValu === undefined ? false : _settings$useDataValu,
  1120. label = settings.label,
  1121. itemStyle = settings.itemStyle,
  1122. lineStyle = settings.lineStyle;
  1123. if (!links) {
  1124. console.warn('links is needed in settings!');
  1125. return;
  1126. }
  1127. var itemDataType = dataType[0];
  1128. var linksDataType = dataType[1];
  1129. var tooltip = getTooltip({
  1130. itemDataType: itemDataType,
  1131. linksDataType: linksDataType,
  1132. digit: digit
  1133. });
  1134. var series = getSeries({
  1135. rows: rows,
  1136. dimension: dimension,
  1137. metrics: metrics,
  1138. links: links,
  1139. valueFull: valueFull,
  1140. useDataValue: useDataValue,
  1141. label: label,
  1142. itemStyle: itemStyle,
  1143. lineStyle: lineStyle
  1144. });
  1145. return { tooltip: tooltip, series: series };
  1146. };
  1147. // EXTERNAL MODULE: ./src/utils/charts/core.js + 9 modules
  1148. var core = __webpack_require__(43);
  1149. // CONCATENATED MODULE: ./packages/c-sankey/index.js
  1150. /* harmony default export */ var c_sankey = __webpack_exports__["default"] = (Object.assign({}, core["a" /* default */], {
  1151. name: 'VeSankey',
  1152. data: function data() {
  1153. this.chartHandler = sankey;
  1154. return {};
  1155. }
  1156. }));
  1157. /***/ }),
  1158. /***/ 6:
  1159. /***/ (function(module, exports, __webpack_require__) {
  1160. /*
  1161. MIT License http://www.opensource.org/licenses/mit-license.php
  1162. Author Tobias Koppers @sokra
  1163. */
  1164. var stylesInDom = {};
  1165. var memoize = function (fn) {
  1166. var memo;
  1167. return function () {
  1168. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  1169. return memo;
  1170. };
  1171. };
  1172. var isOldIE = memoize(function () {
  1173. // Test for IE <= 9 as proposed by Browserhacks
  1174. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  1175. // Tests for existence of standard globals is to allow style-loader
  1176. // to operate correctly into non-standard environments
  1177. // @see https://github.com/webpack-contrib/style-loader/issues/177
  1178. return window && document && document.all && !window.atob;
  1179. });
  1180. var getTarget = function (target, parent) {
  1181. if (parent){
  1182. return parent.querySelector(target);
  1183. }
  1184. return document.querySelector(target);
  1185. };
  1186. var getElement = (function (fn) {
  1187. var memo = {};
  1188. return function(target, parent) {
  1189. // If passing function in options, then use it for resolve "head" element.
  1190. // Useful for Shadow Root style i.e
  1191. // {
  1192. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  1193. // }
  1194. if (typeof target === 'function') {
  1195. return target();
  1196. }
  1197. if (typeof memo[target] === "undefined") {
  1198. var styleTarget = getTarget.call(this, target, parent);
  1199. // Special case to return head of iframe instead of iframe itself
  1200. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  1201. try {
  1202. // This will throw an exception if access to iframe is blocked
  1203. // due to cross-origin restrictions
  1204. styleTarget = styleTarget.contentDocument.head;
  1205. } catch(e) {
  1206. styleTarget = null;
  1207. }
  1208. }
  1209. memo[target] = styleTarget;
  1210. }
  1211. return memo[target]
  1212. };
  1213. })();
  1214. var singleton = null;
  1215. var singletonCounter = 0;
  1216. var stylesInsertedAtTop = [];
  1217. var fixUrls = __webpack_require__(12);
  1218. module.exports = function(list, options) {
  1219. if (typeof DEBUG !== "undefined" && DEBUG) {
  1220. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  1221. }
  1222. options = options || {};
  1223. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  1224. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  1225. // tags it will allow on a page
  1226. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  1227. // By default, add <style> tags to the <head> element
  1228. if (!options.insertInto) options.insertInto = "head";
  1229. // By default, add <style> tags to the bottom of the target
  1230. if (!options.insertAt) options.insertAt = "bottom";
  1231. var styles = listToStyles(list, options);
  1232. addStylesToDom(styles, options);
  1233. return function update (newList) {
  1234. var mayRemove = [];
  1235. for (var i = 0; i < styles.length; i++) {
  1236. var item = styles[i];
  1237. var domStyle = stylesInDom[item.id];
  1238. domStyle.refs--;
  1239. mayRemove.push(domStyle);
  1240. }
  1241. if(newList) {
  1242. var newStyles = listToStyles(newList, options);
  1243. addStylesToDom(newStyles, options);
  1244. }
  1245. for (var i = 0; i < mayRemove.length; i++) {
  1246. var domStyle = mayRemove[i];
  1247. if(domStyle.refs === 0) {
  1248. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  1249. delete stylesInDom[domStyle.id];
  1250. }
  1251. }
  1252. };
  1253. };
  1254. function addStylesToDom (styles, options) {
  1255. for (var i = 0; i < styles.length; i++) {
  1256. var item = styles[i];
  1257. var domStyle = stylesInDom[item.id];
  1258. if(domStyle) {
  1259. domStyle.refs++;
  1260. for(var j = 0; j < domStyle.parts.length; j++) {
  1261. domStyle.parts[j](item.parts[j]);
  1262. }
  1263. for(; j < item.parts.length; j++) {
  1264. domStyle.parts.push(addStyle(item.parts[j], options));
  1265. }
  1266. } else {
  1267. var parts = [];
  1268. for(var j = 0; j < item.parts.length; j++) {
  1269. parts.push(addStyle(item.parts[j], options));
  1270. }
  1271. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  1272. }
  1273. }
  1274. }
  1275. function listToStyles (list, options) {
  1276. var styles = [];
  1277. var newStyles = {};
  1278. for (var i = 0; i < list.length; i++) {
  1279. var item = list[i];
  1280. var id = options.base ? item[0] + options.base : item[0];
  1281. var css = item[1];
  1282. var media = item[2];
  1283. var sourceMap = item[3];
  1284. var part = {css: css, media: media, sourceMap: sourceMap};
  1285. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  1286. else newStyles[id].parts.push(part);
  1287. }
  1288. return styles;
  1289. }
  1290. function insertStyleElement (options, style) {
  1291. var target = getElement(options.insertInto)
  1292. if (!target) {
  1293. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  1294. }
  1295. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  1296. if (options.insertAt === "top") {
  1297. if (!lastStyleElementInsertedAtTop) {
  1298. target.insertBefore(style, target.firstChild);
  1299. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  1300. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  1301. } else {
  1302. target.appendChild(style);
  1303. }
  1304. stylesInsertedAtTop.push(style);
  1305. } else if (options.insertAt === "bottom") {
  1306. target.appendChild(style);
  1307. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  1308. var nextSibling = getElement(options.insertAt.before, target);
  1309. target.insertBefore(style, nextSibling);
  1310. } else {
  1311. throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
  1312. }
  1313. }
  1314. function removeStyleElement (style) {
  1315. if (style.parentNode === null) return false;
  1316. style.parentNode.removeChild(style);
  1317. var idx = stylesInsertedAtTop.indexOf(style);
  1318. if(idx >= 0) {
  1319. stylesInsertedAtTop.splice(idx, 1);
  1320. }
  1321. }
  1322. function createStyleElement (options) {
  1323. var style = document.createElement("style");
  1324. if(options.attrs.type === undefined) {
  1325. options.attrs.type = "text/css";
  1326. }
  1327. if(options.attrs.nonce === undefined) {
  1328. var nonce = getNonce();
  1329. if (nonce) {
  1330. options.attrs.nonce = nonce;
  1331. }
  1332. }
  1333. addAttrs(style, options.attrs);
  1334. insertStyleElement(options, style);
  1335. return style;
  1336. }
  1337. function createLinkElement (options) {
  1338. var link = document.createElement("link");
  1339. if(options.attrs.type === undefined) {
  1340. options.attrs.type = "text/css";
  1341. }
  1342. options.attrs.rel = "stylesheet";
  1343. addAttrs(link, options.attrs);
  1344. insertStyleElement(options, link);
  1345. return link;
  1346. }
  1347. function addAttrs (el, attrs) {
  1348. Object.keys(attrs).forEach(function (key) {
  1349. el.setAttribute(key, attrs[key]);
  1350. });
  1351. }
  1352. function getNonce() {
  1353. if (false) {}
  1354. return __webpack_require__.nc;
  1355. }
  1356. function addStyle (obj, options) {
  1357. var style, update, remove, result;
  1358. // If a transform function was defined, run it on the css
  1359. if (options.transform && obj.css) {
  1360. result = typeof options.transform === 'function'
  1361. ? options.transform(obj.css)
  1362. : options.transform.default(obj.css);
  1363. if (result) {
  1364. // If transform returns a value, use that instead of the original css.
  1365. // This allows running runtime transformations on the css.
  1366. obj.css = result;
  1367. } else {
  1368. // If the transform function returns a falsy value, don't add this css.
  1369. // This allows conditional loading of css
  1370. return function() {
  1371. // noop
  1372. };
  1373. }
  1374. }
  1375. if (options.singleton) {
  1376. var styleIndex = singletonCounter++;
  1377. style = singleton || (singleton = createStyleElement(options));
  1378. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  1379. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  1380. } else if (
  1381. obj.sourceMap &&
  1382. typeof URL === "function" &&
  1383. typeof URL.createObjectURL === "function" &&
  1384. typeof URL.revokeObjectURL === "function" &&
  1385. typeof Blob === "function" &&
  1386. typeof btoa === "function"
  1387. ) {
  1388. style = createLinkElement(options);
  1389. update = updateLink.bind(null, style, options);
  1390. remove = function () {
  1391. removeStyleElement(style);
  1392. if(style.href) URL.revokeObjectURL(style.href);
  1393. };
  1394. } else {
  1395. style = createStyleElement(options);
  1396. update = applyToTag.bind(null, style);
  1397. remove = function () {
  1398. removeStyleElement(style);
  1399. };
  1400. }
  1401. update(obj);
  1402. return function updateStyle (newObj) {
  1403. if (newObj) {
  1404. if (
  1405. newObj.css === obj.css &&
  1406. newObj.media === obj.media &&
  1407. newObj.sourceMap === obj.sourceMap
  1408. ) {
  1409. return;
  1410. }
  1411. update(obj = newObj);
  1412. } else {
  1413. remove();
  1414. }
  1415. };
  1416. }
  1417. var replaceText = (function () {
  1418. var textStore = [];
  1419. return function (index, replacement) {
  1420. textStore[index] = replacement;
  1421. return textStore.filter(Boolean).join('\n');
  1422. };
  1423. })();
  1424. function applyToSingletonTag (style, index, remove, obj) {
  1425. var css = remove ? "" : obj.css;
  1426. if (style.styleSheet) {
  1427. style.styleSheet.cssText = replaceText(index, css);
  1428. } else {
  1429. var cssNode = document.createTextNode(css);
  1430. var childNodes = style.childNodes;
  1431. if (childNodes[index]) style.removeChild(childNodes[index]);
  1432. if (childNodes.length) {
  1433. style.insertBefore(cssNode, childNodes[index]);
  1434. } else {
  1435. style.appendChild(cssNode);
  1436. }
  1437. }
  1438. }
  1439. function applyToTag (style, obj) {
  1440. var css = obj.css;
  1441. var media = obj.media;
  1442. if(media) {
  1443. style.setAttribute("media", media)
  1444. }
  1445. if(style.styleSheet) {
  1446. style.styleSheet.cssText = css;
  1447. } else {
  1448. while(style.firstChild) {
  1449. style.removeChild(style.firstChild);
  1450. }
  1451. style.appendChild(document.createTextNode(css));
  1452. }
  1453. }
  1454. function updateLink (link, options, obj) {
  1455. var css = obj.css;
  1456. var sourceMap = obj.sourceMap;
  1457. /*
  1458. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  1459. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  1460. on by default. Otherwise default to the convertToAbsoluteUrls option
  1461. directly
  1462. */
  1463. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  1464. if (options.convertToAbsoluteUrls || autoFixUrls) {
  1465. css = fixUrls(css);
  1466. }
  1467. if (sourceMap) {
  1468. // http://stackoverflow.com/a/26603875
  1469. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  1470. }
  1471. var blob = new Blob([css], { type: "text/css" });
  1472. var oldSrc = link.href;
  1473. link.href = URL.createObjectURL(blob);
  1474. if(oldSrc) URL.revokeObjectURL(oldSrc);
  1475. }
  1476. /***/ })
  1477. /******/ });