@@ -490,7 +490,7 @@ export default class Annotation extends Controller<BaseOption[]> {
490
490
}
491
491
492
492
if ( type === 'arc' ) {
493
- const { start, end } = option as ArcOption ;
493
+ const { start, end, ... rest } = option as ArcOption ;
494
494
const sp = this . parsePosition ( start ) ;
495
495
const ep = this . parsePosition ( end ) ;
496
496
const startAngle = getAngleByPoint ( coordinate , sp ) ;
@@ -500,28 +500,32 @@ export default class Annotation extends Controller<BaseOption[]> {
500
500
}
501
501
502
502
o = {
503
+ ...rest ,
503
504
center : coordinate . getCenter ( ) ,
504
505
radius : getDistanceToCenter ( coordinate , sp ) ,
505
506
startAngle,
506
507
endAngle,
507
508
} ;
508
509
} else if ( type === 'image' ) {
509
- const { start, end } = option as ImageOption ;
510
+ const { start, end, ... rest } = option as ImageOption ;
510
511
o = {
512
+ ...rest ,
511
513
start : this . parsePosition ( start ) ,
512
514
end : this . parsePosition ( end ) ,
513
515
src : option . src ,
514
516
} ;
515
517
} else if ( type === 'line' ) {
516
- const { start, end } = option as LineOption ;
518
+ const { start, end, ... rest } = option as LineOption ;
517
519
o = {
520
+ ...rest ,
518
521
start : this . parsePosition ( start ) ,
519
522
end : this . parsePosition ( end ) ,
520
523
text : get ( option , 'text' , null ) ,
521
524
} ;
522
525
} else if ( type === 'region' ) {
523
- const { start, end } = option as RegionPositionBaseOption ;
526
+ const { start, end, ... rest } = option as RegionPositionBaseOption ;
524
527
o = {
528
+ ...rest ,
525
529
start : this . parsePosition ( start ) ,
526
530
end : this . parsePosition ( end ) ,
527
531
} ;
@@ -538,8 +542,9 @@ export default class Annotation extends Controller<BaseOption[]> {
538
542
content : textContent ,
539
543
} ;
540
544
} else if ( type === 'dataMarker' ) {
541
- const { position, point, line, text, autoAdjust, direction } = option as DataMarkerOption ;
545
+ const { position, point, line, text, autoAdjust, direction, ... rest } = option as DataMarkerOption ;
542
546
o = {
547
+ ...rest ,
543
548
...this . parsePosition ( position ) ,
544
549
coordinateBBox : this . getCoordinateBBox ( ) ,
545
550
point,
@@ -549,15 +554,16 @@ export default class Annotation extends Controller<BaseOption[]> {
549
554
direction,
550
555
} ;
551
556
} else if ( type === 'dataRegion' ) {
552
- const { start, end, region, text, lineLength } = option as DataRegionOption ;
557
+ const { start, end, region, text, lineLength, ... rest } = option as DataRegionOption ;
553
558
o = {
559
+ ...rest ,
554
560
points : this . getRegionPoints ( start , end ) ,
555
561
region,
556
562
text,
557
563
lineLength,
558
564
} ;
559
565
} else if ( type === 'regionFilter' ) {
560
- const { start, end, apply, color } = option as RegionFilterOption ;
566
+ const { start, end, apply, color, ... rest } = option as RegionFilterOption ;
561
567
const geometries : Geometry [ ] = this . view . geometries ;
562
568
const shapes = [ ] ;
563
569
const addShapes = ( item ?: IElement ) => {
@@ -584,6 +590,7 @@ export default class Annotation extends Controller<BaseOption[]> {
584
590
}
585
591
} ) ;
586
592
o = {
593
+ ...rest ,
587
594
color,
588
595
shapes,
589
596
start : this . parsePosition ( start ) ,
0 commit comments