Mercurial > code > home > repos > homeauto
view service/wifi/index.html @ 1444:4afb1830bb5e
use rx version 3.x
Ignore-this: 4232f8e780d35a8d0642e86521eb2801
darcs-hash:747608892b607f78260f4772a4ff2b24c7392f73
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 24 Sep 2019 14:04:02 -0700 |
parents | 996a00d72979 |
children | 517cbb905d4c |
line wrap: on
line source
<!doctype html> <html> <head> <title>wifi</title> <meta charset="utf-8"> <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script> <script src="/lib/require/require-2.3.3.js"></script> <script src="/rdf/common_paths_and_ns.js"></script> <link rel="stylesheet" href="/rdf/browse/style.css"> <link rel="import" href="/rdf/streamed-graph.html"> <link rel="import" href="/lib/polymer/1.0.9/polymer/polymer.html"> </head> <body class="rdfBrowsePage"> <template id="t" is="dom-bind"> <style> body { background: black; color: white; } a { color: #b1b1fd; text-shadow: 1px 1px 0px #0400ff94; text-decoration-color: #00007714; } #subjectRequest { width: 50em; } </style> <streamed-graph url="/sse_collector/graph/network" graph="{{graph}}"></streamed-graph> <div id="out"> </div> <script type="module"> import { render } from '/lib/lit-html/1.0.0/lit-html.js'; import { graphView } from './wifi.js'; const sg = document.querySelector('streamed-graph'); const out = document.querySelector('#out'); const startPainting = () => { if (!sg.graph || !sg.graph.graph) { setTimeout(startPainting, 100); return; } let dirty = true; const repaint = () => { if (!dirty) { return; } render(graphView(sg.graph.graph), out); dirty = false; }; sg.addEventListener('graph-changed', (ev) => { dirty = true; requestAnimationFrame(repaint); }); repaint(); }; setTimeout(startPainting, 10); </script> </template> <script> </script> </body> </html>