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

process_map and render=FALSE ignores layout specification #27

Open
kkmann opened this issue Jun 30, 2020 · 2 comments
Open

process_map and render=FALSE ignores layout specification #27

kkmann opened this issue Jun 30, 2020 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kkmann
Copy link

kkmann commented Jun 30, 2020

Hey,

I bumped into this while trying to export my maps to pdf via 'export_graph'. It works fine but ignores custom layout specifications.

@fmannhardt
Copy link
Member

fmannhardt commented Jul 3, 2020

I assume you are taking about the parameters generated with layout_pm. Indeed, this is a limitation as we are unable to set the relevant DOT attributes via the DiagrammeR library if the map is not rendered staight away, which I assume is what you need to do for the export? A reproducible example would be good to confirm this.

I already created an issue upstream here:
rich-iannone/DiagrammeR#360

For now, there is little we can do about this (except patching DiagrammeR, which I would like to avoid). We should definitely document this, but I had hoped that DiagrammeR would be updated.

You may have some success by manually applying our workaround before passing it into the export function:

	  	# hack to add 'weight' attribute to the graph
		graph$edges_df %>%
			mutate(len = weight, decorate = constraint) -> graph$edges_df

		graph %>% render_graph() -> graph

		graph$x$diagram %>%
			stringr::str_replace_all("len", "weight") %>%
			stringr::str_replace_all("decorate", "constraint") -> graph$x$diagram

@kkmann
Copy link
Author

kkmann commented Jul 3, 2020

Yes, exactly, makes it a bit tricky to produce high quality pdf graphs for publications. Thanks for raising that with DiagrammR!

@fmannhardt fmannhardt added bug Something isn't working help wanted Extra attention is needed labels Oct 5, 2020
@fmannhardt fmannhardt self-assigned this Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants