Created
July 8, 2016 13:42
-
-
Save abhijithanilkumar/c705231bc53e49ed8a38cf2fb85499ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LightGraphs | |
using NetworkViz | |
using NetworkLayout | |
using ThreeJS | |
using Colors | |
main(window) = begin | |
"""ar = int(open(readdlm,"jagmesh1.mtx")) | |
x = ar[:,1] | |
y = ar[:,2] | |
z = [1 for i in 1:3600] | |
am = sparse(x,y,z)""" | |
node=NodeProperty(Color[parse(Colorant,"#00004d") for i in 1:30],0.5,1) | |
edge=EdgeProperty("#ff3333",2) | |
g = WheelGraph(30) | |
am = full(adjacency_matrix(g)) | |
#loc_x, loc_y = layout_fdp(am,tol=0.01,C=0.2,K=2) | |
#loc_z = zeros(size(am)) | |
new = layout_fdp(am,2,tol=0.01,C=0.2,K=2) | |
loc_x = Float64[new[i][1] for i in 1:30] | |
loc_y = Float64[new[i][2] for i in 1:30] | |
#loc_z = Float64[new[i][3] for i in 1:936] | |
loc_z = zeros(size(am)) | |
pts = zip(loc_x,loc_y,loc_z,node.color) | |
vertices = find_edges(loc_x, loc_y, full(am)) | |
push!(window.assets,("ThreeJS","threejs")) | |
push!(window.assets,"widgets") | |
vbox( | |
vskip(2em), | |
plot(collect(pts),vertices, node, edge) | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment