Dash.jl icon indicating copy to clipboard operation
Dash.jl copied to clipboard

Basic Example returns error

Open aabills opened this issue 4 years ago • 3 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

aabills avatar Nov 18 '21 20:11 aabills

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

waralex avatar Nov 19 '21 08:11 waralex

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

aabills avatar Nov 19 '21 15:11 aabills

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

alexcjohnson avatar Nov 19 '21 18:11 alexcjohnson