-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
Lines 892 to 917 in c6c93b7
| def add_structure(self, structure, **kwargs): | |
| '''add structure to view | |
| Parameters | |
| ---------- | |
| structure : nglview.Structure object | |
| Examples | |
| -------- | |
| >>> view.add_trajectory(traj0) # doctest: +SKIP | |
| ... view.add_trajectory(traj1) | |
| ... # then add Structure | |
| ... view.add_structure(s) | |
| See Also | |
| -------- | |
| nglview.NGLWidget.add_component | |
| ''' | |
| if not isinstance(structure, Structure): | |
| raise ValueError(f'{structure} is not an instance of Structure') | |
| self._load_data(structure, **kwargs) | |
| self._ngl_component_ids.append(structure.id) | |
| if self.n_components > 1: | |
| self.center_view(component=len(self._ngl_component_ids) - 1) | |
| self._update_component_auto_completion() | |
| return self[-1] |
Metadata
Metadata
Assignees
Labels
No labels