StatefulSeries.js 1 KB
//>>built
define(["dojo/_base/array","dojo/_base/declare","dojo/_base/lang","dojox/mvc/at"],function(k,l,a,m){return l("dojox.mvc.StatefulSeries",null,{constructor:function(f){function g(){d.series&&(d.series.chart.updateSeries(d.series.name,d),d.series.chart.delayedRender())}var d=this;this._handles=[];this.data=k.map(f,function(b,f){if("dojox.mvc.at"==(b||{}).atsignature){var c=b.target,e=b.targetProp;if(a.isString(c))throw Error("Literal-based dojox/mvc/at is not supported in dojox/mvc/StatefulSeries.");
!b.bindDirection||b.bindDirection&m.from||console.warn("Data binding bindDirection option is ignored in dojox/mvc/StatefulSeries.");if(e&&a.isFunction(c.set)&&a.isFunction(c.watch)){b=b.converter;var h=(b||{}).format&&a.hitch({target:c,source:this},b.format);this._handles.push(c.watch(e,function(b,c,a){d.data[f]=h?h(a):a;g()}))}return e?a.isFunction(c.get)?c.get(e):c[e]:c}return b},this);g()},destroy:function(){for(var a=null;a=this._handles.pop();)a.unwatch()},setSeriesObject:function(a){this.series=
a}})});