Search packages, repositories and app categories

graphite cover
Package detailsv1.2.1

graphite

Flutter widget to easily draw direct graphs, trees, flowcharts. Includes gesture API to create graphs interactions.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
2.1K
Likes
187
Pub points
135

Install package

flutter pub add graphite

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Graphite is a Flutter package that simplifies the creation of direct graphs, trees, and flowcharts within applications. It provides a flexible widget for visualizing hierarchical and networked data with built-in gesture support for interactive graph manipulation. Developers can easily customize node appearance, connections, and layout behavior. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform visualization needs.

Use cases

  • Visualizing organizational hierarchies
  • Creating interactive flowcharts
  • Displaying data dependency trees
  • Building diagramming tools
  • Designing UIs with dynamic node networks

Key features

  • Built-in gesture interactions
  • Customizable node and edge styling
  • Support for hierarchical and directed layouts
  • Cross-platform compatibility
  • Easy integration with Flutter widgets
  • Extensible API for graph modifications

Suitable for

  • UI developers working on diagram-heavy apps
  • Educational or technical applications requiring visual data representation
  • Tools needing user-editable graph structures
  • Teams building interactive data visualization dashboards

Considerations

  • May require performance optimization for large graphs
  • Custom layout logic might need additional implementation
  • Limited built-in animation features
  • Best suited for moderate-sized datasets
  • Requires understanding of graph theory concepts for advanced use

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Graphite

Actions Status

:arrow_right: :black_square_button: Flutter widget to draw direct graphs, trees, flowcharts in rectanglar manner.

Support the author :yellow_heart: :blue_heart:

The only reason why the latest release of Graphite become possible is because of Armed Forces Of Ukraine. Ukrainian defenders are those who saved the author's life last spring and currently continue fighting with absolute evil in my country. If you liked this lib and want to support future releases I would be grateful for your donations to Come Back Alive Charity which directly supports UA Army with equipment.

Thank you.

vertical custom

flowchart

label

digimon

Example of usage:

import 'package:flutter/material.dart';
import 'package:graphite/graphite.dart';

void main() => runApp(MyApp());
const list = '['
    '{"id":"A","next":[{"outcome":"B"}]},'
    '{"id":"B","next":[{"outcome":"C"},{"outcome":"D"},{"outcome":"E"}]},'
    '{"id":"C","next":[{"outcome":"F"}]},'
    '{"id":"D","next":[{"outcome":"J"}]},{"id":"E","next":[{"outcome":"J"}]},'
    '{"id":"J","next":[{"outcome":"I"}]},'
    '{"id":"I","next":[{"outcome":"H"}]},{"id":"F","next":[{"outcome":"K"}]},'
    '{"id":"K","next":[{"outcome":"L"}]},'
    '{"id":"H","next":[{"outcome":"L"}]},{"id":"L","next":[{"outcome":"P"}]},'
    '{"id":"P","next":[{"outcome":"M"},{"outcome":"N"}]},'
    '{"id":"M","next":[]},{"id":"N","next":[]}'
    ']';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Graphite',
      theme: ThemeData(
        primarySwatch: Colors.teal,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: InteractiveViewer(
        constrained: false,
        child: DirectGraph(
          list: nodeInputFromJson(list),
          defaultCellSize: const Size(100.0, 100.0),
          cellPadding: const EdgeInsets.all(20),
          orientation: MatrixOrientation.Vertical,
       ),
      )
    );
  }
}

Features

  • Nodes and edge gesture events.
  • Ability provide graph building direction (horizontal or vertical).
  • Ability to provide custom builder to node widget.
  • Ability to add overlays.
  • Ability to add edge text or Widget labels.
  • Ability to provide custom paint builder to graph edges.
  • Ability to customize arrows and lines.

License

MIT © lempiy

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.