grizzly_range 3.0.4 icon indicating copy to clipboard operation
grizzly_range: ^3.0.4 copied to clipboard

Lazy and efficient 'range' iterables to generate values based on start, stop and step/count.

Range #

Lazy and efficient 'range' iterables to generate values based on start, stop and step/count.

for (final i in 0.to(5)) {
  print(i);
}

Ranges can also be descending:

for (final i in 5.to(-5)) {
  print(i);
}

Linspace #

IntRange.linspace returns an Iterable<int> with range [start, stop] with [count] elements in it.

print(1.linspace(10, 5));

Time ranges #

print(TimeRange(
      DateTime(2019, 1, 1), DateTime(2019, 1, 20), Duration(days: 1)));

Month range #

print(MonthRange(DateTime(2020, 2, 29), DateTime(2032, 2, 30), 6));

ticks #

print(ticks(-100, 1000000, 10));
// => [-100000, 0, 100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000]

Extent #

Extent of list #

print(List.generate(11, (i) => i * 10).findExtent()); // => Extent(0, 100)

Ranging an Extent #

print(Extent(5, 50).range(5));

Generate random numbers #

print(Extent(5, 50).rands(100));

Extents #

Bin #

  final extents = List.generate(11, (i) => i * 10).edgesToExtents();
  final data = extents.rands(20)!;
  print(extents.computeBins(data));

Counts #

  final extents = List.generate(11, (i) => i * 10).edgesToExtents();
  final data = extents.rands(20)!;
  print(extents.computeCounts(data));

Histogram #

  final extents = List.generate(11, (i) => i * 10).edgesToExtents();
  final data = extents.rands(20)!;
  print(extents.computeHistogram(data));
0
likes
120
pub points
0%
popularity

Publisher

unverified uploader

Lazy and efficient 'range' iterables to generate values based on start, stop and step/count.

Homepage

Documentation

API reference

License

Icon for licenses.unknown (LICENSE)

Dependencies

collection, meta, quiver, text_table

More

Packages that depend on grizzly_range