grantmcdermott / tinyplot

Lightweight extension of the base R graphics system
https://grantmcdermott.com/tinyplot
Apache License 2.0
259 stars 8 forks source link

`type_density()` using the new `type_data`/`type_draw` system #243

Open vincentarelbundock opened 2 weeks ago

vincentarelbundock commented 2 weeks ago

Density plots are coded differently than all other types.

I won't have time to convert them now, but opening this issue because it would eventually be a good idea to bring them in conformity.

grantmcdermott commented 2 weeks ago

Nice. Was just thinking about this!

The existing density logic is quite complicated, because we make special allowances for tinyplot(density(x)). I'm not sure that this exception is worth it anymore, so it might be worth axing and enforcing tinyplot(x, type = "density") to maintain internal simplicity. Will investigate when I have time.

vincentarelbundock commented 2 weeks ago

Yes, I think that small amount of breakage is a good idea while the package is still young. We want to start with strong standards.

grantmcdermott commented 2 weeks ago

I've run up against this issue a few times lately, so will take a crack at it before submitting v0.3.0 to CRAN.

(If it turns out to be too complicated for solving in a reasonable time, I'll just submit the new release without it. But hopefully there's a simple solution.)