This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dash | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| import pandas as pd | |
| import numpy as np | |
| from dash.dependencies import Output, Input | |
| data = pd.read_csv("avocado.csv") | |
| data["Date"] = pd.to_datetime(data["Date"], format="%Y-%m-%d") | |
| data.sort_values("Date", inplace=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dash | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| import pandas as pd | |
| data = pd.read_csv("avocado.csv") | |
| data = data.query("type == 'conventional' and region == 'Albany'") | |
| data["Date"] = pd.to_datetime(data["Date"], format="%Y-%m-%d") | |
| data.sort_values("Date", inplace=True) | |
| external_stylesheets = [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| html.Div( | |
| children=[ | |
| html.Div( | |
| children=dcc.Graph( | |
| id="price-chart", | |
| config={"displayModeBar": False}, | |
| figure={ | |
| "data": [ | |
| { | |
| "x": data["Date"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .header-description { | |
| color: #CFCFCF; | |
| margin: 4px auto; | |
| text-align: center; | |
| max-width: 384px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.layout = html.Div( | |
| children=[ | |
| html.Div( | |
| children=[ | |
| html.P(children="🥑", className="header-emoji"), | |
| html.H1( | |
| children="Avocado Analytics", className="header-title" | |
| ), | |
| html.P( | |
| children="Analyze the behavior of avocado prices" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| external_stylesheets = [ | |
| { | |
| "href": "https://fonts.googleapis.com/css2?" | |
| "family=Lato:wght@400;700&display=swap", | |
| "rel": "stylesheet", | |
| }, | |
| ] | |
| app = dash.Dash(__name__, external_stylesheets=external_stylesheets) | |
| app.title = "Avocado Analytics: Understand Your Avocados!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .header-title { | |
| font-size: 48px; | |
| color: red; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| html.H1( | |
| children="Avocado Analytics", | |
| className="header-title", | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| html.H1( | |
| children="Avocado Analytics", | |
| style={"fontSize": "48px", "color": "red"}, | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dash | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| import pandas as pd | |
| data = pd.read_csv("avocado.csv") | |
| data = data.query("type == 'conventional' and region == 'Albany'") | |
| data["Date"] = pd.to_datetime(data["Date"], format="%Y-%m-%d") | |
| data.sort_values("Date", inplace=True) |