Skip to content

Commit f87ea2a

Browse files
authored
v0.10.0: Rename @render.data_frame method .input_cell_selection() to .cell_selection() (#148)
1 parent 1c72579 commit f87ea2a

File tree

15 files changed

+26
-19
lines changed

15 files changed

+26
-19
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7-
branches: [main]
87

98
jobs:
109
build:

_quarto.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ website:
6262
image-height: 630
6363
card-style: "summary_large_image"
6464

65+
repo-url: https://github.com/posit-dev/py-shiny-site
66+
repo-actions: [issue, edit]
67+
6568
navbar:
6669
background: primary
6770
foreground: light

components/_metadata.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ filters:
1010
- quarto
1111
- line-highlight
1212
- shinylive
13+
repo-actions: false

components/outputs/data-grid/app-variation-select-rows-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def penguins_df():
1717

1818
@render.ui
1919
def rows():
20-
rows = penguins_df.input_cell_selection()["rows"] # <<
20+
rows = penguins_df.cell_selection()["rows"] # <<
2121
selected = ", ".join(str(i) for i in sorted(rows)) if rows else "None"
2222
return f"Rows selected: {selected}"
2323

components/outputs/data-grid/app-variation-select-rows-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@render.ui()
1111
def rows():
12-
rows = penguins_df.input_cell_selection()["rows"] # <<
12+
rows = penguins_df.cell_selection()["rows"] # <<
1313
selected = ", ".join(str(i) for i in sorted(rows)) if rows else "None"
1414
return f"Rows selected: {selected}"
1515

components/outputs/data-grid/index.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ listing:
4747
- title: Select Rows
4848
description: Set `selection_mode` in `render.DataGrid()` to `"row"` to allow the
4949
user to select one row at a time. Set it to `"rows"` to allow the user to select
50-
multiple rows at a time. Access the selection(s) as `<id>.input_cell_selection()["rows"]`.
50+
multiple rows at a time. Access the selection(s) as `<id>.cell_selection()["rows"]`.
5151
apps:
5252
- title: Preview
5353
file: app-variation-select-rows-core.py
@@ -130,9 +130,9 @@ To make a reactive Data Grid, follow three steps:
130130

131131
A Data Grid can also collect input from the user. To allow this, set `render.DataGrid(selection_mode="row")` or `render.DataGrid(selection_mode="rows")` to allow the user to select one or more rows of the Data Grid.
132132

133-
The indices of the selected rows will be accessible within the server function as a reactive variable returned by `<name>.input_cell_selection()["rows"]`, where <name> is the name of the function decorated with `@render.data_frame`.
133+
The indices of the selected rows will be accessible within the server function as a reactive variable returned by `<name>.cell_selection()["rows"]`, where <name> is the name of the function decorated with `@render.data_frame`.
134134

135-
The value returned will be an empty tuple if no rows are selected, or a tuple of integers representing the indices of the selected rows. To filter a pandas data frame down to the selected rows, use `df.iloc[list(<name>.input_cell_selection()["rows"])]`.
135+
The value returned will be an empty tuple if no rows are selected, or a tuple of integers representing the indices of the selected rows. To filter a pandas data frame down to the selected rows, use `df.iloc[list(<name>.cell_selection()["rows"])]`.
136136

137137
For more information about interacting with data frames, see the API documentation for [Express](../../../api/express/express.render.data_frame.qmd) or [Core](../../../api/core/render.data_frame.qmd) syntax.
138138

components/outputs/datatable/app-variation-select-rows-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def penguins_df():
1717

1818
@render.ui
1919
def rows():
20-
rows = penguins_df.input_cell_selection()["rows"] # <<
20+
rows = penguins_df.cell_selection()["rows"] # <<
2121
selected = ", ".join(str(i) for i in sorted(rows)) if rows else "None"
2222
return f"Rows selected: {selected}"
2323

components/outputs/datatable/app-variation-select-rows-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@render.ui
1111
def rows():
12-
rows = penguins_df.input_cell_selection()["rows"] # <<
12+
rows = penguins_df.cell_selection()["rows"] # <<
1313
selected = ", ".join(str(i) for i in sorted(rows)) if rows else "None"
1414
return f"Rows selected: {selected}"
1515

components/outputs/datatable/index.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ listing:
4747
- title: Select Rows
4848
description: Set `selection_mode` in `render.DataTable()` to `"row"` to allow
4949
the user to select one row at a time. Set it to `"rows"` to allow the user to
50-
select multiple rows at a time. Access the selection(s) as `<id>.input_cell_selection()["rows"]`.
50+
select multiple rows at a time. Access the selection(s) as `<id>.cell_selection()["rows"]`.
5151
apps:
5252
- title: Preview
5353
file: app-variation-select-rows-core.py
@@ -130,9 +130,9 @@ To make a reactive Data Table, follow three steps:
130130

131131
A Data Table can also collect input from the user. To allow this, set `render.DataTable(selection_mode="row")` or `render.DataTable(selection_mode="rows")` to allow the user to select one or more rows of the Data Table.
132132

133-
The indices of the selected rows will be accessible within the server function as a reactive variable returned by `<name>.input_cell_selection()["rows"]`, where <name> is the name of the function decorated with `@render.data_frame`.
133+
The indices of the selected rows will be accessible within the server function as a reactive variable returned by `<name>.cell_selection()["rows"]`, where <name> is the name of the function decorated with `@render.data_frame`.
134134

135-
The value returned will be an empty tuple if no rows are selected, or a tuple of integers representing the indices of the selected rows. To filter a pandas data frame down to the selected rows, use `df.iloc[list(<name>.input_cell_selection()["rows"])]`.
135+
The value returned will be an empty tuple if no rows are selected, or a tuple of integers representing the indices of the selected rows. To filter a pandas data frame down to the selected rows, use `df.iloc[list(<name>.cell_selection()["rows"])]`.
136136

137137
For more information about interacting with data frames, see the API documentation for [Express](../../../api/express/express.render.data_frame.qmd) or [Core](../../../api/core/render.data_frame.qmd) syntax.
138138

docs/overview.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ shiny create -t dashboard
539539
## Development workflow
540540

541541
See the [workflow](install-create-run.qmd) section for more information developing Shiny apps locally.
542-
Also keep in mind you can develop apps in the browser using the [playground](/playground).
542+
Also keep in mind you can develop apps in the browser using the [playground](https://shinylive.io/py/examples/).
543543
:::
544544

545545

0 commit comments

Comments
 (0)