shukdevdatta123 commited on
Commit
f5618d5
·
verified ·
1 Parent(s): 5143597

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -43
app.py CHANGED
@@ -33,19 +33,19 @@ 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 with clean and centered layout
37
  meta_analysis_section = ''
38
  if included_meta is not None:
39
  meta_analysis_section = f'''
40
- <line x1="400" y1="580" x2="400" y2="620" class="arrow" />
41
- <rect x="300" y="620" width="200" height="80" class="box" />
42
- <text x="400" y="650" class="box-title">Meta-Analysis</text>
43
- <text x="400" y="670">Studies included in quantitative</text>
44
- <text x="400" y="685">synthesis (n = {included_meta})</text>
45
  '''
46
 
47
  svg_content = f'''
48
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800" width="700" height="700">
49
  <style>
50
  .box {{
51
  fill: #f9f9f9;
@@ -80,59 +80,59 @@ def generate_prisma_flow_chart(records_db, records_other, duplicates, excluded_s
80
 
81
  <!-- Identification Section -->
82
  <rect x="250" y="60" width="300" height="80" class="box" />
83
- <text x="400" y="100" class="box-title">Identification</text>
84
- <text x="400" y="120">Records identified through</text>
85
- <text x="400" y="135">database searching (n = {records_db})</text>
86
 
87
  <rect x="550" y="60" width="200" height="80" class="box" />
88
- <text x="650" y="100" class="box-title">Additional</text>
89
- <text x="650" y="120">Other sources</text>
90
- <text x="650" y="135">(n = {records_other})</text>
91
 
92
  <!-- Arrows -->
93
- <line x1="400" y1="140" x2="400" y2="180" class="arrow" />
94
- <line x1="650" y1="140" x2="650" y2="160" class="arrow" />
95
- <line x1="650" y1="160" x2="400" y2="160" class="arrow" />
96
 
97
  <!-- Screening Section -->
98
- <rect x="250" y="180" width="300" height="80" class="box" />
99
- <text x="400" y="220" class="box-title">Screening</text>
100
- <text x="400" y="240">Records after duplicates removed</text>
101
- <text x="400" y="255">(n = {records_after_duplicates})</text>
102
 
103
- <line x1="400" y1="260" x2="400" y2="300" class="arrow" />
104
 
105
  <!-- Title/Abstract Screening Section -->
106
- <rect x="250" y="300" width="300" height="80" class="box" />
107
- <text x="400" y="340" class="box-title">Title/Abstract Screening</text>
108
- <text x="400" y="360">Records screened</text>
109
- <text x="400" y="375">(n = {records_after_duplicates})</text>
110
 
111
- <rect x="550" y="300" width="200" height="80" class="box" />
112
- <text x="650" y="340">Records excluded</text>
113
- <text x="650" y="355">(n = {excluded_screening})</text>
114
 
115
- <line x1="400" y1="380" x2="400" y2="420" class="arrow" />
116
- <line x1="500" y1="340" x2="550" y2="340" class="arrow" />
117
 
118
  <!-- Eligibility Section -->
119
- <rect x="250" y="420" width="300" height="80" class="box" />
120
- <text x="400" y="460" class="box-title">Eligibility</text>
121
- <text x="400" y="480">Full-text articles assessed for</text>
122
- <text x="400" y="495">eligibility (n = {fulltext_assessed})</text>
123
 
124
- <rect x="550" y="420" width="200" height="80" class="box" />
125
- <text x="650" y="460">Full-text articles excluded,</text>
126
- <text x="650" y="475">with reasons (n = {excluded_fulltext})</text>
127
 
128
- <line x1="400" y1="500" x2="400" y2="540" class="arrow" />
129
- <line x1="500" y1="460" x2="550" y2="460" class="arrow" />
130
 
131
  <!-- Included Section -->
132
- <rect x="250" y="540" width="300" height="80" class="box" />
133
- <text x="400" y="580" class="box-title">Included</text>
134
- <text x="400" y="600">Studies included in qualitative</text>
135
- <text x="400" y="615">synthesis (n = {included_studies})</text>
136
 
137
  <!-- Optional Meta-Analysis Box -->
138
  {meta_analysis_section}
 
33
 
34
  records_after_duplicates = records_db + records_other - duplicates
35
 
36
+ # Create SVG content for PRISMA flow chart with improved arrows, spacing, and centered text
37
  meta_analysis_section = ''
38
  if included_meta is not None:
39
  meta_analysis_section = f'''
