Team:TU-Delft/SynBioData

From 2013.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
-
<script>
+
  <head>
-
function drawVisualization() {
+
    <meta charset="UTF-8">
-
  // To see the data that this visualization uses, browse to
+
-
  // http://spreadsheets.google.com/ccc?key=pCQbetd-CptGXxxQIG7VFIQ
+
-
  var query = new google.visualization.Query(
+
-
      'https://docs.google.com/spreadsheet/pub?key=0ArsDNt8sj-LBdEdCREdxUTFmVXpPaTVnZm43d0RTdmc&single=true&gid=0&output=html');
+
-
  // Apply query language.
+
    <title>Results</title>
-
  query.setQuery('SELECT A  WHERE A =1 ORDER BY A');
+
-
  // Send the query with a callback function.
+
    <link href="/apis/fusiontables/docs/samples/style/default.css"
-
  query.send(handleQueryResponse);
+
        rel="stylesheet" type="text/css">
-
}
+
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
 +
    <script type="text/javascript">
 +
      google.load('visualization', '1', { packages: ['table'] });
-
function handleQueryResponse(response) {
+
      function drawTable() {
-
  if (response.isError()) {
+
        var query = "SELECT 'Scoring Team' as Scoring, " +
-
    alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
+
            "'Receiving Team' as Receiving, 'Minute of goal' as Minute " +
-
    return;
+
            'FROM 1VlPiBCkYt_Vio-JT3UwM-U__APurJvPb6ZEJPg';
-
  }
+
        var team = document.getElementById('team').value;
 +
        if (team) {
 +
          query += " WHERE 'Scoring Team' = '" + team + "'";
 +
        }
 +
        var queryText = encodeURIComponent(query);
 +
        var gvizQuery = new google.visualization.Query(
 +
            'https://docs.google.com/spreadsheet/ccc?key=0ArsDNt8sj-LBdEdCREdxUTFmVXpPaTVnZm43d0RTdmc');
-
  var data = response.getDataTable();
+
        gvizQuery.send(function(response) {
-
  visualization = new google.visualization.LineChart(document.getElementById('visualization'));
+
          var table = new google.visualization.Table(
-
  visualization.draw(data, {legend: 'bottom'});
+
              document.getElementById('visualization'));
-
</script>
+
          table.draw(response.getDataTable(), {
 +
            showRowNumber: true
 +
          });
 +
        });
 +
      }
 +
 
 +
      google.setOnLoadCallback(drawTable);
 +
    </script>
 +
  </head>
 +
  <body>
 +
    <div>
 +
      <label>Scoring Team:</label>
 +
      <select id="team" onchange="drawTable();">
 +
        <option value="">All</option>
 +
        <option value="Germany">Germany</option>
 +
        <option value="New Zealand">New Zealand</option>
 +
        <option value="Uruguay">Uruguay</option>
 +
      </select>
 +
    </div>
 +
    <div id="visualization"></div>
 +
  </body>
</html>
</html>

Revision as of 12:15, 2 September 2013

Results