How to use the d3-regression.regressionPow function in d3-regression

To help you get started, we’ve selected a few d3-regression examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github julianrubisch / attractor / src / javascript / functions.js View on Github external
const regressionGenerator = (function(regressionType) {
      switch (regressionType) {
        case RegressionTypes.LINEAR:
          return regressionLinear()
            .x(d => d.x)
            .y(d => d.y)
            .domain([3, d3.max(data, item => item.x)]);
        case RegressionTypes.POWER_LAW:
        default:
          data = data.filter(d => d.y > 0);
          return regressionPow()
            .x(d => d.x)
            .y(d => d.y)
            .domain([3, d3.max(data, item => item.x)]);
      }
    })(regressionType);

d3-regression

Calculate statistical regressions for two-dimensional data

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis