gviz 0.2.0+1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 46

A simple Dart package for writing GraphViz dot files.

0.2.0+1

  • Support Dart 2 stable.

0.2.0

  • Added graphProperties to the Gviz constructor.
  • BREAKING Rename EdgeFlag to Flag.

0.1.0

  • Rename Graph to Gviz.
  • Added Graph class which actually represents a DAG.
  • Ensure nodes are only added once.

0.0.1

  • Initial version.

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() {
  var g = new Graph.fromEdges([
    [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]
  ]);

  g.flagConnectedComponents();

  print(g.createGviz(graphStyle: new GStyle()));
}

class GStyle extends GraphStyle {
  @override
  Map<String, String> styleForNode(Object node) {
    var props = super.styleForNode(node);
    if (node is int && node % 2 == 1) {
      props['color'] = 'red';
    }

    return props;
  }

  @override
  Map<String, String> styleForEdge(Edge edge) {
    var props = <String, String>{};

    if (edge.flags.isNotEmpty) {
      props['color'] = 'blue';
    }

    return props;
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  gviz: ^0.2.0+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:gviz/gviz.dart';
  
Version Uploaded Documentation Archive
0.2.0+1 Jul 25, 2018 Go to the documentation of gviz 0.2.0+1 Download gviz 0.2.0+1 archive
0.2.0 Dec 21, 2017 Go to the documentation of gviz 0.2.0 Download gviz 0.2.0 archive
0.1.0 Aug 8, 2017 Go to the documentation of gviz 0.1.0 Download gviz 0.1.0 archive
0.0.1 Aug 3, 2017 Go to the documentation of gviz 0.0.1 Download gviz 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:gviz/gviz.dart.

Suggestions

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
collection ^1.14.3 1.14.11
Dev dependencies
test ^1.3.0