From d27d6dc4a3535d54f228aee572f3c4367a4b18f7 Mon Sep 17 00:00:00 2001 From: TJ Banghart Date: Sun, 26 Sep 2021 15:29:30 -0700 Subject: [PATCH] Fix number config error --- histogram.js | 2 +- src/common/options.js | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/histogram.js b/histogram.js index eacbaac..93b5a7f 100644 --- a/histogram.js +++ b/histogram.js @@ -47,4 +47,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function PI(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}var BI,LI='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box; }\n .vega-embed.has-actions {\n padding-right: 38px; }\n .vega-embed details:not([open]) > :not(summary) {\n display: none !important; }\n .vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px; }\n .vega-embed summary::-webkit-details-marker {\n display: none; }\n .vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset; }\n .vega-embed summary svg {\n width: 14px;\n height: 14px; }\n .vega-embed details[open] summary {\n opacity: 0.7; }\n .vega-embed:hover summary,\n .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease; }\n .vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left; }\n .vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none; }\n .vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black; }\n .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute; }\n .vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9; }\n .vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff; }\n .vega-embed .chart-wrapper {\n width: 100%;\n height: 100%; }\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: scroll;\n padding-right: 14px; }\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6); }\n to {\n opacity: 1;\n transform: scale(1); } }\n';function II(t,...e){for(const n of e)UI(t,n);return t}function UI(t,e){for(const n of Object.keys(e))Object(Z.kb)(t,n,e[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});const qI=b;let WI=y;const YI="undefined"!=typeof window?window:void 0;void 0===WI&&(null===(BI=null==YI?void 0:YI.vl)||void 0===BI?void 0:BI.compile)&&(WI=YI.vl);const HI={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},GI={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},VI={vega:"Vega","vega-lite":"Vega-Lite"},XI={vega:qI.version,"vega-lite":WI?WI.version:"not available"},JI={vega:t=>t,"vega-lite":(t,e)=>WI.compile(t,{config:e}).spec};function KI(t,e,n,r){const i=`${e}
`,o=`
${n}`,a=window.open("");a.document.write(i+t+o),a.document.title=VI[r]+" JSON Source"}function ZI(t,e){var n;return PI(this,void 0,void 0,(function*(){const r=Object(Z.I)(t.config)?JSON.parse(yield e.load(t.config)):null!==(n=t.config)&&void 0!==n?n:{},i=Object(Z.I)(t.patch)?JSON.parse(yield e.load(t.patch)):t.patch;return Object.assign(Object.assign(Object.assign({},t),i?{patch:i}:{}),r?{config:r}:{})}))}var QI=function(t,e,n={}){var r,i,o;return PI(this,void 0,void 0,(function*(){const a=(s=n.loader)&&"load"in s?n.loader:qI.loader(n.loader);var s;const u=Object(Z.I)(e)?JSON.parse(yield a.load(e)):e,l=yield ZI(null!==(r=u.usermeta&&u.usermeta.embedOptions)&&void 0!==r?r:{},a),c=yield ZI(n,a),f=Object.assign(Object.assign({},II(c,l)),{config:Object(Z.O)(null!==(i=c.config)&&void 0!==i?i:{},null!==(o=l.config)&&void 0!==o?o:{})});return yield function(t,e,n={},r){var i,o,a,s,u,l;return PI(this,void 0,void 0,(function*(){const c=n.theme?Object(Z.O)(v[n.theme],null!==(i=n.config)&&void 0!==i?i:{}):n.config,f=Object(Z.C)(n.actions)?n.actions:II({},HI,null!==(o=n.actions)&&void 0!==o?o:{}),d=Object.assign(Object.assign({},GI),n.i18n),h=null!==(a=n.renderer)&&void 0!==a?a:"canvas",p=null!==(s=n.logLevel)&&void 0!==s?s:qI.Warn,g=null!==(u=n.downloadFileName)&&void 0!==u?u:"visualization",m="string"==typeof t?document.querySelector(t):t;if(!m)throw new Error(t+" does not exist");if(!1!==n.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:r}=function(t){var e;const n=t.getRootNode?t.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(e=document.head)&&void 0!==e?e:document.body}}(m);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?LI.toString():n.defaultStyle,r.appendChild(e)}}const b=function(t,e){var n;if(t.$schema){const r=yI(t.$schema);e&&e!==r.library&&console.warn(`The given visualization spec is written in ${VI[r.library]}, but mode argument sets ${null!==(n=VI[e])&&void 0!==n?n:e}.`);const i=r.library;return Object(K.satisfies)(XI[i],"^"+r.version.slice(1))||console.warn(`The input spec uses ${VI[i]} ${r.version}, but the current version of ${VI[i]} is v${XI[i]}.`),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!=e?e:"vega"}(e,n.mode);let y=JI[b](e,c);if("vega-lite"===b&&y.$schema){const t=yI(y.$schema);Object(K.satisfies)(XI.vega,"^"+t.version.slice(1))||console.warn(`The compiled spec uses Vega ${t.version}, but current version is v${XI.vega}.`)}m.classList.add("vega-embed"),f&&m.classList.add("has-actions"),m.innerHTML="";let x=m;if(f){const t=document.createElement("div");t.classList.add("chart-wrapper"),m.appendChild(t),x=t}const _=n.patch;_&&(y=_ instanceof Function?_(y):N(y,_,!0,!1).newDocument),n.formatLocale&&qI.formatLocale(n.formatLocale),n.timeFormatLocale&&qI.timeFormatLocale(n.timeFormatLocale);const{ast:O}=n,w=qI.parse(y,"vega-lite"===b?{}:c,{ast:O}),j=new qI.View(w,Object.assign({loader:r,logLevel:p,renderer:h},O?{expr:qI.expressionInterpreter}:{}));if(!1!==n.tooltip){let t;t="function"==typeof n.tooltip?n.tooltip:new RI(!0===n.tooltip?{}:n.tooltip).call,j.tooltip(t)}let k,{hover:E}=n;if(void 0===E&&(E="vega"===b),E){const{hoverSet:t,updateSet:e}="boolean"==typeof E?{}:E;j.hover(t,e)}if(n&&(null!=n.width&&j.width(n.width),null!=n.height&&j.height(n.height),null!=n.padding&&j.padding(n.padding)),yield j.initialize(x).runAsync(),!1!==f){let t=m;if(!1!==n.defaultStyle){const e=document.createElement("details");e.title=d.CLICK_TO_VIEW_ACTIONS,m.append(e),t=e;const n=document.createElement("summary");n.innerHTML='\n\n \n \n \n',e.append(n),k=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",k)}const r=document.createElement("div");if(t.append(r),r.classList.add("vega-actions"),!0===f||!1!==f.export)for(const t of["svg","png"])if(!0===f||!0===f.export||f.export[t]){const e=d[t.toUpperCase()+"_ACTION"],i=document.createElement("a");i.text=e,i.href="#",i.target="_blank",i.download=`${g}.${t}`,i.addEventListener("mousedown",(function(e){return PI(this,void 0,void 0,(function*(){e.preventDefault();const r=yield j.toImageURL(t,n.scaleFactor);this.href=r}))})),r.append(i)}if(!0===f||!1!==f.source){const t=document.createElement("a");t.text=d.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){var r,i;KI(J()(e),null!==(r=n.sourceHeader)&&void 0!==r?r:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"",b),t.preventDefault()})),r.append(t)}if("vega-lite"===b&&(!0===f||!1!==f.compiled)){const t=document.createElement("a");t.text=d.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){var e,r;KI(J()(y),null!==(e=n.sourceHeader)&&void 0!==e?e:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"","vega"),t.preventDefault()})),r.append(t)}if(!0===f||!1!==f.editor){const t=null!==(l=n.editorUrl)&&void 0!==l?l:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(t,e,n){const r=t.open(e),{origin:i}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===r&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(r.postMessage(n,i),setTimeout(t,250),o-=1)}),250)}(window,t,{config:c,mode:b,renderer:h,spec:J()(e)}),n.preventDefault()})),r.append(i)}}return{view:j,spec:e,vgSpec:y,finalize:function(){k&&document.removeEventListener("click",k),j.finalize()}}}))}(t,u,f,a)}))},tU=n(2),eU=n(7),nU=n.n(eU);const rU={bin_type:{label:"Binning Type",section:" Values",type:"string",order:2,display:"select",values:[{"Max Bins":"bins"},{Steps:"steps"},{Breakpoints:"breakpoints"}],default:"bins"},bin_style:{label:"Chart Type",section:" Values",type:"string",order:1,display:"select",default:"simple_hist",values:[{"Simple Histogram":"simple_hist"},{"Scatter Histogram":"binned_hist"}]},winsorization:{label:"Limit Outliers (Winsorize)",section:" Values",type:"boolean",order:7,default:!1},color_col:{type:"string",section:" Style",label:"Color",display:"color",display_size:"half",default:"#1A73E8",order:3},color_on_hover:{type:"string",section:" Style",label:"Color On Hover",display:"color",display_size:"half",default:"#338bff",order:4},x_axis_label_divider:{label:"X Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:6},x_axis_override:{label:"X Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:7},x_grids:{label:"X Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",default:!0},x_axis_title_font_size:{label:"X Axis Title Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:9},x_axis_label_font_size:{label:"X Axis Label Size",section:"Labels",type:"number",display:"text",default:12,display_size:"half",order:10},x_axis_label_angle:{label:"X Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:11,min:0,max:90,step:1,display_size:"half"},x_label_separation:{label:"X Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:12,min:1,max:100,step:1,display_size:"half"},y_axis_label_divider:{label:"Y Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:13},y_axis_override:{label:"Y Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:14},y_grids:{label:"Y Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",order:15,default:!0},y_axis_title_font_size:{label:"Y Axis Title Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:16},y_axis_label_font_size:{label:"Y Axis Label Size",section:"Labels",type:"number",display:"text",default:12,display_size:"half",order:17},y_axis_label_angle:{label:"Y Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:18,min:0,max:90,step:1,display_size:"half"},y_label_separation:{label:"Y Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:19,min:1,max:100,step:1,display_size:"half"},x_axis_value_format:{label:"X Axis Value Format",order:200,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"}};function iU(t,e,n){return[{title:""!==e?e:t.title,bin:n,field:n.binned?"label":t.lookerName.replace(".","_"),type:n.binned?"ordinal":"quantitative"},{title:"Count of Records",aggregate:"count",type:"quantitative",...!n.binned&&{aggregate:"count"},...n.binned&&{field:"count_x"}}]}var oU=function({dataProperties:t,config:e,maxX:n,width:r}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"X_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},height:60,width:r,encoding:{x:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{grid:e.x_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_x"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.y_grids}},tooltip:iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}};var aU=({dataProperties:t,config:e,maxY:n,height:r})=>({selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"Y_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},width:60,height:r,encoding:{y:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{grid:e.y_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},x:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_y"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.x_grids,title:null}},tooltip:iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}),sU=n(6);var uU=function({dataProperties:t,config:e,maxX:n,maxY:r,height:i,width:o,valFormatX:a,valFormatY:s}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"HEATMAP",mark:{zindex:-1,type:"rect",invalid:null,...e.heatmap_off&&{cursor:"pointer"},...!e.heatmap_off&&{fillOpacity:0}},height:i,width:o,encoding:{x:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{name:"xAxis",title:""===e.x_axis_override?t[e.x].title:e.x_axis_override,titleFontSize:e.x_axis_title_font_size,format:"d",labelFontSize:e.x_axis_label_font_size,grid:e.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.x_label_separation,labelOverlap:!0,labelColor:"#696969",labelAngle:-1*e.x_axis_label_angle,titleColor:"#696969",titlePadding:25+a.length}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{title:""===e.y_axis_override?t[e.y].title:e.y_axis_override,titleFontSize:e.y_axis_title_font_size,format:"d",labelFontSize:e.y_axis_label_font_size,labelAngle:-1*e.y_axis_label_angle,grid:e.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25+3*s.length}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},color:{aggregate:"count",type:"quantitative",legend:!!e.heatmap_off&&{orient:e.legend_orient,labelFontSize:e.legend_size,titleFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}},opacity:{condition:{selection:"highlight",value:1},value:e.heatmap_opacity},...e.heatmap_off&&{tooltip:(()=>{let i=iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}).concat(iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}));return i=i.concat(i.splice(1,1)),i})()}}}};var lU=function({config:t,dataProperties:e,mainDimensions:n}){return{mark:{type:"text",align:"left",angle:t.point_labels_angle,dx:t.point_labels_x_offset,dy:t.point_labels_y_offset,fontSize:t.point_labels_font_size},encoding:{x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"},text:{field:e._filterlabels?"_filterlabels":n[0]}}}};function cU({config:t,tooltipFields:e,dataProperties:n,width:r,height:i,mainDimensions:o}){const a=function({config:t,tooltipFields:e,width:n,height:r}){return{name:"SCATTERPLOT",mark:{color:t.color_col,cursor:"pointer",type:"circle",opacity:t.point_opacity,zindex:2,size:100},height:r,width:n,encoding:{tooltip:e,x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"}}}}({config:t,dataProperties:n,tooltipFields:e,width:r,height:i});return t.layer_points&&""!==t.size&&void 0!==t.size&&function(t,e,n){t.encoding.size={field:e.size,type:"quantitative",title:n[e.size].title,legend:{orient:e.legend_orient,format:"d",labelFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n),t.layer_points&&void 0!==o[1]&&function(t,e,n,r){t.encoding.color={scale:{scheme:e.point_group_colors},field:r[1],legend:{type:"symbol",offset:e.y_hist?85:10,title:n[r[1]].title,type:"symbol",orient:e.legend_orient,labelFontSize:e.legend_size,titleFontWeight:"normal",titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n,o),a}var fU=n(9);var dU=function({axis:t,config:e,data:n,min:r,max:i}){const o=Object(fU.a)(e[`reference_line_${t}_p`],e[t],n);return{name:"refLine"+t,mark:{type:"rule"},encoding:{x:{datum:"x"===t?o:r},y:{datum:"x"===t?r:o},x2:{datum:"x"===t?o:i},y2:{datum:"x"===t?i:o},color:{value:"red"},size:{value:e[`reference_line_${t}_width`]},strokeDash:{value:[4,4]}}}};var hU=function({layers:t,data:e,config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s,minX:u,minY:l,maxX:c,maxY:f}){n.layer_points&&t.push(cU({config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s})),n.layer_points&&n.point_labels&&t.push(lU({config:n,dataProperties:i,mainDimensions:s})),n.reference_line_x&&t.push(dU({axis:"x",min:l,max:f,config:n,data:e})),n.reference_line_y&&t.push(dU({axis:"y",min:u,max:c,config:n,data:e}))};var pU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{spacing:15,bounds:"flush",hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var gU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})],config:{range:{heatmap:{scheme:n.color_scheme}}}};return hU({layers:h.layer,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var mU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var bU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var yU=function(t){return t.config.x_hist&&t.config.y_hist?pU(t):t.config.x_hist?mU(t):t.config.y_hist?bU(t):gU(t)};function vU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=e.clientWidth,f=e.clientHeight,d=Math.max(...l.map(t=>t[n.x])),h=Math.min(...l.map(t=>t[n.x])),p=Math.max(...l.map(t=>t[n.y])),g=Math.min(...l.map(t=>t[n.y])),m=r.fields.dimension_like.map(t=>t.name.replace(".","_")),b=function(t,e,n,r,i,o){var a={};a.options=Object.assign({},e),a.measures=[],a.dimensions=[],a.masterList=[],a.options.bin_type.values.length>2&&a.options.bin_type.values.pop();var s,u,l,c,f=1,d=1;t.fields.dimension_like.forEach((function(t){if("_filterlabels"!==t.name&&(t.is_numeric||"tier"===t.type)){var e={},n=t.name.replace(".","_");void 0!==t.label_short?e[t.label_short]=n:e[t.label]=n,1==f?s=n:2==f&&(u=n),a.masterList.push(e),a.dimensions.push(e),f+=1}})),t.fields.measure_like.forEach((function(t){if("_filterlabels"!==t.name){var e={},n=t.name.replace(".","_");void 0!==t.label_short?(e[t.label_short]=n,a.measures.push(e)):(e[t.label]=n,"yesno"==t.type?a.dimensions.push(e):a.measures.push(e)),1==d?l=n:2==d&&(c=n),a.masterList.push(e),d+=1}})),void 0===l&&(l=s),void 0===c&&(c=u),"steps"===n.bin_type?(a.options.num_step_x={label:"Step Size (X)",section:" Values",type:"number",order:5,display:"text",default:Math.floor(r/10),display_size:"half"},a.options.num_step_y={label:"Step Size (Y)",section:" Values",type:"number",order:6,display:"text",default:Math.floor(i/10),display_size:"half"}):"bins"===n.bin_type?a.options.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,default:"10"}:"breakpoints"===n.bin_type&&(a.options.breakpointsX={label:"Breakpoints (X)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:4},a.options.breakpointsY={label:"Breakpoints (Y)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:5}),n.winsorization&&(a.options.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.options.x={label:"X Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:l},a.options.y={label:"Y Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:c},a.options.heatmap_off={label:"Heatmap",section:" Values",type:"boolean",order:10,display:"select",display_size:"half",default:!0},a.options.x_hist={label:"X Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.y_hist={label:"Y Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.layer_points={label:"Points",section:" Values",type:"boolean",display_size:"half",order:11,display:"select",default:!0};var h=a.measures.length>2?a.measures[2]:"",p=a.measures.concat([{None:""}]);return a.options.size={label:"Size Points By",section:" Values",type:"string",order:12,display:"select",values:p,default:h[Object.keys(h)[0]]},a.options.color_scheme={label:"Heatmap Color Scheme",section:" Style",type:"array",display:"colors",order:1,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]},o&&(a.options.point_group_colors={label:"Point Groups Colors",section:" Style",type:"array",display:"colors",order:2,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]}),a.options.heatmap_opacity={label:"Heatmap Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:1},a.options.point_opacity={label:"Point Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:6},a.options.legend_orient={label:"Legend Position",section:"Labels",type:"string",display:"select",order:6,values:[{Left:"left"},{Right:"right"},{Top:"top"},{Bottom:"bottom"}],display_size:"half",default:"right"},a.options.legend_size={label:"Legend Font Size",section:"Labels",type:"number",display:"text",default:16,display_size:"half",order:5},a.options.y_axis_value_format={label:"Y Axis Value Format",order:201,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.points_legend_value_format={label:"Point Value Format",order:202,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.point_labels_divider={label:"Point Labels ---------------------------------------------",section:"Labels",type:"string",display:"divider",order:1e3,default:!1},a.options.point_labels={label:"Scatterplot Point Labels",section:"Labels",type:"boolean",order:1001,default:!1},a.options.point_labels_x_offset={label:"Point Label X Offset",section:"Labels",type:"number",display:"range",display_size:"half",default:0,order:1002,min:-50,max:50,step:1},a.options.point_labels_y_offset={label:"Point Label Y Offset",section:"Labels",type:"number",display:"range",display_size:"half",order:1003,default:0,min:-50,max:50,step:1},a.options.point_labels_angle={label:"Point Label Angle",section:"Labels",type:"number",display:"range",display_size:"half",order:1004,default:0,min:-90,max:90,step:1},a.options.point_labels_font_size={label:"Point Label Font Size",section:"Labels",type:"number",display:"text",display_size:"half",default:"12",order:1005},a.options.reference_line_divider={label:"Reference Lines ----------------------------------------",order:1006,section:"Labels",type:"string",display:"divder"},a.options.reference_line_x={label:"X Axis",order:1007,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_y={label:"Y Axis",order:1008,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_x_p={label:"X Axis Percentile",placeholder:"Value from 0 to 100",order:1009,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_y_p={label:"Y Axis Percentile",placeholder:"Value from 0 to 100",order:1010,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_x_width={label:"X Axis Stroke",order:1011,section:"Labels",type:"number",display_size:"half",default:3},a.options.reference_line_y_width={label:"Y Axis Stroke",order:1012,section:"Labels",type:"number",display_size:"half",default:3},a}(r,rU,n,d,p,void 0!==m[1]).options;if(a.trigger("registerOptions",b),"breakpoints"===n.bin_type&&a.addError({title:"Breakpoints Currently not supported for Scatter Histogram"}),null==u[n.x]||null==u[n.y])return;const y=u[n.x].valueFormat,v=u[n.y].valueFormat,x=n.x_axis_value_format,_=n.y_axis_value_format;let O=""!==x?x:y;null==O&&(O="#,##0");let w,j=""!==_?_:v;if(null==j&&(j="#,##0"),n.size){const t=u[n.size].valueFormat,e=n.points_legend_value_format;w=""!==e?e:t,null==w&&(w="#,##0")}n.winsorization&&(l=Object(fU.e)(l,n.x,n.percentile),l=Object(fU.e)(l,n.y,n.percentile));const k=function(t,e,n){let r=[];for(let e in t)if("_filterlabels"!==e&&("nominal"===t[e].dtype||e===n.x||e===n.y||e===n.size)){let i={};i.field=e,i.type=t[e].dtype,i.title=(e=>{switch(e){case n.x:return""!==n.x_axis_override?n.x_axis_override:t[e].title;case n.y:return""!==n.y_axis_override?n.y_axis_override:t[e].title;default:return t[e].title}})(e),r.push(i)}let i=[n.x,n.y];n.size&&i.push(n.size),r.sort((t,e)=>i.indexOf(t.field)-i.indexOf(e.field));for(let t=0;t{Object(sU.d)(i,n,m,O,j,w)};s("#my-vega",E,{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),A(),i.print?o():(e.addEventListener("wheel",A,{passive:!0}),e.addEventListener("mousedown",A,{passive:!0}),e.addEventListener("mouseup",A,{passive:!0}),e.addEventListener("drag",A,{passive:!0}),e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i,o){if(void 0===e||void 0===n||0===n.fillOpacity||"breakpoints"===e.bin_type)return;const a=t=>t.replace(/\u2013|\u2014|\u2212/g,"-"),s=r=>{let i=""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return n.tooltip[i].split(" ")},u=r=>{let i="size"!==r&&""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return Number(a(n.tooltip[i]))},l=(t,e)=>{let n="x"===t?r:i;return[nU.a.format(n,Number(a(e[0]))),nU.a.format(n,Number(a(e[2])))]};if("X_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("x",s("x"));tU.a("td.value").text(t+" - "+e)}if("Y_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("y",s("y"));tU.a("td.value").text(t+" - "+e)}if("HEATMAP_marks"===n.mark.name){let[t,n]=l("x",s("x")),[r,i]=l("y",s("y"));tU.b("td.value").each((function(o,a){0===a?tU.a(this).text(t+" - "+n):1===a&&e.x!==e.y&&tU.a(this).text(r+" - "+i)}))}if("SCATTERPLOT_marks"===n.mark.name){let t=0;tU.b("td.value").each((function(n,a){0===a?tU.a(this).text(nU.a.format(r,u("x"))):1===a?e.x!==e.y?tU.a(this).text(nU.a.format(i,u("y"))):e.size&&(tU.a(this).text(nU.a.format(o,u("size"))),t=1):2===a&&!t&&e.size&&e.x!==e.size&&e.y!==e.size&&tU.a(this).text(nU.a.format(o,u("size")))}))}}(u,n,e,O,j,w)}),void 0!==m[1]&&n.size&&(n.x_hist||n.y_hist)&&Object(sU.c)(n.legend_orient),e.addEventListener("click",(function(t,e){if(!(void 0===e||void 0===e.datum||Object.keys(e.datum).length<=1||0===e.fillOpacity))if(i.crossfilterEnabled&&"rect"!==e.mark.marktype){let n={[u[m[0]].lookerName]:{value:e.datum[m[0]]}};LookerCharts.Utils.toggleCrossfilter({row:n,event:t})}else{var o=e.datum.links;if(Object.keys(e.datum)[0].startsWith("bin_")){let t=[];for(let e of r.fields.dimension_like.concat(r.fields.measure_like))t.push(e.name);const i=u[n.x].lookerName,a=u[n.y].lookerName,s=Object.keys(e.datum).filter(t=>t.includes(n.x)),c=Object.keys(e.datum).filter(t=>t.includes(n.y));let f=l[0].links;if(f.length<1)o=[];else{f=f.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let n=`${f}?fields=${t.join(",")}`;if(s.length>0&&(n+=`&f[${i}]=[${e.datum[s[0]]}, ${e.datum[s[1]]})`),c.length>0&&(n+=`&f[${a}]=[${e.datum[c[0]]}, ${e.datum[c[1]]})`),void 0!==r.applied_filters){let t=r.applied_filters;for(let e in t)n+=`&f[${t[e].field.name}]=${t[e].value}`}o=[{label:`Show ${e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:n}]}}LookerCharts.Utils.openDrillMenu({links:o,event:t})}})))})}function xU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=r.fields.measure_like[0].name.replace(".","_"),f=r.fields.dimensions[0].name.replace(".","_"),d=Math.max(...l.map(t=>t[c])),h=Object.assign({},rU);h.bin_type.values.length<3&&(h.bin_type.values[h.bin_type.values.length]={Breakpoints:{description:"An array of allowable step sizes to choose from.",value:"breakpoints"}}),"bins"===n.bin_type?h.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,display:"text",default:"10"}:"steps"===n.bin_type?h.step_size={label:"Step Size",section:" Values",type:"number",order:4,display:"text",default:Math.floor(d/10)}:(h.breakpoint_array={label:"Breakpoints",section:" Values",order:4,type:"string",default:`min, ${Math.floor(d/5)}, ${Math.floor(d/4)}, ${Math.floor(d/3)}, ${Math.floor(d/2)}, max`},h.breakpoint_ordinal={label:"Use Equal Sized Columns (Ordinal Bins)",order:4,section:" Values",type:"boolean",display:"select",default:!1}),n.winsorization&&(h.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.trigger("registerOptions",h),n.winsorization&&(l=Object(fU.e)(l,c,n.percentile));const p=u[c].valueFormat,g=n.x_axis_value_format;let m=""!==g?g:p;null==m&&(m="#,##0");let b=[];"breakpoints"===n.bin_type&&(b=Object(fU.c)(l,c,n.breakpoint_array,m,"x"));var y,v,x;s("#my-vega",{$schema:"https://vega.github.io/schema/vega-lite/v4.json",config:{view:{stroke:"transparent"}},data:{values:"breakpoints"===n.bin_type?b:l},width:.9*e.clientWidth,height:.8*e.clientHeight,padding:20,selection:{highlight:{type:"single",empty:"none",on:"mouseover"}},mark:{type:"bar",cursor:"pointer"},encoding:{x:{type:n.breakpoint_ordinal?"ordinal":"quantitative",...n.breakpoint_ordinal&&{sort:["order"]},...!n.breakpoint_ordinal&&{bin:{..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size<=Math.floor(d/200)?Math.floor(d/200):n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}}},field:"breakpoints"===n.bin_type?n.breakpoint_ordinal?"label":"bin_start_x":c,axis:{title:""===n.x_axis_override?u[c].title:n.x_axis_override,titleFontSize:n.x_axis_title_font_size,labelFontSize:n.x_axis_label_font_size,labelAngle:-1*n.x_axis_label_angle,format:"d",grid:n.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.x_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},..."breakpoints"===n.bin_type&&!1===n.breakpoint_ordinal&&{x2:{field:"bin_end_x"}},y:{type:"quantitative",..."breakpoints"!==n.bin_type&&{aggregate:"count"},..."breakpoints"===n.bin_type&&{field:"count_x"},axis:{title:""===n.y_axis_override?"Count of "+u[f].title:n.y_axis_override,titleFontSize:n.y_axis_title_font_size,labelFontSize:n.y_axis_label_font_size,labelAngle:-1*n.y_axis_label_angle,grid:n.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},color:{condition:{selection:"highlight",value:n.color_on_hover},value:n.color_col},tooltip:(y=u[c],v=n.x_axis_override,x={..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}},[{title:""!==v?v:y.title,bin:x,field:x.binned?"label":y.lookerName.replace(".","_"),type:x.binned?"ordinal":"quantitative"},{title:"Count of Records",type:"quantitative",...!x.binned&&{aggregate:"count"},...x.binned&&{field:"count_x"}}])}},{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),Object(sU.e)(n,"simple",m),i.print?o():(e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i){if(void 0===e||void 0===r||"transparent"===r.stroke||"breakpoints"===e.bin_type)return;const o=t=>t.replace(/\u2013|\u2014|\u2212/g,"-");let[a,s]=(u=(r=>{let i=""!==e.x_axis_override?e.x_axis_override:t[n].title;return r.tooltip[i].split(" ")})(r),[nU.a.format(i,Number(o(u[0]))),nU.a.format(i,Number(o(u[2])))]);var u;tU.a("td.value").text(a+" - "+s)}(u,n,c,e,m)}),e.addEventListener("click",(function(t,e){if(void 0===e.datum)return;const i=u[c].lookerName,o="breakpoints"===n.bin_type?["bin_start_x","bin_end_x"]:Object.keys(e.datum).filter(t=>t.includes(c));let a=e.datum.links,s=l[0].links,f=[];for(let t of r.fields.dimension_like.concat(r.fields.measure_like))f.push(t.name);if(s.length<1)a=[];else{s=s.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let t=`${s}?fields=${f.join(",")}`;if(t+=`&f[${i}]=[${e.datum[o[0]]}, ${e.datum[o[1]]})`,void 0!==r.applied_filters){let e=r.applied_filters;for(let n in e)t+=`&f[${e[n].field.name}]=${e[n].value}`}a=[{label:`Show ${"breakpoints"===n.bin_type?e.datum.count_x:e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:t}]}LookerCharts.Utils.openDrillMenu({links:a,event:t})})))})}n(96);looker.plugins.visualizations.add({options:rU,create:function(t,e){t.appendChild(document.createElement("div")).setAttribute("id","my-vega")},updateAsync:function(t,e,n,r,i,o){if(0===t.length)return this.addError({title:"No Results"}),void o();if("binned_hist"===n.bin_style){if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:2,max_measures:void 0}))return;vU(t,e,n,r,i,o,this,QI)}else{if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:1,max_measures:void 0}))return;xU(t,e,n,r,i,o,this,QI)}o()}})},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d-t.getMinutes()*i.c)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getUTCHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getUTCMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3)))-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Object(r.a)(e)-Object(r.a)(t))+1}},function(t,e,n){"use strict";var r=n(15);e.a=function(t){return Math.max(0,-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r={},i={};function o(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function a(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function s(t,e){var n=t+"",r=n.length;return r9999?"+"+s(e,6):s(e,4))+"-"+s(t.getUTCMonth()+1,2)+"-"+s(t.getUTCDate(),2)+(o?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"."+s(o,3)+"Z":i?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"Z":r||n?"T"+s(n,2)+":"+s(r,2)+"Z":"")}e.a=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function s(t,e){var o,a=[],s=t.length,u=0,l=0,c=s<=0,f=!1;function d(){if(c)return i;if(f)return f=!1,r;var e,o,a=u;if(34===t.charCodeAt(a)){for(;u++=s?c=!0:10===(o=t.charCodeAt(u++))?f=!0:13===o&&(f=!0,10===t.charCodeAt(u)&&++u),t.slice(a+1,e-1).replace(/""/g,'"')}for(;ut,"vega-lite":(t,e)=>WI.compile(t,{config:e}).spec};function KI(t,e,n,r){const i=`${e}
`,o=`
${n}`,a=window.open("");a.document.write(i+t+o),a.document.title=VI[r]+" JSON Source"}function ZI(t,e){var n;return PI(this,void 0,void 0,(function*(){const r=Object(Z.I)(t.config)?JSON.parse(yield e.load(t.config)):null!==(n=t.config)&&void 0!==n?n:{},i=Object(Z.I)(t.patch)?JSON.parse(yield e.load(t.patch)):t.patch;return Object.assign(Object.assign(Object.assign({},t),i?{patch:i}:{}),r?{config:r}:{})}))}var QI=function(t,e,n={}){var r,i,o;return PI(this,void 0,void 0,(function*(){const a=(s=n.loader)&&"load"in s?n.loader:qI.loader(n.loader);var s;const u=Object(Z.I)(e)?JSON.parse(yield a.load(e)):e,l=yield ZI(null!==(r=u.usermeta&&u.usermeta.embedOptions)&&void 0!==r?r:{},a),c=yield ZI(n,a),f=Object.assign(Object.assign({},II(c,l)),{config:Object(Z.O)(null!==(i=c.config)&&void 0!==i?i:{},null!==(o=l.config)&&void 0!==o?o:{})});return yield function(t,e,n={},r){var i,o,a,s,u,l;return PI(this,void 0,void 0,(function*(){const c=n.theme?Object(Z.O)(v[n.theme],null!==(i=n.config)&&void 0!==i?i:{}):n.config,f=Object(Z.C)(n.actions)?n.actions:II({},HI,null!==(o=n.actions)&&void 0!==o?o:{}),d=Object.assign(Object.assign({},GI),n.i18n),h=null!==(a=n.renderer)&&void 0!==a?a:"canvas",p=null!==(s=n.logLevel)&&void 0!==s?s:qI.Warn,g=null!==(u=n.downloadFileName)&&void 0!==u?u:"visualization",m="string"==typeof t?document.querySelector(t):t;if(!m)throw new Error(t+" does not exist");if(!1!==n.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:r}=function(t){var e;const n=t.getRootNode?t.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(e=document.head)&&void 0!==e?e:document.body}}(m);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?LI.toString():n.defaultStyle,r.appendChild(e)}}const b=function(t,e){var n;if(t.$schema){const r=yI(t.$schema);e&&e!==r.library&&console.warn(`The given visualization spec is written in ${VI[r.library]}, but mode argument sets ${null!==(n=VI[e])&&void 0!==n?n:e}.`);const i=r.library;return Object(K.satisfies)(XI[i],"^"+r.version.slice(1))||console.warn(`The input spec uses ${VI[i]} ${r.version}, but the current version of ${VI[i]} is v${XI[i]}.`),i}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":null!=e?e:"vega"}(e,n.mode);let y=JI[b](e,c);if("vega-lite"===b&&y.$schema){const t=yI(y.$schema);Object(K.satisfies)(XI.vega,"^"+t.version.slice(1))||console.warn(`The compiled spec uses Vega ${t.version}, but current version is v${XI.vega}.`)}m.classList.add("vega-embed"),f&&m.classList.add("has-actions"),m.innerHTML="";let x=m;if(f){const t=document.createElement("div");t.classList.add("chart-wrapper"),m.appendChild(t),x=t}const _=n.patch;_&&(y=_ instanceof Function?_(y):N(y,_,!0,!1).newDocument),n.formatLocale&&qI.formatLocale(n.formatLocale),n.timeFormatLocale&&qI.timeFormatLocale(n.timeFormatLocale);const{ast:O}=n,w=qI.parse(y,"vega-lite"===b?{}:c,{ast:O}),j=new qI.View(w,Object.assign({loader:r,logLevel:p,renderer:h},O?{expr:qI.expressionInterpreter}:{}));if(!1!==n.tooltip){let t;t="function"==typeof n.tooltip?n.tooltip:new RI(!0===n.tooltip?{}:n.tooltip).call,j.tooltip(t)}let k,{hover:E}=n;if(void 0===E&&(E="vega"===b),E){const{hoverSet:t,updateSet:e}="boolean"==typeof E?{}:E;j.hover(t,e)}if(n&&(null!=n.width&&j.width(n.width),null!=n.height&&j.height(n.height),null!=n.padding&&j.padding(n.padding)),yield j.initialize(x).runAsync(),!1!==f){let t=m;if(!1!==n.defaultStyle){const e=document.createElement("details");e.title=d.CLICK_TO_VIEW_ACTIONS,m.append(e),t=e;const n=document.createElement("summary");n.innerHTML='\n\n \n \n \n',e.append(n),k=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",k)}const r=document.createElement("div");if(t.append(r),r.classList.add("vega-actions"),!0===f||!1!==f.export)for(const t of["svg","png"])if(!0===f||!0===f.export||f.export[t]){const e=d[t.toUpperCase()+"_ACTION"],i=document.createElement("a");i.text=e,i.href="#",i.target="_blank",i.download=`${g}.${t}`,i.addEventListener("mousedown",(function(e){return PI(this,void 0,void 0,(function*(){e.preventDefault();const r=yield j.toImageURL(t,n.scaleFactor);this.href=r}))})),r.append(i)}if(!0===f||!1!==f.source){const t=document.createElement("a");t.text=d.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){var r,i;KI(J()(e),null!==(r=n.sourceHeader)&&void 0!==r?r:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"",b),t.preventDefault()})),r.append(t)}if("vega-lite"===b&&(!0===f||!1!==f.compiled)){const t=document.createElement("a");t.text=d.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){var e,r;KI(J()(y),null!==(e=n.sourceHeader)&&void 0!==e?e:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"","vega"),t.preventDefault()})),r.append(t)}if(!0===f||!1!==f.editor){const t=null!==(l=n.editorUrl)&&void 0!==l?l:"https://vega.github.io/editor/",i=document.createElement("a");i.text=d.EDITOR_ACTION,i.href="#",i.addEventListener("click",(function(n){!function(t,e,n){const r=t.open(e),{origin:i}=new URL(e);let o=40;t.addEventListener("message",(function e(n){n.source===r&&(o=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){o<=0||(r.postMessage(n,i),setTimeout(t,250),o-=1)}),250)}(window,t,{config:c,mode:b,renderer:h,spec:J()(e)}),n.preventDefault()})),r.append(i)}}return{view:j,spec:e,vgSpec:y,finalize:function(){k&&document.removeEventListener("click",k),j.finalize()}}}))}(t,u,f,a)}))},tU=n(2),eU=n(7),nU=n.n(eU);const rU={bin_type:{label:"Binning Type",section:" Values",type:"string",order:2,display:"select",values:[{"Max Bins":"bins"},{Steps:"steps"},{Breakpoints:"breakpoints"}],default:"bins"},bin_style:{label:"Chart Type",section:" Values",type:"string",order:1,display:"select",default:"simple_hist",values:[{"Simple Histogram":"simple_hist"},{"Scatter Histogram":"binned_hist"}]},winsorization:{label:"Limit Outliers (Winsorize)",section:" Values",type:"boolean",order:7,default:!1},color_col:{type:"string",section:" Style",label:"Color",display:"color",display_size:"half",default:"#1A73E8",order:3},color_on_hover:{type:"string",section:" Style",label:"Color On Hover",display:"color",display_size:"half",default:"#338bff",order:4},x_axis_label_divider:{label:"X Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:6},x_axis_override:{label:"X Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:7},x_grids:{label:"X Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",default:!0},x_axis_title_font_size:{label:"X Axis Title Size",section:"Labels",type:"number",default:16,display_size:"half",order:9},x_axis_label_font_size:{label:"X Axis Label Size",section:"Labels",type:"number",default:12,display_size:"half",order:10},x_axis_label_angle:{label:"X Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:11,min:0,max:90,step:1,display_size:"half"},x_label_separation:{label:"X Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:12,min:1,max:100,step:1,display_size:"half"},y_axis_label_divider:{label:"Y Axis -------------------------------------------------------",section:"Labels",type:"string",display:"divider",order:13},y_axis_override:{label:"Y Axis Title Override",section:"Labels",type:"string",display:"text",default:"",order:14},y_grids:{label:"Y Axis Gridlines",section:" Style",type:"boolean",display:"select",display_size:"half",order:15,default:!0},y_axis_title_font_size:{label:"Y Axis Title Size",section:"Labels",type:"number",default:16,display_size:"half",order:16},y_axis_label_font_size:{label:"Y Axis Label Size",section:"Labels",type:"number",default:12,display_size:"half",order:17},y_axis_label_angle:{label:"Y Axis Label Angle",section:"Labels",type:"number",display:"range",default:0,order:18,min:0,max:90,step:1,display_size:"half"},y_label_separation:{label:"Y Axis Label Density",section:"Labels",type:"number",display:"range",default:100,order:19,min:1,max:100,step:1,display_size:"half"},x_axis_value_format:{label:"X Axis Value Format",order:200,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"}};function iU(t,e,n){return[{title:""!==e?e:t.title,bin:n,field:n.binned?"label":t.lookerName.replace(".","_"),type:n.binned?"ordinal":"quantitative"},{title:"Count of Records",aggregate:"count",type:"quantitative",...!n.binned&&{aggregate:"count"},...n.binned&&{field:"count_x"}}]}var oU=function({dataProperties:t,config:e,maxX:n,width:r}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"X_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},height:60,width:r,encoding:{x:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{grid:e.x_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_x"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.y_grids}},tooltip:iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}};var aU=({dataProperties:t,config:e,maxY:n,height:r})=>({selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"Y_HISTOGRAM",mark:{type:"bar",cursor:"pointer"},width:60,height:r,encoding:{y:{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{grid:e.y_grids,title:null,labels:!1,ticks:!1}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},x:{..."breakpoints"!==e.bin_type&&{aggregate:"count"},..."breakpoints"===e.bin_type&&{field:"count_y"},type:"quantitative",title:"",axis:{labelColor:"#696969",titleColor:"#696969",grid:e.x_grids,title:null}},tooltip:iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(n/200)?Math.floor(n/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}),color:{condition:{selection:"highlight",value:e.color_on_hover},value:e.color_col}}}),sU=n(6);var uU=function({dataProperties:t,config:e,maxX:n,maxY:r,height:i,width:o,valFormatX:a,valFormatY:s}){return{selection:{grid:{type:"interval",bind:"scales"},highlight:{type:"single",empty:"none",on:"mouseover"}},name:"HEATMAP",mark:{zindex:-1,type:"rect",invalid:null,...e.heatmap_off&&{cursor:"pointer"},...!e.heatmap_off&&{fillOpacity:0}},height:i,width:o,encoding:{x:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_x":e.x,type:"quantitative",axis:{name:"xAxis",title:""===e.x_axis_override?t[e.x].title:e.x_axis_override,titleFontSize:e.x_axis_title_font_size,format:"d",labelFontSize:e.x_axis_label_font_size,grid:e.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.x_label_separation,labelOverlap:!0,labelColor:"#696969",labelAngle:-1*e.x_axis_label_angle,titleColor:"#696969",titlePadding:25+a.length}},..."breakpoints"===e.bin_type&&{x2:{field:"bin_end_x"}},y:{...e.heatmap_off&&{bin:{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}},field:"breakpoints"===e.bin_type?"bin_start_y":e.y,type:"quantitative",axis:{title:""===e.y_axis_override?t[e.y].title:e.y_axis_override,titleFontSize:e.y_axis_title_font_size,format:"d",labelFontSize:e.y_axis_label_font_size,labelAngle:-1*e.y_axis_label_angle,grid:e.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-e.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25+3*s.length}},..."breakpoints"===e.bin_type&&{y2:{field:"bin_end_y"}},color:{aggregate:"count",type:"quantitative",legend:!!e.heatmap_off&&{orient:e.legend_orient,labelFontSize:e.legend_size,titleFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}},opacity:{condition:{selection:"highlight",value:1},value:e.heatmap_opacity},...e.heatmap_off&&{tooltip:(()=>{let i=iU(t[e.x],e.x_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_x<=Math.floor(n/200)?Math.floor(n/200):e.num_step_x},..."breakpoints"===e.bin_type&&{binned:!0}}).concat(iU(t[e.y],e.y_axis_override,{..."bins"===e.bin_type&&{maxbins:e.max_bins},..."steps"===e.bin_type&&{step:e.num_step_y<=Math.floor(r/200)?Math.floor(r/200):e.num_step_y},..."breakpoints"===e.bin_type&&{binned:!0}}));return i=i.concat(i.splice(1,1)),i})()}}}};var lU=function({config:t,dataProperties:e,mainDimensions:n}){return{mark:{type:"text",align:"left",angle:t.point_labels_angle,dx:t.point_labels_x_offset,dy:t.point_labels_y_offset,fontSize:t.point_labels_font_size},encoding:{x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"},text:{field:e._filterlabels?"_filterlabels":n[0]}}}};function cU({config:t,tooltipFields:e,dataProperties:n,width:r,height:i,mainDimensions:o}){const a=function({config:t,tooltipFields:e,width:n,height:r}){return{name:"SCATTERPLOT",mark:{color:t.color_col,cursor:"pointer",type:"circle",opacity:t.point_opacity,zindex:2,size:100},height:r,width:n,encoding:{tooltip:e,x:{field:t.x,type:"quantitative"},y:{field:t.y,type:"quantitative"}}}}({config:t,dataProperties:n,tooltipFields:e,width:r,height:i});return t.layer_points&&""!==t.size&&void 0!==t.size&&function(t,e,n){t.encoding.size={field:e.size,type:"quantitative",title:n[e.size].title,legend:{orient:e.legend_orient,format:"d",labelFontSize:e.legend_size,titleFontWeight:"normal",offset:e.y_hist?85:10,titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n),t.layer_points&&void 0!==o[1]&&function(t,e,n,r){t.encoding.color={scale:{scheme:e.point_group_colors},field:r[1],legend:{type:"symbol",offset:e.y_hist?85:10,title:n[r[1]].title,type:"symbol",orient:e.legend_orient,labelFontSize:e.legend_size,titleFontWeight:"normal",titleFontSize:e.legend_size,titleFont:sU.a,labelFont:sU.a,labelColor:"#696969",titleColor:"#696969"}}}(a,t,n,o),a}var fU=n(9);var dU=function({axis:t,config:e,data:n,min:r,max:i}){const o=Object(fU.a)(e[`reference_line_${t}_p`],e[t],n);return{name:"refLine"+t,mark:{type:"rule"},encoding:{x:{datum:"x"===t?o:r},y:{datum:"x"===t?r:o},x2:{datum:"x"===t?o:i},y2:{datum:"x"===t?i:o},color:{value:"red"},size:{value:e[`reference_line_${t}_width`]},strokeDash:{value:[4,4]}}}};var hU=function({layers:t,data:e,config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s,minX:u,minY:l,maxX:c,maxY:f}){n.layer_points&&t.push(cU({config:n,tooltipFields:r,dataProperties:i,width:o,height:a,mainDimensions:s})),n.layer_points&&n.point_labels&&t.push(lU({config:n,dataProperties:i,mainDimensions:s})),n.reference_line_x&&t.push(dU({axis:"x",min:l,max:f,config:n,data:e})),n.reference_line_y&&t.push(dU({axis:"y",min:u,max:c,config:n,data:e}))};var pU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{spacing:15,bounds:"flush",hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var gU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})],config:{range:{heatmap:{scheme:n.color_scheme}}}};return hU({layers:h.layer,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var mU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={vconcat:[oU({dataProperties:e,config:n,maxX:r,width:u}),{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]}],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.vconcat[1].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var bU=function({data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}){const h={hconcat:[{name:"BOUNDING_BOX",layer:[uU({dataProperties:e,config:n,maxX:r,maxY:o,height:s,width:u,valFormatX:c,valFormatY:f})]},aU({dataProperties:e,config:n,maxY:o,height:s})],config:{range:{heatmap:{scheme:n.color_scheme}}}};let p=h.hconcat[0].layer;return hU({layers:p,data:t,dataProperties:e,config:n,maxX:r,minX:i,maxY:o,minY:a,height:s,width:u,tooltipFields:l,valFormatX:c,valFormatY:f,mainDimensions:d}),h};var yU=function(t){return t.config.x_hist&&t.config.y_hist?pU(t):t.config.x_hist?mU(t):t.config.y_hist?bU(t):gU(t)};function vU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=e.clientWidth,f=e.clientHeight,d=Math.max(...l.map(t=>t[n.x])),h=Math.min(...l.map(t=>t[n.x])),p=Math.max(...l.map(t=>t[n.y])),g=Math.min(...l.map(t=>t[n.y])),m=r.fields.dimension_like.map(t=>t.name.replace(".","_")),b=function(t,e,n,r,i,o){var a={};a.options=Object.assign({},e),a.measures=[],a.dimensions=[],a.masterList=[],a.options.bin_type.values.length>2&&a.options.bin_type.values.pop();var s,u,l,c,f=1,d=1;t.fields.dimension_like.forEach((function(t){if("_filterlabels"!==t.name&&(t.is_numeric||"tier"===t.type)){var e={},n=t.name.replace(".","_");void 0!==t.label_short?e[t.label_short]=n:e[t.label]=n,1==f?s=n:2==f&&(u=n),a.masterList.push(e),a.dimensions.push(e),f+=1}})),t.fields.measure_like.forEach((function(t){if("_filterlabels"!==t.name){var e={},n=t.name.replace(".","_");void 0!==t.label_short?(e[t.label_short]=n,a.measures.push(e)):(e[t.label]=n,"yesno"==t.type?a.dimensions.push(e):a.measures.push(e)),1==d?l=n:2==d&&(c=n),a.masterList.push(e),d+=1}})),void 0===l&&(l=s),void 0===c&&(c=u),"steps"===n.bin_type?(a.options.num_step_x={label:"Step Size (X)",section:" Values",type:"number",order:5,default:Math.floor(r/10),display_size:"half"},a.options.num_step_y={label:"Step Size (Y)",section:" Values",type:"number",order:6,default:Math.floor(i/10),display_size:"half"}):"bins"===n.bin_type?a.options.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,default:"10"}:"breakpoints"===n.bin_type&&(a.options.breakpointsX={label:"Breakpoints (X)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:4},a.options.breakpointsY={label:"Breakpoints (Y)",section:" Values",type:"string",placeholder:"Comma seperated breakpoints (100, 200, 300)",order:5}),n.winsorization&&(a.options.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.options.x={label:"X Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:l},a.options.y={label:"Y Axis",section:" Values",type:"string",display:"select",order:1,values:a.measures,default:c},a.options.heatmap_off={label:"Heatmap",section:" Values",type:"boolean",order:10,display:"select",display_size:"half",default:!0},a.options.x_hist={label:"X Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.y_hist={label:"Y Histogram",section:" Values",type:"boolean",display_size:"half",order:11,default:!0},a.options.layer_points={label:"Points",section:" Values",type:"boolean",display_size:"half",order:11,display:"select",default:!0};var h=a.measures.length>2?a.measures[2]:"",p=a.measures.concat([{None:""}]);return a.options.size={label:"Size Points By",section:" Values",type:"string",order:12,display:"select",values:p,default:h[Object.keys(h)[0]]},a.options.color_scheme={label:"Heatmap Color Scheme",section:" Style",type:"array",display:"colors",order:1,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]},o&&(a.options.point_group_colors={label:"Point Groups Colors",section:" Style",type:"array",display:"colors",order:2,default:["#7FCDAE","#7ED09C","#7DD389","#85D67C","#9AD97B","#B1DB7A","#CADF79","#E2DF78","#E5C877","#E7AF75","#EB9474","#EE7772"]}),a.options.heatmap_opacity={label:"Heatmap Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:1},a.options.point_opacity={label:"Point Opacity",section:" Style",type:"number",display:"range",min:0,max:1,step:.05,default:.8,order:6},a.options.legend_orient={label:"Legend Position",section:"Labels",type:"string",display:"select",order:6,values:[{Left:"left"},{Right:"right"},{Top:"top"},{Bottom:"bottom"}],display_size:"half",default:"right"},a.options.legend_size={label:"Legend Font Size",section:"Labels",type:"number",default:16,display_size:"half",order:5},a.options.y_axis_value_format={label:"Y Axis Value Format",order:201,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.points_legend_value_format={label:"Point Value Format",order:202,section:" Values",type:"string",display:"text",default:"",placeholder:"Spreadsheet Style Value Format"},a.options.point_labels_divider={label:"Point Labels ---------------------------------------------",section:"Labels",type:"string",display:"divider",order:1e3,default:!1},a.options.point_labels={label:"Scatterplot Point Labels",section:"Labels",type:"boolean",order:1001,default:!1},a.options.point_labels_x_offset={label:"Point Label X Offset",section:"Labels",type:"number",display:"range",display_size:"half",default:0,order:1002,min:-50,max:50,step:1},a.options.point_labels_y_offset={label:"Point Label Y Offset",section:"Labels",type:"number",display:"range",display_size:"half",order:1003,default:0,min:-50,max:50,step:1},a.options.point_labels_angle={label:"Point Label Angle",section:"Labels",type:"number",display:"range",display_size:"half",order:1004,default:0,min:-90,max:90,step:1},a.options.point_labels_font_size={label:"Point Label Font Size",section:"Labels",type:"number",display_size:"half",default:12,order:1005},a.options.reference_line_divider={label:"Reference Lines ----------------------------------------",order:1006,section:"Labels",type:"string",display:"divder"},a.options.reference_line_x={label:"X Axis",order:1007,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_y={label:"Y Axis",order:1008,section:"Labels",type:"boolean",display_size:"half"},a.options.reference_line_x_p={label:"X Axis Percentile",placeholder:"Value from 0 to 100",order:1009,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_y_p={label:"Y Axis Percentile",placeholder:"Value from 0 to 100",order:1010,section:"Labels",type:"number",display_size:"half",default:50},a.options.reference_line_x_width={label:"X Axis Stroke",order:1011,section:"Labels",type:"number",display_size:"half",default:3},a.options.reference_line_y_width={label:"Y Axis Stroke",order:1012,section:"Labels",type:"number",display_size:"half",default:3},a}(r,rU,n,d,p,void 0!==m[1]).options;if(a.trigger("registerOptions",b),"breakpoints"===n.bin_type&&a.addError({title:"Breakpoints Currently not supported for Scatter Histogram"}),null==u[n.x]||null==u[n.y])return;const y=u[n.x].valueFormat,v=u[n.y].valueFormat,x=n.x_axis_value_format,_=n.y_axis_value_format;let O=""!==x?x:y;null==O&&(O="#,##0");let w,j=""!==_?_:v;if(null==j&&(j="#,##0"),n.size){const t=u[n.size].valueFormat,e=n.points_legend_value_format;w=""!==e?e:t,null==w&&(w="#,##0")}n.winsorization&&(l=Object(fU.e)(l,n.x,n.percentile),l=Object(fU.e)(l,n.y,n.percentile));const k=function(t,e,n){let r=[];for(let e in t)if("_filterlabels"!==e&&("nominal"===t[e].dtype||e===n.x||e===n.y||e===n.size)){let i={};i.field=e,i.type=t[e].dtype,i.title=(e=>{switch(e){case n.x:return""!==n.x_axis_override?n.x_axis_override:t[e].title;case n.y:return""!==n.y_axis_override?n.y_axis_override:t[e].title;default:return t[e].title}})(e),r.push(i)}let i=[n.x,n.y];n.size&&i.push(n.size),r.sort((t,e)=>i.indexOf(t.field)-i.indexOf(e.field));for(let t=0;t{Object(sU.d)(i,n,m,O,j,w)};s("#my-vega",E,{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),A(),i.print?o():(e.addEventListener("wheel",A,{passive:!0}),e.addEventListener("mousedown",A,{passive:!0}),e.addEventListener("mouseup",A,{passive:!0}),e.addEventListener("drag",A,{passive:!0}),e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i,o){if(void 0===e||void 0===n||0===n.fillOpacity||"breakpoints"===e.bin_type)return;const a=t=>t.replace(/\u2013|\u2014|\u2212/g,"-"),s=r=>{let i=""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return n.tooltip[i].split(" ")},u=r=>{let i="size"!==r&&""!==e[r+"_axis_override"]?e[r+"_axis_override"]:t[e[r].replace(".","_")].title;return Number(a(n.tooltip[i]))},l=(t,e)=>{let n="x"===t?r:i;return[nU.a.format(n,Number(a(e[0]))),nU.a.format(n,Number(a(e[2])))]};if("X_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("x",s("x"));tU.a("td.value").text(t+" - "+e)}if("Y_HISTOGRAM_marks"===n.mark.name){let[t,e]=l("y",s("y"));tU.a("td.value").text(t+" - "+e)}if("HEATMAP_marks"===n.mark.name){let[t,n]=l("x",s("x")),[r,i]=l("y",s("y"));tU.b("td.value").each((function(o,a){0===a?tU.a(this).text(t+" - "+n):1===a&&e.x!==e.y&&tU.a(this).text(r+" - "+i)}))}if("SCATTERPLOT_marks"===n.mark.name){let t=0;tU.b("td.value").each((function(n,a){0===a?tU.a(this).text(nU.a.format(r,u("x"))):1===a?e.x!==e.y?tU.a(this).text(nU.a.format(i,u("y"))):e.size&&(tU.a(this).text(nU.a.format(o,u("size"))),t=1):2===a&&!t&&e.size&&e.x!==e.size&&e.y!==e.size&&tU.a(this).text(nU.a.format(o,u("size")))}))}}(u,n,e,O,j,w)}),void 0!==m[1]&&n.size&&(n.x_hist||n.y_hist)&&Object(sU.c)(n.legend_orient),e.addEventListener("click",(function(t,e){if(!(void 0===e||void 0===e.datum||Object.keys(e.datum).length<=1||0===e.fillOpacity))if(i.crossfilterEnabled&&"rect"!==e.mark.marktype){let n={[u[m[0]].lookerName]:{value:e.datum[m[0]]}};LookerCharts.Utils.toggleCrossfilter({row:n,event:t})}else{var o=e.datum.links;if(Object.keys(e.datum)[0].startsWith("bin_")){let t=[];for(let e of r.fields.dimension_like.concat(r.fields.measure_like))t.push(e.name);const i=u[n.x].lookerName,a=u[n.y].lookerName,s=Object.keys(e.datum).filter(t=>t.includes(n.x)),c=Object.keys(e.datum).filter(t=>t.includes(n.y));let f=l[0].links;if(f.length<1)o=[];else{f=f.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let n=`${f}?fields=${t.join(",")}`;if(s.length>0&&(n+=`&f[${i}]=[${e.datum[s[0]]}, ${e.datum[s[1]]})`),c.length>0&&(n+=`&f[${a}]=[${e.datum[c[0]]}, ${e.datum[c[1]]})`),void 0!==r.applied_filters){let t=r.applied_filters;for(let e in t)n+=`&f[${t[e].field.name}]=${t[e].value}`}o=[{label:`Show ${e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:n}]}}LookerCharts.Utils.openDrillMenu({links:o,event:t})}})))})}function xU(t,e,n,r,i,o,a,s){a.clearErrors();let{dataProperties:u,myData:l}=Object(fU.d)(t,r);const c=r.fields.measure_like[0].name.replace(".","_"),f=r.fields.dimensions[0].name.replace(".","_"),d=Math.max(...l.map(t=>t[c])),h=Object.assign({},rU);h.bin_type.values.length<3&&(h.bin_type.values[h.bin_type.values.length]={Breakpoints:{description:"An array of allowable step sizes to choose from.",value:"breakpoints"}}),"bins"===n.bin_type?h.max_bins={label:"Max number of Bins",section:" Values",type:"string",order:4,display:"text",default:"10"}:"steps"===n.bin_type?h.step_size={label:"Step Size",section:" Values",type:"number",order:4,display:"text",default:Math.floor(d/10)}:(h.breakpoint_array={label:"Breakpoints",section:" Values",order:4,type:"string",default:`min, ${Math.floor(d/5)}, ${Math.floor(d/4)}, ${Math.floor(d/3)}, ${Math.floor(d/2)}, max`},h.breakpoint_ordinal={label:"Use Equal Sized Columns (Ordinal Bins)",order:4,section:" Values",type:"boolean",display:"select",default:!1}),n.winsorization&&(h.percentile={label:"Percentiles",section:" Values",type:"string",order:7,display:"select",display_size:"half",default:"1_99",values:[{"1% - 99%":"1_99"},{"5% - 95%":"5_95"}]}),a.trigger("registerOptions",h),n.winsorization&&(l=Object(fU.e)(l,c,n.percentile));const p=u[c].valueFormat,g=n.x_axis_value_format;let m=""!==g?g:p;null==m&&(m="#,##0");let b=[];"breakpoints"===n.bin_type&&(b=Object(fU.c)(l,c,n.breakpoint_array,m,"x"));var y,v,x;s("#my-vega",{$schema:"https://vega.github.io/schema/vega-lite/v4.json",config:{view:{stroke:"transparent"}},data:{values:"breakpoints"===n.bin_type?b:l},width:.9*e.clientWidth,height:.8*e.clientHeight,padding:20,selection:{highlight:{type:"single",empty:"none",on:"mouseover"}},mark:{type:"bar",cursor:"pointer"},encoding:{x:{type:n.breakpoint_ordinal?"ordinal":"quantitative",...n.breakpoint_ordinal&&{sort:["order"]},...!n.breakpoint_ordinal&&{bin:{..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size<=Math.floor(d/200)?Math.floor(d/200):n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}}},field:"breakpoints"===n.bin_type?n.breakpoint_ordinal?"label":"bin_start_x":c,axis:{title:""===n.x_axis_override?u[c].title:n.x_axis_override,titleFontSize:n.x_axis_title_font_size,labelFontSize:n.x_axis_label_font_size,labelAngle:-1*n.x_axis_label_angle,format:"d",grid:n.x_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.x_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},..."breakpoints"===n.bin_type&&!1===n.breakpoint_ordinal&&{x2:{field:"bin_end_x"}},y:{type:"quantitative",..."breakpoints"!==n.bin_type&&{aggregate:"count"},..."breakpoints"===n.bin_type&&{field:"count_x"},axis:{title:""===n.y_axis_override?"Count of "+u[f].title:n.y_axis_override,titleFontSize:n.y_axis_title_font_size,labelFontSize:n.y_axis_label_font_size,labelAngle:-1*n.y_axis_label_angle,grid:n.y_grids,titleFontWeight:"normal",titleFont:sU.a,labelFont:sU.a,labelSeparation:100-n.y_label_separation,labelOverlap:!0,labelColor:"#696969",titleColor:"#696969",titlePadding:25}},color:{condition:{selection:"highlight",value:n.color_on_hover},value:n.color_col},tooltip:(y=u[c],v=n.x_axis_override,x={..."bins"===n.bin_type&&{maxbins:n.max_bins},..."steps"===n.bin_type&&{step:n.step_size},..."breakpoints"===n.bin_type&&{binned:!0}},[{title:""!==v?v:y.title,bin:x,field:x.binned?"label":y.lookerName.replace(".","_"),type:x.binned?"ordinal":"quantitative"},{title:"Count of Records",type:"quantitative",...!x.binned&&{aggregate:"count"},...x.binned&&{field:"count_x"}}])}},{actions:!1,renderer:"svg",tooltip:{theme:"custom"}}).then(({spec:t,view:e})=>{Object(sU.b)(),Object(sU.e)(n,"simple",m),i.print?o():(e.addEventListener("mousemove",(t,e)=>{!function(t,e,n,r,i){if(void 0===e||void 0===r||"transparent"===r.stroke||"breakpoints"===e.bin_type)return;const o=t=>t.replace(/\u2013|\u2014|\u2212/g,"-");let[a,s]=(u=(r=>{let i=""!==e.x_axis_override?e.x_axis_override:t[n].title;return r.tooltip[i].split(" ")})(r),[nU.a.format(i,Number(o(u[0]))),nU.a.format(i,Number(o(u[2])))]);var u;tU.a("td.value").text(a+" - "+s)}(u,n,c,e,m)}),e.addEventListener("click",(function(t,e){if(void 0===e.datum)return;const i=u[c].lookerName,o="breakpoints"===n.bin_type?["bin_start_x","bin_end_x"]:Object.keys(e.datum).filter(t=>t.includes(c));let a=e.datum.links,s=l[0].links,f=[];for(let t of r.fields.dimension_like.concat(r.fields.measure_like))f.push(t.name);if(s.length<1)a=[];else{s=s.filter(t=>t.url.includes("/explore/"))[0].url.split("?")[0];let t=`${s}?fields=${f.join(",")}`;if(t+=`&f[${i}]=[${e.datum[o[0]]}, ${e.datum[o[1]]})`,void 0!==r.applied_filters){let e=r.applied_filters;for(let n in e)t+=`&f[${e[n].field.name}]=${e[n].value}`}a=[{label:`Show ${"breakpoints"===n.bin_type?e.datum.count_x:e.datum.__count} Records`,type:"drill",type_label:"Drill into Records",url:t}]}LookerCharts.Utils.openDrillMenu({links:a,event:t})})))})}n(96);looker.plugins.visualizations.add({options:rU,create:function(t,e){t.appendChild(document.createElement("div")).setAttribute("id","my-vega")},updateAsync:function(t,e,n,r,i,o){if(0===t.length)return this.addError({title:"No Results"}),void o();if("binned_hist"===n.bin_style){if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:2,max_measures:void 0}))return;vU(t,e,n,r,i,o,this,QI)}else{if(!Object(fU.b)(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:1,max_measures:void 0}))return;xU(t,e,n,r,i,o,this,QI)}o()}})},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d-t.getMinutes()*i.c)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*i.d)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*i.b)}),(function(t,e){return(e-t)/i.b}),(function(t){return t.getUTCHours()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object(r.a)((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*i.c)}),(function(t,e){return(e-t)/i.c}),(function(t){return t.getUTCMinutes()}));e.a=o;o.range},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(r.a)(e)/3)))-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r=n(15);e.a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Object(r.a)(e)-Object(r.a)(t))+1}},function(t,e,n){"use strict";var r=n(15);e.a=function(t){return Math.max(0,-Object(r.a)(Math.abs(t)))}},function(t,e,n){"use strict";var r={},i={};function o(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function a(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function s(t,e){var n=t+"",r=n.length;return r9999?"+"+s(e,6):s(e,4))+"-"+s(t.getUTCMonth()+1,2)+"-"+s(t.getUTCDate(),2)+(o?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"."+s(o,3)+"Z":i?"T"+s(n,2)+":"+s(r,2)+":"+s(i,2)+"Z":r||n?"T"+s(n,2)+":"+s(r,2)+"Z":"")}e.a=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function s(t,e){var o,a=[],s=t.length,u=0,l=0,c=s<=0,f=!1;function d(){if(c)return i;if(f)return f=!1,r;var e,o,a=u;if(34===t.charCodeAt(a)){for(;u++=s?c=!0:10===(o=t.charCodeAt(u++))?f=!0:13===o&&(f=!0,10===t.charCodeAt(u)&&++u),t.slice(a+1,e-1).replace(/""/g,'"')}for(;u