From a9a7fa59f1c9c0bdc2e7d381e63db33a27b499ec Mon Sep 17 00:00:00 2001 From: monty Date: Wed, 22 Jan 2025 17:12:19 -0700 Subject: [PATCH] PlotlyJS.GenericTrace --- scripts/dash_plot.jl | 8 ++++---- scripts/dash_table_map.jl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/dash_plot.jl b/scripts/dash_plot.jl index 37d8aab2..abfd4fe5 100644 --- a/scripts/dash_plot.jl +++ b/scripts/dash_plot.jl @@ -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 @@ -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) @@ -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 @@ -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(; diff --git a/scripts/dash_table_map.jl b/scripts/dash_table_map.jl index 37d8aab2..abfd4fe5 100644 --- a/scripts/dash_table_map.jl +++ b/scripts/dash_table_map.jl @@ -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 @@ -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) @@ -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 @@ -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(;