prisma-flowdiagram / PRISMA2020

Produce PRISMA-2020 compliant flow diagrams
https://estech.shinyapps.io/prisma_flowdiagram_latest/
Other
145 stars 71 forks source link

The "Identification" side label is cut off when exporting the flowchart. #50

Closed Cristrinaranjus closed 1 year ago

Cristrinaranjus commented 1 year ago

Describe the bug I wanted to document the process of a systematic review with your Shiny application, which I find particularly useful for automating processes. When I finish it and click on export, in all possible formats the side label "identification" appears as cut off - it appears "entification", "ntification"... And the words go out of the blue bubble.

Expected behavior I would expect to get a flowchart graphic in which the word "Identification" is not cut off.

Screenshots I attach one of the flowchart examples with the problem I describe. prisma

Desktop (please complete the following information):

Thanks in advance and congratulations for such great work!! @hammady @chriscpritchard @chapb @mcguinlu

chapb commented 1 year ago

Hmm, that's strange! It seems like the "Screening" bubble has somehow been extended such that it overlaps with the "Identification" bubble, and cuts off the first few letters.

My guess is that the screening bubble height is derived from the total height of the section (from the top of "Records Screened", to the bottom of "Reports excluded"). As you have so many exclusion reasons, it's quite tall. But for some reason, it's not being re-positioned such that it starts at the bottom of the exclusion block.

I'm not one of the original programmers, but I can see if I can find a fix! Any way you could provide the input data so I can re-create the issue on my end, and evaluate the patch?

chapb commented 1 year ago

I can reproduce the issue using the following code, but I haven't been able to get a fix based on my understanding of how the spacing is calculated.

# Get PRISMA2020 PRISMA template .csv from the package. 
path_PRISMA_2020_template <- system.file("extdata", "PRISMA.csv", package = "PRISMA2020")
prisma_data           <- readr::read_csv(path_PRISMA_2020_template)

# Add 15 lines to 'dbr_excluded' 
prisma_data[23, 'n'] <- "R1; R2; R3; R4; R5; R6; R7; R8; R9; R10; R11; R12; R13; R14; R15"

# Prepare template (make list) for PRISMA_flowdiagram().
prisma_data_list <- PRISMA2020::PRISMA_data(data = prisma_data)

# Make PRISMA.
PRISMA2020::PRISMA_flowdiagram(data        = prisma_data_list, 
                                             interactive = FALSE, 
                                             previous    = FALSE,
                                             other       = FALSE)
chriscpritchard commented 1 year ago

Sorry for the delay in working on this. I've been able to change the way the position is calculated (mean of the top and bottom, of the relevent boxes, rather than mean of the middle, in PR #51

if @Cristrinaranjus or @chapb (or anyone else!) could test that would be amazing - it's deployed to: https://prismaflow-test.shinyapps.io/PRISMA_flowdiagram/