Skip to content

Commit

Permalink
fixed docstrings / readme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cecoeco committed Jul 29, 2024
1 parent 6720a2f commit cd27d7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@ xlsx_df::DataFrame = DataFrame(XLSX.readtable(xlsx_path, sheetname))
println(xlsx_df)
```

The updated `DataFrames` either it be from a `.csv`, `.html`, `.json`, or `.xlsx` can be loaded into the `flow_diagram` function to create the `FlowDiagram` object which can be plotted using the `Base.show`, and `Base.Multimedia.display` function. The `Base.Multimedia.display` defaults to plotting the `FlowDiagram` as a `SVG` and uses the Julia plotting plane if using VSCode. The format that `Base.show` returns is depended on the mime type represented as `Mime` in Julia. `Base.show` can use an mime type that Graphviz supports through the `Graphviz_jll` binary. The `text/vnd.graphviz` and `text/plain` mimes prints the `.gv` to `IO`:

```julia
using PRISMA: FlowDiagram, flow_diagram

fd::FlowDiagram = flow_diagram()

show(stdout, "text/vnd.graphviz", fd)
show(stdout, "text/plain", fd)
show(stdout, "application/pdf", fd)
show(stdout, "image/png", fd)
show(stdout, "image/svg+xml", fd)

display(fd)
```

The `FlowDiagram` can be saved as any format support by `Graphviz_jll` using the `flow_diagram_save` the only catch is the file path should end with the extension of the desired format:

```julia
Expand Down Expand Up @@ -209,4 +193,4 @@ println(clist_df)
> Bouchet-Valat, M., & Kamiński, B. (2023). DataFrames.jl: Flexible and Fast Tabular Data in Julia. Journal of Statistical Software, 107(4), 1–32. https://doi.org/10.18637/jss.v107.i04
> Page M J, McKenzie J E, Bossuyt P M, Boutron I, Hoffmann T C, Mulrow C D et al. (2021). The PRISMA 2020 statement: An updated guideline for reporting systematic reviews. Systematic Reviews, 10(1), 89. https://doi.org/10.1186/s13643-021-01626-4
> Page M J, McKenzie J E, Bossuyt P M, Boutron I, Hoffmann T C, Mulrow C D et al. (2021). The PRISMA 2020 statement: An updated guideline for reporting systematic reviews. Systematic Reviews, 10(1), 89. https://doi.org/10.1186/s13643-021-01626-4
19 changes: 7 additions & 12 deletions src/PRISMA.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
"""
# PRISMA.jl
Julia package for generating checklists and flow diagrams based on the [the **P**referred **R**eporting **I**tems for **S**ystematic **R**eviews and **M**eta-**A**nalyses (PRISMA) statement (Page et al., 2021).](https://doi.org/10.1186/s13643-021-01626-4)
Julia package for generating checklists and flow diagrams based on the [2020 **P**referred **R**eporting **I**tems for **S**ystematic **R**eviews and **M**eta-**A**nalyses (PRISMA) statement (Page et al., 2021).](https://doi.org/10.1186/s13643-021-01626-4)
## Functions
- `checklist_df`: returns an imcomplete PRISMA checklist as a `DataFrame`
- `checklist`: returns a completed PRISMA checklist as a `Checklist`
- `flow_diagram_df`: returns an imcomplete PRISMA flowchart as a `DataFrame`
- `flow_diagram`: returns a completed PRISMA flowchart as a `FlowDiagram`
- `flow_diagram_save`: saves a completed PRISMA flowchart as a `FlowDiagram`
- `Base.show`: uses an `IO` to print a `FlowDiagram`
- `Base.Multimedia.display`: displays or plots a `FlowDiagram`
- `checklist_df`: returns an empty PRISMA checklist as the type `DataFrame`
- `checklist`: returns a completed PRISMA checklist as the type `Checklist`
- `flow_diagram_df`: returns the `DataFrame` that is used to create the flow diagram
- `flow_diagram`: returns a completed PRISMA flow diagram as the type `FlowDiagram`
- `flow_diagram_save`: saves a `FlowDiagram` to any file format supported by `Graphviz_jll`
## Types
Expand All @@ -21,19 +19,16 @@ Julia package for generating checklists and flow diagrams based on the [the **P*
"""
module PRISMA

using DataFrames: DataFrame, rename!, nrow, groupby
using DataFrames: DataFrame, GroupedDataFrame, rename!, nrow, groupby
using DataStructures: LittleDict
using Graphviz_jll: neato
using LinearAlgebra: norm, dot
using Poppler_jll: pdfinfo, pdftotext
using Statistics: mean
using Transformers: encode, @hgf_str

import Base.show, Base.Multimedia.display

export checklist_df, checklist, Checklist
export flow_diagram_df, flow_diagram, FlowDiagram, flow_diagram_save
export show, display

include("checklist.jl")
include("flow_diagram.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/flow_diagram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function flow_diagram(
shape=box,
style="filled,$border_style",
fixedsize="true",
fillcolor="$box_color",
fillcolor="#aaffff",
penwidth="$(borders ? border_width : 0)",
color="$border_color",
fontname="$font",
Expand Down

0 comments on commit cd27d7c

Please sign in to comment.