MCPcopy Create free account
hub / github.com/datapane/datapane / __init__

Method __init__

python-client/src/datapane/blocks/layout.py:164–195  ·  view source on GitHub ↗

Args: *arg_blocks: Group to add to report blocks: Allows providing the report blocks as a single list name: A unique id for the blocks to aid querying (optional) label: A label used when displaying the block (optional) widths: A li

(
        self,
        *arg_blocks: BlockOrPrimitive,
        blocks: t.List[BlockOrPrimitive] = None,
        name: BlockId = None,
        label: t.Optional[str] = None,
        widths: t.Optional[t.List[t.Union[int, float]]] = None,
        valign: VAlign = VAlign.TOP,
        columns: int = 1,
    )

Source from the content-addressed store, hash-verified

162 _tag = "Group"
163
164 def __init__(
165 self,
166 *arg_blocks: BlockOrPrimitive,
167 blocks: t.List[BlockOrPrimitive] = None,
168 name: BlockId = None,
169 label: t.Optional[str] = None,
170 widths: t.Optional[t.List[t.Union[int, float]]] = None,
171 valign: VAlign = VAlign.TOP,
172 columns: int = 1,
173 ):
174 """
175 Args:
176 *arg_blocks: Group to add to report
177 blocks: Allows providing the report blocks as a single list
178 name: A unique id for the blocks to aid querying (optional)
179 label: A label used when displaying the block (optional)
180 widths: A list of numbers representing the proportion of vertical space given to each column (optional)
181 valign: The vertical alignment of blocks in the Group (default = VAlign.TOP)
182 columns: Display the contained blocks, e.g. Plots, using _n_ columns (default = 1), setting to 0 auto-wraps the columns
183
184 !!! note
185 Group can be passed using either arg parameters or the `blocks` kwarg, e.g. `dp.Group(plot, table, columns=2)` or `dp.Group(blocks=[plot, table], columns=2)`.
186 """
187
188 if widths is not None and len(widths) != columns:
189 raise DPClientError("Group 'widths' list length does not match number of columns")
190
191 # columns = columns or len(self.blocks)
192 self.columns = columns
193 super().__init__(
194 *arg_blocks, blocks=blocks, name=name, label=label, columns=columns, widths=widths, valign=valign
195 )
196
197
198class Toggle(ContainerBlock):

Callers

nothing calls this directly

Calls 2

DPClientErrorClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected