I created a file using stlite and streamlit-ketcher
Unfortunately, it is not working, and I don't have time right now to figure out why. Just going to leave it here for now
I created a file using stlite and streamlit-ketcher
Unfortunately, it is not working, and I don't have time right now to figure out why. Just going to leave it here for now
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta | |
name="viewport" | |
content="width=device-width, initial-scale=1, shrink-to-fit=no" | |
/> | |
<title>stlite app</title> | |
<link | |
rel="stylesheet" | |
href="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/stlite.css" | |
/> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script src="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/stlite.js"></script> | |
<script> | |
stlite.mount( | |
{ | |
requirements: ["streamlit-ketcher"], // Packages to install | |
entrypoint: "streamlit_app.py", // The target file of the `streamlit run` command | |
files: { | |
"streamlit_app.py": ` | |
import streamlit as st | |
from streamlit_ketcher import st_ketcher | |
molecule = st.text_input("Molecule", "CCO") | |
smile_code = st_ketcher(molecule) | |
st.markdown(f"Smile code: {smile_code}") | |
`, | |
}, | |
}, | |
document.getElementById("root") | |
); | |
</script> | |
</body> | |
</html> |