Skip to content

Commit

Permalink
Merge branch 'master' into f-3-compound
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed May 3, 2020
2 parents 63d9e9a + b1a9bd6 commit 691a629
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/datamodelr-code.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ to_html_table <- function(x,
)
),
# rows
sapply(seq_len(nrow(x)), function(r) {
unique(sapply(seq_len(nrow(x)), function(r) {
html_tr(c(
# cells
sapply(cols, function(col_name) {
Expand All @@ -329,7 +329,7 @@ to_html_table <- function(x,
html_td(value, if (is.null(attr_td)) NULL else attr_td(col_name, x[r, ], value))
})
))
})
}))
))
}

Expand Down
97 changes: 97 additions & 0 deletions tests/testthat/out/nycflights13-multi-fk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions tests/testthat/test-draw-dm.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ test_that("output", {
"out/nycflights13.svg"
)

# Multi-fk (#37)
expect_known_output(
dm_nycflights13() %>%
dm_zoom_to(planes) %>%
dm_insert_zoomed("planes_copy") %>%
dm_draw() %>%
DiagrammeRsvg::export_svg() %>%
cli::cat_line(),
"out/nycflights13-multi-fk.svg"
)

expect_known_output(
dm_nycflights13() %>%
dm_add_pk(weather, c(origin, time_hour)) %>%
Expand Down

0 comments on commit 691a629

Please sign in to comment.