Skip to content

Commit

Permalink
Merge pull request #9 from tw15egan/line-graph-fix
Browse files Browse the repository at this point in the history
fix(line-graph): return mouse position on hover
  • Loading branch information
tw15egan authored Sep 21, 2017
2 parents 17eaabb + 4546583 commit ee5cf12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/LineGraph/LineGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class LineGraph extends Component {
.attr('d', line);

var totalLength = path.node().getTotalLength();

path
.attr('stroke-dasharray', 0 + ' ' + totalLength)
.transition()
Expand Down Expand Up @@ -208,8 +209,7 @@ class LineGraph extends Component {
const d0 = data[index - 1];
const d1 = data[index];
const d = timestamp - d0[1] > d1[1] - timestamp ? d1 : d0;

this.props.onHover(d);
this.props.onHover(d, d3.event.pageX, d3.event.pageY);
}

render() {
Expand Down

0 comments on commit ee5cf12

Please sign in to comment.