-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLayoutBase.py
273 lines (242 loc) · 11.2 KB
/
LayoutBase.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
import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objs as go
#import dash_bootstrap_components as dbc
import base64
from textwrap import dedent
tplOverview = 'Technology performance level (TPL) assessment is intended to provide a comprehensive and holistic measure of a wave energy converter’s (WEC) techno-economic performance potential. While the TPL assessments can be applied at all technology development stages and associated technology readiness levels (TRLs), this tool is aimed at assessing early stage concepts. This tool uses a series of questions in seven distinct categories to guide the assessor in evaluating a WEC. Each question addresses a specific aspect that impacts the techno-economic performance of a WEC. For each question, the reviewer must provide a score. Also, this tool is intended to evaluate a wide range of WEC architypes who’s techno-economic performance may be impacted differently by different evaluation criteria, each question has an associated weighting that can be customized by the assessor. The net TPL score is calculated for the score and weighting of each question.'
colors = {
'background': '#ADD8E6',
'text': '#4169E1'
}
buttonStyle = style={'textAlign': 'center',
'display':'table-cell',
'verticalAlign':'middle',
'margin':'auto'}
def header():
div = html.Div(
style={'backgroundColor': colors['background']},
children =[
html.H1('TPL ASSESSMENT TOOL',
style={
'textAlign': 'left',
'color': colors['text']
}
),
dcc.Store(id='tpl-assessment-store',storage_type='local'),
dcc.Store(id='capabilities-store',storage_type='local'),
dcc.Store(id='subCats-store',storage_type='local'),
dcc.Store(id='narrowC-store',storage_type='local'),
dcc.Store(id='specificC-store',storage_type='local'),
dcc.Store(id='qGroup-store',storage_type='local'),
dcc.Store(id='qChoiceGroup-store',storage_type='local'),
dcc.Store(id='qChoice-store',storage_type='local'),
html.Div(id='dummy-out-1', style={'display':'none'}),
html.Div(id='dummy-out-2', style={'display':'none'})
]
)
return div
'''
# need to spend a bit of time getting static files to work correctly
def logo(image_filename = './static/logo.png'):
encoded_image = base64.b64encode(open(image_filename, 'rb').read())
return html.Img(src='data:image/png;base64,{}'.format(encoded_image))
'''
def top_Divs_Base():
div = html.Div(id='top-background-div',
children=[
html.Button('Start Fresh TPL Assessment',
title='Click this to begin a new TPL Assessment',
id='standard-load-button',
style=buttonStyle,
className='four columns'),
html.Div(id='capabilities-dropdown-div',
children=[
dcc.Dropdown(
id='capabilities-dropdown',
options = [{'label':'No TPL Assessment Loaded',
'value':'NoTPL'}],
placeholder='No TPL Assessment Loaded',
)
],
style={'visible':False},
className='four columns'),
html.Div([
dcc.ConfirmDialogProvider(
children=html.Button('TPL?',
className='twelve columns'),
id='overview-button',
message=f'{tplOverview}')
],id='overview-div',className='two columns')
],style={'background':'#F0FEFE'},
className='twelve columns')
return div
def bot_Divs_Base():
div = html.Div(id='bot-background-div',
children=[
html.Div(left_div_preamble(),
id='left-div',
hidden=True,
className='twelve columns'),
plot_row_preable(),
html.Div([
html.Div([
html.Div(id='bot-left-div-1',
className='twelve columns'),
html.Div(id='bot-left-div-2',
className='twelve columns'),
html.Div([
dcc.Dropdown(id='numQuestions-dropdown',
options=[{'label':'noQ','value':'noQ'}],
value=None,
placeholder="Select Question"
),
],id='bot-left-div-3',
className='twelve columns')
],id='bot-left-div',
className='six columns'),
html.Div([
html.Div(
children=bot_right_div_1_preamble(),
id='bot-right-div-1',
className='twelve columns'),
html.Div(id='bot-right-div-2',
className='twelve columns'),
html.Div(id='bot-right-div-3',
className='twelve columns'),
],
id='bot-right-div',
className='six columns')
]),
],
className='twelve columns'
)
return div
def bot_Divs_Base2():
div = html.Div(id='bot-background-div2',
children=[
html.Div([
html.Div(id='bot-right-div-6',
className='twelve columns'),
html.Div(id='bot-right-div-7',
className='twelve columns'),
html.Div(id='bot-right-div-8',
className='twleve columns'),
html.Div(right_div_preamble(),
id='right-div',
hidden=False,
className='six columns'
, style={'marginleft': 5000000000000000, 'marginTop': 25})
],
),
],
className='twelve columns'
)
return div
def left_div_preamble():
return [html.Div([
html.H5('Narrow Index:'),
html.Div(
dcc.Dropdown(id='narrowC-dropdown',
options=[{'label':'Select Device Capabilities',
'value':'NoCG'}],
value=None,
placeholder="Select Device Capabilities"
),id='left-div-1')],
id='q1-holder',
className='four columns'
),
html.Div([
html.H5('Specific Index:'),
html.Div(
dcc.Dropdown(id='specificC-dropdown',
options= [{'label':'Select Capability Group',
'value':'NoCG'}],
value=None,
placeholder="Select Capability Group"
),id='left-div-2')],
id='q2-holder',
className='four columns'
),
html.Div([
html.H5('Question Index:'),
html.Div(
dcc.Dropdown(id='qGroup-dropdown',
options= [{'label':'Select Question Group',
'value':'NoQG'}],
value=None,
placeholder="Select Question Group"
),id='left-div-3')],
id='q3-holder',
className='four columns'
)
]
def plot_row_preable():
return html.Div([
html.Div(id='graph-1-div',className='three columns'),
html.Div(id='graph-2',className='three columns'),
html.Div(id='graph-3',className='three columns'),
html.Div(id='graph-4',className='two columns'),
html.Div([
html.Div('High: 7-9', style={'color': 'green', 'fontSize': 25,}),
html.Div('Med: 4-6', style={'color': 'yellow','fontSize':25,}),
html.Div('Low: 0-3', style={'color':'red','fontSize':25})],className='one column')
],id='plot-row-div',className='twelve columns')
def right_div_preamble():
return [html.Div(#[
# html.H5('Plot:'),
html.Div(id='test-graph'),
#
id='q1-holdernew',
className='eleven columns'
),
html.Div(id='q2-holdernew',className='eleven columns'),
html.Div(id='q3-holdernew',className='eleven columns'),
]
def bot_right_div_1_preamble():
return [html.Div(id='net-score-div'),
dcc.Input(placeholder='Enter your Score',
id='contribution-weight',
type='number',
value=0,
min=0,max=10,
debounce = True,
className='four columns'),
html.Div([
html.Div([
dcc.ConfirmDialogProvider(
children=html.Button('',
className='twelve columns'),
id='background-button',
message=''),
dcc.ConfirmDialogProvider(
children=html.Button('',
className='twelve columns'),
id='score-button',
message=f'')
],className='four columns'),
html.Div([
html.Div([html.Div(children=''),
dcc.Input(placeholder='',
id='question-score',
type='number',
value='',
min=0,max=10,
className='twelve columns'
)],className='six columns'),
html.Div([html.Div(''),
dcc.Input(placeholder='',
id='question-weight',
type='number',
value='',
min=0,max=10,
className='twelve columns'
)
],className='six columns'),
html.Button('',
id = 'score-sub-button',
className='twelve columns')
],className='eight columns')
],className='twelve columns')
]