[Pkg-javascript-commits] [d3-tip.js] 79/277: support offsets for tips

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

bhuvan-guest pushed a commit to branch master
in repository d3-tip.js.

commit ec59a228a2534f2ed6f63e4d4a793d91fd61e9f4
Author: Justin Palmer <justin at github.com>
Date:   Sun Apr 7 19:05:12 2013 -0700

    support offsets for tips
---
 src/d3.tip.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/d3.tip.js b/src/d3.tip.js
index fa5a485..902d0ff 100644
--- a/src/d3.tip.js
+++ b/src/d3.tip.js
@@ -22,6 +22,7 @@ d3.tip = function() {
   // Returns a tip
   tip.show = function(v) {
     var content = text.apply(this, arguments),
+        poffset = offset.apply(this, arguments),
         dir     = direction.apply(this, arguments),
         dirs    = direction_callbacks.keys(),
         nodel   = d3.select(node), i = 0,
@@ -30,7 +31,10 @@ d3.tip = function() {
     nodel.html(content).style('display', 'block')
     for(i; i < dirs.length; i++) nodel.classed(dirs[i], false)
     coords = direction_callbacks.get(dir).apply(this)
-    nodel.classed(dir, true).style({top: coords.top + 'px', left: coords.left + 'px'})
+    nodel.classed(dir, true).style({
+      top: (coords.top +  poffset[0]) + 'px',
+      left: (coords.left + poffset[1]) + 'px'
+    })
 
     return tip
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/d3-tip.js.git



More information about the Pkg-javascript-commits mailing list