Skip to content

Commit

Permalink
A few comments added
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-qb committed Nov 29, 2024
1 parent 86171e0 commit 9732692
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vizro-core/src/vizro/_vizro.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def _pre_build():
for _, filter_obj in list(model_manager._items_with_type(Filter)):
# Run pre_build on all filters first, then on all other models. This handles dependency between Filter
# and Page pre_build and ensures that filters are pre-built before the Page objects that use them.
# This is important because the Page pre_build method checks whether filters are dynamic or not, which is
# defined in the filter's pre_build method.
filter_obj.pre_build()
for model_id in set(model_manager):
model = model_manager[model_id]
Expand Down
2 changes: 2 additions & 0 deletions vizro-core/src/vizro/models/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def __vizro_exclude_fields__(self) -> Optional[Union[set[str], Mapping[str, Any]
@_log_call
def pre_build(self):
targets = model_manager._get_page_model_ids_with_figure(page_id=ModelID(str(self.id)))

# TODO NEXT: make work generically for control group
targets.extend(control.id for control in self.controls if getattr(control, "_dynamic", False))

if targets:
Expand Down

0 comments on commit 9732692

Please sign in to comment.