Skip to content

Commit

Permalink
fix(bar): add new prop valueScale to BarCanvas (pmndrs#1274)
Browse files Browse the repository at this point in the history
Also adds the default values for the Bar chart.

This fixes pmndrs#1273
  • Loading branch information
bobylito committed Nov 12, 2020
1 parent e98d8e0 commit d66acd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/bar/src/BarCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { renderAxesToCanvas, renderGridLinesToCanvas } from '@nivo/axes'
import { renderLegendToCanvas } from '@nivo/legends'
import { BasicTooltip } from '@nivo/tooltip'
import { generateGroupedBars, generateStackedBars } from './compute'
import { BarPropTypes } from './props'
import { BarDefaultProps, BarPropTypes } from './props'
import enhance from './enhance'

const findNodeUnderCursor = (nodes, margin, x, y) =>
Expand Down Expand Up @@ -55,6 +55,8 @@ class BarCanvas extends Component {
minValue,
maxValue,

valueScale,

width,
height,
outerWidth,
Expand Down Expand Up @@ -104,6 +106,7 @@ class BarCanvas extends Component {
getColor,
padding,
innerPadding,
valueScale,
}

const result =
Expand Down Expand Up @@ -284,5 +287,6 @@ class BarCanvas extends Component {
}

BarCanvas.propTypes = BarPropTypes
BarCanvas.defaultProps = BarDefaultProps

export default setDisplayName('BarCanvas')(enhance(BarCanvas))

0 comments on commit d66acd6

Please sign in to comment.