Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
etpinard opened this issue Apr 24, 2023 · 4 comments
Open

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

etpinard opened this issue Apr 24, 2023 · 4 comments
Labels
priority Dash.jl tasks that should be completed prior to non-priority items

Comments

@etpinard
Copy link
Collaborator

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

Resources:

@etpinard etpinard added the priority Dash.jl tasks that should be completed prior to non-priority items label Jun 13, 2023
@etpinard
Copy link
Collaborator Author

etpinard commented Jun 28, 2023

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

  • from dash v1.16.0, app.csp_hashes()
  • from dash v1.19.0 input-output callbacks
  • from dash v1.20.0 app(; extra_hot_reload_paths=#= =#)

Things that are missing from Dash.jl since dash v2

note the dash v2 was released on 2021-08-03 🙃

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

Dash.jl resources were updated in #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
Copy link
Collaborator Author

etpinard commented Jul 4, 2023

Update

dcc_geolocation just works ✔️ 🎉 🍾

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

see Julia snippet
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
Copy link
Collaborator Author

Update

dcc_location refresh="callback-nav"

does not work ❌

Translating this "callback-nav" test

see Julia snippet
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
Copy link
Collaborator Author

Update

Component as props does not work ❌

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority Dash.jl tasks that should be completed prior to non-priority items
Projects
None yet
Development

No branches or pull requests

1 participant