Sector.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { __extends } from "tslib";
  2. import Path from '../Path.js';
  3. import * as roundSectorHelper from '../helper/roundSector.js';
  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. }
  15. return SectorShape;
  16. }());
  17. export { SectorShape };
  18. var 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));
  35. Sector.prototype.type = 'sector';
  36. export default Sector;