Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react'
import PropTypes from 'prop-types'
import { Group, Path } from 'react-native/Libraries/ART/ReactNativeART'
import ChartLine from './chart-line'
import DotAndLine from './dot-and-line'
import styles from './styles'
import config from '../../config'
const TemperatureColumn = ({
horizontalLinePosition,
isVerticalLine,
data,
columnHeight
}) => {
const x = styles.nfpLine.strokeWidth / 2
return (
<Group>
<ChartLine
path={new Path().lineTo(0, columnHeight)}
/>
{horizontalLinePosition && <ChartLine
path={new Path()
.moveTo(0, horizontalLinePosition)
.lineTo(config.columnWidth, horizontalLinePosition)
}
isNfpLine={true}
key='ltl'
/>}
{isVerticalLine && <ChartLine
path={new Path().moveTo(x, x).lineTo(x, columnHeight)}
isNfpLine={true}
key='fhm'
/>}
{data && data.y && <DotAndLine
y={data.y}
exclude={data.temperatureExclude}
rightY={data.rightY}
rightTemperatureExclude={data.rightTemperatureExclude}
leftY={data.leftY}
leftTemperatureExclude={data.leftTemperatureExclude}
key='dotandline'
/>}
</Group>
)
}
TemperatureColumn.propTypes = {
horizontalLinePosition: PropTypes.number,
isVerticalLine: PropTypes.bool,
data: PropTypes.object,
columnHeight: PropTypes.number,
}
export default TemperatureColumn