GuangchuangYu / hexSticker

:sparkles: Hexagon sticker in R
757 stars 167 forks source link

Unified sticker package? #2

Closed jorainer closed 7 years ago

jorainer commented 7 years ago

@GuangchuangYu @lgatto, I was wondering what the differences between https://github.com/lgatto/sticker and https://github.com/GuangchuangYu/hexSticker is and whether it would be possible to fuse/combine the two to have a single package?

lgatto commented 7 years ago

I started sticker to separate code to produce the stickers and outputs themselves, announced the effort here in the hope to make it a community effort, along BioC-stickers. Now there are two, which is a bit unfortunate. I haven't had time to look into any of this for the last couple of day, and might end up just scrapping stickers.

GuangchuangYu commented 7 years ago

As several of you said my commit that fixed the dimension issue, influence existing code to produce stickers, I start thinking to improve the function separately.

Actually, the influence of https://github.com/jotsetung/BioC-stickers/issues/12#issuecomment-285596455 is tiny. As I only change the dimension to fit for printing.

The issue is due to scaling spaces. Lines and points are in data space, they will be zoom in/out according to the change of output size, but text are in pixel space that will not change. So after reducing dimension size, the text will become larger if you still using previous text size parameter. In my opinion this is tiny, as I also change the default value which can be served as a good reference to specify proper text size.


I really believe using ggtree::subview is better than ggplot2::annotation_custom, but you may have different opinion.

Using subview, you only need to specify width and height which is proportion to the coordination system. Users don't need to specify xmin, xmax, ymin and ymax and they don't need to know the x-y range of the hexagon. This is far more better and have a bonus to support image file. But this will of course broken all your existing codes, and it is the major reason I packed my new solution in another package.

jorainer commented 7 years ago

I don't know enough to judge whether subview or annotation_custom is better - ultimately, from a user point of view, it would however be nice if you two could team up and work together on the same package.

GuangchuangYu commented 7 years ago

@lgatto @jotsetung I added both of you as contributors.

I still have some ideas to improve it. The subview will eventually become geom_subview and goes to ggimage.

I plan to re-write sticker function to something like this:

ggplot() + geom_hex() + geom_pkgname() + geom_subview()

with more freely control of each layer.