issue number in tooltip
This commit is contained in:
parent
1d2f4b6e37
commit
b36ca9d87b
|
@ -16,16 +16,14 @@ module.exports =
|
||||||
min = +Infinity ; max = -Infinity
|
min = +Infinity ; max = -Infinity
|
||||||
|
|
||||||
# Generate the actual closes.
|
# Generate the actual closes.
|
||||||
rest = _.map collection, ({ closed_at, size, title, html_url }) ->
|
rest = _.map collection, (issue) ->
|
||||||
|
{ size, closed_at } = issue
|
||||||
min = size if size < min
|
min = size if size < min
|
||||||
max = size if size > max
|
max = size if size > max
|
||||||
{
|
|
||||||
|
_.extend {}, issue,
|
||||||
date: new Date(closed_at)
|
date: new Date(closed_at)
|
||||||
points: total -= size
|
points: total -= size
|
||||||
size
|
|
||||||
title
|
|
||||||
html_url
|
|
||||||
}
|
|
||||||
|
|
||||||
# Now add a radius in a range (will be used for a circle).
|
# Now add a radius in a range (will be used for a circle).
|
||||||
range = d3.scale.linear().domain([ min, max ]).range([ 5, 8 ])
|
range = d3.scale.linear().domain([ min, max ]).range([ 5, 8 ])
|
||||||
|
@ -182,9 +180,9 @@ module.exports =
|
||||||
.attr("cx", ({ date }) -> x date )
|
.attr("cx", ({ date }) -> x date )
|
||||||
.attr("cy", ({ points }) -> y points )
|
.attr("cy", ({ points }) -> y points )
|
||||||
.attr("r", ({ radius }) -> 5 ) # fixed for now
|
.attr("r", ({ radius }) -> 5 ) # fixed for now
|
||||||
.on('mouseover', ({ date, points, title }) ->
|
.on('mouseover', ({ date, points, title, number }) ->
|
||||||
# Pass a title string.
|
# Pass a title string.
|
||||||
tooltip = new Tip title
|
tooltip = new Tip "##{number}: #{title}"
|
||||||
# Absolutely position the div.
|
# Absolutely position the div.
|
||||||
div = document.querySelector '#tooltip'
|
div = document.querySelector '#tooltip'
|
||||||
div.style.left = x(date) + margin.left + 'px'
|
div.style.left = x(date) + margin.left + 'px'
|
||||||
|
|
Loading…
Reference in New Issue