dataTool.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) :
  3. typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) :
  4. (factory((global.dataTool = {}),global.echarts));
  5. }(this, (function (exports,echarts) { 'use strict';
  6. /**
  7. * @module zrender/core/util
  8. */
  9. // 用于处理merge时无法遍历Date等对象的问题
  10. var arrayProto = Array.prototype;
  11. var nativeMap = arrayProto.map;
  12. /**
  13. * Those data types can be cloned:
  14. * Plain object, Array, TypedArray, number, string, null, undefined.
  15. * Those data types will be assgined using the orginal data:
  16. * BUILTIN_OBJECT
  17. * Instance of user defined class will be cloned to a plain object, without
  18. * properties in prototype.
  19. * Other data types is not supported (not sure what will happen).
  20. *
  21. * Caution: do not support clone Date, for performance consideration.
  22. * (There might be a large number of date in `series.data`).
  23. * So date should not be modified in and out of echarts.
  24. *
  25. * @param {*} source
  26. * @return {*} new
  27. */
  28. /**
  29. * @memberOf module:zrender/core/util
  30. * @param {*} target
  31. * @param {*} source
  32. * @param {boolean} [overwrite=false]
  33. */
  34. /**
  35. * @param {Array} targetAndSources The first item is target, and the rests are source.
  36. * @param {boolean} [overwrite=false]
  37. * @return {*} target
  38. */
  39. /**
  40. * @param {*} target
  41. * @param {*} source
  42. * @memberOf module:zrender/core/util
  43. */
  44. /**
  45. * @param {*} target
  46. * @param {*} source
  47. * @param {boolean} [overlay=false]
  48. * @memberOf module:zrender/core/util
  49. */
  50. /**
  51. * 查询数组中元素的index
  52. * @memberOf module:zrender/core/util
  53. */
  54. /**
  55. * 构造类继承关系
  56. *
  57. * @memberOf module:zrender/core/util
  58. * @param {Function} clazz 源类
  59. * @param {Function} baseClazz 基类
  60. */
  61. /**
  62. * @memberOf module:zrender/core/util
  63. * @param {Object|Function} target
  64. * @param {Object|Function} sorce
  65. * @param {boolean} overlay
  66. */
  67. /**
  68. * Consider typed array.
  69. * @param {Array|TypedArray} data
  70. */
  71. /**
  72. * 数组或对象遍历
  73. * @memberOf module:zrender/core/util
  74. * @param {Object|Array} obj
  75. * @param {Function} cb
  76. * @param {*} [context]
  77. */
  78. /**
  79. * 数组映射
  80. * @memberOf module:zrender/core/util
  81. * @param {Array} obj
  82. * @param {Function} cb
  83. * @param {*} [context]
  84. * @return {Array}
  85. */
  86. function map(obj, cb, context) {
  87. if (!(obj && cb)) {
  88. return;
  89. }
  90. if (obj.map && obj.map === nativeMap) {
  91. return obj.map(cb, context);
  92. }
  93. else {
  94. var result = [];
  95. for (var i = 0, len = obj.length; i < len; i++) {
  96. result.push(cb.call(context, obj[i], i, obj));
  97. }
  98. return result;
  99. }
  100. }
  101. /**
  102. * @memberOf module:zrender/core/util
  103. * @param {Array} obj
  104. * @param {Function} cb
  105. * @param {Object} [memo]
  106. * @param {*} [context]
  107. * @return {Array}
  108. */
  109. /**
  110. * 数组过滤
  111. * @memberOf module:zrender/core/util
  112. * @param {Array} obj
  113. * @param {Function} cb
  114. * @param {*} [context]
  115. * @return {Array}
  116. */
  117. /**
  118. * 数组项查找
  119. * @memberOf module:zrender/core/util
  120. * @param {Array} obj
  121. * @param {Function} cb
  122. * @param {*} [context]
  123. * @return {*}
  124. */
  125. /**
  126. * @memberOf module:zrender/core/util
  127. * @param {Function} func
  128. * @param {*} context
  129. * @return {Function}
  130. */
  131. /**
  132. * @memberOf module:zrender/core/util
  133. * @param {Function} func
  134. * @return {Function}
  135. */
  136. /**
  137. * @memberOf module:zrender/core/util
  138. * @param {*} value
  139. * @return {boolean}
  140. */
  141. /**
  142. * @memberOf module:zrender/core/util
  143. * @param {*} value
  144. * @return {boolean}
  145. */
  146. /**
  147. * @memberOf module:zrender/core/util
  148. * @param {*} value
  149. * @return {boolean}
  150. */
  151. /**
  152. * @memberOf module:zrender/core/util
  153. * @param {*} value
  154. * @return {boolean}
  155. */
  156. /**
  157. * @memberOf module:zrender/core/util
  158. * @param {*} value
  159. * @return {boolean}
  160. */
  161. /**
  162. * @memberOf module:zrender/core/util
  163. * @param {*} value
  164. * @return {boolean}
  165. */
  166. /**
  167. * Whether is exactly NaN. Notice isNaN('a') returns true.
  168. * @param {*} value
  169. * @return {boolean}
  170. */
  171. /**
  172. * If value1 is not null, then return value1, otherwise judget rest of values.
  173. * Low performance.
  174. * @memberOf module:zrender/core/util
  175. * @return {*} Final value
  176. */
  177. /**
  178. * @memberOf module:zrender/core/util
  179. * @param {Array} arr
  180. * @param {number} startIndex
  181. * @param {number} endIndex
  182. * @return {Array}
  183. */
  184. /**
  185. * Normalize css liked array configuration
  186. * e.g.
  187. * 3 => [3, 3, 3, 3]
  188. * [4, 2] => [4, 2, 4, 2]
  189. * [4, 3, 2] => [4, 3, 2, 3]
  190. * @param {number|Array.<number>} val
  191. * @return {Array.<number>}
  192. */
  193. /**
  194. * @memberOf module:zrender/core/util
  195. * @param {boolean} condition
  196. * @param {string} message
  197. */
  198. /**
  199. * Set an object as primitive to be ignored traversing children in clone or merge
  200. */
  201. // GEXF File Parser
  202. // http://gexf.net/1.2draft/gexf-12draft-primer.pdf
  203. function parse(xml) {
  204. var doc;
  205. if (typeof xml === 'string') {
  206. var parser = new DOMParser();
  207. doc = parser.parseFromString(xml, 'text/xml');
  208. }
  209. else {
  210. doc = xml;
  211. }
  212. if (!doc || doc.getElementsByTagName('parsererror').length) {
  213. return null;
  214. }
  215. var gexfRoot = getChildByTagName(doc, 'gexf');
  216. if (!gexfRoot) {
  217. return null;
  218. }
  219. var graphRoot = getChildByTagName(gexfRoot, 'graph');
  220. var attributes = parseAttributes(getChildByTagName(graphRoot, 'attributes'));
  221. var attributesMap = {};
  222. for (var i = 0; i < attributes.length; i++) {
  223. attributesMap[attributes[i].id] = attributes[i];
  224. }
  225. return {
  226. nodes: parseNodes(getChildByTagName(graphRoot, 'nodes'), attributesMap),
  227. links: parseEdges(getChildByTagName(graphRoot, 'edges'))
  228. };
  229. }
  230. function parseAttributes(parent) {
  231. return parent ? map(getChildrenByTagName(parent, 'attribute'), function (attribDom) {
  232. return {
  233. id: getAttr(attribDom, 'id'),
  234. title: getAttr(attribDom, 'title'),
  235. type: getAttr(attribDom, 'type')
  236. };
  237. }) : [];
  238. }
  239. function parseNodes(parent, attributesMap) {
  240. return parent ? map(getChildrenByTagName(parent, 'node'), function (nodeDom) {
  241. var id = getAttr(nodeDom, 'id');
  242. var label = getAttr(nodeDom, 'label');
  243. var node = {
  244. id: id,
  245. name: label,
  246. itemStyle: {
  247. normal: {}
  248. }
  249. };
  250. var vizSizeDom = getChildByTagName(nodeDom, 'viz:size');
  251. var vizPosDom = getChildByTagName(nodeDom, 'viz:position');
  252. var vizColorDom = getChildByTagName(nodeDom, 'viz:color');
  253. // var vizShapeDom = getChildByTagName(nodeDom, 'viz:shape');
  254. var attvaluesDom = getChildByTagName(nodeDom, 'attvalues');
  255. if (vizSizeDom) {
  256. node.symbolSize = parseFloat(getAttr(vizSizeDom, 'value'));
  257. }
  258. if (vizPosDom) {
  259. node.x = parseFloat(getAttr(vizPosDom, 'x'));
  260. node.y = parseFloat(getAttr(vizPosDom, 'y'));
  261. // z
  262. }
  263. if (vizColorDom) {
  264. node.itemStyle.normal.color = 'rgb(' +[
  265. getAttr(vizColorDom, 'r') | 0,
  266. getAttr(vizColorDom, 'g') | 0,
  267. getAttr(vizColorDom, 'b') | 0
  268. ].join(',') + ')';
  269. }
  270. // if (vizShapeDom) {
  271. // node.shape = getAttr(vizShapeDom, 'shape');
  272. // }
  273. if (attvaluesDom) {
  274. var attvalueDomList = getChildrenByTagName(attvaluesDom, 'attvalue');
  275. node.attributes = {};
  276. for (var j = 0; j < attvalueDomList.length; j++) {
  277. var attvalueDom = attvalueDomList[j];
  278. var attId = getAttr(attvalueDom, 'for');
  279. var attValue = getAttr(attvalueDom, 'value');
  280. var attribute = attributesMap[attId];
  281. if (attribute) {
  282. switch (attribute.type) {
  283. case 'integer':
  284. case 'long':
  285. attValue = parseInt(attValue, 10);
  286. break;
  287. case 'float':
  288. case 'double':
  289. attValue = parseFloat(attValue);
  290. break;
  291. case 'boolean':
  292. attValue = attValue.toLowerCase() == 'true';
  293. break;
  294. default:
  295. }
  296. node.attributes[attId] = attValue;
  297. }
  298. }
  299. }
  300. return node;
  301. }) : [];
  302. }
  303. function parseEdges(parent) {
  304. return parent ? map(getChildrenByTagName(parent, 'edge'), function (edgeDom) {
  305. var id = getAttr(edgeDom, 'id');
  306. var label = getAttr(edgeDom, 'label');
  307. var sourceId = getAttr(edgeDom, 'source');
  308. var targetId = getAttr(edgeDom, 'target');
  309. var edge = {
  310. id: id,
  311. name: label,
  312. source: sourceId,
  313. target: targetId,
  314. lineStyle: {
  315. normal: {}
  316. }
  317. };
  318. var lineStyle = edge.lineStyle.normal;
  319. var vizThicknessDom = getChildByTagName(edgeDom, 'viz:thickness');
  320. var vizColorDom = getChildByTagName(edgeDom, 'viz:color');
  321. // var vizShapeDom = getChildByTagName(edgeDom, 'viz:shape');
  322. if (vizThicknessDom) {
  323. lineStyle.width = parseFloat(vizThicknessDom.getAttribute('value'));
  324. }
  325. if (vizColorDom) {
  326. lineStyle.color = 'rgb(' + [
  327. getAttr(vizColorDom, 'r') | 0,
  328. getAttr(vizColorDom, 'g') | 0,
  329. getAttr(vizColorDom, 'b') | 0
  330. ].join(',') + ')';
  331. }
  332. // if (vizShapeDom) {
  333. // edge.shape = vizShapeDom.getAttribute('shape');
  334. // }
  335. return edge;
  336. }) : [];
  337. }
  338. function getAttr(el, attrName) {
  339. return el.getAttribute(attrName);
  340. }
  341. function getChildByTagName (parent, tagName) {
  342. var node = parent.firstChild;
  343. while (node) {
  344. if (
  345. node.nodeType != 1 ||
  346. node.nodeName.toLowerCase() != tagName.toLowerCase()
  347. ) {
  348. node = node.nextSibling;
  349. } else {
  350. return node;
  351. }
  352. }
  353. return null;
  354. }
  355. function getChildrenByTagName (parent, tagName) {
  356. var node = parent.firstChild;
  357. var children = [];
  358. while (node) {
  359. if (node.nodeName.toLowerCase() == tagName.toLowerCase()) {
  360. children.push(node);
  361. }
  362. node = node.nextSibling;
  363. }
  364. return children;
  365. }
  366. var gexf = (Object.freeze || Object)({
  367. parse: parse
  368. });
  369. /**
  370. * Copyright (c) 2010-2015, Michael Bostock
  371. * All rights reserved.
  372. *
  373. * Redistribution and use in source and binary forms, with or without
  374. * modification, are permitted provided that the following conditions are met:
  375. *
  376. * * Redistributions of source code must retain the above copyright notice, this
  377. * list of conditions and the following disclaimer.
  378. *
  379. * * Redistributions in binary form must reproduce the above copyright notice,
  380. * this list of conditions and the following disclaimer in the documentation
  381. * and/or other materials provided with the distribution.
  382. *
  383. * * The name Michael Bostock may not be used to endorse or promote products
  384. * derived from this software without specific prior written permission.
  385. *
  386. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  387. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  388. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  389. * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
  390. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  391. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  392. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  393. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  394. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  395. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  396. */
  397. /**
  398. * @see <https://github.com/mbostock/d3/blob/master/src/arrays/quantile.js>
  399. * @see <http://en.wikipedia.org/wiki/Quantile>
  400. * @param {Array.<number>} ascArr
  401. */
  402. var quantile = function(ascArr, p) {
  403. var H = (ascArr.length - 1) * p + 1,
  404. h = Math.floor(H),
  405. v = +ascArr[h - 1],
  406. e = H - h;
  407. return e ? v + e * (ascArr[h] - v) : v;
  408. };
  409. /**
  410. * Linear mapping a value from domain to range
  411. * @memberOf module:echarts/util/number
  412. * @param {(number|Array.<number>)} val
  413. * @param {Array.<number>} domain Domain extent domain[0] can be bigger than domain[1]
  414. * @param {Array.<number>} range Range extent range[0] can be bigger than range[1]
  415. * @param {boolean} clamp
  416. * @return {(number|Array.<number>}
  417. */
  418. /**
  419. * Convert a percent string to absolute number.
  420. * Returns NaN if percent is not a valid string or number
  421. * @memberOf module:echarts/util/number
  422. * @param {string|number} percent
  423. * @param {number} all
  424. * @return {number}
  425. */
  426. /**
  427. * (1) Fix rounding error of float numbers.
  428. * (2) Support return string to avoid scientific notation like '3.5e-7'.
  429. *
  430. * @param {number} x
  431. * @param {number} [precision]
  432. * @param {boolean} [returnStr]
  433. * @return {number|string}
  434. */
  435. function asc(arr) {
  436. arr.sort(function (a, b) {
  437. return a - b;
  438. });
  439. return arr;
  440. }
  441. /**
  442. * Get precision
  443. * @param {number} val
  444. */
  445. /**
  446. * @param {string|number} val
  447. * @return {number}
  448. */
  449. /**
  450. * Minimal dicernible data precisioin according to a single pixel.
  451. *
  452. * @param {Array.<number>} dataExtent
  453. * @param {Array.<number>} pixelExtent
  454. * @return {number} precision
  455. */
  456. /**
  457. * Get a data of given precision, assuring the sum of percentages
  458. * in valueList is 1.
  459. * The largest remainer method is used.
  460. * https://en.wikipedia.org/wiki/Largest_remainder_method
  461. *
  462. * @param {Array.<number>} valueList a list of all data
  463. * @param {number} idx index of the data to be processed in valueList
  464. * @param {number} precision integer number showing digits of precision
  465. * @return {number} percent ranging from 0 to 100
  466. */
  467. // Number.MAX_SAFE_INTEGER, ie do not support.
  468. /**
  469. * To 0 - 2 * PI, considering negative radian.
  470. * @param {number} radian
  471. * @return {number}
  472. */
  473. /**
  474. * @param {type} radian
  475. * @return {boolean}
  476. */
  477. /**
  478. * @param {string|Date|number} value These values can be accepted:
  479. * + An instance of Date, represent a time in its own time zone.
  480. * + Or string in a subset of ISO 8601, only including:
  481. * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
  482. * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
  483. * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
  484. * all of which will be treated as local time if time zone is not specified
  485. * (see <https://momentjs.com/>).
  486. * + Or other string format, including (all of which will be treated as loacal time):
  487. * '2012', '2012-3-1', '2012/3/1', '2012/03/01',
  488. * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
  489. * + a timestamp, which represent a time in UTC.
  490. * @return {Date} date
  491. */
  492. /**
  493. * Quantity of a number. e.g. 0.1, 1, 10, 100
  494. *
  495. * @param {number} val
  496. * @return {number}
  497. */
  498. /**
  499. * find a “nice” number approximately equal to x. Round the number if round = true,
  500. * take ceiling if round = false. The primary observation is that the “nicest”
  501. * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
  502. *
  503. * See "Nice Numbers for Graph Labels" of Graphic Gems.
  504. *
  505. * @param {number} val Non-negative value.
  506. * @param {boolean} round
  507. * @return {number}
  508. */
  509. /**
  510. * Order intervals asc, and split them when overlap.
  511. * expect(numberUtil.reformIntervals([
  512. * {interval: [18, 62], close: [1, 1]},
  513. * {interval: [-Infinity, -70], close: [0, 0]},
  514. * {interval: [-70, -26], close: [1, 1]},
  515. * {interval: [-26, 18], close: [1, 1]},
  516. * {interval: [62, 150], close: [1, 1]},
  517. * {interval: [106, 150], close: [1, 1]},
  518. * {interval: [150, Infinity], close: [0, 0]}
  519. * ])).toEqual([
  520. * {interval: [-Infinity, -70], close: [0, 0]},
  521. * {interval: [-70, -26], close: [1, 1]},
  522. * {interval: [-26, 18], close: [0, 1]},
  523. * {interval: [18, 62], close: [0, 1]},
  524. * {interval: [62, 150], close: [0, 1]},
  525. * {interval: [150, Infinity], close: [0, 0]}
  526. * ]);
  527. * @param {Array.<Object>} list, where `close` mean open or close
  528. * of the interval, and Infinity can be used.
  529. * @return {Array.<Object>} The origin list, which has been reformed.
  530. */
  531. /**
  532. * parseFloat NaNs numeric-cast false positives (null|true|false|"")
  533. * ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  534. * subtraction forces infinities to NaN
  535. *
  536. * @param {*} v
  537. * @return {boolean}
  538. */
  539. /**
  540. * See:
  541. * <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>
  542. * <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>
  543. *
  544. * Helper method for preparing data.
  545. *
  546. * @param {Array.<number>} rawData like
  547. * [
  548. * [12,232,443], (raw data set for the first box)
  549. * [3843,5545,1232], (raw datat set for the second box)
  550. * ...
  551. * ]
  552. * @param {Object} [opt]
  553. *
  554. * @param {(number|string)} [opt.boundIQR=1.5] Data less than min bound is outlier.
  555. * default 1.5, means Q1 - 1.5 * (Q3 - Q1).
  556. * If 'none'/0 passed, min bound will not be used.
  557. * @param {(number|string)} [opt.layout='horizontal']
  558. * Box plot layout, can be 'horizontal' or 'vertical'
  559. * @return {Object} {
  560. * boxData: Array.<Array.<number>>
  561. * outliers: Array.<Array.<number>>
  562. * axisData: Array.<string>
  563. * }
  564. */
  565. var prepareBoxplotData = function (rawData, opt) {
  566. opt = opt || [];
  567. var boxData = [];
  568. var outliers = [];
  569. var axisData = [];
  570. var boundIQR = opt.boundIQR;
  571. var useExtreme = boundIQR === 'none' || boundIQR === 0;
  572. for (var i = 0; i < rawData.length; i++) {
  573. axisData.push(i + '');
  574. var ascList = asc(rawData[i].slice());
  575. var Q1 = quantile(ascList, 0.25);
  576. var Q2 = quantile(ascList, 0.5);
  577. var Q3 = quantile(ascList, 0.75);
  578. var min = ascList[0];
  579. var max = ascList[ascList.length - 1];
  580. var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);
  581. var low = useExtreme
  582. ? min
  583. : Math.max(min, Q1 - bound);
  584. var high = useExtreme
  585. ? max
  586. : Math.min(max, Q3 + bound);
  587. boxData.push([low, Q1, Q2, Q3, high]);
  588. for (var j = 0; j < ascList.length; j++) {
  589. var dataItem = ascList[j];
  590. if (dataItem < low || dataItem > high) {
  591. var outlier = [i, dataItem];
  592. opt.layout === 'vertical' && outlier.reverse();
  593. outliers.push(outlier);
  594. }
  595. }
  596. }
  597. return {
  598. boxData: boxData,
  599. outliers: outliers,
  600. axisData: axisData
  601. };
  602. };
  603. var version = '1.0.0';
  604. // For backward compatibility, where the namespace `dataTool` will
  605. // be mounted on `echarts` is the extension `dataTool` is imported.
  606. // But the old version of echarts do not have `dataTool` namespace,
  607. // so check it before mounting.
  608. if (echarts.dataTool) {
  609. echarts.dataTool.version = version;
  610. echarts.dataTool.gexf = gexf;
  611. echarts.dataTool.prepareBoxplotData = prepareBoxplotData;
  612. }
  613. exports.version = version;
  614. exports.gexf = gexf;
  615. exports.prepareBoxplotData = prepareBoxplotData;
  616. })));
  617. //# sourceMappingURL=dataTool.js.map