Skip to content

Commit 0fd9d75

Browse files
committed
fix(feed-summary): remove flow from trips chart
1 parent 1c50b4f commit 0fd9d75

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/manager/components/validation/TripsChart.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ export default class TripsChart extends Component {
1818
if (!this.props.validationResult) {
1919
return <Loading />
2020
}
21-
const {dailyTripCounts, firstCalendarDate, lastCalendarDate} = this.props.validationResult
21+
const {dailyTripCounts, firstCalendarDate} = this.props.validationResult
2222
const firstDate = moment(firstCalendarDate)
23-
const lastDate = moment(lastCalendarDate)
2423
const data = dailyTripCounts.map((count, index) =>
2524
[firstDate.clone().add(index, 'days'), count])
2625
const graphHeight = 300
@@ -31,8 +30,6 @@ export default class TripsChart extends Component {
3130
const svgHeight = graphHeight + bottomMargin
3231
const maxTrips = Math.max.apply(Math, data.map(d => d[1]))
3332
const yAxisMax = Math.ceil(maxTrips / 100) * 100
34-
// console.log(maxTrips, yAxisMax)
35-
3633
const yAxisPeriod = maxTrips > 1000 ? 1000 : 100
3734
const yAxisLabels = []
3835
for (var i = yAxisPeriod; i <= yAxisMax; i += yAxisPeriod) {
@@ -82,7 +79,8 @@ export default class TripsChart extends Component {
8279
: '#8da0cb'
8380
}
8481
strokeWidth={7} />
85-
{index % 14 === 0 /* label x-axis with dates every 14 days */
82+
{/* label x-axis with dates every 14 days */}
83+
{index % 14 === 0
8684
? <g>
8785
<line x1={x} y1={graphHeight} x2={x} y2={graphHeight + 12} stroke='black' />
8886
<text x={x - 35} y={graphHeight + 26} fill='black'>
@@ -93,8 +91,8 @@ export default class TripsChart extends Component {
9391
}
9492
</g>
9593
)
96-
}
97-
)}
94+
})}
95+
{/* Add baseline to chart */}
9896
<line
9997
x1={0}
10098
y1={graphHeight}

0 commit comments

Comments
 (0)