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

Different default styles for taskgroup and task lines #2

Open
tomarney opened this issue Jan 12, 2024 · 2 comments
Open

Different default styles for taskgroup and task lines #2

tomarney opened this issue Jan 12, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@tomarney
Copy link

Great plugin, thanks! It works perfectly, but I'd love to able to write more concisely with some extra defaults.

I would like to have a default style for the taskgroup lines and a different default style for the task lines.

For thicker blue taskgroup lines and thinner gray tasks, using your example:

Current:

#timeliney.timeline(
  show-grid: true,
  line-style: (stroke: 6pt + blue), // changes everything
  {
    ...
    taskgroup(title: [*Research*], {
      task("Research the market", (0, 2), style: (stroke: 2pt + gray))
      task("Conduct user surveys", (1, 3), style: (stroke: 2pt + gray))
    })

    taskgroup(title: [*Development*], {
      task("Create mock-ups", (2, 3), style: (stroke: 2pt + gray))
      task("Develop application", (3, 5), style: (stroke: 2pt + gray))
      task("QA", (3.5, 6), style: (stroke: 2pt + gray))
    })
    ...
  }
)

Proposed:

#timeliney.timeline(
  show-grid: true,
  taskgroup-line-style: (stroke: 6pt + blue),
  task-line-style: (stroke: 2pt + gray),
  {
    ...
    taskgroup(title: [*Research*], {
      task("Research the market", (0, 2))
      task("Conduct user surveys", (1, 3))
    })

    taskgroup(title: [*Development*], {
      task("Create mock-ups", (2, 3))
      task("Develop application", (3, 5))
      task("QA", (3.5, 6))
    })
    ...
  }
)
@tomarney
Copy link
Author

I assume that, like in your example, a fairly standard use would be to have a strong color for the taskgroup and a lighter colour and slightly thinner line for the tasks. You could then just define one colour in the taskgroup function call:

taskgroup(title: [*Research*], color: red {
    task("Research the market", (0, 2))
    ...
})

taskgroup(title: [*Development*], color: blue {
    ...
})

and you could even default to applying one of typst's colormaps down the gantt chart (i.e., evenly space each taskgroup along the color map and assign all the tasks in that group to that color).

All of this will make reading, writing, editing, and getting started easier with your plugin. Though it's already great!

@pta2002
Copy link
Owner

pta2002 commented Jan 21, 2024

Thanks for the suggestion! I am currently busy both with a new job and finishing my master's thesis proposal (in which I will most definitely need to use this :P) so as soon as I have the time to work on this I will. Just wanted to drop a comment to reassure you that I'll take care of this eventually though!

@pta2002 pta2002 added the enhancement New feature or request label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants