当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript d3-shape.arc函数代码示例

本文整理汇总了TypeScript中d3-shape.arc函数的典型用法代码示例。如果您正苦于以下问题:TypeScript arc函数的具体用法?TypeScript arc怎么用?TypeScript arc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了arc函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: arc

export const dPie = ({
  maxRadius, innerRadius, outerRadius, startAngle, endAngle,
}: PieSeries.PointProps) => arc()({
  startAngle,
  endAngle,
  innerRadius: innerRadius * maxRadius,
  outerRadius: outerRadius * maxRadius,
})!;
开发者ID:MaximKudriavtsev,项目名称:devextreme-reactive,代码行数:8,代码来源:computeds.ts

示例2: getArcGenerator

 private getArcGenerator(innerRadius: number, outerRadius: number): any {
   return arc()
     .innerRadius(innerRadius)
     .outerRadius(outerRadius)
     .startAngle(Math.PI)
     .endAngle((input: any) => {
       return input as number;
     })
 }
开发者ID:iteratec,项目名称:OpenSpeedMonitor,代码行数:9,代码来源:csi-value-svg.renderer.ts

示例3: constructor

    constructor(innerRadius: number, outerRadius: number) {
        this.startAngle = 0;
        this.endAngle = Math.PI / 2;
        this.padAngle = 0;
        this.innerRadius = innerRadius;
        this.outerRadius = outerRadius;
        this.cornerRadius = 3;

        this.arc = d3Shape.arc<Arcer, ArcerDatum>()
            .innerRadius(d => {
                return Math.min(d.innerRadius, this.innerRadius);
            })
            .outerRadius(d => {
                return Math.min(d.outerRadius, this.outerRadius);
            })
            .cornerRadius(this.cornerRadius)
            .startAngle(this.startAngle)
            .endAngle(this.endAngle)
            .padAngle(this.padAngle);
    }
开发者ID:Georadix,项目名称:DefinitelyTyped,代码行数:20,代码来源:d3-shape-tests.ts

示例4:

    innerRadius: 0,
    outerRadius: 100,
    startAngle: 0,
    endAngle: Math.PI / 2,
    padAngle: 0
};

num = defaultArcObject.innerRadius;
num = defaultArcObject.outerRadius;
num = defaultArcObject.startAngle;
num = defaultArcObject.endAngle;
num = defaultArcObject.padAngle;

// arc(...) create Arc generator =====================================================

let canvasArc: d3Shape.Arc<any, d3Shape.DefaultArcObject> = d3Shape.arc();
let svgArc: d3Shape.Arc<SVGPathElement, ArcDatum> = d3Shape.arc<SVGPathElement, ArcDatum>();

// configure Arc(...) generator ======================================================

// context(...) ----------------------------------------------------------------------

if (context !== null) {
    canvasArc = canvasArc.context(context); // draw to canvas
}
context = canvasArc.context();

svgArc = svgArc.context(null); // use as path string generator for SVG

// innerRadius(...) -------------------------------------------------------------------
开发者ID:Georadix,项目名称:DefinitelyTyped,代码行数:30,代码来源:d3-shape-tests.ts


注:本文中的d3-shape.arc函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。