首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >到graphviz circo中节点之间的较大间距

到graphviz circo中节点之间的较大间距
EN

Stack Overflow用户
提问于 2012-06-14 16:01:53
回答 2查看 3.4K关注 0票数 4

我有一个简单的.dot文件(graphviz),如下所示:

代码语言:javascript
复制
digraph Mapper{
  Mapper [label=Mapper];

  General [label=General];
  GeneralNew [label=New];
  GeneralOpen [label=Open];
  GeneralSave [label=Save];
  GeneralClose [label=Close];
  GeneralSettings [label=Settings];
  GeneralHelp [label=Help];
  GeneralAbout [label=About];
  GeneralNewLoad [label="Load symbol set"];
  GeneralNewLoadFile [label="Load symbol set from file"];
  GeneralNewNoLoad [label="Don't load symbols"];
  GeneralOpenFiles [label="OCD|OMAP", shape=record];
  GeneralOpenRecent [label="Open recent"];
  GeneralSaveFiles [label="OMAP|MapperXML", shape=record];
  GeneralHelpStartup [label="Startup tips"];
  GeneralHelpHTML [label="HTML Help"];
  GeneralHelpWhatsThis [label="What's this?"];
  General -> GeneralNew;
  General -> GeneralOpen;
  General -> GeneralSave;
  General -> GeneralClose;
  General -> GeneralSettings;
  General -> GeneralHelp;
  General -> GeneralAbout;
  GeneralNew -> GeneralNewLoad;
  GeneralNew -> GeneralNewLoadFile;
  GeneralNew -> GeneralNewNoLoad;
  GeneralOpen -> GeneralOpenFiles;
  GeneralOpen -> GeneralOpenRecent;
  GeneralSave -> GeneralSaveFiles;
  GeneralHelp -> GeneralHelpStartup;
  GeneralHelp -> GeneralHelpHTML;
  GeneralHelp -> GeneralHelpWhatsThis;
  Mapper -> General;

  Map [label=Map];
  MapImport [label=Import];
  MapPrint [label=Print];
  MapEditor [label=Editor];
  MapChangeCoordinate [label="Change coordinate system"];
  MapChangeScale [label="Change scale"];
  MapAddNotes [label="Add notes"];
  MapImportFiles [label="DXF|GPX", shape=record];
  MapEditorUndo [label=Undo];
  MapEditorRedo [label=Redo];
  MapEditorTools [label=Tools];
  MapEditorSelectObjectsWithSymbol [label="Select all objects with symbol..."];
  MapEditorTools [label=Tools];
  MapEditorToolsEdit [label="Edit|Duplicate|Switch symbol|Switch direction|Connect|Rotate", shape=record, style=rounded];
  MapEditorToolsBasic [label="Point|Straight Line|Bezier|Circle|Rectangle|<text> Text", shape=record, style=rounded];
  MapEditorToolsAdvanced [label="Fill|Create border|Cut object|Measure", shape=record, style=rounded];
  MapEditorToolsArea [label="Area difference|Area XOr|Unify areas|Intersect areas", shape=record, style=rounded];
  MapEditorToolsCutArea [label="Cut hole"];
  MapEditorToolsCutAreas [label="Circle|Rectangle|Free", shape=record, style=rounded];
  MapEditorToolsTextAlignment [label="Text alignment"];
  Map -> MapImport;
  Map -> MapPrint;
  Map -> MapEditor;
  Map -> MapChangeCoordinate;
  Map -> MapChangeScale;
  Map -> MapAddNotes;
  MapImport -> MapImportFiles;
  MapEditor -> MapEditorUndo;
  MapEditor -> MapEditorRedo;
  MapEditor -> MapEditorTools;
  MapEditor -> MapEditorSelectObjectsWithSymbol;
  MapEditorTools -> MapEditorToolsEdit;
  MapEditorTools -> MapEditorToolsBasic;
  MapEditorTools -> MapEditorToolsAdvanced;
  MapEditorTools -> MapEditorToolsArea;
  MapEditorTools -> MapEditorToolsCutArea;
  MapEditorToolsBasic:text -> MapEditorToolsTextAlignment;
  MapEditorToolsCutArea -> MapEditorToolsCutAreas;
  Mapper -> Map;

  View [label=View];
  ViewZoom [label="Zoom"];
  ViewCoordinate [label="Coordinate display"];
  ViewFullscreen [label="Fullscreen"];
  ViewZoomIn [label="Zoom in"];
  ViewZoomOut [label="Zoom out"];
  ViewZoomWhole [label="Show whole map"];
  ViewZoomCustom [label="Custom zoom factor"];
  ViewCoordinateSystems [label="Map|Local|Degrees|DMS", shape=record];
  View -> ViewZoom;
  View -> ViewCoordinate;
  View -> ViewFullscreen;
  ViewZoom -> ViewZoomIn;
  ViewZoom -> ViewZoomOut;
  ViewZoom -> ViewZoomWhole;
  ViewZoom -> ViewZoomCustom;
  ViewCoordinate -> ViewCoordinateSystems;
  Mapper -> View;

  Symbols [label="Symbols"];
  SymbolsNew [label=New];
  SymbolsEdit [label=Edit];
  SymbolsDuplicate [label=Duplicate];
  SymbolsDelete [label=Delete];
  SymbolsScale [label="Scale"];
  SymbolsHide [label="Hide objects with symbol..."];
  SymbolsProtect [label="Protect objects with symbol..."];
  SymbolsSelectAll [label="Select all symbols"];
  SymbolsInvertSelect [label="Invert symbol selection"];
  SymbolsColors [label="Colors"];
  SymbolsColorsNew [label=New];
  SymbolsColorsDelete [label=Delete];
  SymbolsColorsDuplicate [label=Duplicate];
  SymbolsColorsOrder [label="Change order"];
  Symbols -> SymbolsNew;
  Symbols -> SymbolsEdit;
  Symbols -> SymbolsDuplicate;
  Symbols -> SymbolsDelete;
  Symbols -> SymbolsScale;
  Symbols -> SymbolsHide;
  Symbols -> SymbolsProtect;
  Symbols -> SymbolsSelectAll;
  Symbols -> SymbolsInvertSelect;
  Symbols -> SymbolsColors;
  SymbolsColors -> SymbolsColorsNew;
  SymbolsColors -> SymbolsColorsDelete;
  SymbolsColors -> SymbolsColorsDuplicate;
  SymbolsColors -> SymbolsColorsOrder;
  Mapper -> Symbols;

  Templates [label="Templates"];
  TemplatesOpen [label=Open];
  TemplatesOrder [label="Change order"];
  TemplatesOpenFiles [label="Images|GPX|DXF|OCD|OMAP", shape=record];
  TemplatesPaint [label="Paint on template"];
  TemplatesOpacity [label="Opacity"];
  TemplatesMove [label="Move"];
  TemplatesAdjust [label="Adjust"];
  TemplatesRotation [label="Rotation"];
  Templates -> TemplatesOpen;
  Templates -> TemplatesPaint;
  Templates -> TemplatesOrder;
  Templates -> TemplatesOpacity;
  Templates -> TemplatesMove;
  Templates -> TemplatesAdjust;
  Templates -> TemplatesRotation;
  TemplatesOpen -> TemplatesOpenFiles;
  Mapper -> Templates;
}

我使用以下命令来生成图形:

代码语言:javascript
复制
cat mapper.dot | circo -Tpng >output.png

其中mapper.dot是包含上述内容的文件。

问题是节点之间有很大的空间。我的意思是。有什么方法可以减少空间吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-06-14 16:39:09

从您的dot文件的输出判断,我不确定是否可以使用circo。就我个人而言,我会使用sfdp

如果我删除您的uuoc并使用以下命令创建镜像:

代码语言:javascript
复制
sfdp -Tpng -Goverlap=false -o output.png mapper.dot

您将获得没有节点重叠的较短边,但另一方面,边将与节点重叠。要摆脱这种情况,可以通过添加以下命令来启用样条

代码语言:javascript
复制
-Gsplines=true

添加到命令。

输出远非完美,但对我来说,它看起来比以前更有吸引力。

票数 -1
EN

Stack Overflow用户

发布于 2018-05-17 07:14:20

我找到了!

将"mindist“设置为小于1的数字

例如:

代码语言:javascript
复制
graph z {

  layout="circo"
  mindist=.3

  a -- b
  a -- c
  a -- d

}

我通过查看Circo source code找到了这个

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11028998

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档