shukdevdatta123 commited on
Commit
d55ebbb
·
verified ·
1 Parent(s): 9433998

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -45
app.py CHANGED
@@ -33,15 +33,15 @@ def generate_prisma_flow_chart(records_db, records_other, duplicates, excluded_s
33
 
34
  records_after_duplicates = records_db + records_other - duplicates
35
 
36
- # Create SVG content for PRISMA flow chart
37
  meta_analysis_section = ''
38
  if included_meta is not None:
39
  meta_analysis_section = f'''
40
  <line x1="400" y1="490" x2="400" y2="530" class="arrow" />
41
- <rect x="250" y="530" width="300" height="60" class="box" />
42
- <text x="400" y="550" class="box-title">Meta-Analysis</text>
43
- <text x="400" y="575">Studies included in quantitative synthesis</text>
44
- <text x="400" y="590">(n = {included_meta})</text>
45
  '''
46
 
47
  svg_content = f'''
@@ -74,66 +74,66 @@ def generate_prisma_flow_chart(records_db, records_other, duplicates, excluded_s
74
  </defs>
75
 
76
  <!-- Identification Section -->
77
- <rect x="250" y="30" width="300" height="60" class="box" />
78
- <text x="400" y="50" class="box-title">Identification</text>
79
- <text x="400" y="75">Records identified through database searching</text>
80
- <text x="400" y="90">(n = {records_db})</text>
81
 
82
- <rect x="600" y="30" width="150" height="60" class="box" />
83
- <text x="675" y="50" class="box-title">Additional</text>
84
- <text x="675" y="75">Other sources</text>
85
- <text x="675" y="90">(n = {records_other})</text>
86
 
87
  <!-- Arrows -->
88
- <line x1="400" y1="90" x2="400" y2="130" class="arrow" />
89
- <line x1="675" y1="90" x2="675" y2="110" class="arrow" />
90
- <line x1="675" y1="110" x2="400" y2="110" class="arrow" />
91
 
92
  <!-- Screening Section -->
93
- <rect x="250" y="130" width="300" height="60" class="box" />
94
- <text x="400" y="150" class="box-title">Screening</text>
95
- <text x="400" y="175">Records after duplicates removed</text>
96
- <text x="400" y="190">(n = {records_after_duplicates})</text>
97
 
98
- <line x1="400" y1="190" x2="400" y2="230" class="arrow" />
99
 
100
- <rect x="250" y="230" width="300" height="60" class="box" />
101
- <text x="400" y="250" class="box-title">Title/Abstract Screening</text>
102
- <text x="400" y="275">Records screened</text>
103
- <text x="400" y="290">(n = {records_after_duplicates})</text>
104
 
105
- <rect x="600" y="230" width="150" height="60" class="box" />
106
- <text x="675" y="255">Records excluded</text>
107
- <text x="675" y="275">(n = {excluded_screening})</text>
108
 
109
- <line x1="400" y1="290" x2="400" y2="330" class="arrow" />
110
- <line x1="550" y1="260" x2="600" y2="260" class="arrow" />
111
 
112
  <!-- Eligibility Section -->
113
- <rect x="250" y="330" width="300" height="60" class="box" />
114
- <text x="400" y="350" class="box-title">Eligibility</text>
115
- <text x="400" y="375">Full-text articles assessed for eligibility</text>
116
- <text x="400" y="390">(n = {fulltext_assessed})</text>
117
 
118
- <rect x="600" y="330" width="150" height="60" class="box" />
119
- <text x="675" y="350">Full-text articles</text>
120
- <text x="675" y="370">excluded, with reasons</text>
121
- <text x="675" y="390">(n = {excluded_fulltext})</text>
122
 
123
- <line x1="400" y1="390" x2="400" y2="430" class="arrow" />
124
- <line x1="550" y1="360" x2="600" y2="360" class="arrow" />
125
 
126
  <!-- Included Section -->
127
- <rect x="250" y="430" width="300" height="60" class="box" />
128
- <text x="400" y="450" class="box-title">Included</text>
129
- <text x="400" y="475">Studies included in qualitative synthesis</text>
130
- <text x="400" y="490">(n = {included_studies})</text>
131
 
132
  <!-- Optional Meta-Analysis Box -->
133
  {meta_analysis_section}
134
 
135
  <!-- PRISMA Title -->
136
- <text x="150" y="25" style="font-size: 18px; font-weight: bold; text-anchor: start;">PRISMA Flow Diagram</text>
137
  </svg>
138
  '''
139
 
 
33
 
34
  records_after_duplicates = records_db + records_other - duplicates
35
 
36
+ # Create SVG content for PRISMA flow chart with centered layout and larger boxes
37
  meta_analysis_section = ''
38
  if included_meta is not None:
39
  meta_analysis_section = f'''
40
  <line x1="400" y1="490" x2="400" y2="530" class="arrow" />
41
+ <rect x="250" y="530" width="300" height="80" class="box" />
42
+ <text x="400" y="570" class="box-title">Meta-Analysis</text>
43
+ <text x="400" y="595">Studies included in quantitative synthesis</text>
44
+ <text x="400" y="610">(n = {included_meta})</text>
45
  '''
46
 
47
  svg_content = f'''
 
74
  </defs>
75
 
76
  <!-- Identification Section -->
77
+ <rect x="200" y="30" width="400" height="80" class="box" />
78
+ <text x="400" y="70" class="box-title">Identification</text>
79
+ <text x="400" y="95">Records identified through database searching</text>
80
+ <text x="400" y="110">(n = {records_db})</text>
81
 
82
+ <rect x="600" y="30" width="200" height="80" class="box" />
83
+ <text x="700" y="70" class="box-title">Additional</text>
84
+ <text x="700" y="95">Other sources</text>
85
+ <text x="700" y="110">(n = {records_other})</text>
86
 
87
  <!-- Arrows -->
88
+ <line x1="400" y1="110" x2="400" y2="150" class="arrow" />
89
+ <line x1="700" y1="110" x2="700" y2="130" class="arrow" />
90
+ <line x1="700" y1="130" x2="400" y2="130" class="arrow" />
91
 
92
  <!-- Screening Section -->
93
+ <rect x="200" y="150" width="400" height="80" class="box" />
94
+ <text x="400" y="190" class="box-title">Screening</text>
95
+ <text x="400" y="215">Records after duplicates removed</text>
96
+ <text x="400" y="230">(n = {records_after_duplicates})</text>
97
 
98
+ <line x1="400" y1="230" x2="400" y2="270" class="arrow" />
99
 
100
+ <rect x="200" y="270" width="400" height="80" class="box" />
101
+ <text x="400" y="310" class="box-title">Title/Abstract Screening</text>
102
+ <text x="400" y="335">Records screened</text>
103
+ <text x="400" y="350">(n = {records_after_duplicates})</text>
104
 
105
+ <rect x="600" y="270" width="200" height="80" class="box" />
106
+ <text x="700" y="310">Records excluded</text>
107
+ <text x="700" y="325">(n = {excluded_screening})</text>
108
 
109
+ <line x1="400" y1="350" x2="400" y2="390" class="arrow" />
110
+ <line x1="500" y1="310" x2="600" y2="310" class="arrow" />
111
 
112
  <!-- Eligibility Section -->
113
+ <rect x="200" y="390" width="400" height="80" class="box" />
114
+ <text x="400" y="430" class="box-title">Eligibility</text>
115
+ <text x="400" y="455">Full-text articles assessed for eligibility</text>
116
+ <text x="400" y="470">(n = {fulltext_assessed})</text>
117
 
118
+ <rect x="600" y="390" width="200" height="80" class="box" />
119
+ <text x="700" y="430">Full-text articles</text>
120
+ <text x="700" y="445">excluded, with reasons</text>
121
+ <text x="700" y="460">(n = {excluded_fulltext})</text>
122
 
123
+ <line x1="400" y1="470" x2="400" y2="510" class="arrow" />
124
+ <line x1="500" y1="430" x2="600" y2="430" class="arrow" />
125
 
126
  <!-- Included Section -->
127
+ <rect x="200" y="510" width="400" height="80" class="box" />
128
+ <text x="400" y="550" class="box-title">Included</text>
129
+ <text x="400" y="575">Studies included in qualitative synthesis</text>
130
+ <text x="400" y="590">(n = {included_studies})</text>
131
 
132
  <!-- Optional Meta-Analysis Box -->
133
  {meta_analysis_section}
134
 
135
  <!-- PRISMA Title -->
136
+ <text x="400" y="10" style="font-size: 18px; font-weight: bold; text-anchor: middle;">PRISMA Flow Diagram</text>
137
  </svg>
138
  '''
139