BaseGauge
Extends:
Direct Subclass:
Basic abstract BaseGauge class implementing common functionality for different type of gauges.
It should not be instantiated directly but must be extended by a final gauge implementation.
Example:
class MyCoolGauge extends BaseGauge {
// theses methods below MUST be implemented:
constructor(options) {
// ... do something with options
super(options);
// ... implement anything else
}
draw() {
// ... some implementation here
return this;
}
}
Static Member Summary
| Static Public Members | ||
| public static get |
Returns gauges version string |
|
Static Method Summary
| Static Public Methods | ||
| public static |
ensureValue(value: *, min: number): number Ensures value is proper number |
|
| public static |
fromElement(element: HTMLElement) Initializes gauge from a given HTML element (given element should be valid HTML canvas gauge definition) |
|
| public static |
initialize(type: string, options: GenericOptions): * Inject given gauge object into DOM |
|
| public static |
Corrects javascript modulus bug |
|
| Static Protected Methods | ||
| protected static |
Updates gauge options |
|
Constructor Summary
| Public Constructor | ||
| public abstract |
constructor(options: GenericOptions) |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
True if gauge has been drawn for the first time, false otherwise. |
|
| public |
Gauge options |
|
| public |
Gauge type class |
|
| public set |
Sets new value for this gauge. |
|
| public get |
Returns current value of the gauge |
|
| public |
Gauges version string |
|
Method Summary
| Public Methods | ||
| public |
destroy() Performs destruction of this object properly |
|
| public abstract |
Triggering gauge render on a canvas. |
|
| public |
update(options: RadialGaugeOptions): BaseGauge Updates gauge configuration options at runtime and redraws the gauge |
|
Static Public Members
Static Public Methods
public static ensureValue(value: *, min: number): number source
Ensures value is proper number
Params:
| Name | Type | Attribute | Description |
| value | * | ||
| min | number |
public static fromElement(element: HTMLElement) source
Initializes gauge from a given HTML element (given element should be valid HTML canvas gauge definition)
Params:
| Name | Type | Attribute | Description |
| element | HTMLElement |
public static initialize(type: string, options: GenericOptions): * source
Inject given gauge object into DOM
Params:
| Name | Type | Attribute | Description |
| type | string | ||
| options | GenericOptions |
Return:
| * |
Static Protected Methods
Public Constructors
public abstract constructor(options: GenericOptions) source
Params:
| Name | Type | Attribute | Description |
| options | GenericOptions |
Public Members
public canvas: SmartCanvas source
public initialized: boolean source
True if gauge has been drawn for the first time, false otherwise.
Public Methods
public update(options: RadialGaugeOptions): BaseGauge source
Updates gauge configuration options at runtime and redraws the gauge
Params:
| Name | Type | Attribute | Description |
| options | RadialGaugeOptions |