Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
gstaff
/
KiteWind
like
4
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
c2ce1fe
KiteWind
/
templates
/
stlite
/
stlite-snippet-template.html
gstaff
Cleanup and move template to utility file.
4b286f3
about 1 year ago
raw
Copy download link
history
blame
Safe
1.38 kB
<
div
id
=
"KiteWindApp"
>
<
iframe
id
=
"demo-iframe"
width
=
"100%"
height
=
"512px"
src
=
"about:blank"
>
</
iframe
>
<
script
>
const template = \`
<
div
id
=
"root"
>
</
div
>
<
link
rel
=
"stylesheet"
href
=
"https://cdn.jsdelivr.net/npm/@stlite/
[email protected]
/build/stlite.css"
/>
<
script
src
=
"https://cdn.jsdelivr.net/npm/@stlite/
[email protected]
/build/stlite.js"
>
<\\\/script>
<
script
>
const
streamlitConfig =
"[server]\\\\nrunOnSave = true"
;
const
code = \\\
`STARTING_CODE\\\`;
const appController = stlite.mount({
requirements: ["matplotlib"], // Packages to install
entrypoint: "streamlit_app.py", // The target file of the streamlit run command
files: {
".streamlit/config.toml": streamlitConfig,
"streamlit_app.py": code,
},
}, document.getElementById("root"));
// Returned controller functions defined here:
window.appController = appController;
<\\\/script>\`
const frame = document.getElementById('demo-iframe');
frame.contentWindow.document.open();
frame.contentWindow.document.write(template);
frame.contentWindow.document.close();
</
script
>
</
div
>