@@ -30,6 +30,48 @@ def to_payload(self) -> object:
3030
3131
3232class DataGrid (AbstractTabularData ):
33+ """
34+ Holds the data and options for a ``shiny.render.data_frame`` output, for a
35+ spreadsheet-like view.
36+
37+ Parameters
38+ ----------
39+ data
40+ A pandas `DataFrame` object, or any object that has a `.to_pandas()` method
41+ (e.g., a Polars data frame or Arrow table).
42+ width
43+ A _maximum_ amount of vertical space for the data grid to occupy, in CSS units
44+ (e.g. `"400px"`) or as a number, which will be interpreted as pixels. The
45+ default is `fit-content`, which sets the grid's width according to its contents.
46+ Set this to `100%` to use the maximum available horizontal space.
47+ height
48+ A _maximum_ amount of vertical space for the data grid to occupy, in CSS units
49+ (e.g. `"400px"`) or as a number, which will be interpreted as pixels. If there
50+ are more rows than can fit in this space, the grid will scroll. Set the height
51+ to `None` to allow the grid to grow to fit all of the rows (this is not
52+ recommended for large data sets, as it may crash the browser).
53+ summary
54+ If `True` (the default), shows a message like "Viewing rows 1 through 10 of 20"
55+ below the grid when not all of the rows are being shown. If `False`, the message
56+ is not displayed. You can also specify a string template to customize the
57+ message, containing `{start}`, `{end}`, and `{total}` tokens. For example:
58+ `"Viendo filas {start} a {end} de {total}"`.
59+ row_selection_mode
60+ Use `"none"` to disable row selection, `"single"` to allow a single row to be
61+ selected at a time, and `"multiple"` to allow multiple rows to be selected by
62+ clicking on them individually.
63+
64+ Returns
65+ -------
66+ :
67+ An object suitable for being returned from a `@render.data_frame`-decorated
68+ output function.
69+
70+ See Also
71+ --------
72+ ~shiny.ui.output_data_frame ~shiny.render.data_frame
73+ """
74+
3375 def __init__ (
3476 self ,
3577 data : object ,
@@ -39,47 +81,6 @@ def __init__(
3981 summary : Union [bool , str ] = True ,
4082 row_selection_mode : Literal ["none" , "single" , "multiple" ] = "none" ,
4183 ):
42- """
43- Holds the data and options for a ``shiny.render.data_frame`` output, for a
44- spreadsheet-like view.
45-
46- Parameters
47- ----------
48- data
49- A pandas `DataFrame` object, or any object that has a `.to_pandas()` method
50- (e.g., a Polars data frame or Arrow table).
51- width
52- A _maximum_ amount of vertical space for the data grid to occupy, in CSS
53- units (e.g. `"400px"`) or as a number, which will be interpreted as pixels.
54- The default is `fit-content`, which sets the grid's width according to its
55- contents. Set this to `100%` to use the maximum available horizontal space.
56- height
57- A _maximum_ amount of vertical space for the data grid to occupy, in CSS
58- units (e.g. `"400px"`) or as a number, which will be interpreted as pixels.
59- If there are more rows than can fit in this space, the grid will scroll. Set
60- the height to `None` to allow the grid to grow to fit all of the rows (this
61- is not recommended for large data sets, as it may crash the browser).
62- summary
63- If `True` (the default), shows a message like "Viewing rows 1 through 10 of
64- 20" below the grid when not all of the rows are being shown. If `False`, the
65- message is not displayed. You can also specify a string template to
66- customize the message, containing `{start}`, `{end}`, and `{total}` tokens.
67- For example: `"Viendo filas {start} a {end} de {total}"`.
68- row_selection_mode
69- Use `"none"` to disable row selection, `"single"` to allow a single row to
70- be selected at a time, and `"multiple"` to allow multiple rows to be
71- selected by clicking on them individually.
72-
73- Returns
74- -------
75- :
76- An object suitable for being returned from a `@render.data_frame`-decorated
77- output function.
78-
79- See Also
80- --------
81- ~shiny.ui.output_data_frame ~shiny.render.data_frame
82- """
8384 import pandas as pd
8485
8586 self .data : pd .DataFrame = cast (
@@ -113,6 +114,48 @@ def to_payload(self) -> object:
113114
114115
115116class DataTable (AbstractTabularData ):
117+ """
118+ Holds the data and options for a ``shiny.render.data_frame`` output, for a
119+ spreadsheet-like view.
120+
121+ Parameters
122+ ----------
123+ data
124+ A pandas `DataFrame` object, or any object that has a `.to_pandas()` method
125+ (e.g., a Polars data frame or Arrow table).
126+ width
127+ A _maximum_ amount of vertical space for the data table to occupy, in CSS units
128+ (e.g. `"400px"`) or as a number, which will be interpreted as pixels. The
129+ default is `fit-content`, which sets the table's width according to its
130+ contents. Set this to `100%` to use the maximum available horizontal space.
131+ height
132+ A _maximum_ amount of vertical space for the data table to occupy, in CSS units
133+ (e.g. `"400px"`) or as a number, which will be interpreted as pixels. If there
134+ are more rows than can fit in this space, the table body will scroll. Set the
135+ height to `None` to allow the table to grow to fit all of the rows (this is not
136+ recommended for large data sets, as it may crash the browser).
137+ summary
138+ If `True` (the default), shows a message like "Viewing rows 1 through 10 of 20"
139+ below the grid when not all of the rows are being shown. If `False`, the message
140+ is not displayed. You can also specify a string template to customize the
141+ message, containing `{start}`, `{end}`, and `{total}` tokens. For example:
142+ `"Viendo filas {start} a {end} de {total}"`.
143+ row_selection_mode
144+ Use `"none"` to disable row selection, `"single"` to allow a single row to be
145+ selected at a time, and `"multiple"` to allow multiple rows to be selected by
146+ clicking on them individually.
147+
148+ Returns
149+ -------
150+ :
151+ An object suitable for being returned from a `@render.data_frame`-decorated
152+ output function.
153+
154+ See Also
155+ --------
156+ ~shiny.ui.output_data_frame ~shiny.render.data_frame
157+ """
158+
116159 def __init__ (
117160 self ,
118161 data : object ,
@@ -124,48 +167,6 @@ def __init__(
124167 Literal ["none" ], Literal ["single" ], Literal ["multiple" ]
125168 ] = "none" ,
126169 ):
127- """
128- Holds the data and options for a ``shiny.render.data_frame`` output, for a
129- spreadsheet-like view.
130-
131- Parameters
132- ----------
133- data
134- A pandas `DataFrame` object, or any object that has a `.to_pandas()` method
135- (e.g., a Polars data frame or Arrow table).
136- width
137- A _maximum_ amount of vertical space for the data table to occupy, in CSS
138- units (e.g. `"400px"`) or as a number, which will be interpreted as pixels.
139- The default is `fit-content`, which sets the table's width according to its
140- contents. Set this to `100%` to use the maximum available horizontal space.
141- height
142- A _maximum_ amount of vertical space for the data table to occupy, in CSS
143- units (e.g. `"400px"`) or as a number, which will be interpreted as pixels.
144- If there are more rows than can fit in this space, the table body will
145- scroll. Set the height to `None` to allow the table to grow to fit all of
146- the rows (this is not recommended for large data sets, as it may crash the
147- browser).
148- summary
149- If `True` (the default), shows a message like "Viewing rows 1 through 10 of
150- 20" below the grid when not all of the rows are being shown. If `False`, the
151- message is not displayed. You can also specify a string template to
152- customize the message, containing `{start}`, `{end}`, and `{total}` tokens.
153- For example: `"Viendo filas {start} a {end} de {total}"`.
154- row_selection_mode
155- Use `"none"` to disable row selection, `"single"` to allow a single row to
156- be selected at a time, and `"multiple"` to allow multiple rows to be
157- selected by clicking on them individually.
158-
159- Returns
160- -------
161- :
162- An object suitable for being returned from a `@render.data_frame`-decorated
163- output function.
164-
165- See Also
166- --------
167- ~shiny.ui.output_data_frame ~shiny.render.data_frame
168- """
169170 import pandas as pd
170171
171172 self .data : pd .DataFrame = cast (
0 commit comments