dchart-core
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -1,1 +0,1 @@ | ||
function AreaMulti(e,t){var i={xaxis:{orient:"bottom"},yaxis:{}};i=_.deepMerge(i,t),DataV.call(this,e,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");AreaMulti=DataV.extend(AreaMulti,{data:function(e){if(!e)return this._data;var t=this.options,i=t.yaxis.key;e.forEach(function(e){_.isArray(e[i])||(e[i]=[e[i]]),e[i]=_.map(e[i],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},updateBeforeRender:function(){this.beforeRender()},renderSeries:function(){var e,t=this.options,i=this.data(),a=this.getComs("axis","xaxis"),r=this.getComs("axis","yaxis"),n=t.xaxis.key,s=t.yaxis.key,o=a.getX(),u=r.getX(),l=_.maxBy(i,function(e){return e[s].length})[s].length,d=this.getComs("tooltip","tooltip"),c=t.xaxis.type,f=t.xaxis.format;d.dispatch.on("elementMouseover",function(t){closestPoint=function(t){var a=window.screen.availWidth,r=0;return i.forEach(function(i,s){var o=i.x;"time"===c&&f&&(o=d3.time.format(f).parse(i[n])),diff=Math.abs(d.layer.xScale(o)-d.layer.xScale(t.pointXValue)),diff<a&&(a=diff,r=s,e=o)}),i[r]}(t);var a=d.layer.xScale(e);d.renderGuildLayer(a),d.show(closestPoint,function(e){return{x:e[n],y:e[s].toString()}})}),this.series.datum(i),this.series.each(function(){for(var e=d3.select(this),i=0;l>i;i++){var a=d3.svg.area().x(function(e){return"time"===t.xaxis.type&&"string"==typeof e[n]?o(new Date(e[n]))+(o.rangeBand?o.rangeBand()/2:0):o(e[n])+(o.rangeBand?o.rangeBand()/2:0)}).y0(u(r.getMin())).y1(function(e){return u(e[s][i]||r.getMin())});t.interpolate&&a.interpolate(t.interpolate);var d=e.select(".serie"+(i+1));d[0][0]?d.attr({d:a}):e.append("path").attr({"class":"serie serie"+(i+1),d:a})}}),this.series.selectAll(".serie.serie"+l+" ~ .serie").remove()},updateSeries:function(){AreaMulti.prototype.renderSeries.call(this)}}),module.exports=AreaMulti; | ||
function AreaMulti(e,t){var i={xaxis:{orient:"bottom"},yaxis:{}};i=_.deepMerge(i,t),DataV.call(this,e,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");AreaMulti=DataV.extend(AreaMulti,{data:function(e){if(!e)return this._data;var t=this.options,i=t.yaxis.key;e.forEach(function(e){_.isArray(e[i])||(e[i]=[e[i]]),e[i]=_.map(e[i],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},updateBeforeRender:function(){this.beforeRender()},renderSeries:function(){var e=this.options,t=this.data(),i=this.getComs("axis","xaxis"),a=this.getComs("axis","yaxis"),r=e.xaxis.key,n=e.yaxis.key,s=i.getX(),o=a.getX(),l=_.maxBy(t,function(e){return e[n].length})[n].length;if(e.tooltip&&e.tooltip.show){var u,d=this.getComs("tooltip","tooltip"),c=e.xaxis.type,f=e.xaxis.format;d.dispatch.on("elementMouseover",function(i){closestPoint=function(e){var i=window.screen.availWidth,a=0;return t.forEach(function(t,n){var s=t.x;"time"===c&&f&&(s=d3.time.format(f).parse(t[r])),diff=Math.abs(d.layer.xScale(s)-d.layer.xScale(e.pointXValue)),diff<i&&(i=diff,a=n,u=s)}),t[a]}(i);var a=d.layer.xScale(u)+("category"===e.xaxis.type?s.rangeBand()/2:0);d.renderGuildLayer(a),d.show(closestPoint,function(e){return{x:e[r],y:e[n].toString()}})})}this.series.datum(t),this.series.each(function(){for(var t=d3.select(this),i=0;l>i;i++){var u=d3.svg.area().x(function(t){return"time"===e.xaxis.type&&"string"==typeof t[r]?s(new Date(t[r]))+(s.rangeBand?s.rangeBand()/2:0):s(t[r])+(s.rangeBand?s.rangeBand()/2:0)}).y0(o(a.getMin())).y1(function(e){return o(e[n][i]||a.getMin())});e.interpolate&&u.interpolate(e.interpolate);var d=t.select(".serie"+(i+1));d[0][0]?d.attr({d:u}):t.append("path").attr({"class":"serie serie"+(i+1),d:u})}}),this.series.selectAll(".serie.serie"+l+" ~ .serie").remove()},updateSeries:function(){AreaMulti.prototype.renderSeries.call(this)}}),module.exports=AreaMulti; |
@@ -1,1 +0,1 @@ | ||
function AreaMulti(e,t){var r={xaxis:{orient:"bottom"},yaxis:{}};r=_.deepMerge(r,t),DataV.call(this,e,r)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");AreaMulti=DataV.extend(AreaMulti,{data:function(e){if(!e)return this._data;var t=this.options,r=t.yaxis.key;e.forEach(function(e){_.isArray(e[r])||(e[r]=[e[r]]),e[r]=_.map(e[r],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},updateBeforeRender:function(){this.beforeRender()},renderSeries:function(){var e=this.options,t=this.data(),r=this.getComs("axis","xaxis"),i=this.getComs("axis","yaxis"),a=e.xaxis.key,n=e.yaxis.key,s=r.getX(),o=i.getX(),u=_.maxBy(t,function(e){return e[n].length})[n].length;this.series.datum(t),this.series.each(function(){for(var t=d3.select(this),r=0;u>r;r++){var d=d3.svg.area().x(function(t){return"time"===e.xaxis.type&&"string"==typeof t[a]?s(new Date(t[a]))+(s.rangeBand?s.rangeBand()/2:0):s(t[a])+(s.rangeBand?s.rangeBand()/2:0)}).y0(o(i.getMin())).y1(function(e){return o(e[n][r]||i.getMin())});e.interpolate&&d.interpolate(e.interpolate);var l=t.select(".serie"+(r+1));l[0][0]?l.attr({d:d}):t.append("path").attr({"class":"serie serie"+(r+1),d:d})}}),this.series.selectAll(".serie.serie"+u+" ~ .serie").remove()},updateSeries:function(){AreaMulti.prototype.renderSeries.call(this)}}),module.exports=AreaMulti; | ||
function AreaMulti(e,t){var i={xaxis:{orient:"bottom"},yaxis:{}};i=_.deepMerge(i,t),DataV.call(this,e,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");AreaMulti=DataV.extend(AreaMulti,{data:function(e){if(!e)return this._data;var t=this.options,i=t.yaxis.key;e.forEach(function(e){_.isArray(e[i])||(e[i]=[e[i]]),e[i]=_.map(e[i],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},updateBeforeRender:function(){this.beforeRender()},renderSeries:function(){var e=this.options,t=this.data(),i=this.getComs("axis","xaxis"),a=this.getComs("axis","yaxis"),r=e.xaxis.key,n=e.yaxis.key,s=i.getX(),o=a.getX(),l=_.maxBy(t,function(e){return e[n].length})[n].length;if(e.tooltip&&e.tooltip.show){var u,d=this.getComs("tooltip","tooltip"),c=e.xaxis.type,f=e.xaxis.format;d.dispatch.on("elementMouseover",function(i){closestPoint=function(e){var i=window.screen.availWidth,a=0;return t.forEach(function(t,n){var s=t.x;"time"===c&&f&&(s=d3.time.format(f).parse(t[r])),diff=Math.abs(d.layer.xScale(s)-d.layer.xScale(e.pointXValue)),diff<i&&(i=diff,a=n,u=s)}),t[a]}(i);var a=d.layer.xScale(u)+("category"===e.xaxis.type?s.rangeBand()/2:0);d.renderGuildLayer(a),d.show(closestPoint,function(e){return{x:e[r],y:e[n].toString()}})})}this.series.datum(t),this.series.each(function(){for(var t=d3.select(this),i=0;l>i;i++){var u=d3.svg.area().x(function(t){return"time"===e.xaxis.type&&"string"==typeof t[r]?s(new Date(t[r]))+(s.rangeBand?s.rangeBand()/2:0):s(t[r])+(s.rangeBand?s.rangeBand()/2:0)}).y0(o(a.getMin())).y1(function(e){return o(e[n][i]||a.getMin())});e.interpolate&&u.interpolate(e.interpolate);var d=t.select(".serie"+(i+1));d[0][0]?d.attr({d:u}):t.append("path").attr({"class":"serie serie"+(i+1),d:u})}}),this.series.selectAll(".serie.serie"+l+" ~ .serie").remove()},updateSeries:function(){AreaMulti.prototype.renderSeries.call(this)}}),module.exports=AreaMulti; |
@@ -1,1 +0,1 @@ | ||
function BarMulti(t,e){var i={xaxis:{type:"category",orient:"bottom"},groupLabel:null,yaxis:{key:"y"}};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMulti=DataV.extend(BarMulti,{data:function(t){if(!t)return this._data;var e=this.options,i=e.yaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,r=this.data(),n=i.xaxis.key,s=i.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var a=t.getX(),o=e.getX(),u=_.maxBy(r,function(t){return t[s].length})[s].length,l=t.calGroupStep(i.groupLabel||r[0][s].length),c=function(t,r,u){var c=d3.select(this);i.withAnimated&&(i.isFirst&&c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(){return o(e.getMin())},width:function(){return l.rangeBand()},height:0}),c.transition().duration(i.animatedTiming).ease(i.animatedEasing)),t[s][u]!==e.getMin()&&void 0!==t[s][u]&&c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(t){return o(t[s][u])},width:function(){return l.rangeBand()},height:function(t){return o(e.getMin())-o(t[s][u])}})||c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(){return o(e.getMin())-1},width:function(){return l.rangeBand()},height:function(){return 1}})},h=this.series.selectAll(".series-group").data(this._data),d=this.getComs("tooltip","tooltip");this.enterSeries=h.enter().append("g").attr("class","series-group");for(var f=0;u>f;f++)h.each(function(t,e){var i=d3.select(this).select(".serie"+(f+1))[0][0];i&&c.call(d3.select(this).select(".serie"+(f+1))[0][0],t,e,f)}),function(t,e){t.enterSeries.append("rect").attr("class","serie serie"+(e+1)).each(function(t,i){c.call(this,t,i,e)}).on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[n]=t[n],i[s]=t[s][e],d.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),d.hide()})}(this,f);h.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=h.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMulti.prototype.renderSeries.call(this)}}),module.exports=BarMulti; | ||
function BarMulti(t,e){var i={xaxis:{type:"category",orient:"bottom"},groupLabel:null,yaxis:{key:"y"}};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMulti=DataV.extend(BarMulti,{data:function(t){if(!t)return this._data;var e=this.options,i=e.yaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,r=this.data(),n=i.xaxis.key,s=i.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var a=t.getX(),o=e.getX(),u=_.maxBy(r,function(t){return t[s].length})[s].length,l=t.calGroupStep(i.groupLabel||r[0][s].length),c=function(t,r,u){var c=d3.select(this);i.withAnimated&&(i.isFirst&&c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(){return o(e.getMin())},width:function(){return l.rangeBand()},height:0}),c.transition().duration(i.animatedTiming).ease(i.animatedEasing)),t[s][u]!==e.getMin()&&void 0!==t[s][u]&&c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(t){return o(t[s][u])},width:function(){return l.rangeBand()},height:function(t){return o(e.getMin())-o(t[s][u])}})||c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(){return o(e.getMin())-1},width:function(){return l.rangeBand()},height:function(){return 1}})},h=this.series.selectAll(".series-group").data(this._data),d=i.tooltip&&this.getComs("tooltip","tooltip");this.enterSeries=h.enter().append("g").attr("class","series-group");for(var f=0;u>f;f++){h.each(function(t,e){var i=d3.select(this).select(".serie"+(f+1))[0][0];i&&c.call(d3.select(this).select(".serie"+(f+1))[0][0],t,e,f)});var g=this.enterSeries.append("rect").attr("class","serie serie"+(f+1)).each(function(t,e){c.call(this,t,e,f)});i.tooltip&&i.tooltip.show&&!function(t,e){t.on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[n]=t[n],i[s]=t[s][e],d.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),d.hide()})}(g,f)}h.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=h.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMulti.prototype.renderSeries.call(this)}}),module.exports=BarMulti; |
@@ -1,1 +0,1 @@ | ||
function BarMultiCustom(t,e){var a={xaxis:{type:"category",orient:"bottom"},yaxis:{min:0}};_.deepMerge(a,e),DataV.call(this,t,a)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiCustom=DataV.extend(BarMultiCustom,{data:function(t){if(!t)return this._data;var e=this.options,a=e.yaxis.key;t.forEach(function(t){_.isArray(t[a])||(t[a]=[t[a]]),t[a]=_.map(t[a],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,a=this.options,i=this.data(),s=this,n=a.xaxis.key,r=a.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var o=t.getX(),u=e.getX(),c=_.maxBy(i,function(t){return t[r].length})[r].length,l=t.calGroupStep(a.groupLabel||c),h=function(t,i,c){var h=d3.select(this);a.withAnimated&&(a.isFirst&&h.attr({d:function(t){var r=[{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())}];return"function"==typeof a.customPos?(r=a.customPos.call(s,r,i,c),_.pos2Path(r)):"function"==typeof a.customPath?a.customPath.call(s,r,c):_.pos2Path(r)}}),h.transition().duration(a.animatedTiming).ease(a.animatedEasing)),t[r][c]!==e.getMin()&&void 0!==t[r][c]&&h.attr({d:function(t){var h=[{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c),y:u(t[r][c])},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(t[r][c])},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())}];return"function"==typeof a.customPos?(h=a.customPos.call(s,h,i,c),_.pos2Path(h)):"function"==typeof a.customPath?a.customPath.call(s,h,c):_.pos2Path(h)}})||h.attr({d:function(t){var r=[{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c),y:u(e.getMin())-1},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())-1},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())}];return"function"==typeof a.customPos?(r=a.customPos.call(s,r,i,c),_.pos2Path(r)):"function"==typeof a.customPath?a.customPath.call(s,r,c):_.pos2Path(r)}})},d=this.series.selectAll(".series-group").data(this._data);this.enterSeries=d.enter().append("g").attr("class","series-group");for(var g=0;c>g;g++)d.each(function(t,e){var a=d3.select(this).select(".serie"+(g+1))[0][0];a&&h.call(d3.select(this).select(".serie"+(g+1))[0][0],t,e,g)}),this.enterSeries.append("path").attr("class","serie serie"+(g+1)).each(function(t,e){h.call(this,t,e,g)});d.selectAll(".serie.serie"+c+" ~ .serie").remove(),this.outerSeries=d.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiCustom.prototype.renderSeries.call(this)}}),module.exports=BarMultiCustom; | ||
function BarMultiCustom(t,e){var i={xaxis:{type:"category",orient:"bottom"},yaxis:{min:0}};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiCustom=DataV.extend(BarMultiCustom,{data:function(t){if(!t)return this._data;var e=this.options,i=e.yaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,s=this.data(),a=this,o=i.xaxis.key,n=i.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var r=t.getX(),u=e.getX(),l=_.maxBy(s,function(t){return t[n].length})[n].length,c=t.calGroupStep(i.groupLabel||l),h=function(t,s,l){var h=d3.select(this);i.withAnimated&&(i.isFirst&&h.attr({d:function(t){var n=[{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())}];return"function"==typeof i.customPos?(n=i.customPos.call(a,n,s,l),_.pos2Path(n)):"function"==typeof i.customPath?i.customPath.call(a,n,l):_.pos2Path(n)}}),h.transition().duration(i.animatedTiming).ease(i.animatedEasing)),t[n][l]!==e.getMin()&&void 0!==t[n][l]&&h.attr({d:function(t){var h=[{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l),y:u(t[n][l])},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(t[n][l])},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())}];return"function"==typeof i.customPos?(h=i.customPos.call(a,h,s,l),_.pos2Path(h)):"function"==typeof i.customPath?i.customPath.call(a,h,l):_.pos2Path(h)}})||h.attr({d:function(t){var n=[{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l),y:u(e.getMin())-1},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())-1},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())}];return"function"==typeof i.customPos?(n=i.customPos.call(a,n,s,l),_.pos2Path(n)):"function"==typeof i.customPath?i.customPath.call(a,n,l):_.pos2Path(n)}})},d=this.series.selectAll(".series-group").data(this._data),f=this.getComs("tooltip","tooltip");this.enterSeries=d.enter().append("g").attr("class","series-group");for(var p=0;l>p;p++){d.each(function(t,e){var i=d3.select(this).select(".serie"+(p+1))[0][0];i&&h.call(d3.select(this).select(".serie"+(p+1))[0][0],t,e,p)});var g=this.enterSeries.append("path").attr("class","serie serie"+(p+1)).each(function(t,e){h.call(this,t,e,p)});i.tooltip&&i.tooltip.show&&!function(t,e){t.on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[o]=t[o],i[n]=t[n][e],f.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),f.hide()})}(g,p)}d.selectAll(".serie.serie"+l+" ~ .serie").remove(),this.outerSeries=d.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiCustom.prototype.renderSeries.call(this)}}),module.exports=BarMultiCustom; |
@@ -1,1 +0,1 @@ | ||
function BarMultiHori(e,t){var r={xaxis:{orient:"bottom",key:"y"},yaxis:{type:"category",key:"x"}};_.deepMerge(r,t),DataV.call(this,e,r)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiHori=DataV.extend(BarMultiHori,{data:function(e){if(!e)return this._data;var t=this.options,r=t.xaxis.key;e.forEach(function(e){_.isArray(e[r])||(e[r]=[e[r]]),e[r]=_.map(e[r],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e.reverse()},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var e,t,r=this.options,i=this.data(),n=r.xaxis.key,a=r.yaxis.key;e=this.getComs("axis","xaxis"),t=this.getComs("axis","yaxis");var s=e.getX(),o=t.getX(),u=_.maxBy(i,function(e){return e[n].length})[n].length,c=((o.rangeBand()-(u-1)*r.padding)/u,t.calGroupStep(r.groupLabel||i[0][n].length)),d=function(t,i,u){var d=d3.select(this);r.withAnimated&&(r.isFirst&&d.attr({x:function(){return s(e.getMin())},y:function(e){return o(e[a])+c(""+u)},width:0,height:function(){return c.rangeBand()}}),d.transition().duration(r.animatedTiming).ease(r.animatedEasing)),t[n][u]!==e.getMin()&&void 0!==t[n][u]&&d.attr({x:function(){return s(e.getMin())},y:function(e){return o(e[a])+c(""+u)},width:function(e){return s(e[n][u])},height:function(){return c.rangeBand()}})||d.attr({x:function(){return s(e.getMin())},y:function(e){return o(e[a])+c(""+u)},width:function(){return s(e.getMin())+1},height:function(){return c.rangeBand()}})},h=this.series.selectAll(".series-group").data(this._data);this.enterSeries=h.enter().append("g").attr("class","series-group");for(var l=0;u>l;l++)h.each(function(e,t){var r=d3.select(this).select(".serie"+(l+1))[0][0];r&&d.call(d3.select(this).select(".serie"+(l+1))[0][0],e,t,l)}),this.enterSeries.append("rect").attr("class","serie serie"+(l+1)).each(function(e,t){d.call(this,e,t,l)});h.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=h.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiHori.prototype.renderSeries.call(this)}}),module.exports=BarMultiHori; | ||
function BarMultiHori(t,e){var i={xaxis:{orient:"bottom",key:"y"},yaxis:{type:"category",key:"x"}};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiHori=DataV.extend(BarMultiHori,{data:function(t){if(!t)return this._data;var e=this.options,i=e.xaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t.reverse()},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,r=this.data(),n=i.xaxis.key,s=i.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var a=t.getX(),o=e.getX(),u=_.maxBy(r,function(t){return t[n].length})[n].length,l=((o.rangeBand()-(u-1)*i.padding)/u,e.calGroupStep(i.groupLabel||r[0][n].length)),c=function(e,r,u){var c=d3.select(this);i.withAnimated&&(i.isFirst&&c.attr({x:function(){return a(t.getMin())},y:function(t){return o(t[s])+l(""+u)},width:0,height:function(){return l.rangeBand()}}),c.transition().duration(i.animatedTiming).ease(i.animatedEasing)),e[n][u]!==t.getMin()&&void 0!==e[n][u]&&c.attr({x:function(){return a(t.getMin())},y:function(t){return o(t[s])+l(""+u)},width:function(t){return a(t[n][u])},height:function(){return l.rangeBand()}})||c.attr({x:function(){return a(t.getMin())},y:function(t){return o(t[s])+l(""+u)},width:function(){return a(t.getMin())+1},height:function(){return l.rangeBand()}})},h=this.series.selectAll(".series-group").data(this._data),d=this.getComs("tooltip","tooltip");this.enterSeries=h.enter().append("g").attr("class","series-group");for(var f=0;u>f;f++){h.each(function(t,e){var i=d3.select(this).select(".serie"+(f+1))[0][0];i&&c.call(d3.select(this).select(".serie"+(f+1))[0][0],t,e,f)});var g=this.enterSeries.append("rect").attr("class","serie serie"+(f+1)).each(function(t,e){c.call(this,t,e,f)});i.tooltip&&i.tooltip.show&&!function(t,e){t.on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[s]=t[s],i[n]=t[n][e],d.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),d.hide()})}(g,f)}h.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=h.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiHori.prototype.renderSeries.call(this)}}),module.exports=BarMultiHori; |
@@ -1,1 +0,1 @@ | ||
function BarMatrix(t,e){var r={xaxis:{type:"category",orient:"bottom",padding:0},yaxis:{},matrixHeight:10};_.deepMerge(r,e),DataV.call(this,t,r)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMatrix=DataV.extend(BarMatrix,{data:function(t){if(!t)return this._data;var e=this.options,r=e.yaxis.key;t.forEach(function(t){_.isArray(t[r])||(t[r]=[t[r]]),t[r]=_.map(t[r],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,r=this.options,i=this.data();t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var a=t.getX(),n=e.getX(),s=r.yaxis.key,o=r.xaxis.key,u=_.maxBy(i,function(t){return t[s].length})[s].length,c=i.length,h=function(u,h,d){var x=d3.select(this);r.withAnimated&&(r.isFirst&&x.attr({x:function(t){return a(t[o])},y:function(t){return n(t[s][h])},width:function(e){return"category"===r.xaxis.type?a.rangeBand():h+1>=c?a(t.getMax())-a(e[o]):a(i[h+1][o])-a(e[o])},height:0}),x.transition().duration(r.animatedTiming).ease(r.animatedEasing)),u[s][d]!==e.getMin()&&void 0!==u[s][d]&&x.attr({x:function(t){return a(t[o])},y:function(t){return n(t[s][d])},width:function(e){return"category"===r.xaxis.type?a.rangeBand():h+1>=c?a(t.getMax())-a(e[o]):a(i[h+1][o])-a(e[o])},height:function(){return r.matrixHeight}})||x.attr({x:function(t){return a(t[o])},y:function(){return n(e.getMin())},width:function(e){return"category"===r.xaxis.type?a.rangeBand():h+1>=c?a(t.getMax())-a(e[o]):a(i[h+1][o])-a(e[o])},height:function(){return r.matrixHeight}})},d=this.series.selectAll(".series-group").data(this._data);this.enterSeries=d.enter().append("g").attr("class","series-group");for(var x=0;u>x;x++)d.each(function(t,e){var r=d3.select(this).select(".serie"+(x+1))[0][0];r&&h.call(d3.select(this).select(".serie"+(x+1))[0][0],t,e,x)}),this.enterSeries.append("rect").attr("class","serie serie"+(x+1)).each(function(t,e){h.call(this,t,e,x)});d.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=d.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMatrix.prototype.renderSeries.call(this)}}),module.exports=BarMatrix; | ||
function BarMatrix(t,e){var i={xaxis:{type:"category",orient:"bottom",padding:0},yaxis:{},matrixHeight:10};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMatrix=DataV.extend(BarMatrix,{data:function(t){if(!t)return this._data;var e=this.options,i=e.yaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,r=this.data();t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var a=t.getX(),n=e.getX(),s=i.yaxis.key,o=i.xaxis.key,u=_.maxBy(r,function(t){return t[s].length})[s].length,c=r.length,h=function(u,h,l){var d=d3.select(this);i.withAnimated&&(i.isFirst&&d.attr({x:function(t){return a(t[o])},y:function(t){return n(t[s][h])},width:function(e){return"category"===i.xaxis.type?a.rangeBand():h+1>=c?a(t.getMax())-a(e[o]):a(r[h+1][o])-a(e[o])},height:0}),d.transition().duration(i.animatedTiming).ease(i.animatedEasing)),u[s][l]!==e.getMin()&&void 0!==u[s][l]&&d.attr({x:function(t){return a(t[o])},y:function(t){return n(t[s][l])},width:function(e){return"category"===i.xaxis.type?a.rangeBand():h+1>=c?a(t.getMax())-a(e[o]):a(r[h+1][o])-a(e[o])},height:function(){return i.matrixHeight}})||d.attr({x:function(t){return a(t[o])},y:function(){return n(e.getMin())},width:function(e){return"category"===i.xaxis.type?a.rangeBand():h+1>=c?a(t.getMax())-a(e[o]):a(r[h+1][o])-a(e[o])},height:function(){return i.matrixHeight}})},l=this.series.selectAll(".series-group").data(this._data),d=this.getComs("tooltip","tooltip");this.enterSeries=l.enter().append("g").attr("class","series-group");for(var g=0;u>g;g++){l.each(function(t,e){var i=d3.select(this).select(".serie"+(g+1))[0][0];i&&h.call(d3.select(this).select(".serie"+(g+1))[0][0],t,e,g)});var x=this.enterSeries.append("rect").attr("class","serie serie"+(g+1)).each(function(t,e){h.call(this,t,e,g)});i.tooltip&&i.tooltip.show&&!function(t,e){t.on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[o]=t[o],i[s]=t[s][e],d.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),d.hide()})}(x,g)}l.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=l.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMatrix.prototype.renderSeries.call(this)}}),module.exports=BarMatrix; |
@@ -1,1 +0,1 @@ | ||
function BarMulti(e,t){var r={xaxis:{type:"category",orient:"bottom"},groupLabel:null,yaxis:{}};_.deepMerge(r,t),DataV.call(this,e,r)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMulti=DataV.extend(BarMulti,{data:function(e){if(!e)return this._data;var t=this.options,r=t.yaxis.key;e.forEach(function(e){_.isArray(e[r])||(e[r]=[e[r]]),e[r]=_.map(e[r],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var e,t,r=this.options,i=this.data(),n=r.xaxis.key,a=r.yaxis.key;e=this.getComs("axis","xaxis"),t=this.getComs("axis","yaxis");var s=e.getX(),u=t.getX(),o=_.maxBy(i,function(e){return e[a].length})[a].length,c=e.calGroupStep(r.groupLabel||i[0][a].length),h=function(e,i,o){var h=d3.select(this);r.withAnimated&&(r.isFirst&&h.attr({x:function(e){return s(e[n])+c(""+o)},y:function(){return u(t.getMin())},width:function(){return c.rangeBand()},height:0}),h.transition().duration(r.animatedTiming).ease(r.animatedEasing)),e[a][o]!==t.getMin()&&void 0!==e[a][o]&&h.attr({x:function(e){return s(e[n])+c(""+o)},y:function(e){return u(e[a][o])},width:function(){return c.rangeBand()},height:function(e){return u(t.getMin())-u(e[a][o])}})||h.attr({x:function(e){return s(e[n])+c(""+o)},y:function(){return u(t.getMin())-1},width:function(){return c.rangeBand()},height:function(){return 1}})},l=this.series.selectAll(".series-group").data(this._data);this.enterSeries=l.enter().append("g").attr("class","series-group");for(var d=0;o>d;d++)l.each(function(e,t){var r=d3.select(this).select(".serie"+(d+1))[0][0];r&&h.call(d3.select(this).select(".serie"+(d+1))[0][0],e,t,d)}),this.enterSeries.append("rect").attr("class","serie serie"+(d+1)).each(function(e,t){h.call(this,e,t,d)});l.selectAll(".serie.serie"+o+" ~ .serie").remove(),this.outerSeries=l.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMulti.prototype.renderSeries.call(this)}}),module.exports=BarMulti; | ||
function BarMulti(t,e){var i={xaxis:{type:"category",orient:"bottom"},groupLabel:null,yaxis:{}};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMulti=DataV.extend(BarMulti,{data:function(t){if(!t)return this._data;var e=this.options,i=e.yaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,r=this.data(),n=i.xaxis.key,s=i.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var a=t.getX(),o=e.getX(),u=_.maxBy(r,function(t){return t[s].length})[s].length,l=t.calGroupStep(i.groupLabel||r[0][s].length),c=function(t,r,u){var c=d3.select(this);i.withAnimated&&(i.isFirst&&c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(){return o(e.getMin())},width:function(){return l.rangeBand()},height:0}),c.transition().duration(i.animatedTiming).ease(i.animatedEasing)),t[s][u]!==e.getMin()&&void 0!==t[s][u]&&c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(t){return o(t[s][u])},width:function(){return l.rangeBand()},height:function(t){return o(e.getMin())-o(t[s][u])}})||c.attr({x:function(t){return a(t[n])+l(""+u)},y:function(){return o(e.getMin())-1},width:function(){return l.rangeBand()},height:function(){return 1}})},h=this.series.selectAll(".series-group").data(this._data),d=this.getComs("tooltip","tooltip");this.enterSeries=h.enter().append("g").attr("class","series-group");for(var f=0;u>f;f++){h.each(function(t,e){var i=d3.select(this).select(".serie"+(f+1))[0][0];i&&c.call(d3.select(this).select(".serie"+(f+1))[0][0],t,e,f)});var g=this.enterSeries.append("rect").attr("class","serie serie"+(f+1)).each(function(t,e){c.call(this,t,e,f)});i.tooltip&&i.tooltip.show&&!function(t,e){t.on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[n]=t[n],i[s]=t[s][e],d.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),d.hide()})}(g,f)}h.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=h.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMulti.prototype.renderSeries.call(this)}}),module.exports=BarMulti; |
@@ -1,1 +0,1 @@ | ||
function BarMultiCustom(t,e){var a={xaxis:{type:"category",orient:"bottom"},yaxis:{}};_.deepMerge(a,e),DataV.call(this,t,a)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiCustom=DataV.extend(BarMultiCustom,{data:function(t){if(!t)return this._data;var e=this.options,a=e.yaxis.key;t.forEach(function(t){_.isArray(t[a])||(t[a]=[t[a]]),t[a]=_.map(t[a],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,a=this.options,i=this.data(),s=this,n=a.xaxis.key,r=a.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var o=t.getX(),u=e.getX(),c=_.maxBy(i,function(t){return t[r].length})[r].length,l=t.calGroupStep(a.groupLabel||i[0][r].length),h=function(t,i,c){var h=d3.select(this);a.withAnimated&&(a.isFirst&&h.attr({d:function(t){var r=[{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())}];return"function"==typeof a.customPos?(r=a.customPos.call(s,r,i,c),_.pos2Path(r)):"function"==typeof a.customPath?a.customPath.call(s,r,c):_.pos2Path(r)}}),h.transition().duration(a.animatedTiming).ease(a.animatedEasing)),t[r][c]!==e.getMin()&&void 0!==t[r][c]&&h.attr({d:function(t){var h=[{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c),y:u(t[r][c])},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(t[r][c])},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())}];return"function"==typeof a.customPos?(h=a.customPos.call(s,h,i,c),_.pos2Path(h)):"function"==typeof a.customPath?a.customPath.call(s,h,c):_.pos2Path(h)}})||h.attr({d:function(t){var r=[{x:o(t[n])+l(""+c),y:u(e.getMin())},{x:o(t[n])+l(""+c),y:u(e.getMin())-1},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())-1},{x:o(t[n])+l(""+c)+l.rangeBand(),y:u(e.getMin())}];return"function"==typeof a.customPos?(r=a.customPos.call(s,r,i,c),_.pos2Path(r)):"function"==typeof a.customPath?a.customPath.call(s,r,c):_.pos2Path(r)}})},d=this.series.selectAll(".series-group").data(this._data);this.enterSeries=d.enter().append("g").attr("class","series-group");for(var g=0;c>g;g++)d.each(function(t,e){var a=d3.select(this).select(".serie"+(g+1))[0][0];a&&h.call(d3.select(this).select(".serie"+(g+1))[0][0],t,e,g)}),this.enterSeries.append("path").attr("class","serie serie"+(g+1)).each(function(t,e){h.call(this,t,e,g)});d.selectAll(".serie.serie"+c+" ~ .serie").remove(),this.outerSeries=d.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiCustom.prototype.renderSeries.call(this)}}),module.exports=BarMultiCustom; | ||
function BarMultiCustom(t,e){var i={xaxis:{type:"category",orient:"bottom"},yaxis:{}};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiCustom=DataV.extend(BarMultiCustom,{data:function(t){if(!t)return this._data;var e=this.options,i=e.yaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,s=this.data(),a=this,o=i.xaxis.key,n=i.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var r=t.getX(),u=e.getX(),l=_.maxBy(s,function(t){return t[n].length})[n].length,c=t.calGroupStep(i.groupLabel||s[0][n].length),h=function(t,s,l){var h=d3.select(this);i.withAnimated&&(i.isFirst&&h.attr({d:function(t){var n=[{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())}];return"function"==typeof i.customPos?(n=i.customPos.call(a,n,s,l),_.pos2Path(n)):"function"==typeof i.customPath?i.customPath.call(a,n,l):_.pos2Path(n)}}),h.transition().duration(i.animatedTiming).ease(i.animatedEasing)),t[n][l]!==e.getMin()&&void 0!==t[n][l]&&h.attr({d:function(t){var h=[{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l),y:u(t[n][l])},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(t[n][l])},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())}];return"function"==typeof i.customPos?(h=i.customPos.call(a,h,s,l),_.pos2Path(h)):"function"==typeof i.customPath?i.customPath.call(a,h,l):_.pos2Path(h)}})||h.attr({d:function(t){var n=[{x:r(t[o])+c(""+l),y:u(e.getMin())},{x:r(t[o])+c(""+l),y:u(e.getMin())-1},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())-1},{x:r(t[o])+c(""+l)+c.rangeBand(),y:u(e.getMin())}];return"function"==typeof i.customPos?(n=i.customPos.call(a,n,s,l),_.pos2Path(n)):"function"==typeof i.customPath?i.customPath.call(a,n,l):_.pos2Path(n)}})},d=this.series.selectAll(".series-group").data(this._data),f=this.getComs("tooltip","tooltip");this.enterSeries=d.enter().append("g").attr("class","series-group");for(var p=0;l>p;p++){d.each(function(t,e){var i=d3.select(this).select(".serie"+(p+1))[0][0];i&&h.call(d3.select(this).select(".serie"+(p+1))[0][0],t,e,p)});var g=this.enterSeries.append("path").attr("class","serie serie"+(p+1)).each(function(t,e){h.call(this,t,e,p)});i.tooltip&&i.tooltip.show&&!function(t,e){t.on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[o]=t[o],i[n]=t[n][e],f.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),f.hide()})}(g,p)}d.selectAll(".serie.serie"+l+" ~ .serie").remove(),this.outerSeries=d.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiCustom.prototype.renderSeries.call(this)}}),module.exports=BarMultiCustom; |
@@ -1,1 +0,1 @@ | ||
function BarMultiHori(e,t){var r={xaxis:{orient:"bottom",key:"y"},yaxis:{type:"category",key:"x"}};_.deepMerge(r,t),DataV.call(this,e,r)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiHori=DataV.extend(BarMultiHori,{data:function(e){if(!e)return this._data;var t=this.options,r=t.xaxis.key;e.forEach(function(e){_.isArray(e[r])||(e[r]=[e[r]]),e[r]=_.map(e[r],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e.reverse()},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var e,t,r=this.options,i=this.data(),n=r.xaxis.key,a=r.yaxis.key;e=this.getComs("axis","xaxis"),t=this.getComs("axis","yaxis");var s=e.getX(),o=t.getX(),u=_.maxBy(i,function(e){return e[n].length})[n].length,c=((o.rangeBand()-(u-1)*r.padding)/u,t.calGroupStep(r.groupLabel||u)),d=function(t,i,u){var d=d3.select(this);r.withAnimated&&(r.isFirst&&d.attr({x:function(){return s(e.getMin())},y:function(e){return o(e[a])+c(""+u)},width:0,height:function(){return c.rangeBand()}}),d.transition().duration(r.animatedTiming).ease(r.animatedEasing)),t[n][u]!==e.getMin()&&void 0!==t[n][u]&&d.attr({x:function(){return s(e.getMin())},y:function(e){return o(e[a])+c(""+u)},width:function(e){return s(e[n][u])},height:function(){return c.rangeBand()}})||d.attr({x:function(){return s(e.getMin())},y:function(e){return o(e[a])+c(""+u)},width:function(){return s(e.getMin())+1},height:function(){return c.rangeBand()}})},h=this.series.selectAll(".series-group").data(this._data);this.enterSeries=h.enter().append("g").attr("class","series-group");for(var l=0;u>l;l++)h.each(function(e,t){var r=d3.select(this).select(".serie"+(l+1))[0][0];r&&d.call(d3.select(this).select(".serie"+(l+1))[0][0],e,t,l)}),this.enterSeries.append("rect").attr("class","serie serie"+(l+1)).each(function(e,t){d.call(this,e,t,l)});h.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=h.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiHori.prototype.renderSeries.call(this)}}),module.exports=BarMultiHori; | ||
function BarMultiHori(t,e){var i={xaxis:{orient:"bottom",key:"y"},yaxis:{type:"category",key:"x"}};_.deepMerge(i,e),DataV.call(this,t,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");BarMultiHori=DataV.extend(BarMultiHori,{data:function(t){if(!t)return this._data;var e=this.options,i=e.xaxis.key;t.forEach(function(t){_.isArray(t[i])||(t[i]=[t[i]]),t[i]=_.map(t[i],function(t){return"string"==typeof t&&(t=parseInt(t)),t||(t=0),t})}),this._data=t.reverse()},renderSeries:function(){this.svg.classed("bar-chart-g",!0);var t,e,i=this.options,r=this.data(),n=i.xaxis.key,s=i.yaxis.key;t=this.getComs("axis","xaxis"),e=this.getComs("axis","yaxis");var a=t.getX(),o=e.getX(),u=_.maxBy(r,function(t){return t[n].length})[n].length,l=((o.rangeBand()-(u-1)*i.padding)/u,e.calGroupStep(i.groupLabel||u)),c=function(e,r,u){var c=d3.select(this);i.withAnimated&&(i.isFirst&&c.attr({x:function(){return a(t.getMin())},y:function(t){return o(t[s])+l(""+u)},width:0,height:function(){return l.rangeBand()}}),c.transition().duration(i.animatedTiming).ease(i.animatedEasing)),e[n][u]!==t.getMin()&&void 0!==e[n][u]&&c.attr({x:function(){return a(t.getMin())},y:function(t){return o(t[s])+l(""+u)},width:function(t){return a(t[n][u])},height:function(){return l.rangeBand()}})||c.attr({x:function(){return a(t.getMin())},y:function(t){return o(t[s])+l(""+u)},width:function(){return a(t.getMin())+1},height:function(){return l.rangeBand()}})},h=this.series.selectAll(".series-group").data(this._data),d=this.getComs("tooltip","tooltip");this.enterSeries=h.enter().append("g").attr("class","series-group");for(var f=0;u>f;f++){h.each(function(t,e){var i=d3.select(this).select(".serie"+(f+1))[0][0];i&&c.call(d3.select(this).select(".serie"+(f+1))[0][0],t,e,f)});var g=this.enterSeries.append("rect").attr("class","serie serie"+(f+1)).each(function(t,e){c.call(this,t,e,f)});i.tooltip&&i.tooltip.show&&!function(t,e){t.on("mouseover",function(t){this.oldColor=d3.select(this).style("fill"),d3.select(this).style("fill","rgb(155, 207, 241)");var i={};i[s]=t[s],i[n]=t[n][e],d.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),d.hide()})}(g,f)}h.selectAll(".serie.serie"+u+" ~ .serie").remove(),this.outerSeries=h.exit().remove()},updateBeforeRender:function(){this.beforeRender()},updateSeries:function(){BarMultiHori.prototype.renderSeries.call(this)}}),module.exports=BarMultiHori; |
@@ -1,1 +0,1 @@ | ||
var exports=module.exports;exports.Options=function(){this.isFirst=!0,this.margin={top:30,right:30,bottom:30,left:30},this.xaxisDefault={key:"x",type:"defaults",orient:"bottom",dy:8},this.yaxisDefault={key:"y",type:"defaults",orient:"left",dy:8},this.svg=null,this.width=0,this.height=0,this.withAnimated=!1,this.animatedEasing="basic",this.animatedTiming=1e3,this.withInteract=!1,this.interpolate=null,this.tooltip={show:!0},this.theme="grey"}; | ||
var exports=module.exports;exports.Options=function(){this.isFirst=!0,this.margin={top:30,right:30,bottom:30,left:30},this.xaxisDefault={key:"x",type:"defaults",orient:"bottom",dy:8},this.yaxisDefault={key:"y",type:"defaults",orient:"left",dy:8},this.svg=null,this.width=0,this.height=0,this.withAnimated=!1,this.animatedEasing="basic",this.animatedTiming=1e3,this.withInteract=!1,this.interpolate=null,this.tooltip=null,this.theme="grey"}; |
@@ -1,1 +0,1 @@ | ||
function LineMulti(e,t){var i={xaxis:{orient:"bottom"},yaxis:{key:"y"}};_.deepMerge(i,t),DataV.call(this,e,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");LineMulti=DataV.extend(LineMulti,{data:function(e){if(!e)return this._data;var t=this.options,i=t.yaxis.key;e.forEach(function(e){_.isArray(e[i])||(e[i]=[e[i]]),e[i]=_.map(e[i],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},renderSeries:function(){this.svg.classed("line-chart-g",!0);var e,t,i=this.options,a=this.data(),r=i.xaxis.key,s=i.yaxis.key;e=this.getComs("axis","xaxis"),t=this.getComs("axis","yaxis");var n=e.getX(),o=t.getX(),u=_.maxBy(a,function(e){return e[s].length})[s].length;this.series=this.series.datum(a).each(function(){for(var e=d3.select(this),t=0;u>t;t++){var a=d3.svg.line().x(function(e){return"time"===i.xaxis.type&&"string"==typeof e[r]?n(new Date(e[r]))+(n.rangeBand?n.rangeBand()/2:0):n(e[r])+("category"===i.xaxis.type?n.rangeBand()/2:0)}).y(function(e){return o(e[s][t]||yaxis.getMax())});i.interpolate&&a.interpolate(i.interpolate);var d=e.select(".serie"+(t+1))[0][0]?e.select(".serie"+(t+1)):e.append("path").attr({"class":"serie serie"+(t+1)});i.withAnimated&&d.transition().duration(i.animatedTiming).ease(i.animatedEasing),d.attr({d:a})}}),this.series.selectAll(".serie.serie"+u+" ~ .serie").remove()},updateSeries:function(){LineMulti.prototype.renderSeries.call(this)}}),module.exports=LineMulti; | ||
function LineMulti(e,t){var i={xaxis:{orient:"bottom"},yaxis:{key:"y"}};_.deepMerge(i,t),DataV.call(this,e,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");LineMulti=DataV.extend(LineMulti,{data:function(e){if(!e)return this._data;var t=this.options,i=t.yaxis.key;e.forEach(function(e){_.isArray(e[i])||(e[i]=[e[i]]),e[i]=_.map(e[i],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},renderSeries:function(){this.svg.classed("line-chart-g",!0);var e,t,i=this.options,a=this.data(),r=i.xaxis.key,n=i.yaxis.key;e=this.getComs("axis","xaxis"),t=this.getComs("axis","yaxis");var s=e.getX(),o=t.getX(),l=_.maxBy(a,function(e){return e[n].length})[n].length;if(i.tooltip&&i.tooltip.show){var d,u=this.getComs("tooltip","tooltip"),c=i.xaxis.type,x=i.xaxis.format;u.dispatch.on("elementMouseover",function(e){closestPoint=function(e){var t=window.screen.availWidth,i=0;return a.forEach(function(a,n){var s=a.x;"time"===c&&x&&(s=d3.time.format(x).parse(a[r])),diff=Math.abs(u.layer.xScale(s)-u.layer.xScale(e.pointXValue)),diff<t&&(t=diff,i=n,d=s)}),a[i]}(e);var t=u.layer.xScale(d)+("category"===i.xaxis.type?s.rangeBand()/2:0);u.renderGuildLayer(t),u.show(closestPoint,function(e){var t=i.xaxis.type,a="%Y",s=e[r];return"time"===t&&(s=d3.time.format(x||a)(e[r])),{x:s,y:e[n].toString()}})})}this.series=this.series.datum(a).each(function(){for(var e=d3.select(this),t=0;l>t;t++){var a=d3.svg.line().x(function(e){return"time"===i.xaxis.type&&"string"==typeof e[r]?s(new Date(e[r]))+(s.rangeBand?s.rangeBand()/2:0):s(e[r])+("category"===i.xaxis.type?s.rangeBand()/2:0)}).y(function(e){return o(e[n][t]||yaxis.getMax())});i.interpolate&&a.interpolate(i.interpolate);var d=e.select(".serie"+(t+1))[0][0]?e.select(".serie"+(t+1)):e.append("path").attr({"class":"serie serie"+(t+1)});i.withAnimated&&d.transition().duration(i.animatedTiming).ease(i.animatedEasing),d.attr({d:a})}}),this.series.selectAll(".serie.serie"+l+" ~ .serie").remove()},updateSeries:function(){LineMulti.prototype.renderSeries.call(this)}}),module.exports=LineMulti; |
@@ -1,1 +0,1 @@ | ||
function LineMulti(e,t){var i={xaxis:{orient:"bottom"},yaxis:{key:"y"}};_.deepMerge(i,t),DataV.call(this,e,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");LineMulti=DataV.extend(LineMulti,{data:function(e){if(!e)return this._data;var t=this.options,i=t.yaxis.key;e.forEach(function(e){_.isArray(e[i])||(e[i]=[e[i]]),e[i]=_.map(e[i],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},renderSeries:function(){this.svg.classed("line-chart-g",!0);var e,t,i=this.options,a=this.data(),r=i.xaxis.key,n=i.yaxis.key;e=this.getComs("axis","xaxis"),t=this.getComs("axis","yaxis");var s,o=e.getX(),l=t.getX(),u=_.maxBy(a,function(e){return e[n].length})[n].length,d=this.getComs("tooltip","tooltip"),c=i.xaxis.type,x=i.xaxis.format;d.dispatch.on("elementMouseover",function(e){closestPoint=function(e){var t=window.screen.availWidth,i=0;return a.forEach(function(a,n){var o=a.x;"time"===c&&x&&(o=d3.time.format(x).parse(a[r])),diff=Math.abs(d.layer.xScale(o)-d.layer.xScale(e.pointXValue)),diff<t&&(t=diff,i=n,s=o)}),a[i]}(e);var t=d.layer.xScale(s);d.renderGuildLayer(t),d.show(closestPoint,function(e){var t=i.xaxis.type,a="%Y",s=e[r];return"time"===t&&(s=d3.time.format(x||a)(e[r])),{x:s,y:e[n].toString()}})}),this.series=this.series.datum(a).each(function(){for(var e=d3.select(this),t=0;u>t;t++){!function(){}(t);var a=d3.svg.line().x(function(e){return"time"===i.xaxis.type&&"string"==typeof e[r]?o(new Date(e[r]))+(o.rangeBand?o.rangeBand()/2:0):o(e[r])+("category"===i.xaxis.type?o.rangeBand()/2:0)}).y(function(e){return l(e[n][t]||yaxis.getMax())});i.interpolate&&a.interpolate(i.interpolate);var s=e.select(".serie"+(t+1))[0][0]?e.select(".serie"+(t+1)):e.append("path").attr({"class":"serie serie"+(t+1)});i.withAnimated&&s.transition().duration(i.animatedTiming).ease(i.animatedEasing),s.attr({d:a})}}),this.series.selectAll(".serie.serie"+u+" ~ .serie").remove()},updateSeries:function(){LineMulti.prototype.renderSeries.call(this)}}),module.exports=LineMulti; | ||
function LineMulti(e,t){var i={xaxis:{orient:"bottom"},yaxis:{key:"y"}};_.deepMerge(i,t),DataV.call(this,e,i)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");LineMulti=DataV.extend(LineMulti,{data:function(e){if(!e)return this._data;var t=this.options,i=t.yaxis.key;e.forEach(function(e){_.isArray(e[i])||(e[i]=[e[i]]),e[i]=_.map(e[i],function(e){return"string"==typeof e&&(e=parseInt(e)),e||(e=0),e})}),this._data=e},renderSeries:function(){this.svg.classed("line-chart-g",!0);var e,t,i=this.options,a=this.data(),r=i.xaxis.key,n=i.yaxis.key;e=this.getComs("axis","xaxis"),t=this.getComs("axis","yaxis");var s=e.getX(),o=t.getX(),l=_.maxBy(a,function(e){return e[n].length})[n].length;if(i.tooltip&&i.tooltip.show){var d,u=this.getComs("tooltip","tooltip"),c=i.xaxis.type,x=i.xaxis.format;u.dispatch.on("elementMouseover",function(e){closestPoint=function(e){var t=window.screen.availWidth,i=0;return a.forEach(function(a,n){var s=a.x;"time"===c&&x&&(s=d3.time.format(x).parse(a[r])),diff=Math.abs(u.layer.xScale(s)-u.layer.xScale(e.pointXValue)),diff<t&&(t=diff,i=n,d=s)}),a[i]}(e);var t=u.layer.xScale(d)+("category"===i.xaxis.type?s.rangeBand()/2:0);u.renderGuildLayer(t),u.show(closestPoint,function(e){var t=i.xaxis.type,a="%Y",s=e[r];return"time"===t&&(s=d3.time.format(x||a)(e[r])),{x:s,y:e[n].toString()}})})}this.series=this.series.datum(a).each(function(){for(var e=d3.select(this),t=0;l>t;t++){var a=d3.svg.line().x(function(e){return"time"===i.xaxis.type&&"string"==typeof e[r]?s(new Date(e[r]))+(s.rangeBand?s.rangeBand()/2:0):s(e[r])+("category"===i.xaxis.type?s.rangeBand()/2:0)}).y(function(e){return o(e[n][t]||yaxis.getMax())});i.interpolate&&a.interpolate(i.interpolate);var d=e.select(".serie"+(t+1))[0][0]?e.select(".serie"+(t+1)):e.append("path").attr({"class":"serie serie"+(t+1)});i.withAnimated&&d.transition().duration(i.animatedTiming).ease(i.animatedEasing),d.attr({d:a})}}),this.series.selectAll(".serie.serie"+l+" ~ .serie").remove()},updateSeries:function(){LineMulti.prototype.renderSeries.call(this)}}),module.exports=LineMulti; |
{ | ||
"name": "dchart-core", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,1 +0,1 @@ | ||
function Pie(e,t){var r={arc:{startAngle:function(e){return e.startAngle},endAngle:function(e){return e.endAngle}},pyaxis:{key:"y"},paxis:null};_.deepMerge(r,t),DataV.call(this,e,r)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");Pie=DataV.extend(Pie,{beforeRender:function(){var e=this.options;e.arc.radius||(e.arc._radius=Math.min(e.innerHeight,e.innerWidth)/2)},updateBeforeRender:function(){this.beforeRender(),w},changeSeries:function(){var e=this.options,t=this.data(),r=d3.layout.pie().sort(null).value(function(t){var r=t[e.pyaxis.key];return"string"==typeof r?parseInt(r):r?r:0}),a=this.getComs("arc","arc").getArc(),i=this.series.selectAll(".series-group").attr("transform","translate("+e.innerWidth/2+","+e.innerHeight/2+")").data(r(t)),n=function(t){if(!e.paxis._dr)return"translate("+a.centroid(t)+")";var r=e.paxis._dr,i=(t.startAngle+t.endAngle)/2;return"translate("+r*Math.sin(i)+", "+-r*Math.cos(i)+")"},s=function(t,r){return"function"==typeof e.paxis.label?e.paxis.label.call(t,t.data,r):e.paxis.label&&e.paxis.label.length?e.paxis.label[r]:t.data[e.paxis.key]};this.series.selectAll(".series-group").each(function(t,r){var i=d3.select(this);i.selectAll(".serie").attr({d:function(){return a(t,r)}}),e.paxis&&i.selectAll(".serie-label").attr("transform",n.bind(null,t)).html(s.bind(null,t,r))}),this.enterSeries=i.enter().append("g").attr("class","series-group").attr("transform","translate("+e.innerWidth/2+","+e.innerHeight/2+")").each(function(t,r){var i=d3.select(this);i.append("path").attr({"class":function(){return"serie serie1"},d:function(){return a(t,r)}}),e.paxis&&i.append("text").attr({"class":"serie-label",transform:n.bind(null,t),dy:".35em"}).style("text-anchor","middle").html(s.bind(null,t,r))}),this.outerSeries=i.exit().remove()},renderSeries:function(){this.svg.classed("pie-chart-g",!0);{var e=this.options;this.renderCom("arc","arc",this.svg[0][0],e.arc).getArc()}this.changeSeries()},updateSeries:function(){var e=this.options,t=this.data(),r=this.getComs("arc","arc");r.update(t,e.arc),r=r.getArc(),this.changeSeries()}}),module.exports=Pie; | ||
function Pie(e,t){var r={arc:{startAngle:function(e){return e.startAngle},endAngle:function(e){return e.endAngle}},pyaxis:{key:"y"},paxis:null};_.deepMerge(r,t),DataV.call(this,e,r)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");Pie=DataV.extend(Pie,{beforeRender:function(){var e=this.options;e.arc.radius||(e.arc._radius=Math.min(e.innerHeight,e.innerWidth)/2)},updateBeforeRender:function(){this.beforeRender()},changeSeries:function(){var e=this.options,t=this.data(),r=d3.layout.pie().sort(null).value(function(t){var r=t[e.pyaxis.key];return"string"==typeof r?parseInt(r):r?r:0}),a=this.getComs("arc","arc").getArc(),i=this.series.selectAll(".series-group").attr("transform","translate("+e.innerWidth/2+","+e.innerHeight/2+")").data(r(t)),n=function(t){if(!e.paxis._dr)return"translate("+a.centroid(t)+")";var r=e.paxis._dr,i=(t.startAngle+t.endAngle)/2;return"translate("+r*Math.sin(i)+", "+-r*Math.cos(i)+")"},s=function(t,r){return"function"==typeof e.paxis.label?e.paxis.label.call(t,t.data,r):e.paxis.label&&e.paxis.label.length?e.paxis.label[r]:t.data[e.paxis.key]};this.series.selectAll(".series-group").each(function(t,r){var i=d3.select(this);i.selectAll(".serie").attr({d:function(){return a(t,r)}}),e.paxis&&i.selectAll(".serie-label").attr("transform",n.bind(null,t)).html(s.bind(null,t,r))}),this.enterSeries=i.enter().append("g").attr("class","series-group").attr("transform","translate("+e.innerWidth/2+","+e.innerHeight/2+")").each(function(t,r){var i=d3.select(this);i.append("path").attr({"class":function(){return"serie serie1"},d:function(){return a(t,r)}}),e.paxis&&i.append("text").attr({"class":"serie-label",transform:n.bind(null,t),dy:".35em"}).style("text-anchor","middle").html(s.bind(null,t,r))}),this.outerSeries=i.exit().remove()},renderSeries:function(){this.svg.classed("pie-chart-g",!0);{var e=this.options;this.renderCom("arc","arc",this.svg[0][0],e.arc).getArc()}this.changeSeries()},updateSeries:function(){var e=this.options,t=this.data(),r=this.getComs("arc","arc");r.update(t,e.arc),r=r.getArc(),this.changeSeries()}}),module.exports=Pie; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
108949
2