Closed non-Jedi closed 1 month ago
Thanks for trying the package.
I'm having trouble replicating the error. I've done a clean install and ran the code, and it seems to be working. Also, the CI seems to be passing the tests.
Can you try doing other simpler operations, such as
d = Circle() + T(2,0)Circle()
draw(d)
The issue might be related to fonts, as the error seems to be that the TextGeom is returning a fontsize either negative or zero, which is not allowed.
Hi Davi. Thanks for taking a look. I can confirm that the code you posted works just fine. I'll try working my way through the "Diagramming Basics" tutorial to see if I get any errors. I can also send you an --bug-report=rr
recording if that would help?
Thanks, I think that might help. BTW, if you run:
plt = plot(x=rand(10),y=rand(10))
draw(plt)
using different random values. Does it always returns the same error?
Also, if you may. Try running the following:
plt = plot(
config=(
xaxis=(title="",),
yaxis=(title="",),),
x=rand(10),y=rand(10)
)
draw(plt)
I'm modifying the code in order to accept negative fontsize. This does not address your issue directly, but it is possible that after this your code will run without errors, but the final drawing might come out strange. Yet, this will help in the debugging.
I'm modifying the code in order to accept negative fontsize. This does not address your issue directly, but it is possible that after this your code will run without errors, but the final drawing might come out strange. Yet, this will help in the debugging.
I've ]dev
ed "Vizagrams", and the change just seems to give me a new error. Maybe it's progress? See below stacktrace:
julia> show(err)
1-element ExceptionStack:
NaN values are not allowed for HTML or SVG nodes: <text> x=NaN >
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] validateattr(ctx::Hyperscript.HTMLSVG, tag::SubString{String}, attr::Pair{String, Float64})
@ Hyperscript ~/.julia/packages/Hyperscript/l66rR/src/Hyperscript.jl:296
[3] (::Hyperscript.var"#2#5"{Pair{Symbol, Any}, Hyperscript.HTMLSVG, SubString{String}})(attr′::Pair{String, Float64})
@ Hyperscript ./none:0
[4] iterate
@ ./generator.jl:47 [inlined]
[5] iterate
@ ./iterators.jl:1202 [inlined]
[6] iterate
@ ./iterators.jl:1196 [inlined]
[7] Dict{String, Any}(kv::Base.Iterators.Flatten{Base.Generator{@Kwargs{x::Float64, y::Float64, transform::String, style::String}, Hyperscript.var"#3#4"{Hyperscript.HTMLSVG, SubString{String}}}})
@ Base ./dict.jl:83
[8] processattrs
@ ~/.julia/packages/Hyperscript/l66rR/src/Hyperscript.jl:126 [inlined]
[9] Hyperscript.Node(ctx::Hyperscript.HTMLSVG, tag::String, children::Tuple{String}, attrs::@Kwargs{x::Float64, y::Float64, transform::String, style::String})
@ Hyperscript ~/.julia/packages/Hyperscript/l66rR/src/Hyperscript.jl:88
[10] #m#18
@ ~/.julia/packages/Hyperscript/l66rR/src/Hyperscript.jl:335 [inlined]
[11] primtosvg(geom::TextGeom, s::S)
@ Vizagrams ~/.julia/dev/Vizagrams/src/backends/svgbackend.jl:265
[12] primtosvg
@ ~/.julia/dev/Vizagrams/src/backends/svgbackend.jl:69 [inlined]
[13] (::Vizagrams.var"#375#376")(p::Prim{TextGeom})
@ Vizagrams ~/.julia/dev/Vizagrams/src/backends/svgbackend.jl:357
[14] iterate
@ ./generator.jl:47 [inlined]
[15] collect_to!(dest::Vector{Hyperscript.Node{Hyperscript.HTMLSVG}}, itr::Base.Generator{Vector{Prim}, Vizagrams.var"#375#376"}, offs::Int64, st::Int64)
@ Base ./array.jl:892
[16] collect_to_with_first!(dest::Vector{Hyperscript.Node{Hyperscript.HTMLSVG}}, v1::Hyperscript.Node{Hyperscript.HTMLSVG}, itr::Base.Generator{Vector{Prim}, Vizagrams.var"#375#376"}, st::Int64)
@ Base ./array.jl:870
[17] _collect(c::Vector{Prim}, itr::Base.Generator{Vector{Prim}, Vizagrams.var"#375#376"}, ::Base.EltypeUnknown, isz::Base.HasShape{1})
@ Base ./array.jl:864
[18] collect_similar
@ ./array.jl:763 [inlined]
[19] map
@ ./abstractarray.jl:3285 [inlined]
[20] tosvg(dmark::Vizagrams.Pure{Mark}; height::Int64, width::Float64, kwargs::@Kwargs{viewBox::String, preserveAspectRatio::String})
@ Vizagrams ~/.julia/dev/Vizagrams/src/backends/svgbackend.jl:356
[21] drawsvg(d::Vizagrams.Pure{Mark}; height::Int64, pad::Int64, width::Nothing, kwargs::@Kwargs{})
@ Vizagrams ~/.julia/dev/Vizagrams/src/backends/svgbackend.jl:393
[22] drawsvg(p::Plot; height::Int64, pad::Int64, kwargs::@Kwargs{})
@ Vizagrams ~/.julia/dev/Vizagrams/src/backends/svgbackend.jl:405
[23] #draw#390
@ ~/.julia/dev/Vizagrams/src/backends/draw.jl:17 [inlined]
[24] top-level scope
@ REPL[13]:1
using different random values. Does it always returns the same error?
I seem to get this new error no matter what I seed with or how I define x
and y
.
Also, if you may. Try running the following:
plt = plot( config=( xaxis=(title="",), yaxis=(title="",),), x=rand(10),y=rand(10) ) draw(plt)
This gives the same error as the above.
I'm working on getting you an rr
trace, but I'm currently getting a (probably unrelated) strange error when attempting to save the trace.
I can also confirm that the package works as expected on these commands if I ssh into my server and execute them, so it's something funky about my local install. I would recommend not spending any more of your time investigating this until I've spent some more time confirming it's not some sort of strange user error on my part.
Ah, ok! Thanks for letting me know.
I'll close the issue for now. But if you think the problem is on the package, feel free to open it again.
Copy-pasting the first example shown in "First Data Vizualization" in the "Data Vizualizations Basics" tutorial throws an error.
Code pasted:
Stack trace:
Execution environment: