graphviz - graphviz circo中节点之间的空间很大

标签 graphviz dot

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

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;
}

我正在使用以下命令生成图形:
cat mapper.dot | circo -Tpng >output.png

其中 mapper.dot 是具有上述内容的文件。

问题是节点之间有很多空间。我的意思是很多。有没有办法减少空间?

最佳答案

我找到了!

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

例如:

graph z {

  layout="circo"
  mindist=.3

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

}

我通过查看 Circo source code 发现了这个

关于graphviz - graphviz circo中节点之间的空间很大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11028998/

相关文章:

python - 如何使用 pygraphviz for dot 连接记录中的 graphviz 节点?

graphviz - gvpack (graphviz) 不保留各个有向字母的标签

graphviz - Graphviz DOT 文件中的多个图形

graphviz - 关于 Graphviz API 的问题(Graphviz 作为一个库)

graphviz - 多特历史事件年表

graphviz - 我怎样才能影响 Graphviz/dot 通过消除蛇形和更好的边交叉来制作更好的控制流图?

Graphviz 绘制两个箭头而不是一个

python - 如何指定决策树的 graphviz 表示形式的 figsize?

python - 从 python 打开 .dot 格式的图形

environment-variables - Doxygen for Windows 中 DOT 路径的环境变量