diff --git a/src/main/webapp/static/global/plugins/highcharts/js/sunburst.js b/src/main/webapp/static/global/plugins/highcharts/js/sunburst.js index 7cca3aaba..0847c585f 100644 --- a/src/main/webapp/static/global/plugins/highcharts/js/sunburst.js +++ b/src/main/webapp/static/global/plugins/highcharts/js/sunburst.js @@ -1,43 +1,1077 @@ /* -charts JS v6.1.0 (2018-04-13) -*/ -(function(E){"object"===typeof module&&module.exports?module.exports=E:E(Highcharts)})(function(E){var O=function(){return function(b){var B=this,n=B.graphic,k=b.animate,w=b.attr,e=b.onComplete,H=b.css,D=b.group,t=b.renderer,x=b.shapeArgs;b=b.shapeType;B.shouldDraw()?(n||(B.graphic=n=t[b](x).add(D)),n.css(H).attr(w).animate(k,void 0,e)):n&&n.animate(k,void 0,function(){B.graphic=n=n.destroy();"function"===typeof e&&e()});n&&n.addClass(B.getClassName(),!0)}}(),M=function(b){var B=b.each,n=b.extend, -k=b.isArray,w=b.isObject,e=b.isNumber,H=b.merge,D=b.pick,t=b.reduce;return{getColor:function(x,y){var v=y.index,p=y.mapOptionsToLevel,n=y.parentColor,C=y.parentColorIndex,z=y.series,l=y.colors,k=y.siblings,q=z.points,e,t,w,B;if(x){q=q[x.i];x=p[x.level]||{};if(e=q&&x.colorByPoint)w=q.index%(l?l.length:z.chart.options.chart.colorCount),t=l&&l[w];l=q&&q.options.color;e=x&&x.color;if(p=n)p=(p=x&&x.colorVariation)&&"brightness"===p.key?b.color(n).brighten(v/k*p.to).get():n;e=D(l,e,t,p,z.color);B=D(q&& -q.options.colorIndex,x&&x.colorIndex,w,C,y.colorIndex)}return{color:e,colorIndex:B}},getLevelOptions:function(b){var y=null,v,p,F,C;if(w(b))for(y={},F=e(b.from)?b.from:1,C=b.levels,p={},v=w(b.defaults)?b.defaults:{},k(C)&&(p=t(C,function(b,l){var p,q;w(l)&&e(l.level)&&(q=H({},l),p="boolean"===typeof q.levelIsConstant?q.levelIsConstant:v.levelIsConstant,delete q.levelIsConstant,delete q.level,l=l.level+(p?0:F-1),w(b[l])?n(b[l],q):b[l]=q);return b},{})),C=e(b.to)?b.to:1,b=0;b<=C;b++)y[b]=H({},v,w(p[b])? -p[b]:{});return y},setTreeValues:function y(b,p){var e=p.before,t=p.idRoot,k=p.mapIdToNode[t],l=p.points[b.i],w=l&&l.options||{},q=0,v=[];n(b,{levelDynamic:b.level-(("boolean"===typeof p.levelIsConstant?p.levelIsConstant:1)?0:k.level),name:D(l&&l.name,""),visible:t===b.id||("boolean"===typeof p.visible?p.visible:!1)});"function"===typeof e&&(b=e(b,p));B(b.children,function(e,l){var t=n({},p);n(t,{index:l,siblings:b.children.length,visible:b.visible});e=y(e,t);v.push(e);e.visible&&(q+=e.val)});b.visible= -0e.lP.lR&&g.algorithmCalcPoints(a, -!1,e,d,r);h===u&&g.algorithmCalcPoints(a,!0,e,d,r);h+=1});return d},algorithmFill:function(a,b,c){var d=[],g,A=b.direction,r=b.x,h=b.y,u=b.width,e=b.height,m,l,p,q;t(c,function(c){g=c.val/b.val*b.height*b.width;m=r;l=h;0===A?(q=e,p=g/q,u-=p,r+=p):(p=u,q=g/p,e-=q,h+=q);d.push({x:m,y:l,width:p,height:q});a&&(A=1-A)});return d},strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0, -a,b)},stripes:function(a,b){return this.algorithmFill(!1,a,b)},translate:function(){var a=this,b=a.options,c=K(a),f,g;l.prototype.translate.call(a);g=a.tree=a.getTree();f=a.nodeMap[c];a.mapOptionsToLevel=y({from:f.level+1,levels:b.levels,to:g.height,defaults:{levelIsConstant:a.options.levelIsConstant,colorByPoint:b.colorByPoint}});""===c||f&&f.children.length||(a.drillToNode("",!1),c=a.rootNode,f=a.nodeMap[c]);I(a.nodeMap[a.rootNode],function(c){var b=!1,f=c.parent;c.visible=!0;if(f||""===f)b=a.nodeMap[f]; -return b});I(a.nodeMap[a.rootNode].children,function(a){var c=!1;t(a,function(a){a.visible=!0;a.children.length&&(c=(c||[]).concat(a.children))});return c});a.setTreeValues(g);a.axisRatio=a.xAxis.len/a.yAxis.len;a.nodeMap[""].pointValues=c={x:0,y:0,width:100,height:100};a.nodeMap[""].values=c=e(c,{width:c.width*a.axisRatio,direction:"vertical"===b.layoutStartingDirection?0:1,val:g.val});a.calculateChildrenAreas(g,c);a.colorAxis?a.translateColors():b.colorByPoint||a.setColorRecursive(a.tree);b.allowDrillToNode&& -(b=f.pointValues,a.xAxis.setExtremes(b.x,b.x+b.width,!1),a.yAxis.setExtremes(b.y,b.y+b.height,!1),a.xAxis.setScale(),a.yAxis.setScale());a.setPointValues()},drawDataLabels:function(){var a=this,b=a.mapOptionsToLevel,c=v(a.points,function(a){return a.node.visible}),f,g;t(c,function(c){g=b[c.node.level];f={style:{}};c.node.isLeaf||(f.enabled=!1);g&&g.dataLabels&&(f=e(f,g.dataLabels),a._hasPointLabels=!0);c.shapeArgs&&(f.style.width=c.shapeArgs.width,c.dataLabel&&c.dataLabel.css({width:c.shapeArgs.width+ -"px"}));c.dlOptions=e(f,c.options.dataLabels)});l.prototype.drawDataLabels.call(this)},alignDataLabel:function(a){k.column.prototype.alignDataLabel.apply(this,arguments);a.dataLabel&&a.dataLabel.attr({zIndex:(a.node.zIndex||0)+1})},pointAttribs:function(a,b){var c=F(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},f=a&&c[a.node.level]||{},c=this.options,g=b&&c.states[b]||{},d=a&&a.getClassName()||"";a={stroke:a&&a.borderColor||f.borderColor||g.borderColor||c.borderColor,"stroke-width":z(a&&a.borderWidth, -f.borderWidth,g.borderWidth,c.borderWidth),dashstyle:a&&a.borderDashStyle||f.borderDashStyle||g.borderDashStyle||c.borderDashStyle,fill:a&&a.color||this.color};-1!==d.indexOf("highcharts-above-level")?(a.fill="none",a["stroke-width"]=0):-1!==d.indexOf("highcharts-internal-node-interactive")?(b=z(g.opacity,c.opacity),a.fill=q(a.fill).setOpacity(b).get(),a.cursor="pointer"):-1!==d.indexOf("highcharts-internal-node")?a.fill="none":b&&(a.fill=q(a.fill).brighten(g.brightness).get());return a},drawPoints:function(){var a= -this,b=v(a.points,function(a){return a.node.visible});t(b,function(c){var b="level-group-"+c.node.levelDynamic;a[b]||(a[b]=a.chart.renderer.g(b).attr({zIndex:1E3-c.node.levelDynamic}).add(a.group));c.group=a[b]});k.column.prototype.drawPoints.call(this);a.options.allowDrillToNode&&t(b,function(c){c.graphic&&(c.drillId=a.options.interactByLeaf?a.drillToByLeaf(c):a.drillToByGroup(c))})},onClickDrillToNode:function(a){var b=(a=a.point)&&a.drillId;C(b)&&(a.setState(""),this.drillToNode(b))},drillToByGroup:function(a){var b= -!1;1!==a.node.level-this.nodeMap[this.rootNode].level||a.node.isLeaf||(b=a.id);return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)a=this.nodeMap[a.parent],a.parent===this.rootNode&&(b=a.id);return b},drillUp:function(){var a=this.nodeMap[this.rootNode];a&&C(a.parent)&&this.drillToNode(a.parent)},drillToNode:function(a,b){var c=this.nodeMap[a];this.idPreviousRoot=this.rootNode;this.rootNode=a;""===a?this.drillUpButton=this.drillUpButton.destroy(): -this.showDrillUpButton(c&&c.name||a);this.isDirty=!0;z(b,!0)&&this.chart.redraw()},showDrillUpButton:function(a){var b=this;a=a||"\x3c Back";var c=b.options.drillUpButton,f,g;c.text&&(a=c.text);this.drillUpButton?(this.drillUpButton.placed=!1,this.drillUpButton.attr({text:a}).align()):(g=(f=c.theme)&&f.states,this.drillUpButton=this.chart.renderer.button(a,null,null,function(){b.drillUp()},f,g&&g.hover,g&&g.select).addClass("highcharts-drillup-button").attr({align:c.position.align,zIndex:7}).add().align(c.position, -!1,c.relativeTo||"plotBox"))},buildKDTree:D,drawLegendSymbol:b.LegendSymbolMixin.drawRectangle,getExtremes:function(){l.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;l.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var a={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};l.prototype.bindAxes.call(this);b.extend(this.yAxis.options, -a);b.extend(this.xAxis.options,a)},utils:{recursive:I,reduce:J}},{getClassName:function(){var a=b.Point.prototype.getClassName.call(this),d=this.series,c=d.options;this.node.level<=d.nodeMap[d.rootNode].level?a+=" highcharts-above-level":this.node.isLeaf||z(c.interactByLeaf,!c.allowDrillToNode)?this.node.isLeaf||(a+=" highcharts-internal-node"):a+=" highcharts-internal-node-interactive";return a},isValid:function(){return this.id||p(this.value)},setState:function(a){b.Point.prototype.setState.call(this, -a);this.graphic&&this.graphic.attr({zIndex:"hover"===a?1:0})},setVisible:k.pie.prototype.pointClass.prototype.setVisible})})(E,M);(function(b,B,n){var k=b.CenteredSeriesMixin,w=b.Series,e=b.each,H=b.extend,D=k.getCenter,t=n.getColor,x=n.getLevelOptions,y=k.getStartAndEndRadians,v=b.grep,p=b.inArray,F=b.isNumber,C=b.isObject,z=b.isString,l=b.keys,E=b.merge,q=180/Math.PI,k=b.seriesType,L=n.setTreeValues,J=b.reduce,I=n.updateRootId,K=function(a,b){var c=[];if(F(a)&&F(b)&&a<=b)for(;a<=b;a++)c.push(a); -return c},a=function(a,b){var c;b=C(b)?b:{};var f=0,d,h,u,q;C(a)&&(c=E({},a),a=F(b.from)?b.from:0,q=F(b.to)?b.to:0,h=K(a,q),a=v(l(c),function(a){return-1===p(+a,h)}),d=u=F(b.diffRadius)?b.diffRadius:0,e(h,function(a){a=c[a];var b=a.levelSize.unit,g=a.levelSize.value;"weight"===b?f+=g:"percentage"===b?(a.levelSize={unit:"pixels",value:g/100*d},u-=a.levelSize.value):"pixels"===b&&(u-=g)}),e(h,function(a){var b=c[a];"weight"===b.levelSize.unit&&(b=b.levelSize.value,c[a].levelSize={unit:"pixels",value:b/ -f*u})}),e(a,function(a){c[a].levelSize={value:0,unit:"pixels"}}));return c},d=function(a,b){var c=b.mapIdToNode[a.parent],f=b.series,d=f.chart,h=f.points[a.i],c=t(a,{colors:d&&d.options&&d.options.colors,colorIndex:f.colorIndex,index:b.index,mapOptionsToLevel:b.mapOptionsToLevel,parentColor:c&&c.color,parentColorIndex:c&&c.colorIndex,series:b.series,siblings:b.siblings});a.color=c.color;a.colorIndex=c.colorIndex;h&&(h.color=a.color,h.colorIndex=a.colorIndex,a.sliced=a.id!==b.idRoot?h.sliced:!1);return a}; -k("sunburst","treemap",{center:["50%","50%"],colorByPoint:!1,dataLabels:{defer:!0,style:{textOverflow:"ellipsis"},rotationMode:"perpendicular"},rootId:void 0,levelIsConstant:!0,levelSize:{value:1,unit:"weight"},slicedOffset:10},{drawDataLabels:b.noop,drawPoints:function(){var a=this,b=a.mapOptionsToLevel,d=a.shapeRoot,p=a.group,r=a.hasRendered,h=a.rootId,u=a.idPreviousRoot,l=a.nodeMap,m=l[u],t=m&&m.shapeArgs,m=a.points,n=a.startAndEndRadians,k=a.chart,k=k&&k.options&&k.options.chart||{},y="boolean"=== -typeof k.animation?k.animation:!0,x=a.center[3]/2,B=a.chart.renderer,z,v=!1,D=!1;if(k=!!(y&&r&&h!==u&&a.dataLabelsGroup))a.dataLabelsGroup.attr({opacity:0}),z=function(){v=!0;a.dataLabelsGroup&&a.dataLabelsGroup.animate({opacity:1,visibility:"visible"})};e(m,function(c){var f,g,e=c.node,m=b[e.level];f=c.shapeExisting||{};var k=e.shapeArgs||{},A,w=!(!e.visible||!e.shapeArgs);if(r&&y){var G={};g={end:k.end,start:k.start,innerR:k.innerR,r:k.r,x:k.x,y:k.y};w?!c.graphic&&t&&(G=h===c.id?{start:n.start, -end:n.end}:t.end<=k.start?{start:n.end,end:n.end}:{start:n.start,end:n.start},G.innerR=G.r=x):c.graphic&&(u===c.id?g={innerR:x,r:x}:d&&(g=d.end<=f.start?{innerR:x,r:x,start:n.end,end:n.end}:{innerR:x,r:x,start:n.start,end:n.start}));f=G}else g=k,f={};var G=[k.plotX,k.plotY],v;c.node.isLeaf||(h===c.id?(v=l[h],v=v.parent):v=c.id);H(c,{shapeExisting:k,tooltipPos:G,drillId:v,name:""+(c.name||c.id||c.index),plotX:k.plotX,plotY:k.plotY,value:e.val,isNull:!w});v=c.options;e=C(k)?k:{};v=C(v)?v.dataLabels: -{};m=C(m)?m.dataLabels:{};m=E({rotationMode:"perpendicular",style:{width:e.radius}},m,v);F(m.rotation)||(e=e.end-(e.end-e.start)/2,e=e*q%180,"parallel"===m.rotationMode&&(e-=90),90a.val?a.childrenTotal:a.val:a.childrenTotal;this.points[a.i]&&(this.points[a.i].innerArcLength=g*b.innerR,this.points[a.i].outerArcLength=g*b.r);a.shapeArgs=E(b,{plotX:f.x,plotY:f.y});a.values= -E(b,{val:e});a.children.length&&this.setShapeArgs(a,a.values,d)},this)},translate:function(){var b=this.options,f=this.center=D.call(this),e=this.startAndEndRadians=y(b.startAngle,b.endAngle),k=f[3]/2,p=f[2]/2-k,h=I(this),l=this.nodeMap,n,m=l&&l[h],q,t;this.shapeRoot=m&&m.shapeArgs;w.prototype.translate.call(this);t=this.tree=this.getTree();l=this.nodeMap;m=l[h];n=z(m.parent)?m.parent:"";q=l[n];n=x({from:0 f.lP.lR && e.algorithmCalcPoints(a, !1, f, c, m); + u === q && e.algorithmCalcPoints(a, !0, f, c, m); + u += 1 + }); + return c + }, + algorithmFill: function (a, b, d) { + var c = [], + e, + g = b.direction, + m = b.x, + u = b.y, + q = b.width, + f = b.height, + r, + h, + k, + p; + d.forEach(function (d) { + e = d.val / b.val * b.height * b.width; + r = m; + h = u; + 0 === g ? (p = f, k = e / p, q -= k, m += k) : (k = q, p = e / k, f -= p, u += p); + c.push({ + x: r, + y: h, + width: k, + height: p + }); + a && (g = 1 - g) + }); + return c + }, + strip: function (a, b) { + return this.algorithmLowAspectRatio(!1, + a, b) + }, + squarified: function (a, b) { + return this.algorithmLowAspectRatio(!0, a, b) + }, + sliceAndDice: function (a, b) { + return this.algorithmFill(!0, a, b) + }, + stripes: function (a, b) { + return this.algorithmFill(!1, a, b) + }, + translate: function () { + var a = this, + b = a.options, + d = M(a), + c, + e; + C.prototype.translate.call(a); + e = a.tree = a.getTree(); + c = a.nodeMap[d]; + a.mapOptionsToLevel = l({ + from: c.level + 1, + levels: b.levels, + to: e.height, + defaults: { + levelIsConstant: a.options.levelIsConstant, + colorByPoint: b.colorByPoint + } + }); + "" === d || c && c.children.length || (a.drillToNode("", + !1), d = a.rootNode, c = a.nodeMap[d]); + E(a.nodeMap[a.rootNode], function (b) { + var d = !1, + c = b.parent; + b.visible = !0; + if (c || "" === c) + d = a.nodeMap[c]; + return d + }); + E(a.nodeMap[a.rootNode].children, function (a) { + var b = !1; + a.forEach(function (a) { + a.visible = !0; + a.children.length && (b = (b || []).concat(a.children)) + }); + return b + }); + a.setTreeValues(e); + a.axisRatio = a.xAxis.len / a.yAxis.len; + a.nodeMap[""].pointValues = d = { + x: 0, + y: 0, + width: 100, + height: 100 + }; + a.nodeMap[""].values = d = n(d, { + width: d.width * a.axisRatio, + direction: "vertical" === b.layoutStartingDirection ? + 0 : 1, + val: e.val + }); + a.calculateChildrenAreas(e, d); + a.colorAxis ? a.translateColors() : b.colorByPoint || a.setColorRecursive(a.tree); + b.allowDrillToNode && (b = c.pointValues, a.xAxis.setExtremes(b.x, b.x + b.width, !1), a.yAxis.setExtremes(b.y, b.y + b.height, !1), a.xAxis.setScale(), a.yAxis.setScale()); + a.setPointValues() + }, + drawDataLabels: function () { + var a = this, + b = a.mapOptionsToLevel, + d, + c; + a.points.filter(function (a) { + return a.node.visible + }).forEach(function (e) { + c = b[e.node.level]; + d = { + style: {} + }; + e.node.isLeaf || (d.enabled = !1); + c && c.dataLabels && + (d = n(d, c.dataLabels), a._hasPointLabels = !0); + e.shapeArgs && (d.style.width = e.shapeArgs.width, e.dataLabel && e.dataLabel.css({ + width: e.shapeArgs.width + "px" + })); + e.dlOptions = n(d, e.options.dataLabels) + }); + C.prototype.drawDataLabels.call(this) + }, + alignDataLabel: function (a) { + h.column.prototype.alignDataLabel.apply(this, arguments); + a.dataLabel && a.dataLabel.attr({ + zIndex: (a.node.zIndex || 0) + 1 + }) + }, + pointAttribs: function (a, b) { + var d = F(this.mapOptionsToLevel) ? this.mapOptionsToLevel : {}, + c = a && d[a.node.level] || {}, + d = this.options, + e = + b && d.states[b] || {}, + g = a && a.getClassName() || ""; + a = { + stroke: a && a.borderColor || c.borderColor || e.borderColor || d.borderColor, + "stroke-width": x(a && a.borderWidth, c.borderWidth, e.borderWidth, d.borderWidth), + dashstyle: a && a.borderDashStyle || c.borderDashStyle || e.borderDashStyle || d.borderDashStyle, + fill: a && a.color || this.color + }; + -1 !== g.indexOf("highcharts-above-level") ? (a.fill = "none", a["stroke-width"] = 0) : -1 !== g.indexOf("highcharts-internal-node-interactive") ? (b = x(e.opacity, d.opacity), a.fill = p(a.fill).setOpacity(b).get(), + a.cursor = "pointer") : -1 !== g.indexOf("highcharts-internal-node") ? a.fill = "none" : b && (a.fill = p(a.fill).brighten(e.brightness).get()); + return a + }, + drawPoints: function () { + var a = this, + b = a.points.filter(function (a) { + return a.node.visible + }); + b.forEach(function (b) { + var d = "level-group-" + b.node.levelDynamic; + a[d] || (a[d] = a.chart.renderer.g(d).attr({ + zIndex: 1E3 - b.node.levelDynamic + }).add(a.group)); + b.group = a[d] + }); + h.column.prototype.drawPoints.call(this); + this.colorAttribs && a.chart.styledMode && this.points.forEach(function (a) { + a.graphic && + a.graphic.css(this.colorAttribs(a)) + }, this); + a.options.allowDrillToNode && b.forEach(function (b) { + b.graphic && (b.drillId = a.options.interactByLeaf ? a.drillToByLeaf(b) : a.drillToByGroup(b)) + }) + }, + onClickDrillToNode: function (a) { + var b = (a = a.point) && a.drillId; + z(b) && (a.setState(""), this.drillToNode(b)) + }, + drillToByGroup: function (a) { + var b = !1; + 1 !== a.node.level - this.nodeMap[this.rootNode].level || a.node.isLeaf || (b = a.id); + return b + }, + drillToByLeaf: function (a) { + var b = !1; + if (a.node.parent !== this.rootNode && a.node.isLeaf) + for (a = a.node; !b; ) + a = + this.nodeMap[a.parent], a.parent === this.rootNode && (b = a.id); + return b + }, + drillUp: function () { + var a = this.nodeMap[this.rootNode]; + a && z(a.parent) && this.drillToNode(a.parent) + }, + drillToNode: function (a, b) { + var c = this.nodeMap[a]; + this.idPreviousRoot = this.rootNode; + this.rootNode = a; + "" === a ? this.drillUpButton = this.drillUpButton.destroy() : this.showDrillUpButton(c && c.name || a); + this.isDirty = !0; + x(b, !0) && this.chart.redraw() + }, + showDrillUpButton: function (a) { + var b = this; + a = a || "\x3c Back"; + var c = b.options.drillUpButton, + f, + e; + c.text && + (a = c.text); + this.drillUpButton ? (this.drillUpButton.placed = !1, this.drillUpButton.attr({ + text: a + }).align()) : (e = (f = c.theme) && f.states, this.drillUpButton = this.chart.renderer.button(a, null, null, function () { + b.drillUp() + }, f, e && e.hover, e && e.select).addClass("highcharts-drillup-button").attr({ + align: c.position.align, + zIndex: 7, + display: 'none' + }).add().align(c.position, !1, c.relativeTo || "plotBox")) + }, + buildKDTree: y, + drawLegendSymbol: c.LegendSymbolMixin.drawRectangle, + getExtremes: function () { + C.prototype.getExtremes.call(this, this.colorValueData); + this.valueMin = this.dataMin; + this.valueMax = this.dataMax; + C.prototype.getExtremes.call(this) + }, + getExtremesFromAll: !0, + bindAxes: function () { + var a = { + endOnTick: !1, + gridLineWidth: 0, + lineWidth: 0, + min: 0, + dataMin: 0, + minPadding: 0, + max: 100, + dataMax: 100, + maxPadding: 0, + startOnTick: !1, + title: null, + tickPositions: [] + }; + C.prototype.bindAxes.call(this); + c.extend(this.yAxis.options, a); + c.extend(this.xAxis.options, a) + }, + utils: { + recursive: E + } + }, { + getClassName: function () { + var a = c.Point.prototype.getClassName.call(this), + b = this.series, + d = b.options; + this.node.level <= b.nodeMap[b.rootNode].level ? a += " highcharts-above-level" : this.node.isLeaf || x(d.interactByLeaf, !d.allowDrillToNode) ? this.node.isLeaf || (a += " highcharts-internal-node") : a += " highcharts-internal-node-interactive"; + return a + }, + isValid: function () { + return this.id || f(this.value) + }, + setState: function (a) { + c.Point.prototype.setState.call(this, a); + this.graphic && this.graphic.attr({ + zIndex: "hover" === a ? 1 : 0 + }) + }, + setVisible: h.pie.prototype.pointClass.prototype.setVisible + }) + })(z, K); + (function (c, w, k) { + var h = c.CenteredSeriesMixin, + n = c.Series, + B = c.extend, + y = h.getCenter, + t = k.getColor, + l = k.getLevelOptions, + D = h.getStartAndEndRadians, + f = c.isNumber, + z = c.isObject, + K = c.isString, + x = c.merge, + C = 180 / Math.PI, + h = c.seriesType, + L = k.setTreeValues, + p = k.updateRootId, + H = function (a, b) { + var c = []; + if (f(a) && f(b) && a <= b) + for (; a <= b; a++) + c.push(a); + return c + }, + E = function (a, b) { + var c; + b = z(b) ? b : {}; + var k = 0, + e, + g, + m, + u; + z(a) && (c = x({}, a), a = f(b.from) ? b.from : 0, u = f(b.to) ? b.to : 0, g = H(a, u), a = Object.keys(c).filter(function (a) { + return -1 === g.indexOf(+a) + }), e = m = f(b.diffRadius) ? b.diffRadius : 0, g.forEach(function (a) { + a = + c[a]; + var b = a.levelSize.unit, + d = a.levelSize.value; + "weight" === b ? k += d : "percentage" === b ? (a.levelSize = { + unit: "pixels", + value: d / 100 * e + }, m -= a.levelSize.value) : "pixels" === b && (m -= d) + }), g.forEach(function (a) { + var b = c[a]; + "weight" === b.levelSize.unit && (b = b.levelSize.value, c[a].levelSize = { + unit: "pixels", + value: b / k * m + }) + }), a.forEach(function (a) { + c[a].levelSize = { + value: 0, + unit: "pixels" + } + })); + return c + }, + M = function (a, b) { + var c = b.mapIdToNode[a.parent], + f = b.series, + e = f.chart, + g = f.points[a.i], + c = t(a, { + colors: e && e.options && e.options.colors, + colorIndex: f.colorIndex, + index: b.index, + mapOptionsToLevel: b.mapOptionsToLevel, + parentColor: c && c.color, + parentColorIndex: c && c.colorIndex, + series: b.series, + siblings: b.siblings + }); + a.color = c.color; + a.colorIndex = c.colorIndex; + g && (g.color = a.color, g.colorIndex = a.colorIndex, a.sliced = a.id !== b.idRoot ? g.sliced : !1); + return a + }; + h("sunburst", "treemap", { + center: ["50%", "50%"], + colorByPoint: !1, + dataLabels: { + allowOverlap: !0, + defer: !0, + style: { + textOverflow: "ellipsis" + }, + rotationMode: "auto" + }, + rootId: void 0, + levelIsConstant: !0, + levelSize: { + value: 1, + unit: "weight" + }, + slicedOffset: 10 + }, { + drawDataLabels: c.noop, + drawPoints: function () { + var a = this, + b = a.mapOptionsToLevel, + c = a.shapeRoot, + k = a.group, + e = a.hasRendered, + g = a.rootNode, + m = a.idPreviousRoot, + u = a.nodeMap, + h = u[m], + p = h && h.shapeArgs, + h = a.points, + r = a.startAndEndRadians, + t = a.chart, + l = t && t.options && t.options.chart || {}, + w = "boolean" === typeof l.animation ? l.animation : !0, + y = a.center[3] / 2, + D = a.chart.renderer, + E, + F = !1, + H = !1; + if (l = !!(w && e && g !== m && a.dataLabelsGroup)) + a.dataLabelsGroup.attr({ + opacity: 0 + }), E = function () { + F = !0; + a.dataLabelsGroup && + a.dataLabelsGroup.animate({ + opacity: 1, + visibility: "visible" + }) + }; + h.forEach(function (d) { + var h, + v, + q = d.node, + l = b[q.level]; + h = d.shapeExisting || {}; + var n = q.shapeArgs || {}, + I, + F = !(!q.visible || !q.shapeArgs); + if (e && w) { + var J = {}; + v = { + end: n.end, + start: n.start, + innerR: n.innerR, + r: n.r, + x: n.x, + y: n.y + }; + F ? !d.graphic && p && (J = g === d.id ? { + start: r.start, + end: r.end + } + : p.end <= n.start ? { + start: r.end, + end: r.end + } + : { + start: r.start, + end: r.start + }, J.innerR = J.r = y) : d.graphic && (m === d.id ? v = { + innerR: y, + r: y + } + : c && (v = c.end <= h.start ? { + innerR: y, + r: y, + start: r.end, + end: r.end + } + : { + innerR: y, + r: y, + start: r.start, + end: r.start + })); + h = J + } else + v = n, h = {}; + var J = [n.plotX, n.plotY], + A; + d.node.isLeaf || (g === d.id ? (A = u[g], A = A.parent) : A = d.id); + B(d, { + shapeExisting: n, + tooltipPos: J, + drillId: A, + name: "" + (d.name || d.id || d.index), + plotX: n.plotX, + plotY: n.plotY, + value: q.val, + isNull: !F + }); + A = d.options; + q = z(n) ? n : {}; + A = z(A) ? A.dataLabels : {}; + var l = z(l) ? l.dataLabels : {}, + l = x({ + style: {} + }, l, A), + G; + A = l.rotationMode; + f(l.rotation) || ("auto" === A && (1 > d.innerArcLength && d.outerArcLength > q.radius ? G = 0 : A = 1 < d.innerArcLength && d.outerArcLength > 1.5 * + q.radius ? "parallel" : "perpendicular"), "auto" !== A && (G = q.end - (q.end - q.start) / 2), l.style.width = "parallel" === A ? Math.min(2.5 * q.radius, (d.outerArcLength + d.innerArcLength) / 2) : q.radius, "perpendicular" === A && d.series.chart.renderer.fontMetrics(l.style.fontSize).h > d.outerArcLength && (l.style.width = 1), l.style.width = Math.max(l.style.width - 2 * (l.padding || 0), 1), G = G * C % 180, "parallel" === A && (G -= 90), 90 < G ? G -= 180 : -90 > G && (G += 180), l.rotation = G); + 0 === l.rotation && (l.rotation = .001); + d.dlOptions = l; + !H && F && (H = !0, I = E); + d.draw({ + animatableAttribs: v, + attribs: B(h, !t.styledMode && a.pointAttribs(d, d.selected && "select")), + onComplete: I, + group: k, + renderer: D, + shapeType: "arc", + shapeArgs: n + }) + }); + l && H ? (a.hasRendered = !1, a.options.dataLabels.defer = !0, n.prototype.drawDataLabels.call(a), a.hasRendered = !0, F && E()) : n.prototype.drawDataLabels.call(a) + }, + pointAttribs: c.seriesTypes.column.prototype.pointAttribs, + layoutAlgorithm: function (a, b, c) { + var d = a.start, + e = a.end - d, + g = a.val, + m = a.x, + h = a.y, + k = c && z(c.levelSize) && f(c.levelSize.value) ? c.levelSize.value : 0, + l = a.r, + n = l + k, + p = c && f(c.slicedOffset) ? + c.slicedOffset : 0; + return (b || []).reduce(function (a, b) { + var c = 1 / g * b.val * e, + f = d + c / 2, + q = m + Math.cos(f) * p, + f = h + Math.sin(f) * p; + b = { + x: b.sliced ? q : m, + y: b.sliced ? f : h, + innerR: l, + r: n, + radius: k, + start: d, + end: d + c + }; + a.push(b); + d = b.end; + return a + }, []) + }, + setShapeArgs: function (a, b, c) { + var d = [], + e = c[a.level + 1]; + a = a.children.filter(function (a) { + return a.visible + }); + d = this.layoutAlgorithm(b, a, e); + a.forEach(function (a, b) { + b = d[b]; + var e = b.start + (b.end - b.start) / 2, + f = b.innerR + (b.r - b.innerR) / 2, + g = b.end - b.start, + f = 0 === b.innerR && 6.28 < g ? { + x: b.x, + y: b.y + } + : { + x: b.x + + Math.cos(e) * f, + y: b.y + Math.sin(e) * f + }, + h = a.val ? a.childrenTotal > a.val ? a.childrenTotal : a.val : a.childrenTotal; + this.points[a.i] && (this.points[a.i].innerArcLength = g * b.innerR, this.points[a.i].outerArcLength = g * b.r); + a.shapeArgs = x(b, { + plotX: f.x, + plotY: f.y + 4 * Math.abs(Math.cos(e)) + }); + a.values = x(b, { + val: h + }); + a.children.length && this.setShapeArgs(a, a.values, c) + }, this) + }, + translate: function () { + var a = this.options, + b = this.center = y.call(this), + c = this.startAndEndRadians = D(a.startAngle, a.endAngle), + f = b[3] / 2, + e = b[2] / 2 - f, + g = p(this), + h = this.nodeMap, + k, + q = h && h[g], + t, + r; + this.shapeRoot = q && q.shapeArgs; + n.prototype.translate.call(this); + r = this.tree = this.getTree(); + h = this.nodeMap; + q = h[g]; + k = K(q.parent) ? q.parent : ""; + t = h[k]; + k = l({ + from: 0 < q.level ? q.level : 1, + levels: this.options.levels, + to: r.height, + defaults: { + colorByPoint: a.colorByPoint, + dataLabels: a.dataLabels, + levelIsConstant: a.levelIsConstant, + levelSize: a.levelSize, + slicedOffset: a.slicedOffset + } + }); + k = E(k, { + diffRadius: e, + from: 0 < q.level ? q.level : 1, + to: r.height + }); + L(r, { + before: M, + idRoot: g, + levelIsConstant: a.levelIsConstant, + mapOptionsToLevel: k, + mapIdToNode: h, + points: this.points, + series: this + }); + a = h[""].shapeArgs = { + end: c.end, + r: f, + start: c.start, + val: q.val, + x: b[0], + y: b[1] + }; + this.setShapeArgs(t, a, k); + this.mapOptionsToLevel = k + }, + animate: function (a) { + var b = this.chart, + c = [b.plotWidth / 2, b.plotHeight / 2], + f = b.plotLeft, + e = b.plotTop, + b = this.group; + a ? (a = { + translateX: c[0] + f, + translateY: c[1] + e, + scaleX: .001, + scaleY: .001, + rotation: 10, + opacity: .01 + }, b.attr(a)) : (a = { + translateX: f, + translateY: e, + scaleX: 1, + scaleY: 1, + rotation: 0, + opacity: 1 + }, b.animate(a, this.options.animation), this.animate = null) + }, + utils: { + calculateLevelSizes: E, + range: H + } + }, { + draw: w, + shouldDraw: function () { + return !this.isNull + } + }) + })(z, N, K) +}); +//# sourceMappingURL=sunburst.js.map diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 660221a54..9d31f02f6 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -1327,7 +1327,8 @@ function echart_topic_domain(rs){ var data=[{ 'id': '0.0', // 'parent': '', - 'name': 'Service' + 'name': 'Service', + color:'#265197' }]; var unit="bytes"; $(rs).each(function(i,d){ @@ -1342,6 +1343,7 @@ function echart_topic_domain(rs){ if(inoctetsNum>0){ /****主题中的子域名*******/ var topicData=0; + $(d.domainData).each(function(j,t){ var domainNum=t.byteCount; var domainNumK=domainNum/1024; @@ -1373,14 +1375,8 @@ function echart_topic_domain(rs){ plotBorderWidth:null, plotShadow:false, marginTop:50, - marginBottom:10, + marginBottom:10 }, - /* navigation: { - buttonOptions: { - x:-5, - y:15, - } - },*/ exporting: { allowHTML:true, filename:'Service'+addDateName(), @@ -1399,18 +1395,9 @@ function echart_topic_domain(rs){ }, buttons: exportingButton('#6e6379') }, - //colors:[ '#44A9A8', '#f36f8a','#25f3e6','#ffff43','#964CEC','#32B0ED','#2b6ed7','#7278DD','#2DA9D8','#C66FE6','#0099cc','#cc0033','#ff6633','#99cccc','#d9f9d0'], -// colors:['#003078','#004bbc', '#015bb1', '#2f74b5', '#4186c1', '#0058e1','#066aff', '#5597cd', '#5c9dff', '#67a7de', '#77b5dc', '#98cde7','#89b9ff','#78adff'], -// colors:['#008ef9','#0594ff', '#002540', '#004679', '#025ba1', '#026fc0','#0279d5'], -// colors:['#002540','#004679','#025ba1', '#026fc0', '#0279d5', '#0086e9', '#008ef9','#0594ff', '#25a2ff', '#63bbff', '#88cbff'], - colors:[ '#1C4573','#275A9C', '#306EB9', '#3579CE', '#3C85E1', '#3E8EF1','#4294F7', '#4294F7', '#98CBFA'], -// colors:colors, - noData:{ - style: {//设置字体颜色 - color: '#fff', - }, - }, - title: { +// colors:[ '#1C4573','#275A9C', '#306EB9', '#3579CE', '#3C85E1', '#3E8EF1','#4294F7', '#4294F7', '#98CBFA'], + colors:['#013fa2', '#014ecb', '#015ef4', '#01378e', '#014abd','#0156df','#0b68fe'], + title: { text: null }, credits:{//是否有highcharts水印 @@ -1421,19 +1408,19 @@ function echart_topic_domain(rs){ data: data, allowDrillToNode: true, cursor: 'pointer', - colorByPoint: true, + //colorByPoint: true, dataLabels: { //format: '{point.name}', - /*formatter: function(){ + formatter: function(){ this.point.value = this.point.value.toFixed(2); this.series.name = this.point.name; console.info(this); - },*/ - filter: { + }, + filter: { property: 'innerArcLength', operator: '>', value: 16 - } + } }, levels: [{ level: 1, @@ -1470,7 +1457,8 @@ function echart_topic_domain(rs){ }], plotOptions: { sunburst: { - borderColor: "", + borderColor: "#ffffff", + borderWidth:0.2, dataLabels: { enabled: true, style: {//设置字体颜色 @@ -1480,7 +1468,7 @@ function echart_topic_domain(rs){ textOutline:'none', fontWeight:'normal' }, - format: '{point.name}', + format: '{point.name}' } } }, @@ -1488,7 +1476,53 @@ function echart_topic_domain(rs){ headerFormat: "", pointFormat: '{point.name} : {point.value:.2f} ' +unit } - }); + }/*{ + chart: { + backgroundColor: 'rgba(255, 255, 255, 0)', + plotBackgroundColor:null, + plotBorderWidth:null, + plotShadow:false, + marginTop:50, + marginBottom:10 + }, + title: { + text: '2017 世界人口分布' + }, + subtitle: { + text: '数据来源: Wikipedia' + }, + series: [{ + type: "sunburst", + data: data, + allowDrillToNode: true, + cursor: 'pointer', + dataLabels: { + *//** + * A custom formatter that returns the name only if the inner arc + * is longer than a certain pixel size, so the shape has place for + * the label. + *//* + }, + levels: [{ + level: 2, + colorByPoint: true, + dataLabels: { + rotationMode: 'parallel' + } + }, + { + level: 3, + colorVariation: { + key: 'brightness', + to: -0.5 + } + }] + }], + tooltip: { + headerFormat: "", + pointFormat: '{point.name}的人口数量是:{point.value}' + } + }*/); } function exportingButton(color) {