Interactive network visualization

I’m looking for a way to visualize networks while being able to add/remove/move vertices interactively.
I’ve seen NetworkViz but it doesn’t look maintained anymore.

Would it be possible to use GraphRecipes by getting the mouse position and updating the node coordinates somehow?

I’m thankful for any suggestions of how to accomplish this.

1 Like

I found a solution that works for me in case anyone is interested:

  1. Use Makie.jl to draw the graph using the scatter and line functions
  2. Get the initial layout coordinates with NetworkLayout.jl
  3. Use Makie’s scene.events.mouseposition to update the positions of the vertices
4 Likes

Hi! This sounds like the thing you wanted and something that also interests me. Do you think you could attach a small example with a chunk of code so that we, the inexperienced ones, could benefit from your 3 step process? Thanks a lot!

Here’s an example using Makie + GraphMakie:

using LightGraphs
using GLMakie, GraphMakie

function networkplot(g)
    fig, ax, p = graphplot(g)
    
    hidedecorations!(ax)
    hidespines!(ax)

    function node_drag_action(state, idx, event, axis)
        p[:node_pos][][idx] = event.data
        p[:node_pos][] = p[:node_pos][]
    end

    ndrag = NodeDragHandler(node_drag_action)

    deregister_interaction!(ax, :rectanglezoom)
    register_interaction!(ax, :ndrag, ndrag)

    fig
end


g = erdos_renyi(10, 20)
networkplot(g)
2 Likes

Thanks, @Jakob ! Greatly appreciated!

I just tried it out and I got this message:

networkplot(g)
ERROR: MethodError: no method matching iterate(::Compose.Context)
Closest candidates are:
  iterate(::Union{LinRange, StepRangeLen}) at range.jl:664
  iterate(::Union{LinRange, StepRangeLen}, ::Int64) at range.jl:664
  iterate(::T) where T<:Union{Base.KeySet{var"#s79", var"#s78"} where {var"#s79", var"#s78"<:Dict}, Base.ValueIterator{var"#s77"} where var"#s77"<:Dict} at dict.jl:693
  ...
Stacktrace:
 [1] indexed_iterate(I::Compose.Context, i::Int64)
   @ Base ./tuple.jl:89
 [2] networkplot(g::SimpleGraph{Int64})
   @ Main ./REPL[91]:2
 [3] top-level scope
   @ REPL[92]:1

FYI: I also had to use the gplot() function instead of the graphplot() one, since it, strangely enough, is not defined…I assume that the latest package versions that I installed some minutes ago have something to do with that. GraphPlot.jl provides the gplot() function, which I used.

You should make sure that you have the newest versions of GLMake.jl and GraphMakie.jl installed. You can go into the package manager by pressing ] at the REPL and then enter status to see all packages and their versions in the current environment. The example above (which is mostly copied from the GraphMakie.jl documentation) worked on my end with GLMakie 0.4.6 and GraphMakie 0.2.4.

gplot(), coming from GraphPlot, wont work with the the Makie ecosystem so you need to use graphplot() which is exported from GraphMakie…

1 Like

Thanks for your answer and patience…am pretty new to Julia and still trying out different things…
Well, I have the following versions from within Julia 1.6:

(@v1.6) pkg> st GLMakie
      Status `~/.julia/environments/v1.6/Project.toml`
  [e9467ef8] GLMakie v0.4.5

(@v1.6) pkg> st GraphMakie
      Status `~/.julia/environments/v1.6/Project.toml`
  [1ecd5474] GraphMakie v0.2.2

and when I run your function now, I get the UndefVarError

julia> networkplot(g)
ERROR: UndefVarError: graphplot not defined
Stacktrace:
 [1] networkplot(g::SimpleGraph{Int64})
   @ Main ./REPL[101]:2
 [2] top-level scope
   @ REPL[103]:1

There is something I am missing here…
I guess it is the difference in versions that may play a role, right? I may have to migrate to 1.7, I guess.

No worries, we all have to start at some point :slight_smile: You’re not quite at the newest versions so you could go to the package manager again and run up to update all packages. That shouldn’t be the issue behind graphplot() not being defined, though. Have you loaded the packages into your current Julia session via using GLMakie, GraphMakie?

1 Like

