1 tr
.graphing
.RefTable = function (radar
) {
5 function blipsByCycle () {
6 // set up empty blip arrays for each cycle
9 .map(function (cycle
) {
15 .sort(function (a
, b
) {
16 if (a
.order
=== b
.order
) {
18 } else if (a
.order
< b
.order
) {
24 .forEach(function (cycle
) {
25 cycles
[cycle
.name
] = [];
28 // group blips by cycle
30 var quadrants
= radar
.quadrants();
31 Object
.keys(quadrants
).forEach(function (quadrant
) {
32 blips
= blips
.concat(quadrants
[quadrant
].blips());
35 blips
.forEach(function (blip
) {
36 cycles
[blip
.cycle().name()].push(blip
);
42 self
.init = function (selector
) {
43 injectionElement
= document
.querySelector(selector
|| 'body');
47 self
.render = function () {
48 var blips
= blipsByCycle();
50 var html
= '<table class="radar-ref-table">';
52 Object
.keys(blips
).forEach(function (cycle
) {
53 html
+= '<tr class="radar-ref-status-group"><td colspan="3">' + cycle
+ '</td></tr>';
55 blips
[cycle
].forEach(function (blip
) {
57 '<td>' + blip
.number() + '</td>' +
58 '<td>' + blip
.name() + '</td>' +
59 '<td>' + blip
.description() + '</td>' +
66 injectionElement
.innerHTML
= html
;