Skip to content

Releases: keen/keen-js

v3.2.5 Bug Fixes + keen-query.js

24 Jun 04:03
Compare
Choose a tag to compare
  • New keen-query.js distribution is available for query-only functionality (#272 by andrehjr)
  • Fixed bug preventing synchronous XHR execution (#290)
  • URL-encode event collection string for happy API URLs (#266 by nmalzieu)
  • Miscellaneous documentation updates and improvements

CDN:
https://d26b395fwzu5fz.cloudfront.net/3.2.5/keen.min.js
https://d26b395fwzu5fz.cloudfront.net/3.2.5/keen-tracker.min.js
https://d26b395fwzu5fz.cloudfront.net/3.2.5/keen-query.min.js

Data transform bug fixes and minor Visualization improvements

12 Mar 23:47
Compare
Choose a tag to compare
  • Fixed a bug in Dataset access methods for rows and columns (select, insert, update, delete) that caused string selections beginning with a number to fail (#255)
  • Fixed a bug introduced in v3.2.3 that prevented labels from updating properly when new query responses were parsed by a Dataviz instance (#252)
  • Spinner now uses a default height when no height is provided for a Dataviz instance. This can be configured by overriding Keen.Spinner.defaults.height (#244)
  • Updated ChartJS to latest version (v1.0.2) and now apply height/width to constructed <canvas></canvas> elements (#243)
  • AWC cache life extended to 1 full year

Dataviz improvements and bug fixes

14 Feb 00:43
Compare
Choose a tag to compare

CDN:
Full library: http://d26b395fwzu5fz.cloudfront.net/3.2.3/keen.min.js
Tracking-only: http://d26b395fwzu5fz.cloudfront.net/3.2.3/keen-tracker.min.js

NPM: https://www.npmjs.com/package/keen-js

  • Fixes #231 and #233: add a .stacked(boolean) method for dataviz, and configure for C3.js and Google Charts adapters
  • Fixes #234: less cryptic message for empty results, which is caused when receiving an interval+group_by query resopnse where every result value array is empty. So long, "Data column(s) for axis #0 cannot be of type string"
  • Fixes #236: add support for select_unique responses (table)

Fix packaging for browserify

29 Jan 22:49
Compare
Choose a tag to compare

Minor bug fixes

10 Jan 00:23
Compare
Choose a tag to compare

Merged #214 and fixed #215

keen-js learns to node.js

05 Jan 22:19
Compare
Choose a tag to compare

This library now runs in the browser and the server, and can be installed via npm:

$ npm install keen-js

http://d26b395fwzu5fz.cloudfront.net/3.2.0/keen.min.js
http://d26b395fwzu5fz.cloudfront.net/3.2.0/keen.js

New to keen-js

  • client.addEvents - record multiple events with a single API call (#108)
  • client.addEvent("collection", data, null, false) - fourth argument of false invokes a synchronous XHR call, which is useful for sending events before a page unloads (#188)
  • client.get - execute a generic GET request (New approach to #139)
  • client.put - execute a generic PUT request
  • client.post - execute a generic POST request
  • client.del - execute a generic DELETE request (server-only)
  • Keen.utils.encryptScopedKeys - create a new scoped key (server-only)
  • Keen.utils.decryptScopedKeys - decrypt an existing scoped key (server-only)
  • Keen.noConflict – avoid version collisions (#159)
  • Keen.Request object supports timeouts (explained below), and must be explicitly run with .refresh() (#209, wip)
  • "Metric" visualization shows raw value via the HTML element's title attribute (#206, wip)
var req = new Keen.Request(client, [query1, query2], callback)
  .timeout(300*1000)
  .refresh();

Keen.Visualization has been removed

This object doesn't add any value, and only creates more surface-area for new users to reason about.

Check out Keen.Dataviz for building customized visualizations. The docs have been updated to reflect this object's departure, and .run still works as expected.

Breaking change to all callback signatures

All callbacks now use the single function (err, res) callback pattern common to node.js. This was done to make implementations portable between the browser and the server.

This:

client.run(query, function(res){
  // handle response
}, function(err){
  // handle error
});

Now looks like this:

client.run(query, function(err, res){
  // if (err) handle err
  // handle response
});

Build/test-related

Visualization Reboot: v3.1.0

04 Nov 22:52
Compare
Choose a tag to compare

CDN Versions:
Full library: http://d26b395fwzu5fz.cloudfront.net/3.1.0/keen.min.js
Tracking-only: http://d26b395fwzu5fz.cloudfront.net/3.1.0/keen-tracker.min.js

We have completely rewritten the internals for Keen.Visualization, resulting in two brand new tools for creating dynamic, highly-customizable data visualizations.

Check out all these cool examples

Dataviz

  • Composable interface for on-the-fly modifications of pretty much everything
  • Improved memory management, smaller footprint, better performance
  • Charts render a million times faster (not benchmarked, but srsly, it's silly)
  • Two new chart library adapters: Chart.js and C3.js. Either can be configured as the default
  • Expanded color palette with 18 light+dark variants: now at 27 colors!
  • Explicit methods for handling different types of data
  • Explicit methods for updating charts, with full control of "loading" state spinner
  • Display custom error messages
  • Determine if intervals should be indexed by "timeframe.start" or "timeframe.end"
  • Sort both groups and intervals, ascending or descending

Dataset

Dataset is an abstraction layer that handles data inside of Keen.Dataviz. This tool unpacks arbitrary JSON into a 2-dimensional array (a table), and offers a set of simple but powerful tools for modifying, filtering and sorting that data. Keen.Dataviz charting adapters all know how to unpack this data format into their own crazy needs.

I'll build out a series of demos that showcase what this tool can do, but here are a few examples that you can accomplish with a few (like one or two) lines of javascript:

  • For a group_by + interval query:
    • Insert a new series that shows the median (sum/min/max/etc) value of all data points at each interval
    • Sort groups bases the those same results (sort by sum of each series)
  • Remove all records/series that fall below a given threshold (only show the top N results)
  • Multiply all results by 100, or any number
  • Join multiple queries into one chart

The big idea here is that it takes something that once took dozens or hundreds of lines of loopy JS magic and turns it into a quick, repeatable, easily-customizable use of a documented feature.

Test Coverage

We added over 150 new tests to cover these two classes, and have expanded our test coverage to include iOS (6-7.1), Android (4.1-4.4), and Chrome/Firefox Beta builds.

Optimizations

Better request handling for sending and querying events. Our default requestType is JSONP, but GET requests can bump up against URL limits in certain browsers (IE) or our own Service. In that scenario, the event is most likely lost. But now, if an event payload exceeds a reasonable URL length, the library switches back to XHR/POST if possible. We've also added more robust support for XHR in older versions of IE.

Refactored our loading script, makes it easy to stay up to date with the latest version. Now, when users see the JS blob for embedding our library in the page, it'll look like this:

!function(i,o){i("Keen","//d26b395fwzu5fz.cloudfront.net/3.1.0/keen.min.js",o)}(function(a,b,c){var d,e,f;c["_"+a]={},c[a]=function(b){c["_"+a].clients=c["_"+a].clients||{},c["_"+a].clients[b.projectId]=this,this._config=b},c[a].ready=function(b){c["_"+a].ready=c["_"+a].ready||[],c["_"+a].ready.push(b)},d=["addEvent","setGlobalProperties","trackExternalLink","on"];for(var g=0;g<d.length;g++){var h=d[g],i=function(a){return function(){return this["_"+a]=this["_"+a]||[],this["_"+a].push(arguments),this}};c[a].prototype[h]=i(h)}e=document.createElement("script"),e.async=!0,e.src=b,f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(e,f)},this);

Client configuration

Internals have changed: Client instances have an internal hash that contains properties, like projectId and readKey. This internal hash was previously called client, but has been renamed config. Reason being, "client" has become a popular name for new instances, resulting in strange references like client.client.projectId.

You can now also reference projectId and keys w/ a set of getter-setter methods, like so:

var client = new Keen({
  projectId: "123",
  readKey: "123456789"
});
client.projectId(); // returns "123"
client.readKey(); // returns "123456789"

More goodies!

Disable sending of events by setting Keen.enabled = false;. This is handy for disabling event recording from local or development environments.

Enable helpful messages and error logs in your browser console by setting Keen.debug = true;.

Visualization Reboot: v3.1.0-beta

13 Oct 05:35
Compare
Choose a tag to compare
Pre-release

Important: this beta release is constantly being re-published with bug fixes and updates, and the underlying interface elements described below may change without warning. If you're ok with that, let's have some fun!

Report bugs or discuss feature ideas here: #175 (one issue, no dups please)

CDN Versions:
Full library: http://d26b395fwzu5fz.cloudfront.net/3.1.0-beta/keen.min.js
Tracking-only: http://d26b395fwzu5fz.cloudfront.net/3.1.0-beta/keen-tracker.min.js

Improved request handling

02 Oct 19:55
Compare
Choose a tag to compare

This update greatly improves request handling for sending and querying events.

Our default requestType is JSONP, but GET requests can bump up against URL limits in certain browsers (IE) or our own Service. Now, if JSONP is selected and the produced URL exceeds a given threshold, the library attempts to use XHR/POST if supported.

We have also added more robust support for XHR in older versions of IE, and expanded test coverage to include iOS (6-7.1), Android (4.1-4.4), and Chrome/Firefox Beta builds.

Improved memory management for Keen.Visualization

18 Aug 20:23
Compare
Choose a tag to compare

Called .remove() or .trigger("remove") on a chart for proper disposal.