def macros_options(i, dic): return dbc.Row([ dbc.Col(dbc.InputGroup([ dbc.InputGroupAddon('Label', addon_type='prepend', className='input-group-prepend-110'), dbc.Input(value=dic['label'], id=f'macro-item-label-{i}') ]), xs=12, sm=12, md=6, lg=6, xl=6), dbc.Col(dbc.InputGroup([ dbc.InputGroupAddon('Valor', addon_type='prepend', className='input-group-prepend-110'), dbc.Input(value=dic['value'], id=f'macro-item-value-{i}') ]), className='breakColLine', xs=12, sm=12, md=6, lg=6, xl=6), ], className='breakRowLine')
def contract_gen_measure(app): return html.Div([ html.H1("Stop-Loss/Stop-Gain", style={"font-size":"1.25rem"}), html.Hr(), dbc.Row([ dbc.Col('SS1. Stop Loss'), dbc.Col( dbc.InputGroup([ dbc.Input(value= 20), dbc.InputGroupAddon('%', addon_type = 'append') ], size="sm"), width=2 ), ], style={"padding-bottom":"10px"}), dbc.Row([ dbc.Col('SS2. Stop Gain'), dbc.Col( dbc.InputGroup([ dbc.Input(value= 20), dbc.InputGroupAddon('%', addon_type = 'append') ], size="sm"), width=2 ) ], style={"padding-bottom":"10px"}), ], style={"padding":"20px","background-color":"#f2f7ff"})
def generate_matching_card( self ): return dbc.Card( [ dbc.CardHeader("Topic Matching", className="card-header"), dbc.CardBody( [ html.Div( self.generate_matching_card_text(), className="card-text"), dbc.Row( [ dbc.InputGroup( [ dbc.InputGroupAddon("Select Model 1", addon_type="prepend"), self.generate_model_dropdown(1) ], className="col-sm" ), dbc.InputGroup( [ dbc.InputGroupAddon("Select Model 2", addon_type="prepend"), self.generate_model_dropdown(2) ], className="col-sm" ), ] ), html.Div( self.generate_matching_table(), id='content_compare_matching'), ] ), ])
def VerificationCodeInput(id='verification-code-input', placeholder='XXXX', addon="Verification Code"): return dbc.InputGroup([ dbc.InputGroupAddon(addon, addon_type="prepend"), dbc.Input(type="password", id=id, placeholder=placeholder), dbc.InputGroupAddon('?', id='{}-tooltip'.format(id), addon_type='append', style={'font-size': '500%'}), dbc.Tooltip('You can find a verification code in the message that was sent to your registered email address.', target='{}-tooltip'.format(id)) ], className="mb-3")
def get_specific_roof(): table = html.Div([ dbc.Row([ dbc.Col(html.Div([ dbc.InputGroup( [ dbc.InputGroupAddon("Y", addon_type="prepend"), dbc.Input(id='y-slider', type='number', min=0, max=9500, step=500, value=2000), dbc.InputGroupAddon("X", addon_type="prepend"), dbc.Input(id='x-slider', type='number', min=0, max=9500, step=500, value=8000), ], className="mb-3", ), dbc.Checklist( options=[ { "label": "Show detected solar arrays", "value": "show_panels" }, ], value=[], id="map-config", switch=True, ) ]), md=8), dbc.Col( dbc.RadioItems(options=[{ 'label': x, 'value': x } for x in range(2015, 2021)], value=2020, labelStyle={'display': 'idasnline-block'}, inline=True, id='year-choice')) ]), dbc.Row([ dbc.Col(dcc.Graph(id='map', config={'displayModeBar': False}), md=8), dbc.Col(html.Div([ html.Div(id='roof-estimates'), html.Br(), dcc.Graph(id='barchart', config={'displayModeBar': False}) ]), md=4), ]), ]) return table
def inputs_from_dict(dictionary, id_prefix=''): return [ dbc.InputGroup([ dbc.InputGroupAddon(key, addon_type="prepend"), dbc.Input(placeholder=value, id=id_prefix + key) ]) for key, value in dictionary.items() ]
def rv_update(valueInput, valueSlider, **kwargs): ctx = dash.callback_context if not ctx.triggered: trigger_id = "rvSlider.value" else: trigger_id = ctx.triggered[0]['prop_id'] if trigger_id == "rvSlider.value": valueForinput = "{:0,.0f}".format(valueSlider) valueForslider = valueSlider if trigger_id == "rvInput.value": valueInput = valueInput.replace(',', '') valueInput = valueInput.replace('.', '') valueForinput = "{:0,.0f}".format(int(valueInput)) valueForslider = int(valueInput) return [ dbc.Label("Residual value", html_for="rvInput", className='mb-2'), dbc.InputGroup( [ dbc.InputGroupAddon("€", addon_type="prepend"), dbc.Input( id="rvInput", type="text", min=0, max=30000, step=1000, value=valueForinput, debounce=True, className= 'form-control bg-secondary text-white font-weight-bold'), ], className="mb-2", ), dcc.Slider( id='rvSlider', min=0, max=30000, value=valueForslider, step=1000, updatemode='drag', marks={ 00000: { 'label': '0K' }, 10000: { 'label': '10K' }, 20000: { 'label': '20K' }, 30000: { 'label': '30K' } }, tooltip='always_visible', ), ] return dash.no_update
def contract_gen_basic_recom(app): return html.Div([ html.Div([ html.H1("Basic Info", style={"font-size": "1.25rem"}), html.Hr(), dbc.Row([ dbc.Col('BI1. Contract Period', width=7), dbc.Col([ dbc.InputGroup([ dbc.Input(value='1/1/2020', style={"text-align": "center"}), dbc.InputGroupAddon('-', addon_type='append'), dbc.Input(value='12/31/2020', style={"text-align": "center"}), ], size="sm") ], width=5) ], style={"padding-bottom": "10px"}), dbc.Row([ dbc.Col("BI2. ACO's name", width=7), dbc.Col([ dbc.Input(value='ACO1', bs_size="sm", style={"text-align": "center"}) ], width=5), ]), ]), ], style={ "padding": "20px", "background-color": "#f2f7ff" })
def EmailInput(id='email-input', show_tooltip=True): if show_tooltip: children = [ dbc.InputGroupAddon("Email", addon_type="prepend"), dbc.Input(placeholder="*****@*****.**", type="email", id=id, minLength=1, maxLength=65), dbc.InputGroupAddon('?', id='{}-tooltip'.format(id), addon_type='append', style={'font-size': '500%'}), dbc.Tooltip('We will only use this email address to get in touch with you in case your forget your ' 'password or you request assistance from us.', target='{}-tooltip'.format(id)) ] else: children = [ dbc.InputGroupAddon("Email", addon_type="prepend"), dbc.Input(placeholder="*****@*****.**", type="email", id=id, minLength=1, maxLength=65), ] return dbc.InputGroup(children, className="mb-3")
def PaletteSelector(dataset, options, value): index = [x.value for x in PaletteDefaultLayout].index(dataset.encode()) return dbc.InputGroup([ dbc.InputGroupAddon(UserReadableTrackNames.__getattr__(dataset).value, addon_type="prepend"), dbc.Select(id={'type': 'colorpalette-select', 'index': index}, options=options, value=value) ])
def HalfSquareSelector(idx, options, value): return dbc.InputGroup( [ dbc.InputGroupAddon("Map {}".format(idx), addon_type="prepend"), dbc.Select(id={'type': 'halfsquare-select', 'index': idx}, options=options, value=value) ] )
def TrackLayoutSelector(idx, options, value): return dbc.InputGroup( [ dbc.InputGroupAddon("Track {}".format(idx), addon_type="prepend"), dbc.Select(id={'type': 'track-select'.format(idx), 'index': idx}, options=options, value=value) ] )
def create_collapse(algo, measure, min, disabled): return dbc.Card([ dbc.CardHeader( html.H2( dbc.Button(algo + " Options", color="link", id=algo.lower() + "-options", disabled=disabled))), dbc.Collapse(dbc.CardBody([ dbc.FormGroup([ dbc.Label("Runnung time in " + measure, width=5), dbc.Col([ dbc.InputGroup([ dbc.Input(id=algo.lower() + "-timelife", type="number", value=min, placeholder=measure, min=min, max=100000), dbc.InputGroupAddon("at least " + str(min), addon_type="prepend") ]), ], width=5), ], row=True), ]), id="collapse-" + algo.lower()), ])
def get_currency_converter(current_price, symbol): all_curr = current_price.keys() return [ dbc.Row([ dbc.Col( dbc.InputGroup([ dbc.Input(id='eth-side-1', type="number", value=1, step=1), dbc.InputGroupAddon(symbol.upper(), addon_type="append") ]), ), dbc.Col( dbc.Select( id='curr-select-1', options=[{ 'label': curr.upper(), 'value': curr } for curr in all_curr], value='usd', )), dbc.Col(dbc.Input(id='result-side-1', disabled=True)), ], align='center', justify='center'), html.Br(), dbc.Row([ dbc.Col( dbc.Input(id='result-side-2', type="number", step=1, value=1)), dbc.Col( dbc.Select( id='curr-select-2', options=[{ 'label': curr.upper(), 'value': curr } for curr in all_curr], value='usd', )), dbc.Col( dbc.InputGroup([ dbc.Input(id='eth-side-2', disabled=True), dbc.InputGroupAddon(symbol.upper(), addon_type="append") ]), ), ], align='center', justify='center') ]
def time_nud( label_text: str, hour_id: str, hour_default: int, minute_id: str, minute_default: int, ): return dbc.FormGroup( [ dbc.Label(label_text, html_for=hour_id, width=6), dbc.Col( dbc.InputGroup( [ dbc.Input( id=hour_id, type="number", min=0, max=99, step=1, value=hour_default, ), dbc.InputGroupAddon("H", addon_type="append"), ] ) ), dbc.Col( dbc.InputGroup( [ dbc.Input( id=minute_id, type="number", min=0, max=59, step=1, value=minute_default, ), dbc.InputGroupAddon("M", addon_type="append"), ] ) ), ], row=True, )
def EmailIssueSelect(): return dbc.InputGroup([ dbc.Select( id='issue-select', options=[{"label": "Bug report", "value": EmailIssueReference.BUG.value}, {'label': 'I Forgot my password', 'value': EmailIssueReference.FORGOT_PSSWRD.value}, {"label": "General inquiry", "value": EmailIssueReference.OTHER.value}] ), dbc.InputGroupAddon("Subject", addon_type="prepend"), ])
def _standard_dev_output(self): return dbc.InputGroup( [ dbc.InputGroupAddon("σ", addon_type="prepend"), dbc.Input(type="text", id=f'wepstddisplay_{self.tab_id}_{self.weapon_id}', value=f'Average', disabled=True), ], size="sm", )
def _average_output(self): return dbc.InputGroup( [ dbc.InputGroupAddon("Mean", addon_type="prepend"), dbc.Input(type="text", id=f'avgdisplay_{self.tab_id}', value=f'Average', disabled=True), ], size="sm", )
def AdditionalTrackFormatSelector(): format_list = sorted([{"label": '{} ({})'.format(track.name, track.value), "value": track.name} for track in AdditionalDatasetReference], key=lambda k: k['value']) return dbc.InputGroup( [ dbc.Select( id='additional-track-selector', options=format_list ), dbc.InputGroupAddon("Track", addon_type="append"), ] )
def SizeSelector(id, marker_size, min, max, text='Size', disabled=False): if disabled == [1]: disabled = True elif not disabled: disabled = False return dbc.InputGroup( [ dbc.InputGroupAddon(text, addon_type="prepend"), dbc.Input(id=id, type="number", min=min, max=max, step=1, value=marker_size, disabled=disabled), ] )
def function_type(index): type_label = dbc.InputGroupAddon("Type", addon_type="prepend") val = "Exponential" if data is None else data["type"] type_select = dbc.Select( options=[ {"label": "Gaussian", "value": "Gaussian"}, {"label": "Lorentzian", "value": "Exponential"}, ], value=val, id={"function": "apodization", "args": "type", "index": index}, ) return dbc.InputGroup([type_label, type_select], className="input-form")
def interv_fin_init(max_num): interv_fin_input = [ dbc.InputGroupAddon("min", addon_type="prepend"), dbc.Input( type="number", id="interv_fin", disabled=True, debounce=True, min="0", max=max_num, pattern="^[0-9]\d*$" ), ] return interv_fin_input
def LFactorSelector(factor=2, disabled=False): if disabled == [1]: disabled = True elif not disabled: disabled = False return dbc.InputGroup( [ dbc.InputGroupAddon("L /", addon_type="prepend"), dbc.Input(id='L-cutoff-input', type="number", min=0, max=10, step=1, value=factor, disabled=disabled) ] )
def _input_tag(): return (dbc.InputGroup( children=[ dbc.InputGroupAddon( "Tags", addon_type="prepend", style=dict(height="100%"), ), dbc.Input(id="input_tags", style=dict(height="100%")), ], style=dict(height="100%"), ), )
def make_single_input(value, label): name = dbc.InputGroupAddon( children=label, addon_type="prepend", id={"type": "input-name", "index": value}, ) input = dbc.Input( type="number", id={"type": "input", "index": value}, ) units = dbc.InputGroupAddon( id={"type": "inputgroupaddon-units", "index": value}, addon_type="append", ) if value == "egg": input_size = dcc.Dropdown( id={"type": "input-eggsize", "index": value}, style={ "borderRadius": 0, "paddingBottom": 0.5, "marginBottom": -0.5, "marginLeft": -1, "marginRight": -1, }, options=[ {"value": "small", "label": "small"}, {"value": "medium", "label": "medium"}, {"value": "large", "label": "large"}, {"value": "extra-large", "label": "extra-large"}, ], placeholder="Select size...", ) input_group = [name, input, input_size, units] else: input_group = [name, input, units] return dbc.InputGroup( id={"type": "inputgroup-ingredients", "index": value}, children=input_group, className="mb-2", )
def generate_overview_card(self): return dbc.Card([ dbc.CardHeader("Overview: Scatter Plots", className="card-header"), dbc.CardBody([ html.Div(self.generate_overview_card_text(), className="card-text"), dbc.InputGroup([ dbc.InputGroupAddon("Select Embedding", addon_type="prepend"), self.generate_embedding_dropdown() ]), ]), ], )
def roi_content(self): return [ dcc.Markdown(""" Most SpectroChemPy's processing and analysis methods operate only on a region of interest (roi). By default, it is set to the whole range of data. This set up is done on the ``Original`` data. The limit are automatically visualized on the graph and applied in the ``Processed`` graph. If an offset is defined then the actual roi below is displayed accordingly (*see actual roi values below*). """, className='markdown'), # roi x limits dbc.InputGroup([ dbc.InputGroupAddon(id='x-roi', addon_type="prepend"), dbc.InputGroupAddon(id='x-roi-units', addon_type="append"), ], size='sm'), dbc.InputGroup( [ numeric_input(id='x-roi-lower', placeholder='Lower limit'), numeric_input(id='x-roi-upper', placeholder="Upper limit"), ], size='sm', ), # x axis offset (default = 0) dbc.InputGroup( [ dbc.InputGroupAddon('offset', addon_type="prepend"), numeric_input(id='x-offset', placeholder="Offset value, default=0"), ], size='sm', ), dbc.FormText(id='actual-x-roi'), html.Hr(), # roi y limits dbc.InputGroup([ dbc.InputGroupAddon(id='y-roi', addon_type="prepend"), dbc.InputGroupAddon(id='y-roi-units', addon_type="append"), ], size='sm'), dbc.InputGroup( [ numeric_input(id='y-roi-lower', placeholder="Lower limit"), numeric_input(id='y-roi-upper', placeholder="Upper limit"), ], size='sm', ), # y axis offset (default = 0) dbc.InputGroup( [ dbc.InputGroupAddon('Offset', addon_type="prepend"), numeric_input(id='y-offset', placeholder="Offset value, default=0"), ], size='sm', ), dbc.FormText(id='actual-y-roi'), html.Hr(), ]
def _target_input_row(self): content = dbc.InputGroup( [ dbc.InputGroupAddon("Target", addon_type="prepend"), *self._toughness_input(), *self._save_input(), *self._invuln_input(), *self._fnp_input(), *self._wounds_input(), ], size="sm", ) return dbc.Row([dbc.Col(content)], className="mb-2 ",)
def _weapon_name_input(self): return dbc.InputGroup([ dbc.InputGroupAddon("Weapon Name", addon_type="prepend"), dbc.Input(type="text", id=f'weaponname_{self.tab_id}_{self.weapon_id}', value=f'Weapon {self.weapon_id+1}', debounce=True, minLength=2, persistence=True, persistence_type='session', maxLength=60), ], size="sm")
def _tab_name_input(self): content = [ dbc.InputGroupAddon("Profile Name", addon_type="prepend"), dbc.Input(type="text", id=f'tabname_{self.tab_id}', value=f'Profile {self.tab_id}', debounce=True, minLength=2, persistence=True, persistence_type='session', maxLength=60), ] return dbc.InputGroup(content, size="sm")