text: (this.webpackJsonpfrontend=this.webpackJsonpfrontend||[]).push([[0],{184:function(t,e,a){},185:function(t,e,a){},378:function(t,e,a){},379:function(t,e,a){"use strict";a.r(e);var c=a(4),n=a(1),s=a.n(n),r=a(48),i=a.n(r),j=(a(184),a(80)),o=a(76),l=a(77),b=a(82),d=a(81),h=(a(185),a(19)),x=function(t){Object(b.a)(a,t);var e=Object(d.a)(a);function a(){return Object(o.a)(this,a),e.apply(this,arguments)}return Object(l.a)(a,[{key:"render",value:function(){var t=this.props,e=t.x,a=t.y,n=t.payload;return Object(c.jsx)("g",{transform:"translate(".concat(e,",").concat(a,")"),children:Object(c.jsx)("text",{x:0,y:0,dy:16,textAnchor:"end",fill:"#666",transform:"rotate(-35)",children:n.value})})}}]),a}(n.Component),O=function(t){Object(b.a)(a,t);var e=Object(d.a)(a);function a(){return Object(o.a)(this,a),e.apply(this,arguments)}return Object(l.a)(a,[{key:"render",value:function(){return Object(c.jsx)("div",{className:"BARCHART",children:Object(c.jsxs)(h.c,{width:540,height:300,data:this.props.data.data,margin:{top:30,right:30,left:20,bottom:50},children:[Object(c.jsx)(h.e,{dataKey:"date",tick:Object(c.jsx)(x,{}),reversed:!0}),Object(c.jsx)(h.f,{dataKey:this.props.data.key,domain:["auto","auto"]}),Object(c.jsx)(h.a,{strokeDasharray:"5 5"}),Object(c.jsx)(h.d,{}),Object(c.jsx)(h.b,{type:"monotone",dataKey:this.props.data.key,stroke:this.props.data.color,activeDot:{r:8}})]})})}}]),a}(n.Component),u=a(149),f=a.n(u);a(378);var p=function(){var t=Object(n.useState)(""),e=Object(j.a)(t,2),a=e[0],s=e[1],r=Object(n.useState)([]),i=Object(j.a)(r,2),o=i[0],l=i[1];function b(){f.a.get("/getData").then((function(t){l(new Date(t.data[0].date).toDateString()),t.data.forEach((function(t){t.date=new Date(t.date).toLocaleTimeString()})),s(t.data)})).catch((function(t){console.log(t)}))}Object(n.useEffect)((function(){b(),setInterval((function(){b()}),3e4)}),[]);var d={data:a,key:"pmt_2_5",color:"blue"},h={data:a,key:"aqi_2_5",color:"blue"},x={data:a,key:"pmt_10",color:"red"},u={data:a,key:"aqi_10",color:"red"};return Object(c.jsx)("div",{className:"App",children:Object(c.jsxs)("div",{class:"container",children:[Object(c.jsx)("nav",{class:"navbar navbar-light bg-light",children:Object(c.jsx)("a",{class:"navbar-brand",children:"Real Time AQI and PM of Santa Clara County"})}),Object(c.jsx)("br",{}),Object(c.jsx)("p",{class:"font-weight-bold",children:"AQI Table"}),Object(c.jsx)("img",{src:"/tq.png",alt:"AQI Table",width:"648",height:"382"}),Object(c.jsxs)("p",{class:"font-weight-bold",children:["Based on the value of real-time AQI 2.5 you can determine if the air quality is safe.",Object(c.jsx)("br",{}),"The numerical value in the table represent the value of AQI 2.5."]}),Object(c.jsxs)("div",{class:"row",children:[Object(c.jsxs)("div",{class:"col",children:[Object(c.jsx)("br",{}),Object(c.jsx)("p",{class:"font-weight-bold",children:"PM 2.5 Chart Real-Time"}),Object(c.jsx)(O,{data:d}),"X Axis = Time (PDT) ",o," ",Object(c.jsx)("br",{})," Y Axis = PM (Particulate Matter) 2.5"]}),Object(c.jsxs)("div",{class:"col",children:[Object(c.jsx)("br",{}),Object(c.jsx)("p",{class:"font-weight-bold",children:"AQI 2.5 Chart Real-Time"}),Object(c.jsx)(O,{data:h}),"X Axis = Time (PDT) ",o," ",Object(c.jsx)("br",{})," Y Axis = AQI (Air Quality Index) 2.5"]})]}),Object(c.jsxs)("div",{className:"row",children:[Object(c.jsxs)("div",{class:"col",children:[Object(c.jsx)("br",{}),Object(c.jsx)("p",{class:"font-weight-bold",children:"PM 10 Chart Real-Time"}),Object(c.jsx)(O,{data:x}),"X Axis = Time (PDT) ",o," ",Object(c.jsx)("br",{})," Y Axis = PM (Particulate Matter) 10"]}),Object(c.jsx)("br",{}),Object(c.jsxs)("div",{class:"col",children:[Object(c.jsx)("br",{}),Object(c.jsx)("p",{class:"font-weight-bold",children:"AQI 10 Chart Real-Time"}),Object(c.jsx)(O,{data:u}),"X Axis = Time (PDT) ",o," ",Object(c.jsx)("br",{})," Y Axis = AQI (Air Quality Index) 10"]})]})]})})},v=function(t){t&&t instanceof Function&&a.e(3).then(a.bind(null,381)).then((function(e){var a=e.getCLS,c=e.getFID,n=e.getFCP,s=e.getLCP,r=e.getTTFB;a(t),c(t),n(t),s(t),r(t)}))};i.a.render(Object(c.jsx)(s.a.StrictMode,{children:Object(c.jsx)(p,{})}),document.getElementById("root")),v()}},[[379,1,2]]]);
  //# sourceMappingURL=main.9e06160b.chunk.js.map