File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,12 @@ with CSS.
143
143
to: { color: ' #000' },
144
144
step : function (state , circle , attachment ) {
145
145
circle .path .setAttribute (' stroke' , state .color );
146
- }
146
+ },
147
+
148
+ // If true, some useful console.warn calls will be done if it seems
149
+ // that progressbar is used incorrectly
150
+ // Default: false
151
+ warnings: false
147
152
}
148
153
```
149
154
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ var Shape = function Shape(container, opts) {
50
50
svgStyle : {
51
51
display : 'block' ,
52
52
width : '100%'
53
- }
53
+ } ,
54
+ warnings : false
54
55
} , opts , true ) ; // Use recursive extend
55
56
56
57
// If user specifies e.g. svgStyle or text style, the whole object
@@ -77,7 +78,9 @@ var Shape = function Shape(container, opts) {
77
78
78
79
this . _container = element ;
79
80
this . _container . appendChild ( svgView . svg ) ;
80
- this . _warnContainerAspectRatio ( this . _container ) ;
81
+ if ( this . _opts . warnings ) {
82
+ this . _warnContainerAspectRatio ( this . _container ) ;
83
+ }
81
84
82
85
if ( this . _opts . svgStyle ) {
83
86
utils . setStyles ( svgView . svg , this . _opts . svgStyle ) ;
@@ -296,7 +299,7 @@ Shape.prototype._warnContainerAspectRatio = function _warnContainerAspectRatio(c
296
299
if ( ! utils . floatEquals ( this . containerAspectRatio , width / height ) ) {
297
300
console . warn (
298
301
'Incorrect aspect ratio of container' ,
299
- this . _container ,
302
+ '#' + container . id ,
300
303
'detected:' ,
301
304
computedStyle . getPropertyValue ( 'width' ) + '(width)' ,
302
305
'/' ,
You can’t perform that action at this time.
0 commit comments