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

barplot with Observable colors is broken #617

Closed
SebastianM-C opened this issue Jun 1, 2020 · 6 comments
Closed

barplot with Observable colors is broken #617

SebastianM-C opened this issue Jun 1, 2020 · 6 comments
Labels

Comments

@SebastianM-C
Copy link
Contributor

MWE

using Makie

cs = Observable(to_colormap(:viridis, 4))
sc = barplot(rand(Point2f0, 4), color=cs)
sc.plots[2].color[][1] = to_color(:black)
AbstractPlotting.Observables.notify!(sc.plots[2].color)

If I replace barplot with scatter, it works.

The error is

ERROR: Metadata array needs to have same length as data.
                    Found 16 data items, and 32 metadata items
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] meta(::Array{Point{2,Float32},1}; meta::Base.Iterators.Pairs{Symbol,Array{ColorTypes.RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{ColorTypes.RGBA{Float32},1}}}}) at C:\Users\sebastian\.julia\packages\GeometryBasics\dwE6R\src\metadata.jl:111
 [3] pointmeta(::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}; meta_data::Base.Iterators.Pairs{Symbol,Array{ColorTypes.RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{ColorTypes.RGBA{Float32},1}}}}) at C:\Users\sebastian\.julia\packages\GeometryBasics\dwE6R\src\meshes.jl:245
 [4] (::GLMakie.var"#123#127")(::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Array{ColorTypes.RGBA{Float32},1}, ::Nothing, ::Nothing) at C:\Users\sebastian\.julia\packages\GLMakie\wpJsD\src\drawing_primitives.jl:383
 [5] (::Observables.MapUpdater{GLMakie.var"#123#127",GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,GeometryBasics.PointMeta{2,Float32,Point{2,Float32},(:color,),Tuple{ColorTypes.RGBA{Float32}}}},FaceView{GeometryBasics.Ngon{2,Float32,3,GeometryBasics.PointMeta{2,Float32,Point{2,Float32},(:color,),Tuple{ColorTypes.RGBA{Float32}}}}}}})(::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Vararg{Any,N} where N) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:241
 [6] (::Observables.OnUpdate{Observables.MapUpdater{GLMakie.var"#123#127",GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,GeometryBasics.PointMeta{2,Float32,Point{2,Float32},(:color,),Tuple{ColorTypes.RGBA{Float32}}}},FaceView{GeometryBasics.Ngon{2,Float32,3,GeometryBasics.PointMeta{2,Float32,Point{2,Float32},(:color,),Tuple{ColorTypes.RGBA{Float32}}}}}}},Tuple{Observable{GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}},Observable{Array{ColorTypes.RGBA{Float32},1}},Observable{Nothing},Observable{Nothing}}})(::Array{ColorTypes.RGBA{Float32},1}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:218
 [7] setindex!(::Observable{Array{ColorTypes.RGBA{Float32},1}}, ::Array{ColorTypes.RGBA{Float32},1}; notify::Observables.var"#6#8") at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:130
 [8] setindex! at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:126 [inlined]
 [9] (::Observables.MapUpdater{GLMakie.var"#84#85"{AbstractPlotting.Key{:color},AbstractPlotting.Key{:mesh}},Array{ColorTypes.RGBA{Float32},1}})(::Array{ColorTypes.RGBA{Float32},1}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:241
 [10] (::Observables.OnUpdate{Observables.MapUpdater{GLMakie.var"#84#85"{AbstractPlotting.Key{:color},AbstractPlotting.Key{:mesh}},Array{ColorTypes.RGBA{Float32},1}},Tuple{Observable{Any}}})(::Array{ColorTypes.RGBA{Float32},1}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:218
 [11] setindex!(::Observable{Any}, ::Array{ColorTypes.RGBA{Float32},1}; notify::Observables.var"#6#8") at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:130
 [12] setindex! at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:126 [inlined]
 [13] (::Observables.var"#1#2"{Observable{Any}})(::Array{ColorTypes.RGBA{Float32},1}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:32
 [14] #invokelatest#1 at .\essentials.jl:710 [inlined]
 [15] invokelatest at .\essentials.jl:709 [inlined]
 [16] setindex!(::Observable{Any}, ::Array{ColorTypes.RGBA{Float32},1}; notify::Observables.var"#6#8") at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:132
 [17] setindex! at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:126 [inlined]
 [18] (::Observables.var"#3#4"{Any,Observable{Any}})(::Array{ColorTypes.RGBA{Float32},1}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:47
 [19] #invokelatest#1 at .\essentials.jl:710 [inlined]
 [20] invokelatest at .\essentials.jl:709 [inlined]
 [21] setindex!(::Observable{Array{ColorTypes.RGBA{Float32},1}}, ::Array{ColorTypes.RGBA{Float32},1}; notify::Observables.var"#6#8") at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:132
 [22] setindex! at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:126 [inlined]
 [23] (::AbstractPlotting.var"#320#322"{Observable{Array{ColorTypes.RGBA{Float32},1}}})(::Array{GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}},1}, ::Array{ColorTypes.RGB{Float32},1}, ::Nothing, ::Nothing) at C:\Users\sebastian\.julia\packages\AbstractPlotting\erm8R\src\basic_recipes\basic_recipes.jl:144
 [24] (::Observables.MapUpdater{AbstractPlotting.var"#320#322"{Observable{Array{ColorTypes.RGBA{Float32},1}}},GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}})(::Array{GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}},1}, ::Vararg{Any,N} where N) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:241
 [25] (::Observables.OnUpdate{Observables.MapUpdater{AbstractPlotting.var"#320#322"{Observable{Array{ColorTypes.RGBA{Float32},1}}},GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}},Tuple{Observable{Array{GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}},1}},Observable{Any},Observable{Any},Observable{Any}}})(::Array{ColorTypes.RGB{Float32},1}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:218
 [26] setindex!(::Observable{Any}, ::Array{ColorTypes.RGB{Float32},1}; notify::Observables.var"#6#8") at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:130
 [27] setindex!(::Observable{Any}, ::Array{ColorTypes.RGB{Float32},1}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:126
 [28] notify!(::Observable{Any}) at C:\Users\sebastian\.julia\packages\Observables\0wrF6\src\Observables.jl:72
 [29] top-level scope at REPL[9]:1

Verision info

julia> versioninfo()
Julia Version 1.5.0-beta1.0
Commit 6443f6c95a (2020-05-28 17:42 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, haswell)

(jl_HCYuqR) pkg> st -m
Status `C:\Users\sebastian\AppData\Local\Temp\jl_HCYuqR\Manifest.toml`
  [621f4979] AbstractFFTs v0.5.0
  [537997a7] AbstractPlotting v0.11.1
  [79e6a3ab] Adapt v1.1.0
  [7d9fca2a] Arpack v0.4.0
  [68821587] Arpack_jll v3.5.0+3
  [4fba245c] ArrayInterface v2.8.7
  [13072b0f] AxisAlgorithms v1.0.0
  [6e34b625] Bzip2_jll v1.0.6+2
  [fa961155] CEnum v0.2.0
  [a2cac450] ColorBrewer v0.4.0
  [35d6a980] ColorSchemes v3.9.0
  [3da002f7] ColorTypes v0.10.3
  [c3611d14] ColorVectorSpace v0.8.5
  [5ae59095] Colors v0.12.1
  [bbf7d656] CommonSubexpressions v0.2.0
  [34da2185] Compat v3.10.0
  [e66e0078] CompilerSupportLibraries_jll v0.3.3+0
  [d38c429a] Contour v0.5.3
  [9a962f9c] DataAPI v1.3.0
  [864edb3b] DataStructures v0.17.17
  [e2d170a0] DataValueInterfaces v1.0.0
  [163ba53b] DiffResults v1.0.2
  [b552c78f] DiffRules v1.0.1
  [b4f34e82] Distances v0.8.2
  [31c24e10] Distributions v0.23.3
  [ffbed154] DocStringExtensions v0.8.1
  [da5c29d0] EllipsisNotation v0.4.0
  [c87230d0] FFMPEG v0.3.0
  [b22a6f82] FFMPEG_jll v4.1.0+3
  [7a1cc6ca] FFTW v1.2.1
  [f5851436] FFTW_jll v3.3.9+5
  [5789e2e9] FileIO v1.3.0
  [1a297f60] FillArrays v0.8.10
  [6a86dc24] FiniteDiff v2.3.2
  [53c48c17] FixedPointNumbers v0.8.0
  [f6369f11] ForwardDiff v0.10.10
  [b38be410] FreeType v3.0.0
  [d7e528f0] FreeType2_jll v2.10.1+2
  [663a7486] FreeTypeAbstraction v0.8.0
  [559328eb] FriBidi_jll v1.0.5+3
  [f7f18e0c] GLFW v3.2.2
  [0656b61e] GLFW_jll v3.3.2+0
  [38e38edf] GLM v1.3.9
  [e9467ef8] GLMakie v0.1.5
  [5c1252a2] GeometryBasics v0.2.10
  [a2bd30eb] Graphics v1.0.2
  [a09fc81d] ImageCore v0.8.14
  [82e4d734] ImageIO v0.2.0
  [6218d12a] ImageMagick v1.1.5
  [c73af94c] ImageMagick_jll v6.9.10-12+3
  [9b13fd28] IndirectArrays v0.5.1
  [1d5cc7b8] IntelOpenMP_jll v2018.0.3+0
  [a98d9a8b] Interpolations v0.12.10
  [8197267c] IntervalSets v0.5.1
  [c8e1da08] IterTools v1.3.0
  [82899510] IteratorInterfaceExtensions v1.0.0
  [682c06a0] JSON v0.21.0
  [aacddb02] JpegTurbo_jll v2.0.1+0
  [5ab0869b] KernelDensity v0.5.1
  [c1c5ebd0] LAME_jll v3.100.0+1
  [dd192d2f] LibVPX_jll v1.8.1+1
  [d4300ac3] Libgcrypt_jll v1.8.5+1
  [7e76a0d4] Libglvnd_jll v1.3.0+1
  [7add5ba3] Libgpg_error_jll v1.36.0+1
  [94ce4f54] Libiconv_jll v1.16.0+2
  [89763e89] Libtiff_jll v4.1.0+0
  [d3d80556] LineSearches v7.0.1
  [4345ca2d] Loess v0.5.1
  [856f044c] MKL_jll v2019.0.117+2
  [ee78f7c6] Makie v0.11.0
  [dbb5928d] MappedArrays v0.2.2
  [7269a6da] MeshIO v0.4.0
  [e1d29d7a] Missings v0.4.3
  [66fc600b] ModernGL v1.1.2
  [e94cdb99] MosaicViews v0.2.2
  [d41bc354] NLSolversBase v7.6.1
  [77ba4419] NaNMath v0.3.3
  [510215fc] Observables v0.3.1
  [6fe1bfb0] OffsetArrays v1.0.4
  [e7412a2a] Ogg_jll v1.3.4+0
  [4536629a] OpenBLAS_jll v0.3.9+4
  [458c3c95] OpenSSL_jll v1.1.1+2
  [efe28fd5] OpenSpecFun_jll v0.5.3+3
  [429524aa] Optim v0.21.0
  [91d4177d] Opus_jll v1.3.1+1
  [bac558e1] OrderedCollections v1.2.0
  [90014a1f] PDMats v0.9.12
  [f57f5aa1] PNGFiles v0.2.0
  [19eb6ba3] Packing v0.4.0
  [5432bcbf] PaddedViews v0.5.5
  [d96e819e] Parameters v0.12.1
  [69de0a69] Parsers v1.0.4
  [995b91a9] PlotUtils v1.0.4
  [85a6dd25] PositiveFactorizations v0.2.3
  [1fd47b50] QuadGK v2.3.1
  [c84ed2f1] Ratios v0.4.0
  [189a3867] Reexport v0.2.0
  [ae029012] Requires v1.0.1
  [79098fc4] Rmath v0.6.1
  [f50d1b31] Rmath_jll v0.2.2+0
  [65257c39] ShaderAbstractions v0.2.1
  [1277b4bf] ShiftedArrays v1.0.0
  [992d4aef] Showoff v0.3.1
  [73760f76] SignedDistanceFields v0.4.0
  [a2af1166] SortingAlgorithms v0.3.1
  [276daf66] SpecialFunctions v0.10.3
  [90137ffa] StaticArrays v0.12.3
  [2913bbd2] StatsBase v0.33.0
  [4c63d2b9] StatsFuns v0.9.5
  [65254759] StatsMakie v0.2.2
  [3eaba693] StatsModels v0.6.11
  [09ab397b] StructArrays v0.4.3
  [3783bdb8] TableTraits v1.0.0
  [bd369af6] Tables v1.0.4
  [3a884ed6] UnPack v1.0.1
  [1cfade01] UnicodeFun v0.4.1
  [efce3f68] WoodburyMatrices v0.5.2
  [02c8fc9c] XML2_jll v2.9.9+4
  [aed1982a] XSLT_jll v1.1.33+2
  [4f6342f7] Xorg_libX11_jll v1.6.9+2
  [0c0b7dd1] Xorg_libXau_jll v1.0.9+2
  [935fb764] Xorg_libXcursor_jll v1.2.0+2
  [a3789734] Xorg_libXdmcp_jll v1.1.3+2
  [1082639a] Xorg_libXext_jll v1.3.4+2
  [d091e8ba] Xorg_libXfixes_jll v5.0.3+2
  [a51aa0fd] Xorg_libXi_jll v1.7.10+2
  [d1454406] Xorg_libXinerama_jll v1.1.4+2
  [ec84b674] Xorg_libXrandr_jll v1.5.2+2
  [ea2f1a96] Xorg_libXrender_jll v0.9.10+2
  [14d82f49] Xorg_libpthread_stubs_jll v0.1.0+1
  [c7cfdc94] Xorg_libxcb_jll v1.13.0+2
  [c5fb5394] Xorg_xtrans_jll v1.4.0+1
  [83775a58] Zlib_jll v1.2.11+10
  [3161d3a3] Zstd_jll v1.4.5+0
  [0ac62f75] libass_jll v0.14.0+2
  [f638f0a6] libfdk_aac_jll v0.1.6+2
  [b53b4c65] libpng_jll v1.6.37+3
  [f27f6e37] libvorbis_jll v1.3.6+4
  [1270edf5] x264_jll v2019.5.25+2
  [dfaa095f] x265_jll v3.0.0+1
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8bb1440f] DelimitedFiles
  [8ba89e20] Distributed
  [b77e0a4c] InteractiveUtils
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [44cfe95a] Pkg
  [de0858da] Printf
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA
  [9e88b42a] Serialization
  [1a1011a3] SharedArrays
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics
  [4607b0f0] SuiteSparse
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode

I can also reproduce it with an older julia version

julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, haswell)
@asinghvi17
Copy link
Member

