richlegrand / dash_devices Goto Github PK
View Code? Open in Web Editor NEWThis project forked from plotly/dash
A fork of plotly/dash to help Dash deal with devices.
Home Page: https://plotly.com/dash
License: MIT License
This project forked from plotly/dash
A fork of plotly/dash to help Dash deal with devices.
Home Page: https://plotly.com/dash
License: MIT License
I run the server with this:
app.run_server(
debug=False,
host='0.0.0.0',
loop=main_thread_loop,
dev_tools_hot_reload=False,
)
dash 1.13.4
dash-bootstrap-components 0.10.0
dash-core-components 1.10.1
dash-daq 0.5.0
dash-devices 0.1.2
dash-html-components 1.0.3
dash-pivottable 0.0.1
dash-renderer 1.5.1
dash-table 4.8.1
- OS: WSL
- Browser: Edge chrome
Describe the bug
Whenever I change and save code of dependencies of the dash file, it always seems try to reload and fail:
Traceback (most recent call last):
File "jat/jat/trade_dash.py", line 605, in <module>
app.run_server(
File "/home/lxuwsl/miniconda3/lib/python3.8/site-packages/dash_devices/dash.py", line 1987, in run_server
self.server.run(host=host, port=port, debug=debug, **flask_run_options)
File "/home/lxuwsl/miniconda3/lib/python3.8/site-packages/quart/app.py", line 1400, in run
loop.run_until_complete(serve(self, config))
File "/home/lxuwsl/miniconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/lxuwsl/miniconda3/lib/python3.8/site-packages/hypercorn/asyncio/__init__.py", line 39, in serve
await worker_serve(app, config, shutdown_trigger=shutdown_trigger)
File "/home/lxuwsl/miniconda3/lib/python3.8/site-packages/hypercorn/asyncio/run.py", line 157, in worker_serve
restart()
File "/home/lxuwsl/miniconda3/lib/python3.8/site-packages/hypercorn/utils.py", line 168, in restart
os.execv(executable, [executable] + args)
OSError: [Errno 8] Exec format error
That's weird.
This is really a great project and thanks for making it available. But I wonder what the status is. Looking at it today it's 3k+ commits behind the plotly/dash project. How are we compatible with latest version dash? And what's the longer term strategy of this project? Thanks.
There are some features in newer versions of dash which would be nice to have support for in dash_devices. I'm specifically thinking of the "title" and "update_title" arguments which can be passed to the Dash constructor in vanilla dash.
Resolved: when downgrading from dash version 2.0.0 to 1.12 it worked.
Environment:
dash 2.0.0
dash-core-components 2.0.0
dash-daq 0.1.7
dash-devices 0.1.4
dash-html-components 2.0.0
dash-renderer 1.0.0
dash-table 5.0.0
if frontend related, tell us your Browser, Version and OS
Error thrown in console when trying to run example1.py script
Nothing gets rendered to screen. which I think makes sense based on the error.
I expected to be able to run the example script based on the readme.
I doubt this is an actual issue, I could just be missing something simple.
Screenshots
If applicable, add screenshots or screen recording to help explain your problem.
Hi,
I would like to use quart_auth module for login/logout handling. To use this, I need access to the quart application context, but for some reason i cant. Do anyone have an example for getting the current application context, that I can use for storing user login information?
Really cool project, made my day! Can't wait to use it. Been waiting for Dash websocket support for a long time. And the shared-callback model is really clear to understand. Great work.
I want to make a button that changes its text upon click and triggers the next callback (plot update)
@app.callback(
[Output("interval-graph", "disabled"),
Output("start-record-button", "buttonText")],
[Input("start-record-button", "n_clicks")],
[State("interval-graph", "disabled")],
)
def stop_GraphUpdate(n_clicks, current):
if n_clicks == 0:
return True, "Start record"
return not current, "Stop Record" if current else "Start Record"
However, if I use callback_shared
(which I want), page never loads and the Python script cannot be stopped with Ctrl + C
.
Env
dash 1.13.4
dash-bootstrap-components 0.11.3
dash-core-components 1.10.1
dash-daq 0.5.0
dash-devices 0.1.3
dash-html-components 1.0.3
dash-renderer 1.5.1
dash-table 4.8.1
Describe the bug
What causes a problem is a button callback. If simplified:
import dash_devices
from dash_devices.dependencies import Input, Output, State
import dash_html_components as html
import dash_core_components as dcc
app = dash_devices.Dash(__name__)
app.config.suppress_callback_exceptions = True
app.layout = html.Div([
html.Button(
id = 'start-stop',
n_clicks=0
style={'width': 150, 'height':50, 'color':'orange'}
),
])
@app.callback_shared(
Output("start-stop", "children"),
[Input("start-stop", "n_clicks")],
)
def button_text(n_clicks):
if n_clicks == 0 or n_clicks %2 == 0:
return "Start"
else:
return 'Stop'
if __name__ == "__main__":
app.run_server(
debug=True,
host='localhost', port = 5000)
Which leads to infinite page loading.
Expected behavior
Observed only for callback_shared
, callback
behaves as it should.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.