Example
Create and update a scale.
const scale = new NutrientViewer.MeasurementScale({
unitFrom: NutrientViewer.MeasurementScaleUnitFrom.Millimeters,
unitTo: NutrientViewer.MeasurementScaleUnitTo.Inches,
fromValue: 1,
toValue: 10
});
const newScale = scale.set("fromValue", 2);
newScale.fromValue // => 2
Hierarchy
Properties
fromDescription
fromValue
toDescription
toValue
unitFrom
unitTo
Immutable Record API
31
Returns
IterableIterator<[keyof { … }, string | number | undefined]>
Returns
thisSee Also
Map#asImmutable
Returns
thisSee Also
Map#asMutable
Returns a new instance of this Record type with all values set to their default values.
Returns
this
delete<K extends keyof { … }>(key: K): this
Returns a new instance of this Record type with the value for the specific key set to its default value.
Parameters
otherunknownReturns
boolean
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
Returns
number
Parameters
keyPathIterable<unknown>...collectionsunknown[]Returns
this
Parameters
keyPathIterable<unknown>...collectionsunknown[]Returns
this
remove<K extends keyof { … }>(key: K): this
Parameters
keyPathIterable<unknown>valueunknownReturns
this
Deeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
Returns
{ … }
Shallowly converts this Record to equivalent native JavaScript Object.
Returns
{ … }
Shallowly converts this Record to equivalent JavaScript Object.
Returns
{ … }
Returns
Keyed<keyof { … }, string | number | undefined>
Parameters
keyPathIterable<unknown>updater(value: unknown) => unknownReturns
this
Returns
booleanSee Also
Map#wasAltered
Note: Not all methods can be used on a mutable collection or within
withMutations! Onlysetmay be used mutatively.Parameters
mutator(mutable: this) => unknownReturns
thisSee Also
Map#withMutations
MeasurementScale is a class that represents the scale of measurement annotations.
It is an Immutable.Record and thus can be updated using
set(key, value), for example:scale.set("fromValue", 15)