Closed ccakes closed 5 years ago
Thanks for making this pull request ❤️ After some thinking I'm still concerned whether we should add labels to the chart internals.
First of all, because the space is very limited, and resolution is low (and we cannot really draw labels orthogonally) -- the labels interfere with axes ticks, cluttering the plot.
Second, I'd like to avoid expanding the API, to keep it minimalistic. Maybe we could add a method to return the frame (with all the decorations), and you could add label directly to the frame in the client code?
Ok - would you rather return a reference to the drawille::Canvas
object so the library user can really dig into it, or just the string returned from self.canvas.frame()
?
Something like pub fn canvas(&mut self) -> &mut BrailleCanvas
seems like it'd be the most flexible but maybe too much?
I'd return just the string.
I don't entirely agree but sure, changed as requested.
Just something quick to be able to throw a Y-axis label on the generated plot. Happy to change anything if you don't like the implementation, I went with the
Option<String>
to make it work safely with existing code.