New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dchart-core

Package Overview
Dependencies
Maintainers
1
Versions
284
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dchart-core - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

2

bar/barCustom.js

@@ -1,1 +0,1 @@

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;
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),p=i.tooltip&&this.getComs("tooltip","tooltip");this.enterSeries=d.enter().append("g").attr("class","series-group");for(var f=0;l>f;f++){d.each(function(t,e){var i=d3.select(this).select(".serie"+(f+1))[0][0];i&&h.call(d3.select(this).select(".serie"+(f+1))[0][0],t,e,f)});var g=this.enterSeries.append("path").attr("class","serie serie"+(f+1)).each(function(t,e){h.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[o]=t[o],i[n]=t[n][e],p.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),p.hide()})}(g,f)}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(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;
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=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[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 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;
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=i.tooltip&&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(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;
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=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 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;
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(),l=e.getX(),u=_.maxBy(s,function(t){return t[n].length})[n].length,c=t.calGroupStep(i.groupLabel||s[0][n].length),h=function(t,s,u){var h=d3.select(this);i.withAnimated&&(i.isFirst&&h.attr({d:function(t){var n=[{x:r(t[o])+c(""+u),y:l(e.getMin())},{x:r(t[o])+c(""+u),y:l(e.getMin())},{x:r(t[o])+c(""+u)+c.rangeBand(),y:l(e.getMin())},{x:r(t[o])+c(""+u)+c.rangeBand(),y:l(e.getMin())}];return"function"==typeof i.customPos?(n=i.customPos.call(a,n,s,u),_.pos2Path(n)):"function"==typeof i.customPath?i.customPath.call(a,n,u):_.pos2Path(n)}}),h.transition().duration(i.animatedTiming).ease(i.animatedEasing)),t[n][u]!==e.getMin()&&void 0!==t[n][u]&&h.attr({d:function(t){var h=[{x:r(t[o])+c(""+u),y:l(e.getMin())},{x:r(t[o])+c(""+u),y:l(t[n][u])},{x:r(t[o])+c(""+u)+c.rangeBand(),y:l(t[n][u])},{x:r(t[o])+c(""+u)+c.rangeBand(),y:l(e.getMin())}];return"function"==typeof i.customPos?(h=i.customPos.call(a,h,s,u),_.pos2Path(h)):"function"==typeof i.customPath?i.customPath.call(a,h,u):_.pos2Path(h)}})||h.attr({d:function(t){var n=[{x:r(t[o])+c(""+u),y:l(e.getMin())},{x:r(t[o])+c(""+u),y:l(e.getMin())-1},{x:r(t[o])+c(""+u)+c.rangeBand(),y:l(e.getMin())-1},{x:r(t[o])+c(""+u)+c.rangeBand(),y:l(e.getMin())}];return"function"==typeof i.customPos?(n=i.customPos.call(a,n,s,u),_.pos2Path(n)):"function"==typeof i.customPath?i.customPath.call(a,n,u):_.pos2Path(n)}})},d=this.series.selectAll(".series-group").data(this._data),p=i.tooltip&&this.getComs("tooltip","tooltip");this.enterSeries=d.enter().append("g").attr("class","series-group");for(var f=0;u>f;f++){d.each(function(t,e){var i=d3.select(this).select(".serie"+(f+1))[0][0];i&&h.call(d3.select(this).select(".serie"+(f+1))[0][0],t,e,f)});var g=this.enterSeries.append("path").attr("class","serie serie"+(f+1)).each(function(t,e){h.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[o]=t[o],i[n]=t[n][e],p.show(i)}).on("mouseout",function(){d3.select(this).style("fill",this.oldColor),p.hide()})}(g,f)}d.selectAll(".serie.serie"+u+" ~ .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(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;
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=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[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;
{
"name": "dchart-core",
"version": "1.2.3",
"version": "1.2.4",
"description": "",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc