-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Solution for modules-marketplace #51
Comments
I do not agree with some assumptions where "Don't depend on a namespaces and names convention - should be bulletproof so for example we using a naming convention in the pkgdown , so why not to use it for this purpose too.
My idea is to use here the namespaces of each concern pacakge as I show before:
|
@Polkas first step is less difficult to decide on searching namespace. As you noted above, we are pretty consistent with the naming but the problem will occur when we decide to distinguish end describe formals. tm_g_xxx:
params:
a: data_extract_spec
b: character
c: logical In the latter stages of the design we will have to deduct what to pass to the module arguments. Dependency on the namespace doesn't give us any guarantee that we (our algorithm) will correctly guess the type of the argument. This is why we need to be explicit. It should be either some file with content of a function returning needed settings. |
if all modules arguments will have a default value then the problem is solved. For empty arguments we could use character(0)/integer(0) or sthing like data_extract_spec(NULL) (structure(list(), class = "")). |
Teal Wizard The maintenance of the teal wizard connected data has to be as automatic as possible as this process will add another complexity layer to the project. This is another factor which will make the life more difficult for developers and mainly the newcomers. As a developer I need to do x,y,z when adding new module or updating an existing one. Store perspective - local and global:
Information: What information we needed for each module:
*I feel that we need much more here as this will be used to generated the html input of a certain type and possible values Example of thumbnail image of a module: Maintenance: How records are added/removed or updated Functions:
Images of each module have to be created automatically Representation: Each module record should have enough information to build a proper marketplace card and HTML input for each of its arguments. R6 class for each argument type with to_list/from_list/get_shiny_input methods. Validation: How to validate that we have all records with all proper information. Automatic processing - Example: tmc_n <- asNamespace("teal.modules.general")
modules_names <- grep("tm_", ls(tmc_n), value = T)
tm_formals <- lapply(modules_names, function(x) formals(tmc_n[[x]]))
names(tm_formals) <- modules_names
# Arguments Defaults
tm_formals_sc <- tm_formals$tm_g_scatterplot
tm_formals_sc
is_call <- vapply(tm_formals_sc, is.call, logical(1))
is_empty <- vapply(tm_formals_sc, function(x) identical(x, bquote()), logical(1))
is_name <- vapply(tm_formals_sc, is.name, logical(1)) & !is_empty
# types
c(
lapply(lapply(tm_formals_sc[is_call | is_name], eval, envir = tmc_n), class),
lapply(tm_formals_sc[is_empty], function(x) "empty"),
lapply(tm_formals_sc[!(is_empty | is_call | is_name)], class)
)[names(tm_formals_sc)]
db <- tools::Rd_db("teal.modules.general")
sc <- db$tm_g_scatterplot.Rd
sc_names <- lapply(sc, attr, "Rd_tag")
names(sc) <- sc_names
# Title
sc[["\\title"]][[1]]
# Description
trimws(paste(unlist(sc[["\\description"]]), collapse = ""))
|
@gogonzo nad @kumamiao I got an information that the current view on the teal wizard is much simplified. We will not give an option to specify the arguments from the wizard app perspective. As I understand sb is choosing modules and we give a template with already defined defaults. Thus from now on I assume such simplified scope. |
@Polkas solution with browsing the documentation looks good. If we keep the information in the yaml files we can use your code for testing, to make sure that we keep this up to date. And yes, at this moment we will use simplified version for teal-skeleton but in the long term the solution should also cover addition of the arguments and so on. |
SHiny UI Editor |
Suggestion:
teal.modules.clinical::available_modules()
or something similarThe text was updated successfully, but these errors were encountered: