Some values really need to be shown on a logarithmic rather than linear scale eg. luminosity, depth, signal strength. There are also some which work better on a squareroot scale eg. depth, windspeed.
where type can be linear, logarithmic, squareroot or power with a default of linear if not present. See also #406 where this layout is suggested for gauge limits but not implemented at present. If power is specified then an additional property must be present to define the power:
Note that a power of 0.5 is equivalent to squareroot, and a power of 1 is equivalent to linear.
In using these scales the type just defines the function which is applied to all values in order to calculate % deflection of the pointer/needle.
For linear: % deflection = (V - L) / (U - L)
For logarithmic: % deflection = (log(V) - log(L)) / (log(U) - log(L))
For squareroot: % deflection = (√V - √L) / (√U - √L)
For power: % deflection = (Vᴾ - Lᴾ) / (Uᴾ - Lᴾ)
Where: V = value, L = lower bound of the gauge, U = upper bound of the gauge and P = power
Note that on a logarithmic scale neither L nor U can be zero.
I think you've covered everything we should cover at this stage. I browsed through https://github.com/d3/d3-scale, but I don't think we need to cover all the different cases that a graphing library module needs.
Some values really need to be shown on a logarithmic rather than linear scale eg. luminosity, depth, signal strength. There are also some which work better on a squareroot scale eg. depth, windspeed.
Suggest within meta we add:
where type can be linear, logarithmic, squareroot or power with a default of linear if not present. See also #406 where this layout is suggested for gauge limits but not implemented at present. If power is specified then an additional property must be present to define the power:
Note that a power of 0.5 is equivalent to squareroot, and a power of 1 is equivalent to linear.
In using these scales the type just defines the function which is applied to all values in order to calculate % deflection of the pointer/needle.
For linear: % deflection = (V - L) / (U - L) For logarithmic: % deflection = (log(V) - log(L)) / (log(U) - log(L)) For squareroot: % deflection = (√V - √L) / (√U - √L) For power: % deflection = (Vᴾ - Lᴾ) / (Uᴾ - Lᴾ) Where: V = value, L = lower bound of the gauge, U = upper bound of the gauge and P = power
Note that on a logarithmic scale neither L nor U can be zero.
Are there any others?