diff --git a/c3.js b/c3.js index 222bdfa..c0991a2 100644 --- a/c3.js +++ b/c3.js @@ -143,25 +143,27 @@ var legendHeight = __legend_show ? 40 : 0; - var customTimeFormat = timeFormat([ - [d3.time.format("%Y/%-m/%-d"), function() { return true }], - [d3.time.format("%-m/%-d"), function(d) { return d.getMonth() }], - [d3.time.format("%-m/%-d"), function(d) { return d.getDate() != 1 }], - [d3.time.format("%-m/%-d"), function(d) { return d.getDay() && d.getDate() != 1 }], - [d3.time.format("%I %p"), function(d) { return d.getHours() }], - [d3.time.format("%I:%M"), function(d) { return d.getMinutes() }], - [d3.time.format(":%S"), function(d) { return d.getSeconds() }], - [d3.time.format(".%L"), function(d) { return d.getMilliseconds() }] - ]); - function timeFormat(formats) { + var parseDate = d3.time.format(__data_x_format).parse; + + var color = generateColor(__data_colors, __color_pattern); + + var customTimeFormat = (function () { + var formats = [ + [d3.time.format("%Y/%-m/%-d"), function() { return true }], + [d3.time.format("%-m/%-d"), function(d) { return d.getMonth() }], + [d3.time.format("%-m/%-d"), function(d) { return d.getDate() != 1 }], + [d3.time.format("%-m/%-d"), function(d) { return d.getDay() && d.getDate() != 1 }], + [d3.time.format("%I %p"), function(d) { return d.getHours() }], + [d3.time.format("%I:%M"), function(d) { return d.getMinutes() }], + [d3.time.format(":%S"), function(d) { return d.getSeconds() }], + [d3.time.format(".%L"), function(d) { return d.getMilliseconds() }] + ]; return function(date) { var i = formats.length - 1, f = formats[i]; while (!f[1](date)) f = formats[--i]; return f[0](date); }; - } - - var parseDate = d3.time.format(__data_x_format).parse; + })(); /*-- Set Chart Params --*/ @@ -173,6 +175,19 @@ y2Orient = __axis_rotated ? (__axis_y2_inner ? "bottom" : "top") : (__axis_y2_inner ? "left" : "right"), subXOrient = "bottom"; + var translate = { + main : function () { return "translate(" + margin.left + "," + margin.top + ")" }, + context : function () { return "translate(" + margin2.left + "," + margin2.top + ")" }, + legend : function () { return "translate(" + margin3.left + "," + margin3.top + ")" }, + y2 : function () { return "translate(" + (__axis_rotated ? 0 : width) + "," + (__axis_rotated ? 10 : 0) + ")" }, + x : function () { return "translate(0," + height + ")" }, + subx : function () { return "translate(0," + height2 + ")" } + } + + /*-- Define Functions --*/ + + //-- Sizes --// + function updateSizes () { currentWidth = getCurrentWidth(); currentHeight = getCurrentHeight(); @@ -190,7 +205,21 @@ height2 = currentHeight - margin2.top - margin2.bottom; height3 = currentHeight - margin3.top - margin3.bottom; } - updateSizes(); + function getCurrentWidth () { + return __size_width === null ? getParentWidth() : __size_width; + } + function getCurrentHeight () { + var h = __size_height === null ? getParentHeight() : __size_height; + return h > 0 ? h : 320; + } + function getParentWidth () { + return +d3.select(__bindto).style("width").replace('px',''); // TODO: if rotated, use height + } + function getParentHeight () { + return +d3.select(__bindto).style('height').replace('px',''); // TODO: if rotated, use width + } + + //-- Scales --// function updateScales () { // update edges @@ -205,126 +234,12 @@ subX = getX(0, width, isDefined(orgXDomain) ? orgXDomain : undefined, function(d){ return d % 1 === 0 ? subXAxis.tickOffset() : 0 }); subY = getY(height2, 10); subY2 = getY(height2, 10); - // update axies + // update axes xAxis = getXAxis(x, xOrient); yAxis = getYAxis(y, yOrient); yAxis2 = getYAxis(y2, y2Orient); subXAxis = getXAxis(subX, subXOrient); }; - updateScales(); - - var translate = { - main : function () { return "translate(" + margin.left + "," + margin.top + ")" }, - context : function () { return "translate(" + margin2.left + "," + margin2.top + ")" }, - legend : function () { return "translate(" + margin3.left + "," + margin3.top + ")" }, - y2 : function () { return "translate(" + (__axis_rotated ? 0 : width) + "," + (__axis_rotated ? 10 : 0) + ")" }, - x : function () { return "translate(0," + height + ")" }, - subx : function () { return "translate(0," + height2 + ")" } - } - - // For main region - var lineOnMain = (function () { - var line = d3.svg.line() - .x(__axis_rotated ? function(d){ return getYScale(d.id)(d.value); } : xx) - .y(__axis_rotated ? xx : function(d){ return getYScale(d.id)(d.value); }); - return function (d) { - var x0, y0; - if (isLineType(d)) { - isSplineType(d) ? line.interpolate("cardinal") : line.interpolate("linear"); - return Object.keys(__data_regions).length > 0 ? lineWithRegions(d.values, x, getYScale(d.id), __data_regions[d.id]) : line(d.values); - } else { - x0 = x(d.values[0].x); - y0 = getYScale(d.id)(d.values[0].value); - return __axis_rotated ? "M "+y0+" "+x0 : "M "+x0+" "+y0; - } - }; - })(); - - // For brush region - var lineOnSub = (function () { - var line = d3.svg.line() - .x(function(d){ return subX(d.x) }) - .y(function(d){ return getSubYScale(d.id)(d.value) }); - return function (d) { - return isLineType(d) ? line(d.values) : "M " + subX(d.values[0].x)+ " " + getSubYScale(d.id)(d.values[0].value); - }; - })(); - - // Define color - var color = generateColor(__data_colors, __color_pattern); - - // Define svgs - var svg = d3.select(__bindto).append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom); - - // Define defs - var defs = svg.append("defs"); - - defs.append("clipPath") - .attr("id", clipId) - .append("rect") - .attr("y", margin.top) - .attr("width", width) - .attr("height", height-margin.top); - - defs.append("clipPath") - .attr("id", "xaxis-clip") - .append("rect") - .attr("x", -1) - .attr("y", -1) - .attr("width", width + 2) - .attr("height", 40); - - defs.append("clipPath") - .attr("id", "yaxis-clip") - .append("rect") - .attr("x", -margin.left + 1) - .attr("y", margin.top - 1) - .attr("width", margin.left) - .attr("height", height - margin.top + 2); - - // Define regions - var main = svg.append("g") - .attr("transform", translate.main); - var context = null; - if (__subchart_show) { - context = svg.append("g") - .attr("transform", translate.context); - } - var legend = null; - if (__legend_show) { - legend = svg.append("g") - .attr("transform", translate.legend); - } - - // Define tooltip - var tooltip = d3.select(__bindto) - .style("position", "relative") - .append("div") - .style("position", "absolute") - .style("width", "30%") // TODO: cul actual width when show - .style("z-index", "10") - .style("visibility", "hidden"); - - /*-- Define Functions --*/ - - function getCurrentWidth () { - return __size_width === null ? getParentWidth() : __size_width; - } - function getCurrentHeight () { - var h = __size_height === null ? getParentHeight() : __size_height; - return h > 0 ? h : 320; - } - function getParentWidth () { - return +d3.select(__bindto).style("width").replace('px',''); // TODO: if rotated, use height - } - function getParentHeight () { - return +d3.select(__bindto).style('height').replace('px',''); // TODO: if rotated, use width - } - - //-- Scale --// - function getX (min, max, domain, offset) { var scale = ((isTimeSeries) ? d3.time.scale() : d3.scale.linear()).range([min, max]); // Set function and values for c3 @@ -362,7 +277,7 @@ return getAxisId(id) === 'y2' ? subY2 : subY; } - //-- Axis --// + //-- Axes --// function getXAxis (scale, orient) { var axis = (isCategorized ? categoryAxis() : d3.svg.axis()).scale(scale).orient(orient); @@ -778,6 +693,34 @@ //-- Shape --// + // For main region + var lineOnMain = (function () { + var line = d3.svg.line() + .x(__axis_rotated ? function(d){ return getYScale(d.id)(d.value); } : xx) + .y(__axis_rotated ? xx : function(d){ return getYScale(d.id)(d.value); }); + return function (d) { + var x0, y0; + if (isLineType(d)) { + isSplineType(d) ? line.interpolate("cardinal") : line.interpolate("linear"); + return Object.keys(__data_regions).length > 0 ? lineWithRegions(d.values, x, getYScale(d.id), __data_regions[d.id]) : line(d.values); + } else { + x0 = x(d.values[0].x); + y0 = getYScale(d.id)(d.values[0].value); + return __axis_rotated ? "M "+y0+" "+x0 : "M "+x0+" "+y0; + } + }; + })(); + + // For brush region + var lineOnSub = (function () { + var line = d3.svg.line() + .x(function(d){ return subX(d.x) }) + .y(function(d){ return getSubYScale(d.id)(d.value) }); + return function (d) { + return isLineType(d) ? line(d.values) : "M " + subX(d.values[0].x)+ " " + getSubYScale(d.id)(d.values[0].value); + }; + })(); + function lineWithRegions (d, x, y, _regions) { var prev = -1, i, j; var s = "M", sWithRegion; @@ -847,18 +790,18 @@ return s; } - /*-- Define brush --*/ + //-- Define brush/zoom -// var brush = d3.svg.brush().on("brush", redrawForBrush); var zoom = d3.behavior.zoom().on("zoom", __zoom_enabled ? redrawForZoom : null); /*-- Draw Chart --*/ - // for brush area culculation - var firstDate = null, - lastDate = null; + // for svg elements + var svg, defs, main, context, legend, tooltip; - var orgXDomain; + // for brush area culculation + var firstDate = null, lastDate = null, orgXDomain; function init (data) { var targets = c3.data.targets = convertDataToTargets(data); @@ -868,14 +811,19 @@ // TODO: set names if names not specified + // Init sizes and scales + updateSizes(); + updateScales(); + + // Set domains for each scale x.domain(d3.extent(data.map(function(d){ return d.x; }))); y.domain(getYDomain(targets, 'y')); y2.domain(getYDomain(targets, 'y2')); - subX.domain(x.domain()); subY.domain(y.domain()); subY2.domain(y2.domain()); + // Set axes attrs xAxis.ticks(data.length < 10 ? data.length : 10); yAxis.ticks(__axis_y_ticks).outerTickSize(0).tickFormat(__axis_y_format); yAxis2.ticks(__axis_y2_ticks).outerTickSize(0).tickFormat(__axis_y2_format); @@ -883,10 +831,54 @@ // Save original x domain for zoom update orgXDomain = x.domain(); - // MEMO: must set x here for timeseries data + // Set initialized scales to brush and zoom brush.x(subX); if (__zoom_enabled) zoom.x(x); + /*-- Basic Elements --*/ + + // Define svgs + svg = d3.select(__bindto).append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom); + + // Define defs + defs = svg.append("defs"); + defs.append("clipPath") + .attr("id", clipId) + .append("rect") + .attr("y", margin.top) + .attr("width", width) + .attr("height", height-margin.top); + defs.append("clipPath") + .attr("id", "xaxis-clip") + .append("rect") + .attr("x", -1) + .attr("y", -1) + .attr("width", width + 2) + .attr("height", 40); + defs.append("clipPath") + .attr("id", "yaxis-clip") + .append("rect") + .attr("x", -margin.left + 1) + .attr("y", margin.top - 1) + .attr("width", margin.left) + .attr("height", height - margin.top + 2); + + // Define regions + main = svg.append("g").attr("transform", translate.main); + context = __subchart_show ? svg.append("g").attr("transform", translate.context) : null; + legend = __legend_show ? svg.append("g").attr("transform", translate.legend) : null; + + // Define tooltip + tooltip = d3.select(__bindto) + .style("position", "relative") + .append("div") + .style("position", "absolute") + .style("width", "30%") // TODO: cul actual width when show + .style("z-index", "10") + .style("visibility", "hidden"); + /*-- Main Region --*/ // Add Axis @@ -1387,7 +1379,7 @@ } // update subchart elements if needed if (withSubchart) { - // axies + // axes // TODO: fix when rotated context.select('.x.axis').transition().duration(__axis_rotated ? duration : 0).call(__axis_rotated ? yAxis : subXAxis); // extent rect diff --git a/c3.min.js b/c3.min.js index 6817b53..ff6190f 100644 --- a/c3.min.js +++ b/c3.min.js @@ -1,63 +1,64 @@ -(function(xb){function jc(){function l(b,h){b.attr("transform",function(b){return"translate("+(h(b)+R)+",0)"})}function s(b,h){b.attr("transform",function(b){return"translate(0,"+h(b)+")"})}function Na(b){var h=b[0];b=b[b.length-1];return ha?0:a}function aa(a){var c=Da[a.id];a.name=l(c)?c:a.id;return a}function va(a){var c=a[0],d={},m=[],f,b;for(f=1;fw[d].indexOf(f.id)))for(b=0;b=g;g+=diffx2)p+=b(a[f-1],a[f],g,t);return p}function ob(a){var c=k.data.targets=ba(a),d,b;r.domain(d3.extent(a.map(function(a){return a.x}))); -y.domain(B(c,"y"));O.domain(B(c,"y2"));U.domain(r.domain());Pa.domain(y.domain());Qa.domain(O.domain());M.ticks(10>a.length?a.length:10);ea.ticks(Ic).outerTickSize(0).tickFormat(Jc);Ra.ticks(Kc).outerTickSize(0).tickFormat(Lc);ya=r.domain();E.x(U);oa&&Ga.x(r);g.append("g").attr("class","x axis").attr("clip-path",e?"":"url(#xaxis-clip)").attr("transform",I.x).call(e?ea:M);g.append("g").attr("class","y axis").attr("clip-path",e?"url(#yaxis-clip)":"").call(e?M:ea).append("text").attr("transform","rotate(-90)").attr("dy", -"1.4em").attr("dx","-.8em").style("text-anchor","end").text(Mc);Gb&&g.append("g").attr("class","y2 axis").attr("transform",I.y2).call(Ra);if(oa)g.append("rect").attr("class","zoom-rect").attr("width",n).attr("height",u).style("opacity",0).call(Ga).on("dblclick.zoom",null);d=g.append("g").attr("clip-path",Ha).attr("class","grid");ac&&d.append("g").attr("class","xgrids");pb&&(b=d.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(pb).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",e?"":"rotate(-90)").attr("dx",e?0:-v).attr("dy",-6).text(function(a){return a.text}));Nc&&d.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",e?0:-10).attr("x2",e?n:-10).attr("y1",e?-10:v).attr("y2",e?-10:u);bc&&d.append("g").attr("class","ygrids");qb&&d.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(qb).enter().append("line").attr("class", -function(a){return"ygrid-line "+a["class"]});g.append("g").attr("clip-path",Ha).attr("class","regions");g.append("g").attr("clip-path",Ha).attr("class","chart");g.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,c){return"event-rect event-rect-"+c}).style("cursor",function(a){return Y&&ga?"pointer":null}).on("mouseover",function(a,c){if(!Ya){var d=k.data.targets.map(function(a){return aa(a.values[c])}), -b,m;if(0",b,e,f;for(b=0;b"+f+""+e+"";return c+""}),Pc=b(["tooltip","init", -"show"],!1),ra=b(["tooltip","init","x"],0),gc=b(["tooltip","init","position"],{top:"0px",left:"50px"}),vb=xa.replace("#","")+"-clip",Ha="url(#"+vb+")",D="timeseries"===ic,na="categorized"===ic,tb=null,Ya=!1,sb=!1,ca=qa?40:0,oc=function(a){return function(c){for(var b=a.length-1,e=a[b];!e[1](c);)e=a[--b];return e[0](c)}}([[d3.time.format("%Y/%-m/%-d"),function(){return!0}],[d3.time.format("%-m/%-d"),function(a){return a.getMonth()}],[d3.time.format("%-m/%-d"),function(a){return 1!=a.getDate()}],[d3.time.format("%-m/%-d"), -function(a){return a.getDay()&&1!=a.getDate()}],[d3.time.format("%I %p"),function(a){return a.getHours()}],[d3.time.format("%I:%M"),function(a){return a.getMinutes()}],[d3.time.format(":%S"),function(a){return a.getSeconds()}],[d3.time.format(".%L"),function(a){return a.getMilliseconds()}]]),fa=d3.time.format(Vc).parse,Db,Ib,Fb,Oa,Hb,Jb,n,u,da,bb,ma,Kb,Lb,eb,fb,r,y,O,U,Pa,Qa,M,ea,Ra,za,kc=e?"left":"bottom",lc=e?db?"top":"bottom":db?"right":"left",mc=e?cb?"bottom":"top":cb?"left":"right",nc="bottom"; -N();R();var I={main:function(){return"translate("+H+","+v+")"},context:function(){return"translate("+G+","+ta+")"},legend:function(){return"translate("+Na+","+yb+")"},y2:function(){return"translate("+(e?0:n)+","+(e?10:0)+")"},x:function(){return"translate(0,"+u+")"},subx:function(){return"translate(0,"+da+")"}},Rc=function(){var a=d3.svg.line().x(e?function(a){return h(a.id)(a.value)}:Xa).y(e?Xa:function(a){return h(a.id)(a.value)});return function(c){var b;if(mb(c))return"spline"===X["string"=== -typeof c?c:c.id]?a.interpolate("cardinal"):a.interpolate("linear"),0b.classes.indexOf(a)})});return J};k.data.get=function(a){a= -k.data.getAsTarget(a);return l(a)?a.values.map(function(a){return a.value}):void 0};k.data.getAsTarget=function(a){var b=Sa(function(b){return b.id==a});return 0a?0:a}function ba(a){var c=Da[a.id];a.name=l(c)?c:a.id;return a}function va(a){var c=a[0],d={},m=[],f,b;for(f=1;fw[d].indexOf(f.id)))for(b=0;b=g;g+=diffx2)p+=b(a[f-1],a[f],g,t);return p}function pb(a){var c=k.data.targets=ca(a),d,b;N();R();r.domain(d3.extent(a.map(function(a){return a.x}))); +y.domain(B(c,"y"));O.domain(B(c,"y2"));U.domain(r.domain());Qa.domain(y.domain());Ra.domain(O.domain());M.ticks(10>a.length?a.length:10);fa.ticks(Ic).outerTickSize(0).tickFormat(Jc);Sa.ticks(Kc).outerTickSize(0).tickFormat(Lc);ya=r.domain();E.x(U);oa&&Ga.x(r);Ha=d3.select(xa).append("svg").attr("width",n+H+C).attr("height",u+v+T);Za=Ha.append("defs");Za.append("clipPath").attr("id",qb).append("rect").attr("y",v).attr("width",n).attr("height",u-v);Za.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x", +-1).attr("y",-1).attr("width",n+2).attr("height",40);Za.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-H+1).attr("y",v-1).attr("width",H).attr("height",u-v+2);g=Ha.append("g").attr("transform",I.main);x=pa?Ha.append("g").attr("transform",I.context):null;qa=ra?Ha.append("g").attr("transform",I.legend):null;Y=d3.select(xa).style("position","relative").append("div").style("position","absolute").style("width","30%").style("z-index","10").style("visibility","hidden");g.append("g").attr("class", +"x axis").attr("clip-path",e?"":"url(#xaxis-clip)").attr("transform",I.x).call(e?fa:M);g.append("g").attr("class","y axis").attr("clip-path",e?"url(#yaxis-clip)":"").call(e?M:fa).append("text").attr("transform","rotate(-90)").attr("dy","1.4em").attr("dx","-.8em").style("text-anchor","end").text(Mc);Gb&&g.append("g").attr("class","y2 axis").attr("transform",I.y2).call(Sa);if(oa)g.append("rect").attr("class","zoom-rect").attr("width",n).attr("height",u).style("opacity",0).call(Ga).on("dblclick.zoom", +null);d=g.append("g").attr("clip-path",Ia).attr("class","grid");ac&&d.append("g").attr("class","xgrids");rb&&(b=d.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(rb).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",e?"":"rotate(-90)").attr("dx",e?0:-v).attr("dy",-6).text(function(a){return a.text}));Nc&&d.append("g").attr("class", +"xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",e?0:-10).attr("x2",e?n:-10).attr("y1",e?-10:v).attr("y2",e?-10:u);bc&&d.append("g").attr("class","ygrids");sb&&d.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(sb).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});g.append("g").attr("clip-path",Ia).attr("class","regions");g.append("g").attr("clip-path",Ia).attr("class","chart");g.select(".chart").append("g").attr("class","event-rects").style("fill-opacity", +0).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,c){return"event-rect event-rect-"+c}).style("cursor",function(a){return Z&&ha?"pointer":null}).on("mouseover",function(a,c){if(!$a){var d=k.data.targets.map(function(a){return ba(a.values[c])}),b,m;if(0",b,e,f;for(b=0;b"+f+""+e+"";return c+""}),Pc=b(["tooltip","init","show"],!1),sa=b(["tooltip","init","x"],0),gc=b(["tooltip","init","position"],{top:"0px",left:"50px"}),qb=xa.replace("#","")+"-clip",Ia="url(#"+qb+")",D="timeseries"===ic,na="categorized"=== +ic,vb=null,$a=!1,ub=!1,da=ra?40:0,ga=d3.time.format(Vc).parse,P=function(a,c){var b=[],e=null!==c?c:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");return function(c){if(c in a)return a[c];0<=b.indexOf(c)||b.push(c);return e[b.indexOf(c)%e.length]}}(Wc,Xc),oc=function(){var a=[[d3.time.format("%Y/%-m/%-d"),function(){return!0}],[d3.time.format("%-m/%-d"),function(a){return a.getMonth()}],[d3.time.format("%-m/%-d"),function(a){return 1!=a.getDate()}],[d3.time.format("%-m/%-d"), +function(a){return a.getDay()&&1!=a.getDate()}],[d3.time.format("%I %p"),function(a){return a.getHours()}],[d3.time.format("%I:%M"),function(a){return a.getMinutes()}],[d3.time.format(":%S"),function(a){return a.getSeconds()}],[d3.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(c){for(var b=a.length-1,e=a[b];!e[1](c);)e=a[--b];return e[0](c)}}(),Db,Ib,Fb,Pa,Hb,Jb,n,u,ea,cb,ma,Kb,Lb,fb,gb,r,y,O,U,Qa,Ra,M,fa,Sa,za,kc=e?"left":"bottom",lc=e?eb?"top":"bottom":eb?"right":"left", +mc=e?db?"bottom":"top":db?"left":"right",nc="bottom",I={main:function(){return"translate("+H+","+v+")"},context:function(){return"translate("+G+","+ta+")"},legend:function(){return"translate("+Oa+","+yb+")"},y2:function(){return"translate("+(e?0:n)+","+(e?10:0)+")"},x:function(){return"translate(0,"+u+")"},subx:function(){return"translate(0,"+ea+")"}},Rc=function(){var a=d3.svg.line().x(e?function(a){return h(a.id)(a.value)}:Ya).y(e?Ya:function(a){return h(a.id)(a.value)});return function(c){var b; +if(nb(c))return"spline"===X["string"===typeof c?c:c.id]?a.interpolate("cardinal"):a.interpolate("linear"),0b.classes.indexOf(a)})});return J};k.data.get=function(a){a=k.data.getAsTarget(a);return l(a)?a.values.map(function(a){return a.value}):void 0};k.data.getAsTarget=function(a){var b=Ta(function(b){return b.id==a});return 0