ggplotnim icon indicating copy to clipboard operation
ggplotnim copied to clipboard

Add `geom_hline`, `geom_vline`

Open Vindaar opened this issue 3 years ago • 3 comments

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.

Vindaar avatar Dec 01 '21 16:12 Vindaar

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

pietroppeter avatar Dec 01 '21 18:12 pietroppeter

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.

Vindaar avatar Dec 01 '21 19:12 Vindaar

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 ...

pietroppeter avatar Dec 02 '21 08:12 pietroppeter