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

Function iter_children

dash/_layout_utils.py:51–63  ·  view source on GitHub ↗

Yield ``(prop_name, child_component)`` for all component-valued props. Walks ``children`` plus any props declared in the component's ``_children_props`` list. Supports nested path expressions like ``control_groups[].children`` and ``insights.title``.

(
    component: Component,
)

Source from the content-addressed store, hash-verified

49
50
51def iter_children(
52 component: Component,
53) -> Generator[tuple[str, Component], None, None]:
54 """Yield ``(prop_name, child_component)`` for all component-valued props.
55
56 Walks ``children`` plus any props declared in the component's
57 ``_children_props`` list. Supports nested path expressions like
58 ``control_groups[].children`` and ``insights.title``.
59 """
60 props_to_walk = ["children"] + getattr(component, "_children_props", [])
61 for prop_path in props_to_walk:
62 for child in get_children(component, prop_path):
63 yield prop_path, child
64
65
66def get_children(component: Any, prop_path: str) -> list[Component]:

Callers 1

_walkFunction · 0.85

Calls 1

get_childrenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…