[Pkg-javascript-commits] [d3-tip.js] 112/277: first pass at initializing tooltip docs
bhuvan krishna
bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:21 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 730e750c49a79625f6eee0f44df10c0d6b227e66
Author: Justin Palmer <justin at github.com>
Date: Sun Apr 21 15:25:22 2013 -0700
first pass at initializing tooltip docs
---
docs/initializing-tooltips.md | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/docs/initializing-tooltips.md b/docs/initializing-tooltips.md
index 818a247..a3c75d2 100644
--- a/docs/initializing-tooltips.md
+++ b/docs/initializing-tooltips.md
@@ -1 +1,27 @@
-# Initializing tooltips
\ No newline at end of file
+[API Documentation](index.md) ➤ Initializing tooltips
+
+# Initializing tooltips
+
+### d3.tip
+Create and return a [configurable function](http://bost.ocks.org/mike/chart) for
+a tooltip.
+
+You ***must*** call the tip on the context of the target visualization.
+
+``` javascript
+var tip = d3.tip()
+ .attr('class', 'd3-tip')
+ .html(function(d) { return d; })
+
+var vis = d3.select(document.body)
+ .append('svg')
+ // REQUIRED: Call the tooltip on the context of the visualization
+ .call(tip)
+
+ vis.append('rect')
+ .attr('width', 100)
+ .attr('height', 100)
+ // Show and hide the tooltip
+ .on('mouseover', tip.show)
+ .on('mouseout', tip.hide)
+```
\ No newline at end of file
--
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