Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group nodes into clusters in graph visualizations #463

Merged
merged 4 commits into from
Jul 7, 2018
Merged

Conversation

wlandau
Copy link
Member

@wlandau wlandau commented Jul 7, 2018

Summary

In vis_drake_graph() and drake_graph_info(), you can now use the group and clusters arguments to group nodes into clusters. This is handy for large graphs. group is the name of a column in drake_graph_info()$nodes, and these columns include everything in config$plan, such as wildcard evaluation indicators (evaluate_plan(trace = TRUE)). clusters is a vector of values in the group column to cluster on. For example, let's collapse everything except the outdated nodes.

library(drake)
load_mtcars_example()
make(my_plan)
reg2 <- function(d) {
  d$x2 <- d$x ^ 3
  lm(y ~ x2, data = d)
}
config <- drake_config(my_plan)
vis_drake_graph(config, group = "status", clusters = c("imported", "up to date"))

cluster

visNetwork's clustering is glitchy (ref: datastorm-open/visNetwork#254), so I implemented drake's own custom grouping.

Related GitHub issues

Checklist

  • I have read drake's code of conduct, and I agree to follow its rules.
  • I have read the guidelines for contributing.
  • I have listed any substantial changes in the development news.
  • I have added testthat unit tests to tests/testthat to confirm that any new features or functionality work correctly.
  • I have tested this pull request locally with devtools::check()
  • This pull request is ready for review.
  • I think this pull request is ready to merge.

@codecov-io
Copy link

codecov-io commented Jul 7, 2018

Codecov Report

Merging #463 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #463   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          66     66           
  Lines        5517   5564   +47     
=====================================
+ Hits         5517   5564   +47
Impacted Files Coverage Δ
R/shape.R 100% <ø> (ø) ⬆️
R/generate.R 100% <ø> (ø) ⬆️
R/deprecate.R 100% <100%> (ø) ⬆️
R/drake_graph_info_utils.R 100% <100%> (ø) ⬆️
R/vis_drake_graph.R 100% <100%> (ø) ⬆️
R/drake_graph_info.R 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a0e6cb...9ff96c2. Read the comment docs.

@wlandau wlandau merged commit 4014703 into master Jul 7, 2018
@wlandau wlandau deleted the groupnodes branch July 7, 2018 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants