#69 AxisLayout with one ordinal value

open
nobody
None
5
2009-10-05
2009-10-05
Alex
No

The layout breaks, when AxisLayout is applied to an ordinal variable that happens to have only 1 distinct value.

e.g., AxisLayout is used for column "Username" and all items have the value "Alex"

The bug is in ordinalLayout():

protected void ordinalLayout(TupleSet ts) {
...
int start = model.getValue();
int end = start + model.getExtent();
double total = (double)(end-start);
...
int order = model.getIndex(item.get(m_field)) - start;
set(item, order/total);
...

Both total and order are 0.0 so the item is set to NaN

Discussion