health-template/example.org

284 lines
6.9 KiB
Org Mode
Raw Normal View History

2022-11-04 11:26:46 +01:00
#+begin_src elisp
(save-excursion
(let ((old-value org-confirm-babel-evaluate))
(setq org-confirm-babel-evaluate nil)
(org-update-all-dblocks)
(org-show-all)
(org-next-block 1)
(org-babel-execute-src-block)
(setq org-confirm-babel-evaluate old-value)))
#+end_src
2022-11-06 16:54:45 +01:00
2022-11-04 11:26:46 +01:00
#+begin_src elisp
(setq org-capture-templates '(("j" "Journal" entry (file+headline "~/tracking/tracking.org" "Journal")
"* %t
:PROPERTIES:
:exercise:
:sleep:
:nicotine:
:distress:
2022-11-06 16:54:45 +01:00
:missed:
2022-11-04 11:26:46 +01:00
:pain:
:END:
")))
#+end_src
2022-11-06 16:54:45 +01:00
2022-11-04 11:26:46 +01:00
#+begin_src gnuplot :var data=mydata
# clear graphics from any previous run
reset
# define output parameters
set terminal svg font "Arial" size 900,900
2022-11-06 16:54:45 +01:00
set output './example.svg'
2022-11-04 11:26:46 +01:00
# use org-mode format for input
set datafile separator "\t"
set timefmt "%Y-%m-%d"
# set up for time series data
set xdata time
set x2tics 1 format '' scale 0
# one X tick per day
set xtics 24*60*60
# vertical line on each day
set grid xtics
# one Y tick every five points
set ytics 5
# rotate labels to fit better
set xtics rotate by 60 right
set key box lc 'gray60'
set xtics format "%a %m/%d"
2022-11-06 16:54:45 +01:00
set yrange [0:40]
2022-11-04 11:26:46 +01:00
set linetype 1 lw 2 lc rgb 'forest-green' ps 1 pt 9
set linetype 2 lw 2 lc rgb 'purple' ps 1 pt 1
set linetype 3 lw 2 lc rgb 'dark-yellow' ps 1 pt 1
set linetype 4 lw 2 lc rgb 'dark-pink' ps 1 pt 1
2022-11-06 16:54:45 +01:00
set linetype 5 lw 2 lc rgb 'red' ps 1 pt 11
set linetype 6 lw 2 lc rgb 'orange' ps 1 pt 1
set linetype 7 lw 1 lc rgb 'forest-green'
set arrow 7 from graph 0, first 20 to graph 1, first 20 lt 7 dt '..'
2022-11-04 11:26:46 +01:00
set label "20" at graph 0.52, first 20 font 'Arial,16' tc rgb 'forest-green'
2022-11-06 16:54:45 +01:00
set linetype 8 lw 1 lc rgb 'purple'
set arrow 8 from graph 0, first 8 to graph 1, first 8 lt 8 dt '..'
2022-11-04 11:26:46 +01:00
set label "8" at graph 0.52, first 8 font 'Arial,16' tc rgb 'purple'
2022-11-06 16:54:45 +01:00
set linetype 9 lw 1 lc rgb 'dark-yellow'
set arrow 9 from graph 0, first 5 to graph 1, first 5 lt 9 dt '..'
2022-11-04 11:26:46 +01:00
set label "5" at graph 0.52, first 5 font 'Arial,16' tc rgb 'dark-yellow'
plot data using 1:($2 == 0 ? NaN : $2) with points title 'exercise (minutes)' lt 1, \
data using 1:3 with lines title 'sleep (hours)' lt 2, \
data using 1:4 with lines title 'nicotine (doses)' lt 3, \
data using 1:5 with lines title 'distress (scale)' lt 4, \
2022-11-06 16:54:45 +01:00
data using 1:($6 == 0 ? NaN : $6) with points title 'missed (doses)' lt 5, \
data using 1:7 with lines title 'pain (scale)' lt 6
2022-11-04 11:26:46 +01:00
#+end_src
#+RESULTS:
2022-11-06 16:54:45 +01:00
2022-11-04 11:26:46 +01:00
#+BEGIN: columnview :hlines 1 :id myid
#+tblname: mydata
2022-11-06 16:54:45 +01:00
| Date | exercise minutes | sleep hours | nicotine doses | distress scale | missed doses | pain scale |
|------------------+------------------+-------------+----------------+----------------+--------------+------------|
| | | | | | | |
| [2022-09-30 Fri] | 20 | 6 | 4 | 4 | 0 | 2 |
| [2022-10-01 Sat] | 10 | 7.5 | 6 | 3 | 0 | 2 |
| [2022-10-02 Sun] | 15 | 8 | 7 | 2 | 0 | 2 |
| [2022-10-03 Mon] | 0 | 6 | 5 | 2 | 0 | 2 |
| [2022-10-04 Tue] | 0 | 8.5 | 5 | 4 | 0 | 2 |
| [2022-10-05 Wed] | 15 | 8 | 5 | 4 | 0 | 2 |
| [2022-10-06 Thu] | 25 | 8.5 | 5 | 4 | 0 | 2 |
| [2022-10-07 Fri] | 25 | 6 | 5 | 3 | 0 | 2 |
| [2022-10-08 Sat] | 20 | 9 | 0 | 3 | 0 | 2 |
| [2022-10-09 Sun] | 0 | 6 | 3 | 4 | 0 | 2 |
| [2022-10-10 Mon] | 0 | 6 | 5 | 5 | 0 | 2 |
| [2022-10-11 Tue] | 0 | 6.5 | 4 | 4 | 0 | 2 |
| [2022-10-12 Wed] | 0 | 3 | 0 | 3 | 0 | 2 |
| [2022-10-13 Thu] | 0 | 4.5 | 0 | 3 | 0 | 3 |
| [2022-10-14 Fri] | 0 | 4 | 0 | 3 | 1 | 3 |
| [2022-10-15 Sat] | 0 | 5 | 0 | 3 | 0 | 2 |
| [2022-10-16 Sun] | 0 | 2 | 0 | 4 | 0 | 1 |
| [2022-10-17 Mon] | 0 | 4.5 | 0 | 3 | 0 | 2 |
2022-11-04 11:26:46 +01:00
#+END:
2022-11-06 16:54:45 +01:00
* Journal
:PROPERTIES:
:columns: %timestamp(Date) %exercise(exercise minutes) %sleep(sleep hours) %nicotine(nicotine doses) %distress(distress scale) %missed(missed doses) %pain(pain scale)
:ID: myid
:END:
2022-11-04 11:26:46 +01:00
** <2022-09-30 Fri>
:PROPERTIES:
:exercise: 20
:sleep: 6
:nicotine: 4
:distress: 4
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-01 Sat>
:PROPERTIES:
:exercise: 10
:sleep: 7.5
:nicotine: 6
:distress: 3
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-02 Sun>
:PROPERTIES:
:exercise: 15
:sleep: 8
:nicotine: 7
:distress: 2
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-03 Mon>
:PROPERTIES:
:exercise: 0
:sleep: 6
:nicotine: 5
:distress: 2
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-04 Tue>
:PROPERTIES:
:exercise: 0
:sleep: 8.5
:nicotine: 5
:distress: 4
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-05 Wed>
:PROPERTIES:
:exercise: 15
:sleep: 8
:nicotine: 5
:distress: 4
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-06 Thu>
:PROPERTIES:
:exercise: 25
:sleep: 8.5
:nicotine: 5
:distress: 4
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-07 Fri>
:PROPERTIES:
:exercise: 25
:sleep: 6
:nicotine: 5
:distress: 3
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-08 Sat>
:PROPERTIES:
:exercise: 20
:sleep: 9
:nicotine: 0
:distress: 3
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-09 Sun>
:PROPERTIES:
:exercise: 0
:sleep: 6
:nicotine: 3
:distress: 4
:pain: 2
:meditation: 0
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-10 Mon>
:PROPERTIES:
:exercise: 0
:sleep: 6
:nicotine: 5
:distress: 5
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-11 Tue>
:PROPERTIES:
:exercise: 0
:sleep: 6.5
:nicotine: 4
:distress: 4
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-12 Wed>
:PROPERTIES:
:exercise: 0
:sleep: 3
:nicotine: 0
:distress: 3
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-13 Thu>
:PROPERTIES:
:exercise: 0
:sleep: 4.5
:nicotine: 0
:distress: 3
:pain: 3
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-14 Fri>
:PROPERTIES:
:exercise: 0
:sleep: 4
:nicotine: 0
:distress: 3
:pain: 3
2022-11-06 16:54:45 +01:00
:missed: 1
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-15 Sat>
:PROPERTIES:
:exercise: 0
:sleep: 5
:nicotine: 0
:distress: 3
:pain: 2
2022-11-06 16:54:45 +01:00
:missed: 0
2022-11-04 11:26:46 +01:00
:END:
** <2022-10-16 Sun>
:PROPERTIES:
:exercise: 0
:sleep: 2
:nicotine: 0
:distress: 4
:missed: 0
:pain: 1
:END:
** <2022-10-17 Mon>
:PROPERTIES:
:exercise: 0
:sleep: 4.5
:nicotine: 0
:distress: 3
:missed: 0
:pain: 2
:END: