/*! For license information please see dll.222.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[222],{3410:function(e,a,t){"use strict";t.r(a);var l=t(14),n=t.n(l),r=t(12),u=t.n(r),c=t(15),i=t.n(c),o=t(16),s=t.n(o),f=t(8),d=t.n(f),p=t(0),v=t.n(p),h=t(1),g=t.n(h),m=t(86),b=t(75),y=t(66),R=t(965),E=t(207),C=t(203),q=t(204),V=t(1734),P=t(200),D=t(991);function w(e){var a=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(e){return!1}}();return function(){var t,l=d()(e);if(a){var n=d()(this).constructor;t=Reflect.construct(l,arguments,n)}else t=l.apply(this,arguments);return s()(this,t)}}var A=function(e){i()(t,e);var a=w(t);function t(e){var l;return n()(this,t),(l=a.call(this,e)).state={calculateRelative:!1,calculateCounts:!0,variable:e.defaultValue||e.variables[0],group:null,nDecimalPlaces:3},l}return u()(t,[{key:"generateFrequencyTable",value:function(){var e=this.state,a=e.variable,t=e.group,l=e.calculateCounts,n=e.calculateRelative,r=e.nDecimalPlaces,u=v.a.createElement(V.default,{variable:a,group:t,calculateCounts:l,calculateRelative:n,nDecimalPlaces:r,data:this.props.data});this.props.logAction(P.DATA_EXPLORER_FREQUENCY_TABLE,{variable:a,group:t,calculateRelative:n,calculateCounts:l,nDecimalPlaces:r}),this.props.onCreated(u)}},{key:"render",value:function(){var e=this,a=this.props,t=a.variables,l=a.groupingVariables;return v.a.createElement(m.default,null,v.a.createElement(m.default.Header,{as:"h4"},"Frequency Table",v.a.createElement(D.default,{title:"Frequency Table",content:"A frequency table is a tabular display for either the raw absolute or relative frequencies of a categorical variable's values."})),v.a.createElement(m.default.Body,null,v.a.createElement(C.default,{legend:"Variable:",defaultValue:this.state.variable,options:t,onChange:function(a){e.setState({variable:a})}}),v.a.createElement(C.default,{legend:"Group By:",options:l,clearable:!0,menuPlacement:"top",onChange:function(a){e.setState({group:a})},tooltip:"Generate a frequency table for each category of a chosen grouping variable"}),v.a.createElement(R.default,null,v.a.createElement(y.default,null,v.a.createElement(E.default,{legend:"Counts",defaultValue:this.state.calculateCounts,onChange:function(){e.setState({calculateCounts:!e.state.calculateCounts})}})),v.a.createElement(y.default,null,v.a.createElement(E.default,{legend:"Relative Frequency",defaultValue:this.state.calculateRelative,onChange:function(){e.setState({calculateRelative:!e.state.calculateRelative})}}))),this.state.relativeFreqs?v.a.createElement("p",null,"Report relative frequencies to",v.a.createElement(q.default,{inline:!0,width:50,max:16,min:0,defaultValue:this.state.nDecimalPlaces,onChange:function(a){e.setState({nDecimalPlaces:a})}}),"decimal place(s)."):null,v.a.createElement(b.default,{variant:"primary",block:!0,onClick:this.generateFrequencyTable.bind(this),disabled:!this.state.calculateCounts&&!this.state.calculateRelative},"Generate")))}}]),t}(p.Component);A.defaultProps={defaultValue:null,groupingVariables:null,logAction:function(){}},A.propTypes={data:g.a.object.isRequired,defaultValue:g.a.string,groupingVariables:g.a.array,logAction:g.a.func,onCreated:g.a.func.isRequired,variables:g.a.array.isRequired},a.default=A}}]);