File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 16
16
"Uint8Array": true,
17
17
"Int16Array": true,
18
18
"Int32Array": true,
19
- "ArrayBuffer": true
19
+ "ArrayBuffer": true,
20
+ "SVGElement": false
20
21
},
21
22
"rules": {
22
23
"no-trailing-spaces": [2],
Original file line number Diff line number Diff line change 17
17
18
18
if ( sel . size ( ) ) {
19
19
if ( typeof obj === 'string' ) {
20
- checkVal ( obj , arguments [ 1 ] ) ;
20
+ checkVal ( sel , obj , arguments [ 1 ] ) ;
21
21
}
22
22
else {
23
- Object . keys ( obj ) . forEach ( function ( key ) { checkVal ( key , obj [ key ] ) ; } ) ;
23
+ Object . keys ( obj ) . forEach ( function ( key ) { checkVal ( sel , key , obj [ key ] ) ; } ) ;
24
24
}
25
25
}
26
26
27
27
return originalSelStyle . apply ( sel , arguments ) ;
28
28
} ;
29
29
30
- function checkVal ( key , val ) {
30
+ function checkVal ( sel , key , val ) {
31
31
if ( typeof val === 'string' ) {
32
32
// in case of multipart styles (stroke-dasharray, margins, etc)
33
33
// test each part separately
37
37
throw new Error ( 'd3 selection.style called with value: ' + val ) ;
38
38
}
39
39
} ) ;
40
+
41
+ // Microsoft browsers incl. "Edge" don't support CSS transform on SVG elements
42
+ if ( key === 'transform' && sel . node ( ) instanceof SVGElement ) {
43
+ throw new Error ( 'd3 selection.style called on an SVG element with key: ' + key ) ;
44
+ }
40
45
}
41
46
42
47
}
You can’t perform that action at this time.
0 commit comments