GithubHelp home page GithubHelp logo

trendingtechnology / flutter_scatter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from letsar/flutter_scatter

0.0 2.0 0.0 1.16 MB

A widget that displays a collection of dispersed and non-overlapping children

License: MIT License

Java 1.03% Objective-C 2.09% Dart 96.88%

flutter_scatter's Introduction

flutter_scatter

A widget that displays a collection of dispersed and non-overlapping children.

Pub Donate

Can be used to create word clouds: Word Cloud

Features

  • Built-in delegates (Spirals, Align, Ellipse).
  • Allow you to specify how to align chlidren.

Getting started

In the pubspec.yaml of your flutter project, add the following dependency: The latest version is Pub

dependencies:
  ...
  flutter_scatter: ^latest_version

In your library add the following import:

import 'package:flutter_scatter/flutter_scatter.dart';

For help getting started with Flutter, view the online documentation.

Widgets

You can simply create a Scatter by providing a delegate and a list of widgets.

The delegate is responsible for computing positions. For example if you want to position your widgets on a circle, you will use the EllipseScatterDelegate:

return Center(
    child: Scatter(
    delegate: EllipseScatterDelegate(
        a: 185.0,
        b: 185.0,
        step: 1.0 / count,
    ),
    children: widgets,
    ),
);

Ellipse

It may be useful to choose how children are aligned with the computed positions. By default, the center of the widgets will be placed on the positions generated by the delegate. If you want to be left aligned, you will change the alignment argument of the Scatter to be Alignment.topLeft.

By default, the Scatter will not try to fill gaps (for performance reasons). You can override this behavior by setting the fillGaps argument to true.

For example this is what the above word cloud would look if the fillGaps argument would be set to false: fillGaps to false

Delegates

Scatter has built-in delegates which can be highly parameterized:

Spirals

  • ArchimedeanSpiralScatterDelegate
  • FermatSpiralScatterDelegate
  • LogarithmicSpiralScatterDelegate

Spirals

Alignments

  • AlignScatterDelegate

Alignments

Ellipses

  • EllipseScatterDelegate

Ellipses

Examples

You can find more examples in this app.

Changelog

Please see the Changelog page to know what's recently changed.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a new feature, please send a pull request.

flutter_scatter's People

Contributors

letsar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.