toDot function

String toDot(
  1. VizRoot item, {
  2. bool escapeLabels = false,
  3. Iterable<String> ignorePackages = const [],
})

Implementation

String toDot(
  VizRoot item, {
  bool escapeLabels = false,
  Iterable<String> ignorePackages = const [],
}) {
  final gviz = Gviz(
    name: 'pubviz',
    graphProperties: {'nodesep': '0.2'},
    edgeProperties: {'fontcolor': 'gray'},
  );

  for (var pack
      in item.packages.values.where((v) => !ignorePackages.contains(v.name))) {
    gviz.addBlankLine();
    _writeDot(pack, gviz, item.root.name, escapeLabels, ignorePackages);
  }

  return gviz.toString();
}