Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling JSON.json on a PlotlyLight Plot causes stackoverflow #41

Closed
disberd opened this issue Feb 29, 2024 · 1 comment
Closed

calling JSON.json on a PlotlyLight Plot causes stackoverflow #41

disberd opened this issue Feb 29, 2024 · 1 comment

Comments

@disberd
Copy link

disberd commented Feb 29, 2024

I stumbled upon this issues because of failing tests in PlotlyKaleido in the last days.

With version 0.8 of PlotlyLight, one can't seem to call JSON.json on the object without causing an error:

julia> using PlotlyLight, JSON

julia> p = Plot(Config(x = rand(10)));

julia> json(p)
ERROR: StackOverflowError:
Stacktrace:
  [1] Array
    @ .\boot.jl:477 [inlined]
  [2] Array
    @ .\boot.jl:486 [inlined]
  [3] Array
    @ .\boot.jl:494 [inlined]
  [4] _collect_indices
    @ .\array.jl:777 [inlined]
  [5] collect
    @ .\array.jl:761 [inlined]
  [6] JSON.Writer.CompositeTypeWrapper(x::Plot, syms::Vector{Any}) (repeats 74610 times)
    @ JSON.Writer C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:22
  [7] JSON.Writer.CompositeTypeWrapper(x::Plot)
    @ JSON.Writer C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:23
  [8] lower
    @ C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:45 [inlined]
  [9] show_json
    @ C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:348 [inlined]
 [10] #show_json#9
    @ C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:359 [inlined]
 [11] show_json
    @ C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:357 [inlined]
 [12] print(io::IOBuffer, obj::Plot)
    @ JSON.Writer C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:383
 [13] sprint(f::Function, args::Plot; context::Nothing, sizehint::Int64)
    @ Base .\strings\io.jl:114
 [14] sprint
    @ .\strings\io.jl:107 [inlined]
 [15] json(a::Plot)
    @ JSON.Writer C:\Users\Alberto.Mengali\.julia\packages\JSON\93Ea8\src\Writer.jl:399

This does not happen with version 0.7 of PlotlyLight

@joshday
Copy link
Member

joshday commented Feb 29, 2024

Looks like this boiled down to a mistake in Base.propertynames(::Plot). Fixed on master. New release out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants