Skip to content

Commit

Permalink
add third party registry setup + update join block to latest blockr
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Feb 7, 2024
1 parent 57fdc84 commit d8ab1ec
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/demo-bms-blocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ demo_join_block <- function(data, ...) {
data,
y = "demo",
type = "inner",
by_col = c("STUDYID", "USUBJID"),
by = c("STUDYID", "USUBJID"),
...
),
data
Expand Down
83 changes: 83 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,86 @@ ui_fields_one_column <- function(x, ns, inputs_hidden) {
div(cards, class = "mt-3")
)
}

register_blockr_extra_blocks <- function(pkg) {

if (missing(pkg)) {
pkg <- pkg_name()
}

register_blocks(
constructor = c(
plot_block,
ggiraph_block,
asfactor_block,
demo_data_block,
demo_join_block,
demo_arrange_block,
demo_group_by_block,
demo_filter_block_1,
demo_filter_block_2,
demo_summarize_block
),
name = c(
"plot block",
"ggiraph block",
"asfactor block",
"demo data block",
"demo join block",
"demo arrange block",
"demo group by block",
"demo filter block 1",
"demo filter block 2",
"demo summarize block"
),
description = c(
"Monolithic ggplot block",
"Monolithic ggiraph block",
"As factor mutate block",
"blockr.data preselected to lab data",
"Predefined join block for BMS demo",
"Predefined arrange block for BMS demo",
"Predefined group by block for BMS demo",
"Predefined filter block for BMS demo 1",
"Predefined filter block for BMS demo 2",
"Predefined summarize block for BMS demo"
),
classes = list(
"plot_block",
c("ggiraph_block", "plot_block"),
c("asfactor_block", "transform_block"),
c("demo_dataset_block", "data_block"),
c("demo_join_block", "transform_block"),
c("demo_arrange_block", "transform_block"),
c("demo_group_by_block", "transform_block"),
c("demo_filter_block_1", "transform_block"),
c("demo_filter_block_2", "transform_block"),
c("demo_summarize_block", "transform_block")
),
input = c(
"data.frame",
"data.frame",
"data.frame",
NA_character_,
"data.frame",
"data.frame",
"data.frame",
"data.frame",
"data.frame",
"data.frame"
),
output = c(
"list",
"list",
"data.frame",
"data.frame",
"data.frame",
"data.frame",
"data.frame",
"data.frame",
"data.frame",
"data.frame"
),
package = pkg
)
}

Check warning on line 117 in R/utils.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/utils.R,line=117,col=2,[trailing_blank_lines_linter] Missing terminal newline.
6 changes: 6 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.onLoad <- function(libname, pkgname) { # nocov start

register_blockr_extra_blocks(pkgname)

invisible(NULL)
} # nocov end

0 comments on commit d8ab1ec

Please sign in to comment.