mermaid
mermaid copied to clipboard
Starting task after milestone doesn't work with >1 milestone
Description
Here's a gantt that starts two tasks after a milestone, and another task after a second milestone
gantt
title plan 2023
dateFormat YYYY-MM-DD
axisFormat %m/%y
excludes weekends
M1, :milestone, 2023-01-01, m1
M2, :milestone, 2023-02-01, m2
Task 1 :t1, after m1, 30d
Task 2 :t2, after m1, 15d
Task 3 :t3, after m2, 10d
But if I change task 3 to start after m1, everything is fine:
Now lets start everything after m2
gantt
title plan 2023
dateFormat YYYY-MM-DD
axisFormat %m/%y
excludes weekends
M1, :milestone, 2023-01-01, m1
M2, :milestone, 2023-02-01, m2
Task 1 :t1, after m2, 30d
Task 2 :t2, after m2, 15d
Task 3 :t3, after m2, 10d
Steps to reproduce
See above.
Screenshots
Above.
Code Sample
Above.
Setup
Mermaid.live: https://mermaid.live/edit#pako:eNptkLFqwzAQhl9FCLLJ1JbporWmm6DQLgUth3VORSQ5WGeaEPLuvUQpuNBDg_i_Dx36L3KcPUoj95CJXBY8FCiisG8v4hghC93qvgIPhK_zkoDEJ09jbTMMFcEplAfapafduaZ4GuPqsYhvxANmX1yuwHZKmBQiFpozqvuOpu34KJG6h6P_c3R19O9LH1AOohOGOIWJcGGmRN_6DdaM9RZ3z1vcM-7_4NZLJRPyd4Lnbi432Un6woROGr56nGCN5KTLV1Zhpfn9nEdpaFlRyfV4q2oIsF8gSTNBLJyiDzQvtvZ9r_36AwEdcy8
Additional Context
Also broken on github, gitlab. Didn't try CLI version.
There's perhaps a few things going on:
- There' s a logic error in the parser
- There's an undiagnosed error in my syntax (no error msg)
- There's an undocumented "feature" going on here
For example, it works if I do this:
title plan 2023
dateFormat YYYY-MM-DD
axisFormat %m/%y
excludes weekends
M1, :milestone, m1, 2023-01-01,
M2, :milestone, m2, 2023-02-01,
Task 1 :t1, after m1, 30d
Task 2 :t2, after m1, 15d
Task 3 :t3, after m2, 10d
Why do I need a comma on the end? No idea.
An indicator might be that the syntax of milestones requires a "duration":
As you may notice, the exact location of the milestone is determined by the initial date for the milestone and the "duration" of the task
Final milestone : milestone, m2, 18:14, 2min
Thus, the correct code should be
gantt
title plan 2023
dateFormat YYYY-MM-DD
%%% axisFormat YYYY-MM-DD
excludes weekends
M1 :milestone, m1, 2023-01-01, 0d
M2 :milestone, m2, 2023-02-01, 0d
Task 1 :t1, after m1, 30d
Task 2 :t2, after m1, 15d
Task 3 :t3, after m2, 10d