flutter_plot 0.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 52

flutter_plot

R. C. Howell - 2018

A pretty plotting package for Flutter apps. Sizing and autopadding isn't great right now, but tinkering with padding and fontSize will allow for you to align things well. You can also check out /docs to learn more, but it really is a single file package.

Example 1

Screenshot

This example is more complicated than typical because it's showing off the styling capability.

final List<Point> data = [
  const Point(21.0, 19.0),
  const Point(3.0, 7.0),
  const Point(8.0, 9.0),
  const Point(11.0, 14.0),
  const Point(18.0, 17.0),
  const Point(7.0, 8.0),
  const Point(-4.0, -4.0),
  const Point(6.0, 12.0),
];

new Card(
  child: new Column(
    children: <Widget>[
      new Container(
        padding: const EdgeInsets.only(top: 12.0),
        child: new Text('Super Neat Plot'),
      ),
      new Container(
        child: new Plot(
          height: 200.0,
          data: widget.data,
          gridSize: new Offset(2.0, 2.0),
          style: new PlotStyle(
            pointRadius: 3.0,
            outlineRadius: 1.0,
            primary: Colors.white,
            secondary: Colors.orange,
            textStyle: new TextStyle(
              fontSize: 8.0,
              color: Colors.blueGrey,
            ),
            axis: Colors.blueGrey[600],
            gridline: Colors.blueGrey[100],
          ),
          padding: const EdgeInsets.fromLTRB(40.0, 12.0, 12.0, 40.0),
          xTitle: 'My X Title',
          yTitle: 'My Y Title',
          ),
      ),
    ],
  ),
),

Example 2

Screenshot 2

// Using the same data as before

Plot simplePlot = new Plot(
  height: 200.0,
  data: widget.data,
  gridSize: new Offset(2.0, 2.0),
  style: new PlotStyle(
    primary: Colors.black,
    textStyle: new TextStyle(
      fontSize: 8.0,
      color: Colors.blueGrey,
    ),
    axis: Colors.blueGrey[600],
  ),
  padding: const EdgeInsets.fromLTRB(40.0, 12.0, 12.0, 40.0),
);

Displaying trace lines and coordinates

Screenshot 4 Screenshot 5 Screenshot 6

final List<Point> data = [
  const Point(9, 1),
  const Point(-7.0, 19.0),
  const Point(13.0, 5.0),
  const Point(-10.0, -4.0),
  const Point(16.0, 12.0),
];

new Card(
  child: new Column(
    children: <Widget>[
      new Container(
        padding: const EdgeInsets.only(top: 12.0),
        child: new Text('Super Neat Plot'),
      ),
      new Container(
        child: new Plot(
          height: 200.0,
          data: widget.data,
          gridSize: new Offset(2.0, 2.0),
          style: new PlotStyle(
            axisStrokeWidth: 2.0,
            pointRadius: 3.0,
            outlineRadius: 1.0,
            primary: Colors.yellow,
            secondary: Colors.red,
            trace: true,
            traceStokeWidth: 3.0,
            traceColor: Colors.blueGrey,
            traceClose: true,
            showCoordinates: true,
            textStyle: new TextStyle(
              fontSize: 8.0,
              color: Colors.grey,
            ),
            axis: Colors.blueGrey[600],
            gridline: Colors.blueGrey[100],
          ),
            axis: Colors.blueGrey[600],
            gridline: Colors.blueGrey[100],
          ),
          padding: const EdgeInsets.fromLTRB(40.0, 12.0, 12.0, 40.0),
          xTitle: 'My X Title',
          yTitle: 'My Y Title',
          ),
      ),
    ],
  ),
),

How to Use

  1. Add as a dependency
  2. import 'package:flutter_plot/flutter_plot.dart';
  3. See examples! There's not much to this package yet!

[0.0.1] - 3/22/2018

See project README.md. This is the initial release of a small plotting library for Flutter.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_plot: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support 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:flutter_plot/flutter_plot.dart';
  
Version Uploaded Documentation Archive
0.0.2 Sep 6, 2018 Go to the documentation of flutter_plot 0.0.2 Download flutter_plot 0.0.2 archive
0.0.1 Mar 22, 2018 Go to the documentation of flutter_plot 0.0.1 Download flutter_plot 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
39
Health:
Code health derived from static analysis. [more]
68
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
52
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Fix lib/flutter_plot.dart. (-32.31 points)

Analysis of lib/flutter_plot.dart failed with 1 error, 2 warnings:

line 176 col 22: Undefined name 'PI'.

line 244 col 26: Element 'TextStyle' from SDK library 'ui.dart' is implicitly hidden by 'text_style.dart'.

line 347 col 8: Element 'TextStyle' from SDK library 'ui.dart' is implicitly hidden by 'text_style.dart'.

Maintenance suggestions

The description is too short. (-20 points)

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

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use flutter_plot.dart.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
meta ^1.1.2 1.1.6
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
test ^0.12.0