gviz 0.4.0 copy "gviz: ^0.4.0" to clipboard
gviz: ^0.4.0 copied to clipboard

A simple utility for creating GraphViz directed graphs using an object oriented API.

example/example.dart

// Copyright (c) 2017, Kevin Moore. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:gviz/gviz.dart';

void main() {
  final graph = Gviz();

  for (var item in [
    [1, 2],
    [2, 5],
    [5, 1],
    [2, 6],
    [5, 6],
    [2, 3],
    [6, 7],
    [7, 6],
    [3, 7],
    [3, 4],
    [4, 3],
    [4, 8],
    [8, 4],
    [8, 7]
  ]) {
    final from = item[0].toString();
    final to = item[1].toString();

    if (item[0] % 2 == 1 && !graph.nodeExists(from)) {
      graph.addNode(from, properties: {'color': 'red'});
    }

    graph.addEdge(from, to);
  }

  print(graph);
}
10
likes
155
points
15.5k
downloads

Publisher

verified publisherkevmoo.com

Weekly Downloads

A simple utility for creating GraphViz directed graphs using an object oriented API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on gviz