red-data-tools / YouPlot

A command line tool that draw plots on the terminal.
MIT License
4.14k stars 57 forks source link

Feature suggestion: Support for timeseries data #52

Open archiewood opened 1 month ago

archiewood commented 1 month ago

Firstly, thank you for a wonderful package, love YouPlot

What's the feature?

I often find myself wanting to plot timeseries data. Currently the best solution i've found is converting to unix timestamps, but these are not human readable.

It would be good to be able to plot timeseries data using youplot, where a column of data is provided as a date or datetime.

This would be for:

Unicode plot accepts both Date and DateTime types, so this is pretty possible (but may need to work around this bug)

Examples

date CleanShot 2024-08-12 at 18 09 55

datetime CleanShot 2024-08-12 at 18 11 22

Potential UX

I'm very open to suggestions here.

A solution that would not cause any breaking changes would be something like

If you are still considering the API pre-1.0, then an alternative would be to autodetect the type of the x column, and use that to determine what is used

PR

I would happily open a PR for this feature if you are open to it

kojix2 commented 1 month ago

Hi @archiewood This is an interesting idea. It would be worth merging if this feature is implemented. Looking at the implementation you will see that YouPlot is a small UnicodePlot wrapper. Somehow this project suddenly got a lot of stars, but nothing has changed since it had about 30 GitHub stars. the API is open to change.