public void AddEdge(String sourceId, ulong timeId, String edgeId, String fromNodeId, String toNodeId, bool directed) { NetStreamStorage buff = new NetStreamStorage(). EncodeArray(_streamIdArray). EncodeEvent(NetStreamEvent.AddEdge). EncodeString(sourceId). EncodeNative(timeId). EncodeString(edgeId). EncodeString(fromNodeId). EncodeString(toNodeId). EncodeNative(directed); DoSend(buff); }
private static void AddEdgeWithLabel(NetStreamSender stream, string sourceId, ref ulong timeId, string name, string nodeFrom, string nodeTo) { if (lastEdge != null) stream.RemoveEdgeAttribute(sourceId, timeId++, lastEdge, "ui.class"); stream.AddEdge(sourceId, timeId++, name, nodeFrom, nodeTo, false); stream.AddEdgeAttribute(sourceId, timeId++, name, "ui.label", name); stream.AddEdgeAttribute(sourceId, timeId++, name, "ui.class", "active"); lastEdge = name; }