Question
Create a dashboard using PYTHON that will assign each item in the dropbox (each name of the airplane model) to a different screen with different
Create a dashboard using PYTHON that will assign each item in the dropbox (each name of the airplane model) to a different screen with different checkbox properties.
* Each airplane model should have their own checkbox properties. For instance, if we select the airplane model A300 in the dashboard, and airplane model has properties 1,3, and 5, we want the checkboxes to already be marked. However, when we select another airplane model, A319, from the dropbox, it should have the properties 1, 2, 6, and 10 checked, and so on.
What code can I implement/modify to my current code to make sure that for each airplane model, their individual conditions can be met?
When I currently run this code and open up the webpage, the checkboxes are individual of the dropdown options (airplane models). When I select a box, it stays that way despite me choosing another aircraft model in the dropbox model.
CURRENT CODE:
# -*- coding: utf-8 -*- import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=external_stylesheets) app.layout = html.Div([ html.Label('dropdown'), dcc.Dropdown( options=[ {'label': 'A300', 'value': (0, 'test_label0')}, {'label': 'A319', 'value': 1}, {'label': 'A320', 'value': 2}, {'label': 'A321', 'value': 3}, {'label': 'A330', 'value': 4}, {'label': 'ATR 72', 'value': 5}, {'label': 'Airbus Industrie Undifferentiated or Other Model', 'value': 6}, {'label': 'Any Unknown or Unlisted Aircraft Manufacturer', 'value': 7}, {'label': 'B717 (Formerly MD-95)', 'value': 8}, {'label': 'B737 Next Generation Undifferentiated', 'value': 9}, {'label': 'B737 Undifferentiated or Other Model', 'value': 10}, {'label': 'B737-200', 'value': 11}, {'label': 'B737-300', 'value': 12}, {'label': 'B737-400', 'value': 13}, {'label': 'B737-500', 'value': 14}, {'label': 'B737-700', 'value': 15}, {'label': 'B737-800', 'value': 16}, {'label': 'B737-900', 'value': 17}, {'label': 'B747-100', 'value': 18}, {'label': 'B747-200', 'value': 19}, {'label': 'B747-400', 'value': 20}, {'label': 'B747-C/F', 'value': 21}, {'label': 'B757 Undifferentiated or Other Model', 'value': 22}, {'label': 'B757-200', 'value': 23}, {'label': 'B757-300', 'value': 24}, {'label': 'B767 Undifferentiated or Other Model', 'value': 25}, {'label': 'B767-200', 'value': 26}, {'label': 'B767-300 and 300 ER', 'value': 27}, {'label': 'B767-400 and 400 ER', 'value': 28}, {'label': 'B777 Undifferentiated or Other Model', 'value': 29}, {'label': 'B777-200', 'value': 30}, {'label': 'B777-300', 'value': 31}, {'label': 'Beech 1900', 'value': 32}, {'label': 'Boeing Company Undifferentiated or Other Model', 'value': 33}, {'label': 'Brasilia EMB-120 All Series', 'value': 34}, {'label': 'Cessna 150', 'value': 35}, {'label': 'Challenger CL600', 'value': 36}, {'label': 'Challenger CL601', 'value': 37}, {'label': 'Commercial Fixed Wing', 'value': 38}, {'label': 'DC-10 30', 'value': 39}, {'label': 'DC-10 Undifferentiated or Other Model', 'value': 40}, {'label': 'DC-9 Undifferentiated or Other Model', 'value': 41}, {'label': 'Dash 8 Series Undifferentiated or Other Model', 'value': 42}, {'label': 'Dash 8-100', 'value': 43}, {'label': 'Dash 8-200', 'value': 44}, {'label': 'Dash 8-400', 'value': 45}, {'label': 'Do 328 TP (Turboprop)', 'value': 46}, {'label': 'EMB ERJ 135 ER/LR', 'value': 47}, {'label': 'EMB ERJ 140 ER/LR', 'value': 48}, {'label': 'EMB ERJ 145 ER/LR', 'value': 49}, {'label': 'EMB ERJ 170/175 ER/LR', 'value': 50}, {'label': 'EMB ERJ 190/195 ER/LR', 'value': 51}, {'label': 'Embraer Jet Undifferentiated or Other Model', 'value': 52}, {'label': 'Embraer Undifferentiated or Other Model', 'value': 53}, {'label': 'Heavy Transport', 'value': 54}, {'label': 'Large Transport', 'value': 55}, {'label': 'Large Transport; Low Wing; 2 Turbojet Eng', 'value': 56}, {'label': 'Light Transport', 'value': 57}, {'label': 'Light Transport; High Wing; 2 Turboprop Eng', 'value': 58}, {'label': 'MD-11', 'value': 59}, {'label': 'MD-80 Series (DC-9-80) Undifferentiated or Other Model', 'value': 60}, {'label': 'MD-82', 'value': 61}, {'label': 'MD-83', 'value': 62}, {'label': 'MD-88', 'value': 63}, {'label': 'MD-90 Series (DC-9-90) Undifferentiated or Other Model', 'value': 64}, {'label': 'Medium Large Transport', 'value': 65}, {'label': 'Medium Large Transport; Low Wing; 2 Turbojet Eng', 'value': 66}, {'label': 'Medium Transport', 'value': 67}, {'label': 'Medium Transport; High Wing; 2 Turboprop Eng', 'value': 68}, {'label': 'Medium Transport; Low Wing; 2 Turbojet Eng', 'value': 69}, {'label': 'Medium Transport; Low Wing; 2 Turboprop Eng', 'value': 70}, {'label': 'PA-31P Navajo P', 'value': 71}, {'label': 'Q400', 'value': 72}, {'label': 'Regional Jet 200 ER/ LR (CRJ200)', 'value': 73}, {'label': 'Regional Jet 700 ER/LR (CRJ700)', 'value': 74}, {'label': 'Regional Jet 900 (CRJ900)', 'value': 75}, {'label': 'Regional Jet CL65; Undifferentiated or Other Model', 'value': 76}, {'label': 'SF 340A', 'value': 77}, {'label': 'SF 340B', 'value': 78}, {'label': 'Saab-Scania Undifferentiated or Other Model', 'value': 79}, {'label': 'Small Aircraft; Low Wing; 1 Eng; Fixed Gear', 'value': 80}, {'label': 'Widebody Transport', 'value': 81}, {'label': 'Widebody; Low Wing; 2 Turbojet Eng', 'value': 82}, {'label': 'Widebody; Low Wing; 4 Turbojet Eng', 'value': 83}, ], value='1' ), html.Label('Checkboxes'), dcc.Checklist( options=[ {'label': 'property1', 'value': (0, 'test_label0')}, {'label': 'property2', 'value': 1}, {'label': 'property3', 'value': 2}, {'label': 'property4', 'value': 3}, {'label': 'property5', 'value': 4}, {'label': 'property6', 'value': 5}, {'label': 'property7', 'value': 6}, {'label': 'property8', 'value': 7}, {'label': 'property9', 'value': 8}, {'label': 'property10', 'value': 9}, {'label': 'property11', 'value': 10}, {'label': 'property12', 'value': 11}, {'label': 'property13', 'value': 12}, {'label': 'property14', 'value': 13}, {'label': 'B737-500', 'value': 14}, {'label': 'B737-700', 'value': 15}, {'label': 'B737-800', 'value': 16}, {'label': 'B737-900', 'value': 17}, {'label': 'B747-100', 'value': 18}, {'label': 'B747-200', 'value': 19}, ], values=['1', '20'] ), ], style={'columnCount': 2}) if __name__ == '__main__': app.run_server(debug=True)
Thank you so much! I need this very soon because I'm participating in a hackathon. I really appreciate it :)
AerohacksDashboard [/PycharmProjects/AerohacksDashboard] - /Desktop/Da /-Users | claudiatiller-Desktop R. Dashboard, py e t Dashboard.pyX Project AerohacksDashboard-Pycharr 108 'label': 'property3', 'value':2 'label':'property4, 'value':3 'label': 'property5, 'value': 4, 'label': 'property6', 'value': 5, 'label': 'property7, 'value': 6, 'label': 'property8', 'value':7, 'label': 'property9', 'value': 8, 'label':'property10', 'value':9, 'label': 'property11', 'value':10, 'label':'property12', 'value':11, 'label' 'property13', 'value':12, 'label': 'property14', 'value':13), 'label': 'B737-500', 'value': 14, 'label': 'B737-700' 'value':15, 'label':'B737-800', 'value':16, 'label':'B737-900' 'value':17, 'label':'8747-100' 'value':18, 'label':B747-200 'value':19, 109 110 llExternal Libraries Scratches and Consoles 112 113 Scratches Panda scratch. py 115 116 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132if_name_main__' 133 134 values-I ' I , ], style'columnCount': 2) app.run_server(debug True) Run: Dashboard /Users/claudiatiller/PycharmProjects/AerohacksDashboard/venv/bin/python /Users/claudiatiller/Desktop/Dashboard.py Running on Debugger PIN: 291-195-304 * Serving Flask app "Dashboard" (lazy loading) Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. Debug mode: on Running on Debugger PIN : 507-832-556 01234 1111000000 912 333344 1 es-2345 dl pr pr pr pr pr pr AerohacksDashboard [/PycharmProjects/AerohacksDashboard] - /Desktop/Da /-Users | claudiatiller-Desktop R. Dashboard, py e t Dashboard.pyX Project AerohacksDashboard-Pycharr 108 'label': 'property3', 'value':2 'label':'property4, 'value':3 'label': 'property5, 'value': 4, 'label': 'property6', 'value': 5, 'label': 'property7, 'value': 6, 'label': 'property8', 'value':7, 'label': 'property9', 'value': 8, 'label':'property10', 'value':9, 'label': 'property11', 'value':10, 'label':'property12', 'value':11, 'label' 'property13', 'value':12, 'label': 'property14', 'value':13), 'label': 'B737-500', 'value': 14, 'label': 'B737-700' 'value':15, 'label':'B737-800', 'value':16, 'label':'B737-900' 'value':17, 'label':'8747-100' 'value':18, 'label':B747-200 'value':19, 109 110 llExternal Libraries Scratches and Consoles 112 113 Scratches Panda scratch. py 115 116 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132if_name_main__' 133 134 values-I ' I , ], style'columnCount': 2) app.run_server(debug True) Run: Dashboard /Users/claudiatiller/PycharmProjects/AerohacksDashboard/venv/bin/python /Users/claudiatiller/Desktop/Dashboard.py Running on Debugger PIN: 291-195-304 * Serving Flask app "Dashboard" (lazy loading) Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. Debug mode: on Running on Debugger PIN : 507-832-556 01234 1111000000 912 333344 1 es-2345 dl pr pr pr pr pr prStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started