Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolation support #4

Open
Guibod opened this issue Mar 16, 2016 · 1 comment
Open

Interpolation support #4

Guibod opened this issue Mar 16, 2016 · 1 comment

Comments

@Guibod
Copy link

Guibod commented Mar 16, 2016

Line have an interpolate property but never use it. This is a must for line charts.

@Guibod
Copy link
Author

Guibod commented Mar 16, 2016

For the record, I achieve Monotone implementation this way:

import { Line } from 'react-d3-shape';
import { line, curveMonotoneX } from 'd3-shape';

export default class MyLine extends Line {
  _setAxes(data) {
    const {
      xScaleSet,
      yScaleSet
    } = this.props;

    const x = line()
      .x((d) => { return xScaleSet(d.x) })
      .y((d) => { return yScaleSet(d.y) })
      .curve(curveMonotoneX);

    return x.call(this, data);
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant