Comments (10)
Hi
What you are now seeing in the master is basically my Dashboards.jl package that provided only basic Dash functionality. Now there is a lot of work on bringing its functionality to the level of Dash in the dev branch.
For example, right now I'm working on the hot reload. But in addition to it, there are many other things that are in Dash that are not yet in Dash.jl. Please be patient, we will definitely bring Dash.jl to the level of other products from the PlotlyDash ecosystem.
from dash.jl.
@00krishna dev is already very different from master
from dash.jl.
Thanks @waralex I totally understand. I am new to even python Dash, so I have a parallel process of pushing my julia code through pyjulia and using python Dash, versus native Julia dash. So that is cool. I will keep playing around with the Julia dash, just to see how it is working. Let me know if I can be of any assistance.
from dash.jl.
Dash for Python's "hot-reloading" feature is described in plotly/dash#66, plotly/dash#362, and plotly/dash-renderer#73.
Supporting this as in the Python and R implementations would require
- creating a hash at app initialization, and regenerating it on file change
- adding a route to serve the hash
- front-end hot reloading (including ability to refresh layout only when CSS updates occur, as well as formatting the JSON response with a modified file manifest)
- back-end hot reloading (reload the app, restart HTTP.jl)
- adding parameters for the dev tools UI:
dev_tools_hot_reload
,dev_tools_hot_reload_interval
,dev_tools_hot_reload_watch_interval
,dev_tools_silence_routes_logging
- integration tests for "hard" (restart backend app, reload frontend) and "soft" (CSS only = layout refresh) reloading as in Python and R
On the Python side, we use the Flask debug reloader to reset the hash. We would need to find a comparable approach using HTTP.jl instead.
from dash.jl.
@waralex Alexandr, so should the hot-reload feature work now? Seems to indicate that the PR was merged.
from dash.jl.
@00krishna Yes, it works in dev branch.
from dash.jl.
Oh excellent. Nice to know. I can give it a try. If I have any issues, I can always flip back to master branch.
from dash.jl.
Maybe this is a stupid question, but how does the hot reloading work practically?
I'm on dev branch and I have my app defined as a module like this:
module MyApp
using Dash
using DashHtmlComponents
using DashCoreComponents
app = dash(external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"])
app.layout = html_div() do
dcc_input(id = "my-id", value="initial value", type = "text"),
html_div(id = "my-div")
end
callback!(app, Output("my-div", "children"), Input("my-id", "value")) do input_value
"You've entered $(input_value)"
end
end
I tried the following:
(1.3) pkg> activate .
Activating environment at `~/Documents/Julia/MyApp/Project.toml`
julia> using Revise
julia> using MyApp
julia> run_server(MyApp.app, "127.0.0.1", 8080; debug=true)
┌ Warning: Hot reloading is disabled for interactive sessions. Please run your app using julia from the command line to take advantage of this feature.
└ @ Dash ~/.julia/packages/Dash/b6VP7/src/Dash.jl:142
[ Info: Running on http://127.0.0.1:8080
So I put the above code in a file called runserver.jl
and from the command line I did
julia --startup-file=no runserver.jl
where I get the following output:
Activating environment at `~/Documents/Julia/MyApp/Project.toml`
Activating environment at `~/Documents/Julia/MyApp/Project.toml`
[ Info: Running on http://127.0.0.1:8080
If I now change the code in my module nothing happens, even if I refresh the page in my browser.
It would be awesome if you guys could give me a hint.
from dash.jl.
Hi @MLackner
Yes, this may be my mistake - autoreload will not work in this form. Autoreload monitors the executed file and all files included in it (recursively) via include
. However, it does not track changes in external packages connected via using
or import
. If you change runserver.jl, then a restart should occur
from dash.jl.
This feature was added in #25, and is available now in the version released to the Julia Registry. Closing this issue as resolved.
from dash.jl.
Related Issues (20)
- Can Plotly Dash animations display buttons and sliders? HOT 6
- ArgumentError: Distributed.var doesn't have a defined StructTypes.StructType HOT 2
- 3D plot combining line and surface HOT 2
- Feature: Type -> Component mapping with weakdeps
- Using python libs in Dash.jl
- Write (python) dash vs Dash.jl feature comparison table HOT 4
- markdown with latex support HOT 1
- Warning during precompilation HOT 1
- Advanced checklist HOT 1
- Support background callbacks HOT 1
- Support figures generated by Plots.jl with a PlotlyBackend HOT 1
- UndefVarError for html components HOT 3
- Try Dash.jl with React 18
- Move `DashBase.to_dash` type-piracy definitions to DashBase repo HOT 2
- Experiment with `PrecompileTools.jl` to speed up TTFX
- Test failing with Julia 1.10.0-beta3 HOT 2
- Circular callbacks with multiple callbacks seem to work HOT 2
- Accept app root path as kwarg to `dash` method? HOT 5
- Why has the DashCoreResources repo been archived? HOT 9
- Editable Tables examples not working HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash.jl.