## Random Rectangular Graph ​

julia
``````# Adaptation from:
# L Alonso, et. al. https://doi.org/10.1093/comnet/cnx053

using LinearAlgebra, Random, GLMakie
GLMakie.activate!()
GLMakie.closeall() # close any open screen

Random.seed!(rseed)
xy = rand(nodes, 3)
x = xy[:, 1]
y = xy[:, 2]
z = xy[:, 3]

for point in 1:nodes-1
xseps = (x[point+1:end] .- x[point]) .^ 2
yseps = (y[point+1:end] .- y[point]) .^ 2
zseps = (z[point+1:end] .- z[point]) .^ 2

distance = sqrt.(xseps .+ yseps .+ zseps)
dindx = findall(distance .<= radius) .+ point
if length(dindx) > 0
rnd = randn(length(dindx))
end
end
end

xyzos = []
weights = []
for i in eachindex(x), j in i+1:length(x)
push!(xyzos, [x[i], y[i], z[i]])
push!(xyzos, [x[j], y[j], z[j]])
end
end
return (Point3f.(xyzos), Float32.(weights))
end

cmap = (:Hiroshige, 0.75)
segm, weights = getGraphEdges3D(adjacencyM3D, x, y, z)

fig, ax, pltobj = linesegments(segm; color = weights, colormap = cmap,
linewidth = abs.(weights),
figure = (;
size = (1200, 800),
fontsize = 24),
axis = (;
type = Axis3,
aspect = (1, 1, 1),
perspectiveness = 0.5))
meshscatter!(ax, x, y, z; color = diagValues,
markersize = abs.(diagValues) ./ 90,