Skip to content

Commit

Permalink
PlotlyJS.GenericTrace
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Jan 23, 2025
1 parent a155815 commit a9a7fa5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions scripts/dash_plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function map(; df_source::DataFrames.DataFrame=DataFrames.DataFrame(), df_sink::
else
visibility = ""
end
traces = []
traces = Vector{PlotlyJS.GenericTrace{Dict{Symbol, Any}}}(undef, 0)
lon = Vector{Float64}(undef, 0)
lat = Vector{Float64}(undef, 0)
if size(df_source, 1) > 0
Expand Down Expand Up @@ -512,7 +512,7 @@ function map(; df_source::DataFrames.DataFrame=DataFrames.DataFrame(), df_sink::
plot_bgcolor = "#fff",
mapbox = PlotlyJS.attr(; style="stamen-terrain", zoom=zoom, center=PlotlyJS.attr(; lon=lonc, lat=latc)),
showlegend = true)
p = PlotlyJS.plot(convert(Array{typeof(traces[1])}, traces), layout)
p = PlotlyJS.plot(traces, layout)
if filename != ""
fn = joinpathcheck(figuredir, filename)
recursivemkdir(fn)
Expand Down Expand Up @@ -609,7 +609,7 @@ function map_data(df::DataFrames.DataFrame; port::Integer=8050, ip=string(Socket
derived_virtual_selected_rows = derived_virtual_selected_rows .+ 1
end
if edges
traces = []
traces = Vector{PlotlyJS.GenericTrace{Dict{Symbol, Any}}}(undef, 0)
for i in 1:DataFrames.nrow(dff)
r = dff[i, :]
colorl = i in derived_virtual_selected_rows ? color_selected : color
Expand Down Expand Up @@ -644,7 +644,7 @@ function map_data(df::DataFrames.DataFrame; port::Integer=8050, ip=string(Socket
marker = PlotlyJS.attr(; size=9, color=colorp)
))
end
p = convert(Array{typeof(traces[1])}, traces)
p = traces
else
colors = [(i in derived_virtual_selected_rows ? color_selected : color) for i in 1:DataFrames.nrow(dff)]
p = PlotlyJS.scattermapbox(;
Expand Down
8 changes: 4 additions & 4 deletions scripts/dash_table_map.jl
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function map(; df_source::DataFrames.DataFrame=DataFrames.DataFrame(), df_sink::
else
visibility = ""
end
traces = []
traces = Vector{PlotlyJS.GenericTrace{Dict{Symbol, Any}}}(undef, 0)
lon = Vector{Float64}(undef, 0)
lat = Vector{Float64}(undef, 0)
if size(df_source, 1) > 0
Expand Down Expand Up @@ -512,7 +512,7 @@ function map(; df_source::DataFrames.DataFrame=DataFrames.DataFrame(), df_sink::
plot_bgcolor = "#fff",
mapbox = PlotlyJS.attr(; style="stamen-terrain", zoom=zoom, center=PlotlyJS.attr(; lon=lonc, lat=latc)),
showlegend = true)
p = PlotlyJS.plot(convert(Array{typeof(traces[1])}, traces), layout)
p = PlotlyJS.plot(traces, layout)
if filename != ""
fn = joinpathcheck(figuredir, filename)
recursivemkdir(fn)
Expand Down Expand Up @@ -609,7 +609,7 @@ function map_data(df::DataFrames.DataFrame; port::Integer=8050, ip=string(Socket
derived_virtual_selected_rows = derived_virtual_selected_rows .+ 1
end
if edges
traces = []
traces = Vector{PlotlyJS.GenericTrace{Dict{Symbol, Any}}}(undef, 0)
for i in 1:DataFrames.nrow(dff)
r = dff[i, :]
colorl = i in derived_virtual_selected_rows ? color_selected : color
Expand Down Expand Up @@ -644,7 +644,7 @@ function map_data(df::DataFrames.DataFrame; port::Integer=8050, ip=string(Socket
marker = PlotlyJS.attr(; size=9, color=colorp)
))
end
p = convert(Array{typeof(traces[1])}, traces)
p = traces
else
colors = [(i in derived_virtual_selected_rows ? color_selected : color) for i in 1:DataFrames.nrow(dff)]
p = PlotlyJS.scattermapbox(;
Expand Down

0 comments on commit a9a7fa5

Please sign in to comment.