🚀 Welcome to IAQJS
Installation
NPM
npm install iaqjs
import IAQ from 'iaqjs'
Javascript
<script src="/path/to/js">
<script>
let iaq = new window.IAQ();
</script>
Usage
var AQ = new IAQ("clientKey")
- Add widget or measurements to DOM: Call the method generate by passing a DOM and options Object
AQ.generate(domElement, options)
interface Options {
measurementIds?: Array<string>,
widgetId?: string,
autoUpdate?: Boolean,
theme?: Theme
size?: Size
}
interface Theme {
scoreColor: string,
backgroundColor: string,
iconColor: string,
unitColor: string,
}
- Data: You can also retrieve data by calling the method data, it takes options (See interface options) as an argument
AQ.data(options).then(function(result) {
console.log(result)
})
interface Measurement {
type: string,
curVal?: string,
curScore: string,
icon: string,
unit?: string,
name?: string,
toUse?: string
}
interface Data {
name: String,
measurements: Array<Measurement>
}