ADD dashed visualisation
This commit is contained in:
parent
7f3881ccd5
commit
9d648c70cb
@ -101,12 +101,14 @@
|
|||||||
if type(line) == dictionary {
|
if type(line) == dictionary {
|
||||||
complemented_task.push(arg)
|
complemented_task.push(arg)
|
||||||
} else {
|
} else {
|
||||||
let (date, eod) = arg
|
let (date, eod, ..) = arg
|
||||||
|
let dashed = arg.at(2, default: false)
|
||||||
|
let real = arg.at(3, default: false)
|
||||||
|
|
||||||
let weeks = 0
|
let weeks = 0
|
||||||
let foo = date-beginning
|
let foo = date-beginning
|
||||||
let task-week-duration = if type(eod) == datetime {
|
let task-week-duration = if type(eod) == datetime {
|
||||||
dtc.count-weeks(date, eod)
|
dtc.diff-weeks-workingday(date, eod)
|
||||||
} else {
|
} else {
|
||||||
eod
|
eod
|
||||||
}
|
}
|
||||||
@ -117,15 +119,50 @@
|
|||||||
|
|
||||||
weeks = weeks - 1 + dtc.workingday_ratio(date)
|
weeks = weeks - 1 + dtc.workingday_ratio(date)
|
||||||
let end = weeks + task-week-duration
|
let end = weeks + task-week-duration
|
||||||
|
// let p = pattern(size: (4pt, 4pt))[
|
||||||
|
// #line(start: (0pt, 3pt), end: (4pt, 0pt), stroke: black.lighten(20%) + .3pt)
|
||||||
|
// ]
|
||||||
|
let p = pattern(size: (4.5pt, 4.01pt))[
|
||||||
|
#circle(radius: 1.5pt, fill: gray.lighten(20%))
|
||||||
|
//#line(start: (0pt, 3pt), end: (4pt, 0pt), stroke: black.lighten(20%) + .3pt)
|
||||||
|
]
|
||||||
|
|
||||||
complemented_task.push((weeks, end))
|
if dashed {
|
||||||
|
complemented_task.push((
|
||||||
|
from: weeks,
|
||||||
|
to: end,
|
||||||
|
style: (
|
||||||
|
stroke: (
|
||||||
|
dash: "loosely-dotted",
|
||||||
|
thickness: 2.5pt,
|
||||||
|
paint: gray.lighten(10%),
|
||||||
|
cap: "round",
|
||||||
|
)
|
||||||
|
// stroke: (paint: p, thickness: 4pt)
|
||||||
|
)
|
||||||
|
))
|
||||||
|
} else if real{
|
||||||
|
complemented_task.push((
|
||||||
|
from: weeks,
|
||||||
|
to: end,
|
||||||
|
style: (
|
||||||
|
stroke: (
|
||||||
|
//dash: "dotted",
|
||||||
|
thickness: 1pt,
|
||||||
|
paint: rgb("#ff0000")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
))
|
||||||
|
} else {
|
||||||
|
complemented_task.push((weeks, end))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
timeliney.task(
|
timeliney.task(
|
||||||
align(center, description),
|
align(center, description),
|
||||||
..complemented_task,
|
..complemented_task,
|
||||||
style: (stroke: 2pt + gray)
|
style: (stroke: 5pt + gray.lighten(40%))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user