Skip to content

Commit

Permalink
feat(interactivity): add isInteractive property on multiple components
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte committed Aug 12, 2017
1 parent 4835a02 commit 16b7f4d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/charts/bar/Bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const Bar = ({
motionStiffness,
motionDamping,

// interactivity
isInteractive,
}) => {
const labelsLinkColor = getInheritedColorGenerator(_labelsLinkColor, 'axis.tickColor')
Expand Down Expand Up @@ -211,6 +212,7 @@ Bar.propTypes = {
// motion
...motionPropTypes,

// interactivity
isInteractive: PropTypes.bool,
}

Expand Down Expand Up @@ -239,6 +241,9 @@ export const BarDefaultProps = {
animate: true,
motionStiffness: Nivo.defaults.motionStiffness,
motionDamping: Nivo.defaults.motionDamping,

// interactivity
isInteractive: true,
}

Bar.defaultProps = BarDefaultProps
Expand Down
6 changes: 6 additions & 0 deletions src/components/charts/bubble/BubbleProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export const bubblePropTypes = {
...motionPropTypes,
transitionDuration: PropTypes.number.isRequired, // d3 transitions
transitionEasing: PropTypes.string.isRequired, // d3 transitions

// interactivity
isInteractive: PropTypes.bool.isRequired,
}

/**
Expand Down Expand Up @@ -94,4 +97,7 @@ export const bubbleDefaultProps = {
motionDamping: Nivo.defaults.motionDamping, // react-motion
transitionDuration: Nivo.defaults.transitionDuration, // d3 transitions
transitionEasing: Nivo.defaults.transitionEasing, // d3 transitions

// interactivity
isInteractive: true,
}
5 changes: 5 additions & 0 deletions src/components/charts/pie/Pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default class Pie extends Component {
// motion
...motionPropTypes,

// interactivity
isInteractive: PropTypes.bool,
}

Expand Down Expand Up @@ -105,6 +106,9 @@ export default class Pie extends Component {
animate: true,
motionStiffness: Nivo.defaults.motionStiffness,
motionDamping: Nivo.defaults.motionDamping,

// interactivity
isInteractive: true,
}

render() {
Expand Down Expand Up @@ -152,6 +156,7 @@ export default class Pie extends Component {
motionStiffness,
motionDamping,

// interactivity
isInteractive,
} = this.props

Expand Down
5 changes: 5 additions & 0 deletions src/components/charts/stream/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const Stream = ({
motionStiffness,
motionDamping,

// interactivity
isInteractive,
}) => {
const stack = d3Stack()
Expand Down Expand Up @@ -174,6 +175,7 @@ Stream.propTypes = {
// motion
...motionPropTypes,

// interactivity
isInteractive: PropTypes.bool,
}

Expand All @@ -196,6 +198,9 @@ export const StreamDefaultProps = {
animate: true,
motionStiffness: Nivo.defaults.motionStiffness,
motionDamping: Nivo.defaults.motionDamping,

// interactivity
isInteractive: true,
}

const enhance = compose(
Expand Down

0 comments on commit 16b7f4d

Please sign in to comment.