Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
738a00c1
Commit
738a00c1
authored
6 years ago
by
Julia Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Draw NFP lines with svg
parent
bc796979
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/chart/day-column.js
+20
-32
20 additions, 32 deletions
components/chart/day-column.js
components/chart/styles.js
+8
-7
8 additions, 7 deletions
components/chart/styles.js
with
28 additions
and
39 deletions
components/chart/day-column.js
+
20
−
32
View file @
738a00c1
...
@@ -2,10 +2,7 @@ import React, { Component } from 'react'
...
@@ -2,10 +2,7 @@ import React, { Component } from 'react'
import
{
import
{
Text
,
View
,
TouchableOpacity
Text
,
View
,
TouchableOpacity
}
from
'
react-native
'
}
from
'
react-native
'
import
Svg
,{
import
Svg
,{
G
,
Rect
,
Line
}
from
'
react-native-svg
'
G
,
Rect
}
from
'
react-native-svg
'
import
Icon
from
'
react-native-vector-icons/Entypo
'
import
Icon
from
'
react-native-vector-icons/Entypo
'
import
styles
from
'
./styles
'
import
styles
from
'
./styles
'
import
config
from
'
../../config
'
import
config
from
'
../../config
'
...
@@ -51,16 +48,31 @@ export default class DayColumn extends Component {
...
@@ -51,16 +48,31 @@ export default class DayColumn extends Component {
const
columnElements
=
[]
const
columnElements
=
[]
if
(
drawLtlAt
)
{
if
(
drawLtlAt
)
{
const
ltlLine
=
(
<
View
const
ltlLine
=
(
<
Line
position
=
'
absolute
'
x1
=
{
0
}
width
=
{
'
100%
'
}
y1
=
{
drawLtlAt
}
top
=
{
drawLtlAt
}
x2
=
{
config
.
columnWidth
}
y2
=
{
drawLtlAt
}
{...
styles
.
nfpLine
}
{...
styles
.
nfpLine
}
key
=
'
ltl
'
key
=
'
ltl
'
/>
)
/>
)
columnElements
.
push
(
ltlLine
)
columnElements
.
push
(
ltlLine
)
}
}
if
(
drawFhmLine
)
{
const
x
=
styles
.
nfpLine
.
strokeWidth
/
2
const
fhmLine
=
(
<
Line
x1
=
{
x
}
y1
=
{
x
}
x2
=
{
x
}
y2
=
{
columnHeight
}
{...
styles
.
nfpLine
}
key
=
'
ltl
'
/>
)
columnElements
.
push
(
fhmLine
)
}
if
(
y
)
{
if
(
y
)
{
columnElements
.
push
(
columnElements
.
push
(
<
DotAndLine
<
DotAndLine
...
@@ -87,30 +99,6 @@ export default class DayColumn extends Component {
...
@@ -87,30 +99,6 @@ export default class DayColumn extends Component {
<
/Text
>
<
/Text
>
)
)
// we merge the colors here instead of from the stylesheet because of a RN
// bug that doesn't apply borderLeftColor otherwise
const
potentialCustomStyle
=
{
height
:
columnHeight
,
borderLeftColor
:
'
grey
'
,
}
if
(
drawFhmLine
)
{
potentialCustomStyle
.
borderLeftColor
=
styles
.
nfpLine
.
borderColor
potentialCustomStyle
.
borderLeftWidth
=
3
}
// const column = React.createElement(
// TouchableOpacity,
// {
// style: [styles.column.rect, potentialCustomStyle],
// key: this.props.index.toString(),
// onPress: () => {
// this.passDateToDayView(dateString)
// },
// activeOpacity: 1
// },
// columnElements
// )
const
column
=
(
const
column
=
(
<
G
>
<
G
>
<
Rect
<
Rect
...
...
This diff is collapsed.
Click to expand it.
components/chart/styles.js
+
8
−
7
View file @
738a00c1
...
@@ -6,6 +6,8 @@ const colorTemperatureLight = '#a67fb5'
...
@@ -6,6 +6,8 @@ const colorTemperatureLight = '#a67fb5'
const
dotRadius
=
5
const
dotRadius
=
5
const
lineWidth
=
1.5
const
lineWidth
=
1.5
const
colorLtl
=
'
#feb47b
'
const
colorLtl
=
'
#feb47b
'
const
gridColor
=
'
lightgrey
'
const
gridLineWidth
=
0.5
const
styles
=
{
const
styles
=
{
curve
:
{
curve
:
{
...
@@ -41,8 +43,8 @@ const styles = {
...
@@ -41,8 +43,8 @@ const styles = {
x
:
'
0
'
,
x
:
'
0
'
,
y
:
'
0
'
,
y
:
'
0
'
,
width
:
config
.
columnWidth
,
width
:
config
.
columnWidth
,
stroke
:
"
red
"
,
stroke
:
gridColor
,
strokeWidth
:
0.25
,
strokeWidth
:
gridLineWidth
,
fill
:
'
transparent
'
fill
:
'
transparent
'
}
}
},
},
...
@@ -80,16 +82,15 @@ const styles = {
...
@@ -80,16 +82,15 @@ const styles = {
},
},
horizontalGrid
:
{
horizontalGrid
:
{
position
:
'
absolute
'
,
position
:
'
absolute
'
,
borderColor
:
'
lightgrey
'
,
borderColor
:
gridColor
,
borderWidth
:
0.5
,
borderWidth
:
gridLineWidth
,
width
:
'
100%
'
,
width
:
'
100%
'
,
borderStyle
:
'
solid
'
,
borderStyle
:
'
solid
'
,
left
:
config
.
columnWidth
left
:
config
.
columnWidth
},
},
nfpLine
:
{
nfpLine
:
{
borderColor
:
colorLtl
,
stroke
:
colorLtl
,
borderWidth
:
lineWidth
,
strokeWidth
:
lineWidth
,
borderStyle
:
'
solid
'
},
},
symptomRow
:
{
symptomRow
:
{
alignItems
:
'
center
'
,
alignItems
:
'
center
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment