You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tanghe-report/report-ui/static/wordCloud/echarts-wordcloud.min.js

8 lines
125 KiB
JavaScript

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],e):"object"==typeof exports?exports["echarts-wordcloud"]=e(require("echarts")):t["echarts-wordcloud"]=e(t.echarts)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=25)}([function(t,e){function r(t,e){G[t]=e}function n(t){if(null==t||"object"!=typeof t)return t;var e=t,r=W.call(t);if("[object Array]"===r){e=[];for(var i=0,a=t.length;i<a;i++)e[i]=n(t[i])}else if(E[r]){var o=t.constructor;if(t.constructor.from)e=o.from(t);else{e=new o(t.length);for(var i=0,a=t.length;i<a;i++)e[i]=n(t[i])}}else if(!N[r]&&!F(t)&&!T(t)){e={};for(var s in t)t.hasOwnProperty(s)&&(e[s]=n(t[s]))}return e}function i(t,e,r){if(!S(e)||!S(t))return r?n(e):t;for(var a in e)if(e.hasOwnProperty(a)){var o=t[a],s=e[a];!S(s)||!S(o)||w(s)||w(o)||T(s)||T(o)||M(s)||M(o)||F(s)||F(o)?!r&&a in t||(t[a]=n(e[a],!0)):i(o,s,r)}return t}function a(t,e){for(var r=t[0],n=1,a=t.length;n<a;n++)r=i(r,t[n],e);return r}function o(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function s(t,e,r){for(var n in e)e.hasOwnProperty(n)&&(r?null!=e[n]:null==t[n])&&(t[n]=e[n]);return t}function l(){return $||($=U().getContext("2d")),$}function h(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r}return-1}function u(t,e){function r(){}var n=t.prototype;r.prototype=e.prototype,t.prototype=new r;for(var i in n)t.prototype[i]=n[i];t.prototype.constructor=t,t.superClass=e}function c(t,e,r){t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,s(t,e,r)}function f(t){if(t)return"string"!=typeof t&&"number"==typeof t.length}function d(t,e,r){if(t&&e)if(t.forEach&&t.forEach===H)t.forEach(e,r);else if(t.length===+t.length)for(var n=0,i=t.length;n<i;n++)e.call(r,t[n],n,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(r,t[a],a,t)}function v(t,e,r){if(t&&e){if(t.map&&t.map===Y)return t.map(e,r);for(var n=[],i=0,a=t.length;i<a;i++)n.push(e.call(r,t[i],i,t));return n}}function g(t,e,r,n){if(t&&e){if(t.reduce&&t.reduce===V)return t.reduce(e,r,n);for(var i=0,a=t.length;i<a;i++)r=e.call(n,r,t[i],i,t);return r}}function p(t,e,r){if(t&&e){if(t.filter&&t.filter===j)return t.filter(e,r);for(var n=[],i=0,a=t.length;i<a;i++)e.call(r,t[i],i,t)&&n.push(t[i]);return n}}function m(t,e,r){if(t&&e)for(var n=0,i=t.length;n<i;n++)if(e.call(r,t[n],n,t))return t[n]}function x(t,e){var r=X.call(arguments,2);return function(){return t.apply(e,r.concat(X.call(arguments)))}}function y(t){var e=X.call(arguments,1);return function(){return t.apply(this,e.concat(X.call(arguments)))}}function w(t){return"[object Array]"===W.call(t)}function _(t){return"function"==typeof t}function b(t){return"[object String]"===W.call(t)}function S(t){var e=typeof t;return"function"===e||!!t&&"object"==e}function M(t){return!!N[W.call(t)]}function T(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function k(t){return t!==t}function C(t){for(var e=0,r=arguments.length;e<r;e++)if(null!=arguments[e])return arguments[e]}function P(t,e){return null!=t?t:e}function I(t,e,r){return null!=t?t:null!=e?e:r}function A(){return Function.call.apply(X,arguments)}function O(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function D(t,e){if(!t)throw new Error(e)}function L(t){t[Z]=!0}function F(t){return t[Z]}function R(t){t&&d(t,function(t,e){this.set(e,t)},this)}function B(t){return new R(t)}function z(){}var N={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error
* wordcloud2.js
* http://timdream.org/wordcloud2.js/
*
* Copyright 2011 - 2013 Tim Chien
* Released under the MIT license
*/
window.setImmediate||(window.setImmediate=function(){return window.msSetImmediate||window.webkitSetImmediate||window.mozSetImmediate||window.oSetImmediate||function(){if(!window.postMessage||!window.addEventListener)return null;var t=[void 0],e="zero-timeout-message",r=function(r){var n=t.length;return t.push(r),window.postMessage(e+n.toString(36),"*"),n};return window.addEventListener("message",function(r){if("string"==typeof r.data&&r.data.substr(0,e.length)===e){r.stopImmediatePropagation();var n=parseInt(r.data.substr(e.length),36);t[n]&&(t[n](),t[n]=void 0)}},!0),window.clearImmediate=function(e){t[e]&&(t[e]=void 0)},r}()||function(t){window.setTimeout(t,0)}}()),window.clearImmediate||(window.clearImmediate=function(){return window.msClearImmediate||window.webkitClearImmediate||window.mozClearImmediate||window.oClearImmediate||function(t){window.clearTimeout(t)}}()),function(r){var a=function(){var t=document.createElement("canvas");if(!t||!t.getContext)return!1;var e=t.getContext("2d");return!!e.getImageData&&(!!e.fillText&&(!!Array.prototype.some&&!!Array.prototype.push))}(),o=function(){if(a){for(var t,e,r=document.createElement("canvas").getContext("2d"),n=20;n;){if(r.font=n.toString(10)+"px sans-serif",r.measureText("").width===t&&r.measureText("m").width===e)return n+1;t=r.measureText("").width,e=r.measureText("m").width,n--}return 0}}(),s=function(t){for(var e,r,n=t.length;n;e=Math.floor(Math.random()*n),r=t[--n],t[n]=t[e],t[e]=r);return t},l=function(t,e){function r(t,e){return"hsl("+(360*Math.random()).toFixed()+","+(30*Math.random()+70).toFixed()+"%,"+(Math.random()*(e-t)+t).toFixed()+"%)"}if(a){Array.isArray(t)||(t=[t]),t.forEach(function(e,r){if("string"==typeof e){if(t[r]=document.getElementById(e),!t[r])throw"The element id specified is not found."}else if(!e.tagName&&!e.appendChild)throw"You must pass valid HTML elements, or ID of the element."});var n={list:[],fontFamily:'"Trebuchet MS", "Heiti TC", "微軟正黑體", "Arial Unicode MS", "Droid Fallback Sans", sans-serif',fontWeight:"normal",color:"random-dark",minSize:0,weightFactor:1,clearCanvas:!0,backgroundColor:"#fff",gridSize:8,drawOutOfBound:!1,origin:null,drawMask:!1,maskColor:"rgba(255,0,0,0.3)",maskGapWidth:.3,wait:0,abortThreshold:0,abort:function(){},minRotation:-Math.PI/2,maxRotation:Math.PI/2,rotationStep:.1,shuffle:!0,rotateRatio:.1,shape:"circle",ellipticity:.65,classes:null,hover:null,click:null};if(e)for(var i in e)i in n&&(n[i]=e[i]);if("function"!=typeof n.weightFactor){var l=n.weightFactor;n.weightFactor=function(t){return t*l}}if("function"!=typeof n.shape)switch(n.shape){case"circle":default:n.shape="circle";break;case"cardioid":n.shape=function(t){return 1-Math.sin(t)};break;case"diamond":case"square":n.shape=function(t){var e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))};break;case"triangle-forward":n.shape=function(t){var e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))};break;case"triangle":case"triangle-upright":n.shape=function(t){var e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))};break;case"pentagon":n.shape=function(t){var e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))};break;case"star":n.shape=function(t){var e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}}n.gridSize=Math.max(Math.floor(n.gridSize),4);var h,u,c,f,d,v,g,p=n.gridSize,m=p-n.maskGapWidth,x=Math.abs(n.maxRotation-n.minRotation),y=Math.min(n.maxRotation,n.minRotation),w=n.rotationStep;switch(n.color){case"random-dark":g=function(){return r(10,50)};break;case"random-light":g=function(){return r(50,90)};break;default:"function"==typeof n.color&&(g=n.color)}var _=null;"function"==typeof n.classes&&(_=n.classes);var b,S=!1,M=[],T=function(t){var e,r,n=t.currentTarget,i=n.getBoundingClientRect();t.touches?(e=t.touches[0].clientX,r=t.touches[0].clientY):(e=t.clientX,r=t.clientY);var a=e-i.left,o=r-i.top,s=Math.floor(a*(n.width/i.width||1)/p),l=Math.floor(o*(n.h