本文整理汇总了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,
})!;
示例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;
})
}
示例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);
}
示例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(...) -------------------------------------------------------------------