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

Resetting strokecolor to nothing causes error #174

Closed
ConnectedSystems opened this issue Jul 7, 2023 · 4 comments
Closed

Resetting strokecolor to nothing causes error #174

ConnectedSystems opened this issue Jul 7, 2023 · 4 comments

Comments

@ConnectedSystems
Copy link

Hello,

When calling poly!(), if nothing is passed to strokecolor, it results in the error (down below) being thrown.

Minimum Working Example to replicate the issue (although you'll have to have a GeoJSON file handy).

geodata = GeoMakie.GeoJSON.read("path to some GeoJSON")
N = 216  # set to number of features in GeoJSON

f = Figure()
spatial = GeoAxis(
    f[1, 1];
    title="MWE",
    xlabel="Longitude",
    ylabel="Latitude",
    dest="+proj=latlong +datum=WGS84"
)
poly!(spatial, geodata, color=rand(N), colormap=:plasma, strokecolor=nothing)

Setting strokecolor to :black or some other specific value works.

The context here is that a GLMakie interface where the user is able to define some properties of interest, which we then highlight on the map by adjusting the locations' stroke color. Where the view is reset, we want to remove the strokecolors.

If nothing is not an valid value to pass in, I think it should be caught.

Error showing value of type Figure:
ERROR: program 66 not linked. Error in: 
C:\Users\takuy\.julia\packages\GLMakie\OVxAi\assets\shader\fragment_output.frag or C:\Users\takuy\.julia\packages\GLMakie\OVxAi\assets\shader\util.vert or C:\Users\takuy\.julia\packages\GLMakie\OVxAi\assets\shader\lines.vert or C:\Users\takuy\.julia\packages\GLMakie\OVxAi\assets\shader\lines.geom or C:\Users\takuy\.julia\packages\GLMakie\OVxAi\assets\shader\lines.frag
Vertex shader(s) were not successfully compiled before glLinkProgram() was called.  Link failed. 

Stacktrace:
  [1] error(::String, ::String, ::String, ::String)
    @ Base .\error.jl:44
  [2] compile_program(shaders::Vector{GLMakie.GLAbstraction.Shader}, fragdatalocation::Vector{Tuple{Int64, String}})
    @ GLMakie.GLAbstraction C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\GLAbstraction\GLShader.jl:188
  [3] (::GLMakie.GLAbstraction.var"#69#74"{GLMakie.GLAbstraction.ShaderCache, Vector{Vector{String}}, Vector{Vector{String}}, NTuple{5, String}})()
    @ GLMakie.GLAbstraction C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\GLAbstraction\GLShader.jl:261
  [4] get!(default::GLMakie.GLAbstraction.var"#69#74"{GLMakie.GLAbstraction.ShaderCache, Vector{Vector{String}}, Vector{Vector{String}}, NTuple{5, String}}, h::Dict{Any, GLMakie.GLAbstraction.GLProgram}, key::Tuple{NTuple{5, String}, Vector{Vector{String}}})
    @ Base .\dict.jl:468
  [5] gl_convert(cache::GLMakie.GLAbstraction.ShaderCache, lazyshader::GLMakie.GLVisualizeShader, data::Dict{Symbol, Any})
    @ GLMakie.GLAbstraction C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\GLAbstraction\GLShader.jl:252
  [6] gl_convert
    @ C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\glshaders\visualize_interface.jl:88 [inlined]
  [7] GLMakie.GLAbstraction.RenderObject(data::Dict{Symbol, Any}, program::GLMakie.GLVisualizeShader, pre::GLMakie.GLAbstraction.StandardPrerender, post::GLFW.Window, context::GLFW.Window)
    @ GLMakie.GLAbstraction C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\GLAbstraction\GLTypes.jl:444
  [8] GLMakie.GLAbstraction.RenderObject(data::Dict{Symbol, Any}, program::GLMakie.GLVisualizeShader, pre::GLMakie.GLAbstraction.StandardPrerender, post::GLFW.Window)
    @ GLMakie.GLAbstraction C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\GLAbstraction\GLTypes.jl:404
  [9] assemble_shader(data::Dict{Symbol, Any})
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\glshaders\visualize_interface.jl:108
 [10] draw_lines(screen::Any, position::Observable{Vector{Point{2, Float32}}}, data::Dict)
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\glshaders\lines.jl:119
 [11] (::GLMakie.var"#203#206"{GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float32}}}}})(gl_attributes::Dict{Symbol, Any})
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\drawing_primitives.jl:305
 [12] (::GLMakie.var"#175#178"{GLMakie.var"#203#206"{GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float32}}}}}, GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float32}}}}})()
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\drawing_primitives.jl:111
 [13] get!(default::GLMakie.var"#175#178"{GLMakie.var"#203#206"{GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float32}}}}}, GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float32}}}}}, h::Dict{UInt64, GLMakie.GLAbstraction.RenderObject}, key::UInt64)
    @ Base .\dict.jl:468
 [14] cached_robj!(robj_func::GLMakie.var"#203#206"{GLMakie.Screen{GLFW.Window}, Scene, Lines{Tuple{Vector{Point{2, Float32}}}}}, screen::GLMakie.Screen{GLFW.Window}, scene::Scene, x::Lines{Tuple{Vector{Point{2, Float32}}}})
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\drawing_primitives.jl:84
 [15] draw_atomic
    @ C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\drawing_primitives.jl:271 [inlined]
 [16] insert!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene, x::Lines{Tuple{Vector{Point{2, Float32}}}})
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\drawing_primitives.jl:126
 [17] (::GLMakie.var"#181#182"{GLMakie.Screen{GLFW.Window}, Scene})(x::Lines{Tuple{Vector{Point{2, Float32}}}})
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\drawing_primitives.jl:131
 [18] foreach(f::GLMakie.var"#181#182"{GLMakie.Screen{GLFW.Window}, Scene}, itr::Vector{AbstractPlot})
    @ Base .\abstractarray.jl:3073
 [19] insert!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene, x::Poly{Tuple{Vector{GeometryBasics.MultiPolygon{2, Float32, GeometryBasics.Polygon{2, Float32, Point{2, Float32}, GeometryBasics.LineString{2, Float32, Point{2, Float32}, Base.ReinterpretArray{GeometryBasics.Line{2, Float32}, 1, Tuple{Point{2, Float32}, Point{2, Float32}}, GeometryBasics.TupleView{Tuple{Point{2, Float32}, Point{2, Float32}}, 2, 1, Vector{Point{2, Float32}}}, false}}, Vector{GeometryBasics.LineString{2, Float32, Point{2, Float32}, Base.ReinterpretArray{GeometryBasics.Line{2, Float32}, 1, Tuple{Point{2, Float32}, Point{2, Float32}}, GeometryBasics.TupleView{Tuple{Point{2, Float32}, Point{2, Float32}}, 2, 1, Vector{Point{2, Float32}}}, false}}}}, Vector{GeometryBasics.Polygon{2, Float32, Point{2, Float32}, GeometryBasics.LineString{2, Float32, Point{2, Float32}, Base.ReinterpretArray{GeometryBasics.Line{2, Float32}, 1, Tuple{Point{2, Float32}, Point{2, Float32}}, GeometryBasics.TupleView{Tuple{Point{2, Float32}, Point{2, Float32}}, 2, 1, Vector{Point{2, Float32}}}, false}}, Vector{GeometryBasics.LineString{2, Float32, Point{2, Float32}, Base.ReinterpretArray{GeometryBasics.Line{2, Float32}, 1, Tuple{Point{2, Float32}, Point{2, Float32}}, GeometryBasics.TupleView{Tuple{Point{2, Float32}, Point{2, Float32}}, 2, 1, Vector{Point{2, Float32}}}, false}}}}}}}}})
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\drawing_primitives.jl:128
 [20] insertplots!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene)
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\screen.jl:448
 [21] insertplots!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene) (repeats 2 times)
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\screen.jl:451
 [22] display_scene!(screen::GLMakie.Screen{GLFW.Window}, scene::Scene)
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\screen.jl:380
 [23] GLMakie.Screen(scene::Scene, config::GLMakie.ScreenConfig; visible::Nothing, start_renderloop::Bool)
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\screen.jl:397
 [24] GLMakie.Screen(scene::Scene, config::GLMakie.ScreenConfig)
    @ GLMakie C:\Users\takuy\.julia\packages\GLMakie\OVxAi\src\screen.jl:393
 [25] getscreen(::Module, ::Scene; screen_config::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie C:\Users\takuy\.julia\packages\Makie\iECbF\src\display.jl:400
 [26] getscreen
    @ C:\Users\takuy\.julia\packages\Makie\iECbF\src\display.jl:383 [inlined]
 [27] display(figlike::Figure; backend::Module, update::Bool, screen_config::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie C:\Users\takuy\.julia\packages\Makie\iECbF\src\display.jl:160
 [28] display(figlike::Figure)
    @ Makie C:\Users\takuy\.julia\packages\Makie\iECbF\src\display.jl:131
 [29] #invokelatest#2
    @ .\essentials.jl:816 [inlined]
 [30] invokelatest
    @ .\essentials.jl:813 [inlined]
 [31] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL C:\Users\takuy\.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\REPL\src\REPL.jl:305
 [32] (::REPL.var"#57#58"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL C:\Users\takuy\.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\REPL\src\REPL.jl:287
 [33] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\Users\takuy\.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\REPL\src\REPL.jl:557
 [34] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL C:\Users\takuy\.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\REPL\src\REPL.jl:285
 [35] (::REPL.var"#do_respond#80"{Bool, Bool, REPL.var"#93#103"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL C:\Users\takuy\.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\REPL\src\REPL.jl:899
 [36] (::VSCodeServer.var"#98#101"{REPL.var"#do_respond#80"{Bool, Bool, REPL.var"#93#103"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt}})(mi::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ VSCodeServer c:\Users\takuy\.vscode\extensions\julialang.language-julia-1.47.2\scripts\packages\VSCodeServer\src\repl.jl:122
 [37] #invokelatest#2
    @ .\essentials.jl:816 [inlined]
 [38] invokelatest
    @ .\essentials.jl:813 [inlined]
 [39] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit C:\Users\takuy\.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\REPL\src\LineEdit.jl:2647
 [40] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\Users\takuy\.julia\juliaup\julia-1.9.2+0.x64.w64.mingw32\share\julia\stdlib\v1.9\REPL\src\REPL.jl:1300
 [41] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:514
julia> versioninfo()
Julia Version 1.9.2
Commit e4ee485e90 (2023-07-05 09:39 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 6800HS Creator Edition
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 8 on 16 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8
Status `C:\projects\AIMS\ADRIA.jl\sandbox\Manifest.toml`
  [e9467ef8] GLMakie v0.8.6
  [db073c08] GeoMakie v0.5.1
@ConnectedSystems ConnectedSystems changed the title Resetting strokecolor to nothing causes error Resetting strokecolor to nothing causes error Jul 7, 2023
@asinghvi17
Copy link
Member

This looks like a pure GLMakie issue, unfortunately. Are you still experiencing this problem?

@ConnectedSystems
Copy link
Author

ConnectedSystems commented Jun 9, 2024

Hi @asinghvi17

Yes, this issue still occurs for me, using the following package versions:

  [c9ce4bd3] ArchGDAL v0.10.4 
  [e9467ef8] GLMakie v0.9.11
  [62cb38b5] GeoDataFrames v0.3.8
  [db073c08] GeoMakie v0.6.5

@asinghvi17
Copy link
Member

In Makie v0.21 (GLMakie v0.10) this is caught on plotting, but I don't think there's a good way to catch it otherwise. In general colors should not have an input of nothing, though. :transparent might be more suited to your usecase.

I would recommend opening an issue on Makie with this, since it's not something we can solve here.

@asinghvi17 asinghvi17 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
@ConnectedSystems
Copy link
Author

Thank you, I'll try :transparent

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