1223
|
1 <!doctype html>
|
|
2 <html>
|
1444
|
3
|
|
4 <head>
|
|
5 <title>wifi</title>
|
|
6 <meta charset="utf-8">
|
|
7 <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script>
|
|
8 <script src="/lib/require/require-2.3.3.js"></script>
|
|
9 <script src="/rdf/common_paths_and_ns.js"></script>
|
|
10
|
|
11 <link rel="stylesheet" href="/rdf/browse/style.css">
|
|
12
|
|
13 <link rel="import" href="/rdf/streamed-graph.html">
|
|
14 <link rel="import" href="/lib/polymer/1.0.9/polymer/polymer.html">
|
|
15 </head>
|
|
16
|
|
17 <body class="rdfBrowsePage">
|
|
18 <template id="t" is="dom-bind">
|
|
19 <style>
|
|
20 body {
|
|
21 background: black;
|
|
22 color: white;
|
|
23 }
|
|
24 a {
|
|
25 color: #b1b1fd;
|
|
26 text-shadow: 1px 1px 0px #0400ff94;
|
|
27 text-decoration-color: #00007714;
|
|
28 }
|
|
29 #subjectRequest {
|
|
30 width: 50em;
|
|
31 }
|
|
32 </style>
|
|
33
|
|
34 <streamed-graph url="/sse_collector/graph/network" graph="{{graph}}"></streamed-graph>
|
|
35 <div id="out">
|
|
36 </div>
|
1223
|
37
|
1444
|
38 <script type="module">
|
|
39 import { render } from '/lib/lit-html/1.0.0/lit-html.js';
|
|
40 import { graphView } from './wifi.js';
|
|
41 const sg = document.querySelector('streamed-graph');
|
|
42
|
|
43 const out = document.querySelector('#out');
|
|
44 const startPainting = () => {
|
|
45 if (!sg.graph || !sg.graph.graph) {
|
|
46 setTimeout(startPainting, 100);
|
|
47 return;
|
|
48 }
|
|
49
|
|
50 let dirty = true;
|
1223
|
51
|
1444
|
52 const repaint = () => {
|
|
53 if (!dirty) {
|
|
54 return;
|
|
55 }
|
|
56 render(graphView(sg.graph.graph), out);
|
|
57 dirty = false;
|
|
58 };
|
1223
|
59
|
1444
|
60 sg.addEventListener('graph-changed', (ev) => {
|
|
61 dirty = true;
|
|
62 requestAnimationFrame(repaint);
|
|
63 });
|
|
64 repaint();
|
|
65 };
|
|
66 setTimeout(startPainting, 10);
|
|
67 </script>
|
|
68 </template>
|
|
69 <script>
|
|
70
|
|
71 </script>
|
|
72 </body>
|
|
73
|
1223
|
74 </html>
|