html.Div( [ html.H6( "Base Left", style={ "textAlign": "center", "font-size": "1.1rem", "paddingLeft": "14%", "top": "30px", "paddingTop": "8%", }, className="three columns", ), daq.Joystick( id="LED-base-move", force=0, className="four columns", ), html.H6( "Base Right", style={ "textAlign": "center", "font-size": "1.1rem", "left": "9px", "top": "24px", "width": "9%", "position": "relative", }, className="three columns", ), ],
html.Div( [ html.H5( "Motion", id="motion-title", style={ "textAlign": "center", "paddingTop": "3%" }, ), html.Div( [ html.Div( [ daq.Joystick(id="joystick", angle=0, force=0) ], className="four columns", ), html.Div( [ daq.Knob( id="ultrasonic-angle", label=" ", size=60, value=90, color="#FF5E5E", min=0, max=180, scale={
html.P("Select Continuous Waveform Source"), html.Div(cont_wf_path), html.P('Select CPIC Deployment Source'), html.Div(deployment_path), ], className="cont_control_display_left") ]) # ---- 15. Continuous waveform display cont_wf_tabs = dcc.Tabs(id="cont_wf_tabs", value='Control', children=[ dcc.Tab(label='N', value='N', style=tab_style, selected_style=tab_selected_style), dcc.Tab(label='E', value='E', style=tab_style, selected_style=tab_selected_style), dcc.Tab(label='Z', value='Z', style=tab_style, selected_style=tab_selected_style), dcc.Tab(label='NEZ', value='NEZ', style=tab_style, selected_style=tab_selected_style), dcc.Tab(Cont_control_tab, label='Control', value='Control', style=tab_style, selected_style=tab_selected_style) ]) # ---- 16. cont joy stick browse_wf = daq.Joystick( id='move_handle', label="Browse waveform", angle=0, size=60, ), # ---- 18. Tab N control content Cont_N_tab = dcc.Loading( id='loadN', children=html.Div([dcc.Graph(id='N_comp_wfs')])) Cont_E_tab = dcc.Loading( id='loadE', children=html.Div([dcc.Graph(id='E_comp_wfs')])) Cont_Z_tab = dcc.Loading( id='loadZ', children=html.Div([dcc.Graph(id='Z_comp_wfs')])) Cont_NEZ_tab = dcc.Loading( id='loadNEZ', children=html.Div([dcc.Graph(id='NEZ_comp_wfs')]))
Joystick = html.Div(children=[ html.H1('Joystick Examples and Reference'), html.Hr(), html.H3('Default Joystick'), reusable_components.Markdown("An example of a default Joystick without \ any extra properties."), reusable_components.Markdown( examples['joystick'][0], style=styles.code_container ), html.Div( examples['joystick'][1], style={'overflow=x': 'initial'} ), html.Hr(), html.H3('Label'), reusable_components.Markdown( "Change the label and label orientation with `label` and `labelPosition`."), ComponentBlock('''import dash_daq as daq daq.Joystick( label="Label", labelPosition="bottom" )''', style=styles.code_container), html.Hr(), html.H3('Size'), reusable_components.Markdown( "Change the size of the joystick with `size`."), ComponentBlock('''import dash_daq as daq daq.Joystick( size=250 )''', style=styles.code_container), html.Hr(), html.H3('Joystick Properties'), generate_prop_info('Joystick', lib=daq) ])
import dash import dash_daq as daq import dash_html_components as html external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=external_stylesheets) app.layout = html.Div([ daq.Joystick( id='my-joystick', label="Default", angle=0 ), html.Div(id='joystick-output') ]) @app.callback( dash.dependencies.Output('joystick-output', 'children'), [dash.dependencies.Input('my-joystick', 'angle'), dash.dependencies.Input('my-joystick', 'force')]) def update_output(angle, force): return ['Angle is {}'.format(angle), html.Br(), 'Force is {}'.format(force)] if __name__ == '__main__': app.run_server(debug=True)
className="input-group, p-1"), ]) ]), dcc.Tab( label='Control', className="card-header", children=[ html.Div( className="card-body", children=[ html. P('Use the joystick to remote control your RcCat.' ), daq.Joystick( id='joystick', size=250, className= "d-flex justify-content-center"), html.Label('', id="joystick-label", style="visible:hidden"), html. P('Change internal parematers to play with driving characteristics:', className="mt-3"), html.Div([ html.Label("Parameter ID: ", className="mr-1 mt-1"), dcc.Input(id="send-parameter-id", type="number", value=1), html.Label(