Skip to content

Commit

Permalink
Fixed tooltip placement.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattflor committed Apr 24, 2016
1 parent 6169773 commit 5e308f7
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
10 changes: 7 additions & 3 deletions DESCRIPTION
Expand Up @@ -6,13 +6,17 @@ Description: Interactive Chord Diagrams via the D3 JavaScript library
Based on http://bl.ocks.org/mbostock/4062006 with some modifications
(fading) and additions (tooltips, bipartite diagram type).
URL: http://github.com/mattflor/chorddiag/
Depends: R (>= 3.2.0)
Depends:
R (>= 3.2.0)
License: GPL (>= 3)
LazyData: true
Imports: htmlwidgets (>= 0.4),
Imports:
htmlwidgets (>= 0.4),
RColorBrewer (>= 1.1-2)
Enhances: knitr,
shiny
Suggests: dplyr,
Suggests:
dplyr,
knitr
VignetteBuilder: knitr
RoxygenNote: 5.0.1
2 changes: 1 addition & 1 deletion NAMESPACE
@@ -1,4 +1,4 @@
# Generated by roxygen2 (4.1.1): do not edit by hand
# Generated by roxygen2: do not edit by hand

export(chorddiag)
export(chorddiagOutput)
Expand Down
3 changes: 2 additions & 1 deletion inst/examples/example.R
Expand Up @@ -16,7 +16,8 @@ m
# the number of people with different hair colors asked what hair color they
# prefer; this probably reflects how many people there were with the different
# hair colors
chorddiag(m)
chorddiag(m, showGroupnames = T)


# customization: colors, margin, padding
groupColors <- c("#000000", "#FFDD89", "#957244", "#F26223")
Expand Down
4 changes: 2 additions & 2 deletions inst/htmlwidgets/chorddiag.js
Expand Up @@ -69,7 +69,7 @@ HTMLWidgets.widget({
.style("font-size", tooltipFontsize + "px")
.style("font-family", "sans-serif")
.direction('mt')
.offset([0, 0])
.offset([10, 10])
.html(function(d) {
// indexes
var i = d.source.index,
Expand All @@ -95,7 +95,7 @@ HTMLWidgets.widget({
.style("font-size", tooltipFontsize + "px")
.style("font-family", "sans-serif")
.direction('mt')
.offset([0, 0])
.offset([10, 10])
.html(function(d) {
var value = sigFigs(d.value, precision);
return tooltipNames[d.index] + " (total): " + value + tooltipUnit;
Expand Down
2 changes: 1 addition & 1 deletion man/chorddiag-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/chorddiag.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/chorddiagOutput.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/renderChorddiag.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e308f7

Please sign in to comment.