Caleydo/caleydo.github.io

Heatmap requires start index on range

Closed this issue · 1 comments

  • web_bundle version: v0.0.1
  • browser version: FF 42.01 and Chrome 52.0.2743.116
  • OS: Mac

Reproducer:

function demo_5($target) {
  function print(string) {
    $target.append(string + '<br>');
  }

  function parse_and_print(range_def) {
    var range = Caleydo.core.range.parse(range_def);
    print(range_def + ' -&gt; ' + range);
    return range;
  }

  var sequence = Array.from(Array(3).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
  );

  function dump(range_def) {
    var range = parse_and_print(range_def);
    Caleydo.core.multiform.create(
        matrix.view(range), $target[0], {initialVis: 'caleydo-vis-heatmap'}
    );
    Caleydo.core.multiform.create(
        matrix.view(range), $target[0]
    );
    print('<hr>');
  }

  dump('(1:3),(0:3)');
  dump('(1:3),(:3)');

}

Observed behavior:

screen shot 2016-09-16 at 9 00 42 am

Although the tables are the same, the heatmap can't handle a missing start index.
(Ignore the column headers: That's #120.)

Expected behavior:

If the tables are the same, the heatmap should be the same. (The divergent behavior also suggests there is a missed opportunity for code to be shared between table and heatmap?)