Fix LTL bug, use column height, not chart height
This commit is contained in:
@@ -33,7 +33,7 @@ export default class CycleChart extends Component {
|
|||||||
const height = nativeEvent.layout.height
|
const height = nativeEvent.layout.height
|
||||||
this.setState({ chartHeight: height })
|
this.setState({ chartHeight: height })
|
||||||
this.reCalculateChartInfo = () => {
|
this.reCalculateChartInfo = () => {
|
||||||
this.setState({ columns: this.makeColumnInfo(nfpLines(height)) })
|
this.setState({ columns: this.makeColumnInfo(nfpLines()) })
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cycleDaysSortedByDate.addListener(this.reCalculateChartInfo)
|
this.cycleDaysSortedByDate.addListener(this.reCalculateChartInfo)
|
||||||
@@ -104,7 +104,7 @@ export default class CycleChart extends Component {
|
|||||||
dateString,
|
dateString,
|
||||||
y: temp ? normalizeToScale(temp, columnHeight) : null,
|
y: temp ? normalizeToScale(temp, columnHeight) : null,
|
||||||
symptoms,
|
symptoms,
|
||||||
...getFhmAndLtlInfo(dateString, temp)
|
...getFhmAndLtlInfo(dateString, temp, columnHeight)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export default class DayColumn extends Component {
|
|||||||
x2={x}
|
x2={x}
|
||||||
y2={columnHeight}
|
y2={columnHeight}
|
||||||
{...styles.nfpLine}
|
{...styles.nfpLine}
|
||||||
key='ltl'
|
key='fhm'
|
||||||
/>)
|
/>)
|
||||||
columnElements.push(fhmLine)
|
columnElements.push(fhmLine)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { getCycleStatusForDay } from '../../lib/sympto-adapter'
|
import { getCycleStatusForDay } from '../../lib/sympto-adapter'
|
||||||
import { normalizeToScale } from './y-axis'
|
import { normalizeToScale } from './y-axis'
|
||||||
|
|
||||||
export default function (chartHeight) {
|
export default function () {
|
||||||
const cycle = {
|
const cycle = {
|
||||||
status: null
|
status: null
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ export default function (chartHeight) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return function(dateString, temperature) {
|
return function(dateString, temperature, columnHeight) {
|
||||||
const ret = {
|
const ret = {
|
||||||
drawLtlAt: null,
|
drawLtlAt: null,
|
||||||
drawFhmLine: false
|
drawFhmLine: false
|
||||||
@@ -71,7 +71,7 @@ export default function (chartHeight) {
|
|||||||
dateIsInPeriOrPostPhase(dateString) &&
|
dateIsInPeriOrPostPhase(dateString) &&
|
||||||
isInTempMeasuringPhase(temperature, dateString)
|
isInTempMeasuringPhase(temperature, dateString)
|
||||||
) {
|
) {
|
||||||
ret.drawLtlAt = normalizeToScale(tempShift.ltl, chartHeight)
|
ret.drawLtlAt = normalizeToScale(tempShift.ltl, columnHeight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user