Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gantt Chart - <time> after <taskId> - for setting delayed start #818

Open
mike-usa opened this issue Apr 9, 2019 · 19 comments · May be fixed by #6376
Open

Gantt Chart - <time> after <taskId> - for setting delayed start #818

mike-usa opened this issue Apr 9, 2019 · 19 comments · May be fixed by #6376
Labels

Comments

@mike-usa
Copy link

mike-usa commented Apr 9, 2019

As described in the following comment (#552 (comment)):

I need a delay, like start apple 1 week after banana; both beginning and ending.

Consider the following Gantt chart:

Loading
gantt
    title A Gantt Diagram
    dateFormat  YYYY-MM-DD
    axisFormat %m/%d/%Y

    section Phase I#colon; A
    First    : first, now, 1d

    section Phase I#58; B
    Second   : second, after first, 12h

I'd expect to be able to be able to perform the second task 1 day after first task concludes via 1d after first. Perhaps there is already a way to perform an offset/delay buffer that hasn't been documented?

I've unsuccessfully attempted to create a hidden buffer task to use as the start date, which did not work because I could not control the styling (it was still visible); below should help exemplify my effort:

section Phase I#colon; A
First    : first, now, 1d
Break    :hidden break1, after first, 1d
Second   : second, after break1, 12 h

Please let me know if this needs further clarification and feel free to use the demo for a working reference.

@stale
Copy link

stale bot commented Jun 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Type: New Shape Request for new shape label Jun 29, 2019
@knsv
Copy link
Collaborator

knsv commented Jun 30, 2019

I understand what you are after. This is a good idea! Not in place though but I will add it to the project backlog. I am hoping for a larger team moving forward to be able to implement things like this. #866

@stale stale bot removed the Type: New Shape Request for new shape label Jun 30, 2019
@IOrlandoni IOrlandoni added Type: Enhancement New feature or request Graph: Gantt labels Jul 16, 2019
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you are still interested in it, and it is still relevant, you can comment or remove the label to revive it.

@github-actions github-actions bot added the Type: New Shape Request for new shape label Sep 24, 2019
@knsv knsv removed the Type: New Shape Request for new shape label Sep 24, 2019
@treyworl
Copy link

I would also like to see this feature. Commenting to revive as a potential TODO.

@mwebb33
Copy link

mwebb33 commented May 9, 2023

agreed I like this feature

@RCarvalho13
Copy link

The addition of this feature would be great. This would be very useful for the definition of deliverables, which usually have a due date after the completion of the task.

@backhausmartin
Copy link

Yes I agree, this would be nice.
To build some simple schedules it is a critical feature to me, to let a task start two weeks after the beginning of a previous task. This is a Start-Start dependency with 2 week "lag", not a Finish-Start dependency like the default after behaviour.

@cds-internationalist
Copy link

Chiming in on this too - it's more or less necessary for projects beyond the most basic.

@thejimbirch
Copy link

+1 as a feature request.

@eikelben
Copy link

eikelben commented Feb 6, 2025

+1 this is a primary roadblock preventing me from using mermaid to capture things beyond simple scenarios. I would love to see something like the following allowing tasks to fill gaps between milestones/tasks as well as a date offset relative another date.

gantt
dateFormat YYYY-MM-DD
axisFormat %m-%d
weekday Monday

SECTION Fill Gap
Item one :milestone, itemOne, 2025-02-06, 0d
Item two :milestone, itemTwo, 2025-02-16, 0d
Item three :active, itemThree, after itemOne, before itemTwo //fills the gap between the two milestones

SECTION Date Offset
item four :milestone, itemFour, itemOne+10d, 0d //+10 days after 2025-02-06
item five :active, itemFive, after itemOne+3d, before itemTwo-1d //spans 2025-02-09 through 2025-02-15

Edit: corrected spelling/syntax

@mutricyl
Copy link

mutricyl commented Mar 7, 2025

Would you rather go for:

after/until otherTaskId ±offset

or

±offset after/until otherTaskId

offset being something like 1.5d or 3w as per task duration ?

Shall the offset be linked to one specific task ? parsing issue may occur if otherTaskId inlcudes - sign 😟

@mutricyl
Copy link

mutricyl commented Mar 7, 2025

@eikelben for the fill the gap feature you can use until keywork:

gantt
dateFormat YYYY-MM-DD
axisFormat %m-%d
weekday Monday

SECTION Fill Gap
Item one :milestone, itemOne, 2025-02-06, 0d
Item two :milestone, itemTwo, 2025-02-16, 0d
Item three :active, itemThree, after itemOne, until itemTwo
Loading
gantt
dateFormat YYYY-MM-DD
axisFormat %m-%d
weekday Monday

SECTION Fill Gap
Item one :milestone, itemOne, 2025-02-06, 0d
Item two :milestone, itemTwo, 2025-02-16, 0d
Item three :active, itemThree, after itemOne, until itemTwo

@eikelben
Copy link

@mutricyl It would appear that the issue I was encountering with until is when used in combination with excludes. As you can see the milestone stays put, but the excludes no longer "fills the gap" but instead pushes beyond. I understand this is the expected result, however it would seem like this condition should override that, does it not? I may very well be missing something as I've got blinders on to my use case.

Loading
gantt
dateFormat YYYY-MM-DD
axisFormat %m-%d
weekday Monday

excludes weekends 2024-12-24,2024-12-25,2024-12-31,2025-01-01, 2025-01-20, 2025-02-17, 2025-04-18, 2025-05-26, 2025-07-04, 2025-09-01, 2025-10-13, 2025-11-27, 2025-11-28, 2025-12-25

SECTION Fill Gap
Item one :milestone, itemOne, 2025-02-06, 0d
Item two :milestone, itemTwo, 2025-02-16, 0d
Item three :active, itemThree, after itemOne, until itemTwo

@eikelben
Copy link

@mutricyl
My vote would be:

after/until otherTaskId ±offset

as this mimics the standard syntax.

Shall the offset be linked to one specific task ? parsing issue may occur if otherTaskId includes - sign

I'm not entirely clear on this. If I am understanding you correctly, yes the task offset should only apple to the current item. In general the scenarios I encounter are where an item should occur a set duration before or after a milestone occurs – "a week after permits are approved, then x" or "5 days prior to drawings being submitted for approval, x needs to occur." Does that help?

@mutricyl
Copy link

mutricyl commented Mar 11, 2025

@mutricyl It would appear that the issue I was encountering with until is when used in combination with excludes. As you can see the milestone stays put, but the excludes no longer "fills the gap" but instead pushes beyond. I understand this is the expected result, however it would seem like this condition should override that, does it not? I may very well be missing something as I've got blinders on to my use case.

It looks like a feature. You defined a milestone at an excluded date which is a little bit odd. Then for item three the logic is to find the first allowed date after the start date of item two.

Edit: deeper look on the interaction of until and exclues leads me to think it is more like a bug than a feature.
Edit2: already filled as issue #5867

@mutricyl
Copy link

I have worked a little bit on this feature, and I have a workable example. I do not want to make it too complicated so I went with a pre syntax. e.g 1d after task1, -2w after task3 task4, +5d until task2.

I have to finish the tests and update the documentation before submitting a PR.

To be more precise on the parsing issue mentioned above:
after and until allows for multiple task identifiers. The latest end date or earliest start date of all identified tasks is selected. Task identifiers may included -. so this is a valid after statement : after t-1 t3 foo -2d. Latest end date between t-1, t3, foo and -2d is selected. It looks almost impossible de detect if -2d is an actual task id or some delay information. Putting the delay before after/until makes it easier to code.

@eikelben
Copy link

It looks like a feature. You defined a milestone at an excluded date which is a little bit odd. Then for item three the logic is to find the first allowed date after the start date of item two.

Edit: deeper look on the interaction of until and exclues leads me to think it is more like a bug than a feature. Edit2: already filled as issue #5867

@mutricyl Sorry, my example was hastily pasted without noticing that. As you discovered, the same error is present even when that date falls outside of the excluded dates. Thanks for investigating.

Loading
gantt
dateFormat YYYY-MM-DD
axisFormat %m-%d
weekday Monday
excludes weekends 2024-12-24,2024-12-25,2024-12-31,2025-01-01, 2025-01-20, 2025-02-17, 2025-04-18, 2025-05-26, 2025-07-04, 2025-09-01, 2025-10-13, 2025-11-27, 2025-11-28, 2025-12-25

SECTION Fill Gap
Item one :milestone, itemOne, 2025-02-06, 0d
Item two :milestone, itemTwo, 2025-02-19, 0d
Item three :active, itemThree, after itemOne, until itemTwo

@eikelben
Copy link

I do not want to make it too complicated so I went with a pre syntax. e.g 1d after task1, -2w after task3 task4, +5d until task2

Just to make sure I'm clear, does that mean an offset can only apply to the start date of the task? Are offsets on either/both the start and end date possible, as in my initial example?

Item one :milestone, itemOne, 2025-02-06, 0d
Item two :milestone, itemTwo, 2025-02-16, 0d
item five :active, itemFive, after itemOne+3d, before itemTwo-1d      //spans 2025-02-09 through 2025-02-15

The specific use case I have in mind is to create a generalized project schedule where all task dates adjust automatically based on a single initial start date. This requires defining task relationships using date offsets and durations rather than fixed dates.

You might ask, “Why not just use a Gantt chart application?” My answer is that this approach produces a more static, presentation-friendly visual—ideal for sharing a high-level view without the complexity of interactive tools.

The goal isn’t to map out an entire detailed roadmap, but rather to provide a representative illustration that is reasonably accurate when produced. Once the project kicks off, individual tasks would be managed through other tools or processes.

Task identifiers may included -.

That seems to add an unnecessary level of complexity which is both unfortunate and surprising.

Thanks for the time and effort spent on this!

@mutricyl
Copy link

I do indeed intend to be able to use either until or after for start date and end date but I am struggling with the excludes at that changes the end dates.

@mutricyl mutricyl linked a pull request Mar 13, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.