chartisan 1.4.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 44

Chartisan's Dart Backend. #

[1.4.0] - Now uses Map<String, String> instead of Map<String, Dynamic> #

  • The extra fields now use another type annotation. This may be backwards-incompatible if values of dynamic were not Strings as noted by our docs.

[1.3.0] - Internal changes. #

  • Internal changes

[1.2.0] - Now uses double instead of int #

  • The dataset values now require a List<double> instead of a List<int>

[1.1.0] - Added missing method #

  • Fixes to the dataset() method.
  • The constructor now require the ServerData instance.

[1.0.1] - Added missing method #

  • Added the toObject() missing method.

[1.0.0] - Initial version #

  • Initial release.

example/main.dart

import 'dart:io';
import 'package:chartisan/chartisan.dart';

Future main() async {
  var server = await HttpServer.bind(
    InternetAddress.loopbackIPv4,
    9000,
  );
  print('Listening on localhost:${server.port}');

  await for (HttpRequest request in server) {
    final chart = Chartisan.build().labels(['a', 'b', 'c']).dataset(
        'Sample 1', [1, 2, 3]).dataset('Sample 2', [3, 2, 1]).toJSON();
    request.response.headers
      ..add('Content-Type', 'application/json')
      ..add('Access-Control-Allow-Origin', '*');
    request.response.write(chart);
    await request.response.close();
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  chartisan: ^1.4.0

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:chartisan/chartisan.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health suggestions

Fix lib/data.dart. (-0.50 points)

Analysis of lib/data.dart reported 1 hint:

line 9 col 23: Don't explicitly initialize variables to null.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: Documenting chartisan... Initialized dartdoc with 39 libraries in 37.7 seconds Generating docs for library chartisan from package:chartisan/chartisan.dart... Generating docs for library chartisan from package:chartisan/data.dart... Validating docs... Documented 2 public libraries in 6.4 seconds stderr: warning: chartisan has no library level documentation comments, from chartisan: (file:///tmp/pub-dartlang-dartdocHMUVLQ/pkg/lib/chartisan.dart:1:9) warning: chartisan has no library level documentation comments, from chartisan: (file:///tmp/pub-dartlang-dartdocHMUVLQ/pkg/lib/data.dart:1:9) error: failed to write file at: chartisan/chartisan-library.html for symbol chartisan: (file:///tmp/pub-dartlang-dartdocHMUVLQ/pkg/lib/data.dart:1:9) conflicting with file already generated by chartisan: (file:///tmp/pub-dartlang-dartdocHMUVLQ/pkg/lib/chartisan.dart:1:9) Dartdoc generates a path and filename to write to for each symbol. chartisan conflicts with another symbol in the generated path, and therefore can not be written out. Changing the name, library name, or class name (if appropriate) of one of the conflicting items can resolve the conflict. Alternatively, use the @nodoc tag in one symbol's documentation comments to hide it. warning: dartdoc generated a broken link to: chartisan/Chartisan-class.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/Chartisan.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/advancedDataset.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/build.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/dataset.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/extra.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/labels.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/toJSON.html (from index.json) warning: dartdoc generated a broken link to: chartisan/Chartisan/toObject.html (from index.json) found 11 warnings and 1 error Unhandled exception: dartdoc encountered 1 errors while processing. #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:225:9)

The package description is too short. (-20 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