function_tree 0.1.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 48

function_tree

A library for parsing and evaluating mathematical functions built from strings.

Usage

A simple usage example:

import 'package:function_tree/function_tree.dart';
import 'dart:math' show PI;

main() {
  var f = new FunctionOfX("1.5 * sin(2 * (x - PI / 3)) + 2");
  print(f(PI));

  var ft = new FunctionTree(
    fromExpression: "1.5 * sin(2 * (x - PI / 3)^2) + y",
    withVariableNames: ["x", "y"]);

  print(ft({"x": 1, "y": 2}));
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.1.0

  • Initial version, proof of concept.
  • Very little checking of input at this stage.

0.1.1

  • Basic numerical differentiation
  • Basic numerical integration (Simpson)
  • Basic zero-finding (Newton)

1. Depend on it

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


dependencies:
  function_tree: "^0.1.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:function_tree/function_tree.dart';
        
Version Uploaded Documentation Archive
0.1.1 Oct 2, 2017 Go to the documentation of function_tree 0.1.1 Download function_tree 0.1.1 archive
0.1.0 Sep 24, 2017 Go to the documentation of function_tree 0.1.0 Download function_tree 0.1.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
93 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
48
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 26 hints.

    Strong-mode analysis of lib/function_tree.dart gave the following hint:

    line: 99 col: 21
    'NAN' is deprecated and shouldn't be used.

    Strong-mode analysis of lib/src/defs.dart gave the following hint:

    line: 25 col: 27
    'E' is deprecated and shouldn't be used.

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

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use function_tree.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
Dev dependencies
test ^0.12.0