Thank you, Adam, for creating such helpful content, you made my work life easy, I have created end to end dashboard for my office and it was only possible by watching your informative and resourceful vidios.
I love his videos too and have created a dashboard locally which I would like our company staff to use. @Bhagyesh How did you manage to handle user authentication and things like restricting a part of data to certain users?
Thank you, concise and resourceful. Well, I have a doubt- in Row 2 Column with graph width 6 for a sunburst chart, Row 2 (same row) two HTML cards (example: companies and reaction) width 2 each, now immediately below HTML card can I have another graph? Because the new graph in row 2 will be taking columns of already allotted HTML cards so is this possible (hope making sense and u et the wireframe )? kindly assist I have been trying this for a while. Thanks again.
Hi Adam! Thanks for creating this channel! Quick question, i am creating a multi page app and the problem im having is the @app.callback ( ) works with a one page app.. but when i have 5 pages.. for example... app.py.. and index.py which is the main... and then multiply pages.. 1.py.. 2.py... and inside 1.py i have put this whole linkedin page.. the @app.callback() dont work? do i have to rename it to @layout.callback? or for the page name like 1.callback() for the file 1.py???? I cant seem to get any of my pages to work that have an @app.callback() in them.. Any help would be appreciated! Thanks again.. I signed up for your paid sub...
Hi @EAM, Thank you for supporting my channel and my efforts. This is a really nice coincidence because I'm actually recording a new tutorial that focuses on dash app with tabs. This tutorial might help you. Are you trying multiple tabs or multiple pages in your app?
@@CharmingData Hi, I am doing a multi page app(following your vids-about 10 pages so far w/some tabs being drop downs with multiple tabs for pages.. so I have the basic app.py file you used in your multi-page vid, and index.py w/ most of the organization code to nav to pages(im using a navbar)and the problem I have is.. w/a one page app the code for the app.callback() works to render/view the code for my live charts( I used the financial api you used in your api vid)..but when I include that page in my multi page app.. the chart won't update live.. no stock chart comes up? do I need to change the app.callback()??? also doesn't seem to like the interval part.. any help would be appreciated! love the vids.. im building a big data analytics app and been looking for tool to use and dash is great!
@@eam2036 HI @EAM, that's a very specific question. It's really hard to say without seeing the code and going over it. It could be many different things. For example, one thing is that you shouldn't include this line of code that I have in the app file. app = dash.Dash(__name__). Also, does the financial app that I created work for you alone on one page outside of the multipage app you're creating? Do you get a specific error, or just no chart comes up?
@@CharmingData Hi Adam, thanks for answering me. The app works fine in a one page app.. the chart displays with the stock data coming in fine... but when I use app.py as this import dash import dash_auth app = dash.Dash(__name__, suppress_callback_exceptions=True, meta_tags=[{'name': 'viewport', 'content': 'width=device-width, initial-scale=1.0'}], ) server = app.server --------------------------------------- and then an index.py file for the multi page app structure like u did in your vid.. and the link I use for the page goes to live.py.. which is... import pandas as pd import plotly import plotly.express as px from app import app import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from dash.exceptions import PreventUpdate from alpha_vantage.timeseries import TimeSeries key = '4D2' ts = TimeSeries(key, output_format='pandas') tsla_data, tsla_meta_data = ts.get_intraday( symbol='TSLA', interval='1min', outputsize='compact') print(tsla_meta_data) df = tsla_data.copy() print(df.head()) df = df.transpose() print(df.head()) df.rename(index={"1. open": "open", "2. high": "high", "3. low": "low", "4. close": "close", "5. volume": "volume"}, inplace=True) df = df.reset_index().rename(columns={'index': 'indicator'}) print(df.head()) df = pd.melt(df, id_vars=['indicator'], var_name='date', value_name='rate') df = df[df['indicator'] != 'volume'] print(df[:15]) layout = html.Div([ dcc.Interval( id='my_interval', n_intervals=0, # number of times the interval was activated interval=120*1000, # update every 2 minutes ), dcc.Graph(id="world_finance"), ]) @app.callback( Output(component_id='world_finance', component_property='figure'), [Input(component_id='my_interval', component_property='n_intervals')] ) def update_graph(n): """Pull financial data from Alpha Vantage and update graph every 2 minutes""" tsla_data, tsla_meta_data = ts.get_intraday( symbol='TSLA', interval='1min', outputsize='compact') df = tsla_data.copy() df = df.transpose() df.rename(index={"1. open": "open", "2. high": "high", "3. low": "low", "4. close": "close", "5. volume": "volume"}, inplace=True) df = df.reset_index().rename(columns={'index': 'indicator'}) df = pd.melt(df, id_vars=['indicator'], var_name='date', value_name='rate') df = df[df['indicator'] != 'volume'] print(df[:15]) line_chart = px.line( data_frame=df, x='date', y='rate', color='indicator', title="Stock: {}".format(tsla_meta_data['2. Symbol']) ) return (line_chart) ----------------------------------- and what show up is an empty chart grid.. I can see the outline of the chart but no stock data coming in.. I see x and y axis and grid but no line chart inside with stock data.. I guess I have to change the app.callback because its in multi page? THANKS!
Hi Adam, Thanks for the Tutorial. It really introduced me to Dash. I have a problem when preforming 'c'. The @app.callback does not seem to be triggered and I'm not sure why. I use dash 2.1.0
Hello, I mean I know only try to update the card details with the numbers from the data. So I have read the csv files using pandas and built the callback function exactly as you did. When I try to print the df or the length inside the small_card_update function nothing gets printed.
Thank you, Adam, for creating such helpful content, you made my work life easy, I have created end to end dashboard for my office and it was only possible by watching your informative and resourceful vidios.
you're welcome, @Bhagyesh
I love his videos too and have created a dashboard locally which I would like our company staff to use. @Bhagyesh How did you manage to handle user authentication and things like restricting a part of data to certain users?
Charming Data is one stop shop for dash applications !! Totally love it
This is amazing content - thankyou
You're welcome VAE. Thanks for watching.
Could this be done for other social media such as FB or TikTok?
Yes. You just need to connect to their data, probably through an API
Thank you, concise and resourceful. Well, I have a doubt- in Row 2 Column with graph width 6 for a sunburst chart, Row 2 (same row) two HTML cards (example: companies and reaction) width 2 each, now immediately below HTML card can I have another graph? Because the new graph in row 2 will be taking columns of already allotted HTML cards so is this possible (hope making sense and u et the wireframe )? kindly assist I have been trying this for a while. Thanks again.
Hi Adam, is it possible to put two Cards side-by-side in an other Card? If I put two Cards in one Card, this come among each other.
Thx
Great data science content as always bro👏
Adam thx for the tutorial, i d'like to know how can i change the background of the page to a image ??? is it possible ?
Hi Guilherme, this might help you: community.plotly.com/t/add-background-image-to-html-div/12453
Hi Adam! Thanks for creating this channel! Quick question, i am creating a multi page app and the problem im having is the @app.callback ( ) works with a one page app.. but when i have 5 pages.. for example... app.py.. and index.py which is the main... and then multiply pages.. 1.py.. 2.py... and inside 1.py i have put this whole linkedin page.. the @app.callback() dont work? do i have to rename it to @layout.callback? or for the page name like 1.callback() for the file 1.py???? I cant seem to get any of my pages to work that have an @app.callback() in them.. Any help would be appreciated! Thanks again.. I signed up for your paid sub...
Hi @EAM,
Thank you for supporting my channel and my efforts. This is a really nice coincidence because I'm actually recording a new tutorial that focuses on dash app with tabs. This tutorial might help you. Are you trying multiple tabs or multiple pages in your app?
@@CharmingData Hi, I am doing a multi page app(following your vids-about 10 pages so far w/some tabs being drop downs with multiple tabs for pages.. so I have the basic app.py file you used in your multi-page vid, and index.py w/ most of the organization code to nav to pages(im using a navbar)and the problem I have is.. w/a one page app the code for the app.callback() works to render/view the code for my live charts( I used the financial api you used in your api vid)..but when I include that page in my multi page app.. the chart won't update live.. no stock chart comes up? do I need to change the app.callback()??? also doesn't seem to like the interval part.. any help would be appreciated! love the vids.. im building a big data analytics app and been looking for tool to use and dash is great!
@@eam2036 HI @EAM, that's a very specific question. It's really hard to say without seeing the code and going over it. It could be many different things. For example, one thing is that you shouldn't include this line of code that I have in the app file. app = dash.Dash(__name__).
Also, does the financial app that I created work for you alone on one page outside of the multipage app you're creating?
Do you get a specific error, or just no chart comes up?
@@CharmingData Hi Adam, thanks for answering me. The app works fine in a one page app.. the chart displays with the stock data coming in fine... but when I use app.py as this
import dash
import dash_auth
app = dash.Dash(__name__, suppress_callback_exceptions=True,
meta_tags=[{'name': 'viewport',
'content': 'width=device-width, initial-scale=1.0'}],
)
server = app.server
---------------------------------------
and then an index.py file for the multi page app structure like u did in your vid.. and the link I use for the page goes to live.py.. which is...
import pandas as pd
import plotly
import plotly.express as px
from app import app
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate
from alpha_vantage.timeseries import TimeSeries
key = '4D2'
ts = TimeSeries(key, output_format='pandas')
tsla_data, tsla_meta_data = ts.get_intraday(
symbol='TSLA', interval='1min', outputsize='compact')
print(tsla_meta_data)
df = tsla_data.copy()
print(df.head())
df = df.transpose()
print(df.head())
df.rename(index={"1. open": "open", "2. high": "high", "3. low": "low",
"4. close": "close", "5. volume": "volume"}, inplace=True)
df = df.reset_index().rename(columns={'index': 'indicator'})
print(df.head())
df = pd.melt(df, id_vars=['indicator'], var_name='date', value_name='rate')
df = df[df['indicator'] != 'volume']
print(df[:15])
layout = html.Div([
dcc.Interval(
id='my_interval',
n_intervals=0, # number of times the interval was activated
interval=120*1000, # update every 2 minutes
),
dcc.Graph(id="world_finance"),
])
@app.callback(
Output(component_id='world_finance', component_property='figure'),
[Input(component_id='my_interval', component_property='n_intervals')]
)
def update_graph(n):
"""Pull financial data from Alpha Vantage and update graph every 2 minutes"""
tsla_data, tsla_meta_data = ts.get_intraday(
symbol='TSLA', interval='1min', outputsize='compact')
df = tsla_data.copy()
df = df.transpose()
df.rename(index={"1. open": "open", "2. high": "high", "3. low": "low",
"4. close": "close", "5. volume": "volume"}, inplace=True)
df = df.reset_index().rename(columns={'index': 'indicator'})
df = pd.melt(df, id_vars=['indicator'],
var_name='date', value_name='rate')
df = df[df['indicator'] != 'volume']
print(df[:15])
line_chart = px.line(
data_frame=df,
x='date',
y='rate',
color='indicator',
title="Stock: {}".format(tsla_meta_data['2. Symbol'])
)
return (line_chart)
-----------------------------------
and what show up is an empty chart grid.. I can see the outline of the chart but no stock data coming in.. I see x and y axis and grid but no line chart inside with stock data.. I guess I have to change the app.callback because its in multi page? THANKS!
@@eam2036 Can you please put the files up on Github or send them to me so I can try to run it on my computer. adam@charming-data.com
Can you do videos on sentiment analysis please
Hi Saly, I'll try. Thanks for watching
Hi Adam,
Thanks for the Tutorial. It really introduced me to Dash.
I have a problem when preforming 'c'. The @app.callback does not seem to be triggered and I'm not sure why.
I use dash 2.1.0
Hi Ali, what do you mean by preforming c?
Hello, I mean I know only try to update the card details with the numbers from the data. So I have read the csv files using pandas and built the callback function exactly as you did. When I try to print the df or the length inside the small_card_update function nothing gets printed.
@@alisultan340 hi. It's hard to say. I would need to see the code
Hi, I built a similar app. But I am getting errors while filtering data. Can you please help me?
Hi Vaidehi,
I actually offer help on my Patreon. Feel free to check it out for personal support:
www.patreon.com/charmingdata
@@CharmingData Thank you. I will :)