40
+ <line x1="400" y1="650" x2="400" y2="690" class="arrow" />
41
+ <rect x="250" y="690" width="300" height="80" class="box" />
42
+ <text x="400" y="710" class="box-title">Meta-Analysis</text>
43
+ <text x="400" y="730">Studies included in quantitative</text>
44
+ <text x="400" y="750">synthesis (n = {included_meta})</text>
45
  '''
46
 
47
  svg_content = f'''
48
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 900" width="700" height="800">
49
  <style>
50
  .box {{
51
  fill: #f9f9f9;
 
80
 
81
  <!-- Identification Section -->
82
  <rect x="250" y="60" width="300" height="80" class="box" />
83
+ <text x="400" y="90" class="box-title">Identification</text>
84
+ <text x="400" y="110">Records identified through</text>
85
+ <text x="400" y="125">database searching (n = {records_db})</text>
86
 
87
  <rect x="550" y="60" width="200" height="80" class="box" />
88
+ <text x="650" y="90" class="box-title">Additional</text>
89
+ <text x="650" y="110">Other sources</text>
90
+ <text x="650" y="125">(n = {records_other})</text>
91
 
92
  <!-- Arrows -->
93
+ <line x1="400" y1="140" x2="400" y2="190" class="arrow" />
94
+ <line x1="650" y1="140" x2="650" y2="165" class="arrow" />
95
+ <line x1="650" y1="165" x2="400" y2="165" class="arrow" />
96
 
97
  <!-- Screening Section -->
98
+ <rect x="250" y="210" width="300" height="80" class="box" />
99
+ <text x="400" y="240" class="box-title">Screening</text>
100
+ <text x="400" y="260">Records after duplicates removed</text>
101
+ <text x="400" y="275">(n = {records_after_duplicates})</text>
102
 
103
+ <line x1="400" y1="290" x2="400" y2="340" class="arrow" />
104
 
105
  <!-- Title/Abstract Screening Section -->
106
+ <rect x="250" y="360" width="300" height="80" class="box" />
107
+ <text x="400" y="390" class="box-title">Title/Abstract Screening</text>
108
+ <text x="400" y="410">Records screened</text>
109
+ <text x="400" y="425">(n = {records_after_duplicates})</text>
110
 
111
+ <rect x="550" y="360" width="200" height="80" class="box" />
112
+ <text x="650" y="390">Records excluded</text>
113
+ <text x="650" y="410">(n = {excluded_screening})</text>
114
 
115
+ <line x1="400" y1="440" x2="400" y2="490" class="arrow" />
116
+ <line x1="550" y1="400" x2="600" y2="400" class="arrow" />
117
 
118
  <!-- Eligibility Section -->
119
+ <rect x="250" y="510" width="300" height="80" class="box" />
120
+ <text x="400" y="540" class="box-title">Eligibility</text>
121
+ <text x="400" y="560">Full-text articles assessed for</text>
122
+ <text x="400" y="575">eligibility (n = {fulltext_assessed})</text>
123
 
124
+ <rect x="550" y="510" width="200" height="80" class="box" />
125
+ <text x="650" y="540">Full-text articles excluded,</text>
126
+ <text x="650" y="555">with reasons (n = {excluded_fulltext})</text>
127
 
128
+ <line x1="400" y1="590" x2="400" y2="640" class="arrow" />
129
+ <line x1="550" y1="550" x2="600" y2="550" class="arrow" />
130
 
131
  <!-- Included Section -->
132
+ <rect x="250" y="660" width="300" height="80" class="box" />
133
+ <text x="400" y="690" class="box-title">Included</text>
134
+ <text x="400" y="710">Studies included in qualitative</text>
135
+ <text x="400" y="725">synthesis (n = {included_studies})</text>
136
 
137
  <!-- Optional Meta-Analysis Box -->
138
  {meta_analysis_section}