How to use the d3-shape.curveCatmullRom function in d3-shape

To help you get started, we’ve selected a few d3-shape 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 DefinitelyTyped / DefinitelyTyped / d3-shape / d3-shape-tests.ts View on Github external
curveCardinalFactory = d3Shape.curveCardinalOpen;
curveCardinalFactory = d3Shape.curveCardinalOpen.tension(0.5);

curveGenerator = d3Shape.curveCardinalOpen.tension(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCardinalOpen.tension(0.5)(path());

curveCardinalFactory = d3Shape.curveCardinalClosed;
curveCardinalFactory = d3Shape.curveCardinalClosed.tension(0.5);

curveGenerator = d3Shape.curveCardinalClosed.tension(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCardinalClosed.tension(0.5)(path());

let curveCatmullRomFactory: d3Shape.CurveCatmullRomFactory;

curveCatmullRomFactory = d3Shape.curveCatmullRom;
curveCatmullRomFactory = d3Shape.curveCatmullRom.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRom.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRom.alpha(0.5)(path());

curveCatmullRomFactory = d3Shape.curveCatmullRomOpen;
curveCatmullRomFactory = d3Shape.curveCatmullRomOpen.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRomOpen.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRomOpen.alpha(0.5)(path());

curveCatmullRomFactory = d3Shape.curveCatmullRomClosed;
curveCatmullRomFactory = d3Shape.curveCatmullRomClosed.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRomClosed.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRomClosed.alpha(0.5)(path());
github DefinitelyTyped / DefinitelyTyped / d3-shape / d3-shape-tests.ts View on Github external
curveGenerator = d3Shape.curveCardinalOpen.tension(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCardinalOpen.tension(0.5)(path());

curveCardinalFactory = d3Shape.curveCardinalClosed;
curveCardinalFactory = d3Shape.curveCardinalClosed.tension(0.5);

curveGenerator = d3Shape.curveCardinalClosed.tension(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCardinalClosed.tension(0.5)(path());

let curveCatmullRomFactory: d3Shape.CurveCatmullRomFactory;

curveCatmullRomFactory = d3Shape.curveCatmullRom;
curveCatmullRomFactory = d3Shape.curveCatmullRom.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRom.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRom.alpha(0.5)(path());

curveCatmullRomFactory = d3Shape.curveCatmullRomOpen;
curveCatmullRomFactory = d3Shape.curveCatmullRomOpen.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRomOpen.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRomOpen.alpha(0.5)(path());

curveCatmullRomFactory = d3Shape.curveCatmullRomClosed;
curveCatmullRomFactory = d3Shape.curveCatmullRomClosed.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRomClosed.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRomClosed.alpha(0.5)(path());

curveFactory = d3Shape.curveLinear;
github DefinitelyTyped / DefinitelyTyped / d3-shape / d3-shape-tests.ts View on Github external
curveCardinalFactory = d3Shape.curveCardinalOpen;
curveCardinalFactory = d3Shape.curveCardinalOpen.tension(0.5);

curveGenerator = d3Shape.curveCardinalOpen.tension(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCardinalOpen.tension(0.5)(path());

curveCardinalFactory = d3Shape.curveCardinalClosed;
curveCardinalFactory = d3Shape.curveCardinalClosed.tension(0.5);

curveGenerator = d3Shape.curveCardinalClosed.tension(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCardinalClosed.tension(0.5)(path());

let curveCatmullRomFactory: d3Shape.CurveCatmullRomFactory;

curveCatmullRomFactory = d3Shape.curveCatmullRom;
curveCatmullRomFactory = d3Shape.curveCatmullRom.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRom.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRom.alpha(0.5)(path());

curveCatmullRomFactory = d3Shape.curveCatmullRomOpen;
curveCatmullRomFactory = d3Shape.curveCatmullRomOpen.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRomOpen.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRomOpen.alpha(0.5)(path());

curveCatmullRomFactory = d3Shape.curveCatmullRomClosed;
curveCatmullRomFactory = d3Shape.curveCatmullRomClosed.alpha(0.5);

curveGenerator = d3Shape.curveCatmullRomClosed.alpha(0.5)(context!);  // force context to be non-null with post-fix for mock
curveGenerator = d3Shape.curveCatmullRomClosed.alpha(0.5)(path());
github swimlane / ngx-charts / demo / app.component.ts View on Github external
showSeriesOnHover = true;
  roundEdges: boolean = true;
  animations: boolean = true;
  xScaleMin: any;
  xScaleMax: any;
  yScaleMin: number;
  yScaleMax: number;
  showDataLabel = false;

  curves = {
    Basis: shape.curveBasis,
    'Basis Closed': shape.curveBasisClosed,
    Bundle: shape.curveBundle.beta(1),
    Cardinal: shape.curveCardinal,
    'Cardinal Closed': shape.curveCardinalClosed,
    'Catmull Rom': shape.curveCatmullRom,
    'Catmull Rom Closed': shape.curveCatmullRomClosed,
    Linear: shape.curveLinear,
    'Linear Closed': shape.curveLinearClosed,
    'Monotone X': shape.curveMonotoneX,
    'Monotone Y': shape.curveMonotoneY,
    Natural: shape.curveNatural,
    Step: shape.curveStep,
    'Step After': shape.curveStepAfter,
    'Step Before': shape.curveStepBefore,
    default: shape.curveLinear
  };

  // line interpolation
  curveType: string = 'Linear';
  curve: any = this.curves[this.curveType];
  interpolationTypes = [
github beizhedenglong / rough-charts / packages / react-rough-charts / stories / LineSeries.stories.tsx View on Github external
export const WithCustomizedCurve = (props) => {
  const c1 = d3Shape.curveCatmullRom.alpha(1)
  return (
github ethantran / react-native-examples / src / screens / StaggeredLineAnimation.js View on Github external
constructor(props) {
        super(props);
        const { width, height } = Dimensions.get('window');
        const data = Array(dataLength).fill().map((_, index) => ({
            index,
            value: randomNumber(min, max)
        }));
        const data2 = Array(dataLength).fill().map((_, index) => ({
            index,
            value: randomNumber(min, max)
        }));
        const curve = d3Shape.curveCatmullRom.alpha(0.5);
        const x = d3Scale
            .scaleLinear()
            .range([0, width - 10])
            .domain([0, dataLength - 1]);
        const y = d3Scale
            .scaleLinear()
            .range([0, width / 2])
            .domain([min, max]);
        const lineGenerator = d3Shape
            .line()
            .curve(curve)
            .x(d => x(d.index))
            .y(d => y(d.value));
        this.linePath = createLineProps(lineGenerator(data));
        this.linePath2 = createLineProps(lineGenerator(data2));
        this.points = data.map(d => ({
github esnet / react-timeseries-charts / lib / js / curve.js View on Github external
value: true
});

var _d3Shape = require("d3-shape");

exports.default = {
    curveBasisClosed: _d3Shape.curveBasisClosed,
    curveBasisOpen: _d3Shape.curveBasisOpen,
    curveBasis: _d3Shape.curveBasis,
    curveBundle: _d3Shape.curveBundle,
    curveCardinalClosed: _d3Shape.curveCardinalClosed,
    curveCardinalOpen: _d3Shape.curveCardinalOpen,
    curveCardinal: _d3Shape.curveCardinal,
    curveCatmullRomClosed: _d3Shape.curveCatmullRomClosed,
    curveCatmullRomOpen: _d3Shape.curveCatmullRomOpen,
    curveCatmullRom: _d3Shape.curveCatmullRom,
    curveLinearClosed: _d3Shape.curveLinearClosed,
    curveLinear: _d3Shape.curveLinear,
    curveMonotoneX: _d3Shape.curveMonotoneX,
    curveMonotoneY: _d3Shape.curveMonotoneY,
    curveNatural: _d3Shape.curveNatural,
    curveStep: _d3Shape.curveStep,
    curveStepAfter: _d3Shape.curveStepAfter,
    curveStepBefore: _d3Shape.curveStepBefore
}; /**
    *  Copyright (c) 2017, The Regents of the University of California,
    *  through Lawrence Berkeley National Laboratory (subject to receipt
    *  of any required approvals from the U.S. Dept. of Energy).
    *  All rights reserved.
    *
    *  This source code is licensed under the BSD-style license found in the
    *  LICENSE file in the root directory of this source tree.
github esnet / react-timeseries-charts / packages / react-timeseries-charts / dist / curve.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var d3_shape_1 = require("d3-shape");
var curves = {
    curveBasisClosed: d3_shape_1.curveBasisClosed,
    curveBasisOpen: d3_shape_1.curveBasisOpen,
    curveBasis: d3_shape_1.curveBasis,
    curveBundle: d3_shape_1.curveBundle,
    curveCardinalClosed: d3_shape_1.curveCardinalClosed,
    curveCardinalOpen: d3_shape_1.curveCardinalOpen,
    curveCardinal: d3_shape_1.curveCardinal,
    curveCatmullRomClosed: d3_shape_1.curveCatmullRomClosed,
    curveCatmullRomOpen: d3_shape_1.curveCatmullRomOpen,
    curveCatmullRom: d3_shape_1.curveCatmullRom,
    curveLinearClosed: d3_shape_1.curveLinearClosed,
    curveLinear: d3_shape_1.curveLinear,
    curveMonotoneX: d3_shape_1.curveMonotoneX,
    curveMonotoneY: d3_shape_1.curveMonotoneY,
    curveNatural: d3_shape_1.curveNatural,
    curveStep: d3_shape_1.curveStep,
    curveStepAfter: d3_shape_1.curveStepAfter,
    curveStepBefore: d3_shape_1.curveStepBefore
};
exports.default = curves;
//# sourceMappingURL=curve.js.map
github ethantran / react-native-examples / src / components / SvgD3Annotation.js View on Github external
function createCurveData({ type, connectorData, subjectType }) {
    if (!connectorData) {
        connectorData = {};
    }
    if (!connectorData.points || typeof connectorData.points === 'number') {
        connectorData.points = createPoints(
            type.annotation.offset,
            connectorData.points
        );
    }
    if (!connectorData.curve) {
        connectorData.curve = d3Shape.curveCatmullRom;
    }
    let data = createLineData({ type, subjectType });
    data = [data[0], ...connectorData.points, data[1]];
    return data;
}