Thanks for the kind words! I always feel I am a newbie in Julia, to be honest…which is a good and a bad thing… :slight_smile: Yes, I did all that…I tried the up from within the package manager and I cannot get the latest versions that you have. The ones that you see are the latest ones the manager fetches for me. That is why I thought I may need a more recent Julia version altogether to be able to update these packages.
I also did the using for both packages…and I get this error. Any idea why that happens?
Thanks in advance!

In Julia, it is usually best to have separate environments for different projects with only the needed packages loaded, instead of one big environment with all the packages added, to avoid dependency conflicts. So you could try to make a new environment and only add the packages you need.

To do so you need to do the following:

  1. Open your terminal at the project folder (e.g. C:/Users/Jakob/myproject) and open a julia session.
  2. Open the package manager via ] and run activate . The . means you activate the current directory but you could also enter the full path.This will activate the environment in the folder or create a new one if none exists.
  3. The package manager prompt should now indicate the new activated project, something like (myproject) pkg>
  4. Now you can add the packages you need from the package manager, e.g. by running add GLMakie, GraphMakie, LightGraphs

You can check if you get the most current versions now with ] status and try to run the example again in a julia session with the new environment activated.

2 Likes

Just to add to that, it might of course be that even in a new environment you won’t be able to install the latest version of a certain package because of conflicts, in which case you can do ] add Package@X.Y explicitly, where x.y is the latest version. You will then get a resolver error telling you what’s preventing the desired version from being installed.

2 Likes

Dear @Jakob and @nilshg .

The problem is that when I installed the newer version and then tried using them on a new environment, as you suggested, I seem to fail to precompile them. Apparently, something went wrong during their installation. I know this might probably not be the right place to ask this, but since am trying to migrate from R and python that have extremely easy to handle tools for network analysis and visualization, am not sure I will have the time to ask around more about this issue…If you are kind enough and find a few minutes, I would appreciate if you could give me any hint as to what to do with the error below!

Thanks anyways!

PS: I think these are the points where Julia is not as mature as the 2 other ones, R and python…package installations and conflicts of this kind are not there and I hope Julia’s people realize how frustrating it is for newcomers to the language to try to figure out why a package is not installed easily on their machine as it happens to other languages…to Julia’s community defence, you need to spend some more time on the internals of the language to get used to it anyways, but, unfortunately, the counterargument is that most of us, users, care to get the job done and not spend so much time in the preprocessing stages…

[ Info: Precompiling GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]
ERROR: LoadError: MethodError: no method matching names(::Base.Broadcast.BroadcastFunction{Irrational{:log4π}})
Closest candidates are:
  names(::Module; all, imported) at reflection.jl:98
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:11
 [2] include
   @ ./Base.jl:386 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1213
 [4] top-level scope
   @ none:1
 [5] eval
   @ ./boot.jl:360 [inlined]
 [6] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [7] top-level scope
   @ none:1
in expression starting at /Users/atantos/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:3
ERROR: LoadError: Failed to precompile StatsFuns [4c63d2b9-4356-54db-8cca-17b64c39e42c] to /Users/atantos/.julia/compiled/v1.6/StatsFuns/jl_fSBnYy.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Distributions/wMQPJ/src/Distributions.jl:1
ERROR: LoadError: Failed to precompile Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] to /Users/atantos/.julia/compiled/v1.6/Distributions/jl_5HTYxy.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Makie/PFSZS/src/Makie.jl:1
ERROR: LoadError: Failed to precompile Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] to /Users/atantos/.julia/compiled/v1.6/Makie/jl_gYO5Lr.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/GLMakie/TViqo/src/GLMakie.jl:1
ERROR: Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to /Users/atantos/.julia/compiled/v1.6/GLMakie/jl_dRvIkJ.
Stacktrace:
  [1] error(s::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)))
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)), internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)))
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] eval
    @ ./boot.jl:360 [inlined]
  [8] eval
    @ ./Base.jl:39 [inlined]
  [9] repleval(m::Module, code::Expr, #unused#::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)))
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/repl.jl:157
 [10] (::VSCodeServer.var"#69#71"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/repl.jl:123
 [11] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:491
 [12] with_logger
    @ ./logging.jl:603 [inlined]
 [13] (::VSCodeServer.var"#68#70"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/repl.jl:124
 [14] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [15] invokelatest(::Any)
    @ Base ./essentials.jl:706
 [16] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [17] (::VSCodeServer.var"#53#54")()
    @ VSCodeServer ./task.jl:411

It’s hard to guess what

I installed the newer version and then tried using them on a new environment

means. It’s easiest if you do

] activate --temp

] add GLMakie LightGraphs GraphMakie

julia> using LightGraphs, GLMakie, GraphMakie

and report any errors you get from that.

Ok…after activating a temporary environment (i guess) with ] activate --temp on a new, empty directory and when I ] add GLMakie LightGraphs GraphMakie I got the:


