[Pkg-javascript-commits] [d3-tip.js] 232/277: update documentation with an offset callback example

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:34 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 936f88111772f2a5f52ace6a659e9b21af327a42
Author: Brian Galey <bkgaley at gmail.com>
Date:   Thu Mar 27 19:49:21 2014 -0700

    update documentation with an offset callback example
---
 docs/positioning-tooltips.md | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/docs/positioning-tooltips.md b/docs/positioning-tooltips.md
index 1a2fb61..5845d78 100644
--- a/docs/positioning-tooltips.md
+++ b/docs/positioning-tooltips.md
@@ -31,3 +31,12 @@ enough in the desired direction so the extender doesn't overlap the target eleme
 ``` javascript
 tip.offset([10, -10])
 ```
+
+Callbacks are also supported for dynamic positioning.  The following example
+will center tip placement within the bounding box of the target element.
+
+``` javascript
+tip.offset(function() {
+  return [this.getBBox().height / 2, 0]
+})
+```

-- 
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