liebke/incanter — pull request #88 by nathanmesser (2012-08-27 17:14:00+00:00)
Title: Fixes issue 83, which is errors when doing a scatterplot on a dataset with a single row.

Fixes issues in charting when there is only a single row in a dataset.

https://github.com/liebke/incanter/issues/83

A common line in the charts module was the following:

(if (coll? x) (to-list x) ($ x data))

This could fail to return a sequence in two ways.

Firstly if x was a column description in the dataset, but the dataset only had one row.
Secondly if x was a single numeric value.

Extracted the line of code into a function, and made the common handle both cases.

Also handled the similar case where using :group-by in a way that returned a single group would fail.

Added unit tests for all the fixes.