MCPcopy Index your code
hub / github.com/plotly/dash / traverse

Function traverse

dash/_layout_utils.py:16–28  ·  view source on GitHub ↗

Yield ``(component, ancestors)`` for every Component in the tree. If ``start`` is ``None``, the full app layout is resolved via ``dash.get_app()``, preferring ``validation_layout`` for completeness.

(
    start: Component | None = None,
)

Source from the content-addressed store, hash-verified

14
15
16def traverse(
17 start: Component | None = None,
18) -> Generator[tuple[Component, tuple[Component, ...]], None, None]:
19 """Yield ``(component, ancestors)`` for every Component in the tree.
20
21 If ``start`` is ``None``, the full app layout is resolved via
22 ``dash.get_app()``, preferring ``validation_layout`` for completeness.
23 """
24 if start is None:
25 app = get_app()
26 start = getattr(app, "validation_layout", None) or app.get_layout()
27
28 yield from _walk(start, ())
29
30
31def _walk(

Callers 6

component_label_mapMethod · 0.90
read_resourceMethod · 0.90
test_empty_layoutMethod · 0.90
find_componentFunction · 0.85
find_matching_componentsFunction · 0.85

Calls 3

get_appFunction · 0.90
_walkFunction · 0.85
get_layoutMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…