Skip to content

Commit

Permalink
feat(bullet): support ranges that support < 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdjkelly authored and plouc committed Jul 16, 2020
1 parent d2ceffc commit 5dc5ce6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/bullet/src/Bullet.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export class Bullet extends Component {

const max = Math.max(...all)

const scale = scaleLinear().domain([0, max])
const min = Math.min(...all, 0)

const scale = scaleLinear().domain([min, max])

if (layout === 'horizontal') {
scale.range(reverse === true ? [width, 0] : [0, width])
Expand Down

0 comments on commit 5dc5ce6

Please sign in to comment.