bruigtp / flowchart

flowchart is an R package for drawing participant flow diagrams directly from a dataframe using tidyverse.
https://bruigtp.github.io/flowchart/
Other
36 stars 1 forks source link

Add an option to param arrow_ends in fc_draw() #4

Closed ottvahtrik closed 3 weeks ago

ottvahtrik commented 4 weeks ago

Would it be possible to add an option "none" (or something similar) to param arrow_ends in fc_draw() if one doesn't want to have any arrow ends?

pasahe commented 3 weeks ago

Dear @ottvahtrik,

Thanks for the post. The parameters available to customize the arrow are imported from the arrow() function in the grid package. It's true that this function has no direct option to specify to draw an arrow without an end, but you could easily achieve this by setting arrow_length = unit(0.0, "inches"). For example, the following code will draw a filtered flowchart with no arrow end:

safo |> 
    as_fc(label = "Patients assessed for eligibility") |> 
    fc_filter(!is.na(group), label = "Randomized", show_exc = TRUE) |> 
    fc_draw(arrow_length = unit(0.0, "inches"))

I hope this solves your problem.

ottvahtrik commented 3 weeks ago

Ah thank you, that works perfectly!