plotly-dash

Plot multiple columns on line graph using Dash/Plotly

被刻印的时光 ゝ 提交于 2019-12-13 08:36:14
问题 I have a table that has looks like this ... ticker,price1y,price2y,price3y,price5y, aapl,12,23,47,69, tsla,-9,24,54,190, att,-10,23,34,35, I would like to plot these using pandas plotly in dash to show price1y price2y ... price5y along the x axis and % change up the y axis. i need to be able to select multiple values to add to the graph using dash's callback feature. i currently create a dash_core_components graph however i have been unsuccessfully in plotting to this. app.layout = html.Div([

Why is Dash giving a parse error when uploading files?

…衆ロ難τιáo~ 提交于 2019-12-13 03:40:52
问题 Uploading Excel or CSV results in an error. I followed the Dash demo, but as soon as I try to extend it to do something like plotting, it doesn't work. I don't want to just show a table. The Dash_Table function was updated, so previous examples that used Dash_Table_Experiments no longer work I've spent the whole night on stack exchange, tinkering with my code and reading other solutions. the full working code is provided below. I'd like to also add a drop down call back function to "filter"

how to show wordcloud image on dash web application

泪湿孤枕 提交于 2019-12-12 18:15:19
问题 I need to render a wordcloud on my dash application. According to this thread https://community.plot.ly/t/solved-is-it-possible-to-make-a-wordcloud-in-dash/4565, there is no wordcloud build-in component in dash. One workaround is to use WordCloud module to produce the wordcloud as image and use dash_html_components.Img to show on layout. I'm new to Dash. Not sure how I can render the image. Do I need to save wordcloud as temp image everytime I produce a wordcloud? Really appreciate it if

Failed to find application object 'server' in 'app'

此生再无相见时 提交于 2019-12-12 14:30:25
问题 I am trying to serve a Dash app using Heroku. I have 5 files in my app: .gitignore venv *.pyc .DS_Store .env app.py import os import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import pandas as pd # Read in the data districts_change = pd.read_csv("https://github.com/thedatasleuth/New-York-Congressional-Districts/blob/master/districts_change.csv?raw=True") df = districts_change.drop(['TOTAL'], axis=1) # Get a list of all the

Dash output with multiple inputs

僤鯓⒐⒋嵵緔 提交于 2019-12-11 17:42:42
问题 I am trying to have a dash component properly input variables and give appropriate output. Currently multiple inputs will make the functionality not work. I've put multi=true for my dcc dropdown - hasn't worked successfully yet. This is the code I have used. import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import pandas as pd import plotly.graph_objs as go df = pd.read_excel('FreewayFDSData.xlsx', 'Volume', parse

Plotting 3 pie charts side-by-side using the domain property

爷,独闯天下 提交于 2019-12-11 17:22:04
问题 I am trying to plot 3 pie charts side by side. I don't understand why the following code is making the pie charts go across the page diagonally left to write rather than horizontally left to write in one line. Here's my code: app.layout = html.Div([ html.Div([ dcc.Graph(id='TPiePlot', figure={ 'data': [go.Pie(labels=labels1, values=values1, marker=dict(colors=colors, line=dict(color='#fff', width=1)), hoverinfo='label+value+percent', textinfo='value', domain={'x': [0, .25], 'y': [0, 1]} ) ],

dash plotly - create a dropdown menu dynamically, selection of multiple rows, table export?

时光怂恿深爱的人放手 提交于 2019-12-11 10:14:21
问题 I have a data set that looks like this: cat_id author year publisher country value (dollars) name1 kunga 1998 D and D Australia 10 name2 siba 2001 D and D UK 20 name3 siba 2001 D and D US 20 name3 shevara 2001 D and D UK 10 name3 dougherty 1992 D and D Australia 20 name4 ken 2011 S and K Australia 10 I want to turn this into a table in plotly dash. I have most of the code that I want set up: #!/usr/bin/env python import dash from dash.dependencies import Input, Output, State import dash_table

How to use a button to trigger callback updates?

只愿长相守 提交于 2019-12-11 03:50:03
问题 I am just getting started with dash. Taking the example from here. I want to convert the dash app below import dash from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html app = dash.Dash() app.layout = html.Div([ dcc.Input(id='my-id', value='initial value', type="text"), html.Div(id='my-div') ]) @app.callback( Output(component_id='my-div', component_property='children'), [Input(component_id='my-id', component_property='value')] ) def

Plotly-Dash has unknown issue and creates “Error loading dependencies” by using Python-pandas.date_range

本秂侑毒 提交于 2019-12-11 01:09:29
问题 I stumbled upon this post and used the modification mentioned in the comment of the final answer for my own program. But before I tried to test it with the following code: import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import pandas as pd app = dash.Dash() daterange = pd.date_range(start='1994',end='2018',freq='W') app.layout = html.Div(children=[ html.H1('Range Slider Testing'), html.Div( [ html.Label('From 1994 to 2018', id=

How can we create data columns in Dash Table dynamically using callback with a function providing the dataframe

笑着哭i 提交于 2019-12-08 16:14:58
问题 I am trying to create dash table on Web using Inputs. However the issue is that the data is created from database from the callback and a priori, I do not know the names of the columns unless the pandas dataframeis created using the callback function. I have checked that I getting correct data. However not able to display it. I have used multiple output options (using Dash 0.41) My code looks as follows: ( I have not provided the details of the function which generates the pandas dataframe in