From 16b7f4dfffe56b8936104c411b2e3e62c5b47e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Benitte?= Date: Sat, 12 Aug 2017 14:53:35 +0900 Subject: [PATCH] feat(interactivity): add isInteractive property on multiple components --- src/components/charts/bar/Bar.js | 5 +++++ src/components/charts/bubble/BubbleProps.js | 6 ++++++ src/components/charts/pie/Pie.js | 5 +++++ src/components/charts/stream/Stream.js | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/src/components/charts/bar/Bar.js b/src/components/charts/bar/Bar.js index a36d77fe0..fc1ea5041 100644 --- a/src/components/charts/bar/Bar.js +++ b/src/components/charts/bar/Bar.js @@ -58,6 +58,7 @@ const Bar = ({ motionStiffness, motionDamping, + // interactivity isInteractive, }) => { const labelsLinkColor = getInheritedColorGenerator(_labelsLinkColor, 'axis.tickColor') @@ -211,6 +212,7 @@ Bar.propTypes = { // motion ...motionPropTypes, + // interactivity isInteractive: PropTypes.bool, } @@ -239,6 +241,9 @@ export const BarDefaultProps = { animate: true, motionStiffness: Nivo.defaults.motionStiffness, motionDamping: Nivo.defaults.motionDamping, + + // interactivity + isInteractive: true, } Bar.defaultProps = BarDefaultProps diff --git a/src/components/charts/bubble/BubbleProps.js b/src/components/charts/bubble/BubbleProps.js index fc4a9599b..857724fa9 100644 --- a/src/components/charts/bubble/BubbleProps.js +++ b/src/components/charts/bubble/BubbleProps.js @@ -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, } /** @@ -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, } diff --git a/src/components/charts/pie/Pie.js b/src/components/charts/pie/Pie.js index 0bf59ac55..8ad8499fd 100644 --- a/src/components/charts/pie/Pie.js +++ b/src/components/charts/pie/Pie.js @@ -70,6 +70,7 @@ export default class Pie extends Component { // motion ...motionPropTypes, + // interactivity isInteractive: PropTypes.bool, } @@ -105,6 +106,9 @@ export default class Pie extends Component { animate: true, motionStiffness: Nivo.defaults.motionStiffness, motionDamping: Nivo.defaults.motionDamping, + + // interactivity + isInteractive: true, } render() { @@ -152,6 +156,7 @@ export default class Pie extends Component { motionStiffness, motionDamping, + // interactivity isInteractive, } = this.props diff --git a/src/components/charts/stream/Stream.js b/src/components/charts/stream/Stream.js index 6cbe13b6a..5c97668e5 100644 --- a/src/components/charts/stream/Stream.js +++ b/src/components/charts/stream/Stream.js @@ -69,6 +69,7 @@ const Stream = ({ motionStiffness, motionDamping, + // interactivity isInteractive, }) => { const stack = d3Stack() @@ -174,6 +175,7 @@ Stream.propTypes = { // motion ...motionPropTypes, + // interactivity isInteractive: PropTypes.bool, } @@ -196,6 +198,9 @@ export const StreamDefaultProps = { animate: true, motionStiffness: Nivo.defaults.motionStiffness, motionDamping: Nivo.defaults.motionDamping, + + // interactivity + isInteractive: true, } const enhance = compose(