@@ -64,15 +64,20 @@ export interface Configuration {
6464 forceDisableEditing ?: boolean ;
6565 intelligentPolygonCrop ?: boolean ;
6666 forceFrameUpdate ?: boolean ;
67- creationOpacity ?: number ;
6867 CSSImageFilter ?: string ;
68+ colorBy ?: string ;
69+ selectedShapeOpacity ?: number ;
70+ shapeOpacity ?: number ;
71+ controlPointsSize ?: number ;
72+ outlinedBorders ?: string | false ;
6973}
7074
7175export interface DrawData {
7276 enabled : boolean ;
7377 shapeType ?: string ;
7478 rectDrawingMethod ?: RectDrawingMethod ;
7579 cuboidDrawingMethod ?: CuboidDrawingMethod ;
80+ skeletonSVG ?: string ;
7681 numberOfPoints ?: number ;
7782 initialState ?: any ;
7883 crosshair ?: boolean ;
@@ -265,12 +270,23 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
265270 width : 0 ,
266271 } ,
267272 configuration : {
268- displayAllText : false ,
273+ smoothImage : true ,
269274 autoborders : false ,
270- undefinedAttrValue : '' ,
271- textContent : 'id,label,attributes,source,descriptions' ,
272- textPosition : 'auto' ,
275+ displayAllText : false ,
276+ showProjections : false ,
277+ forceDisableEditing : false ,
278+ intelligentPolygonCrop : false ,
279+ forceFrameUpdate : false ,
280+ CSSImageFilter : '' ,
281+ colorBy : 'Label' ,
282+ selectedShapeOpacity : 0.5 ,
283+ shapeOpacity : 0.2 ,
284+ outlinedBorders : false ,
273285 textFontSize : consts . DEFAULT_SHAPE_TEXT_SIZE ,
286+ controlPointsSize : consts . BASE_POINT_SIZE ,
287+ textPosition : consts . DEFAULT_SHAPE_TEXT_POSITION ,
288+ textContent : consts . DEFAULT_SHAPE_TEXT_CONTENT ,
289+ undefinedAttrValue : consts . DEFAULT_UNDEFINED_ATTR_VALUE ,
274290 } ,
275291 imageBitmap : false ,
276292 image : null ,
@@ -541,6 +557,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
541557 }
542558
543559 if ( drawData . enabled ) {
560+ if ( drawData . shapeType === 'skeleton' && ! drawData . skeletonSVG ) {
561+ throw new Error ( 'Skeleton template must be specified when drawing a skeleton' ) ;
562+ }
563+
544564 if ( this . data . drawData . enabled ) {
545565 throw new Error ( 'Drawing has been already started' ) ;
546566 } else if ( ! drawData . shapeType && ! drawData . initialState ) {
@@ -670,6 +690,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
670690 this . data . configuration . textFontSize = configuration . textFontSize ;
671691 }
672692
693+ if ( typeof configuration . controlPointsSize === 'number' ) {
694+ this . data . configuration . controlPointsSize = configuration . controlPointsSize ;
695+ }
696+
673697 if ( [ 'auto' , 'center' ] . includes ( configuration . textPosition ) ) {
674698 this . data . configuration . textPosition = configuration . textPosition ;
675699 }
@@ -702,8 +726,17 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
702726 if ( typeof configuration . forceFrameUpdate === 'boolean' ) {
703727 this . data . configuration . forceFrameUpdate = configuration . forceFrameUpdate ;
704728 }
705- if ( typeof configuration . creationOpacity === 'number' ) {
706- this . data . configuration . creationOpacity = configuration . creationOpacity ;
729+ if ( typeof configuration . selectedShapeOpacity === 'number' ) {
730+ this . data . configuration . selectedShapeOpacity = configuration . selectedShapeOpacity ;
731+ }
732+ if ( typeof configuration . shapeOpacity === 'number' ) {
733+ this . data . configuration . shapeOpacity = configuration . shapeOpacity ;
734+ }
735+ if ( [ 'string' , 'boolean' ] . includes ( typeof configuration . outlinedBorders ) ) {
736+ this . data . configuration . outlinedBorders = configuration . outlinedBorders ;
737+ }
738+ if ( [ 'Instance' , 'Group' , 'Label' ] . includes ( configuration . colorBy ) ) {
739+ this . data . configuration . colorBy = configuration . colorBy ;
707740 }
708741
709742 if ( typeof configuration . CSSImageFilter === 'string' ) {
0 commit comments