@@ -33,10 +33,24 @@ def __init__(self) -> None:
3333 self ._config = ViewerConfig ()
3434
3535 def with_spatial3d (self ) -> Self :
36+ """Update the viewer configuration to include 3D view space.
37+
38+ Returns:
39+ Self: Updated `ViewerBuilder` instance itself.
40+ """
3641 self ._config .spatial3ds .append (rrb .Spatial3DView (name = "3D" , origin = EntityPath .MAP ))
3742 return self
3843
3944 def with_spatial2d (self , cameras : Sequence [str ], contents : list [str ] | None = None ) -> Self :
45+ """Update the viewer configuration to include 2D view spaces for each camera.
46+
47+ Args:
48+ cameras (Sequence[str]): Camera names.
49+ contents (list[str] | None): List of 3D view contents to project onto 2D view spaces.
50+
51+ Returns:
52+ Self: Updated `ViewerBuilder` instance itself.
53+ """
4054 # Preserve the original contents arguments so each camera gets its own view_contents.
4155 base_contents = contents
4256 for name in cameras :
@@ -53,14 +67,39 @@ def with_spatial2d(self, cameras: Sequence[str], contents: list[str] | None = No
5367 return self
5468
5569 def with_labels (self , label2id : dict [str , int ]) -> Self :
70+ """Update the viewer configuration to include label to id mapping.
71+
72+ Args:
73+ label2id (dict[str, int]): Key-value mapping to convert label name to its ID.
74+
75+ Returns:
76+ Self: Updated `ViewerBuilder` instance itself.
77+ """
5678 self ._config .label2id = label2id
5779 return self
5880
5981 def with_streetmap (self , latlon : Vector2Like | None = None ) -> Self :
82+ """Update the viewer configuration to include the streetmap view space.
83+
84+ Args:
85+ latlon (Vector2Like | None): Starting point in (latitude, longitude).
86+
87+ Returns:
88+ Self: Updated `ViewerBuilder` instance itself.
89+ """
6090 self ._config .spatial3ds .append (rrb .MapView (name = "Map" , origin = EntityPath .GEOCOORDINATE ))
6191 if latlon is not None :
6292 self ._config .latlon = latlon
6393 return self
6494
6595 def build (self , app_id : str , save_dir : str | None = None ) -> RerunViewer :
96+ """Build `RerunViewer` from the configuration.
97+
98+ Args:
99+ app_id (str): Viewer application ID.
100+ save_dir (str | None): Directory path to save the rendering record.
101+
102+ Returns:
103+ RerunViewer: Viewer instance.
104+ """
66105 return RerunViewer (app_id = app_id , config = self ._config , save_dir = save_dir )
0 commit comments