import React, { Component } from 'react'; import { Surface, Curve, Layer, CurveProps } from 'recharts'; import { curveBundle, curveCardinal, curveCardinalClosed, curveCardinalOpen, curveCatmullRomOpen, CurveFactory } from 'd3-shape'; import { scaleOrdinal } from 'd3-scale'; import { schemeCategory10 } from 'd3-scale-chromatic'; export default class Demo extends Component { static displayName = 'CurveDemo'; render () { const points = [ { x: 10, y: 40 }, { x: 50, y: 150 }, { x: 90, y: 60 }, { x: 130, y: 180 }, { x: 170, y: 50 } ]; const scale = scaleOrdinal(schemeCategory10); const ticks = [0, 0.25, 0.5, 0.75, 1]; return ( curveCardinalClosed { ticks.map((entry: any, index: number) => ( {`curveCardinalClosed.tension(${entry})`} )) } { points.map((entry, index) => ( )) } curveCatmullRomOpen { ticks.map((entry: any, index: number) => ( {`curveCatmullRomOpen.alpha(${entry})`} )) } { points.map((entry, index) => ( )) } {/* curveBundle { ticks.map((entry: any, index: number) => ( {`curveBundle.beta(${entry})`} )) } { points.map((entry, index) => ( )) } */} ); } }