Class: QgsGenericNumericTransformer¶
QgsPropertyTransformer subclass for scaling an input numeric
value into an output numeric value.
Class Hierarchy¶
Base classes¶
Abstract base class for objects which transform the calculated value of a property. Possible uses include transformers which map a value into a scaled size or color from a gradient.  | 
Methods
Returns the exponent for an exponential expression.  | 
|
Returns the maximum calculated size.  | 
|
Returns the minimum calculated size.  | 
|
Returns the size value when an expression evaluates to NULL.  | 
|
Sets the exponent for an exponential expression.  | 
|
Sets the maximum calculated size.  | 
|
Sets the minimum calculated size.  | 
|
Sets the size value for when an expression evaluates to NULL.  | 
|
Calculates the size corresponding to a specific input value.  | 
Static Methods
Attempts to parse an expression into a corresponding   | 
- class qgis.core.QgsGenericNumericTransformer[source]¶
 Bases:
QgsPropertyTransformer- __init__(minValue: float = 0, maxValue: float = 1, minOutput: float = 0, maxOutput: float = 1, nullOutput: float = 0, exponent: float = 1)
 Constructor for QgsGenericNumericTransformer.
- Parameters:
 minValue (float = 0) – minimum expected input value
maxValue (float = 1) – maximum expected input value
minOutput (float = 0) – minimum value to return
maxOutput (float = 1) – maximum value to return
nullOutput (float = 0) – value to return for null inputs
exponent (float = 1) – optional exponential for non-linear scaling
- __init__(a0: QgsGenericNumericTransformer)
 - Parameters:
 
- exponent(self) float[source]¶
 Returns the exponent for an exponential expression.
See also
- Return type:
 float
- static fromExpression(expression: str | None)[source]¶
 Attempts to parse an expression into a corresponding
QgsSizeScaleTransformer.- Parameters:
 expression (Optional[str]) -> (Optional[QgsGenericNumericTransformer]) – expression to parse
- Returns:
 corresponding
QgsSizeScaleTransformer, orNoneif expression could not be parsed to a size scale transformer.baseExpression: the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
fieldName: a field name which is used to calculate the input to the property transformer. This will be set to an empty string if an expression is the transformer input.
- maxOutputValue(self) float[source]¶
 Returns the maximum calculated size.
See also
- Return type:
 float
- minOutputValue(self) float[source]¶
 Returns the minimum calculated size.
See also
See also
- Return type:
 float
- nullOutputValue(self) float[source]¶
 Returns the size value when an expression evaluates to NULL.
See also
- Return type:
 float
- setExponent(self, exponent: float)[source]¶
 Sets the exponent for an exponential expression.
- Parameters:
 exponent (float) – exponent
See also
- setMaxOutputValue(self, size: float)[source]¶
 Sets the maximum calculated size.
- Parameters:
 size (float) – maximum size
See also
See also
- setMinOutputValue(self, size: float)[source]¶
 Sets the minimum calculated size.
- Parameters:
 size (float) – minimum size
See also
See also