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.0.33 to 1.0.34

2

com/floatTag.js

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

function FloatTag(t,i,a){this.reset(),this.options={shape:"",content:"",customShape:null,pos:null},this.init(t,i,a),this._valid()}var _=require("../util"),Com=require("./index"),d3=require("d3");FloatTag=Com.extend(FloatTag,{_valid:function(){},renderSeries:function(){var t=this.options;this.el=this.el.append("g").attr({"class":"float-tag",opacity:0,transform:"translate("+t.pos[0]+", "+t.pos[1]+")"}),"function"==typeof t.customShape&&this.el.html(t.customShape.apply(this))},update:function(t,i){this.init(null,i),t&&this.data(t),this._valid(),this.valid||this.emit("error",{msg:this.msg});var a=this.options;"function"==typeof i.customShape&&this.el.html(a.customShape.apply(this)),this.updateSeries()},updateSeries:function(){var t=this.options,i=this.alloptions;this.el.transition().duration(i.animatedTiming).ease(i.animatedEasing).attr({transform:"translate("+t.pos[0]+", "+t.pos[1]+")"})},show:function(t){var i=this.options,a=this.alloptions,s=this;this.el.attr({opacity:.1,transform:"translate("+i.pos[0]+", "+(i.pos[1]+10)+")"}).transition().duration(a.animatedTiming).ease(a.animatedEasing).attr({opacity:1,transform:"translate("+i.pos[0]+", "+i.pos[1]+")"}),t&&setTimeout(function(){t.call(s)},a.animatedTiming)},hide:function(t){var i=this.options,a=this.alloptions,s=this;this.el.attr({opacity:1,transform:"translate("+i.pos[0]+", "+i.pos[1]+")"}).transition().duration(a.animatedTiming).ease(a.animatedEasing).attr({opacity:0,transform:"translate("+i.pos[0]+", "+(i.pos[1]+10)+")"}),t&&setTimeout(function(){t.call(s)},a.animatedTiming)}}),module.exports=FloatTag;
function FloatTag(t,i,a){this.reset(),this.options={shape:"",content:"",customShape:null,pos:null},this.init(t,i,a),this._valid()}var _=require("../util"),Com=require("./index"),d3=require("d3");FloatTag=Com.extend(FloatTag,{_valid:function(){},renderSeries:function(){var t=this.options;this.el=this.el.append("g").attr({"class":"float-tag",opacity:0,transform:"translate("+t.pos[0]+", "+t.pos[1]+")"}),"function"==typeof t.customShape&&this.el.html(t.customShape.apply(this))},update:function(t,i){this.init(null,i),t&&this.data(t),this._valid(),this.valid||this.emit("error",{msg:this.msg});var a=this.options;"function"==typeof i.customShape&&this.el.html(a.customShape.apply(this)),(i.pos[0]!==a.pos[0]||i.pos[1]!==a.pos[1])&&this.updateSeries()},updateSeries:function(){var t=this.options,i=this.alloptions;this.el.transition().duration(i.animatedTiming).ease(i.animatedEasing).attr({transform:"translate("+t.pos[0]+", "+t.pos[1]+")"})},show:function(t){var i=this.options,a=this.alloptions,s=this;this.el.attr({opacity:.1,transform:"translate("+i.pos[0]+", "+(i.pos[1]+10)+")"}).transition().duration(a.animatedTiming).ease(a.animatedEasing).attr({opacity:1,transform:"translate("+i.pos[0]+", "+i.pos[1]+")"}),t&&setTimeout(function(){t.call(s)},a.animatedTiming)},hide:function(t){var i=this.options,a=this.alloptions,s=this;this.el.attr({opacity:1,transform:"translate("+i.pos[0]+", "+i.pos[1]+")"}).transition().duration(a.animatedTiming).ease(a.animatedEasing).attr({opacity:0,transform:"translate("+i.pos[0]+", "+(i.pos[1]+10)+")"}),t&&setTimeout(function(){t.call(s)},a.animatedTiming)}}),module.exports=FloatTag;

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

