Skip to content

Instantly share code, notes, and snippets.

@RanaivosonHerimanitra
Created April 17, 2014 09:26
Show Gist options
  • Save RanaivosonHerimanitra/10968189 to your computer and use it in GitHub Desktop.
Save RanaivosonHerimanitra/10968189 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1 " charset="UTF-8" >
<link rel="stylesheet" href="shared/jquery.mobile-1.4.2.min.css" />
<script src="shared/jquery.js" type="text/javascript"></script>
<script src="shared/jquery.mobile-1.4.2.min.js" type="text/javascript" > </script>
<script src="shared/shiny.js" type="text/javascript"></script>
<script src="shared/highcharts.js" type="text/javascript"></script>
<script src="shared/data.js" type="text/javascript"></script>
<script src="shared/exporting.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="shared/shiny.css"/>
<script type="text/javascript">
$(function () {
$('#mygraph').highcharts({
data: {
table: document.getElementById("datatable")
},
chart: {
type: 'column'
},
title: {
text: "Data extracted from an HTML balise"
}
});
});
</script>
</head>
<body>
<h1>HTML UI with jquery mobile & Shiny:</h1>
<div class="ui-grid-a">
<div class="ui-block-a"><div class="ui-bar ui-bar-a" >
<p>
<strong>Distribution:</strong>
<select name="dist" data-native-menu=false >
<option value="norm">Normal</option>
<option value="unif">Uniform</option>
<option value="lnorm">Log-normal</option>
<option value="exp">Exponential</option>
</select>
<strong>Number of observation:</strong>
<input maxlength="4" type="number" name="n" />
</p>
<p>
<strong>Summary of the distribution:</strong>
</p>
<pre id="summary" class="shiny-text-output"></pre>
</p>
<input data-inline=true type="button" value="CLICK ME TO DISPLAY SERVER RESPONSE" onclick='alert(document.getElementById("idmytable"));'/>
<p>
</div></div>
<div class="ui-block-b"><div class="ui-bar ui-bar-a" >
<div id="mygraph" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<table id="datatable">
<thead>
<tr>
<th>Fruits</th>
<th>Jane</th>
</tr>
</thead>
<tbody>
<tr>
<th>Apples</th>
<td>3</td>
</tr>
<tr>
<th>Pears</th>
<td>2</td>
</tr>
<tr>
<th>Plums</th>
<td>5</td>
</tr>
<tr>
<th>Bananas</th>
<td>1</td>
</tr>
<tr>
<th>Oranges</th>
<td>2</td>
</tr>
</tbody>
</table>
<div id="idmytable" class='shiny-html-output'></div>
</div></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment