Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iaqjs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iaqjs

HawkenAQ IAQ Widget

  • 0.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

🚀 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

  • Initialize
    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) // Check Options interface
    interface Options {
        measurementIds?: Array<string>,
        widgetId?: string,
        autoUpdate?: Boolean, // Updates the widget every 5 minutes, Default True
        theme?: Theme // Provide a theme object, Default theme provided
        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
    // Promises and async/await supported
    AQ.data(options).then(function(result) {
        // result is a data Object. Check Reference below
        console.log(result)
    })

    interface Measurement {
        type: string,
        curVal?: string,
        curScore: string,
        icon: string,
        unit?: string,
        name?: string,
        toUse?: string // some measurement only have curScore, toUse denotes what to display
    }
    interface Data {
        name: String,
        measurements: Array<Measurement>
    }

Keywords

FAQs

Package last updated on 21 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc