[Pkg-javascript-commits] [d3-tip.js] 14/277: implement corner radius
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 32dc314121c69eb7a0af5797db1a89861d364f0d
Author: Justin Palmer <justin at labratrevenge.com>
Date: Sun Jan 8 15:22:45 2012 -0800
implement corner radius
---
src/d3.tip.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/d3.tip.js b/src/d3.tip.js
index d403336..2230ab2 100644
--- a/src/d3.tip.js
+++ b/src/d3.tip.js
@@ -1,6 +1,7 @@
d3.svg.tip = function() {
var orient = 'top',
padding = 5,
+ cornerRadius = 3,
stemSize = 60,
offset = d3_svg_offset,
text = d3_svg_text,
@@ -32,8 +33,8 @@ d3.svg.tip = function() {
valRect.width = valRect.width + (padding * 2)
valRect.height = valRect.height + (padding * 2)
-
- backing.attr('width', valRect.width).attr('height', valRect.height)
+
+ backing.attr('width', valRect.width).attr('height', valRect.height).attr('rx', cornerRadius).attr('ry', cornerRadius)
val.attr('dx', valRect.width / 2).attr('dy', valRect.height / 2)
var backingRect = backing.node().getBBox();
@@ -116,6 +117,12 @@ d3.svg.tip = function() {
return tip;
};
+ tip.cornerRadius = function(v) {
+ if (!arguments.length) return cornerRadius;
+ cornerRadius = v;
+ return tip;
+ };
+
tip.stemSize = function(v) {
if (!arguments.length) return stemSize;
stemSize = v;
--
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