Blame view

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