asinghvi17 commented Jun 1, 2020

Looks like something weird is going on with GeometryBasics. Consider the following (stacktraces truncated):

julia> cs = Observable(to_colormap(:viridis, 4))

julia> sc = barplot(rand(Point2f0, 4), color=cs)

julia> cs[] = to_colormap(:viridis, 4)
ERROR: Metadata array needs to have same length as data.
                    Found 16 data items, and 120 metadata items
Stacktrace:
     Function             Module            Signature
     ────────             ──────            ─────────
[1]  error                Base              (::String)
at: /Applications/Julia-1.5.app/Contents/Resources/julia/bin/../share/julia/base/error.jl:33
[2]  #meta#86             GeometryBasics    (::Base.Iterators.Pairs{Symbol,Array{RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{RGBA{Float32},1}}}}, ::typeof(GeometryBasics.meta), ::Array{Point{2,Float32},1})
at: ~/.julia/packages/GeometryBasics/dwE6R/src/metadata.jl:111
[3]  #pointmeta#160       GeometryBasics    (::Base.Iterators.Pairs{Symbol,Array{RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{RGBA{Float32},1}}}}, ::typeof(GeometryBasics.pointmeta), ::GeometryBasics.Mesh{2,Float32,GeometryBas ...99+)
at: ~/.julia/packages/GeometryBasics/dwE6R/src/meshes.jl:245
[4]  #123                 GLMakie           (::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Array{RGBA{Float32},1}, ::Nothing, ::Nothing)
at: ~/.julia/dev/GLMakie/src/drawing_primitives.jl:383
[5]  MapUpdater           Observables       (::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Vararg{Any,N} where N)
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:241
[6]  OnUpdate             Observables       (::Array{RGBA{Float32},1})
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:218
[7]  #setindex!#5         Observables       (::Observables.var"#6#8", ::typeof(setindex!), ::Observable{Array{RGBA{Float32},1}}, ::Array{RGBA{Float32},1})
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:130


