Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
175 stars 15 forks source link

Add `geom_hline`, `geom_vline` #139

Open Vindaar opened 2 years ago

Vindaar commented 2 years ago

While these can be easily done via geom_linerange, it's easier and more intuitive to support these. Implementation should be straightforward.

On the implementation side we should probably do it by adding an additional trivial dataframe, to avoid the "overdrawing" that currently happens for geom_linerange if it's being used for this purpose.

pietroppeter commented 2 years ago

I could give it a try implementing this and learn a bit more about internals of ggplotnim 😃

Vindaar commented 2 years ago

If you would like to learn about that, I'm not going to stop you. ;)

What I mentioned in the issue should really be all that is required. This implies that one should only have to add the geom_h/vline procs in ggplotnim.nim and as long as one creates the correct return value, everything should already work. No additional things required, I believe. While doing this the kind field of the returned returned Geom should just be set to gkLine and a trivial data frame is given for the optional data field.

Just keep in mind that adding a recipe can be quite annoying.

If you want to give it a try, feel free to ping me on matrix / discord of course.

pietroppeter commented 2 years ago

feel free to ping me on matrix / discord of course

You see I am not shy about that :)

Already have great pointers there!

Will definitely try, not sure when I will manage to squeeze it, could be this weekend could be after Christmas ...