grizzly_primitives 0.1.0

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

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.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
0.0.5 Jan 26, 2018 Go to the documentation of grizzly_primitives 0.0.5 Download grizzly_primitives 0.0.5 archive
0.0.4 Jan 26, 2018 Go to the documentation of grizzly_primitives 0.0.4 Download grizzly_primitives 0.0.4 archive
0.0.3 Jan 26, 2018 Go to the documentation of grizzly_primitives 0.0.3 Download grizzly_primitives 0.0.3 archive
0.0.2 Oct 29, 2017 Go to the documentation of grizzly_primitives 0.0.2 Download grizzly_primitives 0.0.2 archive
0.0.1 Oct 29, 2017 Go to the documentation of grizzly_primitives 0.0.1 Download grizzly_primitives 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 9, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

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

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.

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