From 6286c67c014d614666a3a301bf296aa1c7817862 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Wed, 7 Oct 2020 01:12:50 +0200 Subject: [PATCH 1/3] add legendtitle to plotly --- src/backends/plotly.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index d6a712c8..42f19374 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -339,7 +339,11 @@ function plotly_add_legend!(plotattributes_out::KW, sp::Subplot) :font => plotly_font(legendfont(sp)), :tracegroupgap => 0, :x => legend_position.coords[1], - :y => legend_position.coords[2] + :y => legend_position.coords[2], + :title => KW( + :text => sp[:legendtitle] === nothing ? "" : string(sp[:legendtitle]), + :font => plotly_font(legendtitlefont(sp)), + ), ) end end From e7c7daff0cae25c2d7e881d737b8abbdc42ccee4 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Sat, 31 Oct 2020 13:37:11 +0100 Subject: [PATCH 2/3] use plotly-latest --- src/backends/plotly.jl | 2 +- src/init.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 42f19374..df172e84 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -887,7 +887,7 @@ const ijulia_initialized = Ref(false) function plotly_html_head(plt::Plot) plotly = - use_local_dependencies[] ? ("file:///" * plotly_local_file_path[]) : "https://cdn.plot.ly/plotly-1.54.2.min.js" + use_local_dependencies[] ? ("file:///" * plotly_local_file_path[]) : "https://cdn.plot.ly/plotly-latest.min.js" include_mathjax = get(plt[:extra_plot_kwargs], :include_mathjax, "") mathjax_file = include_mathjax != "cdn" ? ("file://" * include_mathjax) : "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML" diff --git a/src/init.jl b/src/init.jl index 3cb22c79..c15f099d 100644 --- a/src/init.jl +++ b/src/init.jl @@ -81,7 +81,7 @@ function __init__() if get(ENV, "PLOTS_HOST_DEPENDENCY_LOCAL", "false") == "true" global plotly_local_file_path[] = joinpath(@get_scratch!("plotly"), "plotly-1.54.2.min.js") if !isfile(plotly_local_file_path[]) - download("https://cdn.plot.ly/plotly-1.54.2.min.js", plotly_local_file_path[]) + download("https://cdn.plot.ly/plotly-latest.min.js", plotly_local_file_path[]) end use_local_plotlyjs[] = true From d9c2b7bf370fdf3dda5fe196822d6cd924c9a3a2 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Sat, 31 Oct 2020 22:49:37 +0100 Subject: [PATCH 3/3] change to plotly v1.57.1 --- src/backends/plotly.jl | 2 +- src/init.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index df172e84..89c97e54 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -887,7 +887,7 @@ const ijulia_initialized = Ref(false) function plotly_html_head(plt::Plot) plotly = - use_local_dependencies[] ? ("file:///" * plotly_local_file_path[]) : "https://cdn.plot.ly/plotly-latest.min.js" + use_local_dependencies[] ? ("file:///" * plotly_local_file_path[]) : "https://cdn.plot.ly/plotly-1.57.1.min.js" include_mathjax = get(plt[:extra_plot_kwargs], :include_mathjax, "") mathjax_file = include_mathjax != "cdn" ? ("file://" * include_mathjax) : "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML" diff --git a/src/init.jl b/src/init.jl index c15f099d..2a64844d 100644 --- a/src/init.jl +++ b/src/init.jl @@ -81,7 +81,7 @@ function __init__() if get(ENV, "PLOTS_HOST_DEPENDENCY_LOCAL", "false") == "true" global plotly_local_file_path[] = joinpath(@get_scratch!("plotly"), "plotly-1.54.2.min.js") if !isfile(plotly_local_file_path[]) - download("https://cdn.plot.ly/plotly-latest.min.js", plotly_local_file_path[]) + download("https://cdn.plot.ly/plotly-1.57.1.min.js", plotly_local_file_path[]) end use_local_plotlyjs[] = true