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.4 to 1.2.5

2

com/tooltip.js

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

function Tooltip(t,e,i,o){this.reset(),this.comObj=e,this.options={show:"true",formatter:{},trigger:"axis",backgroundColor:"",color:""},this.init(t,i,o),this._valid()}var _=require("../util"),Com=require("./index"),d3=require("d3");Tooltip=Com.extend(Tooltip,{_valid:function(){},renderSeries:function(){this.layer={};var t=d3.select(this.el[0][0].parentNode);this.layer.width=t.style("width"),this.layer.height=t.style("height"),this.layer.svgContainer=t,this.layer.xScale=this.comObj.getComs("axis","xaxis").getX(),this.dispatch=d3.dispatch("elementMouseover","elementMouseout"),this.tooltip=d3.select("body").append("div").attr("class","tooltip").style("opacity",0).style("position","absolute"),this.initGuildLayer()},show:function(t,e){"function"==typeof e&&(t=e(t));var i=this.defaultFormatter(t);"function"==typeof this.options.formatter&&(i=this.options.formatter(t)),this.tooltip.html(i),this.tooltip.transition().duration(200).style("opacity",.9),this.tooltip.style("left",d3.event.pageX+10+"px").style("top",d3.event.pageY-28+"px")},hide:function(){this.tooltip.transition().duration(500).style("opacity",0),this.renderGuildLayer(null)},defaultFormatter:function(t){return"x: "+t.x.toString()+"<br>y: "+t.y.toString()},initGuildLayer:function(){function t(){var t=d3.mouse(this),a=t[0],l=t[1],u=!0,d=!1;if(u&&(a-=n.left,l-=n.top),"mouseout"===d3.event.type||0>a||0>l||a>e||l>i||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||d)return r.elementMouseout({mouseX:a,mouseY:l}),void s.renderGuildLayer(null);s.renderGuildLayer(null);var h="function"==typeof o.rangeBands,p=void 0;if(h){var y=d3.bisect(o.range(),a)-1;if(!(o.range()[y]+o.rangeBand()>=a))return r.elementMouseout({mouseX:a,mouseY:l}),void s.renderGuildLayer(null);p=o.domain()[d3.bisect(o.range(),a)-1]}else p=o.invert(a);r.elementMouseover({mouseX:a,mouseY:l,pointXValue:p})}this.wrap=this.el.append("g").attr("class","guildLayer"),guildLineLayer=this.wrap.append("g").attr("class","guildLineLayer");var e=(guildLineLayer.append("g").attr("class","guildLine"),this.layer.width),i=this.layer.height,o=this.layer.xScale,r=this.dispatch,n=this.alloptions.margin,s=(this.renderGuildLayer,this);this.layer.svgContainer.on("mouseover",t).on("mouseout",t)},renderGuildLayer:function(t){d3.select(".series");var e=this.el.select(".guildLine").selectAll("line").data(null!=t?[t]:[],String);e.enter().append("line").attr("class","tooltip_guideline").attr("x1",function(t){return t}).attr("x2",function(t){return t}).attr("y1",this.layer.height).attr("y2",0-this.alloptions.margin.top),e.exit().remove()}}),module.exports=Tooltip;
function Tooltip(t,e,i,o){this.reset(),this.comObj=e,this.options={show:"true",formatter:{},trigger:"axis",backgroundColor:"",color:""},this.init(t,i,o),this._valid()}var _=require("../util"),Com=require("./index"),d3=require("d3");Tooltip=Com.extend(Tooltip,{_valid:function(){},renderSeries:function(){this.layer={};var t=d3.select(this.el[0][0].parentNode);this.layer.width=t.style("width"),this.layer.height=t.style("height"),this.layer.svgContainer=t,this.layer.xScale=this.comObj.getComs("axis","xaxis").getX(),this.dispatch=d3.dispatch("elementMouseover","elementMouseout"),this.tooltip=d3.select("body").append("div").attr("class","tooltip").style("opacity",0).style("position","absolute"),this.initGuildLayer()},show:function(t,e){"function"==typeof e&&(t=e(t));var i=this.defaultFormatter(t);"function"==typeof this.options.formatter&&(i=this.options.formatter(t)),this.tooltip.html(i),this.tooltip.transition().duration(200).style("opacity",.9),this.tooltip.style("left",d3.event.pageX+10+"px").style("top",d3.event.pageY-28+"px")},hide:function(){this.tooltip.transition().duration(500).style("opacity",0),this.renderGuildLayer(null)},defaultFormatter:function(t){return"x: "+t.x.toString()+"<br>y: "+t.y.toString()},initGuildLayer:function(){function t(){var t=d3.mouse(this),a=t[0],l=t[1],u=!0,d=!1;if(u&&(a-=n.left,l-=n.top),"mouseout"===d3.event.type||0>a||0>l||a>e||l>i||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||d)return r.elementMouseout({mouseX:a,mouseY:l}),void s.renderGuildLayer(null);s.renderGuildLayer(null);var h="function"==typeof o.rangeBands,p=void 0;if(h){var y=d3.bisect(o.range(),a)-1;if(!(o.range()[y]+o.rangeBand()>=a))return r.elementMouseout({mouseX:a,mouseY:l}),void s.renderGuildLayer(null);p=o.domain()[d3.bisect(o.range(),a)-1]}else p=o.invert(a);r.elementMouseover({mouseX:a,mouseY:l,pointXValue:p})}this.wrap=this.el.append("g").attr("class","guildLayer"),guildLineLayer=this.wrap.append("g").attr("class","guildLineLayer");var e=(guildLineLayer.append("g").attr("class","guildLine"),this.layer.width),i=this.layer.height,o=this.layer.xScale,r=this.dispatch,n=this.alloptions.margin,s=(this.renderGuildLayer,this);this.layer.svgContainer.on("mouseover",t).on("mouseout",t)},renderGuildLayer:function(t){d3.select(".series");var e=this.el.select(".guildLine").selectAll("line").data(null!=t?[t]:[],String);e.enter().append("line").attr("class","tooltip_guideline").attr("x1",function(t){return t}).attr("x2",function(t){return t}).attr("y1",this.layer.height).attr("y2",0-this.alloptions.margin.top),e.exit().remove()},destroy:function(){this.tooltip&&this.tooltip.remove()}}),module.exports=Tooltip;

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

var exports=module.exports;exports.destroy=function(){this.options.isFirst=!0,this.emptyRender(),this._com._removeAllComs(),this._removeAllEvent()},exports.emptyRender=function(){this.el.html&&this.el.html("")},exports.empty=function(){this.options.isFirst=!0,this.svg.html&&this.svg.html(""),this._com._removeAllComs(),this._removeAllEvent()};
var exports=module.exports;exports.destroy=function(){this.options.isFirst=!0,this.emptyRender(),this._com._removeAllComs(),this._removeAllEvent()},exports.emptyRender=function(){var t=this.options;if(this.el.html&&this.el.html(""),t.tooltip){var o=this.getComs("tooltip","tooltip");o.destroy&&o.destroy()}},exports.empty=function(){this.options.isFirst=!0,this.svg.html&&this.svg.html(""),this._com._removeAllComs(),this._removeAllEvent()};
{
"name": "dchart-core",
"version": "1.2.4",
"version": "1.2.5",
"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