The multi-linear scaler. This scaler maps numeric values according to the majorTickValues content. This allows display of very large value intervals that are difficult to render with a linear scale. For example, if majorTickValues contains [0, 10, 50, 500, 2000], the scale will show five major ticks with these values. Note that this is not a logarithmic scale, the interpolation is linear between two contiguous major ticks. Scalers are responsible for tick generation and various data-transform operations.
See the dojox/dgauges/MultiLinearScaler reference documentation for more information.
Used across all instances a hash to cache attribute names and their getter and setter names.
The array of generated major ticks. You should not set this property when using the scaler.
An array of Number for creating major ticks. This array must be sorted in ascendant order.
The number of minor ticks between two contiguous major ticks. The default value is 4.
The array of generated minor ticks. You should not set this property when using the scaler.
Internal helper for directly changing an attribute value.
Directly change the value of an attribute on an object, bypassing any accessor setter. Also handles the calling of watch and emitting events. It is designed to be used by descendant class when there are two values of attributes that are linked, but calling .set() is not appropriate.
Parameter | Type | Description |
---|---|---|
name | String | The property to set. |
value | Mixed | The value to set in the property. |
Internal helper for directly changing an attribute value.
Private function that does a get based off a hash of names
Parameter | Type | Description |
---|---|---|
name | undefined | |
names | undefined | Hash of names of custom attributes |
Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.
Parameter | Type | Description |
---|---|---|
name | undefined |
Internal method.
Parameter | Type | Description |
---|---|---|
v | undefined | |
property | undefined |
Creates or re-creates the ticks for this scaler.
An array containing all ticks (major then minor ticks).
Get a property on a Stateful instance.
Get a named property on a Stateful object. The property may potentially be retrieved via a getter method in subclasses. In the base class this just retrieves the object's property.
Parameter | Type | Description |
---|---|---|
name | String | The property to get. |
The property value on this Stateful instance.
require(["dojo/Stateful", function(Stateful) { var stateful = new Stateful({foo: 3}); stateful.get("foo") // returns 3 stateful.foo // returns 3 });
Transforms a value into a relative position between 0 and 1.
Parameter | Type | Description |
---|---|---|
value | Number | A value to transform. |
The position between 0 and 1.
Set a property on a Stateful instance
Sets named properties on a stateful object and notifies any watchers of the property. A programmatic setter may be defined in subclasses.
Parameter | Type | Description |
---|---|---|
name | String | The property to set. |
value | Object | The value to set in the property. |
The function returns this dojo.Stateful instance.
require(["dojo/Stateful", function(Stateful) { var stateful = new Stateful(); stateful.watch(function(name, oldValue, value){ // this will be called on the set below } stateful.set(foo, 5);
set() may also be called with a hash of name/value pairs, ex:
stateful.set({ foo: "Howdy", bar: 3 }); });
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
Transforms a relative position (between 0 and 1) into a value.
Parameter | Type | Description |
---|---|---|
position | Number | A relative position to transform. |
The transformed value.
Watches a property for changes
Parameter | Type | Description |
---|---|---|
name | String |
Optional Indicates the property to watch. This is optional (the callback may be the only parameter), and if omitted, all the properties will be watched |
callback | Function | The function to execute when the property changes. This will be called after the property has been changed. The callback will be called with the |this| set to the instance, the first argument as the name of the property, the second argument as the old value and the third argument as the new value. |
An object handle for the watch. The unwatch method of this object can be used to discontinue watching this property:
var watchHandle = obj.watch("foo", callback); watchHandle.unwatch(); // callback won't be called now