I have standard dashboard with app.layout variable. How can I search for a given div and some content somewhere inside my application? I need it to make some checks, (for infinite loop exception, anyways, whatever).
app.layout
What should I use? Can I use Xpath and how?
Dash Components implement the MutableMapping interface, which means they define the following methods:
# - __getitem__ # - __setitem__ # - __delitem__ # - __iter__ # - __len__
__getitem__(), in particular, means that you can do:
__getitem__()
if "some-id" in app.layout: print("hooray")
and
some_component = app.layout["some-id"]
There’s also Component.traverse() and Component.traverse_with_paths() that you might find useful.
Component.traverse()
Component.traverse_with_paths()
See https://github.com/plotly/dash/blob/master/dash/development/base_component.py