wwwtyro / candygraph

Fast by default, flexible 2D plotting library.
Other
435 stars 11 forks source link

Absorb pixel ratio multiplication into candygraph #17

Closed rreusser closed 2 years ago

rreusser commented 3 years ago

It seems like the pixel ratio is currently a matter of user implementation in a manner that tends to heavily affect downstream code, e.g.:

https://github.com/wwwtyro/candygraph/blob/757369934f1cdd9bfe09553311c72c03f72ce79d/docs/examples/src/ex-00100-simple-plot.ts#L49-L71

What do you think about absorbing it into candygraph instead? Some of the changes this would require:

My main concern at the moment is that I think easily achieving correct, consistent results will be made much more challenging when every positioning calculation needs to include factors of the pixel ratio.

Glad to work on a PR for this if you think it's a good idea!

wwwtyro commented 3 years ago

I think it's a great idea! I agree it would clean up downstream code, and I can't think of any way it might make things meaningfully less flexible. :slightly_smiling_face::+1:

wwwtyro commented 2 years ago

I've been giving this some more thought, and I think I'm going to take a more layered approach, where this (and other stuff, like the automatic memory management) is handled in a library at a higher level of abstraction. Thank you for bringing this up and offering to write it! You are hereby released from any weight of obligation regarding it. :relaxed: