4
4
*
5
5
* */
6
6
'use strict' ;
7
+ var __extends = ( this && this . __extends ) || ( function ( ) {
8
+ var extendStatics = function ( d , b ) {
9
+ extendStatics = Object . setPrototypeOf ||
10
+ ( { __proto__ : [ ] } instanceof Array && function ( d , b ) { d . __proto__ = b ; } ) ||
11
+ function ( d , b ) { for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ; } ;
12
+ return extendStatics ( d , b ) ;
13
+ } ;
14
+ return function ( d , b ) {
15
+ extendStatics ( d , b ) ;
16
+ function __ ( ) { this . constructor = d ; }
17
+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
18
+ } ;
19
+ } ) ( ) ;
7
20
import Annotation from '../annotations.src.js' ;
8
21
import ControlPoint from '../ControlPoint.js' ;
9
- import H from '../../parts/Globals.js' ;
10
22
import MockPoint from '../MockPoint.js' ;
11
23
import U from '../../parts/Utilities.js' ;
12
24
var merge = U . merge ;
13
25
/* eslint-disable no-invalid-this, valid-jsdoc */
14
- var CrookedLine = function ( ) {
15
- Annotation . apply ( this , arguments ) ;
16
- } ;
17
- H . extendAnnotation ( CrookedLine , null , {
26
+ var CrookedLine = /** @class */ ( function ( _super ) {
27
+ __extends ( CrookedLine , _super ) ;
28
+ /* *
29
+ *
30
+ * Constructors
31
+ *
32
+ * */
33
+ function CrookedLine ( chart , options ) {
34
+ return _super . call ( this , chart , options ) || this ;
35
+ }
36
+ /* *
37
+ *
38
+ * Functions
39
+ *
40
+ * */
18
41
/**
19
42
* Overrides default setter to get axes from typeOptions.
20
43
* @private
21
44
*/
22
- setClipAxes : function ( ) {
45
+ CrookedLine . prototype . setClipAxes = function ( ) {
23
46
this . clipXAxis = this . chart . xAxis [ this . options . typeOptions . xAxis ] ;
24
47
this . clipYAxis = this . chart . yAxis [ this . options . typeOptions . yAxis ] ;
25
- } ,
26
- getPointsOptions : function ( ) {
48
+ } ;
49
+ CrookedLine . prototype . getPointsOptions = function ( ) {
27
50
var typeOptions = this . options . typeOptions ;
28
- return typeOptions . points . map ( function ( pointOptions ) {
51
+ return ( typeOptions . points || [ ] ) . map ( function ( pointOptions ) {
29
52
pointOptions . xAxis = typeOptions . xAxis ;
30
53
pointOptions . yAxis = typeOptions . yAxis ;
31
54
return pointOptions ;
32
55
} ) ;
33
- } ,
34
- getControlPointsOptions : function ( ) {
56
+ } ;
57
+ CrookedLine . prototype . getControlPointsOptions = function ( ) {
35
58
return this . getPointsOptions ( ) ;
36
- } ,
37
- addControlPoints : function ( ) {
59
+ } ;
60
+ CrookedLine . prototype . addControlPoints = function ( ) {
38
61
this . getControlPointsOptions ( ) . forEach ( function ( pointOptions , i ) {
39
62
var controlPoint = new ControlPoint ( this . chart , this , merge ( this . options . controlPointOptions , pointOptions . controlPoint ) , i ) ;
40
63
this . controlPoints . push ( controlPoint ) ;
41
64
pointOptions . controlPoint = controlPoint . options ;
42
65
} , this ) ;
43
- } ,
44
- addShapes : function ( ) {
66
+ } ;
67
+ CrookedLine . prototype . addShapes = function ( ) {
45
68
var typeOptions = this . options . typeOptions , shape = this . initShape ( merge ( typeOptions . line , {
46
69
type : 'path' ,
47
70
points : this . points . map ( function ( _point , i ) {
@@ -51,8 +74,10 @@ H.extendAnnotation(CrookedLine, null, {
51
74
} )
52
75
} ) , false ) ;
53
76
typeOptions . line = shape . options ;
54
- }
55
- } ,
77
+ } ;
78
+ return CrookedLine ;
79
+ } ( Annotation ) ) ;
80
+ CrookedLine . prototype . defaultOptions = merge ( Annotation . prototype . defaultOptions ,
56
81
/**
57
82
* A crooked line annotation.
58
83
*
0 commit comments