@@ -18,9 +18,8 @@ export default class TripsChart extends Component {
18
18
if ( ! this . props . validationResult ) {
19
19
return < Loading />
20
20
}
21
- const { dailyTripCounts, firstCalendarDate, lastCalendarDate } = this . props . validationResult
21
+ const { dailyTripCounts, firstCalendarDate} = this . props . validationResult
22
22
const firstDate = moment ( firstCalendarDate )
23
- const lastDate = moment ( lastCalendarDate )
24
23
const data = dailyTripCounts . map ( ( count , index ) =>
25
24
[ firstDate . clone ( ) . add ( index , 'days' ) , count ] )
26
25
const graphHeight = 300
@@ -31,8 +30,6 @@ export default class TripsChart extends Component {
31
30
const svgHeight = graphHeight + bottomMargin
32
31
const maxTrips = Math . max . apply ( Math , data . map ( d => d [ 1 ] ) )
33
32
const yAxisMax = Math . ceil ( maxTrips / 100 ) * 100
34
- // console.log(maxTrips, yAxisMax)
35
-
36
33
const yAxisPeriod = maxTrips > 1000 ? 1000 : 100
37
34
const yAxisLabels = [ ]
38
35
for ( var i = yAxisPeriod ; i <= yAxisMax ; i += yAxisPeriod ) {
@@ -82,7 +79,8 @@ export default class TripsChart extends Component {
82
79
: '#8da0cb'
83
80
}
84
81
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
86
84
? < g >
87
85
< line x1 = { x } y1 = { graphHeight } x2 = { x } y2 = { graphHeight + 12 } stroke = 'black' />
88
86
< text x = { x - 35 } y = { graphHeight + 26 } fill = 'black' >
@@ -93,8 +91,8 @@ export default class TripsChart extends Component {
93
91
}
94
92
</ g >
95
93
)
96
- }
97
- ) }
94
+ } ) }
95
+ { /* Add baseline to chart */ }
98
96
< line
99
97
x1 = { 0 }
100
98
y1 = { graphHeight }
0 commit comments