var exports=module.exports,_=require("../util"),d3=require("d3");exports.draw=function(){},exports.render=function(e,t){this.options.isFirst?(this.options.isFirst=!1,e&&this.data(e),t&&_.deepMerge(this.options,t),this.initLayout(),this._beforeRender(),this.renderSeries(),this._afterRender()):this.update.apply(this,arguments)},exports.beforeRender=function(){},exports._beforeRender=function(){this.beforeRender();var e=this.options;e.xaxis&&(e.xaxis=_.deepMerge(e.xaxisDefault,e.xaxis),this.renderXAxis("xaxis",this.svg[0][0],e.xaxis)),e.yaxis&&(e.yaxis=_.deepMerge(e.yaxisDefault,e.yaxis),this.renderYAxis("yaxis",this.svg[0][0],e.yaxis)),this.emit("before.render")},exports.afterRender=function(){},exports._afterRender=function(){this.options.withInteract&&this.series.on("click",function(e,t){self.emit("series_click",{data:e,index:t,dom:this})}).on("mouseenter",function(e,t){self.emit("series_mouseenter",{data:e,index:t,dom:this})}).on("mouseover",function(e,t){self.emit("series_mouseover",{data:e,index:t,dom:this})}).on("mouseleave",function(e,t){self.emit("series_mouseleave",{data:e,index:t,dom:this})}),this.afterRender(),this.emit("after.render")},exports.renderCom=function(e,t,i,s){var r=this._com.add(e,t,i,s,this.options);return r.render(this._data),r.el.attr("id",e),r},exports.renderAxis=function(e,t,i){var s=this._com.addAxis(e,t,i,this.options);return s.render(this._data),s.addClass("axis"+this._com.getAccountByType("axis")),s.el.attr("id",e),s},exports.renderXAxis=function(e,t,i){return this.options.xaxis=_.deepMerge(this.options.xaxis,i),this.renderAxis(e,t,i)},exports.renderYAxis=function(e,t,i){return this.options.yaxis=_.deepMerge(this.options.yaxis,i),this.renderAxis(e,t,i)},exports.renderBG=function(e,t,i){var s=this._com.addBG(e,t,i,this.options);return s.render(this._data),s.el.attr("id",e),s},exports.renderLegend=function(e,t,i){var s=this._com.addLegend(e,t,i,this.options);return s.render(this._data),s.el.attr("id",e),s},exports.renderTime=function(e,t,i){var s=this._com.addTime(e,t,i,this.options);return s.render(this._data),s.el.attr("id",e),s},exports.renderNumber=function(e,t,i){var s=this._com.addNumber(e,t,i,this.options);return s.render(this._data),s.el.attr("id",e),s},exports.renderTheme=function(e){this.themeDom||(this.themeDom=d3.select("head").append("style").attr("class","chart-theme"));var t=this;Cube.use("../theme/"+e+".css",function(e){t.themeDom.html(e)}),this.options.theme=e};
var exports=module.exports,_=require("../util"),d3=require("d3");exports.draw=function(){},exports.render=function(e,t){this.options.isFirst?(this.options.isFirst=!1,e&&this.data(e),t&&_.deepMerge(this.options,t),this.initLayout(),this._beforeRender(),this.renderSeries(),this._afterRender()):this.update.apply(this,arguments)},exports.beforeRender=function(){},exports._beforeRender=function(){this.beforeRender();var e=this.options;e.xaxis&&(e.xaxis=_.deepMerge(e.xaxisDefault,e.xaxis),this.renderXAxis("xaxis",this.svg[0][0],e.xaxis)),e.yaxis&&(e.yaxis=_.deepMerge(e.yaxisDefault,e.yaxis),this.renderYAxis("yaxis",this.svg[0][0],e.yaxis)),this.emit("before.render")},exports.afterRender=function(){},exports._afterRender=function(){this.options.withInteract&&this.series.on("click",function(e,t){self.emit("series_click",{data:e,index:t,dom:this})}).on("mouseenter",function(e,t){self.emit("series_mouseenter",{data:e,index:t,dom:this})}).on("mouseover",function(e,t){self.emit("series_mouseover",{data:e,index:t,dom:this})}).on("mouseleave",function(e,t){self.emit("series_mouseleave",{data:e,index:t,dom:this})}),this.svg[0][0].appendChild(this.svg.select(".series")[0][0]),this.afterRender(),this.emit("after.render")},exports.renderCom=function(e,t,s,i){var r=this._com.add(e,t,s,i,this.options);return r.render(this._data),r.el.attr("id",e),r},exports.renderAxis=function(e,t,s){var i=this._com.addAxis(e,t,s,this.options);return i.render(this._data),i.addClass("axis"+this._com.getAccountByType("axis")),i.el.attr("id",e),i},exports.renderXAxis=function(e,t,s){return this.options.xaxis=_.deepMerge(this.options.xaxis,s),this.renderAxis(e,t,s)},exports.renderYAxis=function(e,t,s){return this.options.yaxis=_.deepMerge(this.options.yaxis,s),this.renderAxis(e,t,s)},exports.renderBG=function(e,t,s){var i=this._com.addBG(e,t,s,this.options);return i.render(this._data),i.el.attr("id",e),i},exports.renderLegend=function(e,t,s){var i=this._com.addLegend(e,t,s,this.options);return i.render(this._data),i.el.attr("id",e),i},exports.renderTime=function(e,t,s){var i=this._com.addTime(e,t,s,this.options);return i.render(this._data),i.el.attr("id",e),i},exports.renderNumber=function(e,t,s){var i=this._com.addNumber(e,t,s,this.options);return i.render(this._data),i.el.attr("id",e),i},exports.renderTheme=function(e){this.themeDom||(this.themeDom=d3.select("head").append("style").attr("class","chart-theme"));var t=this;Cube.use("/src/theme/"+e+".css",function(e){t.themeDom.html(e)}),this.options.theme=e};
{
"name": "dchart-core",
"version": "1.0.33",
"version": "1.0.34",
"description": "",

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

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

function Bubble(n,r){var e={xaxis:{orient:"bottom"}};_.deepMerge(e,r),DataV.call(this,n,e)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");Bubble=DataV.extend(Bubble,{beforeRender:function(){var n=this.options,r=xAxis.getX(),e=r.rangeBand?r.rangeBand()/2:n.innerWidth/data.length/2,t=_.max(data,function(n){return n.r}).r/e,a=_.min(data,function(n){return n[ykey]-n.r/t});a=a[ykey]-a.r/t;var i=_.max(data,function(n){return n[ykey]+n.r/t});i=i[ykey]+i.r/t,n.yaxis.max=i,n.yaxis.min=a},renderSeries:function(){this.series.classed("scatterplot-chart-g",!0);var n,r,e=this.options,t=this.data(),a=e.xaxis.key,i=e.yaxis.key;n=this.renderXAxis("xaxis",this.svg[0][0],e.xaxis);var s=n.getX(),u=s.rangeBand?s.rangeBand()/2:e.innerWidth/t.length/2,c=_.max(t,function(n){return n.r}).r/u,x=_.min(t,function(n){return n[i]-n.r/c});x=x[i]-x.r/c;var d=_.max(t,function(n){return n[i]+n.r/c});d=d[i]+d.r/c,e.yaxis.max=d,e.yaxis.min=x,r=this.renderYAxis("yaxis",this.svg[0][0],e.yaxis);var o=r.getX();this.series=this.series.selectAll(".serie").data(t).enter().append("circle").each(function(){var n=d3.select(this);e.withAnimated?n.attr({"class":"serie",cx:function(n){return s(n[a])+(s.rangeBand?s.rangeBand()/2:0)},cy:function(n){return o(n[i])},r:0}).transition().duration(e.animatedTiming).ease(e.animatedEasing).attr({cx:function(n){return s(n[a])+(s.rangeBand?s.rangeBand()/2:0)},cy:function(n){return o(n[i])},r:function(n){return n.r/c}}):n.attr({"class":"serie",cx:function(n){return s(n[a])+(s.rangeBand?s.rangeBand()/2:0)},cy:function(n){return o(n[i])},r:function(n){return n.r/c}})})},updateSeries:function(){var n,r,e=this.options,t=this.data(),a=e.xaxis.key,i=e.yaxis.key;n=this.getComs("axis","xaxis"),n.update(t,e.xaxis);var s=n.getX(),u=s.rangeBand?s.rangeBand()/2:e.innerWidth/t.length/2,c=_.max(t,function(n){return n.r}).r/u,x=_.min(t,function(n){return n[i]-n.r/c});x=x[i]-x.r/c;var d=_.max(t,function(n){return n[i]+n.r/c});d=d[i]+d.r/c,e.yaxis.max=d,e.yaxis.min=x,r=this.getComs("axis","yaxis"),r.update(t,e.yaxis);var o=r.getX();this.series.data(t),this.series.each(function(){var n=d3.select(this);n.attr({"class":"serie",cx:function(n){return s(n[a])+(s.rangeBand?s.rangeBand()/2:0)},cy:function(n){return o(n[i])},r:function(n){return n.r/c}})})}}),module.exports=Bubble;
function Bubble(e,t){var a={xaxis:{orient:"bottom"},yaxis:{key:"y"},raxis:{key:"r"}};_.deepMerge(a,t),DataV.call(this,e,a)}var DataV=require("../datav"),d3=require("d3"),_=require("../util");Bubble=DataV.extend(Bubble,{beforeRender:function(){{var e=this.options,t=(e.yaxis.key,e.raxis.key),a=this.data(),i=e.innerWidth/a.length/4;this.radio=_.max(a,function(e){return e[t]})[t]/i}},renderSeries:function(){this.series.classed("scatterplot-chart-g",!0);var e=this.options,t=this.data(),a=e.xaxis.key,i=e.yaxis.key,n=e.raxis.key,r=this.getComs("axis","xaxis").getX(),s=this.getComs("axis","yaxis").getX(),u=this.radio;this.series=this.series.selectAll(".serie").data(t).enter().append("circle").each(function(){var t=d3.select(this);e.withAnimated?t.attr({"class":"serie",cx:function(e){return r(e[a])+(r.rangeBand?r.rangeBand()/2:0)},cy:function(e){return s(e[i])},r:0}).transition().duration(e.animatedTiming).ease(e.animatedEasing).attr({cx:function(e){return r(e[a])+(r.rangeBand?r.rangeBand()/2:0)},cy:function(e){return s(e[i])},r:function(e){return e[n]/u}}):t.attr({"class":"serie",cx:function(e){return r(e[a])+(r.rangeBand?r.rangeBand()/2:0)},cy:function(e){return s(e[i])},r:function(e){return e[n]/u}})})},updateSeries:function(){var e,t,a=this.options,i=this.data(),n=a.xaxis.key,r=a.yaxis.key,s=a.raxis.key;e=this.getComs("axis","xaxis"),e.update(i,a.xaxis);var u=e.getX(),c=u.rangeBand?u.rangeBand()/2:a.innerWidth/i.length/2,o=this.radio=_.max(i,function(e){return e[s]})[s]/c,d=_.min(i,function(e){return e[r]-e[s]/o});d=d[r]-d[s]/o;var x=_.max(i,function(e){return e[r]+e[s]/o});x=x[r]+x[s]/o,a.yaxis.max=x,a.yaxis.min=d,t=this.getComs("axis","yaxis"),t.update(i,a.yaxis);var h=t.getX();this.series.data(i),this.series.each(function(){var e=d3.select(this);e.attr({"class":"serie",cx:function(e){return u(e[n])+(u.rangeBand?u.rangeBand()/2:0)},cy:function(e){return h(e[r])},r:function(e){return e[s]/o}})})}}),module.exports=Bubble;
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