|
11 | 11 | from ..recording_stream import RecordingStream
|
12 | 12 | from .archetypes import ContainerBlueprint, PanelBlueprint, SpaceViewBlueprint, SpaceViewContents, ViewportBlueprint
|
13 | 13 | from .components import ColumnShareArrayLike, RowShareArrayLike
|
14 |
| -from .components.container_kind import ContainerKind, ContainerKindLike |
| 14 | +from .components.container_kind import ContainerKindLike |
15 | 15 |
|
16 | 16 | SpaceViewContentsLike = Union[str, Sequence[str], Utf8Like, SpaceViewContents]
|
17 | 17 |
|
@@ -70,6 +70,8 @@ def blueprint_path(self) -> str:
|
70 | 70 |
|
71 | 71 | def to_viewport(self) -> Viewport:
|
72 | 72 | """Convert this space view to a viewport."""
|
| 73 | + from .containers import Grid |
| 74 | + |
73 | 75 | return Viewport(Grid(self))
|
74 | 76 |
|
75 | 77 | def to_blueprint(self) -> Blueprint:
|
@@ -112,56 +114,6 @@ def _iter_space_views(self) -> Iterable[bytes]:
|
112 | 114 | return [self.id.bytes]
|
113 | 115 |
|
114 | 116 |
|
115 |
| -class Spatial3D(SpaceView): |
116 |
| - """A Spatial 3D space view.""" |
117 |
| - |
118 |
| - def __init__( |
119 |
| - self, *, origin: EntityPathLike = "/", contents: SpaceViewContentsLike = "/**", name: Utf8Like | None = None |
120 |
| - ): |
121 |
| - """ |
122 |
| - Construct a blueprint for a new 3D space view. |
123 |
| -
|
124 |
| - Parameters |
125 |
| - ---------- |
126 |
| - origin |
127 |
| - The `EntityPath` to use as the origin of this space view. All other entities will be transformed |
128 |
| - to be displayed relative to this origin. |
129 |
| - contents |
130 |
| - The contents of the space view. Most commonly specified as a query expression. The individual |
131 |
| - sub-expressions must either be newline separate, or provided as a list of strings. |
132 |
| - See: [rerun.blueprint.components.QueryExpression][]. |
133 |
| - name |
134 |
| - The name of the space view. |
135 |
| -
|
136 |
| - """ |
137 |
| - super().__init__(class_identifier="3D", origin=origin, contents=contents, name=name) |
138 |
| - |
139 |
| - |
140 |
| -class Spatial2D(SpaceView): |
141 |
| - """A Spatial 2D space view.""" |
142 |
| - |
143 |
| - def __init__( |
144 |
| - self, *, origin: EntityPathLike = "/", contents: SpaceViewContentsLike = "/**", name: Utf8Like | None = None |
145 |
| - ): |
146 |
| - """ |
147 |
| - Construct a blueprint for a new 2D space view. |
148 |
| -
|
149 |
| - Parameters |
150 |
| - ---------- |
151 |
| - origin |
152 |
| - The `EntityPath` to use as the origin of this space view. All other entities will be transformed |
153 |
| - to be displayed relative to this origin. |
154 |
| - contents |
155 |
| - The contents of the space view. Most commonly specified as a query expression. The individual |
156 |
| - sub-expressions must either be newline separate, or provided as a list of strings. |
157 |
| - See: [rerun.blueprint.components.QueryExpression][]. |
158 |
| - name |
159 |
| - The name of the space view. |
160 |
| -
|
161 |
| - """ |
162 |
| - super().__init__(class_identifier="2D", origin=origin, contents=contents, name=name) |
163 |
| - |
164 |
| - |
165 | 117 | class Container:
|
166 | 118 | """
|
167 | 119 | Base class for all container types.
|
@@ -252,96 +204,6 @@ def _iter_space_views(self) -> Iterable[bytes]:
|
252 | 204 | return itertools.chain.from_iterable(sub._iter_space_views() for sub in self.contents)
|
253 | 205 |
|
254 | 206 |
|
255 |
| -class Horizontal(Container): |
256 |
| - """A horizontal container.""" |
257 |
| - |
258 |
| - def __init__(self, *contents: Container | SpaceView, column_shares: Optional[ColumnShareArrayLike] = None): |
259 |
| - """ |
260 |
| - Construct a new horizontal container. |
261 |
| -
|
262 |
| - Parameters |
263 |
| - ---------- |
264 |
| - *contents: |
265 |
| - All positional arguments are the contents of the container, which may be either other containers or space views. |
266 |
| - column_shares |
267 |
| - The layout shares of the columns in the container. The share is used to determine what fraction of the total width each |
268 |
| - column should take up. The column with index `i` will take up the fraction `shares[i] / total_shares`. |
269 |
| -
|
270 |
| - """ |
271 |
| - super().__init__(*contents, kind=ContainerKind.Horizontal, column_shares=column_shares) |
272 |
| - |
273 |
| - |
274 |
| -class Vertical(Container): |
275 |
| - """A vertical container.""" |
276 |
| - |
277 |
| - def __init__(self, *contents: Container | SpaceView, row_shares: Optional[RowShareArrayLike] = None): |
278 |
| - """ |
279 |
| - Construct a new vertical container. |
280 |
| -
|
281 |
| - Parameters |
282 |
| - ---------- |
283 |
| - *contents: |
284 |
| - All positional arguments are the contents of the container, which may be either other containers or space views. |
285 |
| - row_shares |
286 |
| - The layout shares of the rows in the container. The share is used to determine what fraction of the total height each |
287 |
| - row should take up. The ros with index `i` will take up the fraction `shares[i] / total_shares`. |
288 |
| -
|
289 |
| - """ |
290 |
| - super().__init__(*contents, kind=ContainerKind.Vertical, row_shares=row_shares) |
291 |
| - |
292 |
| - |
293 |
| -class Grid(Container): |
294 |
| - """A grid container.""" |
295 |
| - |
296 |
| - def __init__( |
297 |
| - self, |
298 |
| - *contents: Container | SpaceView, |
299 |
| - column_shares: Optional[ColumnShareArrayLike] = None, |
300 |
| - row_shares: Optional[RowShareArrayLike] = None, |
301 |
| - grid_columns: Optional[int] = None, |
302 |
| - ): |
303 |
| - """ |
304 |
| - Construct a new grid container. |
305 |
| -
|
306 |
| - Parameters |
307 |
| - ---------- |
308 |
| - *contents: |
309 |
| - All positional arguments are the contents of the container, which may be either other containers or space views. |
310 |
| - column_shares |
311 |
| - The layout shares of the columns in the container. The share is used to determine what fraction of the total width each |
312 |
| - column should take up. The column with index `i` will take up the fraction `shares[i] / total_shares`. |
313 |
| - row_shares |
314 |
| - The layout shares of the rows in the container. The share is used to determine what fraction of the total height each |
315 |
| - row should take up. The ros with index `i` will take up the fraction `shares[i] / total_shares`. |
316 |
| - grid_columns |
317 |
| - The number of columns in the grid. |
318 |
| -
|
319 |
| - """ |
320 |
| - super().__init__( |
321 |
| - *contents, |
322 |
| - kind=ContainerKind.Grid, |
323 |
| - column_shares=column_shares, |
324 |
| - row_shares=row_shares, |
325 |
| - grid_columns=grid_columns, |
326 |
| - ) |
327 |
| - |
328 |
| - |
329 |
| -class Tabs(Container): |
330 |
| - """A tab container.""" |
331 |
| - |
332 |
| - def __init__(self, *contents: Container | SpaceView): |
333 |
| - """ |
334 |
| - Construct a new tab container. |
335 |
| -
|
336 |
| - Parameters |
337 |
| - ---------- |
338 |
| - *contents: |
339 |
| - All positional arguments are the contents of the container, which may be either other containers or space views. |
340 |
| -
|
341 |
| - """ |
342 |
| - super().__init__(*contents, kind=ContainerKind.Tabs) |
343 |
| - |
344 |
| - |
345 | 207 | class Viewport:
|
346 | 208 | """
|
347 | 209 | The top-level description of the Viewport.
|
|
0 commit comments