Created
April 8, 2016 19:11
-
-
Save abhijithanilkumar/4f8e7a9943c169aca9dca1bba1014240 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
#Run this code in Escher | |
using NetworkViz | |
using LightGraphs | |
main(window) = begin | |
num = Signal(10) | |
width = Signal(1) | |
nodesize = Signal(0.2) | |
edgewidth = Signal(0.5) | |
toggle = Signal(true) | |
g = WheelGraph(20) | |
c = Color[parse(Colorant,"#00004d") for i in 1:nv(g)] | |
push!(window.assets,("ThreeJS","threejs")) | |
push!(window.assets,"widgets") | |
vbox( | |
h1("Change Properties Example"), | |
vskip(2em), | |
vbox( | |
"Node Size", | |
slider(0:5) >>> nodesize | |
), | |
vskip(2em), | |
vbox( | |
"Edge Thickness", | |
slider(0:10) >>> edgewidth | |
), | |
vskip(2em), | |
vbox( | |
"Circle/Square Nodes", | |
hskip(2em), | |
togglebutton() >>> toggle | |
), | |
vskip(2em), | |
map(toggle,nodesize,edgewidth) do t,nsize,ewidth | |
n = NodeProperty(c,nsize,t) | |
e = EdgeProperty("#ff3333",ewidth) | |
@show nsize,ewidth,t | |
drawGraph(g,node=n,edge=e,z=1) | |
end | |
) |> pad(2em) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment