text: /*! smeans - v0.1.9 - 2014-12-18
  * https://github.com/c0bra/smeans.js
  * Copyright (c) 2014 Brian Hann; Licensed MIT */
  !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.Smeans=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){"use strict";function c(){}function d(a,b){if(!Array.isArray(a))throw new Error("Elements argument is not an array");if(0===a.length)return[];b=b?b:{k:null,clusters:null};for(var d,e,f,g,h,i=0,j=[],d=1,k=a.length;k>d;d++)h=c.distance(a[d],a[d-1]),i+=h,j.push(h);for(var l=i/j.length,m=0,d=0,n=j.length;n>d;d++)h=j[d],m+=Math.pow(h-l,2);var o=m/j.length,p=Math.sqrt(o),q=!0,r=b.k?b.k:1,s=p,t={};if(b.clusters){t=b.clusters;for(var e in t){var u=t[e];u.elements={}}}if(0===Object.keys(t).length)for(var d=1;r>=d;d++){var v=a[Math.floor(Math.random()*a.length)];t[d]={i:d,centroid:v,elements:{}}}for(;q;){for(var w=!1,f=0,k=a.length;k>f;f++){g=a[f];var x=null,y=null;for(var e in t){u=t[e];var z=Math.abs(c.distance(g,u.centroid));(null===x||x>z)&&(x=z,y=u)}if(s>x||0===x)y.elements[g]=g;else{var A=0;for(var B in t){var C=t[B];A<C.i&&(A=C.i)}A++,t[A]={i:A,centroid:g,elements:{}},t[A].elements[g]=g}}var D=!1;for(var e in t){u=t[e];var E=Object.keys(u.elements);if(0!==E.length){for(var F=[],d=0,G=E.length;G>d;d++){var H=E[d];F.push(u.elements[H])}var I=c.centroid(F);0!==c.distance(I,u.centroid)&&(u.centroid=I,D=!0)}else delete t[e]}D||w||(q=!1)}return t}function e(a,b){for(var c=0,d=0,e=a.length;e>d;d++){var f=a[d]-b[d];c+=f*f}return Math.sqrt(c)}function f(a,b){for(var c,d=1/0,g=0,h=b.length;h>g;g++){var i=b[g],j=e(a,i);f>j&&(d=j,c=i)}return c}function g(a){for(var b=a[0].length,c=a.length,d=[],e=0;b>e;e++)d[e]=d[e]=0;for(var f=0;c>f;f++)for(var e=0;b>e;e++)d[e]+=a[f][e];for(var g=[],e=0;b>e;e++)g[e]=d[e]/c;return g}c.cluster=d,c.distance=e,c.centroid=g,c.closest=f,b.exports=c},{}]},{},[1])(1)});