nataliaElv commited on
Commit
4cf7ecf
1 Parent(s): 0c6044d

Theme change

Browse files
Files changed (1) hide show
  1. app.py +9 -24
app.py CHANGED
@@ -92,22 +92,16 @@ def create_progress_bar(progress):
92
  color='rgb(67, 67, 67)'),
93
  showarrow=False, align='right'))
94
  # labeling the first percentage of each bar (x_axis)
95
- annotations.append(dict(xref='x', yref='y',
96
- x=xd[0] / 2, y=yd,
97
- text=str(xd[0]),
98
- font=dict(family='Arial', size=14,
99
- color='rgb(248, 248, 255)'),
100
- showarrow=False))
101
- # # labeling the first Likert scale (on the top)
102
- # if yd == y_data[-1]:
103
- # annotations.append(dict(xref='x', yref='paper',
104
- # x=xd[0] / 2, y=1.1,
105
- # text=top_labels[0],
106
- # font=dict(family='Arial', size=14,
107
- # color='rgb(67, 67, 67)'),
108
- # showarrow=False))
109
  space = xd[0]
110
  for i in range(1, len(xd)):
 
111
  # labeling the rest of percentages for each bar (x_axis)
112
  annotations.append(dict(xref='x', yref='y',
113
  x=space + (xd[i]/2), y=yd,
@@ -115,14 +109,6 @@ def create_progress_bar(progress):
115
  font=dict(family='Arial', size=14,
116
  color='rgb(248, 248, 255)'),
117
  showarrow=False))
118
- # # labeling the Likert scale
119
- # if yd == y_data[-1]:
120
- # annotations.append(dict(xref='x', yref='paper',
121
- # x=space + (xd[i]/2), y=1.1,
122
- # text=top_labels[i],
123
- # font=dict(family='Arial', size=14,
124
- # color='rgb(67, 67, 67)'),
125
- # showarrow=False))
126
  space += xd[i]
127
 
128
  fig.update_layout(annotations=annotations, height=80)
@@ -152,8 +138,7 @@ def create_piechart(user_annotations):
152
  title_text="User contributions to the total end dataset",
153
  height=500,
154
  margin=dict(l=10, r=10, t=50, b=10),
155
- paper_bgcolor="#F0F0F0", # Light gray background
156
- plot_bgcolor="#F0F0F0", # Light gray background
157
  )
158
 
159
  return fig
 
92
  color='rgb(67, 67, 67)'),
93
  showarrow=False, align='right'))
94
  # labeling the first percentage of each bar (x_axis)
95
+ if xd[0] > 0:
96
+ annotations.append(dict(xref='x', yref='y',
97
+ x=xd[0] / 2, y=yd,
98
+ text=str(xd[0]),
99
+ font=dict(family='Arial', size=14,
100
+ color='rgb(248, 248, 255)'),
101
+ showarrow=False))
 
 
 
 
 
 
 
102
  space = xd[0]
103
  for i in range(1, len(xd)):
104
+ if xd[i] > 0:
105
  # labeling the rest of percentages for each bar (x_axis)
106
  annotations.append(dict(xref='x', yref='y',
107
  x=space + (xd[i]/2), y=yd,
 
109
  font=dict(family='Arial', size=14,
110
  color='rgb(248, 248, 255)'),
111
  showarrow=False))
 
 
 
 
 
 
 
 
112
  space += xd[i]
113
 
114
  fig.update_layout(annotations=annotations, height=80)
 
138
  title_text="User contributions to the total end dataset",
139
  height=500,
140
  margin=dict(l=10, r=10, t=50, b=10),
141
+ template="ggplot2",
 
142
  )
143
 
144
  return fig