How to use the keen-tracking.extendLibrary function in keen-tracking

To help you get started, we’ve selected a few keen-tracking examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keen / keen-js / lib / index.js View on Github external
import KeenBase from 'keen-tracking';
import KeenAnalysis from 'keen-analysis';
import { Dataviz } from 'keen-dataviz';

KeenBase.extendLibrary(KeenBase, KeenAnalysis);
KeenBase.version = require('../package.json').version;

KeenBase.prototype.draw = function(query, el, attributes){
  var chart = Dataviz()
    .attributes(attributes)
    .el(el)
    .prepare();

  this.run(query, function(err, res){
    if (err) {
      chart.message(err.message);
    }
    else {
      chart.data(res).render();
    }
  });

keen-tracking

Track events - custom user actions, clicks, pageviews, purchases.

MIT
Latest version published 4 years ago

Package Health Score

57 / 100
Full package analysis