julia> cs[] = to_colormap(:viridis, 4)
ERROR: Metadata array needs to have same length as data.
                    Found 16 data items, and 136 metadata items
Stacktrace:
     Function             Module            Signature
     ────────             ──────            ─────────
[1]  error                Base              (::String)
at: /Applications/Julia-1.5.app/Contents/Resources/julia/bin/../share/julia/base/error.jl:33
[2]  #meta#86             GeometryBasics    (::Base.Iterators.Pairs{Symbol,Array{RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{RGBA{Float32},1}}}}, ::typeof(GeometryBasics.meta), ::Array{Point{2,Float32},1})
at: ~/.julia/packages/GeometryBasics/dwE6R/src/metadata.jl:111
[3]  #pointmeta#160       GeometryBasics    (::Base.Iterators.Pairs{Symbol,Array{RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{RGBA{Float32},1}}}}, ::typeof(GeometryBasics.pointmeta), ::GeometryBasics.Mesh{2,Float32,GeometryBas ...99+)
at: ~/.julia/packages/GeometryBasics/dwE6R/src/meshes.jl:245
[4]  #123                 GLMakie           (::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Array{RGBA{Float32},1}, ::Nothing, ::Nothing)
at: ~/.julia/dev/GLMakie/src/drawing_primitives.jl:383
[5]  MapUpdater           Observables       (::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Vararg{Any,N} where N)
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:241
[6]  OnUpdate             Observables       (::Array{RGBA{Float32},1})
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:218
[7]  #setindex!#5         Observables       (::Observables.var"#6#8", ::typeof(setindex!), ::Observable{Array{RGBA{Float32},1}}, ::Array{RGBA{Float32},1})
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:130


