搜索插件、代码仓与 APP 分类

graphite 封面
插件详情v1.2.1

graphite

一个易于绘制有向图、树形图、流程图的 Flutter 小部件。包含手势 API,用于创建图形交互。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
2090
喜欢数
187
Pub 分数
135

安装插件

flutter pub add graphite

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Graphite 是一个 Flutter 包,可简化在应用程序中创建有向图、树状图和流程图的过程。它提供了一个灵活的组件,用于可视化层次结构和网络数据,并内置了手势支持,便于交互式图形操作。开发者可以轻松自定义节点外观、连接方式和布局行为。该包支持多种平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,非常适合跨平台可视化需求。

适合场景

  • 可视化组织架构
  • 创建交互式流程图
  • 显示数据依赖关系树
  • 构建绘图工具
  • 使用动态节点网络设计用户界面

主要特点

  • 内置手势交互
  • 可自定义的节点和边样式
  • 支持层次化和有向布局
  • 跨平台兼容性
  • 与 Flutter 小部件的轻松集成
  • 可扩展的图修改 API

适合对象

  • UI 开发人员在图表密集型应用程序上工作
  • 需要视觉数据表示的教育或技术应用
  • 需要用户可编辑图结构的工具
  • 构建交互式数据可视化仪表板的团队

使用建议

  • 可能需要针对大型图进行性能优化
  • 自定义布局逻辑可能需要额外的实现
  • 有限的内置动画功能
  • 最适合中等大小的数据集
  • 高级使用需要理解图论概念

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。