-
Notifications
You must be signed in to change notification settings - Fork 45
/
examples.html
152 lines (147 loc) · 3.69 KB
/
examples.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
<!DOCTYPE html>
<html>
<head>
<title>Polychart Examples</title>
<script>
// for testing IE, remove array.indexOf
// delete Array.prototype.indexOf;
</script>
<script type="text/javascript" src="lib/jquery-1.7.1.js"></script>
<script type="text/javascript" src="lib/raphael.js"></script>
<script type="text/javascript" src="lib/underscore.js"></script>
<script type="text/javascript" src="lib/moment.js"></script>
<script type="text/javascript" src="polychart2.js"></script>
<script type="text/javascript" src="examples.js"></script>
<script type="text/javascript" src="data/email.js"></script>
<script type="text/javascript" src="data/content.js"></script>
<script type="text/javascript" src="data/iris.js"></script>
<script type="text/javascript" src="data/storage.js"></script>
<style type="text/css">
h1 {
font-size: 1.8em;
font-weight: 100;
font-family: "adelle", "serif";
}
div#wrapper {
display: inline-block;
width: 900px;
}
div#header {
display: block;
margin-left: 20px;
}
div {
display:inline-block;
}
div#nav {
float:right;
display:inline-block;
height: 700px;
width: 150px;
overflow: auto;
}
div#nav table {
border:1px solid #e2e2e6;
padding-left:5px;
}
div#error {
color: red;
font-size: 30px;
font-weight: 200;
padding-top: 300px;
display: none;
}
div#header {
display: block;
width: 900px;
}
a {
text-decoration: none;
}
div#header a {
color:green;
}
div#header #curr {
padding-left: 250px;
color: black;
}
div#header a:visited {
color: green;
float: left;
}
div#header a:last-child {
margin-left: 20px;
float: right;
}
</style>
</head>
<body>
<div id="nav">
<table>
<thead>
<tr>
<th align="left">Navigation</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div id="wrapper">
<div id="header">
<a id="prev">PREV</a>
<a id="curr"></a>
<a id="next">NEXT</a>
</div>
<div id="main">
<div id="chart" ></div>
<div id="chart2"></div>
<div id="chart3"></div>
</div>
<div id="error">
<p>YOU HAVE FAILED ME, YOUNG PADAWAN!</p>
</div>
</div>
<script type="text/javascript">
var selection, prev, next;
selection = location.search.substr(1);
if (examples[selection] !== undefined) {
examples[selection]('chart', 'chart2', 'chart3');
var found = false;
for (var elem in examples) {
if (found) {
next = elem;
break;
}
if (elem === selection) {
found = true;
} else {
prev = elem;
}
}
} else {
for (var elem in examples) {
next = elem;
break;
}
}
$("#curr").text(selection);
if (prev !== undefined) {
$("#prev").attr("href", "?"+prev)
.text("PREV ("+prev+")");
} else {
$("#prev").hide();
}
if (next !== undefined) {
$("#next").attr("href", "?"+next)
.text("("+next+")"+" NEXT");
} else {
$("#next").hide();
}
_.each(examples, function(v, k) {
$('#nav table tbody').append(
$("<tr><td><a href='?"+k+"'>"+k+"</a></td></tr>")
);
});
</script>
</body>
</html>