julia> cs[] = to_colormap(:viridis, 4)
ERROR: Metadata array needs to have same length as data.
                    Found 16 data items, and 152 metadata items
Stacktrace:
     Function             Module            Signature
     ────────             ──────            ─────────
[1]  error                Base              (::String)
at: /Applications/Julia-1.5.app/Contents/Resources/julia/bin/../share/julia/base/error.jl:33
[2]  #meta#86             GeometryBasics    (::Base.Iterators.Pairs{Symbol,Array{RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{RGBA{Float32},1}}}}, ::typeof(GeometryBasics.meta), ::Array{Point{2,Float32},1})
at: ~/.julia/packages/GeometryBasics/dwE6R/src/metadata.jl:111
[3]  #pointmeta#160       GeometryBasics    (::Base.Iterators.Pairs{Symbol,Array{RGBA{Float32},1},Tuple{Symbol},NamedTuple{(:color,),Tuple{Array{RGBA{Float32},1}}}}, ::typeof(GeometryBasics.pointmeta), ::GeometryBasics.Mesh{2,Float32,GeometryBas ...99+)
at: ~/.julia/packages/GeometryBasics/dwE6R/src/meshes.jl:245
[4]  #123                 GLMakie           (::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Array{RGBA{Float32},1}, ::Nothing, ::Nothing)
at: ~/.julia/dev/GLMakie/src/drawing_primitives.jl:383
[5]  MapUpdater           Observables       (::GeometryBasics.Mesh{2,Float32,GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}},FaceView{GeometryBasics.Ngon{2,Float32,3,Point{2,Float32}}}}, ::Vararg{Any,N} where N)
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:241
[6]  OnUpdate             Observables       (::Array{RGBA{Float32},1})
at: ~/.julia/packages/Observables/0wrF6/src/Observables.jl:218
[7]  #setindex!#5         Observables       (::Observables.var"#6#8", ::typeof(setindex!), ::Observable{Array{RGBA{Float32},1}}, ::Array{RGBA{Float32},1})
at: ~/.julia/packages/Observables/0wrF6/src/

@SebastianM-C
Copy link
Contributor Author

It looks like at each call another 16 are added. Not sure if it's relevant.

@Datseris
Copy link
Contributor

Datseris commented Jun 1, 2020

@asinghvi17 sorry to invade the issue for something off-topic, but how did you get this nice presentation of stacktraces?

@SebastianM-C
Copy link
Contributor Author

See https://github.com/jkrumbiegel/ClearStacktrace.jl

(This may also be of interest JuliaLang/julia#36026)

@asinghvi17
Copy link
Member

Hmm...16 is 4x4, 4 vertices per bar x 4 bars.

@SimonDanisch
Copy link
Member

Fixed in: JuliaPlots/AbstractPlotting.jl#444

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

No branches or pull requests

4 participants