-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDemo.html
250 lines (242 loc) · 13.9 KB
/
Demo.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
<!DOCTYPE html>
<html ng-app="Tex">
<head>
<title>RevEx</title>
<meta charset="UTF-8">
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="shortcut icon" href="images/favico.png" />
<link href='vendors/roboto.css' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="vendors/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css" />
<script src="vendors/angular.min.js"></script>
<script src="vendors/angular-sanitize.min.js"></script>
<script src="vendors/elasticsearch.angular.min.js"></script>
<script src="vendors/d3.min.js"></script>
<script src="vendors/topojson.v1.min.js"></script>
<script src="vendors/d3.layout.cloud.js"></script>
<script src="vendors/papaparse.min.js"></script>
<script src="vendors/moment.min.js"></script>
<script src="js/states.js"></script>
<script src="js/utils.js"></script>
<script src="js/es.js"></script>
<script src="js/app.js"></script>
<script src="js/facets.js"></script>
</head>
<body ng-controller="texCtrl" ng-init="init()">
<div class="loading" ng-hide="true" id="initialSplash" style="display:block; z-index: 1000; opacity:1">
<img src="images/logo.png">{{logged}} <br><br>
Password: <input type="password" ng-model="security.password" ng-enter="login()"> <button ng-click="login()">Load</button> <br>
<span style="color:red">{{security.status}}</span>
</div>
<input type="file" id="uploadBox" style="display:none" fileread="vm.uploadme"/>
<div id="SearchBar">
<ul>
<li><img src="images/logo.png" /></li>
<li><input ng-enter="setUrl(); changeSearch()" type="search" placeholder="Search" ng-model="filter.search" /></li>
<li><button ng-click="setUrl(); changeSearch()" style="cursor: pointer; font-size:16px"><i class="fa fa-search"></i></button></li>
<li>
<button ng-click="saveState()" style="cursor: pointer; font-size:16px"><i class="fa fa-floppy-o"></i></button>
</li>
<li style="margin-left: 20px; padding-top: 4px; padding-left: 10px;">
<span ng-if="config.minCount > 1" class="filter"><i style="padding-left: 6px" class="fa fa-chevron-right"></i> Min:{{config.minCount}} <div ng-click="removeMin()">Remove</div> </span>
<span ng-repeat="f in filter.filters" class="filter"><i style="padding-left: 6px" class="fa fa-chevron-right"></i> {{f.facet}}:{{f.value.join(",")}} <div ng-click="removeFilter(f, $index)">Remove</div> </span>
</li>
</ul>
</div>
<div id="Summary">
<div class="stats">
<h2>Hits: {{data.total}}</h2><br />
<label><input type="datetime" ng-model="filter.date.from.desc" style="width: 60px; border:none; border-bottom:solid 1px #ccc" ng-model-options="{ updateOn: 'blur' }" /> to <input type="datetime" ng-model="filter.date.to.desc" style="width: 60px; border:none; border-bottom:solid 1px #ccc" /></label>
</div>
<div class="histogram">
<div histogram data="data.histogram" filter="filter" loading="loading.histogram"></div>
</div>
<div class="sort">
<label>Sort</label>
<select ng-model="filter.sortDocuments" ng-change="changeSort()">
<option value="relevance">Relevance</option>
<option value="date">Date</option>
<option value="date-desc">Date (Desc)</option>
<option value="stars">Stars</option>
<option value="stars-desc">Stars (Desc)</option>
</select>
<button>
<i class="fa fa-download" ng-click="downloadDocuments()"></i>
</button>
</div>
</ul>
</div>
<div id="Data">
<div id="Facets" >
<div class="facet" style="min-height: 10px">
<div class="legend">
<label>Count(#)</label>
<div style="background-color:hsl(200, 20%, 80%)">< 5</div>
<div style="background-color:hsl(200, 40%, 70%)">> 5</div>
<div style="background-color:hsl(200, 60%, 60%)">> 50</div>
<div style="background-color:hsl(200, 80%, 50%)">> 500</div>
<div style="background-color:hsl(200, 100%, 40%)">> 5K</div>
</div>
<div class="legend">
<label>Percent(%)</label>
<div style="background-color:hsl(200, 20%, 80%)">< 0.1%</div>
<div style="background-color:hsl(200, 40%, 70%)">> 0.1%</div>
<div style="background-color:hsl(200, 60%, 60%)">> 1%</div>
<div style="background-color:hsl(200, 80%, 50%)">> 10%</div>
<div style="background-color:hsl(200, 100%, 40%)">> 50%</div>
</div>
</div>
<div class="facet facet-{{facet.directive}}" facet data="facet" loading="loading.facets" ng-repeat="facet in data.facets | orderBy: 'order'"></div>
</div>
<div id="RelatedPhrases" style="overflow:auto">
<div class="facet suggestions" ng-show="data.suggestions.length > 0">
<h3>Did you mean</h3>
<ul>
<li ng-repeat="sugg in data.suggestions">
<span class="title">{{sugg.text}} = </span>
<span ng-click="searchFix(sugg.text, op.text)" ng-repeat="op in sugg.options"><span class="opt">{{op.text}}</span>, </span>
</li>
</ul>
</div>
<div class="facet facet-{{facet.directive}}" cloud search="state.search" total="data.total" h="400" data="data.terms" loading="loading.terms"></div>
<div class="facet facet-{{facet.directive}}" cloud search="state.search" total="data.total" h="200" data="data.bigrams" loading="loading.bigrams"></div>
</div>
<div id="DocumentsList">
<div class="sortBar" ng-model="sortDocuments">
</div>
<div class="list">
<div class="document" ng-repeat="doc in data.documents" ng-click="selectDocument(doc)">
<div class="header">
<span class="business"><a ng-href="{{doc.review.url}}" target="_blank">{{doc.business.name}}</a></span>
<span class="details"> - {{doc.business.category | list}} - {{doc.review.created | date:'MMM dd, yyyy'}}</span>
<span class="stars" ng-bind-html="doc.review.rating | stars"></span>
</div>
<div class="text" ng-bind-html="HTML(doc.text)"></div>
</div>
<div class="loadmore" ng-show="data.documents.length < data.total" ng-click="loadMore()">Load More ...</div>
</div>
</div>
</div>
<div id="documentDetailView" ng-show="state.selectedDocument" >
<div class="window" >
<h1>{{state.selectedDocument.business.name}} <a ng-click="state.selectedDocument = undefined">x close</a></h1>
<div class="details">
<h2>Review</h2>
<table>
<tr><th>Date</th><td>{{state.selectedDocument.review.created | date:short}}</td></tr>
<tr><th>Rating</th><td>{{state.selectedDocument.review.rating }}</td></tr>
<tr><th>Url</th><td><a ng-href="{{state.selectedDocument.review.url}}" target="_blank" ng-click="$event.stopPropagation()">Link</a></td></tr>
</table>
<h2>Business</h2>
<table>
<tr><th>Category</th><td>{{state.selectedDocument.business.category | list}}</td></tr>
<tr><th>City</th><td>{{state.selectedDocument.business.city }}</td></tr>
<tr><th>State</th><td>{{state.selectedDocument.business.state }}</td></tr>
<tr><th>Phone</th><td>{{state.selectedDocument.business.phone }}</td></tr>
<tr><th>Avg. Rating</th><td>{{state.selectedDocument.business.rating }}</td></tr>
<tr><th>Review Count</th><td>{{state.selectedDocument.business.review_count }}</td></tr>
<tr><th>Url</th><td><a ng-href="{{state.selectedDocument.business.url}}" target="_blank">Link</a></td></tr>
</table>
<h2>User</h2>
<table>
<tr><th>Name</th><td>{{state.selectedDocument.user.name }}</td></tr>
<tr><th>Gender</th><td>{{state.selectedDocument.user.gender }}</td></tr>
<tr><th>City</th><td>{{state.selectedDocument.user.city }}</td></tr>
<tr><th>State</th><td>{{state.selectedDocument.user.state }}</td></tr>
</table>
</div>
<div class="text">
<span ng-bind-html="HTML(state.selectedDocument.text)"></span> <br>
<button ng-click="saveDocument(state.selectedDocument)" style="cursor: pointer; font-size:16px"> <i class="fa fa-floppy-o"></i> Save Document</button>
</div>
</div>
</div>
<div id="configView">
<div class="toolBar">
<button><i class="fa fa-cog"></i></button>
</div>
<div class="panel">
<ul>
<li><label>Min. Count</label><input type="number" ng-enter="loadData()" ng-model="config.minCount"></input></li>
</ul>
<hr />
<div class="help">
<h3>Search Query</h3>
<h4>Boolean operators</h4>
Operators are:
<ul>
<li><em>+</em> (this term must be present)</li>
<li><em>-</em> (this term must not be present).</li>
</ul>
All other terms are optional. For example, this query:
<em>quick brown +fox -news</em>
<ul>
<li><em>fox</em> must be present</li>
<li><em>news</em> must not be present</li>
<li><em>quick and brown</em> are optional — their presence increases the relevance</li>
</ul>
The familiar operators <em>AND</em>, <em>OR</em> and <em>NOT</em> are also supported
<h4>Proximity searches</h4>
<span>While a phrase query (eg "john smith") expects all of the terms in exactly the same order,
a proximity query allows the specified words to be further apart or in a different order with a number specifying the maximum distance between them: "fox quick"~5</span>
<h4>Fuzziness</h4>
<span>We can search for terms that are similar to, but not exactly like our search terms, using the “fuzzy” operator: quikc~ brwn~ foks~</span>
<h4>Wildcards</h4>
<span>Wildcard searches can be run on individual terms, using <em>?</em> to replace a single character, and <em>*</em> to replace zero or more characters: qu?ck bro*</span>
<h4>Regular Expressions</h4>
<span>Regular expression patterns can be embedded in the query string by wrapping them in forward-slashes <em>("/")</em>:/joh?n(ath[oa]n)/ </span>
<h4>Boosting</h4>
<span>Use the boost operator <em>^</em> to make one term more relevant than another, For instance, if we want to find all documents about foxes, but we are especially interested in quick foxes: quick^2 fox, </span>
</div>
</div>
</div>
<div id="about"><a href="http://enrico.bertini.io/revex">About</a></div>
<div id="caseView">
<div class="toolBar">
Case: {{selectedCase.name}} <i class="fa fa-caret-down"></i>
</div>
<div class="panel">
<div class="subBar">
<button><i class="fa fa-plus" ng-click="addCase()"></i></button>
<button><i class="fa fa-download" ng-click="downloadCases()"></i></button>
<button><i class="fa fa-upload" ng-click="upload()"></i></button>
</div>
<h2>States</h2>
<ul>
<li ng-repeat="state in selectedCase.states track by $index" ng-click="loadState(state)">
{{state.desc}}
<div class="detail"> {{filtersList(state)}} </div>
<button ng-click="removeState($index); $event.stopPropagation();"><i class="fa fa-trash-o"></i></button>
</li>
</ul>
<h2>Documents</h2>
<ul>
<li ng-repeat="doc in selectedCase.documents track by $index" ng-click="selectDocument(doc)">{{doc.title}}
<div class="detail"><span ng-repeat="h in doc.details" ng-bind-html="HTML(h)"></span></div>
<button ng-click="removeDoc($index); $event.stopPropagation();"><i class="fa fa-trash-o"></i></button>
</li>
</ul>
<div class="caselist" ng-hide="cases.length <= 1">
<h2>Other Cases</h2>
<ul class="otherCases">
<li ng-repeat="case in cases track by $index" ng-hide="case.name == selectedCase.name" ng-click="selectCase(case)">{{case.name}}
<button ng-click="removeCase($index); $event.stopPropagation();"><i class="fa fa-trash-o"></i></button>
</li>
</ul>
</div>
</div>
</div>
<div id="toolTip">tool tip</div>
</body>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-61671027-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</html>