Precompiling project...
  ✗ StatsFuns
  ✗ Distributions
  ✗ KernelDensity
  ✗ Makie
  ✗ GraphMakie
  ✗ GLMakie
  0 dependencies successfully precompiled in 27 seconds (166 already precompiled)
  6 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages

Then, I run import Pkg; Pkg.precompile() as was advised and I got:

julia> import Pkg; Pkg.precompile()
Precompiling project...
  ✗ StatsFuns
  ✗ Distributions
  ✗ KernelDensity
  ✗ Makie
  ✗ GraphMakie
  ✗ GLMakie
  0 dependencies successfully precompiled in 27 seconds (166 already precompiled)

ERROR: The following 2 direct dependencies failed to precompile:

GraphMakie [1ecd5474-83a3-4783-bb4f-06765db800d2]

ERROR: LoadError: MethodError: no method matching names(::Base.Broadcast.BroadcastFunction{Irrational{:log4π}})
Closest candidates are:
  names(::Module; all, imported) at reflection.jl:98
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:11
 [2] include
   @ ./Base.jl:386 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1213
 [4] top-level scope
   @ none:1
 [5] eval
   @ ./boot.jl:360 [inlined]
 [6] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [7] top-level scope
   @ none:1
in expression starting at /Users/atantos/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:3
ERROR: LoadError: Failed to precompile StatsFuns [4c63d2b9-4356-54db-8cca-17b64c39e42c] to /Users/atantos/.julia/compiled/v1.6/StatsFuns/jl_POzhVO.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{IOStream})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Distributions/wMQPJ/src/Distributions.jl:1
ERROR: LoadError: Failed to precompile Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] to /Users/atantos/.julia/compiled/v1.6/Distributions/jl_MEYLcI.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{IOStream})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Makie/PFSZS/src/Makie.jl:1
ERROR: LoadError: Failed to precompile Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] to /Users/atantos/.julia/compiled/v1.6/Makie/jl_JY3pmw.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{IOStream})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/GraphMakie/Xoi2T/src/GraphMakie.jl:1

GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]

ERROR: LoadError: MethodError: no method matching names(::Base.Broadcast.BroadcastFunction{Irrational{:log4π}})
Closest candidates are:
  names(::Module; all, imported) at reflection.jl:98
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:11
 [2] include
   @ ./Base.jl:386 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1213
 [4] top-level scope
   @ none:1
 [5] eval
   @ ./boot.jl:360 [inlined]
 [6] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [7] top-level scope
   @ none:1
in expression starting at /Users/atantos/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:3
ERROR: LoadError: Failed to precompile StatsFuns [4c63d2b9-4356-54db-8cca-17b64c39e42c] to /Users/atantos/.julia/compiled/v1.6/StatsFuns/jl_7eIywG.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{IOStream})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Distributions/wMQPJ/src/Distributions.jl:1
ERROR: LoadError: Failed to precompile Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] to /Users/atantos/.julia/compiled/v1.6/Distributions/jl_NBrnlg.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{IOStream})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Makie/PFSZS/src/Makie.jl:1
ERROR: LoadError: Failed to precompile Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] to /Users/atantos/.julia/compiled/v1.6/Makie/jl_QFDMit.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{IOStream})
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/GLMakie/TViqo/src/GLMakie.jl:1

Stacktrace:
 [1] pkgerror(msg::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)))
   @ Pkg.Types /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1244
 [3] precompile
   @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:920 [inlined]
 [4] #precompile#196
   @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:918 [inlined]
 [5] precompile()
   @ Pkg.API /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:918
 [6] top-level scope
   @ REPL[66]:1

I never got to the using line, since the problem is already there, as you can see.

Hm, that works for me with no issues. What’s your Julia version and which versions of GraphMakie, GLMakie, and LightGraphs are getting installed in your new environment?

Here is the info:

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 

