JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
418 stars 77 forks source link

savehtml not defined #387

Closed claytonpbarrows closed 3 years ago

claytonpbarrows commented 3 years ago

When attempting to save a SyncPlot to html, via savefig, I get the following error:

ulia> PlotlyJS.savefig(PlotlyJS.plot(p), "blah.html")
ERROR: UndefVarError: savehtml not defined
Stacktrace:
 [1] savefig(io::IOStream, p::Plot{Vector{GenericTrace{Dict{Symbol, Any}}}, Layout{Dict{Symbol, Any}}, Vector{PlotlyFrame}}; width::Nothing, height::Nothing, scale::Nothing, format::String)
   @ PlotlyBase ~/.julia/packages/PlotlyBase/HGHhS/src/kaleido.jl:145
 [2] (::PlotlyBase.var"#210#211"{Nothing, Nothing, Nothing, Plot{Vector{GenericTrace{Dict{Symbol, Any}}}, Layout{Dict{Symbol, Any}}, Vector{PlotlyFrame}}})(f::IOStream)
   @ PlotlyBase ~/.julia/packages/PlotlyBase/HGHhS/src/kaleido.jl:179
 [3] open(::PlotlyBase.var"#210#211"{Nothing, Nothing, Nothing, Plot{Vector{GenericTrace{Dict{Symbol, Any}}}, Layout{Dict{Symbol, Any}}, Vector{PlotlyFrame}}}, ::String, ::Vararg{String, N} where N; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Base ./io.jl:330
 [4] open
   @ ./io.jl:328 [inlined]
 [5] savefig(p::Plot{Vector{GenericTrace{Dict{Symbol, Any}}}, Layout{Dict{Symbol, Any}}, Vector{PlotlyFrame}}, fn::String; format::Nothing, width::Nothing, height::Nothing, scale::Nothing)
   @ PlotlyBase ~/.julia/packages/PlotlyBase/HGHhS/src/kaleido.jl:178
 [6] savefig(p::Plot{Vector{GenericTrace{Dict{Symbol, Any}}}, Layout{Dict{Symbol, Any}}, Vector{PlotlyFrame}}, fn::String)
   @ PlotlyBase ~/.julia/packages/PlotlyBase/HGHhS/src/kaleido.jl:173
 [7] savefig(p::PlotlyJS.SyncPlot, a::String; k::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ PlotlyJS ~/.julia/packages/PlotlyJS/LpUSO/src/PlotlyJS.jl:49
 [8] savefig(p::PlotlyJS.SyncPlot, a::String)
   @ PlotlyJS ~/.julia/packages/PlotlyJS/LpUSO/src/PlotlyJS.jl:49
 [9] top-level scope
   @ REPL[42]:1

Versioninfo:

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

(test) pkg> st
      Status `~/Documents/repos/PowerGraphics.jl/test/Project.toml`
  [336ed68f] CSV v0.8.5
  [5ae59095] Colors v0.12.8
  [a93c6f00] DataFrames v1.1.1
  [864edb3b] DataStructures v0.18.9
  [60bf3e95] GLPK v0.14.12
  [2cd47ed4] InfrastructureSystems v1.10.0
  [f0f68f2c] PlotlyJS v0.16.0
  [91a5bcdd] Plots v1.16.6
  [5f7eddb3] PowerGraphics v0.10.0 `..`
  [e690365d] PowerSimulations v0.14.4
  [f00506e0] PowerSystemCaseBuilder v0.4.1
  [bcd98974] PowerSystems v1.9.0
  [98d24dd4] TestSetExtensions v2.0.0
  [9e3dc215] TimeSeries v0.22.1
  [44d3d7a6] Weave v0.10.10
  [ddb6d928] YAML v0.4.7
  [ade2ca70] Dates
  [b77e0a4c] InteractiveUtils
  [56ddb016] Logging
  [9a3f8284] Random
  [8dfed614] Test
sglyon commented 3 years ago

Thanks @claytonpbarrows I accidentally made a breaking change here.

This PR fixes things: https://github.com/sglyon/PlotlyBase.jl/pull/54

I will merge + tag a new version of PlotlyBase ASAP

sglyon commented 3 years ago

The fix has been merged. If you update packages this should work again

Please re-open if not