Spaces:
Running
Running
MarcSkovMadsen
commited on
Commit
•
3b30030
1
Parent(s):
7709a41
Update index.html
Browse files- index.html +131 -18
index.html
CHANGED
@@ -1,19 +1,132 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<title>Panel Application</title>
|
6 |
+
<style>
|
7 |
+
html, body {
|
8 |
+
box-sizing: border-box;
|
9 |
+
display: flow-root;
|
10 |
+
height: 100%;
|
11 |
+
margin: 0;
|
12 |
+
padding: 0;
|
13 |
+
}
|
14 |
+
</style>
|
15 |
+
|
16 |
+
<style type="text/css">
|
17 |
+
:host(.pn-loading),
|
18 |
+
.pn-loading {
|
19 |
+
overflow: hidden;
|
20 |
+
}
|
21 |
+
|
22 |
+
:host(.pn-loading):before,
|
23 |
+
.pn-loading:before {
|
24 |
+
position: absolute;
|
25 |
+
height: 100%;
|
26 |
+
width: 100%;
|
27 |
+
content: '';
|
28 |
+
z-index: 1000;
|
29 |
+
background-color: rgb(255, 255, 255, 0.5);
|
30 |
+
border-color: lightgray;
|
31 |
+
background-repeat: no-repeat;
|
32 |
+
background-position: center;
|
33 |
+
background-size: auto 50%;
|
34 |
+
border-width: 1px;
|
35 |
+
cursor: progress;
|
36 |
+
}
|
37 |
+
|
38 |
+
:host(.pn-loading) .pn-loading-msg,
|
39 |
+
.pn-loading .pn-loading-msg {
|
40 |
+
position: absolute;
|
41 |
+
top: 72%;
|
42 |
+
font-size: 2em;
|
43 |
+
color: black;
|
44 |
+
width: 100%;
|
45 |
+
text-align: center;
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
:host(.pn-loading.pn-arc):before, .pn-loading.pn-arc:before {
|
50 |
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJtYXJnaW46IGF1dG87IGJhY2tncm91bmQ6IG5vbmU7IGRpc3BsYXk6IGJsb2NrOyBzaGFwZS1yZW5kZXJpbmc6IGF1dG87IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYzNjM2MzIiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij4gICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjFzIiB2YWx1ZXM9IjAgNTAgNTA7MzYwIDUwIDUwIiBrZXlUaW1lcz0iMDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+ICA8L2NpcmNsZT48L3N2Zz4=");
|
51 |
+
background-size: auto calc(min(50%, 400px));
|
52 |
+
}
|
53 |
+
</style><script src="https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.js"></script>
|
54 |
+
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-3.3.0.min.js"></script>
|
55 |
+
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.3.0.min.js"></script>
|
56 |
+
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.3.0.min.js"></script>
|
57 |
+
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.3.0.min.js"></script>
|
58 |
+
<script type="text/javascript" src="https://cdn.holoviz.org/panel/1.3.0/dist/panel.min.js"></script>
|
59 |
+
|
60 |
+
<script type="text/javascript">
|
61 |
+
Bokeh.set_log_level("info");
|
62 |
+
</script> </head>
|
63 |
+
<body class="pn-loading pn-arc">
|
64 |
+
<div id="e50f5949-8265-415f-89c9-f3f0156fe820" data-root-id="p1006" style="display: contents;"></div>
|
65 |
+
<div id="fb757014-18c9-4154-8440-38c7aae15601" data-root-id="p1007" style="display: contents;"></div>
|
66 |
+
<div id="c936cc0b-1108-4440-b77e-277c8bd4a577" data-root-id="p1008" style="display: contents;"></div>
|
67 |
+
|
68 |
+
<script type="text/javascript">
|
69 |
+
async function main() {
|
70 |
+
let pyodide = await loadPyodide();
|
71 |
+
await pyodide.loadPackage("micropip");
|
72 |
+
await pyodide.runPythonAsync(`
|
73 |
+
import micropip
|
74 |
+
await micropip.install(['https://cdn.holoviz.org/panel/wheels/bokeh-3.3.0-py3-none-any.whl', 'https://cdn.holoviz.org/panel/1.3.0/dist/wheels/panel-1.3.0-py3-none-any.whl', 'pyodide-http==0.2.1']);
|
75 |
+
`);
|
76 |
+
code = `
|
77 |
+
import asyncio
|
78 |
+
|
79 |
+
from panel.io.pyodide import init_doc, write_doc
|
80 |
+
|
81 |
+
init_doc()
|
82 |
+
|
83 |
+
import panel as pn
|
84 |
+
|
85 |
+
pn.extension()
|
86 |
+
|
87 |
+
pn.panel("hello world").servable()
|
88 |
+
|
89 |
+
await write_doc()`
|
90 |
+
await pyodide.runPythonAsync(code);
|
91 |
+
}
|
92 |
+
main();
|
93 |
+
</script>
|
94 |
+
<script type="application/json" id="p1009">
|
95 |
+
{"d486ee8e-5bf5-468a-ac7c-94691399cc35":{"version":"3.3.0","title":"Panel Application","roots":[{"type":"object","name":"panel.models.markup.HTML","id":"p1006","attributes":{"css_classes":["markdown"],"stylesheets":["\n:host(.pn-loading.pn-arc):before, .pn-loading.pn-arc:before {\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJtYXJnaW46IGF1dG87IGJhY2tncm91bmQ6IG5vbmU7IGRpc3BsYXk6IGJsb2NrOyBzaGFwZS1yZW5kZXJpbmc6IGF1dG87IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYzNjM2MzIiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij4gICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjFzIiB2YWx1ZXM9IjAgNTAgNTA7MzYwIDUwIDUwIiBrZXlUaW1lcz0iMDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+ICA8L2NpcmNsZT48L3N2Zz4=\");\n background-size: auto calc(min(50%, 400px));\n}",{"type":"object","name":"ImportedStyleSheet","id":"p1004","attributes":{"url":"https://cdn.holoviz.org/panel/1.3.0/dist/css/loading.css"}},{"type":"object","name":"ImportedStyleSheet","id":"p1005","attributes":{"url":"https://cdn.holoviz.org/panel/1.3.0/dist/css/markdown.css"}},{"type":"object","name":"ImportedStyleSheet","id":"p1002","attributes":{"url":"https://cdn.holoviz.org/panel/1.3.0/dist/bundled/theme/default.css"}},{"type":"object","name":"ImportedStyleSheet","id":"p1003","attributes":{"url":"https://cdn.holoviz.org/panel/1.3.0/dist/bundled/theme/native.css"}}],"margin":[5,10],"align":"start","text":"&lt;p&gt;hello world&lt;/p&gt;\n"}},{"type":"object","name":"panel.models.location.Location","id":"p1007","attributes":{"name":"location","reload":false}},{"type":"object","name":"panel.models.browser.BrowserInfo","id":"p1008","attributes":{"name":"browser_info"}}],"defs":[{"type":"model","name":"ReactiveHTML1"},{"type":"model","name":"FlexBox1","properties":[{"name":"align_content","kind":"Any","default":"flex-start"},{"name":"align_items","kind":"Any","default":"flex-start"},{"name":"flex_direction","kind":"Any","default":"row"},{"name":"flex_wrap","kind":"Any","default":"wrap"},{"name":"justify_content","kind":"Any","default":"flex-start"}]},{"type":"model","name":"FloatPanel1","properties":[{"name":"config","kind":"Any","default":{"type":"map"}},{"name":"contained","kind":"Any","default":true},{"name":"position","kind":"Any","default":"right-top"},{"name":"offsetx","kind":"Any","default":null},{"name":"offsety","kind":"Any","default":null},{"name":"theme","kind":"Any","default":"primary"},{"name":"status","kind":"Any","default":"normalized"}]},{"type":"model","name":"GridStack1","properties":[{"name":"mode","kind":"Any","default":"warn"},{"name":"ncols","kind":"Any","default":null},{"name":"nrows","kind":"Any","default":null},{"name":"allow_resize","kind":"Any","default":true},{"name":"allow_drag","kind":"Any","default":true},{"name":"state","kind":"Any","default":[]}]},{"type":"model","name":"drag1","properties":[{"name":"slider_width","kind":"Any","default":5},{"name":"slider_color","kind":"Any","default":"black"},{"name":"value","kind":"Any","default":50}]},{"type":"model","name":"click1","properties":[{"name":"terminal_output","kind":"Any","default":""},{"name":"debug_name","kind":"Any","default":""},{"name":"clears","kind":"Any","default":0}]},{"type":"model","name":"toggle_value1","properties":[{"name":"active_icons","kind":"Any","default":{"type":"map"}},{"name":"options","kind":"Any","default":{"type":"map","entries":[["favorite","heart"]]}},{"name":"value","kind":"Any","default":[]},{"name":"_reactions","kind":"Any","default":[]},{"name":"_base_url","kind":"Any","default":"https://tabler-icons.io/static/tabler-icons/icons/"}]},{"type":"model","name":"copy_to_clipboard1","properties":[{"name":"value","kind":"Any","default":null},{"name":"fill","kind":"Any","default":"none"}]},{"type":"model","name":"FastWrapper1","properties":[{"name":"object","kind":"Any","default":null},{"name":"style","kind":"Any","default":null}]},{"type":"model","name":"NotificationAreaBase1","properties":[{"name":"js_events","kind":"Any","default":{"type":"map"}},{"name":"position","kind":"Any","default":"bottom-right"},{"name":"_clear","kind":"Any","default":0}]},{"type":"model","name":"NotificationArea1","properties":[{"name":"js_events","kind":"Any","default":{"type":"map"}},{"name":"notifications","kind":"Any","default":[]},{"name":"position","kind":"Any","default":"bottom-right"},{"name":"_clear","kind":"Any","default":0},{"name":"types","kind":"Any","default":[{"type":"map","entries":[["type","warning"],["background","#ffc107"],["icon",{"type":"map","entries":[["className","fas fa-exclamation-triangle"],["tagName","i"],["color","white"]]}]]},{"type":"map","entries":[["type","info"],["background","#007bff"],["icon",{"type":"map","entries":[["className","fas fa-info-circle"],["tagName","i"],["color","white"]]}]]}]}]},{"type":"model","name":"Notification","properties":[{"name":"background","kind":"Any","default":null},{"name":"duration","kind":"Any","default":3000},{"name":"icon","kind":"Any","default":null},{"name":"message","kind":"Any","default":""},{"name":"notification_type","kind":"Any","default":null},{"name":"_destroyed","kind":"Any","default":false}]},{"type":"model","name":"TemplateActions1","properties":[{"name":"open_modal","kind":"Any","default":0},{"name":"close_modal","kind":"Any","default":0}]},{"type":"model","name":"BootstrapTemplateActions1","properties":[{"name":"open_modal","kind":"Any","default":0},{"name":"close_modal","kind":"Any","default":0}]},{"type":"model","name":"MaterialTemplateActions1","properties":[{"name":"open_modal","kind":"Any","default":0},{"name":"close_modal","kind":"Any","default":0}]}]}}
|
96 |
+
</script>
|
97 |
+
<script type="text/javascript">
|
98 |
+
(function() {
|
99 |
+
const fn = function() {
|
100 |
+
Bokeh.safely(function() {
|
101 |
+
(function(root) {
|
102 |
+
function embed_document(root) {
|
103 |
+
const docs_json = document.getElementById('p1009').textContent;
|
104 |
+
const render_items = [{"docid":"d486ee8e-5bf5-468a-ac7c-94691399cc35","roots":{"p1006":"e50f5949-8265-415f-89c9-f3f0156fe820","p1007":"fb757014-18c9-4154-8440-38c7aae15601","p1008":"c936cc0b-1108-4440-b77e-277c8bd4a577"},"root_ids":["p1006","p1007","p1008"]}];
|
105 |
+
root.Bokeh.embed.embed_items(docs_json, render_items);
|
106 |
+
}
|
107 |
+
if (root.Bokeh !== undefined) {
|
108 |
+
embed_document(root);
|
109 |
+
} else {
|
110 |
+
let attempts = 0;
|
111 |
+
const timer = setInterval(function(root) {
|
112 |
+
if (root.Bokeh !== undefined) {
|
113 |
+
clearInterval(timer);
|
114 |
+
embed_document(root);
|
115 |
+
} else {
|
116 |
+
attempts++;
|
117 |
+
if (attempts > 100) {
|
118 |
+
clearInterval(timer);
|
119 |
+
console.log("Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing");
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}, 10, root)
|
123 |
+
}
|
124 |
+
})(window);
|
125 |
+
});
|
126 |
+
};
|
127 |
+
if (document.readyState != "loading") fn();
|
128 |
+
else document.addEventListener("DOMContentLoaded", fn);
|
129 |
+
})();
|
130 |
+
</script>
|
131 |
+
</body>
|
132 |
+
</html>
|