Metadata
- Source
- FLUID-5705
- Type
- Bug
- Priority
- Major
- Status
- Open
- Resolution
- N/A
- Assignee
- Antranig Basman
- Reporter
- Antranig Basman
- Created
2015-07-10T13:32:39.422-0400 - Updated
2021-08-08T13:55:01.215-0400 - Versions
-
- 1.5
- 2.0
- 3.0
- Fixed Versions
-
- 5.0
- Component
-
- Framework
Description
The initial phase of fluid.linearScale operates an aggressive type check before operating its arithmetic:
if (typeof(value) !== "number" || typeof(factor) !== "number" || typeof(offset) !== "number") {
return undefined;
}
This prevents the transform from operating in many cases where the native JS operation would permit it to proceed - where the values are encoded as strings, for example. This check is also inconsistent with all of our other numeric transforms such as limitRange. The best plan, as well as removing this, might be to start operating new semantics for return values of transforms and treat a NaN output value in the same way as undefined - that is, representing "no output". This would also allow us to remove boilerplate from other numeric transforms such as a hypothetical transforms.sqrt or transforms.log etc.