diff --git a/components/chart/chart.js b/components/chart/chart.js
index 2bb8097..f60b63c 100644
--- a/components/chart/chart.js
+++ b/components/chart/chart.js
@@ -18,7 +18,7 @@ export default class CycleChart extends Component {
this.renderColumn = ({item, index}) => {
return (
)
}
@@ -62,6 +59,7 @@ export default class DayColumn extends Component {
left = {config.columnMiddle - styles.mucusIcon.width / 2}
{...styles.mucusIcon}
backgroundColor={styles.mucusIconShades[mucus]}
+ key='mucus'
/>
)
columnElements.push(mucusIcon)
@@ -74,6 +72,7 @@ export default class DayColumn extends Component {
width={styles.nfpLine.strokeWidth}
height={200}
{...styles.nfpLine}
+ key='fhm'
/>)
columnElements.push(fhmLine)
}
@@ -84,6 +83,7 @@ export default class DayColumn extends Component {
width={'100%'}
top={nfpLineInfo.drawLtlAt}
{...styles.nfpLine}
+ key='ltl'
/>)
columnElements.push(ltlLine)
}
@@ -93,8 +93,11 @@ export default class DayColumn extends Component {
)
}
@@ -111,7 +114,7 @@ export default class DayColumn extends Component {
)
columnElements.push(
-
+
{cycleDayLabel}
{dateLabel}
diff --git a/components/chart/dot-and-line.js b/components/chart/dot-and-line.js
index 92e5f63..d626c94 100644
--- a/components/chart/dot-and-line.js
+++ b/components/chart/dot-and-line.js
@@ -4,6 +4,10 @@ import styles from './styles'
import config from './config'
export default class DotAndLine extends Component {
+ shouldComponentUpdate(newProps) {
+ return Object.keys(newProps).some(key => newProps[key] != this.props[key])
+ }
+
render() {
const y = this.props.y
const exclude = this.props.exclude
@@ -28,6 +32,7 @@ export default class DotAndLine extends Component {
top={y - (dotStyle.height / 2)}
left={config.columnMiddle - (dotStyle.width / 2)}
style={dotStyle}
+ key='dot'
/>
)
return [lineToLeft, lineToRight, dot]
@@ -61,5 +66,6 @@ function makeLine(leftY, rightY, direction, excludeLine) {
],
}}
{...lineStyle}
+ key ={direction}
/>)
}
\ No newline at end of file