-
Notifications
You must be signed in to change notification settings - Fork 2
/
visualise.html
160 lines (153 loc) · 5.83 KB
/
visualise.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
<!-- Copyright (c) 2016 The MathJax Consortium -->
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html lang="en"/>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Semantic Tree Visualisation</title>
<link type="text/css" rel="stylesheet" href="styles/style.css"/>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/d3/dist/d3.min.js"></script>
<link type="text/css" rel="stylesheet" href="styles/tree.css"/>
<script src="https://cdn.jsdelivr.net/npm/speech-rule-engine"></script>
<script>
MathJax = {
loader: {load: ['[tex]/cases', '[tex]/empheq', '[tex]/mathtools']},
tex: {packages: {'[+]': ['cases', 'empheq', 'mathtools']}}
};
</script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script type="text/javascript" src="lib/visualise.js"></script>
<script type="text/javascript">
streeVis.config.expanded = true;
</script>
</head>
<body>
<header>
<div id="layout">
<div id="main">
<textarea id="input" rows="7" cols="35" style="font-size:120%" aria-label="Formula input"></textarea>
</div>
<div id="controls">
<div class="controls" id="rendering-controls">
<div class="header"><span>Rendering</span></div>
<div>
<input id="translate" type="button" value="LaTeX (MathJax)" onclick="streeVis.translateTex(display.checked)"></input>
</div>
<div>
<input id="translate" type="button" value="MathML (MathJax)" onclick="streeVis.translateMathML()"></input>
</div>
<div>
<input id="translate" type="button" value="MathML (direct)" onclick="streeVis.translateSRE()"></input>
</div>
<div id="buttons">
<div>
</div>
<div>
<input id="keep" type="button" value="Keep" onclick="streeVis.keep()"></input>
</div>
</div>
</div>
<div class="controls" id="display-controls">
<div class="header"><span>Display</span></div>
<div>
<input checked align="right" type="checkbox" id="display" value="display"><label for="display">Display</label></input>
</div>
<div>
<input type="checkbox" id="showMathml" value="showMathml"><label for="showMathml">Show MathML</label></input>
</div>
<div>
<input type="checkbox" id="showJson" value="showJson"><label for="showJson">Show Json</label></input>
</div>
<div>
<input type="checkbox" id="showSemantics" value="showSemantics"><label for="showSemantics">Show Semantics</label></input>
</div>
<div>
<input type="checkbox" id="showEnrMml" value="showEnrMml"><label for="showEnrMml">Show enrMML</label></input>
</div>
</div>
<div class="controls" id="tree-controls">
<div class="header"><span>Tree Ops</span></div>
<div>
<input id="orientation" type="button" value="Orientation" onclick="streeVis.changeOrientation()"></input>
</div>
<div>
<input id="collapse" type="button" value="Collapse" onclick="streeVis.collapseAll()"></input>
</div>
<div>
<input id="expand" type="button" value="Expand" onclick="streeVis.expandAll()"></input>
</div>
<div>
</div>
</div>
<div class="controls" id="hover-controls">
<div class="header"><span>Hover Info</span></div>
<div>
<input type="checkbox" id="semanticId" value="semanticId"><label for="semanticId">Id</label></input>
</div>
<div>
<input type="checkbox" id="semanticType" value="semanticType"><label for="semanticType">Type</label></input>
</div>
<div>
<input type="checkbox" id="semanticRole" value="semanticRole"><label for="semanticRole">Role</label></input>
</div>
<div>
<input type="checkbox" id="semanticFont" value="semanticFont"><label for="semanticFont">Font</label></input>
</div>
<div>
<input type="checkbox" id="semanticAnnotation" value="semanticAnnotation"><label for="semanticAnnotation">Annotation</label></input>
</div>
</div>
<div class="controls" id="speech-control">
<div class="header"><span>Speech</span></div>
<div>
<select id="speech" aria-label="Speech nesting depth">
<option>None</option>
<option>Shallow</option>
<option>Deep</option>
</select>
</div>
<div>
<select id="domain" aria-label="Speech rule set">
<option>MathSpeak</option>
<option>ClearSpeak</option>
<option>Default</option>
</select>
</div>
<div>
<select id="locale" aria-label="Speech locale">
<option>en</option>
</select>
</div>
</div>
</div>
<div id="output">
<div id="rendered"><math></math></div>
</div>
</div>
</header>
<hr/>
<section id="body"></section>
<section>
<div>
<pre id="mathml"></pre>
</div>
</section>
<section>
<div>
<pre id="json"></pre>
</div>
</section>
<section>
<div>
<pre id="semantics"></pre>
</div>
</section>
<section>
<div>
<pre id="enrmml"></pre>
</div>
</section>
<script type="text/javascript">
streeVis.reload();
</script>
</body>
</html>