plotly / Plotly.jl

A Julia interface to the plot.ly plotting library and cloud services
Other
96 stars 19 forks source link

Plot selected/unselected attribute not working #60

Open Wingmore opened 2 years ago

Wingmore commented 2 years ago

Problem Nothing happens when passing in a marker object into selected/unselected variable

I'm trying to edit code from the tutorial here: https://dash-julia.plotly.com/interactive-graphing.

At the very bottom, there is code which seems to suggest you can edit properties of selected and unselected points. However when I try to edit the marker = ... line, nothing happens

Code

using DataFrames, Dash, DashHtmlComponents, DashCoreComponents, PlotlyJS

df4 = DataFrame(rand(30, 2), :auto)
plot(
    df4, x=:x1, y=:x2,
    mode="event+markers+text",
    marker_size=20,
    text=1:size(df4)[1],
    selectedpoints=selectedpoints,
    unselected=(
        marker=(opacity=0.1, size=55, textfont_color = "rgba(0,0,0,0)")
    )
)

The documentation here https://plotly.com/julia/reference/scatter/#scatter-selected also seems to suggest you can pass in a dictionary, and i have tried

unselected = Dict("size"=>40)

but this time I get an error which goes

ERROR: LoadError: MethodError: no method matching setindex!(::PlotlyBase.PlotlyAttribute{Dict{Symbol, Any}}, ::Int64, ::Missing, ::Symbol, ::String)
nicolaskruchten commented 2 years ago

@sglyon this one's all yours :)