Open r-matsuzaka opened 2 years ago
Hi, thanks for drawing my attention to streamlit which looks absolutely fantastic! at the minute this is not supported but I would love to explore the possibilities.
Thank you for your response! I am glad to hear that.
At the same time, I am now asking about it to streamlit community. https://github.com/streamlit/streamlit/issues/4366
I am not sure this feature belongs to vedo
or streamlit
.
as i understand it should probably belong to vedo
..
I hope i can play a bit with it over the weekend
streamlit is very user friendly design. If you are familiar with matplot lib, then you just need to prepare place holder and pass fig object to it. Tutorial is useful.
My very first try at it:
import vedo
from itkwidgets import view
from ipywidgets import embed
import streamlit.components.v1 as components
data = vedo.Volume(vedo.dataurl+'embryo.tif').imagedata()
#data = vedo.Sphere().scale(100).polydata()
#print(type(data))
#vedo.show(data, interactive=True)
view_width = 800
view_height = 800
snippet = embed.embed_snippet(views=view(data))
html = embed.html_template.format(title="", snippet=snippet)
components.html(html, width=view_width, height=view_height)
Run by:
streamlit run myscript.py
for some reason I cannot visualise the polygonal mesh (commented out) but that's maybe due to some problems with the itkwidgets
...
I guess that since it needs a raw html string it can work with k3d
too but I'm not sure how to do it.. @artur-trzesiok
Wow. Nice!
I have never thought that we can use components
method to incorporate figure.
I will try it the same way.
Hi. I want to use this feature by streamlit. Is this usage supported?