plotly-dash

placing everything in center of app messes up `DatePickerSingle` and `RadioItems`

左心房为你撑大大i 提交于 2020-01-04 04:53:56
问题 I am building a dash app, which as DatePickerSingle and RadioItems . I've placed everything in center to make it look like it's on mobile phone. Here's my css to center everything in my app: html * { width: 100%; max-width: 500px; margin: auto; } As you can see in the below image, two days from every week are not being displayed and arrows that take the user to next/previous month are shifted. Here's my CSS for DatePickerSingle : .DateInput{ margin: 0; padding: 0; background: #fff; position:

input data from slider to change marker colour

拜拜、爱过 提交于 2020-01-03 13:39:31
问题 Appreciate any help on this task! I'm trying to have this dash app take slider input value to change a variable through a function and then change the marker colour variable only. The code is written in python and uses plotly-dash and plotly and as well as pandas numpy and mapbox. The top part of the code is getting the data into the right format. It has traffic data which is being processed to product a heatmap that shows congestion over time on a map. The dataframe DF is for volume of

input data from slider to change marker colour

扶醉桌前 提交于 2020-01-03 13:39:11
问题 Appreciate any help on this task! I'm trying to have this dash app take slider input value to change a variable through a function and then change the marker colour variable only. The code is written in python and uses plotly-dash and plotly and as well as pandas numpy and mapbox. The top part of the code is getting the data into the right format. It has traffic data which is being processed to product a heatmap that shows congestion over time on a map. The dataframe DF is for volume of

Launch Dash from Jupyter Notebook

和自甴很熟 提交于 2020-01-03 03:06:06
问题 Is there a way I can launch a Dash dahsboard using the below line of code in Jupyter notebook? # if __name__ == '__main__': # app.run_server(debug=True) When I try to launch this I get an error. The only way to correct it is to set debug to false. But then the Dashboard does not update automatically when the data feeding the charts is altered. 回答1: EDIT I just found out that a valuable GitHub user published the following library. This is the direct link to the respective repo. See his

How do I display a website written in Dash as a static PDF (Python)?

我们两清 提交于 2020-01-02 01:59:11
问题 I want to export the site I've made in dash into a static PDF. Here is the code for my site (it's just a chart with 3 columns): import dash import dash_core_components as dcc import dash_html_components as html import pdfkit from flask import Flask, render_template, make_response app = dash.Dash() app.layout = html.Div( className="three columns", children=html.Div([ dcc.Graph( id='right-top-graph', figure={ 'data': [{ 'x': [1, 2, 3], 'y': [3, 1, 2], 'type': 'bar' }], 'layout': { 'height': 400

How to fix 'Dropdown Menu Read' Error in Plotly Dash

北战南征 提交于 2019-12-24 08:59:23
问题 I have tried to re-create the following example Towards Data Science Example shown on the web I have written the following code which I modified to this: 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 # Step 1. Launch the application app = dash.Dash() # Step 2. Import the dataset filepath = 'https://raw.githubusercontent.com/plotly/datasets/master/finance-charts

plotly dash: create multiple callbacks (with loop?)

梦想的初衷 提交于 2019-12-24 08:02:11
问题 Say I have a model with 20 parameters and I made one input component for each param. [dcc.Input(type = 'number', id = 'input %i'%i) for i in range(20)] I want to have one button html.Button('populate parameters', id = 'button populate') that is supposed to populate best pre-fitted value for all the inputs. Code should look like below, except it doesn't work. for i in range(20): @app.callback( dash.dependencies.Output('input %i'%i, 'value'), [dash.dependencies.Input('button populate', 'n

Undefined data using D3-tile within React/Dash

邮差的信 提交于 2019-12-23 22:04:20
问题 I'm trying to duplicate this d3 map example within React so that I can use it as a component in Plotly Dash. However, there is an issue (I think with D3-tile) that's resulting in undefined strings in the opnestreemap urls. This prevents the code from grabbing the actual images for the tiles, and results in the following image: The errors produced as you zoom in look like this: Here is the full MyMap.react.js code. It seems like the error is coming from the tiles variable not being filled with

Multi-Page Dash Application

。_饼干妹妹 提交于 2019-12-22 08:23:41
问题 I'm trying to build a multi page Dash App. When I run the following code, everything works except it won't route to my /dash_1 or /dash_2 urls. Was wondering if someone could help me out. My structure looks like this: dash-project/ app1/ app.py app2/ app.py server.py run.py My run.py code is from app import server as application from app import app import app_1.dash_1 import app_2.dash_2 My app.py code is: from flask import Flask from flask_sqlalchemy import SQLAlchemy from werkzeug.wsgi

Dash(Python) - can't display dataframe in datatable after calculations

与世无争的帅哥 提交于 2019-12-13 18:03:14
问题 I'm reading a text file(.csv mostly) from dash_core_components.Upload . I had no problems printing the file that i've taken. But, problems arise when i do some calculations and try printing that. and the error is: dash.exceptions.InvalidCallbackReturnValue: The callback for property `children` of component `dataframe_output` returned a value which is not JSON serializable. In general, Dash properties can only be dash components, strings, dictionaries, numbers, None, or lists of those. Here's