-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgraphgame.html
More file actions
executable file
·49 lines (49 loc) · 3.54 KB
/
graphgame.html
File metadata and controls
executable file
·49 lines (49 loc) · 3.54 KB
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
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Win Expectancy Grapher</title>
<link rel="canonical" href="https://gregstoll.com/~gregstoll/baseball/graphgame.html" />
<!--#include virtual="/bootstraphead.html"-->
</head>
<body>
<!--#include virtual="/navbar.html"-->
<div class="container">
<p>This tool takes a lot of work to use - if you want to see the win expectancy for MLB games, check out <a href="http://www.fangraphs.com/scoreboard.aspx">fangraphs.com</a>!</p>
<p><a href="javascript:startOver();">Start over</a></p>
<p><a href="#inputtext">Input text directly from a previous run</a> (you can also try out example files)</p>
<div id="todolist">
<form action="graphgame.cgi" method="post">
<p><label for="formtoptitle">Graph title:</label> <input type="text" name="title" id="formtoptitle" value="Home win probability" onchange="return setTitle(false, this.value);"></p>
<p><label for="formtopdoRunsScored">Show when runs scored:</label> <input type="checkbox" name="doRunsScored" id="formtopdoRunsScored" value="doRunsScored" checked onchange="return setDoRunsScored(false, this.checked);"></p>
<p><label for="formtopdoKey">Show legend of when runs scored:</label> <input type="checkbox" name="doKey" id="formtopdoKey" value="doKey" checked onchange="return setDoKey(false, this.checked);"></p>
<table>
<tbody id="situationTBody">
<tr><th>Inning</th><th>Outs</th><th>Runners</th><th>Score diff</th><th></th></tr>
</tbody>
</table>
<p><a href="javascript:addEntries(50, false);">Add more entries</a></p>
</form>
</div>
<p><a id="inputtext">Or, input text here</a> (some <a href="interestinggames/">sample games</a> are available):</p>
<form action="graphgame.cgi" method="post">
<p><label for="formbottomtitle">Graph title:</label> <input type="text" name="title" id="formbottomtitle" onchange="return setTitle(true, this.value);" value="Home win probability"></p>
<p><label for="formbottomdoRunsScored">Show when runs scored:</label> <input type="checkbox" name="doRunsScored" id="formbottomdoRunsScored" value="doRunsScored" checked onchange="return setDoRunsScored(true, this.checked);"></p>
<p><label for="formbottomdoKey">Show legend of when runs scored:</label> <input type="checkbox" name="doKey" id="formbottomdoKey" value="doKey" checked onchange="return setDoKey(true, this.checked);"></p>
<textarea name="directtext" rows="8" cols="50"></textarea>
<input type="submit" name="directtextsubmit" value="Submit">
</form>
<p>This uses the calculations from the <a href="stats.html">Win Expectancy Finder</a>. Here are the source files for the graphing, which are also available from <a href="https://github.com/gregstoll/baseballstats">GitHub</a>:</p>
<ul>
<li><a href="getstats.txt">getstats.py</a> - gets the statistics from the <a href="probs.txt">probs.txt</a> file.</li>
<li><a href="graphgame.txt">graphgame.cgi</a> - does the graphing with <a href="http://www.gnuplot.info">Gnuplot</a>.</li>
<li><a href="/scripts/gregcommon.js.txt">gregcommon.js</a> - common Javascript functions.</li>
<li><a href="graphgame.js">graphgame.js</a> - the Javascript file that creates and updates the inputs on this page for convenience.</li>
</ul>
<p><a href="index.html">Baseball statistic calculators</a></p>
<script type="text/javascript" src="/scripts/gregcommon.js"></script>
<script type="text/javascript" src="graphgame.js"></script>
</div>
<!--#include virtual="/endOfBody.html"-->
</body>
</html>