grizzly_primitives 0.4.6

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

grizzly_primitives

Primitives (Index, Pair, Extent) for Grizzly

Usage

Pair

  final p1 = pair<int, String>(1, 'one');
  print(p1.key);  // => 1
  print(p1.value);  // => one

IntPair

  final p1 = intPair<String>(1, 'one');
  print(p1.key);  // => 1
  print(p1.value);  // => one

Index1D

  final i1 = idx1D(5);
  print(i1.dim); // => 1
  print(i1.x); // => 5
  print(i1[0]); // => 5
  print(i1.toList()); // => [5]
  
  print(i1 == [5]); // => true
  print(i1 == [2]); // => false
  
  print(i1 > idx1D(2)); // => true
  print(i1 > idx1D(10)); // => false
  print(i1 >= idx1D(2)); // => true
  print(i1 >= idx1D(10)); // => false
  print(i1 >= idx1D(5)); // => true
  
  print(i1 < idx1D(2)); // => false
  print(i1 < idx1D(10)); // => true
  print(i1 <= idx1D(2)); // => false
  print(i1 <= idx1D(10)); // => true
  print(i1 <= idx1D(5)); // => true

Index2D

  final i2 = idx2D(5, 25);
  print(i2.dim); // => 2
  print(i2.row); // => 5
  print(i2.col); // => 25
  print(i2[0]); // => 5
  print(i2[1]); // => 25
  print(i2.toList()); // => [5, 25]
  
  print(i2 == [5, 25]); // => true
  print(i2 == [5, 24]); // => false

  print(i2 > idx2D(0, 0)); // => true
  print(i2 > idx2D(10, 20)); // => false
  print(i2 >= idx2D(5, 5)); // => true
  print(i2 >= idx2D(4, 30)); // => false
  print(i2 >= idx2D(5, 25)); // => true

  print(i2 < idx2D(4, 30)); // => false
  print(i2 < idx2D(10, 30)); // => true
  print(i2 <= idx2D(10, 20)); // => false
  print(i2 <= idx2D(10, 30)); // => true
  print(i2 <= idx2D(5, 25)); // => true

Changelog

0.2.5

  • Moved Ranger from grizzly_scales

0.2.3

  • Has breaking changes
  • Better arithmetic operator methods for Array2D

0.2.4

  • Several improvements to Array and Array2D

0.2.1

  • New API

0.1.0

  • New API

0.0.9

  • Removed uniqueSqueeze
  • Added sort to Array and Array2D

0.0.8

  • Added unique and uniqueSqueeze to Array and Array2D

0.0.7

  • Array and Array2D do not inherit from Iterable

0.0.5

  • Removed valueCounts from Array and Array2D

0.0.4

  • Array
  • Numeric1D
  • Array2D
  • Numeric2D

0.0.3

  • Series
  • DataFrameBase

0.0.2

  • Extent gets custom == operator

0.0.1

  • Pair
  • IntPair
  • Extent
  • Index1D
  • Index2D

example/grizzly_primitives_example.dart

import 'package:grizzly_primitives/grizzly_primitives.dart';

main() {
  final p1 = intPair<String>(1, 'one');
  print(p1.key); // => 1
  print(p1.value); // => one

  final Index1D i1 = idx1D(5);
  print(i1.dim); // => 1
  print(i1.x); // => 5
  print(i1[0]); // => 5
  print(i1.toList()); // => [5]

  print(i1 == [5]); // => true
  print(i1 == [2]); // => false

  print(i1 > idx1D(2)); // => true
  print(i1 > idx1D(10)); // => false
  print(i1 >= idx1D(2)); // => true
  print(i1 >= idx1D(10)); // => false
  print(i1 >= idx1D(5)); // => true

  print(i1 < idx1D(2)); // => false
  print(i1 < idx1D(10)); // => true
  print(i1 <= idx1D(2)); // => false
  print(i1 <= idx1D(10)); // => true
  print(i1 <= idx1D(5)); // => true

  final i2 = idx2D(5, 25);
  print(i2.dim); // => 2
  print(i2.row); // => 5
  print(i2.col); // => 25
  print(i2[0]); // => 5
  print(i2[1]); // => 25
  print(i2.toList()); // => [5, 25]

  print(i2 == [5, 25]); // => true
  print(i2 == [5, 24]); // => false

  print(i2 > idx2D(0, 0)); // => true
  print(i2 > idx2D(10, 20)); // => false
  print(i2 >= idx2D(5, 5)); // => true
  print(i2 >= idx2D(4, 30)); // => false
  print(i2 >= idx2D(5, 25)); // => true

  print(i2 < idx2D(4, 30)); // => false
  print(i2 < idx2D(10, 30)); // => true
  print(i2 <= idx2D(10, 20)); // => false
  print(i2 <= idx2D(10, 30)); // => true
  print(i2 <= idx2D(5, 25)); // => true
}

Use this package as a library

1. Depend on it

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


dependencies:
  grizzly_primitives: ^0.4.6

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:grizzly_primitives/grizzly_primitives.dart';
  
Version Uploaded Documentation Archive
0.4.6 Jun 3, 2018 Go to the documentation of grizzly_primitives 0.4.6 Download grizzly_primitives 0.4.6 archive
0.4.5 Jun 3, 2018 Go to the documentation of grizzly_primitives 0.4.5 Download grizzly_primitives 0.4.5 archive
0.4.4 Jun 3, 2018 Go to the documentation of grizzly_primitives 0.4.4 Download grizzly_primitives 0.4.4 archive
0.4.3 May 29, 2018 Go to the documentation of grizzly_primitives 0.4.3 Download grizzly_primitives 0.4.3 archive
0.4.2 May 29, 2018 Go to the documentation of grizzly_primitives 0.4.2 Download grizzly_primitives 0.4.2 archive
0.4.1 May 29, 2018 Go to the documentation of grizzly_primitives 0.4.1 Download grizzly_primitives 0.4.1 archive
0.3.1 May 28, 2018 Go to the documentation of grizzly_primitives 0.3.1 Download grizzly_primitives 0.3.1 archive
0.2.5 Apr 15, 2018 Go to the documentation of grizzly_primitives 0.2.5 Download grizzly_primitives 0.2.5 archive
0.2.4 Mar 30, 2018 Go to the documentation of grizzly_primitives 0.2.4 Download grizzly_primitives 0.2.4 archive
0.2.3 Mar 27, 2018 Go to the documentation of grizzly_primitives 0.2.3 Download grizzly_primitives 0.2.3 archive

All 22 versions...

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

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0