UNPKG

1.06 kBJavaScriptView Raw
1import { __extends } from "tslib";
2import Path from '../Path.js';
3import * as roundSectorHelper from '../helper/roundSector.js';
4var SectorShape = (function () {
5 function SectorShape() {
6 this.cx = 0;
7 this.cy = 0;
8 this.r0 = 0;
9 this.r = 0;
10 this.startAngle = 0;
11 this.endAngle = Math.PI * 2;
12 this.clockwise = true;
13 this.cornerRadius = 0;
14 }
15 return SectorShape;
16}());
17export { SectorShape };
18var Sector = (function (_super) {
19 __extends(Sector, _super);
20 function Sector(opts) {
21 return _super.call(this, opts) || this;
22 }
23 Sector.prototype.getDefaultShape = function () {
24 return new SectorShape();
25 };
26 Sector.prototype.buildPath = function (ctx, shape) {
27 roundSectorHelper.buildPath(ctx, shape);
28 };
29 Sector.prototype.isZeroArea = function () {
30 return this.shape.startAngle === this.shape.endAngle
31 || this.shape.r === this.shape.r0;
32 };
33 return Sector;
34}(Path));
35Sector.prototype.type = 'sector';
36export default Sector;