I checked the latest releases of the packages on their pages and I have them…
GraphMakie = v0.4.6
GLMakie = v0.2.4
LightGraphs = v1.3.5

BUT, for Makie I got this here, although I had it installed earlier:

(jl_XBjS1x) pkg> st Makie
  No Matches in `/private/var/folders/1c/pz057gn56wg5mmvslp7vnnzm0000gn/T/jl_XBjS1x/Project.toml`

After seeing that, I did add Makie and I got:

(jl_XBjS1x) pkg> st Makie
      Status `/private/var/folders/1c/pz057gn56wg5mmvslp7vnnzm0000gn/T/jl_XBjS1x/Project.toml`
  [ee78f7c6] Makie v0.15.2

There is another interesting fact. I tried to remove and install all 6 packages (Distributions, StatsFuns, KernelDensity, Makie, GLMakie and GraphMakie) included in the error message, in this way: I first removed them all and then added the 3 packages of immediate interest: Makie, GLMakie and GraphMakie to check whether there was something wrong with the 3 removed statistics-related packages. After that and although these 3 (Distributions, StatsFuns, KernelDensity) were not there any more, I still could not get the Makie package family installed. I got an error message that STILL included reference to the 3 others (the removed ones)…is there something going on with the cache or with the updating of the Project.toml?

julia> using LightGraphs, GLMakie, GraphMakie
[ Info: Precompiling GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]
ERROR: LoadError: MethodError: no method matching names(::Base.Broadcast.BroadcastFunction{Irrational{:log4π}})
Closest candidates are:
  names(::Module; all, imported) at reflection.jl:98
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:11
 [2] include
   @ ./Base.jl:386 [inlined]
 [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
   @ Base ./loading.jl:1213
 [4] top-level scope
   @ none:1
 [5] eval
   @ ./boot.jl:360 [inlined]
 [6] eval(x::Expr)
   @ Base.MainInclude ./client.jl:446
 [7] top-level scope
   @ none:1
in expression starting at /Users/atantos/.julia/packages/StatsFuns/LlviX/src/StatsFuns.jl:3
ERROR: LoadError: Failed to precompile StatsFuns [4c63d2b9-4356-54db-8cca-17b64c39e42c] to /Users/atantos/.julia/compiled/v1.6/StatsFuns/jl_rKLu0Q.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Distributions/wMQPJ/src/Distributions.jl:1
ERROR: LoadError: Failed to precompile Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] to /Users/atantos/.julia/compiled/v1.6/Distributions/jl_aRlVnX.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/Makie/PFSZS/src/Makie.jl:1
ERROR: LoadError: Failed to precompile Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] to /Users/atantos/.julia/compiled/v1.6/Makie/jl_ntHHWY.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1213
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /Users/atantos/.julia/packages/GLMakie/TViqo/src/GLMakie.jl:1
ERROR: Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to /Users/atantos/.julia/compiled/v1.6/GLMakie/jl_w6DTr4.
Stacktrace:
  [1] error(s::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)))
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)), internal_stderr::Base.TTY, internal_stdout::Base.TTY)
    @ Base ./loading.jl:1360
  [3] compilecache(pkg::Base.PkgId, path::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)))
    @ Base ./loading.jl:1306
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1021
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
  [7] eval
    @ ./boot.jl:360 [inlined]
  [8] eval
    @ ./Base.jl:39 [inlined]
  [9] repleval(m::Module, code::Expr, #unused#::IOContext(IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1)))
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/repl.jl:157
 [10] (::VSCodeServer.var"#69#71"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/repl.jl:123
 [11] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:491
 [12] with_logger
    @ ./logging.jl:603 [inlined]
 [13] (::VSCodeServer.var"#68#70"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/repl.jl:124
 [14] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [15] invokelatest(::Any)
    @ Base ./essentials.jl:706
 [16] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.4.3/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [17] (::VSCodeServer.var"#53#54")()
    @ VSCodeServer ./task.jl:411

For Makie you only need to add one of the frontends (GLMake, CairoMakie, or WGLMake) but not Makie itself.

Maybe something has gone wrong with your environment. Is (jl_XBjS1x) pkg> really the environment you wanted to activate?

This was a temp environment I prepared with activate --temp that @nilshg suggested above. As for Makie, would you recommend to remove it and then install the frontends directly?

I tried to remove Makie and then reinstall the frontends, as you suggest, but I get an error again(the same)…