本文介绍了将GraphML转换为GV或Dot文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用"graphml"在graphvis中绘制图形?文件作为输入.
我知道 graphviz graphml2gv 一起提供,但是当我尝试从命令提示符运行此命令时,得到此消息
cvtgxl:未配置为从GXL转换为GV

How can I draw a graph in graphvis using "graphml" file as an input.
I know graphviz comes with graphml2gv for this purpose but when I try to run this command from command prompt I get this message
cvtgxl: not configured for conversion from GXL to GV

推荐答案

您的Graphviz副本是在没有Expat库的情况下编译的(要纠正,请安装Expat并在运行后重新编译./configure--with-expat = yes).

Your copy of Graphviz was compiled without the Expat library (to redress, install Expat and recompile after running ./configure --with-expat=yes).

cmd/tools/graphml2gv.c :

#ifdef HAVE_EXPAT
    initargs(argc, argv);
    while ((inFile = getFile())) {
    while ((G = graphml_to_gv(nameOf(gname, gcnt), inFile, &rv))) {
        gcnt++;
        if (prev)
        agclose(prev);
        prev = G;
        if (Verbose)
        fprintf (stderr, "%s: %d nodes %d edges\n",
            agnameof (G), agnnodes(G), agnedges(G));
        agwrite(G, outFile);
        fflush(outFile);
    }
    }
    exit(rv);
#else
    fputs("cvtgxl: not configured for conversion from GXL to GV\n", stderr);
    exit(1);
#endif

这篇关于将GraphML转换为GV或Dot文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 04:27