private static void Example()
{
const string sourceId = "C++_netstream_test";
ulong timeId = 0L;
var stream = new NetStreamSender("default", "localhost", 2001);
const string style = "node {" +
" shape: rounded-box;" +
" fill-color: grey;" +
" fill-mode: dyn-plain;" +
" size-mode: fit;" +
"}" +
"node.active {" +
" fill-color: green;" +
" size:20px;" +
"}" +
"edge {" +
" shape: cubic-curve;" +
" size: 1px;" +
" arrow-shape: arrow;" +
"}" +
"edge.active {" +
" fill-color: green;" +
" size: 5px;" +
"}";
stream.AddGraphAttribute(sourceId, timeId++, "stylesheet", style);
stream.AddGraphAttribute(sourceId, timeId++, "ui.antialias", true);
stream.AddGraphAttribute(sourceId, timeId++, "ui.quality", true);
stream.AddGraphAttribute(sourceId, timeId++, "layout.stabilization-limit", 0);
for (int i = 0; i < 500; i++)
{
var n1 = i.ToString();
AddNodeWithLabel(stream, sourceId, ref timeId, n1);
if (i > 0)
{
var n2 = (i - 1).ToString();
var n3 = (i / 2).ToString();
var e1 = n1 + "-" + n2;
var e2 = n1 + "-" + n3;
AddEdgeWithLabel(stream, sourceId, ref timeId, e1, n1, n2);
if (!e1.Equals(e2))
{
AddEdgeWithLabel(stream, sourceId, ref timeId, e2, n1, n3);
}
}
//Thread.Sleep(100);
}
stream.Close();
}