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

d3-tip

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-tip - npm Package Compare versions

Comparing version 0.6.7 to 0.7.1

4

bower.json
{
"name": "d3-tip",
"version": "0.6.6",
"version": "0.7.1",
"main": "index.js",

@@ -15,4 +15,4 @@ "ignore": [

"dependencies": {
"d3": "3.4"
"d3": "^4.2"
}
}

@@ -12,6 +12,4 @@ // d3.tip

// CommonJS
module.exports = function(d3) {
d3.tip = factory(d3)
return d3.tip
}
var d3 = require('d3')
module.exports = factory(d3)
} else {

@@ -51,3 +49,3 @@ // Browser global.

dir = direction.apply(this, args),
nodel = d3.select(node),
nodel = getNodeEl(),
i = directions.length,

@@ -59,13 +57,12 @@ coords,

nodel.html(content)
.style({ opacity: 1, 'pointer-events': 'all' })
.style('opacity', 1).style('pointer-events', 'all')
while(i--) nodel.classed(directions[i], false)
coords = direction_callbacks.get(dir).apply(this)
nodel.classed(dir, true).style({
top: (coords.top + poffset[0]) + scrollTop + 'px',
left: (coords.left + poffset[1]) + scrollLeft + 'px'
})
nodel.classed(dir, true)
.style('top', (coords.top + poffset[0]) + scrollTop + 'px')
.style('left', (coords.left + poffset[1]) + scrollLeft + 'px')
return tip
}
return tip;
};

@@ -76,4 +73,4 @@ // Public - hide the tooltip

tip.hide = function() {
var nodel = d3.select(node)
nodel.style({ opacity: 0, 'pointer-events': 'none' })
var nodel = getNodeEl()
nodel.style('opacity', 0).style('pointer-events', 'none')
return tip

@@ -90,6 +87,6 @@ }

if (arguments.length < 2 && typeof n === 'string') {
return d3.select(node).attr(n)
return getNodeEl().attr(n)
} else {
var args = Array.prototype.slice.call(arguments)
d3.selection.prototype.attr.apply(d3.select(node), args)
d3.selection.prototype.attr.apply(getNodeEl(), args)
}

@@ -108,6 +105,6 @@

if (arguments.length < 2 && typeof n === 'string') {
return d3.select(node).style(n)
return getNodeEl().style(n)
} else {
var args = Array.prototype.slice.call(arguments)
d3.selection.prototype.style.apply(d3.select(node), args)
var args = Array.prototype.slice.call(arguments)
d3.selection.prototype.style.apply(getNodeEl(), args)
}

@@ -126,3 +123,3 @@

if (!arguments.length) return direction
direction = v == null ? v : d3.functor(v)
direction = v == null ? v : functor(v)

@@ -139,3 +136,3 @@ return tip

if (!arguments.length) return offset
offset = v == null ? v : d3.functor(v)
offset = v == null ? v : functor(v)

@@ -152,3 +149,3 @@ return tip

if (!arguments.length) return html
html = v == null ? v : d3.functor(v)
html = v == null ? v : functor(v)

@@ -158,2 +155,13 @@ return tip

// Public: destroys the tooltip and removes it from the DOM
//
// Returns a tip
tip.destroy = function() {
if(node) {
getNodeEl().remove();
node = null;
}
return tip;
}
function d3_tip_direction() { return 'n' }

@@ -241,10 +249,5 @@ function d3_tip_offset() { return [0, 0] }

function initNode() {
var node = d3.select(document.createElement('div'))
node.style({
position: 'absolute',
top: 0,
opacity: 0,
'pointer-events': 'none',
'box-sizing': 'border-box'
})
var node = d3.select(document.createElement('div'));
node.style('position', 'absolute').style('top', 0).style('opacity', 0)
.style('pointer-events', 'none').style('box-sizing', 'border-box')

@@ -262,2 +265,11 @@ return node.node()

function getNodeEl() {
if(node === null) {
node = initNode();
// re-add node to DOM
document.body.appendChild(node);
};
return d3.select(node);
}
// Private - gets the screen coordinates of a shape

@@ -312,2 +324,9 @@ //

}
// Private - replace D3JS 3.X d3.functor() function
function functor(v) {
return typeof v === "function" ? v : function() {
return v
}
}

@@ -314,0 +333,0 @@ return tip

{
"name": "d3-tip",
"version": "0.6.7",
"version": "0.7.1",
"description": "Tooltips for d3 svg visualizations",

@@ -22,3 +22,2 @@ "author": "Justin Palmer <justin@labratrevenge.com> (http://labratrevenge.com/d3-tip)",

],
"author": "Justin Palmer",
"license": "MIT",

@@ -28,3 +27,6 @@ "bugs": {

},
"homepage": "https://github.com/Caged/d3-tip"
"homepage": "https://github.com/Caged/d3-tip",
"dependencies": {
"d3": "^4.2"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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