带C#的DEX图形数据库:是否有图形导出的代码示例?

带C#的DEX图形数据库:是否有图形导出的代码示例?,c#,graph-databases,C#,Graph Databases,我开始用C#使用DEX图形数据库。到目前为止,我已经成功地运行了一些简单的示例,但无法找到如何导出图形 我想将图形导出为Graphviz格式,以便使用其他可视化工具显示它。是否有人知道有什么好的资源可以找到图形导出的示例,或者可能有人已经成功导出了图形并可以共享代码 非常感谢您的帮助。有一个简单的默认导出器,可以这样使用: DefaultExport exp = new DefaultExport(); graph.Export("exported.gv", ExportType.Graphvi

我开始用C#使用DEX图形数据库。到目前为止,我已经成功地运行了一些简单的示例,但无法找到如何导出图形

我想将图形导出为Graphviz格式,以便使用其他可视化工具显示它。是否有人知道有什么好的资源可以找到图形导出的示例,或者可能有人已经成功导出了图形并可以共享代码


非常感谢您的帮助。

有一个简单的默认导出器,可以这样使用:

DefaultExport exp = new DefaultExport();
graph.Export("exported.gv", ExportType.Graphviz, exp);
但是为了获得更好的输出,您可能需要编写自己的导出程序来扩展类


如果您有问题,您可以向公司询问。

有一个简单的默认导出器,可以这样使用:

DefaultExport exp = new DefaultExport();
graph.Export("exported.gv", ExportType.Graphviz, exp);
但是为了获得更好的输出,您可能需要编写自己的导出程序来扩展类


如果你有问题,你可以向公司询问。

要做你自己的出口商,你应该这样做:

public class MyExport : ExportManager
    {
        private Graph g = null;

        public MyExport() {
        }

        public override void Prepare(Graph graph) {
            // This method will be called once at the beginning of the export.
            // So we keep the graph being exported.
            g = graph;

        }

        public override void Release() {
            // Called once at the end of the export process.
        }

        public override bool GetGraph(GraphExport graphExport) {
            // Called once to get the Graph details (a label)
            graphExport.SetLabel("[MyExport] MyGraph");
            return true;
        }

        public override bool EnableType(int type) {
            // Will be called once for each type to allow or deny the export of
            // the nodes/edges of each type
            return true; // We enable the export of all types
        }


        public override bool GetNode(long node, NodeExport nodeExport) {
            // Called once for each node of an allowed type to get it's export definition.
            // The definition will be used if it returns true, or the default
            // node type definition from getNodeType will be used if this method
            // returns false.
            // It can set the label, shape, color, ...
            nodeExport.SetLabel("[MyExport] MyNode " + node);
            return true;
        }

        public override bool GetNodeType(int type, NodeExport nodeExport) {
            // Used to get a node type generic export definition.
            // Called once for each node only if the call to GetNode returned false.
            // It can set the label, shape, color, ...
            nodeExport.SetLabel("[MyExport] MyNodeType " + type);
            return true;
        }

        public override bool GetEdge(long edge, EdgeExport edgeExport) {
            // Called once for each edge of an allowed type to get it's export definition.
            // The definition will be used if it returns true, or the default
            // edge type definition from getEdgeType will be used if this method
            // returns false.
            // It can set the label, shape, color, ...
            edgeExport.SetLabel("[MyExport] MyEdge " + edge);
            return true;
        }

        public override bool GetEdgeType(int type, EdgeExport edgeExport) {
            // Used to get an edge type generic export definition.
            // Called once for each edge only if the call to GetEdge returned false.
            // It can set the label, shape, color, ...
            edgeExport.SetLabel("[MyExport] MyEdgeType " + type);
            return true;
        }
    } 

恐怕对于graphviz,出口商只接受更换标签。对于颜色和形状。。。也许你可以考虑使用YGOLML出口?

< P>让你自己的出口商你应该做这样的事情:

public class MyExport : ExportManager
    {
        private Graph g = null;

        public MyExport() {
        }

        public override void Prepare(Graph graph) {
            // This method will be called once at the beginning of the export.
            // So we keep the graph being exported.
            g = graph;

        }

        public override void Release() {
            // Called once at the end of the export process.
        }

        public override bool GetGraph(GraphExport graphExport) {
            // Called once to get the Graph details (a label)
            graphExport.SetLabel("[MyExport] MyGraph");
            return true;
        }

        public override bool EnableType(int type) {
            // Will be called once for each type to allow or deny the export of
            // the nodes/edges of each type
            return true; // We enable the export of all types
        }


        public override bool GetNode(long node, NodeExport nodeExport) {
            // Called once for each node of an allowed type to get it's export definition.
            // The definition will be used if it returns true, or the default
            // node type definition from getNodeType will be used if this method
            // returns false.
            // It can set the label, shape, color, ...
            nodeExport.SetLabel("[MyExport] MyNode " + node);
            return true;
        }

        public override bool GetNodeType(int type, NodeExport nodeExport) {
            // Used to get a node type generic export definition.
            // Called once for each node only if the call to GetNode returned false.
            // It can set the label, shape, color, ...
            nodeExport.SetLabel("[MyExport] MyNodeType " + type);
            return true;
        }

        public override bool GetEdge(long edge, EdgeExport edgeExport) {
            // Called once for each edge of an allowed type to get it's export definition.
            // The definition will be used if it returns true, or the default
            // edge type definition from getEdgeType will be used if this method
            // returns false.
            // It can set the label, shape, color, ...
            edgeExport.SetLabel("[MyExport] MyEdge " + edge);
            return true;
        }

        public override bool GetEdgeType(int type, EdgeExport edgeExport) {
            // Used to get an edge type generic export definition.
            // Called once for each edge only if the call to GetEdge returned false.
            // It can set the label, shape, color, ...
            edgeExport.SetLabel("[MyExport] MyEdgeType " + type);
            return true;
        }
    } 
恐怕对于graphviz,出口商只接受更换标签。对于颜色和形状。。。也许你可以考虑使用YGOLML出口?