A Directed Acyclic Graph Extension for 'blockr'

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.


blockr.dag

lifecycle status coverage CRANstatus

An interative network library provided by g6R can be used as front-end to a blockr board using this package.

Installation

You can install the development version of blockr.dag from GitHub with:

# install.packages("pak")
pak::pak("BristolMyersSquibb/blockr.dag")

Example

To start up a board with the dag extension, run the following code:

library(blockr.dag)
library(blockr.core)
library(blockr.dock)

options(
  "g6R.mode" = "dev",
  #"g6R.layout_on_data_change" = TRUE,
  "g6R.preserve_elements_position" = TRUE
)

serve(
  new_dock_board(
    blocks = c(
      a = new_dataset_block("iris"),
      b = new_scatter_block(x = "Sepal.Length", y = "Sepal.Width")
    ),
    links = list(from = "a", to = "b", input = "data"),
    stacks = c(
      stack_1 = new_dock_stack(c("a", "b"), color = "#0000FF"),
      stack_2 = new_dock_stack()
    ),
    extensions = new_dag_extension()
  )
)
blockr.dag demo application with stacks blockr.dag demo application with stacks

The board is the single source of truth for the DAG. The extension owns only board-independent view attributes, e.g. node positions, passed as positions (keyed by block id) and persisted across save / restore. The auto-layout currently still computes final placement at cold start, so positions are not yet honored over it (a planned follow-up):

library(blockr.dag)
library(blockr.dock)
library(blockr.core)

# The board is the single source of truth for nodes / edges / combos. The DAG
# extension only owns board-independent view attributes, e.g. node positions,
# supplied as a named list keyed by block id. Supplied positions pin those
# nodes over the auto-layout; the rest fall back to the layout.
positions <- list(
  a = list(x = 200, y = 150),
  b = list(x = 200, y = 350)
)

serve(
  new_dock_board(
    blocks = c(
      a = new_dataset_block("iris"),
      b = new_head_block()
    ),
    links = list(from = "a", to = "b", input = "data"),
    extensions = new_dag_extension(positions = positions)
  )
)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("blockr.dag")

0.1.5 by David Granjon, 3 months ago


https://bristolmyerssquibb.github.io/blockr.dag/


Browse source code at https://github.com/cran/blockr.dag


Authors: David Granjon [aut, cre] , Nicolas Bennett [aut] , Christoph Sax [aut] , Bristol Myers Squibb [fnd]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports blockr.core, blockr.dock, shiny, g6R, jsonlite, htmltools

Suggests knitr, rmarkdown, testthat, roxy.shinylive, webshot2, quarto, cyclocomp, shinytest2, chromote, withr, colorspace


Imported by blockr.


See at CRAN