forked from fin-hypergrid/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
615 lines (537 loc) · 26 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
<!doctype html>
<html>
<head>
<script>
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var theme = getParameterByName("theme") || "seven-seas";
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("shim-shadowdom", ' ');
fileref.setAttribute("href", 'themes/' + theme + '.css');
document.getElementsByTagName("head")[0].appendChild(fileref);
</script>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>fin-hypergrid Demo</title>
<script src="../webcomponentsjs/webcomponents.js"></script>
<script src="../accountingjs/accounting.min.js"></script>
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-menu-button/paper-menu-button.html">
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../core-splitter/core-splitter.html">
<link href="../core-collapse/core-collapse.html" rel="import">
<link href="../core-icons/core-icons.html" rel="import">
<link href="../core-menu/core-menu.html" rel="import">
<link href="../paper-button/paper-button.html" rel="import">
<link href="../paper-dropdown/paper-dropdown.html" rel="import">
<link href="../paper-icon-button/paper-icon-button.html" rel="import">
<link href="../paper-item/paper-item.html" rel="import">
<!-- <link rel="import" href="fin-hypergrid.min.html"> -->
<link rel="import" href="polymer/html/fin-hypergrid.html">
<style>
body {
transition: opacity 0.150s ease-in;
}
.rotateHalf {
opacity: 0;
}
fin-hypergrid {
}
paper-tabs {
box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2);
}
core-header-panel {
height: 100%;
width: 100%;
position: absolute;
}
core-pages {
position: absolute;
top: 50px;
right: 0;
bottom: 0;
left: 0;
}
a {
font-weight: 900;
font-size: larger;
color: rgba(0, 115, 255, 0.9) !important;
}
.abs {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.rel {
position: relative;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.centered {
margin-left: auto;
margin-right: auto;
width: 50%;
white-space: nowrap;
}
.description {
padding-left: 8%;
padding-right: 8%;
}
.theme-menu {
width:140px;
text-align:center;
padding-top:12px;
cursor: pointer;
}
</style>
</head>
<body unresolved fullbleed>
<core-header-panel>
<core-toolbar layout horizontal>
<paper-menu-button class="nocollapse theme-menu">
Themes
<core-icon icon="arrow-drop-down"></core-icon>
<paper-dropdown class="dropdown" transition="">
<core-menu class="menu" style="width:140px;margin: 0px;">
<template is="auto-binding" id="themeDropDown" repeat="{{themes}}">
<paper-item onclick="selectTheme(this)">{{}}</paper-item>
</template>
</core-menu>
</paper-dropdown>
</paper-menu-button>
<paper-tabs selected="0" flex>
<paper-tab>In Memory</paper-tab>
<paper-tab>Default</paper-tab>
<paper-tab>JSON</paper-tab>
<paper-tab>Q</paper-tab>
<paper-tab>Q Tree</paper-tab>
<paper-tab>Game Of Life</paper-tab>
</paper-tabs>
</core-toolbar>
<core-pages selected="0">
<div vertical layout>
<div class="description">
<h3>fin-hypergrid-behavior-in-memory
</h3> This element is a custom Polymer web component that is a demonstration of a simple subclass of the fin-hypergrid-behavior-default. It demonstrates live high frequency updating of data, variable width columns, alternate cell renderers, and alternate cell editors(double click in various cells of column 'J'). Press Alt/Option to toggle the column picker. Also, Take note that hypergrid supports <a href="https://polymerthemes.com/">polymer themes</a> and one can be selected from the top left menu.
<br>
<br>
</div>
<core-splitter direction="up"></core-splitter>
<div flex class="rel">
<fin-hypergrid class="abs" id="in-memory-example">
<fin-hypergrid-behavior-in-memory></fin-hypergrid-behavior-in-memory>
<fin-hypergrid-excel></fin-hypergrid-excel>
</fin-hypergrid>
</div>
</div>
<div vertical layout>
<div class="description">
<h3>fin-hypergrid-behavior-default</h3> This element is a custom Polymer web component that is the base class for the GridBehavior role in the design of the OpenFin hypergrid. Not only does it accomodate the interface getValue(x,y) and setValue(x,y) of a traditional table model, it encapsulates the behavior that allows its implementation to determine what happens on various user events. This allows for external data analytics tools to do sorting, drilling down, aggregation etc. With this example the getValue function is defined to simply return a string of the passed in x and y modulo 26 alpha character. Notice the number of rows is set to a quadrillion. Press Alt/Option to toggle the column picker.
<br>
<br>
</div>
<core-splitter direction="up"></core-splitter>
<div flex class="rel">
<fin-hypergrid class="abs">
<fin-hypergrid-behavior-default></fin-hypergrid-behavior-default>
</fin-hypergrid>
</div>
</div>
<div vertical layout>
<div class="description">
<h3>fin-hypergrid-behavior-json</h3> This element is a custom Polymer web component that manages data sets within javascript. You can sort on any column, with the sort being stable hence previous sorts are maintained. The data is "pushed" into the behavior object with the call to setData at anytime after the polymer ready event is fired, see <a href="https://github.com/openfin/example-fin-hypergrid-behavior-json">(standalone json hypergrid project)</a> for an encapsulated version of this example. Toggle the HiDPI button below to scale canvas to a higher pixel density with sharper rendering. Keep in mind that the grid might exhibit a noticeable performance cost on chrome as there is an <a href="https://code.google.com/p/chromium/issues/detail?id=445372&q=drawImage&colspec=ID%20Pri%20M%20Week%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified">outstanding bug</a> that is triggered in HiDPI mode because the double buffering image dimensions are much larger on some devices.
<button id="hidpi-button" onClick="toggleHiDPI()">enable HiDPI</button>
<br>
<br>
</div>
<core-splitter direction="up"></core-splitter>
<div flex class="rel">
<fin-hypergrid class="abs" id="json-example">
<fin-hypergrid-behavior-json></fin-hypergrid-behavior-json>
</fin-hypergrid>
</div>
</div>
<div vertical layout>
<div class="description">
<h3>fin-hypergrid-behavior-q</h3> This element is a custom Polymer web component that demonstrates a simple interface to Q/KDB+ by kx systems. In order for this to work you need to run a hypergrid compatible Q program on your machine. The provided example sorttable.q script is a true in memory million row table that allows you to sort on any column. This hypergrid example can also be used with a rdbms of moderate size. See the <a href="https://github.com/openfin/fin-hypergrid/tree/master/rdbms">rdbms</a> directory for instructions.
<h3>To setup q for this demo</h3>
<ol>
<li>Install <a href="http://kx.com/software-download.php">Q 32bit free version</a></li>
<li>download <a href="sorttable.q">sorttable.q</a> and place it into a directory somewhere(myqdir for this example)</li>
<li>make sure port 5000 is available</li>
<li>start sorttable.q at the command line<pre>~/myqdir>q sortable.q</pre></li>
<li>refresh your browser and reselect this tab</li>
</ol>
<h3>To point this example to your data</h3>
load <a href="http://q/hypergrid-support.q">hypergrid-support.q</a> into your running q process and modify the url, table name, then press reconnect.
</div>
<br>
<div width="100%">
<div class="centered">url:<input id="qurl" style="width:150px" value="ws://localhost:5000"></input> table:<input id="qtable" style="width:80px" value="trade"></input><button id="connectq" onClick="connectQ()">reconnect</button></div>
</div>
<core-splitter direction="up"></core-splitter>
<div flex class="rel">
<fin-hypergrid class="abs" id="q-example">
<fin-hypergrid-behavior-q url="ws://localhost:5000" table="trade"></fin-hypergrid-behavior-q>
</fin-hypergrid>
</div>
</div>
<div vertical layout>
<div class="description">
<h3>fin-hypergrid-behavior-qtree</h3> This element is a custom Polymer web component that demonstrates a more complex interface to Q/KDB+ by kx systems. In order for this to work you need to run either provided q scripts found in <a href="https://github.com/openfin/fin-hypergrid/blob/master/q/s1.zip">s1.zip scripts (see s1.txt for instructions)</a>, <a href="https://github.com/openfin/fin-hypergrid/blob/master/q/s2.zip">s2.zip scripts (see s2.txt for instructions)</a>, or <a href="https://github.com/openfin/fin-hypergrid/blob/master/q/s3.zip">s3.zip scripts (see s32.txt for instructions)</a>. The s1 example is a +1MM row tree table with static data, the s2 example has live updates without page caching, and the s3 example demonstrates true backend view caching delivering +1MM updates X 4 times a second push to the hypergrid. These examples show the powerful dynamic analytic capabilities of an external data engine. These example Q script are based on <a href="http://archive.vector.org.uk/art10500340">code and a paper</a> written by <a href="http://nsl.com/">Stevan Apter.</a> Press the alt/option button for a popup to select the hierarchy columns or select/hide the visible columns.</div>
<br>
<core-splitter direction="up"></core-splitter>
<div flex class="rel">
<fin-hypergrid class="abs" id="qtree-example">
<fin-hypergrid-behavior-qtree url="ws://localhost:12345"></fin-hypergrid-behavior-qtree>
</fin-hypergrid>
</div>
</div>
<div vertical layout>
<div class="description">
<h3>fin-hypergrid-behavior-gol</h3> This element is another custom Polymer web component grid behavior showing Conway's Game of Life. The performance difference in the javascript execution environment between various browsers is very apparent with this example. For the best performance try resizing your browser window to the grid x by y size (75 X 45)<br>
<button id="play-button" onClick="toggleRunning()">play</button>
<button onClick="clearGOLGrid()">reset</button>
<br>
<br>
</div>
<core-splitter direction="up"></core-splitter>
<div flex class="rel">
<fin-hypergrid class="abs">
<fin-hypergrid-behavior-gol></fin-hypergrid-behavior-gol>
</fin-hypergrid>
</div>
</div>
</core-pages>
</core-header-panel>
<script>
var updateThemes = function() {
var renderers = Array.prototype.slice.call(document.querySelectorAll('fin-hypergrid'));
//only need to tickle one as it's a global theme
if (renderers.length > 0) {
renderers[0].themeChangedNotification();
}
}
function selectTheme(selection) {
var themeName = selection.innerText || selection.textContent;
themeName = themeName.trim();
setTimeout(function(){
document.location = document.location.href.split('?')[0]+'?theme=' + themeName;
},50);
};
//some general setup
(function(){
document.addEventListener('polymer-ready', function() {
var scope = document.querySelector('#themeDropDown');
scope.themes = [
'excel',
'bloomberg',
'candy',
'classical',
'dark-side',
'denim',
'everest',
'gelati',
'golden-goose',
'ice',
'la-resistance',
'melon',
'seven-seas',
'sky',
'technology',
'the-times'
];
});
})();
//lets initialize the tabs....
(function() {
var tabs = document.querySelector('paper-tabs');
var pages = document.querySelector('core-pages');
tabs.addEventListener('core-select', function() {
pages.selected = tabs.selected;
});
})();
//override the cell provider for the q example
(function() {
document.addEventListener('polymer-ready', function() {
//get ahold of our in memory example
var inMemoryGrid = document.querySelector('#in-memory-example');
//lets turn his scrollbars to always on....
var lnfOverrides = {
scrollbarHoverOver: 'visible',
scrollbarHoverOff: 'visible',
scrollingEnabled: true
};
inMemoryGrid.addProperties(lnfOverrides);
//get ahold of our q grid example
var qGrid = document.querySelector('#q-example');
//get it's table model
var qModel = qGrid.getBehavior();
//get the cell cellProvider for altering cell renderers
var cellProvider = qModel.getCellProvider();
//there are 4 default cell renderer types to choose from at the moment
//<br>simpleCellRenderer, sliderCellRenderer, sparkbarCellRenderer, sparklineCellRenderer
var typeRendererMap = {
J: 'sparklineCellRenderer',
j: 'simpleCellRenderer',
s: 'simpleCellRenderer',
t: 'simpleCellRenderer',
f: 'simpleCellRenderer',
d: 'simpleCellRenderer'
};
// cellProvider.getCell = function(config) {
// var x = config.x;
// var renderer = cellProvider.cellCache[typeRendererMap[qModel.block.headers[x + 1][1]]];
// renderer = renderer || cellProvider.cellCache.simpleCellRenderer;
// if (x === 11) {
// renderer = cellProvider.cellCache.sliderCellRenderer;
// } else if (x === 13) {
// renderer = cellProvider.cellCache.sparkbarCellRenderer;
// }
// renderer.config = config;
// return renderer;
// };
});
})();
//setup random data for the JSON tab example
(function(){
var seed = 1;
var rnd = function() {
var x = Math.sin(seed++)*10000;
var r = x - Math.floor(x);
return r;
};
var numRows = 100000;
var firstNames = ['Olivia', 'Sophia', 'Ava', 'Isabella', 'Boy', 'Liam', 'Noah', 'Ethan', 'Mason', 'Logan', 'Moe', 'Larry', 'Curly', 'Shemp', 'Groucho', 'Harpo', 'Chico', 'Zeppo', 'Stanley', 'Hardy'];
var lastNames = ['Wirts', 'Oneil', 'Smith', 'Barbarosa', 'Soprano', 'Gotti', 'Columbo', 'Luciano', 'Doerre', 'DePena'];
var months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
var days = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'];
var states = ['Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','Florida','Georgia','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','New Hampshire','New Jersey','New Mexico','New York','North Carolina','North Dakota','Ohio','Oklahoma','Oregon','Pennsylvania','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Vermont','Virginia','Washington','West Virginia','Wisconsin','Wyoming'];
var randomFunc = Math.random;
//var randomFunc = rnd;
var randomPerson = function() {
var firstName = Math.round((firstNames.length - 1) * randomFunc());
//var lastName = 'a' + randomFunc() + 'b';
var lastName = Math.round((lastNames.length - 1) * randomFunc());
var pets = Math.round(10 * randomFunc());
var birthyear = 1900 + Math.round(randomFunc() * 114);
var birthmonth = Math.round(randomFunc() * 11);
var birthday = Math.round(randomFunc() * 29);
var birthstate = Math.round(randomFunc() * 49);
var residencestate = Math.round(randomFunc() * 49);
var travel = randomFunc() * 1000;
var income = randomFunc() * 100000;
var employed = Math.round(randomFunc());
var person = {
last_name: lastNames[lastName],
first_name: firstNames[firstName],
pets: pets,
birthDate: birthyear + '-' + months[birthmonth] + '-' + days[birthday],
birthState: states[birthstate],
residenceState: states[residencestate],
employed: employed === 1,
income: income,
travel: travel
};
return person;
};
// alternate way to set fields and headers
// var headers =
// [
// 'Last Name',
// 'First Name',
// 'Pets',
// 'Birth Date',
// 'Birth State',
// 'Residence State',
// 'Employed',
// 'Income',
// 'Travel'
// ];
// var fields =
// [
// 'last_name',
// 'first_name',
// 'pets',
// 'birthDate',
// 'birthState',
// 'residenceState',
// 'employed',
// 'income',
// 'travel'
// ];
//lets make it available
data = [];
for (var i = 0; i < numRows; i ++) {
data.push(randomPerson());
}
var editorTypes = ['choice','textfield','spinner','date','choice','choice','choice','textfield','textfield'];
document.addEventListener('polymer-ready', function() {
//get ahold of our json grid example
var jsonGrid = document.querySelector('#json-example');
//get it's table model
var jsonModel = jsonGrid.getBehavior();
//get the cell cellProvider for altering cell renderers
var cellProvider = jsonModel.getCellProvider();
//alternate way to set the header labels
//jsonModel.setHeaders(headers);
//alternate way to set the fields found on the row objects
//jsonModel.setFields(fields);
//yet another way to set the fields and headers
// jsonModel.setColumns([
// {
// title: 'First Name',
// field: 'last_name',
// },
// {
// title: 'Last Name',
// field: 'first_name',
// },
// {
// title: 'Birth Date',
// field: 'birthDate',
// }
// ]);
//set the actual json row objects
jsonModel.setData(data);
//sort ascending on the first column (first name)
//jsonModel.toggleSort(0);
//all formatting and rendering per cell can be overridden in here
cellProvider.getCell = function(config) {
var renderer = cellProvider.cellCache.simpleCellRenderer;
config.halign = 'left';
var x = config.x;
if (x === 2) {
config.halign = 'center';
} else if (x === 3) {
config.halign = 'center';
} else if (x === 6) {
config.halign = 'center';
} else if (x === 7) {
var travel = 60 + Math.round(config.value*150/100000);
var bcolor = travel.toString(16);
config.halign = 'right';
config.bgColor = '#00' + bcolor + '00';
config.fgColor = '#FFFFFF';
config.value = accounting.formatMoney(config.value);
} else if (x === 8) {
var travel = 105 + Math.round(config.value*150/1000);
var bcolor = travel.toString(16);
config.halign = 'right';
config.bgColor = '#' + bcolor+ '0000';
config.fgColor = '#FFFFFF';
config.value = accounting.formatMoney(config.value, "€", 2, ".", ",");
}
renderer.config = config;
return renderer;
};
//lets override the cell editors, and configure the drop down lists
jsonModel.getCellEditorAt = function(x, y) {
var type = editorTypes[x];
var cellEditor = this.grid.cellEditors[type];
if (x === 0) {
cellEditor.items = lastNames;
} else if (x === 4 || x === 5) {
cellEditor.items = states;
} else if (x === 6) {
cellEditor.items = [true, false];
}
return cellEditor;
};
jsonGrid.addEventListener('fin-scroll-x', function(e){
console.log('x', e);
});
jsonGrid.addEventListener('fin-scroll-y', function(e){
console.log('y', e);
});
});
})();
//json-example stuff
function toggleHiDPI() {
var button = document.querySelector('#hidpi-button');
var jsonGrid = document.querySelector('#json-example');
jsonGrid.toggleHiDPI();
if (jsonGrid.isHiDPI()) {
button.innerText = 'disable HiDPI';
} else {
button.innerText = 'enable HiDPI';
}
}
//q of life stuff
function connectQ() {
var q = document.querySelector('fin-hypergrid-behavior-q');
var url = document.querySelector('#qurl').value;
var table = document.querySelector('#qtable').value;
//set it blank first to tickle the change event if its
//the same value
q.setAttribute('table', table);
q.setAttribute('url', '');
q.setAttribute('url', url);
}
function toggleRunning() {
var button = document.querySelector('#play-button');
var gol = document.querySelector('fin-hypergrid-behavior-gol');
gol.toggleRunning();
var description = gol.getNextState();
button.innerText = description;
}
//game of life stuff
function clearGOLGrid() {
var gol = document.querySelector('fin-hypergrid-behavior-gol');
gol.resetPetriDish();
}
function toggleRunning() {
var button = document.querySelector('#play-button');
var gol = document.querySelector('fin-hypergrid-behavior-gol');
gol.toggleRunning();
var description = gol.getNextState();
button.innerText = description;
}
function dumpTheme() {
var pb = document.createElement('paper-button');
pb.style.display = 'none';
pb.setAttribute('disabled', true);
document.body.appendChild(pb);
var section = document.createElement('section');
section.style.display = 'none';
section.setAttribute('hero', true);
document.body.appendChild(section);
var p = window.getComputedStyle(pb);
var h = window.getComputedStyle(document.querySelector('html'));
var d = (h.flex || '0 0 0').split(' ');
var s = window.getComputedStyle(section);
console.log('fixed', p['background-color']);
console.log('lineColor', p['color']);
console.log('color', h['color']);
console.log('font-family', h['font-family']);
console.log('backgroundColor', s['background-color']);
pb.setAttribute('disabled', false);
pb.setAttribute('secondary', true);
pb.setAttribute('raised', true);
console.log('backgroundSelColor', p['background-color']);
pb.setAttribute('secondary', false);
pb.setAttribute('info', true);
console.log('fixedRowFGSelColor', p['color']);
console.log('fixedRowBGSelColor', p['background-color']);
document.body.removeChild(pb);
document.body.removeChild(section);
}
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
console.log(mutation.type);
});
var target = document.querySelector('html');
observer.observe(target, { attributes: true, childList: true, characterData: true });
});
</script>
</body>
</html>