@@ -90,112 +90,122 @@ def _uid(id_):
90
90
91
91
LAYOUT : Div = Div (
92
92
[
93
- Location (id = _uid ("url" ), refresh = False ),
94
- H3 ([Link (APP_NAME , href = APP_PATH )], className = "text-center" ),
93
+ Div (className = "col-2" ),
95
94
Div (
96
95
[
97
- Markdown (APP_DESCRIPTION ),
98
- H5 (children = "Colourspace" ),
99
- Dropdown (
100
- id = _uid ("colourspace" ),
101
- options = OPTIONS_RGB_COLOURSPACE ,
102
- value = STATE_DEFAULT ["colourspace" ],
103
- clearable = False ,
104
- className = "app-widget" ,
105
- ),
106
- H5 (children = "Illuminant" ),
107
- Dropdown (
108
- id = _uid ("illuminant" ),
109
- options = OPTIONS_ILLUMINANTS ,
110
- value = STATE_DEFAULT ["illuminant" ],
111
- clearable = False ,
112
- className = "app-widget" ,
113
- ),
114
- H5 (children = "Chromatic Adaptation Transform" ),
115
- Dropdown (
116
- id = _uid ("chromatic-adaptation-transform" ),
117
- options = OPTIONS_CHROMATIC_ADAPTATION_TRANSFORM ,
118
- value = STATE_DEFAULT ["chromatic_adaptation_transform" ],
119
- clearable = False ,
120
- className = "app-widget" ,
121
- ),
122
- H5 (children = "Formatter" ),
123
- Dropdown (
124
- id = _uid ("formatter" ),
125
- options = [
126
- {"label" : "str" , "value" : "str" },
127
- {"label" : "repr" , "value" : "repr" },
128
- ],
129
- value = STATE_DEFAULT ["formatter" ],
130
- clearable = False ,
131
- className = "app-widget" ,
132
- ),
133
- H5 (children = "Decimals" ),
134
- Slider (
135
- id = _uid ("decimals" ),
136
- min = 1 ,
137
- max = 15 ,
138
- step = 1 ,
139
- value = STATE_DEFAULT ["decimals" ],
140
- marks = {i + 1 : str (i + 1 ) for i in range (15 )},
141
- className = "app-widget" ,
142
- ),
143
- Button (
144
- "Copy to Clipboard" ,
145
- id = _uid ("copy-to-clipboard-button" ),
146
- n_clicks = 0 ,
147
- style = {"width" : "100%" },
148
- ),
149
- Pre (
150
- [
151
- Code (
152
- id = _uid ("primaries-output" ), className = "code shell"
153
- )
154
- ],
155
- className = "app-widget app-output" ,
156
- ),
157
- Ul (
96
+ Location (id = _uid ("url" ), refresh = False ),
97
+ H3 ([Link (APP_NAME , href = APP_PATH )], className = "text-center" ),
98
+ Div (
158
99
[
159
- Li (
160
- [
161
- Link (
162
- "Back to index..." ,
163
- href = "/" ,
164
- className = "app-link" ,
165
- )
100
+ Markdown (APP_DESCRIPTION ),
101
+ H5 (children = "Colourspace" ),
102
+ Dropdown (
103
+ id = _uid ("colourspace" ),
104
+ options = OPTIONS_RGB_COLOURSPACE ,
105
+ value = STATE_DEFAULT ["colourspace" ],
106
+ clearable = False ,
107
+ className = "app-widget" ,
108
+ ),
109
+ H5 (children = "Illuminant" ),
110
+ Dropdown (
111
+ id = _uid ("illuminant" ),
112
+ options = OPTIONS_ILLUMINANTS ,
113
+ value = STATE_DEFAULT ["illuminant" ],
114
+ clearable = False ,
115
+ className = "app-widget" ,
116
+ ),
117
+ H5 (children = "Chromatic Adaptation Transform" ),
118
+ Dropdown (
119
+ id = _uid ("chromatic-adaptation-transform" ),
120
+ options = OPTIONS_CHROMATIC_ADAPTATION_TRANSFORM ,
121
+ value = STATE_DEFAULT [
122
+ "chromatic_adaptation_transform"
123
+ ],
124
+ clearable = False ,
125
+ className = "app-widget" ,
126
+ ),
127
+ H5 (children = "Formatter" ),
128
+ Dropdown (
129
+ id = _uid ("formatter" ),
130
+ options = [
131
+ {"label" : "str" , "value" : "str" },
132
+ {"label" : "repr" , "value" : "repr" },
166
133
],
167
- className = "list-inline-item" ,
134
+ value = STATE_DEFAULT ["formatter" ],
135
+ clearable = False ,
136
+ className = "app-widget" ,
137
+ ),
138
+ H5 (children = "Decimals" ),
139
+ Slider (
140
+ id = _uid ("decimals" ),
141
+ min = 1 ,
142
+ max = 15 ,
143
+ step = 1 ,
144
+ value = STATE_DEFAULT ["decimals" ],
145
+ marks = {i + 1 : str (i + 1 ) for i in range (15 )},
146
+ className = "app-widget" ,
147
+ ),
148
+ Button (
149
+ "Copy to Clipboard" ,
150
+ id = _uid ("copy-to-clipboard-button" ),
151
+ n_clicks = 0 ,
152
+ style = {"width" : "100%" },
168
153
),
169
- Li (
154
+ Pre (
170
155
[
171
- A (
172
- "Permalink" ,
173
- href = urllib .parse .urljoin (
174
- str (SERVER_URL ), APP_PATH
175
- ),
176
- target = "_blank" ,
156
+ Code (
157
+ id = _uid ("primaries-output" ),
158
+ className = "code shell" ,
177
159
)
178
160
],
179
- className = "list-inline-item " ,
161
+ className = "app-widget app-output " ,
180
162
),
181
- Li (
163
+ Ul (
182
164
[
183
- A (
184
- "colour-science.org" ,
185
- href = "https://www.colour-science.org" ,
186
- target = "_blank" ,
187
- )
165
+ Li (
166
+ [
167
+ Link (
168
+ "Back to index..." ,
169
+ href = "/" ,
170
+ className = "app-link" ,
171
+ )
172
+ ],
173
+ className = "list-inline-item" ,
174
+ ),
175
+ Li (
176
+ [
177
+ A (
178
+ "Permalink" ,
179
+ href = urllib .parse .urljoin (
180
+ str (SERVER_URL ), APP_PATH
181
+ ),
182
+ target = "_blank" ,
183
+ )
184
+ ],
185
+ className = "list-inline-item" ,
186
+ ),
187
+ Li (
188
+ [
189
+ A (
190
+ "colour-science.org" ,
191
+ href = "https://www.colour-science.org" ,
192
+ target = "_blank" ,
193
+ )
194
+ ],
195
+ className = "list-inline-item" ,
196
+ ),
188
197
],
189
- className = "list-inline-item " ,
198
+ className = "list-inline text-center " ,
190
199
),
200
+ Div (id = _uid ("dev-null" ), style = {"display" : "none" }),
191
201
],
192
- className = "list-inline text-center" ,
193
202
),
194
- Div (id = _uid ("dev-null" ), style = {"display" : "none" }),
195
203
],
196
- className = "col-6 mx-auto " ,
204
+ className = "col-6" ,
197
205
),
198
- ]
206
+ Div (className = "col-2" ),
207
+ ],
208
+ Div (className = "row" ),
199
209
)
200
210
"""
201
211
App layout, i.e. :class:`Div` class instance.
0 commit comments