Skip to content

Commit 55d6e42

Browse files
committed
Fix for infinity
1 parent 150ff1c commit 55d6e42

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

js/scripts/prop-types.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ const JS_WIDGET_SERIALIZER = '{ deserialize: serializers.unpackThreeModel }';
66
function pythonify(value) {
77
if (value === false) { return 'False'; }
88
if (value === true) { return 'True'; }
9-
if (value === Infinity) { return "float('inf')"; }
10-
if (value === -Infinity) { return "-float('inf')"; }
119
if (value === undefined || value === null) { return 'None'; }
1210
if (Array.isArray(value)) {
1311
return `[${

js/src/_base/Three.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -487,29 +487,10 @@ var ThreeModel = widgets.WidgetModel.extend({
487487

488488
// Float
489489
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-
}
500490
return v;
501491
},
502492

503493
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-
}
513494
return v;
514495
},
515496

0 commit comments

Comments
 (0)