ipywidgets-static
ipywidgets-static copied to clipboard
Hiding div elements if function outputs HTML
If my widget function outputs HTML with div
elements, control change would hide them. Try moving the slider in following example.
def foo(a):
html = "<div id='linechart{}'><h1>{}</h1></div>".format(a,a)
return html
StaticInteract(foo, a=RangeWidget(1, 5))
Problem is on this line. One way to fix that would be to only include direct children of widget div
element via additional condition
else if((name != "controls") && (outputs[i].parentNode == div)){{