forked from jblattgerste/sus-analysis-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helper.py
789 lines (709 loc) · 25.2 KB
/
Helper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
import base64
import copy
import random
from dataclasses import dataclass
# noinspection PyProtectedMember
from bs4 import UnicodeDammit
import pandas as pd
from dash import html, dcc
import io
from dash.dash_table.Format import Format, Scheme
import ChartLayouts
from Result import Result
from SUSDataset import SUSDataset
from SUSStud import SUSStud
import numpy as np
def parseDataFrameToSUSDataset(dataFrame, singleStudy=False):
"""Parses through DataFrame and creates and returns a list with SUSStuds from it."""
# Set with each individual study.
studySet = set(dataFrame['System'])
# Container for SUSStuds
SUSStudies = []
for singleStudy in studySet:
# All the Study results, which belong to the current singleStudy
resultsRawString = dataFrame.loc[dataFrame['System'] == singleStudy].values.tolist()
# remove first and last element, as they are the index and System-String in the dataframe
for result in resultsRawString:
result.pop()
# Container for the current Results
results = []
# Create result objects and add them to container.
for idx, result in enumerate(resultsRawString):
results.append(Result(result, idx))
# Create SUSStuds-instances and append to list
SUSStudies.append(SUSStud(results, singleStudy))
return SUSStudies
def decodeContentToCSV(contents):
content_type, csvData = contents.split(',')
decoded = base64.b64decode(csvData)
# Tries to encoding format of uploaded file
suggestion = UnicodeDammit(decoded)
csvData = pd.read_csv(io.StringIO(decoded.decode(suggestion.original_encoding, errors="strict")), sep=';')
return csvData
def stringListToFloat(stringList):
"""Converts a list with strings into a list with floats."""
return [float(singleFloatResult) for singleFloatResult in stringList]
def downloadChartContentSingleStudy(fig):
fig = copy.copy(fig)
fig.update_layout(
paper_bgcolor='rgba(255,255,255,255)',
font=dict(
size=20),
xaxis=dict(title_font_size=20),
xaxis3=dict(title_font_size=20),
yaxis3=dict(title_font_size=20),
xaxis2=dict(
title_font_size=20,
),
yaxis2=dict(
title_font_size=20,
),
)
img_bytes = fig.to_image(format="png", width=1530, height=1048)
encoding = base64.b64encode(img_bytes).decode()
img_b64 = "data:image/png;base64," + encoding
downloadChart = [
html.A(html.Button('Download this chart', className='button1'), href=img_b64, download='plot')
]
return downloadChart
def downloadChartContent(downloadType, fig, customWidth=None, customHeight=None, customFontSize=None):
if downloadType == 'customSize':
fig.update_layout(
paper_bgcolor='rgba(255,255,255,255)',
font=dict(
size=customFontSize)
)
img_bytes = fig.to_image(format="png", width=customWidth,
height=customHeight)
else:
fig.update_layout(
paper_bgcolor='rgba(255,255,255,255)',
font=dict(
size=plotSettings[downloadType].fontSize)
)
img_bytes = fig.to_image(format="png", width=plotSettings[downloadType].width,
height=plotSettings[downloadType].height)
return img_bytes
def downloadChartContent_orientation(fig, download_format, orientation):
fig = copy.copy(fig)
fig.update_layout(
paper_bgcolor='rgba(255,255,255,255)',
)
if orientation == 'vertical':
if download_format == "narrowPlot":
img_bytes = fig.to_image(format="png", width=1300, height=500)
elif download_format == "dynamicPlot":
img_bytes = fig.to_image(format="png")
elif download_format == "widePlot":
img_bytes = fig.to_image(format="png", width=1600, height=500)
else:
img_bytes = fig.to_image(format="png", width=1300, height=500)
else:
if download_format == "singleColumn":
img_bytes = fig.to_image(format="png", width=900, height=500)
elif download_format == "doubleColumn":
img_bytes = fig.to_image(format="png", width=900, height=700)
elif download_format == "wideFigurePresentationStyle":
img_bytes = fig.to_image(format="png", width=900, height=400)
else:
img_bytes = fig.to_image(format="png", width=900, height=700)
encoding = base64.b64encode(img_bytes).decode()
img_b64 = "data:image/png;base64," + encoding
downloadChart = [
html.A(html.Button('Download this chart', className='button1'), href=img_b64, download='plot')
]
return downloadChart
def checkUploadFile(csvData, isSingleStudy):
if isSingleStudy:
if 'System' not in csvData:
csvData['System'] = 'System'
if len(csvData['System'].unique()) != 1:
raise WrongUploadFileException(
'This csv-file contained multiple systems. Try a csv file with only one system or use the multi study upload.')
columns = csvData.columns.values
if len(columns) != 11:
raise WrongUploadFileException('Wrong amount of columns in CSV-File')
if True in np.nditer(csvData.isnull()):
raise WrongUploadFileException('There is a NaN value in the dataframe')
else:
if 'System' not in csvData:
raise WrongUploadFileException('There must be System column in the CSV-File')
columns = csvData.columns.values
if len(columns) != 11:
raise WrongUploadFileException('Wrong amount of columns in CSV-File')
if True in np.nditer(csvData.isnull()):
raise WrongUploadFileException('There is a NaN value in the dataframe')
return csvData
class WrongUploadFileException(Exception):
pass
scaleInfoTexts = {
'adjectiveScale': html.P(children=[
'The adjective scale contextualizes SUS study scores on descriptive adjectives ranging from \"Worst Imaginable\" to \"Best Imaginable\". It is based on ',
html.A('Sauro et al. 2018', href='https://measuringu.com/interpret-sus-score', target="_blank"),
'\'s interpretation of the primary data by ',
html.A('Bangor et al. 2009',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=BD7BLDgAAAAJ&citation_for_view=BD7BLDgAAAAJ:d1gkVwhDpl0C',
target="_blank"),
'.'
]),
'gradeScale': html.P(
children=[
'The grade scale contextualizes SUS study scores on school grades ranging from \"F\" to \"A\". This scale is based on the data from ',
html.A('Sauro et al. 2016',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=rmiLIsYAAAAJ&citation_for_view=rmiLIsYAAAAJ:Mojj43d5GZwC',
target="_blank"),
'. Note: There is multiple interpretations of the grade scale, e.g. the one proposed by ',
html.A('Bangor et al. 2009',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=BD7BLDgAAAAJ&citation_for_view=BD7BLDgAAAAJ:d1gkVwhDpl0C',
target="_blank"),
' uses different ranges.'
]),
'quartileScale': html.P(
children=['The quartile scale was developed by splitting a dataset of 3500 SUS scores into four quartiles (',
html.A('Bangor et al. 2009',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=BD7BLDgAAAAJ&citation_for_view=BD7BLDgAAAAJ:d1gkVwhDpl0C',
target="_blank"),
'). It can be used to contextualize and compare SUS study scores against the scores in the dataset.']),
'acceptabilityScale': html.P(children=[
'The acceptability scale contextualizes SUS study scores on descriptions ranging from \"Not Acceptable\" over \"Marginally accaptable\" to \"Acceptable\". This scale is based on data from ',
html.A('Bangor et al. 2008',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=BD7BLDgAAAAJ&citation_for_view=BD7BLDgAAAAJ:u5HHmVD_uO8C',
target="_blank"),
' and derived from implications of the grading and adjective scales.']),
'promoterScale': html.P(children=[
'The Net Promoter score scale describes how likely users of a product are to recommend the System to others. It is based on data from ',
html.A('Sauro et al. 2012', href='https://measuringu.com/nps-sus/', target="_blank"),
'.']),
'industryBenchmarkScale': html.P(children=[
'This non-empirical scale is derived from ', html.A('Lewis et al. 2018',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=rmiLIsYAAAAJ&citation_for_view=rmiLIsYAAAAJ:a9-T7VOCCH8C',
target="_blank"),
'. It is based on the idea that 68 is the average SUS study score but a SUS score of 80 is commonly observed to be an “industrial benchmark” to reach as evidence of an above average user experience.']),
'none': ""
}
plotStyleInfoTexts = {
'mainplot': "Displays SUS study scores as boxplots.",
'per-question-chart': "Displays the SUS study score on bar charts with standard deviation.",
'notched': "Displays SUS study scores as notched boxplots. The notches can help identifying skewed distributions of data.",
}
SUSQuestions = ['Question 1', 'Question 2', 'Question 3', 'Question 4', 'Question 5', 'Question 6',
'Question 7', 'Question 8', 'Question 9',
'Question 10']
SUSQuestionsTexts = ['I think that I would like to use this system frequently.',
'I found the system unnecessarily complex.',
'I thought the system was easy to use.',
'I think that I would need the support of a technical person to be able to use this system.',
'I found the various functions in this system were well integrated.',
'I thought there was too much inconsistency in this system.',
'I would imagine that most people would learn to use this system very quickly.',
'I found the system very cumbersome to use.',
'I felt very confident using the system.',
'I needed to learn a lot of things before I could get going with this system.']
ConclusivenessValues = dict({0: '0%',
6: '35%',
7: '55%',
8: '75%',
9: '78%',
10: '80%',
11: '98%',
12: '100%',
13: '100%',
14: '100%'
})
def filterSUSStuds(SUSData, systemsToPlot):
studies = SUSData.SUSStuds
SUSData.SUSStuds = list(filter(lambda study: study.name in systemsToPlot, studies))
return SUSData
def getAdjectiveValue(score):
if score < 25.1:
return "Worst Imaginable"
if score < 51.7:
return "Poor"
if score < 71.1:
return "OK"
if score < 80.7:
return "Good"
if score < 84:
return "Excellent"
else:
return "Best Imaginable"
def getGradeScaleValue(score):
if score < 51.6:
return "F"
if score < 62.6:
return "D"
if score < 72.5:
return "C"
if score < 78.8:
return "B"
else:
return "A"
def getQuartileScaleValue(score):
if score < 62.5:
return "1st"
if score < 71:
return "2nd"
if score < 78:
return "3rd"
else:
return "4th"
def getAcceptabilityValue(score):
if score < 51.7:
return "Not Acceptable"
if score < 72.6:
return "Marginal"
else:
return "Acceptable"
def getNPSValue(score):
if score < 62.5:
return "Detractor"
if score < 78.8:
return "Passive"
else:
return "Promoter"
def getIndustryBenchmarkValue(score):
if score < 68:
return "Below Average"
if score < 80:
return "Above Average"
else:
return "Above Industry Standard"
def getConclusiveness(study):
sampleSize = len(study.Results)
if sampleSize < 6:
return '0%'
elif sampleSize < 15:
return ConclusivenessValues.get(sampleSize)
else:
return '100%'
def tableDataIsInvalid(table_data):
# Check whether table is empty
if table_data:
for row in table_data:
cells = list(row.values())
if all([cell != '' for cell in cells]) and all([cell is not None for cell in cells]) and all(
[0 < int(cell) < 6 for cell in cells[0:9]]):
continue
else:
return True
else:
return True
def conditionalFormattingEditableDataTable(columnNames):
style_data_conditional = []
for name in columnNames[0:10]:
style_data_conditional.extend([
{
'if': {
'filter_query': '{' + '{name}'.format(name=name) + '}< 1 ||' + '{' + '{name}'.format(
name=name) + '} > 5',
'column_id': '{name}'.format(name=name)
},
'backgroundColor': 'tomato',
'color': 'white'
},
{
'if': {
'filter_query': '{' + '{name}'.format(name=name) + '} is blank',
'column_id': '{name}'.format(name=name)
},
'backgroundColor': 'tomato',
'color': 'white'
},
]
)
style_data_conditional.append(
{
'if': {
'filter_query': '{' + '{name}'.format(name=columnNames[10]) + '} is blank',
'column_id': '{name}'.format(name=columnNames[10])
},
'backgroundColor': 'tomato',
'color': 'white'
},
)
return style_data_conditional
# Generates an example dataframe with random SUS values
def createExampleDataFrame(singleStudy=False):
if singleStudy:
df = pd.read_csv('assets/singleStudyData.csv', sep=';')
else:
df = pd.read_csv('assets/studyData.csv', sep=';')
return df
# Random data generation... deprecated for now
# exampleData = {}
# for i in range(1, 11):
# exampleData['Question {qNumber}'.format(qNumber=i)] = [random.randint(1, 5), random.randint(1, 5)]
# # Only Multi Study table has a system column
# if singleStudy is False:
# exampleData['System'] = ['Example System A', 'Example System B']
# else:
# exampleData['System'] = ['Example System', 'Example System']
# dataframe = pd.DataFrame(data=exampleData)
# return dataframe
dataframeQuartileConditions = [
{
'if': {
'column_id': 'SUS Score (mean) '
},
'fontWeight': 'bold'
},
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 100.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#CEE741'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 78',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FEF445'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 71',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FAC710'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 62.5',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#F24726'
}
]
dataframeAcceptabilityConditions = [
{
'if': {
'column_id': 'SUS Score (mean) '
},
'fontWeight': 'bold'
},
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 100.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#8FD14F'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 72.6',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FEF445'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 51.7',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#F24726'
},
]
dataframeGradeConditions = [
{
'if': {
'column_id': 'SUS Score (mean) '
},
'fontWeight': 'bold'
},
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 100.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#8FD14F'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 78.8',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#CEE741'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 72.5',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FEF445'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 62.6',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FAC710'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 51.6',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#F24726'
},
]
dataframeAdjectiveConditions = [
{
'if': {
'column_id': 'SUS Score (mean) '
},
'fontWeight': 'bold'
},
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 100.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'white',
'backgroundColor': '#008000'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 84.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#8FD14F'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 80.8',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#CEE741'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 71.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FEF445'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 51.7',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FAC710'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 25.0',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#F24726'
}
]
dataframeNPSConditions = [
{
'if': {
'column_id': 'SUS Score (mean) '
},
'fontWeight': 'bold'
},
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 100.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#8FD14F'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 78.8',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FEF445'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 62.5',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#F24726'
},
]
industryBenchmarkConditions = [
{
'if': {
'column_id': 'SUS Score (mean) '
},
'fontWeight': 'bold'
},
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 100.1',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#8FD14F'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 80',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#FEF445'
},
{
'if': {
'filter_query': '{SUS Score (mean) } < 68',
# 'column_id': 'SUS Score (mean) '
},
'color': 'black',
'backgroundColor': '#F24726'
},
]
dataFrameNoScale = [
{
'if': {
'column_id': 'SUS Score (mean) '
},
'fontWeight': 'bold'
},
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
}
]
editableTableTypeFormatting = {
'type': 'numeric',
'format': Format(
precision=0,
scheme=Scheme.fixed,
),
}
dataFrameConditions = {'acceptabilityScale': dataframeAcceptabilityConditions,
'adjectiveScale': dataframeAdjectiveConditions,
'gradeScale': dataframeGradeConditions,
'quartileScale': dataframeQuartileConditions,
'promoterScale': dataframeNPSConditions,
'industryBenchmarkScale': industryBenchmarkConditions,
'none': dataFrameNoScale
}
percentileIntoText = html.P(children=[
'SUS study scores do not follow a uniform or normal distribution. Bar charts and boxplots can therefore sometimes be deceiving for comparing the difference between SUS scores. The percentile curve, derived from over 5000 SUS study scores by ',
html.A('Sauro et al. 2016',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=rmiLIsYAAAAJ&citation_for_view=rmiLIsYAAAAJ:Mojj43d5GZwC',
target="_blank"),
', visualizes SUS study scores on the cumulative percentile curve of the dataset.'
])
conclusivenessInfoText = html.P(children=[
'The conclusiveness chart visualizes how conclusive each system/variables SUS study score is based on the number of participants. This graph is based on data from ',
html.A('Tullis et al. 2006',
href='https://scholar.google.de/citations?view_op=view_citation&hl=de&user=TXoUczoAAAAJ&citation_for_view=TXoUczoAAAAJ:PyEswDtIyv0C',
target="_blank"),
'.'
])
@dataclass
class ImageDownloadSettings:
width: float
height: float
fontSize: float
defaultPlotSettings = ImageDownloadSettings(1200, 487, 15)
widePlotSettings = ImageDownloadSettings(1530, 510, 15)
narrowPlotSettings = ImageDownloadSettings(1025, 805, 15)
plotSettings = {'defaultPlot': defaultPlotSettings,
'narrowPlot': narrowPlotSettings,
'widePlot': widePlotSettings}
def imageDownloadLabelFactory(idSubstring):
return html.Div([
html.Label([
"Download ",
dcc.Dropdown(id='download-type-' + idSubstring,
options=ChartLayouts.download_layouts,
value='defaultPlot',
style={'font-weight': 'normal',
'margin-top': '10px',
'font-size': '.8rem'
}
),
],
style={'display': 'block',
'font-weight': 'bold',
'padding': '10px 10px 10px 10px'
},
),
html.Label([
'Download Image Width:', html.Br(),
dcc.Input(id='image-width-' + idSubstring + '',
type="number",
debounce=True,
style={'font-weight': 'normal',
'margin-top': '10px',
}
), html.Br(),
'Download Image Length:', html.Br(),
dcc.Input(id='image-height-' + idSubstring,
type="number",
debounce=True,
style={'font-weight': 'normal',
'margin-top': '10px',
}
), html.Br(),
'Download Image Font Size":', html.Br(),
dcc.Input(id='image-font-size-' + idSubstring,
type="number",
value=25,
debounce=True,
style={'font-weight': 'normal',
'margin-top': '10px',
}
), html.Br(),
],
id='custom-image-size-' + idSubstring,
style={'display': 'None',
'font-weight': 'bold',
'padding': '10px 10px 10px 10px'
},
)])