boxplot 1.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 49

Dart CI

A Boxplot library for Dart developers.

Created by Matletik - Mathematical Manipulatives and Interactive Learning Tools

http://www.matletik.com

Developer Web Site

Source Code

Screenshot

Usage #

A simple usage example:

import 'dart:html';
import 'package:boxplot/box_plot.dart';

void main() {
  DivElement mydiv = querySelector("#mydiv");
  BoxPlot boxplot = new BoxPlot(500, 200);
  boxplot.setQuantiles(0, 30, 60, 86, 100);
  mydiv.append(boxplot.getDrawableComponent());


  RangeInputElement myrange = querySelector("#myrange");
  myrange.onInput.listen((event) {
    boxplot.setValue(double.parse(myrange.value));
    boxplot.drawComponent();
  });
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Matletik Boxplot for Dart - Example</title>
    <script src = "boxplot_example.dart.js"></script>

    <style>
        div{
            background-color: rgba(255, 255, 255, 0.35);
            font-size: 16px;
            margin: 0 auto;
            valign: middle;
            text-align: center;
        }
        input[type=range]{
            width: 100%;
        }
    </style>
</head>
<body>
<fieldset>
    <caption>Value on the boxplot</caption>
    <input type="range" min="0" max="100" value="65" id="myrange"/>
</fieldset>
<br/>
<div id="mydiv"></div>
</body>
</html>

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.5 #

  • Quantiles can be set manually as well as automatically. A basic algorithm is used to estimate 25th and 75th quantiles.
  • Axes limits and labels are now changing automatically.

1.0.3 #

  • Package description in more detail.

1.0.2 #

  • Code refactoring and Dart docs.

1.0.1 #

  • Code refactoring and Dart docs.

1.0.0 #

  • Initial version, created by Matletik

example/boxplot_example.dart

import 'dart:html';
import 'package:boxplot/boxplot.dart';

void main() {
  DivElement mydiv = querySelector("#mydiv");
  /*
  Creating a boxplot with the dimension 500 x 200 in pixels
   */
  BoxPlot boxplot = new BoxPlot(500, 200);

  /*
  Quantiles can be set manually
   */
  boxplot.setQuantiles(
      /* min */
      50,
      /* 25th percentile */ 60,
      /* median */ 70,
      /* 75th percentile */ 80,
      /* max */ 200);

  /*
  Appending drawable component into a div element
   */
  mydiv.append(boxplot.getDrawableComponent());

  /*
  or, quantiles can be estimated using a dataset:
   */
  //boxplot.setQuantilesUsingData(aListOfDoubleValues);

  RangeInputElement myrange = querySelector("#myrange");
  myrange.onInput.listen((event) {
    boxplot.setValue(double.parse(myrange.value));
    boxplot.drawComponent();
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  boxplot: ^1.0.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:boxplot/boxplot.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
5
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14

Analysis suggestions

Package not compatible with runtime flutter-native on android

Because:

  • package:boxplot/boxplot.dart that imports:
  • package:boxplot/src/gui_component.dart that imports:
  • dart:html

Package not compatible with runtime flutter-native on ios

Because:

  • package:boxplot/boxplot.dart that imports:
  • package:boxplot/src/gui_component.dart that imports:
  • dart:html

Package not compatible with runtime flutter-native on linux

Because:

  • package:boxplot/boxplot.dart that imports:
  • package:boxplot/src/gui_component.dart that imports:
  • dart:html

Package not compatible with runtime flutter-native on macos

Because:

  • package:boxplot/boxplot.dart that imports:
  • package:boxplot/src/gui_component.dart that imports:
  • dart:html

Package not compatible with runtime flutter-native on windows

Because:

  • package:boxplot/boxplot.dart that imports:
  • package:boxplot/src/gui_component.dart that imports:
  • dart:html

Package not compatible with runtime native

Because:

  • package:boxplot/boxplot.dart that imports:
  • package:boxplot/src/gui_component.dart that imports:
  • dart:html

Package not compatible with runtime native-aot

Because:

  • package:boxplot/boxplot.dart that imports:
  • package:boxplot/src/gui_component.dart that imports:
  • dart:html

Health suggestions

Fix lib/src/box_plot.dart. (-0.50 points)

Analysis of lib/src/box_plot.dart reported 1 hint:

line 22 col 23: Use lowercase_with_underscores when specifying a library prefix.

Fix lib/src/stats.dart. (-0.50 points)

Analysis of lib/src/stats.dart reported 1 hint:

line 44 col 20: The operator x ~/ y is more efficient than (x / y).toInt().

Format lib/src/gui_component.dart.

Run dartfmt to format lib/src/gui_component.dart.

Maintenance suggestions

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
build_runner any
build_web_compilers any
pedantic ^1.8.0
test ^1.6.0