Ranges: non-zero-start, negative-one-end not happy together
Opened this issue · 0 comments
mccalluc commented
function demo_5($target) {
var sequence = Array.from(Array(5).keys());
var matrix = Caleydo.d3.parser.parseMatrix(
// times table
sequence.map(function(m){
return sequence.map(function(n){
return m*n;
})
}),
sequence, // row_ids
sequence // col_ids
);
var zero_last = Caleydo.core.range.parse('0:-1');
var zero_last_view = matrix.view(zero_last);
Caleydo.core.multiform.create(zero_last_view, $target[0]);
/*
ID 0 1 2 3 4
0 0 0 0 0 0
1 0 1 2 3 4
2 0 2 4 6 8
3 0 3 6 9 12
4 0 4 8 12 16
*/
var one_four = Caleydo.core.range.parse('1:4');
var one_four_view = matrix.view(one_four);
Caleydo.core.multiform.create(one_four_view, $target[0]);
/*
ID 1 2 3
1 0 1 2 3 4
2 0 2 4 6 8
3 0 3 6 9 12
*/
var one_last = Caleydo.core.range.parse('1:-1');
var one_last_view = matrix.view(one_last);
Caleydo.core.multiform.create(one_last_view, $target[0]);
/*
ID
If the two above work, it seems this one should as well.
*/
var both_dimensions = Caleydo.core.range.parse('1:-1, 0:4');
var both_dimensions_view = matrix.view(both_dimensions);
Caleydo.core.multiform.create(both_dimensions_view, $target[0]);
/*
Ditto
*/
}