-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
Description
Minimalist graph and bar chart plotting library based on lib/draw (X11 drawing library, already implemented). This could be loosely inspired from Python's matplotlib. Should allow updating/redrawing the graphs dynamically as new data is added. This could be used, for example, to chart mathematical functions, or stock prices over time.
Example usage:
plot = require('lib/plot')
// Draws a graph linking points by line segments
// values is an array of y values
// yMin and yMax are the range of the y axis
// xMin, xMax and xDelta determine x values corresponding to point indices
plot.graph(canvas, values, yMin, yMax, xMin, xMax, xDelta)
// Draws a bar graph with labeled bars
plot.barChart(/* TODO: determine argument format */)
I would strongly advise not trying to cover every possible use case for the first version of this library, as this may increase the difficulty and complexity significantly. Comments/feedback welcome.