plotly / Dash.jl

Dash for Julia - A Julia interface to the Dash ecosystem for creating analytic web applications in Julia. No JavaScript required.
MIT License
489 stars 40 forks source link

Write (python) dash vs Dash.jl feature comparison table #200

Open etpinard opened 1 year ago

etpinard commented 1 year ago

and put it in the Dash.jl README.md somewhere?

Resources:

etpinard commented 1 year ago

Tentative list

Things that are missing from Dash.jl since before Dash.jl v1 (and dash v1.15.0)

taken from the TODO items in https://github.com/plotly/Dash.jl/projects/1

Things that are missing from Dash.jl from dash v1.x

Things that are missing from Dash.jl since dash v2

note the dash v2 was released on 2021-08-03 :upside_down_face:

Things that maybe just work using resources from dash >= v2.10.2

Dash.jl resources were updated in https://github.com/plotly/Dash.jl/pull/212 after an 18+ month hiatus. The update resources are set to be released as part of the upcoming Dash.jl v1.3.0.

TODO, check if

work in Dash.jl.

etpinard commented 1 year ago

Update

dcc_geolocation just works :heavy_check_mark: :tada: :champagne:

Tested with https://dash.plotly.com/dash-core-components/geolocation translated in Julia as:

see Julia snippet ```jl using Dash app = dash() app.layout = html_div() do html_button("Update Position"; id = "update_btn"), dcc_geolocation(; id = "geolocation"), html_div(; id="text_position") end callback!(app, Output("geolocation", "update_now"), Input("update_btn", "n_clicks")) do click return !isnothing(click) && (click > 1) end callback!(app, Output("text_position", "children"), Input("geolocation", "local_date"), Input("geolocation", "position")) do date, pos isnothing(pos) && return "No position data available" return html_p("As of $date your location was: lat $(pos.lat), lon $(pos.lon), accuracy $(pos.accuracy) meters") end run_server(app, "0.0.0.0", 8080) ```
etpinard commented 1 year ago

Update

dcc_location refresh="callback-nav"

does not work :x:

Translating this "callback-nav" test

see Julia snippet ```jl using Dash app = dash() app.layout = html_div() do dcc_location(; id = "url", refresh = false), dcc_location(; id = "callback-url", refresh = "callback-nav"), html_button("click"; id = "callback-btn", n_clicks=0), html_div(; id = "content") end callback!(app, Output("content", "children"), Input("url", "pathname")) do pathname return if isnothing(pathname) || pathname == "/page-1" html_div("1"; id = "div1") elseif pathname == "/" html_div("base", id = "div0") else "404" end end callback!(app, Output("callback-url", "pathname"), Input("callback-btn", "n_clicks")) do n return if n > 0 "/page-1" else no_update() end end run_server(app) ```

gives

Screencast from 2023-07-11 11-32-18.webm

where the app hangs after pressing the back button.

etpinard commented 1 year ago

Update

Component as props does not work :x:

using Dash

app = dash()

app.layout = html_div() do
    dcc_checklist(; id="checklist",
                  options=[(label=html_h2("H2 label"), value="h2"),
                           (label="plain label", value="plain")])
end

run_server(app, "0.0.0.0", 8080; debug=true)

lead to

image