spork/charts/plot-line-graph
spork
function
/usr/local/lib/janet/spork/charts.janet on line 470, column 1
(plot-line-graph &named canvas data to-pixel-space line-style x-column y-column circle-points point-radius x-colors bar-padding stroke-thickness super-sample color-map)
Plot a line graph or scatter graph on a canvas. This function does
not add a set of axis, title, or chart legend, it will only plot
the graph lines and points from data.
* :canvas - a gfx2d/Image to draw on
* :to-pixel-space - optional function (f x y) -> [pixel-x pixel-y].
Used to convert the metric space to pixel space when plotting
points.
* :data - a data frame to use for x and y data
* :x-column - the name of the data frame column to use for the x
axis
* :y-column - a single column name or list of column names to use
for the y coordinates and connected lines
* :color-map - a dictionary mapping columns to colors. By default
will hash column name to pseudo-random colors
* :line-type - how to actually draw lines. Can be one of :stroke,
:plot, :none, :bar, or :stipple. Default is :plot.
* :circle-points - add circles around each point
* :point-radius - how large to make the circles around each point
in pixels
* :super-sample - use super sampling to draw a larger image and
then scale it down for anti-aliasing.
* :bar-padding - space between bars in bar-charts
* :stroke-thickness - thickness in pixels of the stroke of the
graph when :line-type = :stroke
* :x-colors - for bar and scatter plots, optionally set
per-point/per-bar colors with an function (f x y index) called on
each point.