| Title: | A Directed Acyclic Graph Extension for 'blockr' |
|---|---|
| Description: | Building on the docking layout manager provided by 'blockr.dock', this provides an extension that allows for visualizing and manipulating a 'blockr' board using a DAG-based user interface powered by the 'g6R' graph visualisation HTML widget. |
| Authors: | David Granjon [aut, cre], Nicolas Bennett [aut], Christoph Sax [aut], Bristol Myers Squibb [fnd] |
| Maintainer: | David Granjon <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.5.9003 |
| Built: | 2026-11-19 08:15:59 UTC |
| Source: | https://github.com/BristolMyersSquibb/blockr.dag |
How the Workflow extension arranges the board: the layered DAG layout, its
flow direction and its spacing. Users change both from the toolbar's
layout menu; new_dag_extension() takes the one a board starts with.
dag_layout( direction = c("TB", "LR"), spacing = c("normal", "compact", "loose") ) is_dag_layout(x)dag_layout( direction = c("TB", "LR"), spacing = c("normal", "compact", "loose") ) is_dag_layout(x)
direction |
|
spacing |
|
x |
Object to test. |
dag_layout() returns an object of class dag_layout: a list of
direction and spacing, plain values only, so it round-trips through
serialization.
dag_layout() dag_layout(direction = "LR", spacing = "compact")dag_layout() dag_layout(direction = "LR", spacing = "compact")
Functions for creating and working with context menu entries.
new_context_menu_entry( name, js, action = NULL, condition = TRUE, id = tolower(gsub(" +", "_", name)), retarget = FALSE ) is_context_menu_entry(x) context_menu_items(x)new_context_menu_entry( name, js, action = NULL, condition = TRUE, id = tolower(gsub(" +", "_", name)), retarget = FALSE ) is_context_menu_entry(x) context_menu_items(x)
name |
Name of the context menu entry. |
js |
JavaScript code to execute when the entry is selected. |
action |
Action to perform when the entry is selected. |
condition |
Condition to determine if the entry should be shown. |
id |
Unique identifier for the context menu entry.
Inferred from |
retarget |
When |
x |
Object |
new_context_menu_entry()Creates a new context menu entry with the specified name, JavaScript code, action function, and display condition.
is_context_menu_entry()Tests whether an object is a valid context menu entry.
context_menu_items()Generic function to extract context menu items from various objects like dock extensions, boards, or lists.
The context_menu_items.dag_extension() method
provides the following actions:
Create link - Creates connections between workflow nodes.
Remove block - Removes individual blocks from the workflow.
Remove link - Removes connections between workflow nodes.
Append block - Adds a new block after the selected node.
Create stack - Creates a new workflow stack.
Remove stack - Removes an entire workflow stack.
Edit stack - Opens stack editing interface.
Add block - Adds a new block to the canvas.
new_context_menu_entry()A context menu entry object of class "context_menu_entry" containing condition, action, and js functions, with name and id attributes.
is_context_menu_entry()TRUE if x is
a context menu entry, FALSE otherwise.
context_menu_items()A list of context menu items for the given object.
Visualizes the DAG (directed acyclic graph) underlying a board and provides UI elements to manipulate the board.
new_dag_extension(positions = NULL, layout = NULL, ...)new_dag_extension(positions = NULL, layout = NULL, ...)
positions |
Optional node positions overlaid on the board-derived
nodes, as a named list keyed by block id, each element a list with numeric
|
layout |
The layout's direction and spacing, from |
... |
Forwarded to |
A dag_extension object that extends the dock extension system
for visualizing and manipulating DAG workflows.
blockr.dag.svg_renderer: when TRUE, the DAG is rendered with the SVG
renderer instead of the default canvas renderer. Canvas is the default
because the SVG element reports offsetWidth == 0, which makes the
underlying g-lite client/canvas coordinate scaling ignore the page zoom
factor and desyncs hit-testing below 100% browser zoom. The SVG renderer
keeps every element in the DOM, which the shinytest2 end-to-end tests need
to query and screenshot, so they opt in via
AppDriver$new(options = list(blockr.dag.svg_renderer = TRUE)).
Functions for creating and working with toolbar items for the DAG interface.
new_toolbar_item(id, icon, js, action = NULL, tooltip = NULL) is_toolbar_item(x) toolbar_items(x)new_toolbar_item(id, icon, js, action = NULL, tooltip = NULL) is_toolbar_item(x) toolbar_items(x)
id |
Unique identifier for the toolbar item. |
icon |
Name of an icon to show in the toolbar. |
js |
JavaScript code to execute when the entry is selected. |
action |
Action to perform when the entry is selected. |
tooltip |
Optional tooltip text for the entry. |
x |
Object |
new_toolbar_item()Creates a new toolbar item with the specified id, icon, JavaScript code, action function, and tooltip text.
is_toolbar_item()Tests whether an object is a valid toolbar item.
toolbar_items()Generic function to extract toolbar items from various objects like dock extensions, boards, or lists.
The toolbar_items.dag_extension() method provides
the following actions:
Zoom in - Increases the graph zoom level.
Zoom out - Decreases the graph zoom level.
Auto fit - Automatically fits the entire graph within the viewport.
Layout - Reapplies the graph layout algorithm to reorganize nodes.
Add block - Opens interface to add a new block to the workflow.
Add stack - Creates a new workflow stack.
Remove selected - Removes currently selected elements from the graph.
new_toolbar_item()A toolbar item object of class "toolbar_item" containing action and js functions, with id, icon, and tooltip attributes.
is_toolbar_item()TRUE if x is
a toolbar item, FALSE otherwise.
toolbar_items()A list of toolbar items for the given object.