grizzly_primitives 0.2.5

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

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
}

1. Depend on it

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


dependencies:
  grizzly_primitives: "^0.2.5"

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 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.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
0.2.2 Mar 26, 2018 Go to the documentation of grizzly_primitives 0.2.2 Download grizzly_primitives 0.2.2 archive
0.2.1 Mar 25, 2018 Go to the documentation of grizzly_primitives 0.2.1 Download grizzly_primitives 0.2.1 archive
0.1.1 Mar 19, 2018 Go to the documentation of grizzly_primitives 0.1.1 Download grizzly_primitives 0.1.1 archive
0.1.0 Feb 9, 2018 Go to the documentation of grizzly_primitives 0.1.0 Download grizzly_primitives 0.1.0 archive
0.0.9 Jan 31, 2018 Go to the documentation of grizzly_primitives 0.0.9 Download grizzly_primitives 0.0.9 archive
0.0.8 Jan 31, 2018 Go to the documentation of grizzly_primitives 0.0.8 Download grizzly_primitives 0.0.8 archive
0.0.7 Jan 28, 2018 Go to the documentation of grizzly_primitives 0.0.7 Download grizzly_primitives 0.0.7 archive

All 15 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]
50 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
75
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.

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

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 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'.

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

    line: 20 col: 17
    Always override hashCode if overriding ==.

    Similar analysis of the following files failed:

    • lib/src/core/index.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
meta ^1.1.2 1.1.2
Dev dependencies
test ^0.12.0