Releases: BristolMyersSquibb/blockr
v0.0.2.9023
What's Changed
- Fix file browser field - file root #358 by @DivadNojnarg in #426
Full Changelog: v0.0.2.9022...v0.0.2.9023
v0.0.2.9022
Hotfix for the add block feature in dynamic UI context (cc @JohnCoene). It was not possible to add a block to a dynamically created stack, like in the below example:
library(shiny)
library(bslib)
library(blockr)
ui <- fluidPage(
theme = bslib::bs_theme(5L),
actionButton("create", "Create Stack"),
div(id = "stacks")
)
server <- function(input, output, session) {
observeEvent(input$create, {
stack <- new_stack()
on.exit({
generate_server(stack)
})
insertUI(
"#stacks",
"beforeEnd",
generate_ui(stack)
)
})
}
shinyApp(ui, server)
v0.0.2.9021
What's Changed
- hotfix: registry issue (remove submit_class) by @DivadNojnarg in #422. This was preventing from seeing suggested blocks in the new add block menu after adding a submit block like filter, sumarize, ...
Full Changelog: v0.0.2.9020...v0.0.2.9021
v0.0.2.9020
Features
- Improved
submit
feature for blocks. Now submit isn't added as a class but as a special block attribute. When you design a block, you can pass thesubmit
parameter like so:
new_super_block <- function(submit = NA, ...) {
fields <- list()
new_block(
fields = fields,
expr = quote(print("test")),
submit = submit,
...,
class = "my_block"
)
}
When submit = NA
, it will add a submit button but computations are blocked, as clicking on it is required. Internally, once the input$submit
is clicked, the submit attribute is set to TRUE
. This is useful when the stack is serialized, since this state is kept so that computations can be automatically re-triggered on restore. When submit = TRUE
, a button is shown and the result is also computed. When submit = FALSE
, no button is shown.
# You can disable the submit button for filter block
serve_stack(new_stack(new_dataset_block(), new_filter_block(columns = "Time", submit = FALSE)))
serve_stack(new_stack(new_dataset_block(), new_filter_block(columns = "Time", submit = NA)))
# Simulate what happens when restoring a serialised stack
serve_stack(new_stack(new_dataset_block(), new_filter_block(columns = "Time", submit = TRUE)))
v0.0.2.9010
Feature
- Improved add new block.
- Added new
category
to the registry. Now when a block is registered, you may pass a category parameter (which is used by the add block feature to sort blocks):
register_block(
constructor = new_tail_block,
name = "tail block",
description = "return last n rows",
category = "transform",
classes = c("tail_block", "transform_block"),
input = "data.frame",
output = "data.frame"
)
If not passed, the block will belong to uncategorized
blocks (default).
Doc
- Improved
registry
andgetting started
vignettes. - Add new
case studies
vignette to present blockr in various contexts. - Refine GitHub readme.
Fixes
- Fix issue in
handle_remove.block
:vals$stack
wasn't correctly updated
when the last block was removed leading to wrong state. - Loading spinner is now correctly hidden when the block visual is updated.
v0.0.2
blockr 0.0.2
Breaking changes
- Change blocks and fields constructor names to
new_*_block
andnew_*_field
. For instance, for the select block,
users are now supposed to usenew_select_block()
and notselect_block
. - Remove
data
from block constructor:
new_select_block <- function(columns = character(), ...) {
...
}
New features
- New validation functions:
validate_field()
andvalidate_block()
to check that
values are consistent with data. These are used to then propagate any error to the user via JavaScript. - Evaluation stops whenever a block isn't valid and the app should not crash.
- We can now instantiate block outside the stack with default parameter values (or use the old way with constructors):
# New way
data_blk <- new_dataset_block(selected = "lab", package = "blockr.data")
select_blk <- new_select_block("STUDYID")
stack <- new_stack(data_blk, select_blk)
# Old way
stack <- new_stack(new_data_block, new_select_block)
v0.0.0.9000
Initial prototype shown to the BMS leadership team. The full demo is available at: https://github.com/blockr-org/block.demo.