rainbow_vis 0.0.1

  • README.md
  • Installing
  • Versions
  • 33

rainbowvis-dart

Pub Travis

Color data visualization; easily map numbers to a smooth-transitioning color legend. This is a port of the RainbowVis-JS written by anomal.

Usage

Instantiate a Rainbow, e.g.

  Rainbow rb0 = new Rainbow(); //[0,100],red-yellow-green-blue
  Rainbow rb1 = new Rainbow(minNum:-10, maxNum: 10); 
  Rainbow rb2 = new Rainbow.fromArray(['red', 'FFFFFF', '#00ff00']);
  Rainbow rb3 = new Rainbow.fromArray(['red', 'blue'], minNum: -0.5, maxNum: 0.5);

To interpolate a color among the spectrum, use the list access operator, e.g.

  Rainbow rb0 = new Rainbow(minNum:-10, maxNum: 10); 
  var myColdColor = rb0[-9.32];
  var myWarmCOlor = rb0[8.44];

Testing

To run on vm (default): pub run test As usual, tests can be run on other platforms with -p<platform>

1. Depend on it

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


dependencies:
  rainbow_vis: "^0.0.1"

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:rainbow_vis/rainbow_vis.dart';
        
Version Uploaded Documentation Archive
0.0.1 Sep 3, 2016 Go to the documentation of rainbow_vis 0.0.1 Download rainbow_vis 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.

  • tool failures on Feb 3, 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]
0 / 100
Health:
Code health derived from static analysis. [more]
79 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
44 / 100
Overall score:
Weighted score of the above. [more]
33

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • Fix lib/rainbow_vis.dart.

    Strong-mode analysis of lib/rainbow_vis.dart failed with the following error:

    line: 62 col: 24
    Couldn't infer type parameter 'T'.\n\nTried to infer 'dynamic' for 'T' which doesn't work:\n Type parameter 'T' declared to extend 'num'.\nThe type 'dynamic' was inferred from:\n Parameter 'a' declared as 'T'\n but argument is 'int'.\n Parameter 'b' declared as 'T'\n but argument is 'dynamic'.\n\nConsider passing explicit type argument(s) to the generic.\n\n

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

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

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use rainbow_vis.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 <2.0.0
Dev dependencies
test ^0.12.5+1