nnnjjj123
2020-11-17 1b2c1edb61190eeb19f465ff031eaa3b2a1b8dbc
1
2
3
4
5
6
7
8
9
10
//>>built
define("dojo/_base/array dojo/_base/declare dojo/query dojo/_base/connect dojo/_base/Color ./Legend dijit/form/CheckBox ../action2d/Highlight dojox/lang/functional dojox/gfx/fx dojo/keys dojo/dom-construct dojo/dom-prop dijit/registry".split(" "),function(e,n,f,m,z,p,q,r,A,B,g,t,u,v){function w(a){return"mouseenter"==a?"onmouseover":"mouseleave"==a?"onmouseout":"on"+a}var x=n(null,{constructor:function(a){this.legend=a;this.index=0;this.horizontalLength=this._getHrizontalLength();e.forEach(a.legends,
function(a,c){0<c&&f("input",a).attr("tabindex",-1)});this.firstLabel=f("input",a.legends[0])[0];m.connect(this.firstLabel,"focus",this,function(){this.legend.active=!0});m.connect(this.legend.domNode,"keydown",this,"_onKeyEvent")},_getHrizontalLength:function(){var a=this.legend.horizontal;return"number"==typeof a?Math.min(a,this.legend.legends.length):a?this.legend.legends.length:1},_onKeyEvent:function(a){if(this.legend.active)if(a.keyCode==g.TAB)this.legend.active=!1;else{var b=this.legend.legends.length;
switch(a.keyCode){case g.LEFT_ARROW:this.index--;0>this.index&&(this.index+=b);break;case g.RIGHT_ARROW:this.index++;this.index>=b&&(this.index-=b);break;case g.UP_ARROW:0<=this.index-this.horizontalLength&&(this.index-=this.horizontalLength);break;case g.DOWN_ARROW:this.index+this.horizontalLength<b&&(this.index+=this.horizontalLength);break;default:return}this._moveToFocus();Event.stop(a)}},_moveToFocus:function(){f("input",this.legend.legends[this.index])[0].focus()}}),y=n(r,{connect:function(){}});
return n("dojox.charting.widget.SelectableLegend",p,{outline:!1,transitionFill:null,transitionStroke:null,autoScale:!1,postCreate:function(){this.legends=[];this.legendAnim={};this._cbs=[];this.inherited(arguments)},refresh:function(){this.legends=[];this._clearLabels();this.inherited(arguments);this._applyEvents();new x(this)},_clearLabels:function(){for(var a=this._cbs;a.length;)a.pop().destroyRecursive()},_addLabel:function(a,b){this.inherited(arguments);var c=f("td",this.legendBody),d=c[c.length-
1];this.legends.push(d);c=new q({checked:!0});this._cbs.push(c);t.place(c.domNode,d,"first");d=f("label",d)[0];u.set(d,"for",c.id)},_applyEvents:function(){this.chart.dirty||e.forEach(this.legends,function(a,b){var c,d,k;this._isPie()?(c=this.chart.stack[0],d=c.name,k=this.chart.series[0].name):(c=this.chart.series[b],d=c.plot,k=c.name);var h=v.byNode(f(".dijitCheckBox",a)[0]);h.set("checked",!this._isHidden(d,b));m.connect(h,"onClick",this,function(a){this.toogle(d,b,!h.get("checked"));a.stopPropagation()});
var l=f(".dojoxLegendIcon",a)[0],g=this._getFilledShape(this._surfaces[b].children);e.forEach(["onmouseenter","onmouseleave"],function(a){m.connect(l,a,this,function(a){this._highlight(a,g,b,!h.get("checked"),k,d)})},this)},this)},_isHidden:function(a,b){return this._isPie()?-1!=e.indexOf(this.chart.getPlot(a).runFilter,b):this.chart.series[b].hidden},toogle:function(a,b,c){a=this.chart.getPlot(a);this._isPie()?-1!=e.indexOf(a.runFilter,b)?c||(a.runFilter=e.filter(a.runFilter,function(a){return a!=
b})):c&&a.runFilter.push(b):this.chart.series[b].hidden=c;this.autoScale?this.chart.dirty=!0:a.dirty=!0;this.chart.render()},_highlight:function(a,b,c,d,k,h){if(!d){var l=this._getAnim(h),f=this._isPie(),g=w(a.type);l.process({shape:b,index:f?"legend"+c:"legend",run:{name:k},type:g});e.forEach(this._getShapes(c,h),function(a,b){a={shape:a,index:f?c:b,run:{name:k},type:g};l.duration=100;l.process(a)})}},_getShapes:function(a,b){var c=[];if(this._isPie()){var d=0;e.forEach(this.chart.getPlot(b).runFilter,
function(b){a>b&&d++});c.push(this.chart.stack[0].group.children[a-d])}else this._isCandleStick(b)?e.forEach(this.chart.series[a].group.children,function(a){e.forEach(a.children,function(a){e.forEach(a.children,function(a){"line"!=a.shape.type&&c.push(a)})})}):c=this.chart.series[a].group.children;return c},_getAnim:function(a){this.legendAnim[a]||(this.legendAnim[a]=new y(this.chart,a));return this.legendAnim[a]},_getTransitionFill:function(a){return-1!=this.chart.stack[this.chart.plots[a]].declaredClass.indexOf("dojox.charting.plot2d.Stacked")?
this.chart.theme.plotarea.fill:null},_getFilledShape:function(a){for(var b=0;a[b];){if(a[b].getFill())return a[b];b++}return null},_isPie:function(){return"dojox.charting.plot2d.Pie"==this.chart.stack[0].declaredClass},_isCandleStick:function(a){return"dojox.charting.plot2d.Candlesticks"==this.chart.stack[this.chart.plots[a]].declaredClass},destroy:function(){this._clearLabels();this.inherited(arguments)}})});