adayim / consort

Create CONSORT diagrams for clinical studies.
Other
28 stars 4 forks source link

Spline options in grViz-plotting #23

Closed statpunx closed 1 month ago

statpunx commented 2 months ago

Dear Alim,

while using the "plot(g, grViz = T)" option (with a fairly big diagram with 4 arms) the connections are partly displayed as curved lines. Is there a way to implement spline options or does this require building a GraphViz object from scratch? See the attached picture for reference.

Unbenannt

adayim commented 2 months ago

Hi,

I've tried to measure the text inside the box and calculated the minlen, but it's not ideal. I've updated the package with options to avoid overlap and make sure the lines are straight with splines=ortho, overlap=prism option. Thanks for bringing up the spline option.

Alternatively, you can use cat(build_grviz(g), file = "consort.gv") to save the grViz and tweak it. I would prefer to improve this package and avoid manual editing if possible.

Can you try out the development version on GitHub and let me know if it solved your problem? Thank you very much.

Best, Alimu

statpunx commented 2 months ago

Hi Alimu,

thank you so much for the quick answer and help! I ran my code again and the changes you made definetly improved things, no more curved lines!

Screenshot 2024-05-29 084318

Is there an option to adjust the scaling in this new version, so that the arms are closer to each other? I tried to find it in the development versions code, but since I'm not that familiar with GraphViz and your functions, I couldn't find anything. I can provide you with sample data to replicate my problem if that makes it easier for you, just let me know :)

All the best, Thomas

adayim commented 2 months ago

Dear Thomas,

Thank you for trying this out. It looks like it has improved, but maybe too much. Can you share your data with me so I can test it? You can email it to me. Thanks.

Best, Alimu

statpunx commented 2 months ago

Dear Alimu,

I'll send you a mail shortly!

Best, Thomas

adayim commented 1 month ago

I think I have fixed this issue now and you can try it out.