Abaixo está meu código com um círculo dentro de um elemento svg que eu quero renderizar através do jinja2 usando st.html no streamlit. O problema é que o contêiner está visível, mas o elemento svg não está. Ele está em branco. Veja o código abaixo.
<style>
html,body {
height: 100%;
background-color: #404040;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
.container {
display: flex;
width: 500px;
/* Extended width for pipe */
height: 500px;
border: 3px solid #EEEEEE;
justify-content: center;
align-items: center;
border-radius: 20px;
}
.drawing {
position: relative;
width: 2000px;
/* Extended width for pipe */
height: 600px;
}
.circle-svg {
width: 100%;
height: 100%;
}
.c3 {
fill: none;
stroke: grey;
stroke-width: 10;
}
</style>
<body>
<div class="container">
<div class="drawing">
<svg viewBox="0 0 500 500" class="circle-svg">
<!-- Circle -->
<circle class="c3" cx="250" cy="250" r="198"></circle>
</svg>
</div>
</div>
</body>
código python:
def cutting_dimention(html_content):
# Directly use the HTML content without treating it as a file path
template = Template(html_content)
rendered_html = template.render() # Render the HTML with Jinja2
st.text(rendered_html) # Display rendered HTML text
st.html(rendered_html) # Display rendered HTML as an HTML block in Streamlit
Chame a função com o conteúdo HTML
dimensão_de_corte(meu_círculo)