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
b63a9560
Commit
b63a9560
authored
6 years ago
by
Julia Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Draw horizontal line only during temp measuring phase
parent
4b5f4f90
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/chart/chart.js
+36
-11
36 additions, 11 deletions
components/chart/chart.js
with
36 additions
and
11 deletions
components/chart/chart.js
+
36
−
11
View file @
b63a9560
...
...
@@ -65,7 +65,7 @@ export default class CycleChart extends Component {
const
label
=
styles
.
column
.
label
const
dateLabel
=
dateString
.
split
(
'
-
'
).
slice
(
1
).
join
(
'
-
'
)
const
getFhmAndLtlInfo
=
setUpFertilityStatusFunc
()
const
nfpLineInfo
=
getFhmAndLtlInfo
(
dateString
)
const
nfpLineInfo
=
getFhmAndLtlInfo
(
dateString
,
cycleDay
)
return
(
<
G
onPress
=
{()
=>
this
.
passDateToDayView
(
dateString
)}
>
...
...
@@ -81,8 +81,12 @@ export default class CycleChart extends Component {
{
this
.
placeHorizontalGrid
()}
<
Text
{...
label
.
number
}
y
=
{
config
.
cycleDayNumberRowY
}
>
{
cycleDayNumber
}
<
/Text
>
<
Text
{...
label
.
date
}
y
=
{
config
.
dateRowY
}
>
{
dateLabel
}
<
/Text
>
<
Text
{...
label
.
number
}
y
=
{
config
.
cycleDayNumberRowY
}
>
{
cycleDayNumber
}
<
/Text
>
<
Text
{...
label
.
date
}
y
=
{
config
.
dateRowY
}
>
{
dateLabel
}
<
/Text
>
{
cycleDay
&&
cycleDay
.
bleeding
?
<
Path
{...
styles
.
bleedingIcon
}
...
...
@@ -101,7 +105,10 @@ export default class CycleChart extends Component {
{...
styles
.
nfpLine
}
/> : null
}
{
y
?
this
.
drawDotAndLines
(
y
,
cycleDay
.
temperature
.
exclude
,
index
)
:
null
}
{
y
?
this
.
drawDotAndLines
(
y
,
cycleDay
.
temperature
.
exclude
,
index
)
:
null
}
<
/G
>
)
}
...
...
@@ -197,15 +204,18 @@ function makeColumnInfo(n) {
function
getPreviousDays
(
n
)
{
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
earlierDate
=
new
Date
(
today
-
(
range
.
DAY
*
n
))
return
range
(
earlierDate
,
today
).
reverse
()
}
function
normalizeToScale
(
temp
)
{
const
temperatureS
cale
=
config
.
temperatureScale
const
valueRelativeToScale
=
(
temperatureS
cale
.
high
-
temp
)
/
(
temperatureScale
.
high
-
temperatureS
cale
.
low
)
const
s
cale
=
config
.
temperatureScale
const
valueRelativeToScale
=
(
s
cale
.
high
-
temp
)
/
(
scale
.
high
-
s
cale
.
low
)
const
scaleHeight
=
config
.
chartHeight
return
scaleHeight
*
valueRelativeToScale
}
...
...
@@ -264,7 +274,15 @@ function setUpFertilityStatusFunc() {
)
}
return
function
(
dateString
)
{
function
precededByAnotherTempValue
(
dateString
)
{
return
Object
.
keys
(
cycleStatus
.
phases
).
some
(
phaseName
=>
{
return
cycleStatus
.
phases
[
phaseName
].
cycleDays
.
some
(
day
=>
{
return
day
.
temperature
&&
day
.
date
<
dateString
})
})
}
return
function
(
dateString
,
cycleDay
)
{
const
ret
=
{}
if
(
!
cycleStatus
&&
!
noMoreCycles
)
updateCurrentCycle
(
dateString
)
if
(
noMoreCycles
)
return
ret
...
...
@@ -272,14 +290,21 @@ function setUpFertilityStatusFunc() {
if
(
dateString
<
cycleStartDate
)
updateCurrentCycle
(
dateString
)
if
(
noMoreCycles
)
return
ret
// now we know we have the current cycle
const
tempShift
=
cycleStatus
.
temperatureShift
if
(
tempShift
&&
tempShift
.
firstHighMeasurementDay
.
date
===
dateString
)
{
if
(
tempShift
&&
tempShift
.
firstHighMeasurementDay
.
date
===
dateString
)
{
ret
.
drawFhmLine
=
true
}
if
(
tempShift
&&
dateIsInPeriOrPostPhase
(
dateString
))
{
if
(
tempShift
&&
cycleDay
&&
(
cycleDay
.
temperature
||
precededByAnotherTempValue
(
dateString
))
&&
dateIsInPeriOrPostPhase
(
dateString
)
)
{
ret
.
drawLtlAt
=
normalizeToScale
(
tempShift
.
ltl
)
}
...
...
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