c80b533eb7b3645abee89ca7dae23fc1f3ad51c068d1b60d8603ff8629c9d6cb2f90b8d290264dcf0050baa7ae28b5ed74b8f9e318b7ebb3392e06662ec30b 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @module zrender/graphic/shape/Polyline
  3. */
  4. import Path, { PathProps } from '../Path';
  5. import * as polyHelper from '../helper/poly';
  6. import { VectorArray } from '../../core/vector';
  7. export class PolylineShape {
  8. points: VectorArray[] = null
  9. // Percent of displayed polyline. For animating purpose
  10. percent?: number = 1
  11. smooth?: number = 0
  12. smoothConstraint?: VectorArray[] = null
  13. }
  14. export interface PolylineProps extends PathProps {
  15. shape?: Partial<PolylineShape>
  16. }
  17. class Polyline extends Path<PolylineProps> {
  18. shape: PolylineShape
  19. constructor(opts?: PolylineProps) {
  20. super(opts);
  21. }
  22. getDefaultStyle() {
  23. return {
  24. stroke: '#000',
  25. fill: null as string
  26. };
  27. }
  28. getDefaultShape() {
  29. return new PolylineShape();
  30. }
  31. buildPath(ctx: CanvasRenderingContext2D, shape: PolylineShape) {
  32. polyHelper.buildPath(ctx, shape, false);
  33. }
  34. }
  35. Polyline.prototype.type = 'polyline';
  36. export default Polyline;