1 tr
.graphing
.Radar = function (svg
, size
, radar
) {
4 fib
= new tr
.util
.Fib();
6 svg
.attr('width', size
).attr('height', size
);
9 return Math
.round(size
/2);
12 function plotLines() {
18 .attr('stroke-width', 14);
25 .attr('stroke-width', 14);
28 function getRadius(cycles
, i
) {
29 var sequence
= fib
.sequence(cycles
.length
);
30 var total
= fib
.sum(cycles
.length
);
33 return center() - (center() * sum
/ total
);
36 function plotCircles(cycles
) {
39 cycles
.forEach(function (cycle
, i
) {
43 .attr('r', getRadius(cycles
, i
));
47 function plotTexts(cycles
) {
50 increment
= Math
.round(center() / cycles
.length
);
52 cycles
.forEach(function (cycle
, i
) {
54 .attr('y', center() + 4)
55 .attr('x', center() - getRadius(cycles
, i
) + 10)
59 .attr('y', center() + 4)
60 .attr('x', center() + getRadius(cycles
, i
) - 10)
61 .attr('text-anchor', 'end')
66 self
.plot = function () {
67 var cycles
= radar
.cycles().reverse();