Skip to content

Commit

Permalink
Recompute text sizes on redraw
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Dec 7, 2012
1 parent c07d88c commit 8660f01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions inst/d3/profr.coffee
Expand Up @@ -117,10 +117,11 @@ redraw = ->
# text.exit().remove()
# text.transition()

text
svg.selectAll("g").data(data, id).selectAll("text")
.each((d) -> this.__width = this.getBBox().width)
.style("opacity", (d) ->
.style("opacity", (d, i) ->
w = this.__width
# if i == 1 then console.log(w + " / " + width(d))
if w != 0 and w + 8 < width(d) then 1 else 0
)

Expand Down
4 changes: 2 additions & 2 deletions inst/d3/profr.js

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

0 comments on commit 8660f01

Please sign in to comment.