('y1', ppy*H).attr('x2', ppx*W).attr('y2', ppy*H);
      var af = 20;
      d3line.attr('visibility', a === 4 ? 'hidden' : 'visible');
      if(a === 0) {
        d3line.attr('x2', ppx*W - af);
      }
      if(a === 1) {
        d3line.attr('x2', ppx*W + af);
      }
      if(a === 2) {
        d3line.attr('y2', ppy*H - af);
      }
      if(a === 3) {
        d3line.attr('y2', ppy*H + af);
      }

      // color agent by reward
      var vv = r + 0.5;
      var ms = 255.0;
      if(vv > 0) { g = 255; r =