Open CnBDM-Su opened 6 months ago
does this do the trick ?
import ipyvuetify as v
v.Html(tag="div", children=["test"])
And then you can update the children member as much as you want.
``> does this do the trick ?
import ipyvuetify as v v.Html(tag="div", children=["test"])
And then you can update the children member as much as you want.
Yes, if the children is easy like that, this works. But in my situation, I want to capture the plot rendered html from IPython. If I use ipywidgets, it is easy
import ipywidgets as widgets
from IPython.display import HTML
out = widgets.Output()
with out:
fig_obj.show()
out
But seems there is no element which can capture ipython result automatically in ipyvuetify. Under your suggestion, I need to get the html script and rerender it as a v.html then it can be displayed. Seems it is not very convinent. Some thing like this.
import ipyvuetify as v
out = v.Html(tag="div", children=[])
fig_html = v.Html(tag='div', children=[fig_obj.return_html_script()])
out.children=[fig_html]
out
If I cannot restructure the html, is there any way I can render the plot?
if the plot is not a DOM element you cannot display it using ipyvuetify. usualy i do interactive plots (bqplot, bokeh, plotly) that are DOM elements and can thus directly be added to the children list. Not sure it's possible with vanilla matplotlib.
You can mix classic ipywidgets, do you can make the output widget a child of an ipyvuetify widget.
@12rambau Can you provide one simple case of ployly? Then I can follow. Thanks
@maartenbreddels Yeah, for now, I am doing like this.
There is no other solution, this is how it should work. Ipyvuetify does not need to re implement features of other libraries, or its parent library. I hope this make sense?
Is there any ipyvuetify component can be used to replace the ipwidgets.Output?
Ipywidgets.Output can capture all ipython output run under this component. eg: