-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to set datanames
#824
base: main
Are you sure you want to change the base?
Conversation
Unit Tests Summary 1 files 22 suites 13m 8s ⏱️ Results for commit f23555d. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Results for commit 101cc5c ♻️ This comment has been updated with latest results. |
datanames <- if (show_metadata && length(datasets_selected) > 0L) { | ||
datasets_selected | ||
} else if (show_metadata) { | ||
"all" | ||
} else { | ||
NULL | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a gap here when show_metadata = FALSE
and length(datasets_selected)
. This show_metadata
argument is unnecessary and I would suggest to deprecate show_metadata
and to show metadata when datasets_selected
is not empty. So:
tm_front_page <- function(
datasets_selected = NULL,
show_metadata = <deprecated>
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On that condition show_metadata
prevails and nothing would be shown... but I can deprecate show_metadata
entirely.
@@ -110,6 +111,7 @@ | |||
tm_missing_data <- function(label = "Missing data", | |||
plot_height = c(600, 400, 5000), | |||
plot_width = NULL, | |||
datasets_selected = character(0L), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with what is used in other modules, currently there are 2 modules using this argument: tm_data_table
and tm_variable_browser
. Let me know if you want me to rename those other modules too.
I haven't tested what happens with transformators...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be much easier if tm_data_table
and tm_variable_browser
had datanames
instead of datasets_selected
. I wouldn't rename them, but:
datanames = "all",
datasets_selected = <deprecated>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do that and check what happens with transformators
.
Pull Request
Fixes #821
This PR add a parameter (or uses existing ones) to use on
teal::module(datanames)
to select which datasets are shown in each module.tm_file_viewer()
doesn't have and I think shouldn't have.Acceptance criteria:
tm_missing_data example
tm_variable_browser example
tm_front_page (additional modifications to enable granular selection): Example
I checked via searching
datanames =
that there are now at least 15 cases inmodule()
corresponding to the 15 modules exported.There is one that is not configurable (
datanames = NULL
on the picture above),tm_file_viewer
. In my opinion it doesn't matter the datasets available on the module to visualize files. But if needed we can add adataset_selected
argument.Note that I added the
dataset_selected
argument to two modules on the best place I thought, if a package/user is using positional arguments it might break (and also teal.gallery).Note that it doesn't show on shinylive (on Rstudio, preview, not sure if once fully installed) and also that it doesn't show the url (this could be an issue with my machine):