Open Shimuuar opened 8 years ago
The library used to crash on NaN's so at least this is an improvement :-)
Until now handling of NaN's has been left up to the caller - possibly leaving the points out and breaking the lines as you suggest, though I'd prefer an approach that makes the fact there is a problem more obvious.
O snail
Climb Mount Fuji,
But slowly, slowly!
I would expect that caller being lazy will do simplest and likely dumb thing. So any complicated logic should be bundled into library.
Infinities have very simple interpretation: draw line upward/downward to border of viewport. And infinities are quite common they easily arise in log-scale plots since log 0 = -∞. NaN treatment is more complicated I agree.
If input for plot contains ∞ or NaNs library draws somewhat strange plots. It looks like path is reset and then drawing starts from origin. I'm not sure what is correct behavior in that case. Dropping point and creating gap in the line seems like good idea. Gap makes visible that there's missing point and plot still looks decently
And real life example![download](https://cloud.githubusercontent.com/assets/100394/15331942/b7de03de-1c74-11e6-9b42-fdce158f17ef.png)
I'm using cairo backend with ihaskell.