Skip to content

Commit 84bc54d

Browse files
committed
Update tests to work with new interpose function
1 parent 7a45fd9 commit 84bc54d

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Calculate statistical regressions from two-dimensional data. [![Build Status](ht
77
If you use NPM, `npm install d3-regression`. Otherwise, download the [latest release](https://github.com/HarryStevens/d3-regression/raw/master/dist/d3-regression.zip). AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3 global is exported:
88

99
```html
10-
<script src="https://unpkg.com/d3-regression@1.3.0/dist/d3-regression.min.js"></script>
10+
<script src="https://unpkg.com/d3-regression@1.3.1/dist/d3-regression.min.js"></script>
1111
<script>
1212
1313
const regression = d3.regressionLinear()

dist/d3-regression.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// https://github.com/HarryStevens/d3-regression#readme Version 1.2.8. Copyright 2019 Harry Stevens.
1+
// https://github.com/HarryStevens/d3-regression#readme Version 1.3.0. Copyright 2019 Harry Stevens.
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
44
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -126,7 +126,8 @@
126126
// returns a smooth line.
127127

128128
function interpose(xmin, xmax, predict) {
129-
var precision = .01,
129+
var l = Math.log(xmax - xmin) * Math.LOG10E + 1 | 0;
130+
var precision = 1 * Math.pow(10, -l / 2 - 1),
130131
maxIter = 1e4;
131132
var points = [px(xmin), px(xmax)],
132133
iter = 0;

test/exponential-test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/logarithmic-test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/polynomial-test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/power-test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/quadratic-test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)