Commit 2df538e 1 parent 7bede40 commit 2df538e Copy full SHA for 2df538e
File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " venn.js" ,
3
- "version" : " 0.2.11 " ,
3
+ "version" : " 0.2.12 " ,
4
4
"author" : " Ben Frederickson <ben@benfrederickson.com> (http:/www.benfrederickson.com)" ,
5
5
"url" : " https://github.com/benfred/venn.js/issues" ,
6
6
"devDependencies" : {
Original file line number Diff line number Diff line change @@ -147,7 +147,13 @@ export function VennDiagram() {
147
147
148
148
if ( wrap ) {
149
149
if ( hasPrevious ) {
150
- updateText . on ( "end" , wrapText ( circles , label ) ) ;
150
+ // d3 4.0 uses 'on' for events on transitions,
151
+ // but d3 3.0 used 'each' instead. switch appropiately
152
+ if ( 'on' in updateText ) {
153
+ updateText . on ( "end" , wrapText ( circles , label ) ) ;
154
+ } else {
155
+ updateText . each ( "end" , wrapText ( circles , label ) ) ;
156
+ }
151
157
} else {
152
158
updateText . each ( wrapText ( circles , label ) ) ;
153
159
}
Original file line number Diff line number Diff line change 1340
1340
1341
1341
if ( wrap ) {
1342
1342
if ( hasPrevious ) {
1343
- updateText . on ( "end" , wrapText ( circles , label ) ) ;
1343
+ // d3 4.0 uses 'on' for events on transitions,
1344
+ // but d3 3.0 used 'each' instead. switch appropiately
1345
+ if ( 'on' in updateText ) {
1346
+ updateText . on ( "end" , wrapText ( circles , label ) ) ;
1347
+ } else {
1348
+ updateText . each ( "end" , wrapText ( circles , label ) ) ;
1349
+ }
1344
1350
} else {
1345
1351
updateText . each ( wrapText ( circles , label ) ) ;
1346
1352
}
You can’t perform that action at this time.
0 commit comments