Skip to content
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

Ability to set datanames in module's constructor #1307

Closed
donyunardi opened this issue Dec 19, 2024 · 1 comment · Fixed by #1309
Closed

Ability to set datanames in module's constructor #1307

donyunardi opened this issue Dec 19, 2024 · 1 comment · Fixed by #1309
Assignees
Labels

Comments

@donyunardi
Copy link
Contributor

donyunardi commented Dec 19, 2024

Summary

Related to insightsengineering/teal#1436.

We need to review all modules to ensure there is a way for users to set datanames in the module. Upon review, we identified two modules that require updates:

  • tm_g_barchart_simple
  • tm_g_ci

Additionally, we discussed how tm_g_ci should be designed to use x_var, y_var, and color (which are data_extract_spec objects) when defining datanames, similar to the approach described here .

Acceptance Criteria

  • Update the design of tm_g_barchart_simple and tm_g_ci to allow datanames to be set in the module's constructor.
  • Design tm_g_ci to utilize x_var, y_var, and color as data_extract_spec objects when defining datanames.
  • Ensure that every module provides a way to configure datanames (via argument, data extract spec, or other means) in the module's constructor.
    • Review and update roxygen note, if necessary.
@donyunardi donyunardi changed the title Ability to set datanames in module's constructor Ability to set datanames in module's constructor Dec 19, 2024
@llrs-roche llrs-roche self-assigned this Jan 9, 2025
@llrs-roche
Copy link
Contributor

There are 36 exported modules from tmg, only those tm_g_barchart_simple and tm_g_ci have set datanames = "all", other have it configurable:

Image

tm_g_ci already requires data_extract_spec for x_var, y_var and color:

checkmate::assert_class(y_var, classes = "data_extract_spec")
checkmate::assert_class(x_var, classes = "data_extract_spec")
checkmate::assert_class(color, classes = "data_extract_spec")

It is easy to use them for specifying module's datanames.

I've modified the two modules on similar ways to solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants