UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 19.1 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[88156],{56434:function(t,e,n){n.d(e,{e:function(){return o}});var a=n(81977);function o(t,e,n){return(0,a.P)(t,12*e,n)}},6116:function(t,e,n){n.d(e,{o:function(){return i}});var a=n(6439),o=n(83339);function i(t,e,n){const i=(0,o.b)(t,e)/6e4;return(0,a.u)(null==n?void 0:n.roundingMethod)(i)}},77652:function(t,e,n){n.d(e,{n:function(){return s}});n(16280);var a=n(40445),o=n(5990),i=n(54202),r=n(99904),l=n(16890),u=n(16418),s="sankey",c=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return(0,a.C6)(e,t),e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],a=t.data||t.nodes||[],o=t.levels||[];this.levelModels=[];for(var l=this.levelModels,u=0;u<o.length;u++)null!=o[u].depth&&o[u].depth>=0&&(l[o[u].depth]=new r.A(o[u],this,e));return(0,i.A)(a,n,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t,e){var n=t.parentModel,a=n.getData().getItemLayout(e);if(a){var o=a.depth,i=n.levelModels[o];i&&(t.parentModel=i)}return t}),e.wrapMethod("getItemModel",function(t,e){var n=t.parentModel,a=n.getGraph().getEdgeByIndex(e).node1.getLayout();if(a){var o=a.depth,i=n.levelModels[o];i&&(t.parentModel=i)}return t})}).data},e.prototype.setNodePosition=function(t,e){var n=(this.option.data||this.option.nodes)[t];n.localX=e[0],n.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function a(t){return isNaN(t)||null==t}if("edge"===n){var o=this.getDataParams(t,n),i=o.data,r=o.value,u=i.source+" -- "+i.target;return(0,l.Qx)("nameValue",{name:u,value:r,noValue:a(r)})}var s=this.getGraph().getNodeByIndex(t).getLayout().value,c=this.getDataParams(t,n).data.name;return(0,l.Qx)("nameValue",{name:null!=c?c+"":null,value:s,noValue:a(s)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,n){var a=t.prototype.getDataParams.call(this,e,n);if(null==a.value&&"node"===n){var o=this.getGraph().getNodeByIndex(e).getLayout().value;a.value=o}return a},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+s,e.layoutMode="box",e.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:u.A.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:u.A.color.primary}},animationEasing:"linear",animationDuration:1e3},e}(o.A);e.A=c},30052:function(t,e,n){n(46058);var a=n(40445),o=n(79231),i=n(22785),r=n(4017),l=n(67665),u=n(52557),s=n(9078),c=n(77652),d=n(27275),g=n(79825),h=n(90057),y=n(52577),p=n(16329),f=n(66834),v=n(42605),x=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},m=function(t){function e(e){return t.call(this,e)||this}return(0,a.C6)(e,t),e.prototype.getDefaultShape=function(){return new x},e.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},e.prototype.highlight=function(){(0,s.HY)(this)},e.prototype.downplay=function(){(0,s.SD)(this)},e}(o.Ay),L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=c.n,e._mainGroup=new i.A,e}return(0,a.C6)(e,t),e.prototype.init=function(t,e){this._controller=new p.A(e.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(t,e,n){var a=t.getGraph(),o=this._mainGroup,i=t.layoutInfo,l=i.width,c=i.height,d=t.getData(),p=t.getData("edge"),f=t.get("orient");o.removeAll(),o.x=i.x,o.y=i.y,this._updateViewCoordSys(t,n),(0,v.jg)(t,n,this._controller,(0,v.QB)(o),null),a.eachEdge(function(e){var n=new m,a=(0,h.z)(n);a.dataIndex=e.dataIndex,a.seriesIndex=t.seriesIndex,a.dataType="edge";var i,r,u,d,v,x,L,b,I=e.getModel(),S=I.getModel("lineStyle"),w=S.get("curveness"),M=e.node1.getLayout(),T=e.node1.getModel(),_=T.get("localX"),E=T.get("localY"),A=e.node2.getLayout(),D=e.node2.getModel(),z=D.get("localX"),C=D.get("localY"),O=e.getLayout();n.shape.extent=Math.max(1,O.dy),n.shape.orient=f,"vertical"===f?(i=(null!=_?_*l:M.x)+O.sy,r=(null!=E?E*c:M.y)+M.dy,u=(null!=z?z*l:A.x)+O.ty,v=i,x=r*(1-w)+(d=null!=C?C*c:A.y)*w,L=u,b=r*w+d*(1-w)):(i=(null!=_?_*l:M.x)+M.dx,r=(null!=E?E*c:M.y)+O.sy,v=i*(1-w)+(u=null!=z?z*l:A.x)*w,x=r,L=i*w+u*(1-w),b=d=(null!=C?C*c:A.y)+O.ty),n.setShape({x1:i,y1:r,x2:u,y2:d,cpx1:v,cpy1:x,cpx2:L,cpy2:b}),n.useStyle(S.getItemStyle()),V(n.style,f,e);var G=""+I.get("value"),N=(0,g.lx)(I,"edgeLabel");(0,g.qM)(n,N,{labelFetcher:{getFormattedLabel:function(e,n,a,o,i,r){return t.getFormattedLabel(e,n,"edge",o,(0,y.retrieve3)(i,N.normal&&N.normal.get("formatter"),G),r)}},labelDataIndex:e.dataIndex,defaultText:G}),n.setTextConfig({position:"inside"});var P=I.getModel("emphasis");(0,s.Mx)(n,I,"lineStyle",function(t){var n=t.getItemStyle();return V(n,f,e),n}),o.add(n),p.setItemGraphicEl(e.dataIndex,n);var j=P.get("focus");(0,s.Lm)(n,"adjacency"===j?e.getAdjacentDataIndices():"trajectory"===j?e.getTrajectoryDataIndices():j,P.get("blurScope"),P.get("disabled"))}),a.eachNode(function(e){var n=e.getLayout(),a=e.getModel(),i=a.get("localX"),u=a.get("localY"),y=a.getModel("emphasis"),p=a.get(["itemStyle","borderRadius"])||0,f=new r.A({shape:{x:null!=i?i*l:n.x,y:null!=u?u*c:n.y,width:n.dx,height:n.dy,r:p},style:a.getModel("itemStyle").getItemStyle(),z2:10});(0,g.qM)(f,(0,g.lx)(a),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(e,n,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),f.disableLabelAnimation=!0,f.setStyle("fill",e.getVisual("color")),f.setStyle("decal",e.getVisual("style").decal),(0,s.Mx)(f,a),o.add(f),d.setItemGraphicEl(e.dataIndex,f),(0,h.z)(f).dataType="node";var v=y.get("focus");(0,s.Lm)(f,"adjacency"===v?e.getAdjacentDataIndices():"trajectory"===v?e.getTrajectoryDataIndices():v,y.get("blurScope"),y.get("disabled"))}),d.eachItemGraphicEl(function(e,a){d.getItemModel(a).get("draggable")&&(e.drift=function(e,o){this.shape.x+=e,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:d.getRawIndex(a),localX:this.shape.x/l,localY:this.shape.y/c})},e.draggable=!0,e.cursor="move")}),!this._data&&t.isAnimationEnabled()&&o.setClipPath(function(t,e,n){var a=new r.A({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return u.LW(a,{shape:{width:t.width+20}},e,n),a}(o.getBoundingRect(),t,function(){o.removeClipPath()})),this._data=t.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(t,e,n){(0,f.nT)(this.group,f.ZD,e.coordinateSystem,null)},e.prototype.dispose=function(){this._controller&&this._controller.dispose()},e.prototype._updateViewCoordSys=function(t,e){var n=t.layoutInfo,a=t.coordinateSystem=(0,v.ao)(t,e,n.x,n.y,n.width,n.height);(0,f.nT)(this.group,f.ZD,a,this._firstRender?null:t)},e.type=c.n,e}(d.A);function V(t,e,n){switch(t.fill){case"source":t.fill=n.node1.getVisual("color"),t.decal=n.node1.getVisual("style").decal;break;case"target":t.fill=n.node2.getVisual("color"),t.decal=n.node2.getVisual("style").decal;break;case"gradient":var a=n.node1.getVisual("color"),o=n.node2.getVisual("color");(0,y.isString)(a)&&(0,y.isString)(o)&&(t.fill=new l.A(0,0,+("horizontal"===e),+("vertical"===e),[{color:a,offset:0},{color:o,offset:1}]))}}e.A=L},47685:function(t,e,n){n.d(e,{a:function(){return w}});var a=n(30052),o=n(77652),i=n(11975),r=n(42605),l=(n(16280),n(44114),n(94490),n(26910),n(62953),n(52577)),u=n(6471),s=n(83354),c=n(88877),d=(0,u.O9)(o.n,function(t,e){t.eachSeriesByType(o.n,function(t){var n=t.get("nodeWidth"),a=t.get("nodeGap"),o=(0,s.Lj)(t,e).refContainer,i=(0,s.dV)(t.getBoxLayoutParams(),o);t.layoutInfo=i;var r=i.width,d=i.height,p=t.getGraph(),f=p.nodes,v=p.edges;!function(t){l.each(t,function(t){var e=V(t.outEdges,L),n=V(t.inEdges,L),a=t.getValue()||0,o=Math.max(e,n,a);t.setLayout({value:o},!0)})}(f),function(t,e,n,a,o,i,r,s,d){(function(t,e,n,a,o,i,r){for(var u=[],s=[],c=[],d=[],h=0,y=0;y<e.length;y++)u[y]=1;for(y=0;y<t.length;y++)s[y]=t[y].inEdges.length,0===s[y]&&c.push(t[y]);var p=-1;for(;c.length;){for(var f=0;f<c.length;f++){var v=c[f],x=v.hostGraph.data.getRawDataItem(v.dataIndex),m=null!=x.depth&&x.depth>=0;m&&x.depth>p&&(p=x.depth),v.setLayout({depth:m?x.depth:h},!0),"vertical"===i?v.setLayout({dy:n},!0):v.setLayout({dx:n},!0);for(var L=0;L<v.outEdges.length;L++){var V=v.outEdges[L];u[l.indexOf(e,V)]=0;var b=V.node2;0===--s[l.indexOf(t,b)]&&l.indexOf(d,b)<0&&d.push(b)}}++h,c=d,d=[]}for(y=0;y<u.length;y++)if(1===u[y])throw new Error("Sankey is a DAG, the original data has cycle!");var I=p>h-1?p:h-1;r&&"left"!==r&&function(t,e,n,a){if("right"===e){for(var o=[],i=t,r=0;i.length;){for(var u=0;u<i.length;u++){var s=i[u];s.setLayout({skNodeHeight:r},!0);for(var c=0;c<s.inEdges.length;c++){var d=s.inEdges[c];l.indexOf(o,d.node1)<0&&o.push(d.node1)}}i=o,o=[],++r}l.each(t,function(t){g(t)||t.setLayout({depth:Math.max(0,a-t.getLayout().skNodeHeight)},!0)})}else"justify"===e&&function(t,e){l.each(t,function(t){g(t)||t.outEdges.length||t.setLayout({depth:e},!0)})}(t,a)}(t,r,0,I);var S="vertical"===i?(o-n)/I:(a-n)/I;!function(t,e,n){l.each(t,function(t){var a=t.getLayout().depth*e;"vertical"===n?t.setLayout({y:a},!0):t.setLayout({x:a},!0)})}(t,S,i)})(t,e,n,o,i,s,d),function(t,e,n,a,o,i,r){var s=function(t,e){var n=[],a="vertical"===e?"y":"x",o=(0,u.Sq)(t,function(t){return t.getLayout()[a]});return(0,c.Y6)(o.keys),l.each(o.keys,function(t){n.push(o.buckets.get(t))}),n}(t,r);(function(t,e,n,a,o,i){var r=1/0;l.each(t,function(t){var e=t.length,u=0;l.each(t,function(t){u+=t.getLayout().value});var s="vertical"===i?(a-(e-1)*o)/u:(n-(e-1)*o)/u;s<r&&(r=s)}),l.each(t,function(t){l.each(t,function(t,e){var n=t.getLayout().value*r;"vertical"===i?(t.setLayout({x:e},!0),t.setLayout({dx:n},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:n},!0))})}),l.each(e,function(t){var e=+t.getValue()*r;t.setLayout({dy:e},!0)})})(s,e,n,a,o,r),h(s,o,n,a,r);for(var d=1;i>0;i--)y(s,d*=.99,r),h(s,o,n,a,r),b(s,d,r),h(s,o,n,a,r)}(t,e,i,o,a,r,s),function(t,e){var n="vertical"===e?"x":"y";l.each(t,function(t){t.outEdges.sort(function(t,e){return t.node2.getLayout()[n]-e.node2.getLayout()[n]}),t.inEdges.sort(function(t,e){return t.node1.getLayout()[n]-e.node1.getLayout()[n]})}),l.each(t,function(t){var e=0,n=0;l.each(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),l.each(t.inEdges,function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy})})}(t,s)}(f,v,n,a,r,d,0!==l.filter(f,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))})});function g(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function h(t,e,n,a,o){var i="vertical"===o?"x":"y";l.each(t,function(t){var r,l,u;t.sort(function(t,e){return t.getLayout()[i]-e.getLayout()[i]});for(var s=0,c=t.length,d="vertical"===o?"dx":"dy",g=0;g<c;g++)(u=s-(l=t[g]).getLayout()[i])>0&&(r=l.getLayout()[i]+u,"vertical"===o?l.setLayout({x:r},!0):l.setLayout({y:r},!0)),s=l.getLayout()[i]+l.getLayout()[d]+e;if((u=s-e-("vertical"===o?a:n))>0){r=l.getLayout()[i]-u,"vertical"===o?l.setLayout({x:r},!0):l.setLayout({y:r},!0),s=r;for(g=c-2;g>=0;--g)(u=(l=t[g]).getLayout()[i]+l.getLayout()[d]+e-s)>0&&(r=l.getLayout()[i]-u,"vertical"===o?l.setLayout({x:r},!0):l.setLayout({y:r},!0)),s=l.getLayout()[i]}})}function y(t,e,n){l.each(t.slice().reverse(),function(t){l.each(t,function(t){if(t.outEdges.length){var a=V(t.outEdges,p,n)/V(t.outEdges,L);if(isNaN(a)){var o=t.outEdges.length;a=o?V(t.outEdges,f,n)/o:0}if("vertical"===n){var i=t.getLayout().x+(a-m(t,n))*e;t.setLayout({x:i},!0)}else{var r=t.getLayout().y+(a-m(t,n))*e;t.setLayout({y:r},!0)}}})})}function p(t,e){return m(t.node2,e)*t.getValue()}function f(t,e){return m(t.node2,e)}function v(t,e){return m(t.node1,e)*t.getValue()}function x(t,e){return m(t.node1,e)}function m(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function L(t){return t.getValue()}function V(t,e,n){for(var a=0,o=t.length,i=-1;++i<o;){var r=+e(t[i],n);isNaN(r)||(a+=r)}return a}function b(t,e,n){l.each(t,function(t){l.each(t,function(t){if(t.inEdges.length){var a=V(t.inEdges,v,n)/V(t.inEdges,L);if(isNaN(a)){var o=t.inEdges.length;a=o?V(t.inEdges,x,n)/o:0}if("vertical"===n){var i=t.getLayout().x+(a-m(t,n))*e;t.setLayout({x:i},!0)}else{var r=t.getLayout().y+(a-m(t,n))*e;t.setLayout({y:r},!0)}}})})}var I=n(16928),S=(0,u.O9)(o.n,function(t){t.eachSeriesByType(o.n,function(t){var e=t.getGraph(),n=e.nodes,a=e.edges;if(n.length){var o=1/0,i=-1/0;l.each(n,function(t){var e=t.getLayout().value;e<o&&(o=e),e>i&&(i=e)}),l.each(n,function(e){var n=new I.A({type:"color",mappingMethod:"linear",dataExtent:[o,i],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),a=e.getModel().get(["itemStyle","color"]);null!=a?(e.setVisual("color",a),e.setVisual("style",{fill:a})):(e.setVisual("color",n),e.setVisual("style",{fill:n}))})}a.length&&l.each(a,function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)})})});function w(t){t.registerChartView(a.A),t.registerSeriesModel(o.A),t.registerLayout(d),t.registerVisual(S),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,e){e.eachComponent({mainType:i.t7,subType:o.n,query:t},function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])})}),(0,r.Bs)(t,i.t7,o.n)}},16928:function(t,e,n){n(44114),n(26910);var a=n(52577),o=n(85767),i=n(88877),r=a.each,l=a.isObject,u=-1,s=function(){function t(e){var n=e.mappingMethod,o=e.type,i=this.option=a.clone(e);this.type=o,this.mappingMethod=n,this._normalizeData=m[n];var l=t.visualHandlers[o];this.applyVisual=l.applyVisual,this.getColorMapper=l.getColorMapper,this._normalizedToVisual=l._normalizedToVisual[n],"piecewise"===n?(c(i),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,a.each(e,function(e,n){e.originIndex=n,null!=e.visual&&(t.hasSpecialVisual=!0)})}(i)):"category"===n?i.categories?function(t){var e=t.categories,n=t.categoryMap={},o=t.visual;if(r(e,function(t,e){n[t]=e}),!a.isArray(o)){var i=[];a.isObject(o)?r(o,function(t,e){var a=n[e];i[null!=a?a:u]=t}):i[-1]=o,o=x(t,i)}for(var l=e.length-1;l>=0;l--)null==o[l]&&(delete n[e[l]],e.pop())}(i):c(i,!0):(a.assert("linear"!==n||i.dataExtent),c(i))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return a.bind(this._normalizeData,this)},t.listVisualTypes=function(){return a.keys(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){a.isObject(t)?a.each(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,o){var i,r=a.isArray(e)?[]:a.isObject(e)?{}:(i=!0,null);return t.eachVisual(e,function(t,e){var a=n.call(o,t,e);i?r=a:r[e]=a}),r},t.retrieveVisuals=function(e){var n,a={};return e&&r(t.visualHandlers,function(t,o){e.hasOwnProperty(o)&&(a[o]=e[o],n=!0)}),n?a:null},t.prepareVisualTypes=function(t){if(a.isArray(t))t=t.slice();else{if(!l(t))return[];var e=[];r(t,function(t,n){e.push(n)}),t=e}return t.sort(function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1}),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var o,i=1/0,r=0,l=e.length;r<l;r++){var u=e[r].value;if(null!=u){if(u===t||a.isString(u)&&u===t+"")return r;n&&g(u,r)}}for(r=0,l=e.length;r<l;r++){var s=e[r],c=s.interval,d=s.close;if(c){if(c[0]===-1/0){if(L(d[1],t,c[1]))return r}else if(c[1]===1/0){if(L(d[0],c[0],t))return r}else if(L(d[0],c[0],t)&&L(d[1],t,c[1]))return r;n&&g(c[0],r),n&&g(c[1],r)}}if(n)return t===1/0?e.length-1:t===-1/0?0:o;function g(e,n){var a=Math.abs(e-t);a<i&&(i=a,o=n)}},t.visualHandlers={color:{applyVisual:h("color"),getColorMapper:function(){var t=this.option;return a.bind("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),y.call(this,t)}:function(e,n,a){var i=!!a;return!n&&(e=this._normalizeData(e)),a=o.fastLerp(e,t.parsedVisual,a),i?a:o.stringify(a,"rgba")},this)},_normalizedToVisual:{linear:function(t){return o.stringify(o.fastLerp(t,this.option.parsedVisual),"rgba")},category:y,piecewise:function(t,e){var n=v.call(this,e);return null==n&&(n=o.stringify(o.fastLerp(t,this.option.parsedVisual),"rgba")),n},fixed:p}},colorHue:d(function(t,e){return o.modifyHSL(t,e)}),colorSaturation:d(function(t,e){return o.modifyHSL(t,null,e)}),colorLightness:d(function(t,e){return o.modifyHSL(t,null,null,e)}),colorAlpha:d(function(t,e){return o.modifyAlpha(t,e)}),decal:{applyVisual:h("decal"),_normalizedToVisual:{linear:null,category:y,piecewise:null,fixed:null}},opacity:{applyVisual:h("opacity"),_normalizedToVisual:f([0,1])},liftZ:{applyVisual:h("liftZ"),_normalizedToVisual:{linear:p,category:p,piecewise:p,fixed:p}},symbol:{applyVisual:function(t,e,n){n("symbol",this.mapValueToVisual(t))},_normalizedToVisual:{linear:g,category:y,piecewise:function(t,e){var n=v.call(this,e);return null==n&&(n=g.call(this,t)),n},fixed:p}},symbolSize:{applyVisual:h("symbolSize"),_normalizedToVisual:f([0,1])}},t}();function c(t,e){var n=t.visual,o=[];a.isObject(n)?r(n,function(t){o.push(t)}):null!=n&&o.push(n);e||1!==o.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(o[1]=o[0]),x(t,o)}function d(t){return{applyVisual:function(e,n,a){var o=this.mapValueToVisual(e);a("color",t(n("color"),o))},_normalizedToVisual:f([0,1])}}function g(t){var e=this.option.visual;return e[Math.round((0,i.Cb)(t,[0,1],[0,e.length-1],!0))]||{}}function h(t){return function(e,n,a){a(t,this.mapValueToVisual(e))}}function y(t){var e=this.option.visual;return e[this.option.loop&&t!==u?t%e.length:t]}function p(){return this.option.visual[0]}function f(t){return{linear:function(e){return(0,i.Cb)(e,t,this.option.visual,!0)},category:y,piecewise:function(e,n){var a=v.call(this,n);return null==a&&(a=(0,i.Cb)(e,t,this.option.visual,!0)),a},fixed:p}}function v(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var a=n[s.findPieceIndex(t,n)];if(a&&a.visual)return a.visual[this.type]}}function x(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=a.map(e,function(t){var e=o.parse(t);return e||[0,0,0,1]})),e}var m={linear:function(t){return(0,i.Cb)(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=s.findPieceIndex(t,e,!0);if(null!=n)return(0,i.Cb)(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?u:e},fixed:a.noop};function L(t,e,n){return t?e<=n:e<n}e.A=s}}]);