Sector.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { __extends } from "tslib";
  2. import Path from '../Path';
  3. import * as roundSectorHelper from '../helper/roundSector';
  4. var 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. this.innerCornerRadius = 0;
  15. }
  16. return SectorShape;
  17. }());
  18. export { SectorShape };
  19. var Sector = (function (_super) {
  20. __extends(Sector, _super);
  21. function Sector(opts) {
  22. return _super.call(this, opts) || this;
  23. }
  24. Sector.prototype.getDefaultShape = function () {
  25. return new SectorShape();
  26. };
  27. Sector.prototype.buildPath = function (ctx, shape) {
  28. roundSectorHelper.buildPath(ctx, shape);
  29. };
  30. Sector.prototype.isZeroArea = function () {
  31. return this.shape.startAngle === this.shape.endAngle
  32. || this.shape.r === this.shape.r0;
  33. };
  34. return Sector;
  35. }(Path));
  36. Sector.prototype.type = 'sector';
  37. export default Sector;