Skip to content

Commit

Permalink
feat(stack): add lines to StackDots
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Benitte committed May 8, 2016
1 parent fa879a0 commit 475b78b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/charts/stack/StackDots.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ class StackDots extends Component {
.style('pointer-events', 'all')
;

newSlices.selectAll('line').data(d => d).enter().append('line')
.attr('y1', d => yScale(d.y0 + d.y))
.attr('y2', d => yScale(d.y0))
.style('stroke-width', props.borderWidth)
.style('stroke', (d, i) => borderColorFn({ color: color(i) }))
;

newSlices.selectAll('circle').data(d => d).enter().append('circle')
.attr('r', props.radius)
.attr('transform', d => {
Expand Down Expand Up @@ -113,6 +120,17 @@ class StackDots extends Component {
.style('stroke-width', props.borderWidth)
.style('stroke', (d, i) => borderColorFn({ color: color(i) }))
;

elements
.selectAll('line').data(d => d)
.transition()
.duration(transitionDuration)
.ease(transitionEasing)
.attr('y1', d => yScale(d.y0 + d.y))
.attr('y2', d => yScale(d.y0))
.style('stroke-width', props.borderWidth)
.style('stroke', (d, i) => borderColorFn({ color: color(i) }))
;
};
}

Expand Down

0 comments on commit 475b78b

Please sign in to comment.