Skip to content

Commit

Permalink
updated readme and vignette with filter module
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Feb 12, 2021
1 parent f2ae82a commit fa788f6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ Define some validation rules with package [validate](https://github.com/data-cle
![](man/figures/datamods-validation.png)


### Filter

Interactively filter a `data.frame`, this module also generates the code to reproduce the filters.

![](man/figures/datamods-filter.png)


## Final Notes :

- Please find example apps of each of the modules in the `/examples` folder.
Expand Down
Binary file added man/figures/datamods-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions vignettes/datamods.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,35 @@ The return value server-side is a list with the following items:
* **details**: a reactive function returning a list with validation details.


### Filter

Interactively filter a `data.frame` and generate code to reproduce filters applied:

```{r}
# UI
filter_data_ui("filtering", max_height = "500px")
# Server
res_filter <- filter_data_server(
id = "filtering",
data = reactive(mtcars),
name = reactive("mtcars"),
vars = reactive(names(mtcars)),
widget_num = "slider",
widget_date = "slider",
label_na = "Missing"
)
```

You can select variables for which to create a filter and choose widgets used to create the UI filter.

<img src="figures/datamods-filter-2.png" style="width:100%"></img>

The return value server-side is a list with the following items:

* **filtered**: a `reactive` function returning the data filtered.
* **code**: a `reactive` function returning the dplyr pipeline to filter data.
* **expr**: a `reactive` function returning an expression to filter data.



Binary file added vignettes/figures/datamods-filter-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fa788f6

Please sign in to comment.