Function
Static Public Summary | ||
public |
Gauge collections type. |
|
public |
drawValueBox(context: Canvas2DContext, options: GenericOptions, value: number | string, x: number, y: number, max: number) Draws value box at given position |
|
public |
formatMajorTickNumber(num: number, options: object): string Formats a number for display on the dial's plate using the majorTicksFormat config option. |
|
public |
linearGradient(context: Canvas2DContext, colorFrom: string, colorTo: string, length: number): CanvasGradient Creates and returns linear gradient canvas object |
|
public |
Pads a given value with leading zeros using the given options |
|
public |
radialPoint(radius: number, angle: number): {x: number, y: number} Calculates and returns radial point coordinates |
|
public |
Transforms degrees to radians |
|
public |
Draws rounded corners rectangle |
|
public |
Look-ups for a proper vendor-specific property and returns its value |
Static Public
public Collection() source
import Collection from 'canvas-gauges/lib/Collection.js'
Gauge collections type.
It is used ES5 declaration here, because babel transpiles inheritance incorrectly in this case.
public drawValueBox(context: Canvas2DContext, options: GenericOptions, value: number | string, x: number, y: number, max: number) source
import {drawValueBox} from 'canvas-gauges/lib/drawings.js'
Draws value box at given position
public formatMajorTickNumber(num: number, options: object): string source
import {formatMajorTickNumber} from 'canvas-gauges/lib/drawings.js'
Formats a number for display on the dial's plate using the majorTicksFormat config option.
public linearGradient(context: Canvas2DContext, colorFrom: string, colorTo: string, length: number): CanvasGradient source
import {linearGradient} from 'canvas-gauges/lib/drawings.js'
Creates and returns linear gradient canvas object
Return:
CanvasGradient |
public padValue(val: number, options: RadialGaugeOptions | {valueInt: number, valueDec: number}): string source
import {padValue} from 'canvas-gauges/lib/drawings.js'
Pads a given value with leading zeros using the given options
Params:
Name | Type | Attribute | Description |
val | number | ||
options | RadialGaugeOptions | {valueInt: number, valueDec: number} |
public radialPoint(radius: number, angle: number): {x: number, y: number} source
import {radialPoint} from 'canvas-gauges/lib/drawings.js'
Calculates and returns radial point coordinates
public radians(degrees: number): number source
import {radians} from 'canvas-gauges/lib/drawings.js'
Transforms degrees to radians
Params:
Name | Type | Attribute | Description |
degrees | number |
public roundRect(context: Canvas2DContext, x: number, y: number, w: number, h: number, r: number) source
import {roundRect} from 'canvas-gauges/lib/drawings.js'
Draws rounded corners rectangle
public vendorize(prop: string, from: HTMLElement | Window | object): * source
import vendorize from 'canvas-gauges/lib/vendorize.js'
Look-ups for a proper vendor-specific property and returns its value
Return:
* |
Example:
var requestAnimationFrame = vendorize('requestAnimationFrame');
// it will refer properly to:
// - window.requestAnimationFrame by default or to
// - window.webkitRequestAnimationFrame or to
// - window.mozRequestAnimationFrame or to
// - window.msRequestAnimationFrame or to
// - window.oRequestAnimationFrame
// depending on the current browser vendor