Tabs figure getter

Hi,

I have a function which returns a Tabs (with 2 panels)

...
panels=[]
panel1 = Panel(child=fig1, title='log')
panels.append(panel1)
panel2 = Panel(child=fig2, title='linear')
panels.append(panel2)
tabs = Tabs(tabs=panels)

Is there a way to retrieve fig1 & fig2 from the tabs element ? :face_with_monocle:
So far I have implemented a figure getter but I am wondering if it is really necessary…
Thanks
Olivier

Something like

tabs.select(Plot)

ought to work.

But fair warning the select, select_one APIs are barely used since ~10 years. There are tests for them but you know there might be bugs too.

All that said, in my personal experience it’s usually simplest to just give variable names to the things you want to keep track of, so that you don’t have to look them up at all.

1 Like