plotly-dash

Flask-Babel not working on the login page

∥☆過路亽.° 提交于 2019-12-08 11:48:05
问题 I have a Flask/Dash app that uses the Flask-Babel module. The translation works like a charm after logging in and browsing through pages. However, I cannot make it work for the login page which will always be displayed in English. The messages.po and messages.mo both contain the translation strings I prepared for the login page, so the compilation part seems to work fine. Here's a snippet from my app.py (with a hard-coded choice of Spanish): import dash from dash.dependencies import Input,

Plotly-Dash: Want two stacked bar charts side by side from single df column

心不动则不痛 提交于 2019-12-08 05:08:17
问题 I am trying to get two stacked bar charts side by side but cannot figure it out. Here's an example df: Field Issue Police Budget cuts Research Budget cuts Police Time consuming Banking Lack of oversight Healthcare Lack of support Research Bureaucracy Healthcare Bureaucracy Banking Mistrust What I want is a stacked bar chart of of field first. It will have a height of 8 broken down by 2 police, 2 x research etc. Then I want a stacked bar chart of Issue next to the first chart. This second one

Launch Dash from Jupyter Notebook

纵饮孤独 提交于 2019-12-07 17:02:29
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. 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 documentation and examples to implement it successfully within jupyter. It worked for me. DON'T understimate this

Plotly-Dash: Want two stacked bar charts side by side from single df column

我与影子孤独终老i 提交于 2019-12-06 21:57:36
I am trying to get two stacked bar charts side by side but cannot figure it out. Here's an example df: Field Issue Police Budget cuts Research Budget cuts Police Time consuming Banking Lack of oversight Healthcare Lack of support Research Bureaucracy Healthcare Bureaucracy Banking Mistrust What I want is a stacked bar chart of of field first. It will have a height of 8 broken down by 2 police, 2 x research etc. Then I want a stacked bar chart of Issue next to the first chart. This second one will have a height of 8 and be stacked by 2 x budget cuts, 1 x time consuming, 1 x lack of oversight

Multi-Page Dash Application

こ雲淡風輕ζ 提交于 2019-12-05 18:17:49
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 import DispatcherMiddleware import os import pandas as pd import dash import flask import dash import dash

How to Range Slider and Selector with Plotly-Dash

血红的双手。 提交于 2019-12-05 06:48:54
问题 I am trying to recreate this Plotly example with Dash, but I cannot get the buttons and the range slider. Does anyone know how I can do this? That's what I tried: traces =[{ 'x':df.index, 'y':df.level, 'type': 'scatter', 'mode': 'lines', 'name': 'a_level' }] graphs.append(dcc.Graph( id='a_level', figure={ 'data': traces, 'layout': { 'type': 'date', 'rangeslider': {'visible':True}, 'margin': {'b': 0, 'r': 10, 'l': 60, 't': 0} } } ) 回答1: The RangeSlider is a Dash Core Component, it's not an

AppEngine warning - OpenBLAS WARNING - could not determine the L2 cache size on this system

*爱你&永不变心* 提交于 2019-12-01 04:54:45
问题 I try to deploy application on the GC AppEngine. There are no errors during deploy process but application doesn't work (Just show loading page). The only one strange raw in logs OpenBLAS WARNING - could not determine the L2 cache size on this system By the way - it works well on my local machine. This is python web app based on Dash framework My app.yaml: runtime: python37 service: service-name instance_class: F2 entrypoint: gunicorn -b :$PORT main:app.server Requirements.txt: Flask==1.0.2

Saving Dash layout to html

孤者浪人 提交于 2019-12-01 01:54:52
I plotted a bunch of things in a dash layout. I want to save them to an html file so I can look at them later. when I reopen the saved html file, I first see everything correctly. However, within <1s, the page goes blank and I get an error: “Error loading layout”. (see gif below) How can this be fixed? Thanks! This solution is not fully working: You have to save your Webpage complete. To prevent the javascript creating any errors i have removed the bundle(2).js file. This file contains the function dash_renderer which tries to interact with the server and creates issues. <footer> <script id="

Dash core component for basic Button with click event?

孤者浪人 提交于 2019-11-30 17:41:55
问题 I'm trying to create an app with multiple tabs for different sets of information. My first thought was to use html Buttons but there's not dash_core_component for this, and I can't find documentation on anything I can use in it's place. Basically, when I click a button (or link), I'd like to get a "clicked" event with the id of the button so I can redraw the layout for the selected page. Is there a way to do this with existing components? Is there documentation on how to create new components

Running a Dash app within a Flask app

冷暖自知 提交于 2019-11-26 15:19:34
问题 I have an existing Flask app, and I want to have a route to another app . More concretely, the second app is a Plotly Dash app. How can I run my Dash app within my existing Flask app? @app.route('/plotly_dashboard') def render_dashboard(): # go to dash app I also tried adding a route to the Dash instance, since it's a Flask app, but I get the error: AttributeError: 'Dash' object has no attribute 'route' 回答1: From the docs: The underlying Flask app is available at app.server . import dash app