From d8aa017d9fe49b20ddf26cf5b467c38e95d0d750 Mon Sep 17 00:00:00 2001 From: webofceco Date: Thu, 8 Aug 2024 13:23:51 -0400 Subject: [PATCH] fixed widths --- CITATION.bib | 6 ------ README.md | 2 +- src/flow_diagram.jl | 32 ++++++++++++++++++-------------- 3 files changed, 19 insertions(+), 21 deletions(-) delete mode 100644 CITATION.bib diff --git a/CITATION.bib b/CITATION.bib deleted file mode 100644 index bb9f693..0000000 --- a/CITATION.bib +++ /dev/null @@ -1,6 +0,0 @@ -@software{PRISMA.jl, - author = {Ceco E. Maples}, - title = {PRISMA.jl}, - howpublished = {\url{https://github.com/cecoeco/PRISMA.jl}}, - year = {2024} -} \ No newline at end of file diff --git a/README.md b/README.md index 426b4eb..6a0950d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Julia package and [web application](https://prisma-jl.onrender.com) built with [ :arrow_down: **Installation:** use this command in the Julia REPL: `using Pkg; Pkg.add("PRISMA")` -:book: **Documentation:** Documentation Stable Documentation Dev +:book: **Documentation:** Documentation Stable Documentation Dev :books: **References:** diff --git a/src/flow_diagram.jl b/src/flow_diagram.jl index 6bf048d..0aef8be 100644 --- a/src/flow_diagram.jl +++ b/src/flow_diagram.jl @@ -125,7 +125,7 @@ Flow diagram type for PRISMA.jl end function wrap_text(string::AbstractString)::String - return replace(str_wrap(string; width=30), "\n" => "
") + return replace(str_wrap(string, width=33), "\n" => "
") end function group_labels(df::DataFrame)::DataFrame @@ -140,7 +140,7 @@ function group_labels(df::DataFrame)::DataFrame text::String = ismissing(row.result) ? "$(row.box_text)" : row.box_text result::String = ismissing(row.result) ? "" : "n = $(row.result)" - wrapped_text::String = row.box_num in [1, 2, 3, 4, 5, 6] ? text : wrap_text(text) + wrapped_text::String = row.box_num in TOP_BOXES || row.box_num in SIDE_BOXES ? text : wrap_text(text) wrapped_result::String = wrap_text(result) label::String = ismissing(row.result) ? wrapped_text : string(wrapped_text, "
", wrapped_result) @@ -156,20 +156,24 @@ function group_labels(df::DataFrame)::DataFrame return grouped_labels end +FLOW_DIAGRAM_TOP_MARGIN::Number = 1.4 + FLOW_DIAGRAM_ROW_01::Number = 15.5 -FLOW_DIAGRAM_ROW_02::Number = 14 -FLOW_DIAGRAM_ROW_03::Number = 12 -FLOW_DIAGRAM_ROW_04::Number = 10 -FLOW_DIAGRAM_ROW_05::Number = 08 -FLOW_DIAGRAM_ROW_06::Number = 06 -FLOW_DIAGRAM_ROW_07::Number = 04 +FLOW_DIAGRAM_ROW_02::Number = FLOW_DIAGRAM_ROW_01 - 1.2 +FLOW_DIAGRAM_ROW_03::Number = FLOW_DIAGRAM_ROW_02 - FLOW_DIAGRAM_TOP_MARGIN +FLOW_DIAGRAM_ROW_04::Number = FLOW_DIAGRAM_ROW_03 - FLOW_DIAGRAM_TOP_MARGIN +FLOW_DIAGRAM_ROW_05::Number = FLOW_DIAGRAM_ROW_04 - FLOW_DIAGRAM_TOP_MARGIN +FLOW_DIAGRAM_ROW_06::Number = FLOW_DIAGRAM_ROW_05 - FLOW_DIAGRAM_TOP_MARGIN +FLOW_DIAGRAM_ROW_07::Number = FLOW_DIAGRAM_ROW_06 - FLOW_DIAGRAM_TOP_MARGIN + +FLOW_DIAGRAM_LEFT_MARGIN::Number = 2.65 FLOW_DIAGRAM_COL_01::Number = 01 -FLOW_DIAGRAM_COL_02::Number = 04 -FLOW_DIAGRAM_COL_03::Number = 07 -FLOW_DIAGRAM_COL_04::Number = 10 -FLOW_DIAGRAM_COL_05::Number = 13 -FLOW_DIAGRAM_COL_06::Number = 16 +FLOW_DIAGRAM_COL_02::Number = FLOW_DIAGRAM_COL_01 + FLOW_DIAGRAM_LEFT_MARGIN +FLOW_DIAGRAM_COL_03::Number = FLOW_DIAGRAM_COL_02 + FLOW_DIAGRAM_LEFT_MARGIN +FLOW_DIAGRAM_COL_04::Number = FLOW_DIAGRAM_COL_03 + FLOW_DIAGRAM_LEFT_MARGIN +FLOW_DIAGRAM_COL_05::Number = FLOW_DIAGRAM_COL_04 + FLOW_DIAGRAM_LEFT_MARGIN +FLOW_DIAGRAM_COL_06::Number = FLOW_DIAGRAM_COL_05 + FLOW_DIAGRAM_LEFT_MARGIN const FLOW_DIAGRAM_POSITIONS::Dict{Number,@NamedTuple{x::Number, y::Number}} = Dict( 01.0 => ( @@ -372,7 +376,7 @@ function flow_diagram( border_color::AbstractString="black", font::AbstractString="Helvetica", font_color::AbstractString="black", - font_size::Union{AbstractString,Number}=12, + font_size::Union{AbstractString,Number}=10, arrow_head::AbstractString="normal", arrow_size::Union{AbstractString,Number}=1, arrow_color::AbstractString="black",