c3 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 76

A generated Dart API for C3.js using pkg/js and dart_js_facade_gen.

Example #

import "dart:html";
import "package:c3/c3.dart" as c3;

main() async {
  await c3.load();

  final container = document.querySelector("#chart");

  final data = new c3.Data()
    ..columns = [
      ['data1', 30, 200, 100, 400, 150, 250],
      ['data2', 50, 20, 10, 40, 15, 25]
    ];

  final configuration = new c3.ChartConfiguration()
    ..bindto = container
    ..data = data;

  final chart = c3.generate(configuration);
}

Changelog #

0.1.0 #

  • use last c3 js

0.0.2 #

  • dart 2 stable
  • some missing api
  • fix dart2js

0.0.1 #

  • Initial version, created by Stagehand

example/example.dart

import 'dart:html';
import "package:c3/c3.dart" as c3;

import "package:js/js_util.dart";

main() async {
  final container = document.querySelector("#chart");

  final data = new c3.Data()
    ..columns = [
      ['data1', 30, 200, 100, 400, 150, 250],
      ['data2', 50, 20, 10, 40, 15, 25]
    ]
    ..types = jsify({"data2": 'bar'})
    ..axes = jsify({"data2": 'y2'});

  final configuration = new c3.ChartConfiguration()
    ..bindto = container
    ..data = data
    ..axis = (new c3.Axis()
      ..y = (new c3.YAxisConfiguration()
        ..label = jsify({"text": 'Y Label', "position": 'outer-middle'}))
      ..y2 = (new c3.YAxisConfiguration()
        ..show = true
        ..label = jsify({"text": 'Y2 Label', "position": 'outer-middle'})));

  final chart = c3.generate(configuration);

  chart.load(new c3.Data()
    ..columns = [
      ['data1', 300, 100, 250, 150, 300, 150, 500],
      ['data2', 100, 200, 150, 50, 100, 250]
    ]);
}

Use this package as a library

1. Depend on it

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


dependencies:
  c3: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:c3/c3.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
92
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Oct 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: web

Primary library: package:c3/c3.dart with components: html, js.

Maintenance suggestions

The package description is too short. (-8 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 >=1.20.1 <3.0.0
dart_browser_loader ^0.0.3 0.0.5+1
js ^0.6.1 0.6.1+1
Dev dependencies
build_runner >=0.8.10 <2.0.0
build_web_compilers >=0.3.6 <0.5.0
test ^1.3.0