File tree Expand file tree Collapse file tree 2 files changed +0
-21
lines changed Expand file tree Collapse file tree 2 files changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ const JS_WIDGET_SERIALIZER = '{ deserialize: serializers.unpackThreeModel }';
6
6
function pythonify ( value ) {
7
7
if ( value === false ) { return 'False' ; }
8
8
if ( value === true ) { return 'True' ; }
9
- if ( value === Infinity ) { return "float('inf')" ; }
10
- if ( value === - Infinity ) { return "-float('inf')" ; }
11
9
if ( value === undefined || value === null ) { return 'None' ; }
12
10
if ( Array . isArray ( value ) ) {
13
11
return `[${
Original file line number Diff line number Diff line change @@ -487,29 +487,10 @@ var ThreeModel = widgets.WidgetModel.extend({
487
487
488
488
// Float
489
489
convertFloatModelToThree : function ( v ) {
490
- if ( typeof v === 'string' || v instanceof String ) {
491
- v = v . toLowerCase ( ) ;
492
- if ( v === 'inf' ) {
493
- return Infinity ;
494
- } else if ( v === '-inf' ) {
495
- return - Infinity ;
496
- } else if ( v === 'nan' ) {
497
- return NaN ;
498
- }
499
- }
500
490
return v ;
501
491
} ,
502
492
503
493
convertFloatThreeToModel : function ( v ) {
504
- if ( isFinite ( v ) ) { // Most common first
505
- return v ;
506
- } else if ( isNaN ( v ) ) {
507
- return 'nan' ;
508
- } else if ( v === Infinity ) {
509
- return 'inf' ;
510
- } else if ( v === - Infinity ) {
511
- return '-inf' ;
512
- }
513
494
return v ;
514
495
} ,
515
496
You can’t perform that action at this time.
0 commit comments