[Pkg-javascript-commits] [d3-tip.js] 09/277: simple readme
bhuvan krishna
bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:11 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 c4cc777ca36be819b2910137d2287fcb04b4aa52
Author: Justin Palmer <justin at labratrevenge.com>
Date: Sat Jan 7 14:32:57 2012 -0800
simple readme
---
README.md | 20 ++++++++++++++++++++
src/d3.tip.js | 10 +---------
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..174eac9
--- /dev/null
+++ b/README.md
@@ -0,0 +1,20 @@
+## Simple Tooltips for d3.js
+**ALPHA STATE**
+
+Pure SVG tooltips for [d3.js](http://mbostock.github.com/d3/)
+
+### Usage
+``` javascript
+// Setup
+tip = d3.svg.tip().text(function(d) { return d; });
+
+// Usage
+vis.selectAll('rect')
+ .data(data)
+.enter().append('rect')
+ .attr('width', function() { return x.rangeBand() })
+ .attr('height', function(d) { return h - y(d) })
+ .attr('y', function(d) { return y(d) })
+ .attr('x', function(d, i) { return x(i) })
+ .on('mouseover', tip)
+```
\ No newline at end of file
diff --git a/src/d3.tip.js b/src/d3.tip.js
index 8c9f011..1b7beaa 100644
--- a/src/d3.tip.js
+++ b/src/d3.tip.js
@@ -18,7 +18,7 @@ d3.svg.tip = function() {
bounds = doc.node().getBoundingClientRect(),
symbol = d3.svg.symbol().type('triangle-down').size(stemSize);
- //el.on('mouseout', function() { group.remove() })
+ el.on('mouseout', function() { group.remove() })
group.classed(klass, true).text(' ');
@@ -45,14 +45,6 @@ d3.svg.tip = function() {
if(x + rbbox.width > bounds.width) { x = bounds.width - rbbox.width }
if(y <= 0) { y = 0 }
- console.log(ebbox);
- doc.append('circle')
- .attr('class', 'debug')
- .attr('r', 2)
- .attr('cy', ebbox.top)
- .attr('cx', (ebbox.right - (ebbox.width / 2)))
- .style('fill', 'hotpink')
-
str.attr('dx', rbbox.width / 2).attr('dy', rbbox.height / 2)
group.attr('transform', "translate(" + x + "," + y + ")")
stem.attr('transform','translate(' + rbbox.width / 2 + ',' + (rbbox.height + stemBounds.height / 2) + ')')
--
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