Upgrade plotly.js to v2.6.3 (#3958)
* Upgrade plotly.js to version 2.6.3 * plotly polar support, api changed in plotly.js v2.x.x https://plotly.com/javascript/polar-chart/ https://community.plotly.com/t/announcing-plotly-js-2-0/53675
This commit is contained in:
parent
c32dbeef8a
commit
79cf62cf91
@ -203,7 +203,7 @@ import RecipesPipeline:
|
|||||||
|
|
||||||
# Use fixed version of Plotly instead of the latest one for stable dependency
|
# Use fixed version of Plotly instead of the latest one for stable dependency
|
||||||
# Ref: https://github.com/JuliaPlots/Plots.jl/pull/2779
|
# Ref: https://github.com/JuliaPlots/Plots.jl/pull/2779
|
||||||
const _plotly_min_js_filename = "plotly-1.57.1.min.js"
|
const _plotly_min_js_filename = "plotly-2.6.3.min.js"
|
||||||
|
|
||||||
include("types.jl")
|
include("types.jl")
|
||||||
include("utils.jl")
|
include("utils.jl")
|
||||||
|
|||||||
@ -1013,8 +1013,9 @@ function plotly_polar!(plotattributes_out::KW, series::Series)
|
|||||||
# convert polar plots x/y to theta/radius
|
# convert polar plots x/y to theta/radius
|
||||||
if ispolar(series[:subplot])
|
if ispolar(series[:subplot])
|
||||||
theta, r = pop!(plotattributes_out, :x), pop!(plotattributes_out, :y)
|
theta, r = pop!(plotattributes_out, :x), pop!(plotattributes_out, :y)
|
||||||
plotattributes_out[:t] = rad2deg.(theta)
|
plotattributes_out[:theta] = rad2deg.(theta)
|
||||||
plotattributes_out[:r] = r
|
plotattributes_out[:r] = r
|
||||||
|
plotattributes_out[:type] = :scatterpolar
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1078,10 +1079,10 @@ function plotly_html_body(plt, style = nothing)
|
|||||||
requirejs_prefix = """
|
requirejs_prefix = """
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
paths: {
|
paths: {
|
||||||
Plotly: '$(plotly_no_ext)'
|
Plotly2: '$(plotly_no_ext)'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
require(['Plotly'], function (Plotly) {
|
require(['Plotly2'], function (Plotly2) {
|
||||||
"""
|
"""
|
||||||
requirejs_suffix = "});"
|
requirejs_suffix = "});"
|
||||||
end
|
end
|
||||||
@ -1100,8 +1101,7 @@ end
|
|||||||
|
|
||||||
function js_body(plt::Plot, uuid)
|
function js_body(plt::Plot, uuid)
|
||||||
js = """
|
js = """
|
||||||
var PLOT = document.getElementById('$(uuid)');
|
Plotly2.newPlot('$(uuid)', $(plotly_series_json(plt)), $(plotly_layout_json(plt)));
|
||||||
Plotly.plot(PLOT, $(plotly_series_json(plt)), $(plotly_layout_json(plt)));
|
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user