/*! For license information please see dll.215.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[215],{1483:function(t,e,n){"use strict";n.r(e),e.default=function(t,e){var n=new String(t);return n.categories=e,n}},3434:function(t,e,n){"use strict";n.r(e);var a=n(14),r=n.n(a),i=n(12),u=n.n(i),o=n(10),l=n.n(o),c=n(15),s=n.n(c),f=n(16),d=n.n(f),p=n(8),m=n.n(p),v=n(7),g=n.n(v),h=n(0),R=n.n(h),y=n(1),b=n.n(y),E=n(201),k=n.n(E),q=n(138),w=n.n(q),A=n(1040),_=n.n(A),C=n(203),S=n(207),V=n(204),D=n(368),j=n(1483),z=n(1838),G=n(200),K=n(991);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return d()(this,n)}}var P=function(t){s()(n,t);var e=O(n);function n(t){var a;return r()(this,n),a=e.call(this,t),g()(l()(a),"compute",(function(t,e,n,r){var i=R.a.createElement(z.default,{data:a.props.data,variables:t,K:e,initialization:r,onResult:function(r){if(n){var i=w()(a.props.data,1),u=a.props.categorical.slice(),o=t.map((function(t){return t[0]})).join(""),l=Object(j.default)("kmeans_cluster_"+o,_()(0,e,1).map((function(t){return"Cluster ".concat(t+1)})));i[l]=r.clusters.map((function(t){return"Cluster ".concat(t+1)})),k()(u,l)||u.push(l),a.props.onGenerate(u,i)}}});a.props.logAction(G.DATA_EXPLORER_KMEANS,{variables:t,K:e,attach:n,initialization:r}),a.props.onCreated(i)})),a}return u()(n,[{key:"render",value:function(){var t=this.props,e=t.quantitative,n=t.originalQuantitative;return R.a.createElement(D.default,{title:R.a.createElement("span",null,"kmeans Clustering",R.a.createElement(K.default,{title:"kmeans Clustering",content:"Algorithm to partition observations into k clusters by iteratively assigning them to the cluster with the nearest mean."})),autoStart:!1,onGenerate:this.compute},R.a.createElement(C.default,{legend:"Variables:",multi:!0,defaultValue:n,options:e,closeMenuOnSelect:!1}),R.a.createElement(V.default,{legend:"Number of clusters",min:1,defaultValue:3}),R.a.createElement(S.default,{legend:"Attach clusters to table?",defaultValue:!1}),R.a.createElement(C.default,{legend:"Initialization method",options:["kmeans++","random","mostDistant"],defaultValue:"kmeans++"}))}}]),n}(h.Component);P.defaultProps={logAction:function(){}},P.propTypes={categorical:b.a.array.isRequired,quantitative:b.a.array.isRequired,originalQuantitative:b.a.array.isRequired,data:b.a.object.isRequired,logAction:b.a.func,onGenerate:b.a.func.isRequired,onCreated:b.a.func.isRequired},e.default=P}}]);