From 6097e108f9b1f053deeb8e404841d768c03d3735 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Mon, 17 Feb 2014 22:57:49 +0900 Subject: [PATCH] Fix tooltip position when size and padding specified - #27 --- c3.js | 27 +++++++--- c3.min.js | 156 +++++++++++++++++++++++++++--------------------------- 2 files changed, 97 insertions(+), 86 deletions(-) diff --git a/c3.js b/c3.js index 053cabc..5bba912 100644 --- a/c3.js +++ b/c3.js @@ -818,22 +818,33 @@ //-- Tooltip --// function showTooltip(selectedData, mouse) { + var tWidth, tHeight; + var svgLeft, tooltipLeft, tooltipRight, tooltipTop, chartRight; // Construct tooltip tooltip.html(__tooltip_contents(selectedData)) .style("visibility", "hidden") .style("display", "block"); // Get tooltip dimensions - var tWidth = tooltip.property('offsetWidth'), - tHeight = tooltip.property('offsetHeight'); + tWidth = tooltip.property('offsetWidth'); + tHeight = tooltip.property('offsetHeight'); + // Determin tooltip position + if (__axis_rotated) { + tooltipLeft = mouse[0]; + } else { + svgLeft = svg.property('offsetLeft'); + tooltipLeft = svgLeft + getCurrentPaddingLeft() + x(selectedData[0].x) + 20; + tooltipRight = tooltipLeft + tWidth; + chartRight = svgLeft + getCurrentWidth() - getCurrentPaddingRight(); + if (tooltipRight > chartRight) { + tooltipLeft -= tWidth + 30; + } + } + tooltipTop = mouse[1] + 15 + tHeight < getCurrentHeight() ? mouse[1] + 15 : mouse[1] - tHeight; // Set tooltip // todo get rid of magic numbers tooltip - .style("top", (mouse[1] + 15 + tHeight < getCurrentHeight() ? mouse[1] + 15 : mouse[1] - tHeight) + "px") - .style("left", ((__axis_rotated ? - mouse[0] : - (x(selectedData[0].x) + 60 + tWidth < getCurrentWidth()) ? - (x(selectedData[0].x) + 60) + "px" : (x(selectedData[0].x) - tWidth + 30) + "px" - ))) + .style("top", tooltipTop + "px") + .style("left", tooltipLeft + 'px') .style("visibility", "visible"); } function hideTooltip() { diff --git a/c3.min.js b/c3.min.js index 34bfe68..294ded3 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,84 +1,84 @@ -(function(N){function jd(){function q(d,e){d.attr("transform",function(d){return"translate("+(e(d)+ba)+", 0)"})}function t(d,e){d.attr("transform",function(d){return"translate(0,"+e(d)+")"})}function N(d){var e=d[0];d=d[d.length-1];return ea?0:a}function qc(a){return qa&&a===qa||Z&&Ed(Z,a)}function Fd(a){return!qc(a)}function Gd(a){Object.keys(a).forEach(function(b){Z[b]=a[b]})}function lb(a){var b;a&&(b=La[a.id],a.name=b?b:a.id);return a}function rc(a){var b=a[0],c={},f=[],l,d;for(l=1;lb&&(c=a,b=a.values.length)}):c=a?g.data.targets[0]:null;return c}function mb(a){a=t(a)?g.data.targets:a;return a.map(function(a){return a.id})}function uc(a){var b=mb(),c;for(c=0;ca?0:a}function qc(a){return qa&&a===qa||Z&&Ed(Z,a)}function Fd(a){return!qc(a)}function Gd(a){Object.keys(a).forEach(function(b){Z[b]=a[b]})}function pb(a){var b;a&&(b=La[a.id],a.name=b?b:a.id);return a}function rc(a){var b=a[0],c={},f=[],k,d;for(k=1;kb&&(c=a,b=a.values.length)}):c=a?g.data.targets[0]:null;return c}function qb(a){a=v(a)?g.data.targets:a;return a.map(function(a){return a.id})}function uc(a){var b=qb(),c;for(c=0;cv[c].indexOf(l.id)))for(f=0;f -b?a-b:0};return function(a){var d=b?L(a.id):x(a.id);return c(d(a.value))}}function Pa(a,b){var c=t(a)?mb():a;"string"===typeof c&&(c=[c]);for(var f=0;f=e;e+=s)g+=f(a[d-1],a[d],e,m)}return g}function Lb(a){var b;nb=d.select(va);if(nb.empty())N.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{nb.html("");g.data.x= -{};g.data.targets=Ma(a);ta();Q();n.domain(d.extent(jb(g.data.targets)));y.domain(hb("y"));X.domain(hb("y2"));T.domain(n.domain());cb.domain(y.domain());db.domain(X.domain());H.ticks(10>a.length?a.length:10);oa.ticks(Vd).outerTickSize(0).tickFormat(Wd);eb.ticks(Xd).outerTickSize(0).tickFormat(Yd);U=n.domain();I.x(T);ra&&E.x(n);p=d.select(va).append("svg").attr("width",r+G+da).attr("height",s+u+M).on("mouseenter",Zd).on("mouseleave",$d);ob=p.append("defs");ob.append("clipPath").attr("id",Mb).append("rect").attr("y", -u).attr("width",r).attr("height",s-u);ob.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1-G).attr("y",-20).attr("width",K).attr("height",ca);ob.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-G+1).attr("y",u-1).attr("width",ja).attr("height",sb);k=p.append("g").attr("transform",J.main);z=ya?p.append("g").attr("transform",J.context):null;za=Aa?p.append("g").attr("transform",J.legend):null;V=d.select(va).style("position","relative").append("div").style("position", -"absolute").style("z-index","10").style("display","none");k.append("g").attr("class","x axis").attr("clip-path",h?"":"url(#xaxis-clip)").attr("transform",J.x).call(h?oa:H).append("text").attr("class","-axis-x-label").attr("x",r).attr("dy","-.5em").style("text-anchor","end").text(ae);k.append("g").attr("class","y axis").attr("clip-path",h?"url(#yaxis-clip)":"").call(h?H:oa).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(be);dc&& -k.append("g").attr("class","y2 axis").attr("transform",J.y2).call(eb);a=k.append("g").attr("clip-path",Ra).attr("class","grid");Wc&&a.append("g").attr("class","xgrids");Nb&&(b=a.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(Nb).enter().append("g").attr("class","xgrid-line"),b.append("line").attr("class",function(a){return""+a["class"]}),b.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",h?"":"rotate(-90)").attr("dx",h? -0:-u).attr("dy",-6).text(function(a){return a.text}));ce&&a.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",h?0:-10).attr("x2",h?r:-10).attr("y1",h?-10:u).attr("y2",h?-10:s);Xc&&a.append("g").attr("class","ygrids");Ob&&a.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(Ob).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});k.append("g").attr("clip-path",Ra).attr("class","regions");k.append("g").attr("clip-path", -Ra).attr("class","chart");k.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",ra?"ew-resize":null);k.select(".chart").append("g").attr("class","chart-bars");k.select(".chart").append("g").attr("class","chart-lines");k.select(".chart").append("g").attr("class","chart-arcs").attr("transform",J.arc);if(ra)k.insert("rect",de?null:"g.grid").attr("class","zoom-rect").attr("width",r).attr("height",s).style("opacity",0).style("cursor","ew-resize").call(E).on("dblclick.zoom", -null);null!==pb&&I.extent("function"!==typeof pb?pb:pb(jb()));ya&&(z.append("g").attr("clip-path",Ra).attr("class","chart"),z.select(".chart").append("g").attr("class","chart-bars"),z.select(".chart").append("g").attr("class","chart-lines"),z.append("g").attr("clip-path",Ra).attr("class","x brush").call(I).selectAll("rect").attr("height",na),z.append("g").attr("class","x axis").attr("transform",J.subx).call(Fa));Aa&&qb(g.data.targets);Yc(g.data.targets);F({withTransition:!1,withUpdateXDomain:!0}); -if(ee){if(A&&"string"===typeof Ba){Ba=pa(Ba);for(a=0;aDb(c,a)?p.select(".event-rect").style("cursor","pointer"):p.select(".event-rect").style("cursor",null))}).on("click",function(){var a,c;B(g.data.targets)||(a=d.mouse(this),c=Dc(g.data.targets,a),100>Db(c,a)&&k.select(".-circles-"+c.id).select(".-circle-"+c.index).each(function(){$c(this,c,c.index)}))}).call(d.behavior.drag().origin(Object).on("drag",function(){ad(d.mouse(this))}).on("dragstart", -function(){bd(d.mouse(this))}).on("dragend",function(){cd()})).call(E).on("dblclick.zoom",null)}function $c(a,b,c){var f=d.select(a),e=f.classed(ia),g=!1,h;"circle"===a.nodeName?(g=Oc(a,1.5*Qa),h=Rc):"rect"===a.nodeName&&(g=Pc(a),h=Tc);if(sa||g)ga&&ha(b)&&(f.classed(ia,!e),h(!e,f,b,c)),je(b,f)}function ad(a){var b,c,f,e,h,n,m;B(g.data.targets)||!ga||ra&&!E.altDomain||(b=Sb[0],c=Sb[1],f=a[0],a=a[1],e=Math.min(b,f),h=Math.max(b,f),n=sa?u:Math.min(c,a),m=sa?s:Math.max(c,a),k.select(".dragarea").attr("x", -e).attr("y",n).attr("width",h-e).attr("height",m-n),k.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return ha(a)}).each(function(a,b){var c=d.select(this),f=c.classed(ia),g=c.classed(Tb),k,p,q,r;k=!1;"circle"===this.nodeName?(k=1*c.attr("cx"),p=1*c.attr("cy"),r=Rc,k=ek&&(d-=c+30));c=b[1]+ +15+fr[c].indexOf(k.id)))for(f=0;fb?a-b:0};return function(a){var d=b?L(a.id):x(a.id);return c(d(a.value))}}function Pa(a,b){var c=v(a)?qb():a;"string"===typeof c&&(c=[c]);for(var f=0;f=e;e+=t)g+=f(a[d-1],a[d],e,m)}return g}function Ob(a){var b;rb=d.select(va);if(rb.empty())N.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".'); +else{rb.html("");g.data.x={};g.data.targets=Ma(a);ta();Q();n.domain(d.extent(nb(g.data.targets)));y.domain(lb("y"));X.domain(lb("y2"));T.domain(n.domain());gb.domain(y.domain());hb.domain(X.domain());H.ticks(10>a.length?a.length:10);oa.ticks(Vd).outerTickSize(0).tickFormat(Wd);ib.ticks(Xd).outerTickSize(0).tickFormat(Yd);U=n.domain();I.x(T);ra&&E.x(n);q=d.select(va).append("svg").attr("width",p+G+da).attr("height",t+u+M).on("mouseenter",Zd).on("mouseleave",$d);sb=q.append("defs");sb.append("clipPath").attr("id", +Pb).append("rect").attr("y",u).attr("width",p).attr("height",t-u);sb.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1-G).attr("y",-20).attr("width",K).attr("height",ca);sb.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-G+1).attr("y",u-1).attr("width",ja).attr("height",wb);l=q.append("g").attr("transform",J.main);z=ya?q.append("g").attr("transform",J.context):null;za=Aa?q.append("g").attr("transform",J.legend):null;V=d.select(va).style("position","relative").append("div").style("position", +"absolute").style("z-index","10").style("display","none");l.append("g").attr("class","x axis").attr("clip-path",h?"":"url(#xaxis-clip)").attr("transform",J.x).call(h?oa:H).append("text").attr("class","-axis-x-label").attr("x",p).attr("dy","-.5em").style("text-anchor","end").text(ae);l.append("g").attr("class","y axis").attr("clip-path",h?"url(#yaxis-clip)":"").call(h?H:oa).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(be);yb&& +l.append("g").attr("class","y2 axis").attr("transform",J.y2).call(ib);a=l.append("g").attr("clip-path",Ra).attr("class","grid");Wc&&a.append("g").attr("class","xgrids");Qb&&(b=a.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(Qb).enter().append("g").attr("class","xgrid-line"),b.append("line").attr("class",function(a){return""+a["class"]}),b.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",h?"":"rotate(-90)").attr("dx",h? +0:-u).attr("dy",-6).text(function(a){return a.text}));ce&&a.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",h?0:-10).attr("x2",h?p:-10).attr("y1",h?-10:u).attr("y2",h?-10:t);Xc&&a.append("g").attr("class","ygrids");Rb&&a.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(Rb).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});l.append("g").attr("clip-path",Ra).attr("class","regions");l.append("g").attr("clip-path", +Ra).attr("class","chart");l.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",ra?"ew-resize":null);l.select(".chart").append("g").attr("class","chart-bars");l.select(".chart").append("g").attr("class","chart-lines");l.select(".chart").append("g").attr("class","chart-arcs").attr("transform",J.arc);if(ra)l.insert("rect",de?null:"g.grid").attr("class","zoom-rect").attr("width",p).attr("height",t).style("opacity",0).style("cursor","ew-resize").call(E).on("dblclick.zoom", +null);null!==tb&&I.extent("function"!==typeof tb?tb:tb(nb()));ya&&(z.append("g").attr("clip-path",Ra).attr("class","chart"),z.select(".chart").append("g").attr("class","chart-bars"),z.select(".chart").append("g").attr("class","chart-lines"),z.append("g").attr("clip-path",Ra).attr("class","x brush").call(I).selectAll("rect").attr("height",na),z.append("g").attr("class","x axis").attr("transform",J.subx).call(Fa));Aa&&ub(g.data.targets);Yc(g.data.targets);F({withTransition:!1,withUpdateXDomain:!0}); +if(ee){if(A&&"string"===typeof Ba){Ba=pa(Ba);for(a=0;aGb(c,a)?q.select(".event-rect").style("cursor","pointer"):q.select(".event-rect").style("cursor",null))}).on("click",function(){var a,c;B(g.data.targets)||(a=d.mouse(this),c=Dc(g.data.targets,a),100>Gb(c,a)&&l.select(".-circles-"+c.id).select(".-circle-"+c.index).each(function(){$c(this,c,c.index)}))}).call(d.behavior.drag().origin(Object).on("drag",function(){ad(d.mouse(this))}).on("dragstart", +function(){bd(d.mouse(this))}).on("dragend",function(){cd()})).call(E).on("dblclick.zoom",null)}function $c(a,b,c){var f=d.select(a),e=f.classed(ia),g=!1,h;"circle"===a.nodeName?(g=Oc(a,1.5*Qa),h=Rc):"rect"===a.nodeName&&(g=Pc(a),h=Tc);if(sa||g)ga&&ha(b)&&(f.classed(ia,!e),h(!e,f,b,c)),je(b,f)}function ad(a){var b,c,f,e,h,n,m;B(g.data.targets)||!ga||ra&&!E.altDomain||(b=Vb[0],c=Vb[1],f=a[0],a=a[1],e=Math.min(b,f),h=Math.max(b,f),n=sa?u:Math.min(c,a),m=sa?t:Math.max(c,a),l.select(".dragarea").attr("x", +e).attr("y",n).attr("width",h-e).attr("height",m-n),l.selectAll(".-shapes").selectAll(".-shape").filter(function(a){return ha(a)}).each(function(a,b){var c=d.select(this),f=c.classed(ia),g=c.classed(Wb),l,p,s,q;l=!1;"circle"===this.nodeName?(l=1*c.attr("cx"),p=1*c.attr("cy"),q=Rc,l=e",c,d,e;for(c=0;c"+e+""+d+"");return b+""}),ee=e(["tooltip","init","show"],!1),Ba=e(["tooltip","init","x"],0),Zc=e(["tooltip","init","position"],{top:"0px",left:"50px"}),Mb=va.replace("#","")+"-clip",Ra="url(#"+Mb+")",A="timeseries"===id,Y="categorized"===id,Cb=!A&&(qa||Z),Sb=null,Sa=!1,Rb=!1,ma=Aa?40:0,O=function(a,b){var c=[],d=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" "); +function(a){return O(a.id)}));Aa&&ub(a);q.selectAll(".target").transition().style("opacity",1)}function Ta(a,b){g.data.targets.forEach(function(b){for(var d=0;d",c,d,e;for(c=0;c"+e+""+d+"");return b+""}),ee=e(["tooltip","init","show"],!1),Ba=e(["tooltip","init","x"],0),Zc=e(["tooltip","init","position"],{top:"0px",left:"50px"}),Pb=va.replace("#","")+"-clip",Ra="url(#"+Pb+")",A="timeseries"===id,Y="categorized"===id,Fb=!A&&(qa||Z),Vb=null,Sa=!1,Ub=!1,ma=Aa?40:0,O=function(a,b){var c=[],d=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" "); return function(b){if(b in a)return a[b];-1===c.indexOf(b)&&c.push(b);return d[c.indexOf(b)%d.length]}}(qe,re),qd=function(){var a=[[d.time.format("%Y/%-m/%-d"),function(){return!0}],[d.time.format("%-m/%-d"),function(a){return a.getMonth()}],[d.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[d.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[d.time.format("%I %p"),function(a){return a.getHours()}],[d.time.format("%I:%M"),function(a){return a.getMinutes()}],[d.time.format(":%S"), -function(a){return a.getSeconds()}],[d.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),$b,gc,bc,ab,fc,hc,r,s,na,tb,ua,bb,wb,fb,lc,mc,Ab,jc,kc,yb,zb,n,y,X,T,cb,db,H,oa,eb,Fa,ld=h?"left":"bottom",md=h?vb?"top":"bottom":vb?"right":"left",nd=h?ub?"bottom":"top":ub?"left":"right",od="bottom",J={main:function(){return"translate("+G+","+u+")"},context:function(){return"translate("+m+","+Ca+")"},legend:function(){return"translate("+ -Xb+","+Wb+")"},y2:function(){return"translate("+(h?0:r)+","+(h?10:0)+")"},x:function(){return"translate(0,"+s+")"},subx:function(){return"translate(0,"+na+")"},arc:function(){return"translate("+r/2+","+s/2+")"}};Ab=d.layout.pie().value(function(a){return a.values.reduce(function(a,c){return a+c.value},0)});var le=function(){var a=d.svg.line().x(h?function(a){return x(a.id)(a.value)}:xa).y(h?xa:function(a){return x(a.id)(a.value)});return function(b){var c=Hb(b.values),d;if(Eb(b))return Lc(b)?a.interpolate("cardinal"): -a.interpolate("linear"),hd[b.id]?Ud(c,n,x(b.id),hd[b.id]):a(c);d=n(c[0].x);b=x(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),me=function(){var a;a=h?d.svg.area().x0(function(a){return x(a.id)(0)}).x1(function(a){return x(a.id)(a.value)}).y(xa):d.svg.area().x(xa).y0(function(a){return x(a.id)(0)}).y1(function(a){return x(a.id)(a.value)});return function(b){var c=Hb(b.values),d;if(Ka([b],"area")||Ka([b],"area-spline"))return Lc(b)?a.interpolate("cardinal"):a.interpolate("linear"),a(c);d= -n(c[0].x);b=x(b.id)(c[0].value);return h?"M "+b+" "+d:"M "+d+" "+b}}(),ne=function(){var a=d.svg.line().x(function(a){return T(a.x)}).y(function(a){return L(a.id)(a.value)});return function(b){var c=Hb(b.values);return Eb(b)?a(c):"M "+T(c[0].x)+" "+L(b.id)(c[0].value)}}(),I=d.svg.brush().on("brush",function(){F({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}),E=d.behavior.zoom().on("zoomstart",function(){E.altDomain=d.event.sourceEvent.altKey?n.orgDomain():null}).on("zoom",ra? -oe:null);I.update=function(){z&&z.select(".x.brush").call(this);return this};E.orgScaleExtent=function(){var a=gd?gd:[1,10];return[a[0],Math.max(Ea()/a[1],a[1])]};E.updateScaleExtent=function(){var a=n.orgDomain(),a=(a[1]-a[0])/(U[1]-U[0]),b=this.orgScaleExtent();this.scaleExtent([b[0]*a,b[1]*a]);return this};var p,ob,k,z,za,V,nb,U;g.focus=function(a){var b=p.selectAll(Va(a)),c=b.filter(Ub),b=b.filter(Vb);g.defocus();c.classed("focused",!0).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity", -1);B(g.data.targets)&&Za(a,!0)};g.defocus=function(a){var b=p.selectAll(Va(a)),c=b.filter(Ub),b=b.filter(Vb);c.classed("focused",!1).transition().duration(100).style("opacity",0.3);b.transition().duration(100).style("opacity",0.3);B(g.data.targets)&&rb(a)};g.revert=function(a){var b=p.selectAll(Va(a)),c=b.filter(Ub),b=b.filter(Vb);c.classed("focused",!1).transition().duration(100).style("opacity",1);b.transition().duration(100).style("opacity",1);B(g.data.targets)&&rb(a)};g.show=function(a){p.selectAll(Va(a)).transition().style("opacity", -1)};g.hide=function(a){p.selectAll(Va(a)).transition().style("opacity",0)};g.unzoom=function(){I.clear().update();F({withUpdateXDomain:!0})};g.load=function(a){"function"!==typeof a.done&&(a.done=function(){});a.xs&&Gd(a.xs);"categories"in a&&Y&&(Ga=a.categories,H.categories(Ga));if("cacheIds"in a&&Cd(a.cacheIds))Ta(Dd(a.cacheIds),a.done);else if("data"in a)Ta(Ma(a.data),a.done);else if("url"in a)d.csv(a.url,function(b,c){Ta(Ma(c),a.done)});else if("rows"in a)Ta(Ma(rc(a.rows)),a.done);else if("columns"in -a)Ta(Ma(sc(a.columns)),a.done);else throw Error("url or rows or columns is required.");};g.unload=function(a){g.data.targets=g.data.targets.filter(function(b){return b.id!==a});p.selectAll(".target-"+a).transition().style("opacity",0).remove();Aa&&(p.selectAll(".legend-item-"+a).remove(),qb(g.data.targets));0b.classes.indexOf(a)})});return P};g.data.get=function(a){a=g.data.getAsTarget(a);return q(a)?a.values.map(function(a){return a.value}):void 0};g.data.getAsTarget=function(a){var b=ib(function(b){return b.id===a});return 0b.classes.indexOf(a)})});return P};g.data.get=function(a){a=g.data.getAsTarget(a);return s(a)?a.values.map(function(a){return a.value}):void 0};g.data.getAsTarget=function(a){var b=mb(function(b){return b.id===a});return 0