Introduces TemperatureColumn component
This commit is contained in:
@@ -0,0 +1,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
|
||||
Reference in New Issue
Block a user