पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

flutter_graph_view कवर
पैकेज विवरणv2.1.0

flutter_graph_view

सुंदर ग्राफिक डेटा संरचनाओं के लिए विजेट्स, उदाहरण के लिए बल-आधारित आरेख।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
3.1 हज़ार
लाइक
93
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add flutter_graph_view

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

Flutter Graph View एक दृश्य पैकेज है जो बल-निर्देशित आरेखों सहित दृश्यात्मक रूप से आकर्षक ग्राफ डेटा संरचनाओं के निर्माण की अनुमति देता है। यह नोड और एज को चित्रित करने के लिए कस्टमाइज़ किए जा सकने वाले विजेट प्रदान करता है, जिसमें स्मूथ एनीमेशन और इंटरैक्टिव व्यवहार शामिल हैं। नेटवर्क, ट्री या डिपेंडेंसी ग्राफ में जटिल संबंधों को दिखाने के लिए उपयुक्त है, यह मोबाइल, वेब और डेस्कटॉप सहित कई प्लेटफॉर्म का समर्थन करता है। पैकेज दक्ष लेआउट एल्गोरिदम का उपयोग करता है ताकि बड़े डेटासेट के साथ भी प्रतिक्रियाशील प्रदर्शन सुनिश्चित किया जा सके। इसका साफ एपीआई डायनामिक विज़ुअलाइज़ेशन की आवश्यकता वाले Flutter एप्लिकेशन में एकीकरण को सरल बनाता है।

उपयोग

  • नेटवर्क टॉपोलॉजी का दृश्यीकरण
  • निर्भरता ग्राफ दिखाएं
  • इंटरैक्टिव माइंड मैप बनाना
  • हायरार्किकल डेटा संरचनाओं को रेंडर करना
  • वास्तविक समय के डेटा प्रवाह दिखाएं

मुख्य विशेषताएँ

  • बल-निर्देशित व्यवस्था एल्गोरिदम
  • कस्टमाइज़ किए गए नोड और एज स्टाइल
  • इंटरैक्टिव ड्रैग-एंड-ड्रॉप समर्थन
  • चिकन एनीमेशन और संक्रमण
  • क्रॉस-प्लेटफॉर्म संगतता (Android, iOS, Web, macOS, Windows, Linux)

इनके लिए उपयुक्त

  • डेटा विज़ुअलाइज़ेशन ऐप्स
  • शैक्षिक उपकरण
  • नेटवर्क विश्लेषण सॉफ्टवेयर
  • जटिल डेटा संबंधों वाले UI
  • गतिशील ग्राफ़ रेंडरिंग की आवश्यकता वाले अनुप्रयोग

विचार योग्य बातें

  • बहुत बड़े ग्राफ के साथ प्रदर्शन में कमी आ सकती है
  • लेआउट पैरामीटर्स को सावधानीपूर्वक ट्यून करने की आवश्यकता है
  • मूल ड्रैगिंग के अतिरिक्त सीमित निर्मित इंटरैक्टिविटी
  • उन्नत इवेंट हैंडलिंग के लिए अतिरिक्त तर्क की आवश्यकता हो सकती है
  • वास्तविक समय के धारा डेटा अपडेट के लिए अनअनुकूलित

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Flutter Graph View

GitHub stars GitHub forks

Widgets for beautiful graphic data structures, such as force-oriented diagrams.

image image

image

https://github.com/graph-cn/flutter_graph_view/assets/15630211/a035cd7d-bdac-4ef6-8abf-74594e9d699b

Features

  • [x] Data converter: convert business data into graphic view data.

  • [x] Algorithm: calculate vertex layout.

    • [x] Force directed algorithm.
    • [x] Random algorithm (In example folder).
    • [x] Support algorithm decorator.
      • [x] Breathe decorator (optional).
      • [x] Provide decorators that follow Hooke's Law for related nodes
      • [x] Provide a decorator for Hooke's Law from the center outward for all nodes
      • [x] Provide mutually exclusive Coulomb's law decorators for subgraph root nodes
      • [x] Hooke's Law decorator that provides border buffering collisions for all nodes
      • [x] Add a counter decorator in the figure to convert node forces into motion
  • [x] Data panel embedding.

  • [x] Style configuration.

  • [ ] More graphical interactions.

Getting started

flutter pub add flutter_graph_view

Usage

