本文整理匯總了Python中dash_html_components.Button方法的典型用法代碼示例。如果您正苦於以下問題:Python dash_html_components.Button方法的具體用法?Python dash_html_components.Button怎麽用?Python dash_html_components.Button使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dash_html_components
的用法示例。
在下文中一共展示了dash_html_components.Button方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def __init__(self, parent_name, local_name):
Component.__init__(self, parent_name, local_name)
self.log_selector = LogSelectorDropdown(self.full_name, 'log_selector')
self.dimension_controls = Scatter2DDimensionControls(
self.full_name, 'dimension_controls')
# self.filter_selector = FilterSelectorDropdown(self.full_name, 'filter_selector')
self.delete_button = Button(self.full_name, 'delete_button',
'Delete Row')
self.notes = Notes(self.full_name, 'notes')
self._register(
full_column([
self.notes.get_layout(),
# horizontal_separator(),
self.log_selector.get_layout(),
# horizontal_separator(),
self.dimension_controls.get_layout(),
# horizontal_separator(),
# self.filter_selector.get_layout(),
]))
示例2: divs_list
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def divs_list():
return [html.Div([
dcc.Markdown(
'',
id='model-{}-markdown'.format(id)
),
html.P(
'',
id='model-{}-p'.format(id)
),
html.Button(
'Delete',
id='model-{}-delete-button'.format(id),
style={'width': '49%'}
),
html.Button(
'Start/Stop',
id='model-{}-toggle-button'.format(id),
style={'marginLeft': '2%', 'width': '49%'}
),
html.Hr()
], id='model-k2-{}'.format(id)) for id in IDS]
示例3: _make_buttons
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def _make_buttons(self, prev_id, next_id):
return html.Div(
style=self.set_grid_layout("1fr 1fr"),
children=[
html.Button(
style={
"fontSize": "2rem",
"paddingLeft": "5px",
"paddingRight": "5px",
},
id=prev_id,
children="⬅",
),
html.Button(
style={
"fontSize": "2rem",
"paddingLeft": "5px",
"paddingRight": "5px",
},
id=next_id,
children="➡",
),
],
)
示例4: make_buttons
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def make_buttons(self, prev_id, next_id):
return html.Div(
style=self.set_grid_layout("1fr 1fr"),
children=[
html.Button(
id=prev_id,
style={
"fontSize": "2rem",
"paddingLeft": "5px",
"paddingRight": "5px",
},
children="⬅",
),
html.Button(
id=next_id,
style={
"fontSize": "2rem",
"paddingLeft": "5px",
"paddingRight": "5px",
},
children="➡",
),
],
)
示例5: serve_layout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def serve_layout():
session_id = str(uuid.uuid4())
return html.Div(style={'marginLeft': 80}, children=[
html.Div(session_id, id='session-id', style={'display': 'none'}),
html.Button('Get data', id='button'),
html.Div(id='output-1'),
html.Div(id='output-2')
])
示例6: display_value_1
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def display_value_1(value, session_id):
df = get_dataframe(session_id)
return html.Div([
'Output 1 - Button has been clicked {} times'.format(value),
html.Pre(df.to_csv())
])
示例7: display_value_2
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def display_value_2(value, session_id):
df = get_dataframe(session_id)
return html.Div([
'Output 2 - Button has been clicked {} times'.format(value),
html.Pre(df.to_csv())
])
示例8: layout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def layout():
return html.Div([
html.Button('Run Process', id='button'),
dcc.Interval(id='interval', interval=500),
html.Div(id='lock'),
html.Div(id='output'),
])
示例9: update_output
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def update_output(b1_timestamp, b2_timestamp):
if b1_timestamp > b2_timestamp:
return '''
Button 1 Was Clicked
(Button 1 timestamp: {}. Button 2 timestamp: {}.)
'''.format(b1_timestamp, b2_timestamp)
else:
return '''
Button 2 Was Clicked
(Button 1 timestamp: {}. Button 2 timestamp: {}.)
'''.format(b1_timestamp, b2_timestamp)
示例10: clicks
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def clicks(n_clicks):
return 'Button has been clicked {} times'.format(n_clicks)
示例11: layout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def layout(self) -> html.Div:
return html.Div(
[
html.H1(self.title),
html.Button(
id=self.uuid("submit-button"), n_clicks=0, children="Submit"
),
html.Div(id=self.uuid("output-state")),
]
)
示例12: set_callbacks
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def set_callbacks(self, app: Dash) -> None:
@app.callback(
Output(self.uuid("output-state"), "children"),
[Input(self.uuid("submit-button"), "n_clicks")],
)
def _update_output(n_clicks: int) -> str:
return f"Button has been pressed {n_clicks} times."
示例13: layout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def layout(self):
return html.Div(
children=[
html.Div(
style=self.set_grid_layout("1fr 1fr 1fr 1fr 1fr"),
children=[
self.well_layout,
self.well_options,
self.seismic_layout,
self.viz_options_layout,
html.Button(id=self.ids("show_map"), children="Show map",),
],
),
html.Div(
id=self.ids("viz_wrapper"),
style={"position": "relative"},
children=[
html.Div(
id=self.ids("map_wrapper"),
style={
"position": "absolute",
"width": "30%",
"height": "40%",
"right": 0,
"zIndex": 10000,
"visibility": "hidden",
},
children=LayeredMap(
height=400, id=self.ids("map"), layers=[]
),
),
wcc.Graph(id=self.ids("graph")),
],
),
],
)
示例14: update_related_terms
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def update_related_terms(sentiment_term):
try:
# get data from cache
for i in range(100):
related_terms = cache.get('related_terms', sentiment_term) # term: {mean sentiment, count}
if related_terms:
break
time.sleep(0.1)
if not related_terms:
return None
buttons = [html.Button('{}({})'.format(term, related_terms[term][1]), id='related_term_button', value=term, className='btn', type='submit', style={'background-color':'#4CBFE1',
'margin-right':'5px',
'margin-top':'5px'}) for term in related_terms]
#size: related_terms[term][1], sentiment related_terms[term][0]
sizes = [related_terms[term][1] for term in related_terms]
smin = min(sizes)
smax = max(sizes) - smin
buttons = [html.H5('Terms related to "{}": '.format(sentiment_term), style={'color':app_colors['text']})]+[html.Span(term, style={'color':sentiment_colors[round(related_terms[term][0]*2)/2],
'margin-right':'15px',
'margin-top':'15px',
'font-size':'{}%'.format(generate_size(related_terms[term][1], smin, smax))}) for term in related_terms]
return buttons
except Exception as e:
with open('errors.txt','a') as f:
f.write(str(e))
f.write('\n')
#recent-trending div
# term: [sent, size]
示例15: simple_app_layout
# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Button [as 別名]
def simple_app_layout(
component
):
return [
dcc.Input(id='prop-name'),
dcc.Input(id='prop-value'),
html.Div(id='pass-fail-div'),
html.Button('Submit', id='submit-prop-button'),
component
]