grizzly_primitives 0.4.6

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

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

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or 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: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...

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

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

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:grizzly_primitives/grizzly_primitives.dart.

Suggestions

  • 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.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 15 hints.

    Strong-mode analysis of lib/src/array2d/array2d.dart gave the following hint:

    line: 4 col: 8
    Unused import: 'package:grizzly_primitives/src/series/series.dart'.

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

    Similar analysis of the following files failed:

    • lib/src/core/extent.dart (hint)
    • lib/src/core/index.dart (hint)
    • lib/src/ranger/ranger.dart (hint)
  • 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.20.1 <2.0.0
meta ^1.1.2 1.1.5
Dev dependencies
test ^0.12.0