plotly / Dash.jl

Dash for Julia - A Julia interface to the Dash ecosystem for creating analytic web applications in Julia. No JavaScript required.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic Example returns error

aabills opened this issue · comments

Hello,

The example on the Plotly Documentation:

using DataFrames, CSV, PlotlyJS
using Dash, DashHtmlComponents, DashCoreComponents

iris = dataset(DataFrame, "iris")

p1 = plot(
    iris, x=:sepal_length, y=:sepal_width, color=:species,
    mode="markers", marker_size=8
)

app = dash()

app.layout = html_div() do
    html_h4("Iris Sepal Length vs Sepal Width"),
    dcc_graph(
        id="example-graph-3",
        figure=p1,
    )
end

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

Returns an error. I've attached the full stack trace. This is on Julia 1.6.0.

Thanks!
plotly_stacktrace.txt

Hi!
Can you give a link to the documentation section in which this example is?
If you replace

p1 = plot(
    iris, x=:sepal_length, y=:sepal_width, color=:species,
    mode="markers", marker_size=8
)

with

p1 = Plot(
    iris, x=:sepal_length, y=:sepal_width, color=:species,
    mode="markers", marker_size=8
)

, then everything will work.
Plot is a structure with a description of the graph, which should be passed to Dash components, and plot is a graph rendering function within PlotlyJS

Thanks for the response, makes sense, this fixes it! Sorry if it's a newbie issue, but I do think the docs should be updated.

It's located here

We should really redirect that whole site to the new docs site https://dash.plotly.com/julia - looks like this was already fixed over there https://dash.plotly.com/julia/layout#more-about-visualization