How to use the d3-shape.curveMonotoneY 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 / types / d3-shape / d3-shape-tests.ts View on Github external
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;

curveFactory = d3Shape.curveLinearClosed;

curveFactory = d3Shape.curveMonotoneX;

curveFactory = d3Shape.curveMonotoneY;

curveFactory = d3Shape.curveNatural;

curveFactory = d3Shape.curveStep;

curveFactory = d3Shape.curveStepAfter;

curveFactory = d3Shape.curveStepBefore;

// -----------------------------------------------------------------------------------
// Test Link/LinkRadial Generators
// -----------------------------------------------------------------------------------

// Preparatory steps =================================================================

interface TreeNodeDatum {
github viadee / sonarQuest / sonarQuest-frontend / src / app / pages / skill-tree-page / skill-tree-page.component.ts View on Github external
import { NgxGraphModule } from '@swimlane/ngx-graph';
import { UserSkillGroup } from 'app/Interfaces/UserSkillGroup';
import { Router, RouterModule } from '@angular/router';
import { RoutingUrls } from 'app/app-routing/routing-urls';
import { PermissionService } from 'app/services/permission.service';


@Component({
  selector: 'app-skill-tree-page',
  templateUrl: './skill-tree-page.component.html',
  styleUrls: ['./skill-tree-page.component.css']
})
export class SkillTreePageComponent implements OnInit {

  userSkillGroupTree: { nodes: [], links: [] };
  curve = shape.curveMonotoneY
  nodecolor = '#c0c0c0';
  isAdmin = false;
  isGamemaster = false;
  // curve = shape.curveLinear;


  constructor(private skillTreeService: SkillTreeService,
    private router: Router,
    private permissionService: PermissionService) { }

  ngOnInit() {

    this.isAdmin = true && this.permissionService.isUrlVisible(RoutingUrls.admin);
    this.isGamemaster = true && this.permissionService.isUrlVisible(RoutingUrls.gamemaster);

    this.skillTreeService.userSkillGroupTree$.subscribe(userSkillGroupTree => {
github swimlane / ngx-charts / demo / app.component.ts View on Github external
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 = [
    'Basis', 'Bundle', 'Cardinal', 'Catmull Rom', 'Linear', 'Monotone X',
    'Monotone Y', 'Natural', 'Step', 'Step After', 'Step Before'
  ];

  closedCurveType: string = 'Linear Closed';
github openforis / collect / collect-web / collect-webapp / frontend / vendor / recharts / lib / shape / Curve.js View on Github external
var _classnames2 = _interopRequireDefault(_classnames);

var _ReactUtils = require('../util/ReactUtils');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var CURVE_FACTORIES = {
  curveBasisClosed: _d3Shape.curveBasisClosed, curveBasisOpen: _d3Shape.curveBasisOpen, curveBasis: _d3Shape.curveBasis, curveLinearClosed: _d3Shape.curveLinearClosed, curveLinear: _d3Shape.curveLinear,
  curveMonotoneX: _d3Shape.curveMonotoneX, curveMonotoneY: _d3Shape.curveMonotoneY, curveNatural: _d3Shape.curveNatural, curveStep: _d3Shape.curveStep, curveStepAfter: _d3Shape.curveStepAfter,
  curveStepBefore: _d3Shape.curveStepBefore
};

var defined = function defined(p) {
  return p.x === +p.x && p.y === +p.y;
};
var getX = function getX(p) {
  return p.x;
};
var getY = function getY(p) {
  return p.y;
};

var getCurveFactory = function getCurveFactory(type, layout) {
  if ((0, _isFunction3.default)(type)) {
    return type;
github contiamo / operational-ui / packages / visualizations / lib / Chart / series / renderers / line.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fp_1 = require("lodash/fp");
var d3_shape_1 = require("d3-shape");
var styles = require("./styles");
var defaultAccessors = {
    color: function (series, d) { return series.legendColor(); },
    dashed: function (series, d) { return false; },
    interpolate: function (series, d) { return "linear"; },
    closeGaps: function (series, d) { return true; },
};
var interpolator = {
    cardinal: d3_shape_1.curveCardinal,
    linear: d3_shape_1.curveLinear,
    monotoneX: d3_shape_1.curveMonotoneX,
    monotoneY: d3_shape_1.curveMonotoneY,
    step: d3_shape_1.curveStep,
    stepAfter: d3_shape_1.curveStepAfter,
    stepBefore: d3_shape_1.curveStepBefore,
};
var hasValue = function (d) {
    return !!d || d === 0;
};
var aOrB = function (a, b) {
    return hasValue(a) ? a : b;
};
var Line = /** @class */ (function () {
    function Line(state, events, el, data, options, series) {
        this.type = "line";
        this.state = state;
        this.events = events;
        this.series = series;
github contiamo / operational-ui / packages / visualizations / lib / Chart / series / renderers / area.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fp_1 = require("lodash/fp");
var d3_shape_1 = require("d3-shape");
var styles = require("./styles");
var interpolator = {
    cardinal: d3_shape_1.curveCardinal,
    linear: d3_shape_1.curveLinear,
    monotoneX: d3_shape_1.curveMonotoneX,
    monotoneY: d3_shape_1.curveMonotoneY,
    step: d3_shape_1.curveStep,
    stepAfter: d3_shape_1.curveStepAfter,
    stepBefore: d3_shape_1.curveStepBefore,
};
var defaultAccessors = {
    color: function (series, d) { return series.legendColor(); },
    interpolate: function (series, d) { return "linear"; },
    closeGaps: function (series, d) { return true; },
};
var hasValue = function (d) {
    return !!d || d === 0;
};
var aOrB = function (a, b) {
    return hasValue(a) ? a : b;
};
var Area = /** @class */ (function () {
github swimlane / ngx-charts-builder / src / app / app.component.ts View on Github external
curve: shape.curveLinear,
  curveClosed: shape.curveCardinalClosed
};

const  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
};


@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['../../node_modules/@swimlane/ngx-ui/release/index.css', './app.component.scss'],
  encapsulation: ViewEncapsulation.None
})
export class AppComponent implements OnInit {
  chartTypes = chartTypes;
github hshoff / vx / packages / vx-curve / build / index.js View on Github external
get: function get() {
    return _d3Shape.curveMonotoneY;
  }
});
github esnet / react-timeseries-charts / lib / js / curve.js View on Github external
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.
    */