Improve var names
This commit is contained in:
+4
-4
@@ -23,12 +23,12 @@ export default class CycleChart extends Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
columns: makeColumnInfo(config.cycleDaysToShow)
|
columns: makeColumnInfo(config.xAxisRangeInDays)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.reCalculateChartInfo = (function(Chart) {
|
this.reCalculateChartInfo = (function(Chart) {
|
||||||
return function() {
|
return function() {
|
||||||
Chart.setState({columns: makeColumnInfo(config.cycleDaysToShow)})
|
Chart.setState({columns: makeColumnInfo(config.xAxisRangeInDays)})
|
||||||
}
|
}
|
||||||
})(this)
|
})(this)
|
||||||
|
|
||||||
@@ -176,9 +176,9 @@ function makeColumnInfo(n) {
|
|||||||
function getPreviousDays(n) {
|
function getPreviousDays(n) {
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
today.setHours(0); today.setMinutes(0); today.setSeconds(0); today.setMilliseconds(0)
|
today.setHours(0); today.setMinutes(0); today.setSeconds(0); today.setMilliseconds(0)
|
||||||
const twoWeeksAgo = new Date(today - (range.DAY * n))
|
const earlierDate = new Date(today - (range.DAY * n))
|
||||||
|
|
||||||
return range(twoWeeksAgo, today).reverse()
|
return range(earlierDate, today).reverse()
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeToScale(temp) {
|
function normalizeToScale(temp) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const config = {
|
|||||||
low: 33,
|
low: 33,
|
||||||
high: 40
|
high: 40
|
||||||
},
|
},
|
||||||
cycleDaysToShow: 40,
|
xAxisRangeInDays: 40
|
||||||
}
|
}
|
||||||
|
|
||||||
const margin = 3
|
const margin = 3
|
||||||
|
|||||||
Reference in New Issue
Block a user