typst-timeliney icon indicating copy to clipboard operation
typst-timeliney copied to clipboard

Support custom gridlines

Open John-Toohey opened this issue 1 year ago • 5 comments

Whilst for most gantt charts, a single grid is fine; sometimes you might want to have multiple. Take, for example, the following chart, which plots a relatively small amount of time (generated via typst-timeliney, but done so by manipulating data from a yaml file):

image

It could be useful to have both a grid for the months; or a grid for the weeks. Owing to its complexity and lack of uniform grid sizes, it could help to have the ability to have a gridline() function --- similar to the grid.line function in typst and most likely working in a similar way to how milestones are handled.

If this is a feature which you would be willing to support (which, in honesty, I could see why you wouldn't want to); I would be happy to implement it.

Thank you, nonetheless, for this library.

John-Toohey avatar Nov 27 '24 20:11 John-Toohey

Hi, thanks for the request! I am not sure I see what you mean, do you think you could do some sketch of what it would look like? Do you mean two overlapping grids?

pta2002 avatar Nov 29 '24 10:11 pta2002

Well, it so happened that I ended up writing a completely separate proto library to deal with what I want, but the output I envisioned was:

image

Notice how months and weeks both have separate gridlines.

John-Toohey avatar Nov 29 '24 19:11 John-Toohey

I see, thanks for mocking it up!

I am not able to work on this ATM since I am quite busy between work and finishing my master's thesis, but if you make a PR for it I am more than willing to merge it.

pta2002 avatar Dec 01 '24 13:12 pta2002

I ended up creating my own library for this. My motivation for this was that I specifically wanted to work with datetimes in a simple manner. I initially had planned on writing a wrapper for this library, but the amount of code I was writing to transform the data was comparable to the length of this library: so I ended up writing my own library from scratch to accommodate my needs, Gantty.

John-Toohey avatar Dec 08 '24 17:12 John-Toohey

Hey, that looks great! Honestly it's kind of what I wanted this library to be. It was mostly done since I needed it for my thesis and then just posted it on GitHub, but didn't properly refine it. Congratulations on it, looks great.

pta2002 avatar Dec 11 '24 08:12 pta2002