Hey there, I ran into the same issue and couldn't identify the cause in a timely manner so I decided on an interim solution of converting the dm_draw output to svg and printing in the viewer. I called this function dm_draw_svg. Please see the following (note: you'll need to install DiagrammeRsvg)
library(dm)
dm_draw_svg = function(dm,...) {
if (!requireNamespace("DiagrammeRsvg", quietly = TRUE)) {
stop(
"Package \"DiagrammeRsvg\" must be installed to use this function.",
call. = FALSE
)
}
dm::dm_draw(dm = dm, ...) %>%
DiagrammeRsvg::export_svg() %>%
htmltools::HTML() %>%
htmltools::html_print()
}
df1 <- data.frame(x = letters[range(1:10)], y = sample(seq(1, 10)))
df2 <- data.frame(x = letters[range(1:10)], y = sample(seq(1, 10)))
dm <- dm(df1, df2)
dm.pks <- dm %>%
dm_add_pk(df1, x) %>%
dm_add_pk(df2, x)
dm.all.keys <- dm.pks %>%
dm_add_fk(df1, x, df2)
dm.all.keys %>%
dm_draw_svg()