plot_window 0.0.53

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 19

plot_window

A very simple, very buggy library to plot graphs on a canvas. I'll gradually add to it, so you probably shouldn't use this in any projects yet.

Usage

A simple usage example:

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

main() {
  var plotWindow = new PlotWindow(querySelector('#mycanvas');
  var line1 = new plot_window.Line([new Point(1,2), new Point(2,5), new Point(3,-3)], color:new plot_window.Color(255,0,0));

  var line2 = new plot_window.Line([new Point(-3,5), new Point(-2,4), new Point(-1,-2)], color:new plot_window.Color(0,0,255));

  plotWindow..addLine("line1", line1)
     ..addLine("line2", line2);

  plotWindow.plot();
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.1

  • Initial version, created by Stagehand

0.0.2

  • Added x zoom with shift + mousewheel, y zoom with alt + mousewheel

0.0.3

  • Added mouse drag

0.0.4

  • Added legend

0.0.5

  • moved color to new file

0.0.7

  • added method removeLines()

0.0.8

  • bugfix

0.0.9

  • added fontSize and fontFace to PlotWindow

example/plot_window.dart

// Copyright (c) 2015, <your name>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

//import 'package:plot_window/plot_window.dart' as pl;
import '../lib/plot_window.dart' as pl;
import 'dart:html';
import 'dart:math' as math;


main() {
  pl.Init();
  
  var plotWindow = new pl.LinePlotWindow(querySelector('#mycanvas'));
  var line1 = new pl.Line("line1", new pl.PointList([new Point(1,2), new Point(2,5), new Point(3,-3), new Point(4, 2)])); //, color:new pl.Color(255,0,0));

  var line2 = new pl.Line("line2", new pl.PointList([new Point(-3,3), new Point(-2,2), new Point(-1,3), new Point(0,2), new Point(1,1)])); //, color:new pl.Color(0,0,255));
  line2.showLinearRegression= true;
  plotWindow..addLine(line1)
    ..addLine(line2);
  
    plotWindow.plot(); 
    /*
  var rand = new math.Random();
  var data = new List<List<num>>();
  for (int i=0; i<20; i++) {
    data.add(new List<num>());
    for (int j=0; j<100; j++) {
      data[i].add(j+i + rand.nextInt(20));
    }
  }

  var plotWindow = new pl.HeatmapPlotWindow(querySelector('#mycanvas'));
        var heatmap = new pl.Heatmap("my heatmap", 20, 20, data);
  plotWindow.heatmap = heatmap;
  plotWindow.plot();
    */
}

1. Depend on it

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


dependencies:
  plot_window: "^0.0.53"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:plot_window/plot_window.dart';
        
Version Uploaded Documentation Archive
0.0.53 Aug 3, 2016 Go to the documentation of plot_window 0.0.53 Download plot_window 0.0.53 archive
0.0.52 Aug 3, 2016 Go to the documentation of plot_window 0.0.52 Download plot_window 0.0.52 archive
0.0.51 Aug 3, 2016 Go to the documentation of plot_window 0.0.51 Download plot_window 0.0.51 archive
0.0.50 Aug 1, 2016 Go to the documentation of plot_window 0.0.50 Download plot_window 0.0.50 archive
0.0.49 Jul 6, 2016 Go to the documentation of plot_window 0.0.49 Download plot_window 0.0.49 archive
0.0.48 Jun 27, 2016 Go to the documentation of plot_window 0.0.48 Download plot_window 0.0.48 archive
0.0.47 Jun 27, 2016 Go to the documentation of plot_window 0.0.47 Download plot_window 0.0.47 archive
0.0.46 Jun 6, 2016 Go to the documentation of plot_window 0.0.46 Download plot_window 0.0.46 archive
0.0.45 Jun 6, 2016 Go to the documentation of plot_window 0.0.45 Download plot_window 0.0.45 archive
0.0.44 Jun 6, 2016 Go to the documentation of plot_window 0.0.44 Download plot_window 0.0.44 archive

All 53 versions...

Analysis

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

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
54 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
12 / 100
Overall score:
Weighted score of the above. [more]
19
Learn more about scoring.

Platforms

Detected platforms: web

Primary library: package:plot_window/plot_window.dart with components: html.

Suggestions

  • Use constrained dependencies.

    The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: intl.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 27 errors 27 hints.

    Strong-mode analysis of lib/heatmap.dart failed with the following error:

    line: 18 col: 57
    The argument type '(String) → Null' can't be assigned to the parameter type '(dynamic) → void'.

    Strong-mode analysis of lib/heatmap_plot_window.dart failed with the following error:

    line: 85 col: 3
    Invalid override. The type of 'HeatmapPlotWindow.getLegendEntries' ('() → Iterable<LegendEntry>') isn't a subtype of 'PlotWindow.getLegendEntries' ('() → List<LegendEntry>').

    Similar analysis of the following files failed:

    • lib/line.dart (error)
    • lib/line_plot_window.dart (error)
    • lib/plot_action.dart (error)
    • lib/plot_window.dart (error)
    • lib/point_smoother.dart (error)
    • lib/range.dart (error)
    • lib/text.dart (error)
    • lib/text_performable.dart (error)
    • lib/text_settable.dart (error)
    • lib/axis.dart (hint)
    • lib/color.dart (hint)
    • lib/legend_position.dart (hint)
    • lib/linear_regression.dart (hint)
    • lib/point_list.dart (hint)
    • lib/settings.dart (hint)
  • The description is too short.

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

  • Package is pre-v1 release.

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
browser ^0.10.0+2 0.10.0+3
dialog ^0.5.0 0.5.0
intl 0.15.6
Transitive dependencies
path 1.5.1
Dev dependencies
test >=0.12.0 <0.13.0