Skip to content

Commit

Permalink
Ensure file outputs show up in drake_ggraph()
Browse files Browse the repository at this point in the history
Also improve drake_ggraph() aesthetics.
  • Loading branch information
wlandau-lilly committed Mar 18, 2019
1 parent 0a1062e commit cab7b4d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
## Bug fixes

- In `drake` 7.0.0, if you run `make()` in interactive mode and respond to the menu prompt with an option other than `1` or `2`, targets will still build.
- Make sure file outputs show up in `drake_graph()`. The bug came from `append_output_file_nodes()`, a utility function of `drake_graph_info()`.

## New features

- Add a new `use_drake()` function to write the `make.R` and `_drake.R` files from the [main example](https://github.com/wlandau/drake-examples/tree/master/main). Does not write other supporting scripts.

## Enhancements

- Improve `drake_ggraph()`: hide node labels by default and render the arrows behind the nodes.
- Print an informative error message when the user supplies a `drake` plan to the `config` argument of a function.
- Improve `drake_ggraph()`
- Hide node labels by default and render the arrows behind the nodes.
- Print an informative error message when the user supplies a `drake` plan to the `config` argument of a function.
- By default, use gray arrows and a black-and-white background with no gridlines.


# Version 7.0.0
Expand Down
2 changes: 1 addition & 1 deletion R/utils-graphinfo.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ append_build_times <- function(config) {

append_output_file_nodes <- function(config) {
with(config, {
cols <- setdiff(colnames(nodes), c("id", "label", "level", "shape"))
cols <- setdiff(colnames(nodes), c("id", "label", "level", "shape", "type"))
for (target in intersect(names(file_out), nodes$id)) {
files <- intersect(file_out[[target]], nodes$id)
if (length(files)){
Expand Down
7 changes: 6 additions & 1 deletion R/vis-ggraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ render_drake_ggraph <- function(
ggplot2::scale_color_manual(values = colors) +
ggplot2::scale_shape_manual(values = shapes) +
ggplot2::ggtitle(main) +
ggplot2::labs(x = "", y = "")
ggplot2::labs(x = "", y = "") +
ggplot2::theme_bw() +
ggplot2::theme(
panel.grid.major = ggplot2::element_blank(),
panel.grid.minor = ggplot2::element_blank()
)
if (label_nodes) {
out <- out + ggraph::geom_node_text(ggplot2::aes(label = label))
}
Expand Down

0 comments on commit cab7b4d

Please sign in to comment.