diff --git a/DESCRIPTION b/DESCRIPTION
index 4f636716d..8c3b1ed09 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -62,6 +62,7 @@ Depends:
Imports:
backports,
checkmate,
+ cli,
data.table,
digest,
lgr,
@@ -101,6 +102,7 @@ Suggests:
htmlwidgets,
ranger,
themis
+Remotes: mlr-org/mlr3misc
ByteCompile: true
Encoding: UTF-8
Config/testthat/edition: 3
diff --git a/NAMESPACE b/NAMESPACE
index 7d18e1f4f..b1281c6e5 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -229,6 +229,7 @@ if (getRversion() >= "4.3.0") S3method(chooseOpsMethod,CnfAtom)
if (getRversion() >= "4.3.0") S3method(chooseOpsMethod,CnfClause)
if (getRversion() >= "4.3.0") S3method(chooseOpsMethod,CnfFormula)
import(checkmate)
+import(cli)
import(data.table)
import(mlr3)
import(mlr3misc)
diff --git a/R/Graph.R b/R/Graph.R
index d0832780a..c3264fc6c 100644
--- a/R/Graph.R
+++ b/R/Graph.R
@@ -414,15 +414,25 @@ Graph = R6Class("Graph",
scc = self$edges[, list(sccssors = paste(unique(dst_id), collapse = ",")), by = list(ID = src_id)]
lines = scc[prd[lines, on = "ID"], on = "ID"][, c("ID", "State", "sccssors", "prdcssors")]
lines[is.na(lines)] = ""
- catf("Graph with %s PipeOps:", nrow(lines))
+ cat_cli(cli_h1("Graph with {nrow(lines)} PipeOps:"))
## limit column width ##
outwidth = getOption("width") %??% 80 # output width we want (default 80)
colwidths = map_int(lines, function(x) max(nchar(x), na.rm = TRUE)) # original width of columns
collimit = calculate_collimit(colwidths, outwidth)
+
opts = options(datatable.prettyprint.char = collimit)
on.exit(options(opts), add = TRUE)
print(lines, row.names = FALSE)
+
+ is_sequential = all(table(self$edges$src_id) <= 1) && all(table(self$edges$dst_id) <= 1)
+ if(is_sequential) {
+ ppunit = paste0(self$ids(), collapse = " -> ")
+ pp = paste0(c("", ppunit, "