plot_window 0.1.0 copy "plot_window: ^0.1.0" to clipboard
plot_window: ^0.1.0 copied to clipboard

A library to use a canvas element to plot data

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();
    */
}
0
likes
25
pub points
0%
popularity

Publisher

unverified uploader

A library to use a canvas element to plot data

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

dialog, intl

More

Packages that depend on plot_window