forked from OpenExoplanetCatalogue/oec_web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
systems.html
266 lines (239 loc) · 9.84 KB
/
systems.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<?include(".inc/prepend.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- If this is run as a php script on a server, you can include your own header that includes a navigation bar, and other stylistic features -->
<script language="php"> include "./.inc/header.php"; if (false){ </script>
<!-- ** start server side header ** -->
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon" type="image/ico" href="favicon.ico" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/><meta name="description" content="description"/>
<title>Open Exoplanet Catalogue</title>
<link rel="stylesheet" type="text/css" href="./css/style.css" media="screen" />
<link rel="stylesheet" type="text/css" href="./css/tables.css" media="screen" />
<script type="text/javascript" src="./js/d3.v3.min.js"></script>
<script type="text/javascript" src="./js/rgbcolor.js"></script>
<script type="text/javascript" src="./js/canvg.js"></script>
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="./js/oec_numberformatter.js"></script>
</script>
</head>
<body>
<div class="outer-container">
<div class="inner-container">
<div class="content">
<!-- ** end server side header ** -->
<script language="php"> } </script>
<!-- ########################### -->
<!-- ########################### -->
<h2><img src="./img/database.png" alt="kig" />Correlation diagrams</h2>
<p>
This page is currently under development.
It uses the d3 javascript library.
Once you've loaded this page, you can do all the operations without an internet connection.
</p>
<!-- ########################### -->
<style type="text/css">
label input {
margin-right: 0.5em;
}
.spec{
vertical-align: top;
}
</style>
<!-- ########################### -->
<div class="spacer"></div>
<table cellspacing="0" summary="Settings">
<thead>
<tr>
<th scope="col" class="nobg"> </th>
<th scope="col">Options<br/> <small>The table updates automatically when an option is changed.</small> </th>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="14" scope="row">
<label>Available fields</label>
</th>
<td><label><input checked="checked" name="field" type="checkbox" value="name:first" onclick="updateTable()"/>Planet name</label></td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="name" onclick="updateTable()"/>Planet name and all aliases</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="discoveryyear" onclick="updateTable()"/>Discovery year</label> </td>
</tr>
<tr>
<td><label><input checked="checked" name="field" type="checkbox" value="mass" onclick="updateTable()"/>Mass [MJup]</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="radius" onclick="updateTable()"/>Radius [RJup]</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="discoverymethod" onclick="updateTable()"/>Discovery method</label> </td>
</tr>
<tr>
<td><label><input checked="checked" name="field" type="checkbox" value="semimajoraxis" onclick="updateTable()"/>Semi-major axis [AU]</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="eccentricity" onclick="updateTable()"/>Eccentricity</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="numberofplanetsinsystem" onclick="updateTable()"/>Number of planets in system</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="numberofstarsinsystem" onclick="updateTable()"/>Number of stars in system</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="lastupdate" onclick="updateTable()"/>Last update [yy/mm/dd]</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="distance" onclick="updateTable()"/>Distance [pc]</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="rightascension" onclick="updateTable()"/>Right ascension [hh mm ss]</label> </td>
</tr>
<tr>
<td><label><input name="field" type="checkbox" value="declination" onclick="updateTable()"/>Declination [+-dd mm ss]</label> </td>
</tr>
<tr>
<th rowspan="3" scope="row">
Stellar multiplicity
</th>
<td>
<label for="stellarmultiplicity_all"><input checked="checked" name="stellarmultiplicity" type="radio" value="all" id="stellarmultiplicity_all" onclick="updateTable()"/>All planets</label>
</td>
</tr>
<tr>
<td>
<label for="stellarmultiplicity_ptype"><input name="stellarmultiplicity" type="radio" value="ptype" id="stellarmultiplicity_circumbinary" onclick="updateTable()"/>Only circumbinary planets, P-type</label>
</td>
</tr>
<tr>
<td>
<label for="stellarmultiplicity_stype"><input name="stellarmultiplicity" type="radio" value="stype" id="stellarmultiplicity_stype" onclick="updateTable()"/>Only planets around stars with<br />a wide binary companion, S-type</label>
</td>
</tr>
</tbody>
</table>
<!-- ########################### -->
<div class="spacer"> </div>
<table cellspacing="0" summary="List of exoplanets" id="systemtable" class="tablesorter">
<thead>
<tr id="systemtablehead">
</tr>
</thead>
<tbody id="systemtablebody">
<script language="php">
// Include server side script (to allow crawlers to access sites without js)
$filename = "systems.xml";
$requestname = basename($filename,".xml");
$system = simplexml_load_file($filename);
$planets = $system->xpath('.//planet');
foreach($planets as $planet){
print "<tr>\n";
print "\t<td><a href=\"./system.html?id=". urlencode($planet->name) . "\">".$planet->name."</a></td>\n";
print "\t<td>".$planet->mass."</td>\n";
print "\t<td>".$planet->semimajoraxis."</td>\n";
print "</tr>\n";
}
</script>
</tbody>
</table>
<!-- ########################### -->
<script type="text/javascript">
// This specifies the data source.
// github is fast and reliable. The file in this repository is always up-to-date.
// github uses gzip compression which reduces the size of the entire database to only 100KB.
// However, your browser must allow script to be loaded from other websites.
//var source = "https://raw.github.com/hannorein/oec_iphone/master/data_iphone_9.1/systems.xml";
// You can always load a file in the same directory. This also works with local files if you do
// not have access to the internet.
var source = "systems.xml";
var xmldata = null;
d3.xml(source, "application/xml", function(xml) {
xmldata = xml;
updateTable(true);
});
function getValueForPlanetAndKey(planet,key){
switch (key){
case "numberofplanetsinsystem":
var system = $(planet).parents("system");
return system.find("planet").length;
case "numberofstarsinsystem":
var system = $(planet).parents("system");
return system.find("star").length;
case "declination":
case "rightascension":
var system = $(planet).parents("system");
return $(key,system).text();
case "lastupdate":
return $(key,planet).text();
case "distance":
var system = $(planet).parents("system");
return getFormatForTag($(key,system));
case "name:first":
var name = $(key,planet).text();
return "<a href='./system.html?id="+encodeURIComponent(name)+"'>"+name+"</a>";
default:
return getFormatForTag($(key,planet));
}
}
var updateTable = function(first){
var stellarmultiplicity = $("input:radio[name=stellarmultiplicity]:checked").val();
var planets;
switch(stellarmultiplicity){
case "all":
planets = $("planet",xmldata);
break;
case "ptype":
planets = $("binary > planet",xmldata);
break;
case "stype":
planets = $("binary > star > planet",xmldata);
break;
}
var fields = $("input[name=field]:checked");
// Header
var th = d3.select("#systemtablehead").selectAll("th")
.data(fields)
th.enter().append("th");
th.attr("scope","column")
.text(function(d){
return $(d).parent().text();
});
th.exit().remove();
// Body
var tr = d3.select("#systemtablebody").selectAll("tr").data(planets);
tr.exit().remove();
tr.enter().append("tr");
var td = tr.selectAll("td").data(fields);
td.exit().remove();
td.enter().append("td");
td
.html(function(d) {
return getValueForPlanetAndKey(d3.select(this.parentNode).datum(),$(d).val());
});
$(".tablesorter").tablesorter({ cssHeader: 'tsheader'});
};
</script>
<div class="spacer" style="clear:left"></div>
<!-- ########################### -->
<h2><img src="./img/xml.png" alt="star" />Data download</h2>
<p>
The data presented in this plot is taken from the <a href="https://github.com/hannorein/open_exoplanet_catalogue">Open Exoplanet Catalogue</a>. All information on this page is directly generated from the XML files in the catalogue. If you are interested in how, look at the source code. You can download the entire catalogue on <a href="https://github.com/hannorein/open_exoplanet_catalogue/">github</a>. You can also find ASCII tables of the same catalogue <a href="https://github.com/hannorein/oec_tables/">in a separate repository</a>. Some information, especially in the case of a binary system cannot be easily represented in an ASCII table. You are therefore encouraged to use the original XML files provided by the Open Exoplanet Catalogue.
</p>
<!-- If run on a server, you can include your own footer -->
<script language="php"> include "./.inc/footer.php"; if (false){ </script>
<!-- ** start server side header ** -->
</div> <!-- content -->
<div class="clearer"> </div>
<div class="footer">
The data on this page is taken from the <a href="http://github.com/hannorein/open_exoplanet_catalogue">Open Exoplanet Catalogue</a>. The Open Exoplanet Catalogue as well as this website itself are licensed under an <a href="https://github.com/hannorein/open_exoplanet_catalogue/blob/master/README.md">MIT license</a>.
</div> <!-- footer -->
</div> <!-- inner container -->
</div> <!-- outer container -->
</body>
</html>
<!-- ** end server side header ** -->
<script language="php"> } </script>