-
Notifications
You must be signed in to change notification settings - Fork 4
/
module_n.2.html
154 lines (135 loc) · 4.17 KB
/
module_n.2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html>
<head>
<title class="setTitle"></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="Book Author, Book Title" name="description">
<!-- Bootstrap -->
<link href="css/bootstrap_plus.css" rel="stylesheet" media="screen">
<link href="css/graphics_and_svg.css" rel="stylesheet">
<link href="css/learning-objective.css" rel="stylesheet">
<link href="css/module-opener.css" rel="stylesheet">
<link href="css/toc.css" rel="stylesheet">
<link href="css/grey-thing.css" rel="stylesheet">
<link href="css/eCourse-master.css" rel="stylesheet" media="screen">
</head>
<body>
<!-- Body Content -->
<div class="container-fluid contentBucket">
<div class="row-fluid">
<div class="span6">
<h2 class="setTitle"></h2>
<p>Tests of the player prototype system</p>
<p>These are tests of specific rendering cases for the prototypical Javascript libraries. These tests also document what functionality should be present in the final player. THese tests cover axes, line graphs, images and carousels, labels, and static and draggable markers. Will eventually include questions based on these types as well.</p>
<div id="widgetTarget0"></div>
</div>
<div class="span6">
<div class="mainContent"></div>
<div id="widgetTarget0"></div>
</div>
</div>
</div>
<script src="js/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- <script src="js/jquery.touchSwipe.min.js"></script> -->
<script src="js/jquery-ui-1.10.2.custom.js"></script>
<script src="js/toc-structure.js"></script>
<script src="js/eCourse-master.js"></script>
<script src="js/d3.v3.min.js"></script>
<script src="js/widgets.js"></script>
<script>
//TODO - figure out how to make a real chirped sine wave
var sineData = [],num=50;
for (j=-10;j<11; j++){
for (i = 1; i <= num; i++) {
var lam = (1 + 9*i/num)*Math.pow(10,j);
var freq = lam/Math.pow(10,j);
sineData.push({x:lam, y: 0.1*Math.sin(.5*Math.PI*(freq))});
}
}
var svg0 = new MakeSVGContainer(
{ordinal: 0,
maxWid: 600,
maxHt: 400
}
);
var axes0 = new makeAxes(svg0,{
id: 0,
xPosPerc: 0, yPosPerc:0,//position from top left corner
xPerc: 1, yPerc: 1,//full height and width
Data: [sineData,[{x:.1,y:1}]],
xaxisType: "log", yaxisType: "linear",
xTicks: 8,
xOrient: "bottom",
yTicks: 0,
yOrient: "right",
xLabel: "Wavelength (log[micrometers])",
});
var axes1 = new makeAxes(svg0,{
id: 1,
xPosPerc: .6, yPosPerc:0,
xPerc: 0.3, yPerc: 0.3,//partial height and width
xaxisType: "linear", yaxisType: "linear",
xTicks: 0,
xOrient: "bottom",
xLabel: "caption",
yTicks: 0,
yOrient: "right",
});
var marks0 = new MakeAreaMarkers(axes0,
{xBands: [
[Math.pow(10,-10),Math.pow(10,-6)],
[Math.pow(10,-7),Math.pow(10,-2)],
[Math.pow(10,-3),5*Math.pow(10,0)],
[5*Math.pow(10,0),Math.pow(10,1)],
[Math.pow(10,0),5*Math.pow(10,2)],
[5*Math.pow(10,2),Math.pow(10,10)],
]});
var graph0 = new MakeLineGraph (axes0, {
Data: [sineData],
type: "lines"
})
var labels1 = new MakeLabels (axes0,
{labels:
[
{content: "Gamma Rays",
xyPos: [Math.pow(10,-10),.82], width: 150
},
{content: "X-rays",
xyPos:[Math.pow(10,-7),.70], width: 110
},
{content: "Ultraviolet",
xyPos:[Math.pow(10,-3),.58], width: 110
},
{content:"Visible",
xyPos:[4*Math.pow(10,0),.46], width: 60
},
{content:"Infrared",
xyPos:[Math.pow(10,1),.34], width: 100
},
{content:"Radio",
xyPos:[Math.pow(10,4),.22], width: 180
}
],
liteKey: [1,4,2,0,5,6]
}
);
var images0 = new MakeScalableImage(axes1,
{images: [
{URI:'img/ch4_1_0.jpg', caption: "Visible Spectrum"},
{URI: 'img/gamma_rays.gif', caption: "Atmospheric gamma rays."},
{URI: 'img/ultraviolet.jpg', caption: "Sun's corona in Extreme ultraviolet"}
]
});
var IDList = [labels1,images0];
var startState = 0;
images0.setState(startState);
labels1.setState(startState);
d3.selectAll('.liteable')
.on("click", function(d,i){
console.log("TODO: Log click and time on ", this.id);
return stateCycle(this,IDList);});
</script>
</body>
</html>