Skip to content

Commit

Permalink
Improve the definition of "transform" in the vignettes (#1489)
Browse files Browse the repository at this point in the history
Closes #1475 

`Customizing Module Output` vignette is now called `Transform Module
Output`
As we introduce a new term "customize" and it would be best to use the
same term "transform" that we se to transform the `teal_data` object

`Data Transformations as Shiny Module` is now called `Transform Input
Data`
This name was appropriate at the time of writing the vignette when
transformation done using shiny module was only possible in one place,
now that is not the case and we have two places where data is
_transformed_ using shiny module. And from the user's perspective the
main thing showcased in this vignette is about transforming the input
data.
  • Loading branch information
vedhav authored Feb 12, 2025
1 parent c702995 commit 5aef4d7
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 60 deletions.
2 changes: 1 addition & 1 deletion R/dummy_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' This module creates an object called `object` that can be modified with decorators.
#' The `object` is determined by what's selected in `Choose a dataset` input in UI.
#' The object can be anything that can be handled by `renderPrint()`.
#' See the `vignette("customizing-module-output", package = "teal")` or [`teal_transform_module`]
#' See the `vignette("transform-module-output", package = "teal")` or [`teal_transform_module`]
#' to read more about decorators.
#'
#' @inheritParams teal_modules
Expand Down
2 changes: 1 addition & 1 deletion R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ setOldClass("teal_modules")
#' @param ui_args (named `list`) with additional arguments passed on to the UI function.
#' @param x (`teal_module` or `teal_modules`) Object to format/print.
#' @param transformators (`list` of `teal_transform_module`) that will be applied to transform module's data input.
#' To learn more check `vignette("data-transform-as-shiny-module", package = "teal")`.
#' To learn more check `vignette("transform-input-data", package = "teal")`.
#'
#' @param ...
#' - For `modules()`: (`teal_module` or `teal_modules`) Objects to wrap into a tab.
Expand Down
6 changes: 3 additions & 3 deletions R/teal_transform_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' The primary advantage of `teal_transform_module` over custom modules is in its error handling, where all warnings and
#' errors are managed by `teal`, allowing developers to focus on transformation logic.
#'
#' For more details, see the vignette: `vignette("data-transform-as-shiny-module", package = "teal")`.
#' For more details, see the vignette: `vignette("transform-input-data", package = "teal")`.
#'
#' # Customizing Module Outputs
#'
Expand All @@ -23,7 +23,7 @@
#' To manage these `decorators` within your module, use [`ui_transform_teal_data()`] and [`srv_transform_teal_data()`].
#' (For further guidance on managing decorators, refer to `ui_args` and `srv_args` in the vignette documentation.)
#'
#' See the vignette `vignette("customizing-module-output", package = "teal")` for additional examples.
#' See the vignette `vignette("transform-module-output", package = "teal")` for additional examples.
#'
#' # `server` as a language
#'
Expand Down Expand Up @@ -141,7 +141,7 @@ teal_transform_module <- function(ui = NULL,
"teal_transform_module() ",
"Using eventReactive in teal_transform module server code should be avoided as it ",
"may lead to unexpected behavior. See the vignettes for more information ",
"(`vignette(\"data-transform-as-shiny-module\", package = \"teal\")`).",
"(`vignette(\"transform-input-data\", package = \"teal\")`).",
call. = FALSE
)
}
Expand Down
4 changes: 2 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ articles:
- including-data-in-teal-applications
- data-as-shiny-module
- filter-panel
- data-transform-as-shiny-module
- transform-input-data
- title: Extending `teal`
navbar: Extending `teal`
contents:
- creating-custom-modules
- adding-support-for-reporting
- customizing-module-output
- transform-module-output
- title: Using `teal`
navbar: Using `teal`
contents:
Expand Down
137 changes: 137 additions & 0 deletions inst/design/teal-transform-module-decorators.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<mxfile host="65bd71144e">
<diagram name="Page-1" id="Af2CoAbSZcckCuTcOnmQ">
<mxGraphModel dx="1748" dy="940" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="78" value="&lt;span style=&quot;font-weight: 700; font-size: 20px;&quot;&gt;Input Data Transformations&lt;/span&gt;" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;fontSize=20;" parent="1" vertex="1">
<mxGeometry x="505" y="870" width="275" height="310" as="geometry"/>
</mxCell>
<mxCell id="151" value="" style="shape=flexArrow;endArrow=classic;html=1;strokeColor=#d79b00;fontSize=20;fillColor=#ffe6cc;entryX=-0.005;entryY=0.124;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="725" y="1100" as="sourcePoint"/>
<mxPoint x="851.3625" y="1124.82292" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="76" value="&lt;span style=&quot;font-weight: 700; font-size: 20px;&quot;&gt;Module Output Decoration&lt;/span&gt;" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;fontSize=20;" parent="1" vertex="1">
<mxGeometry x="505" y="1380" width="280" height="155" as="geometry"/>
</mxCell>
<mxCell id="77" value="&lt;span style=&quot;font-weight: 700; font-size: 20px;&quot;&gt;Teal Module Logic&lt;/span&gt;" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;fontSize=20;" parent="1" vertex="1">
<mxGeometry x="505" y="1200" width="280" height="160" as="geometry"/>
</mxCell>
<mxCell id="79" value="" style="endArrow=classic;html=1;" parent="1" source="84" target="85" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry"/>
</mxCell>
<mxCell id="80" value="" style="endArrow=classic;html=1;" parent="1" source="85" target="86" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry"/>
</mxCell>
<mxCell id="81" value="" style="endArrow=classic;html=1;" parent="1" source="86" target="87" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry"/>
</mxCell>
<mxCell id="83" value="" style="endArrow=classic;html=1;" parent="1" source="89" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="640" y="1425" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="84" value="teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;container=0;fontColor=#333333;arcSize=0;" parent="1" vertex="1">
<mxGeometry x="587.5" y="920" width="105" height="25" as="geometry"/>
</mxCell>
<mxCell id="85" value="Filter Panel" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;container=0;glass=0;arcSize=50;" parent="1" vertex="1">
<mxGeometry x="580" y="970" width="120" height="35" as="geometry"/>
</mxCell>
<mxCell id="86" value="Filtered teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;container=0;fontColor=#333333;arcSize=0;" parent="1" vertex="1">
<mxGeometry x="582.5" y="1032.5" width="115" height="25" as="geometry"/>
</mxCell>
<mxCell id="87" value="Transform Panel (transformators)" style="rounded=1;fillColor=#ffe6cc;strokeColor=#d79b00;arcSize=50;" parent="1" vertex="1">
<mxGeometry x="545" y="1082.5" width="190" height="35" as="geometry"/>
</mxCell>
<mxCell id="88" value="Module Logic" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;arcSize=50;" parent="1" vertex="1">
<mxGeometry x="580" y="1244" width="120" height="35" as="geometry"/>
</mxCell>
<mxCell id="89" value="Generated outputs (plots/tables) within&#10;teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;arcSize=0;" parent="1" vertex="1">
<mxGeometry x="532.5" y="1300" width="215" height="40" as="geometry"/>
</mxCell>
<mxCell id="90" value="" style="endArrow=classic;html=1;" parent="1" source="88" target="89" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry"/>
</mxCell>
<mxCell id="92" value="Decorated outputs within&#10;teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;arcSize=0;" parent="1" vertex="1">
<mxGeometry x="562.5" y="1485" width="155" height="40" as="geometry"/>
</mxCell>
<mxCell id="93" value="" style="endArrow=classic;html=1;" parent="1" target="92" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="640" y="1460" as="sourcePoint"/>
</mxGeometry>
</mxCell>
<mxCell id="198" style="edgeStyle=none;html=1;" edge="1" parent="1" source="196" target="88">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="196" value="Transformed teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;container=0;fontColor=#333333;arcSize=0;" vertex="1" parent="1">
<mxGeometry x="576.25" y="1141" width="127.5" height="25" as="geometry"/>
</mxCell>
<mxCell id="197" value="" style="endArrow=classic;html=1;" edge="1" parent="1" target="196">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="640" y="1117.5" as="sourcePoint"/>
<mxPoint x="640" y="1244" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="199" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#FFFFFF;opacity=50;" vertex="1" parent="1">
<mxGeometry x="490" y="850" width="590" height="710" as="geometry"/>
</mxCell>
<mxCell id="200" value="" style="shape=flexArrow;endArrow=classic;html=1;strokeColor=#d79b00;fontSize=20;fillColor=#ffe6cc;entryX=0.012;entryY=0.954;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" target="202">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="757" y="1450" as="sourcePoint"/>
<mxPoint x="827" y="1370" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="201" value="Transforming module outputs (decorators)" style="rounded=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
<mxGeometry x="530" y="1425" width="235" height="35" as="geometry"/>
</mxCell>
<mxCell id="202" value="Transforming teal_data" style="rounded=1;fillColor=#ffe6cc;strokeColor=#d79b00;arcSize=11;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="852" y="1090" width="208" height="270" as="geometry"/>
</mxCell>
<mxCell id="203" style="edgeStyle=none;html=1;strokeColor=#000000;fontSize=28;" edge="1" parent="1" source="204" target="208">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="204" value="teal_transform_module" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;container=0;glass=0;arcSize=50;" vertex="1" parent="1">
<mxGeometry x="881" y="1175" width="150" height="35" as="geometry"/>
</mxCell>
<mxCell id="205" style="edgeStyle=none;html=1;strokeColor=#000000;fontSize=28;" edge="1" parent="1" source="206" target="204">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="206" value="teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;container=0;fontColor=#333333;" vertex="1" parent="1">
<mxGeometry x="905.5" y="1125" width="100" height="30" as="geometry"/>
</mxCell>
<mxCell id="207" style="edgeStyle=none;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#000000;fontSize=28;" edge="1" parent="1" source="208" target="211">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="208" value="teal_transform_module" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;container=0;glass=0;arcSize=50;" vertex="1" parent="1">
<mxGeometry x="881" y="1225" width="150" height="35" as="geometry"/>
</mxCell>
<mxCell id="209" value="Transformed teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;container=0;fontColor=#333333;" vertex="1" parent="1">
<mxGeometry x="890" y="1315" width="134" height="30" as="geometry"/>
</mxCell>
<mxCell id="210" style="edgeStyle=none;html=1;strokeColor=#000000;fontSize=28;" edge="1" parent="1" source="211" target="209">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="211" value="..." style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=bottom;whiteSpace=wrap;rounded=0;fontSize=28;" vertex="1" parent="1">
<mxGeometry x="927" y="1272.5" width="60" height="25" as="geometry"/>
</mxCell>
<mxCell id="212" value="" style="rounded=0;whiteSpace=wrap;html=1;fontSize=28;dashed=1;" vertex="1" parent="1">
<mxGeometry x="935" y="870" width="125" height="150" as="geometry"/>
</mxCell>
<mxCell id="213" value="Logic" style="rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;container=0;glass=0;arcSize=50;" vertex="1" parent="1">
<mxGeometry x="967.5" y="950" width="60" height="25" as="geometry"/>
</mxCell>
<mxCell id="214" value="teal_data" style="rounded=1;fillColor=#f5f5f5;strokeColor=#666666;container=0;fontColor=#333333;arcSize=0;" vertex="1" parent="1">
<mxGeometry x="962.5" y="910" width="70" height="25" as="geometry"/>
</mxCell>
<mxCell id="215" value="Transform Logic" style="rounded=1;fillColor=#ffe6cc;strokeColor=#d79b00;arcSize=50;" vertex="1" parent="1">
<mxGeometry x="947.5" y="985" width="100" height="25" as="geometry"/>
</mxCell>
<mxCell id="216" value="Legend" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=20;fontStyle=0" vertex="1" parent="1">
<mxGeometry x="945" y="870" width="105" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading

0 comments on commit 5aef4d7

Please sign in to comment.