Is a marimo.ui.anywidget with a __format__ spec possible?
#6868
Unanswered
RichardPotthoff
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here is my problem:
I would like to render a widget differently in different places in the notebook.
A (seemingly) straightforward way would be to add a "dataset.formatSpec" to the "el" element that is passed to the anywidget's "render(model,el)" function.
I have tried to wrap the widget into a
<span>element:I was not able to find this wrapper as a parent of the "el" element passed to anywidget's "render" function:
el.parentElement.parentElement.parentElement=null
el.parentElement.parentElement.outerHTML=
How would I find my wrapper
<span>element?Here is a marimo notebook with my "SIUnitInput" anywidget that could benefit form variable front-end rendering (Currently it used a "dropdown" select element to change the display format):
On GitHub:
https://github.com/RichardPotthoff/Notebooks/blob/SIUnitInput02/SIinput.py
In marimo:
https://marimo.app?src=https://github.com/RichardPotthoff/Notebooks/blob/SIUnitInput02/SIinput.py&mode=read&show-code=false
Beta Was this translation helpful? Give feedback.
All reactions