// Copyright (c) 2023- All flutter_graph_view authors. All rights reserved.
//
// This source code is licensed under Apache 2.0 License.

import 'dart:math';

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

class DecoratorDemo extends StatelessWidget {
  const DecoratorDemo({super.key});

  @override
  Widget build(BuildContext context) {
    var vertexes = <Map>{};
    var r = Random();
    for (var i = 0; i < 150; i++) {
      vertexes.add(
        {
          'id': 'node$i',
          'tag': 'tag${r.nextInt(9)}',
          'tags': [
            'tag${r.nextInt(9)}',
            if (r.nextBool()) 'tag${r.nextInt(4)}',
            if (r.nextBool()) 'tag${r.nextInt(8)}'
          ],
        },
      );
    }
    var edges = <Map>{};

    for (var i = 0; i < 150; i++) {
      edges.add({
        'srcId': 'node${i % 8 + 8}',
        'dstId': 'node$i',
        'edgeName': 'edge${r.nextInt(3)}',
        'ranking': DateTime.now().millisecond,
      });
    }
    // for (var i = 0; i < 20; i++) {
    //   edges.add({
    //     'srcId': 'node${i % 8}',
    //     'dstId': 'node${r.nextInt(150)}',
    //     'edgeName': 'edge${r.nextInt(3)}',
    //     'ranking': DateTime.now().millisecond,
    //   });
    // }

    var data = {
      'vertexes': vertexes,
      'edges': edges,
    };
    return FlutterGraphWidget(
      data: data,
      algorithm: RandomAlgorithm(
        decorators: [
          CoulombDecorator(),
          // HookeBorderDecorator(),
          HookeDecorator(),
          CoulombCenterDecorator(),
          HookeCenterDecorator(),
          ForceDecorator(),
          ForceMotionDecorator(),
          TimeCounterDecorator(),
        ],
      ),
      convertor: MapConvertor(),
      options: Options()
        ..enableHit = false
        ..panelDelay = const Duration(milliseconds: 500)
        ..graphStyle = (GraphStyle()
          // tagColor is prior to tagColorByIndex. use vertex.tags to get color
          ..tagColor = {'tag8': Colors.orangeAccent.shade200}
          ..tagColorByIndex = [
            Colors.red.shade200,
            Colors.orange.shade200,
            Colors.yellow.shade200,
            Colors.green.shade200,
            Colors.blue.shade200,
            Colors.blueAccent.shade200,
            Colors.purple.shade200,
            Colors.pink.shade200,
            Colors.blueGrey.shade200,
            Colors.deepOrange.shade200,
          ])
        ..useLegend = true // default true
        ..edgePanelBuilder = edgePanelBuilder
        ..vertexPanelBuilder = vertexPanelBuilder
        ..edgeShape = EdgeLineShape() // default is EdgeLineShape.
        ..vertexShape = VertexCircleShape(), // default is VertexCircleShape.
    );
  }

  Widget edgePanelBuilder(Edge edge, Viewfinder viewfinder) {
    var c = viewfinder.localToGlobal(edge.position);

    return Stack(
      children: [
        Positioned(
          left: c.x + 5,
          top: c.y,
          child: SizedBox(
            width: 200,
            child: ColoredBox(
              color: Colors.grey.shade900.withAlpha(200),
              child: ListTile(
                title: Text(
                    '${edge.edgeName} @${edge.ranking}\nDelay controlled by \noptions.panelDelay\ndefault to 300ms'),
              ),
            ),
          ),
        )
      ],
    );
  }

  Widget vertexPanelBuilder(hoverVertex, Viewfinder viewfinder) {
    var c = viewfinder.localToGlobal(hoverVertex.cpn!.position);
    return Stack(
      children: [
        Positioned(
          left: c.x + hoverVertex.radius + 5,
          top: c.y - 20,
          child: SizedBox(
            width: 120,
            child: ColoredBox(
              color: Colors.grey.shade900.withAlpha(200),
              child: ListTile(
                title: Text(
                  'Id: ${hoverVertex.id}',
                ),
                subtitle: Text(
                    'Tag: ${hoverVertex.data['tag']}\nDegree: ${hoverVertex.degree} ${hoverVertex.prevVertex?.id}'),
              ),
            ),
          ),
        )
      ],
    );
  }
}

Licence

flutter_graph_view is under the Apache License, Version 2.0.

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।