File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 9
9
var sin = Math . sin ( angle )
10
10
var tx = x * cos - y * sin + 100
11
11
var ty = x * sin + y * cos + 100
12
+
13
+ if ( ty < 0 ) debugger
12
14
return {
13
15
x : tx ,
14
16
y : ty
26
28
{ label : 'F' , value : 100 }
27
29
] ,
28
30
29
- get points ( ) {
30
- const total = this . stats . length
31
- return this . stats . map ( ( stat , i ) => valueToPoint ( stat . value , i , total ) )
31
+ get pointsString ( ) {
32
+ return this . getPoints ( )
33
+ . map ( ( { x, y } ) => `${ x } ,${ y } ` )
34
+ . join ( ' ' )
32
35
} ,
33
36
34
- get pointsString ( ) {
35
- return this . points . map ( ( { x, y } ) => `${ x } ,${ y } ` ) . join ( ' ' )
37
+ getPoints ( offset = 0 ) {
38
+ const total = this . stats . length
39
+ return this . stats . map ( ( stat , i ) => ( {
40
+ ...valueToPoint ( + stat . value + offset , i , total ) ,
41
+ label : stat . label
42
+ } ) )
36
43
} ,
37
44
38
45
add ( e ) {
60
67
< g >
61
68
< polygon :points ="pointsString "> </ polygon >
62
69
< circle cx ="100 " cy ="100 " r ="80 "> </ circle >
63
- < text v-for ="{ x, y, label } in points " :x ="x " :y ="y "> {{ label }}</ text >
70
+ < text v-for ="{ x, y, label } in getPoints(10) " :x ="x " :y ="y "> {{ label }}</ text >
64
71
</ g >
65
72
</ svg >
66
73
<!-- controls -->
You can’t perform that action at this time.
0 commit comments