(window.webpackJsonp=window.webpackJsonp||[]).push([[504],{1157:function(t,r,e){"use strict";e.r(r);e(4),e(8),e(23),e(25),e(40),e(31),e(17),e(5),e(41),e(43),e(32);var o=e(891);function n(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(!t)return;if("string"==typeof t)return l(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return l(t,r)}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,c=!0,d=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return c=t.done,t},e:function(t){d=!0,n=t},f:function(){try{c||null==e.return||e.return()}finally{if(d)throw n}}}}function l(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,e=new Array(r);i<r;i++)e[i]=t[i];return e}o.f.register(o.j,o.m,o.i,o.e,o.k,o.l,o.h,o.p,o.q);var c={name:"ChartGranulometria",props:{granulometria:{type:Array,default:function(){return[]},required:!0},onlyGranulometria:{type:Boolean,default:function(){return!1}}},data:function(){return{datasets:[{label:"Granulometria",data:[],backgroundColor:"#ff0000",hoverBackgroundColor:"#fff0",borderColor:"#ff0000"},{label:"Limite inferior",data:[],backgroundColor:"#454545",hoverBackgroundColor:"#fff0",borderColor:"#454545"},{label:"Limite superior",data:[],backgroundColor:"#454545",hoverBackgroundColor:"#fff0",borderColor:"#454545"},{label:"Faixa Trab. Inf.",data:[],backgroundColor:"#00348A",hoverBackgroundColor:"#fff0",borderColor:"#00348A"},{label:"Faixa Trab. Sup.",data:[],backgroundColor:" #00348A",hoverBackgroundColor:"#fff0",borderColor:"#00348A"}],baseChart:{},chartCtx:null,customAxis:null,labelsAxis:[],chartData:{datasets:[]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},plugins:{legend:{position:"right"},title:{display:!0,text:"Distribuição Granulométrica",font:{size:14}},tooltip:{callbacks:{}}},scales:{x:{bounds:"ticks",display:!0,type:"logarithmic",min:.01,max:100,title:{display:!0,text:"Abertura (mm)"},ticks:{crossAlign:"center",major:{enabled:!0}}},y:{display:!0,title:{display:!0,text:"Passando (%)"}}}}}},watch:{onlyGranulometria:function(t){console.log("onlyGranulometria",t),this.chartData.datasets=t?[this.datasets[0]]:this.datasets,this.baseChart.update()},granulometria:{deep:!0,handler:function(t,r){this.baseChart.destroy(),this.mountedChart();var e=this.datasets;e[0].data=[],e[1].data=[],e[2].data=[],e[3].data=[],e[4].data=[];for(var o=100,n=0,l=t.length-1;l>=0;l--){var c=t[l],d=c.valorAbertura;d<o&&(o=d),d>n&&(n=d),e[0].data.push({x:d,y:c.percPassando}),e[1].data.push({x:d,y:c.limiteInicial}),e[2].data.push({x:d,y:c.limiteFinal}),e[3].data.push({x:d,y:c.faixaTrabalhoInicial}),e[4].data.push({x:d,y:c.faixaTrabalhoFinal})}this.chartData.datasets=this.onlyGranulometria?[e[0]]:e,this.options.scales.x.min=o,this.options.scales.x.max=n,this.baseChart.update()}}},mounted:function(){this.mountedChart()},methods:{mountedChart:function(){this.chartCtx=document.getElementById("chart-granulometria");var t=this.granulometria;this.customAxis={id:"custom-axis-draw",beforeDraw:function(r){var e=r.ctx,o=r.scales.x;if(void 0!==o){var l=r.scales.x.bottom;e.save(),e.beginPath();var c,d=n(t);try{for(d.s();!(c=d.n()).done;){var f=c.value,h=o.getPixelForValue(f.valorAbertura);h&&(e.font="bold 10px Arial",e.fillStyle="#333333",e.fillText("fundo"!==f.descricaoPeneira.toLowerCase()?f.descricaoPeneira:"",h-12,l-18))}}catch(t){d.e(t)}finally{d.f()}}e.lineWidth=1,e.stroke(),e.restore()}},this.options.plugins.tooltip.callbacks.footer=function(r){var e="";return r.forEach((function(r){var o,l=r.parsed.x,c=n(t);try{for(c.s();!(o=c.n()).done;){var d=o.value;if(d.valorAbertura===l&&"fundo"!==d.descricaoPeneira.toLowerCase()){e=d.descricaoPeneira;break}}}catch(t){c.e(t)}finally{c.f()}})),e},this.baseChart=new o.f(this.chartCtx,{type:"line",data:this.chartData,options:this.options,plugins:[this.customAxis]})}}},d=e(42),component=Object(d.a)(c,(function(){var t=this,r=t.$createElement;t._self._c;return t._m(0)}),[function(){var t=this.$createElement,r=this._self._c||t;return r("div",{staticClass:"col-12 d-flex align-items-center justify-content-center"},[r("div",{staticStyle:{position:"relative",height:"70vh",width:"80vw"},attrs:{id:"chart-container"}},[r("canvas",{attrs:{id:"chart-granulometria"}})])])}],!1,null,null,null);r.default=component.exports}}]);
//# sourceMappingURL=418637a-1.2.11.js.map