You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In response to the conclusions from the last meeting we implemented a slightly different design.
decorators specified for tm_ constructor should be a list of teal_transform_module.
There is a way to simplify building of teal_transform_module's server by calling make_teal_transform_server(expr). This function allows to simply write an expression which will be wrapped in necessary boilerplate shiny-server code. When expression contains a name which matches the input, then it will be substituted with input value. Consider following, where ui has input named gg_title and in the expression there is ggtitle(gg_title). This would result in gg_title to be replaced with input$gg_title value.
When created teal_transform_module has constant object names. This means that it is hard to robustly reuse
transformer in any tm_ module. It is recomended for external parties to collect library of "decorators" as functions
to potentially adjust the content of the evaluated expression to teal_modules's internals. See the following example
and focus on output_name.
transforms and decorators they are very similar concepts. transforms modify module's data input while decorators modify module's output object. module function has transforms argument, which is attached to the teal_module object and executed by teal before teal_module's server is called. We would like to document decorators also, but decorators fits better as ui/server_args and thus they don't have a dedicated place in the module() formals. Just consider a module which is defined as follows:
ui is a function of id and additional args (ui_args)
server is a function if id, data and additional args (server_args)
If we decide to feed a ui and server with decorators as a separate module() argument it means it goes beyond the definition.
The text was updated successfully, but these errors were encountered:
part of #1384
Improved POC
In response to the conclusions from the last meeting we implemented a slightly different design.
decorators
specified fortm_
constructor should be a list ofteal_transform_module
.There is a way to simplify building of
teal_transform_module
's server by callingmake_teal_transform_server(expr)
. This function allows to simply write an expression which will be wrapped in necessary boilerplate shiny-server code. When expression contains a name which matches the input, then it will be substituted with input value. Consider following, where ui has input namedgg_title
and in the expression there isggtitle(gg_title)
. This would result ingg_title
to be replaced withinput$gg_title
value.simplified server constructor
When created
teal_transform_module
has constant object names. This means that it is hard to robustly reusetransformer in any
tm_
module. It is recomended for external parties to collect library of "decorators" as functionsto potentially adjust the content of the evaluated expression to
teal_modules
's internals. See the following exampleand focus on
output_name
.function constructor
example app
Example tmg app
Regression footnote
Design challenges:
transforms
anddecorators
they are very similar concepts.transforms
modify module's data input whiledecorators
modify module's output object.module
function hastransforms
argument, which is attached to theteal_module
object and executed by teal before teal_module's server is called. We would like to documentdecorators
also, butdecorators
fits better asui/server_args
and thus they don't have a dedicated place in themodule()
formals. Just consider amodule
which is defined as follows:ui
is a function ofid
and additional args (ui_args)server
is a function ifid
,data
and additional args (server_args)If we decide to feed a
ui
andserver
withdecorators
as a separatemodule()
argument it means it goes beyond the definition.The text was updated successfully, but these errors were encountered: