grizzly_scales 2.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

vizzie #

Provides scales and interpolators for grizzly_viz

TODO #

  • [ ] Color scale

Scales #

  • [ ] Log scale
  • [ ] Color
  • [ ] nice

Interpolators #

  • [ ] Color

General #

  • [ ] Ticks

Examples #

  • Visualize

Changelog #

2.0.2 #

  • BandScale implementation

2.0.1 #

  • Simplified rewrite of all scales

0.0.6 #

  • Moved Ranger to grizzly_primitives

0.0.5 #

  • Dart2 fixes

0.0.3 #

  • Ranger.range supports double

0.0.2 #

  • Ticks
  • TimeScale
  • TimeRange

0.0.1 #

  • Initial version, created by Stagehand

example/example.dart

// Copyright (c) 2017, teja. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:grizzly_scales/grizzly_scales.dart';
import 'package:grizzly_range/grizzly_range.dart';

main() {
  // print(binaryRangeSearch([10, 20, 30, 40, 50, 60], 90));
  // print(LinearScale([0, 1000], [0, 100]).ticks(count: 50));

  final x =
      range(DateTime(2019, 11, 1), DateTime(2019, 11, 30), Duration(days: 1));
  print(x.toList());
  final xScale = TimeScale(Extent.compute(x).asList(), [0, 400]);
  print(xScale.ticks());
}

Use this package as a library

1. Depend on it

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


dependencies:
  grizzly_scales: ^2.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter 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_scales/grizzly_scales.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
8
Health:
Code health derived from static analysis. [more]
89
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
89
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4

Health issues and suggestions

Fix lib/src/scale/ordinal/band.dart. (-8.28 points)

Analysis of lib/src/scale/ordinal/band.dart reported 1 warning, 7 hints, including:

line 72 col 23: Parameters can't override default values, this method overrides 'Scale.ticks' where 'count' has a different value.

line 22 col 37: Use = to separate a named parameter from its default value.

line 22 col 52: Use = to separate a named parameter from its default value.

line 22 col 74: Use = to separate a named parameter from its default value.

line 27 col 7: DO use curly braces for all flow control structures.

Fix lib/src/scale/continuous.dart. (-1.49 points)

Analysis of lib/src/scale/continuous.dart reported 3 hints:

line 20 col 7: DO use curly braces for all flow control structures.

line 23 col 7: DO use curly braces for all flow control structures.

line 32 col 7: DO use curly braces for all flow control structures.

Fix lib/src/scale/log.dart. (-1 points)

Analysis of lib/src/scale/log.dart reported 2 hints:

line 17 col 17: Use = to separate a named parameter from its default value.

line 17 col 41: Use = to separate a named parameter from its default value.

Maintenance suggestions

The package description is too short. (-11 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
grizzly_range ^2.0.6 2.0.6
Transitive dependencies
collection 1.14.12
meta 1.1.8
quiver_hashcode 2.0.0
Dev dependencies
test any