Skip to content

Commit

Permalink
Merge pull request #953 from cozy/fix-d3-transition
Browse files Browse the repository at this point in the history
fix: Bad transition fix when reducing d3 size
  • Loading branch information
ptbrowne authored Feb 27, 2019
2 parents ec8c5af + 7e35629 commit fda42f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/Chart/LineChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,26 +380,30 @@ class LineChart extends Component {
this.mask.attr('opacity', 0)
}

d3.transition(this.line)
this.line
.attr('stroke-dasharray', lineTotalLength)
.attr('stroke-dashoffset', lineTotalLength)
.transition()
.duration(this.props.enterAnimationDuration)
.ease(d3.easeExpInOut)
.attr('stroke-dashoffset', 0)
.on('end', () => {
if (this.mask) {
d3.transition(this.mask)
this.mask
.transition()
.duration(250)
.ease(d3.easeLinear)
.attr('opacity', 1)

d3.transition(this.point)
this.point
.transition()
.duration(200)
.ease(d3.easeLinear)
.attr('r', this.props.pointRadius)
.attr('stroke-width', this.props.pointStrokeWidth)

d3.transition(this.pointLine)
this.pointLine
.transition()
.duration(400)
.ease(d3.easeExpIn)
.attr('opacity', 1)
Expand Down

0 comments on commit fda42f1

Please sign in to comment.