-
Notifications
You must be signed in to change notification settings - Fork 14
Fix 817 - Add HTMLWidgets barcharts #883
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
Changes from all commits
f3d7d41
45b3696
7cdf721
fbcd3fb
264d991
67ab491
06268d5
ba64b2e
e80563f
45decf8
9c25e87
127fc00
866ff78
917bdf4
9e69105
cdce0d2
07b8ae6
bd390b0
16b38e8
8368f7e
cb28f9e
6a11117
fe4bdc9
a18468b
d9d2858
debd709
df85ce5
82eb08e
31ed9a7
62ae0a0
638f091
ec82668
d6b752f
2ee843f
f6852c8
ba143ad
05392d7
11a5df7
00e326a
65261a2
44e809e
d127028
565d71f
56cb9d3
f90bbcd
01316fb
a547596
b6e9cf4
f5e601a
7428116
9c76c52
04c76e1
4b9394e
c640f1a
8987390
5ff36d1
9596ffd
a50bbcd
1fab3f5
054d824
e24f41d
dc54437
30002c3
07bff94
88e2d5c
bed7fcf
189e307
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ Imports: | |
glue, | ||
gt, | ||
ggplot2, | ||
htmlwidgets, | ||
here, | ||
janitor, | ||
knitr, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,9 +116,35 @@ Consent_Assess <- function( | |
|
||
# visualizations ---------------------------------------------------------- | ||
lCharts <- list() | ||
|
||
dfConfig <- MakeDfConfig( | ||
strMethod = "identity", | ||
strGroup = strGroup, | ||
strAbbreviation = "CONSENT", | ||
strMetric = "Consent Issues", | ||
strNumerator = "Consent Issues", | ||
strDenominator = "Total Subjects", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Denominator doesn't apply here. |
||
vThreshold = nThreshold | ||
) | ||
|
||
lCharts$barMetric <- gsm::Visualize_Score(dfFlagged = lData$dfFlagged, strType = "metric") | ||
lCharts$barScore <- gsm::Visualize_Score(dfFlagged = lData$dfFlagged, strType = "score") | ||
if (!bQuiet) cli::cli_alert_success("{.fn Visualize_Score} created {length(lCharts)} chart{?s}.") | ||
|
||
lCharts$barMetricJS <- barChart( | ||
results = lData$dfFlagged, | ||
workflow = dfConfig, | ||
yaxis = "metric", | ||
elementId = "consentAssessMetric" | ||
) | ||
|
||
lCharts$barScoreJS <- barChart( | ||
results = lData$dfFlagged, | ||
workflow = dfConfig, | ||
yaxis = "score", | ||
elementId = "consentAssessScore" | ||
) | ||
|
||
if (!bQuiet) cli::cli_alert_success("Created {length(lCharts)} bar chart{?s}.") | ||
|
||
# return data ------------------------------------------------------------- | ||
return(list( | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -107,9 +107,35 @@ IE_Assess <- function( | |||||
|
||||||
# visualizations ---------------------------------------------------------- | ||||||
lCharts <- list() | ||||||
|
||||||
dfConfig <- MakeDfConfig( | ||||||
strMethod = "identity", | ||||||
strGroup = strGroup, | ||||||
strAbbreviation = "IE", | ||||||
strMetric = "Inclusion/Exclusion Issues (Count)", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
strNumerator = "Inclusion/Exclusion Issues", | ||||||
strDenominator = "Total Subjects", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Denominator doesn't apply here. |
||||||
vThreshold = nThreshold | ||||||
) | ||||||
|
||||||
lCharts$barMetric <- Visualize_Score(dfFlagged = lData$dfFlagged, strType = "metric") | ||||||
lCharts$barScore <- Visualize_Score(dfFlagged = lData$dfFlagged, strType = "score") | ||||||
if (!bQuiet) cli::cli_alert_success("{.fn Visualize_Score} created {length(lCharts)} chart{?s}.") | ||||||
|
||||||
lCharts$barMetricJS <- barChart( | ||||||
results = lData$dfFlagged, | ||||||
workflow = dfConfig, | ||||||
yaxis = "metric", | ||||||
elementId = "ieAssessMetric" | ||||||
) | ||||||
|
||||||
lCharts$barScoreJS <- barChart( | ||||||
results = lData$dfFlagged, | ||||||
workflow = dfConfig, | ||||||
yaxis = "score", | ||||||
elementId = "ieAssessScore" | ||||||
) | ||||||
|
||||||
if (!bQuiet) cli::cli_alert_success("Created {length(lCharts)} bar chart{?s}.") | ||||||
|
||||||
# return data ------------------------------------------------------------- | ||||||
return(list( | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -168,14 +168,52 @@ LB_Assess <- function( | |||||
|
||||||
if (!hasName(lData, "dfBounds")) lData$dfBounds <- NULL | ||||||
|
||||||
dfConfig <- MakeDfConfig( | ||||||
strMethod = strMethod, | ||||||
strGroup = strGroup, | ||||||
strAbbreviation = "LB", | ||||||
strMetric = "LB Abnormalities (Rate)", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
strNumerator = "Abnormal Lab Samples", | ||||||
strDenominator = "Total Lab Samples", | ||||||
vThreshold = vThreshold | ||||||
) | ||||||
|
||||||
|
||||||
|
||||||
if (strMethod != "Identity") { | ||||||
|
||||||
|
||||||
lCharts$scatter <- gsm::Visualize_Scatter(dfFlagged = lData$dfFlagged, dfBounds = lData$dfBounds, strGroupLabel = strGroup) | ||||||
if (!bQuiet) cli::cli_alert_success("{.fn Visualize_Scatter} created {length(lCharts)} chart.") | ||||||
|
||||||
# rbm-viz charts ---------------------------------------------------------- | ||||||
lCharts$scatterJS <- scatterPlot( | ||||||
results = lData$dfFlagged, | ||||||
workflow = dfConfig, | ||||||
bounds = lData$dfBounds, | ||||||
elementId = "lbAssessScatter" | ||||||
) | ||||||
|
||||||
if (!bQuiet) cli::cli_alert_success("Created {length(lCharts)} scatter plot{?s}.") | ||||||
} | ||||||
|
||||||
lCharts$barMetric <- gsm::Visualize_Score(dfFlagged = lData$dfFlagged, strType = "metric") | ||||||
lCharts$barScore <- gsm::Visualize_Score(dfFlagged = lData$dfFlagged, strType = "score", vThreshold = vThreshold) | ||||||
if (!bQuiet) cli::cli_alert_success("{.fn Visualize_Score} created {length(names(lCharts)[names(lCharts) != 'scatter'])} chart{?s}.") | ||||||
|
||||||
lCharts$barMetricJS <- barChart( | ||||||
results = lData$dfFlagged, | ||||||
workflow = dfConfig, | ||||||
yaxis = "metric", | ||||||
elementId = "lbAssessMetric" | ||||||
) | ||||||
|
||||||
lCharts$barScoreJS <- barChart( | ||||||
results = lData$dfFlagged, | ||||||
workflow = dfConfig, | ||||||
yaxis = "score", | ||||||
elementId = "lbAssessScore" | ||||||
) | ||||||
|
||||||
if (!bQuiet) cli::cli_alert_success("Created {length(names(lCharts)[!names(lCharts) %in% c('scatter', 'scatterJS')])} bar chart{?s}.") | ||||||
|
||||||
|
||||||
|
||||||
|
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'd prefer Widget or Interactive here if I may be so pedantic.
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.
@samussiah will update the naming in a separate PR, think that'll make things a tad easier