<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ayush Bansal on Medium]]></title>
        <description><![CDATA[Stories by Ayush Bansal on Medium]]></description>
        <link>https://medium.com/@ayu023ban?source=rss-8c649dfc5a64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qfZE2uLGTF0f44hhraX2Xg.jpeg</url>
            <title>Stories by Ayush Bansal on Medium</title>
            <link>https://medium.com/@ayu023ban?source=rss-8c649dfc5a64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:59:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayu023ban/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React Hooks With Context]]></title>
            <link>https://ayu023ban.medium.com/react-hooks-with-context-7273e321b873?source=rss-8c649dfc5a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/7273e321b873</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[usecontext]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-hook]]></category>
            <dc:creator><![CDATA[Ayush Bansal]]></dc:creator>
            <pubDate>Mon, 27 Dec 2021 10:30:07 GMT</pubDate>
            <atom:updated>2021-12-27T10:30:07.178Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I had to make functionality to show and hide Help button at different pages. The first thing the comes to our mind is we can make the button component in every page that needs to be shown. Right? But when we say it out loud then we notice that we have to mount the button at every page and also the button was being generated by third party API (Freshworks) so we have to load javascript again and again in every visible page.</p><p>Let’s go through the whole mind process in creating the functionality and try to make it a bit more better. Let’s import the component in the root component so that the button is visible at any page by default. And hide the function at required pages. Here comes the functionality of custom hook handy.</p><h3>But what is a custom hook?</h3><p>According to React’s official document: `<strong>A custom Hook is a JavaScript function whose name starts with ”use” and that may call other Hooks</strong>`</p><p>So a hook is just a javascript function basically in which we will define logic to show and hide the help button.</p><pre>export const useHelp = () =&gt; {<br>  const show = () =&gt; {};<br>  const hide = () =&gt; {};</pre><pre>  return { show, hide };<br>};</pre><p>But I wanted to show the button by default and in the above logic once the hide function is called then it will be hidden even if the user changes the route. To solve This we have to add a listener which calls show method whenever route changes.</p><pre>export const useHelp = () =&gt; {</pre><pre>  useEffect(() =&gt; {<br>    history.listen(() =&gt; {<br>	show()<br>    });<br>  }, []);<br> </pre><pre>  const show = () =&gt; {<br>  };<br>  const hide = () =&gt; {<br>  };</pre><pre>  return { show, hide };<br>};</pre><p>But I wanted to make a third part (Boot) which loads the help api button for the first time. Up until now I was just adding the script in public.html but to me it feels like hard coding. So I decided to add a custom helper function to add script dynamically into the Dom:</p><pre>export function loadScript(src = &#39;&#39;, innerHTML = &#39;&#39;) {<br>  return new Promise(resolve =&gt; {<br>    const script = document.createElement(&#39;script&#39;);<br>    script.src = src;<br>    script.innerHTML = innerHTML;<br>    script.onload = () =&gt; {<br>      resolve(true);<br>    };<br>    script.onerror = () =&gt; {<br>      resolve(false);<br>    };<br>    document.body.appendChild(script);<br>  });<br>}</pre><p>So Now my hooks look like this:</p><pre>export const useHelp = () =&gt; {</pre><pre>  useEffect(() =&gt; {<br>    history.listen(() =&gt; {<br>	show()<br>    });<br>  }, []);<br> </pre><pre>  const show = () =&gt; {<br>  };<br>  const hide = () =&gt; {<br>  };</pre><pre>  const boot = () =&gt; {<br>    loadScript(<br>      ‘Script_address’<br>    )<br>  };<br></pre><pre>  return { show, hide , boot};<br>};</pre><p>But then here came another problem: Whenever I call the boot function then it loads the script asynchronously and Show or hide functions were already called by that time. So I needed to save the state of the page whether it should show the button or not in a variable.</p><pre>export const useHelp = () =&gt; {<br>  useEffect(() =&gt; {<br>    history.listen(() =&gt; {<br>      show();<br>    });<br>  }, []);</pre><pre>  const [showHelp, setShowHelp] = useState(true);</pre><pre>  const hideShowHelp = show =&gt; {<br>    if (show) {<br>      // logic to show button<br>    } else {<br>      // logic to hide button<br>    }<br>  };</pre><pre>  useEffect(() =&gt; {<br>    hideShowHelp(showHelp);<br>  }, [showHelp]);</pre><pre>  const show = () =&gt; {<br>    setShowHelp(true);<br>  };<br>  const hide = () =&gt; {<br>    setShowHelp(false);<br>  };</pre><pre>  const boot = () =&gt; {<br>    loadScript(&#39;Script_address&#39;).then(() =&gt; hideShowHelp(showHelp));<br>  };</pre><pre>  return { show, hide, boot };<br>};</pre><p>Now When it seemed like it’s almost complete then came a bug. Now it shows error that we cannot change state on an unmounted compound. Whyyyyyy God. This is happening because when the route changes then our hook gets disconnected from the Dom and then the state cannot be updated. To solve this we need to use context so that our state would be accessible from anywhere in the tree.</p><h3>But What is React Context?</h3><p>According to ‘Geeks For Geeks’: `<strong>React Context is a method to pass props from parent to child component(s), by storing the props in a store(similar in Redux) and using these props from the store by child component(s) without actually passing them manually at each level of the component tree.</strong>`</p><p>Now that we know what react context is lets add this…</p><pre>const HelpContext = createContext(null);</pre><pre>export const HelpProvider = ({ children }) =&gt; {<br>  const [show, setShow] = useState(true);<br>  const history = useHistory();<br>  const [isBooted, setIsBooted] = useState(false);</pre><pre>  useEffect(() =&gt; {<br>    history.listen(() =&gt; {<br>      setShow(true); // By default set it to true whenever we changes the page.<br>    });<br>  }, []);</pre><pre>  useEffect(() =&gt; {<br>    // Code to show/hide the button through api<br>  }, [show, isBooted]);</pre><pre>  return (<br>    &lt;HelpContext.Provider value={{ setShow }}&gt;{children}&lt;/HelpContext.Provider&gt;<br>  );<br>};</pre><p>We wrap the HelpProvider around the root component then we can access the state from anywhere . So lets use this in our code now and here is our final code::</p><pre>import React, { createContext, useContext, useEffect, useState } from &#39;react&#39;;<br>import PropTypes from &#39;prop-types&#39;;<br>import { useHistory } from &#39;react-router&#39;;<br>import { loadScript } from &#39;../utils/loadScript&#39;;</pre><pre>const HelpContext = createContext(null);</pre><pre>export const HelpProvider = ({ children }) =&gt; {<br>  const [show, setShow] = useState(true);<br>  const history = useHistory();<br>  const [isBooted, setIsBooted] = useState(false);</pre><pre>  useEffect(() =&gt; {<br>    history.listen(() =&gt; {<br>      setShow(true);<br>    });<br>  }, []);</pre><pre>  useEffect(() =&gt; {<br>    if (show) {<br>      //logic to show widget<br>    } else {<br>      // logic to hide widget<br>    }<br>  }, [show, isBooted]);<br>  return (<br>    &lt;HelpContext.Provider value={{ setShow, setIsBooted }}&gt;<br>      {children}<br>    &lt;/HelpContext.Provider&gt;<br>  );<br>};</pre><pre>HelpProvider.propTypes = {<br>  children: PropTypes.oneOfType([<br>    PropTypes.arrayOf(PropTypes.node),<br>    PropTypes.node,<br>  ]).isRequired,<br>};</pre><pre>export const useHelp = () =&gt; {<br>  const { setShow, setIsBooted } = useContext(HelpContext);</pre><pre>  const show = () =&gt; {<br>    setShow(true);<br>  };<br>  const hide = () =&gt; {<br>    setShow(false);<br>  };</pre><pre>  const boot = () =&gt; {<br>    loadScript(&#39;path/to/script&#39;).then(() =&gt; {<br>      // Some initialisation<br>      setIsBooted(true);<br>    });<br>  };</pre><pre>  return { show, hide, boot };<br>};</pre><p>Now We can wrap the HelpProvider around the root Component like:</p><pre>&lt;FreshWorksHelpProvider&gt;</pre><pre>&lt;App /&gt;</pre><pre>&lt;/FreshWorksHelpProvider&gt;</pre><p>and call the boot function in the root component.</p><pre>const { boot } = useFreshWorksHelp();</pre><pre>useEffect(() =&gt; {</pre><pre>boot();</pre><pre>}, []);</pre><p>Now on whatever page we want to hide the button we can do this:</p><pre>const { hide } = useFreshWorksHelp();</pre><pre>useEffect(() =&gt; {</pre><pre>hide();</pre><pre>}, []);</pre><h3>Please share your view on this.</h3><p>That’s all for this post I hope this was helpful.</p><p>Keep on learning and keep on <strong>React</strong>ing:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7273e321b873" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2021: Polaris Web Reports]]></title>
            <link>https://ayu023ban.medium.com/gsoc-2021-polaris-web-reports-a9f7a5f95939?source=rss-8c649dfc5a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9f7a5f95939</guid>
            <category><![CDATA[gsoc2021]]></category>
            <category><![CDATA[iit-roorkee]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[polaris]]></category>
            <category><![CDATA[gsoc]]></category>
            <dc:creator><![CDATA[Ayush Bansal]]></dc:creator>
            <pubDate>Wed, 18 Aug 2021 11:13:38 GMT</pubDate>
            <atom:updated>2021-08-19T04:27:17.530Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A tool to generate customizable and rich analysis Reports and make interactive graphs</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmjhvUcQIdN5b48KABxbJA.png" /></figure><h3>Purpose</h3><p>Polaris is an open-source CLI based satellite telemetry analysis tool under Libre Space Foundation umbrella which uses machine learning techniques to satellite data.</p><p>The purpose of my GSoC project was to make two new module commands:</p><ol><li>Polaris Behave The first goal was to make a module which uses a pre-built autoencoder model fromBETSI libraryand detect anomalies in satellite telemetry data and output the results, models, history and normalizers in nicely formatted form.</li><li>Polaris Report The second goal was to use the results of Polaris behave and show them in the interactive formats in a web browser so that users can read them more easily.</li></ol><h3>Demo</h3><p>There is no better way of understanding the project than look and feel on your own. You can look at the demo analysis yourself at <a href="https://librespacefoundation.gitlab.io/polaris/polaris-reports/">https://librespacefoundation.gitlab.io/polaris/polaris-reports/</a></p><p>Here are some of the report sections for you:</p><blockquote>Contribution Graph:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*zr-NDM5uQHpzRmACM0b8fw.png" /></figure><p>The contribution graph is made by counting the number of events that are common in individual telemetry and the overall events. That gives the idea of the number of events in which one telemetry contributed.</p><blockquote>Highlights</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*rdeGkbd77JWN64l88w5K4w.png" /></figure><p>The highlight section shows the summary of the input data such as the number of telemetries, input date range, number of frames captured etc.</p><blockquote>Stacked Graph of telemetry with Anomalies shown as annotations</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*9_ABap52VodEAZbNOR__2w.png" /></figure><blockquote>Compare Individual Telemetry Graphs side by side</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7oPSfBOdbDVVTx03adMHJw.png" /></figure><blockquote>Compare Individual Telemetry Graph on Single Plot</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jJzaBz6JNrGlU_bQfA97Sg.png" /></figure><blockquote>Support For Both Light and Dark Themes</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JVfSXK-3z6-tKscIA-PUMw.png" /></figure><h3>Work</h3><p>Here is the <a href="https://docs.google.com/document/d/14VSv9-pJX3n-a731eAu89w9OchMbIz7fQmFr_2hqxIA/edit?usp=sharing">link</a> to my GSoC proposal if someone wants to look at my original plan: <a href="https://docs.google.com/document/d/14VSv9-pJX3n-a731eAu89w9OchMbIz7fQmFr_2hqxIA/edit?usp=sharing">https://docs.google.com/document/d/14VSv9-pJX3n-a731eAu89w9OchMbIz7fQmFr_2hqxIA/edit?usp=sharing</a></p><p>I learnt a whole bunch of new things during this time. Some of them are:</p><ol><li>I learnt the importance of unit and integration tests. I made test cases for several classes and modules in Polaris.</li><li>I tried out a lot of charting and graph libraries to select the perfect library that was able to handle big data, aesthetically beautiful and future proof.</li><li>I learnt a whole lot about machine learning and auto-encoders. I read a bunch of research papers about anomaly detection, feature importance detection and other stuff.</li><li>I got to know about how important the description of the merge request is when you are working with the collaboration of others. I started to write clearer descriptions, workflow of the merge requests, proof of validation and results in the description for better understanding.</li></ol><p>For the more detailed flow of work and list of MRs you can refer to <a href="https://docs.google.com/spreadsheets/d/1mXaSVNNzrboe82cDyAZ-5tLqAFd6EMmkqpBgScFfhV4/edit?usp=sharing">this Sheet</a>: <a href="https://docs.google.com/spreadsheets/d/1mXaSVNNzrboe82cDyAZ-5tLqAFd6EMmkqpBgScFfhV4/edit?usp=sharing">https://docs.google.com/spreadsheets/d/1mXaSVNNzrboe82cDyAZ-5tLqAFd6EMmkqpBgScFfhV4/edit?usp=sharing</a></p><h3>Future Work</h3><p>Polaris Web Reports is just born, and there is a world of things to do in it. Some major things are:</p><ul><li>Make Supports for Multi-Satellite by URL separation.</li><li>Improve look and feel and responsiveness of the reports.</li><li>Integrate Polaris dependency graph in it to unify the visualization process.</li><li>Use Graph Comparison to get information of telemetry responsible for an anomaly, percentage of responsibility of telemetry, order of importance of telemetry in an anomaly and other micro details.</li><li>Add Support for both normalized graph and un-normalized graph.</li></ul><h3>More than Just an Internship</h3><p>I want to thank the whole Libre Space Foundation and Polaris community for always helping me out with the comprehension of the entire ecosystem. Despite these people’s various engagements, they were responsive, which helped me get my doubts cleared as soon as possible.</p><p>It was a great summer working on this project, and now I am pretty familiar with Polaris development. I would continue to contribute by writing code or encouraging people to do so by reviewing their MR and explaining to them the concepts involved in the project. GSoC is not the end.</p><h3>Links</h3><p>Polaris → <a href="https://gitlab.com/librespacefoundation/polaris/polaris">https://gitlab.com/librespacefoundation/polaris/polaris</a></p><p>Polaris Report -&gt;<a href="https://gitlab.com/librespacefoundation/polaris/polaris-reports">https://gitlab.com/librespacefoundation/polaris/polaris-reports</a></p><p>BETSI -&gt; <a href="https://gitlab.com/librespacefoundation/polaris/betsi">https://gitlab.com/librespacefoundation/polaris/betsi</a></p><p>Feel free to reach out to me on <a href="https://github.com/ayu023ban/">Github</a>, <a href="https://gitlab.com/ayu023ban/">Gitlab</a> or <a href="https://www.linkedin.com/in/ayu023ban/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9f7a5f95939" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My GSoC’21 Journey..]]></title>
            <link>https://ayu023ban.medium.com/my-gsoc21-journey-44d095a45453?source=rss-8c649dfc5a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/44d095a45453</guid>
            <category><![CDATA[polaris]]></category>
            <category><![CDATA[ayu023ban]]></category>
            <category><![CDATA[libre-space-foundation]]></category>
            <category><![CDATA[iit-roorkee]]></category>
            <category><![CDATA[gsoc]]></category>
            <dc:creator><![CDATA[Ayush Bansal]]></dc:creator>
            <pubDate>Sun, 11 Jul 2021 10:11:45 GMT</pubDate>
            <atom:updated>2021-07-11T11:08:15.187Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMmFERGeRrakotlWZl5-Yw.png" /></figure><p>Hi There, As almost half of the time has gone, I am gonna share my overall experience and progress in GSoC programme.</p><h3>20 March 21</h3><p>As you know Google announced which organisations are going to participate this year.</p><p>For two days I didn’t even tried to open the gsoc page to see the organisation pages as I thought I wasn’t prepared to do a shot at GSoC and the only thought in my mind was that why should I even bother to try if I am not ready.</p><p>And then For 2–3 days my friends constantlly asked me like “hey dude, you checked the list😏? Which organisation are you going to apply for?” And I was like ….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*msyH1aIQwcGOJv-myKeeIg.jpeg" /></figure><p>But after that I decided to build courage and look for the organisations once and atleast try to give it a shot. So I looked and filtered out some of the repositories, double checked all the projects of the year and spent 10 hours in that. Then went to IRC channels or mailing groups of most of them and looked for the conversations and activities going on.</p><p>And there Libre Space Foundation caught my attention. It was all that I was looking for. The space stuff, satellites, web development and some coding. That’s it. I will try to participate in it.</p><p>So I looked and filtered out some of the repositories and there Libre Space Foundation caught my attention. It was all that I was looking for. The space stuff, satellites and some coding. That’s it. I will try to participate in it.</p><h3>Fast Forward to May 17, 2021</h3><p>I got the mail from Google and boom… I was on the ninth cloud. I got selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c8kytJj8uCbNNOVPPCITHg.jpeg" /></figure><h3>Introduction</h3><p>The <a href="https://libre.space/">Libre Space Foundation</a> is an open source organization that as a vision has a free and accessible space for everyone. In order to make its vision a reality, people from all over the world are participating in open source technologies that involve both on-earth and off-earth constructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*w7ND4ykhDenWHOwhzvMI8w.png" /></figure><p><a href="https://polarisml.space/">Polaris</a> is a Project under LSF umbrella which aims to apply Machine Learning to Satellite telemetry data and obtain different kinds of useful results and relations. You can also join the discussion at <a href="https://app.element.io/#/room/#polaris:matrix.org">element</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ysj--1GE1EgLS21G" /></figure><p>My Proposal in Polaris is to set up building blocks to detect Anomalies in the satellite telemetry data through command line and to generate interactive Web Based Reports and graphs for the user to visualize better the output results.</p><h3>Mentors</h3><p><a href="https://gitlab.com/redsharpbyte">Red Boumghar</a><br><a href="https://gitlab.com/saintaardvark">Hugh Brown</a></p><h3>Proposal</h3><p>If you guys havn’t seen my proposal to polaris then you can see it here.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.slideshare.net%2Fslideshow%2Fembed_code%2Fkey%2FBV62K2UpEgJZwA&amp;display_name=SlideShare&amp;url=https%3A%2F%2Fwww.slideshare.net%2FAyushBansal122%2Fgsoc-proposal-2021-polaris&amp;image=https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fgsocproposal2021polaris-210710051933-thumbnail-4.jpg%3Fcb%3D1625894378&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=slideshare" width="600" height="640" frameborder="0" scrolling="no"><a href="https://medium.com/media/95f8b2bc448aea34969193f02090b92b/href">https://medium.com/media/95f8b2bc448aea34969193f02090b92b/href</a></iframe><h3>Community Bonding</h3><p>In this time we talked over chat in element channel, did amazing video calls over jitsi platform. The whole community is amazing. There is a huge time-zone gap between as people are from almost 5–6 different timezones but then also we meet regularly with ease. We discussed about the roadmap of what to do in upcoming days and build out a roadmap. I didn’t know much about space telemetry and satellites so I learned a lot from the community.</p><h3>Coding phase begins</h3><p>We planned stuff, fixed bugs. did some sword fights over topics and Merge Requests and Issue Filing became regular thing for me.</p><p>I learnt importance of how to code properly, give proper names to different functions, explain the aims of the code more clearly and a lot more.</p><h3>Work Done</h3><h4><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/184">Add option to show list of supported satellites — MR<strong>184</strong></a></h4><p>Added a new option in command line utility of polaris fetch to list all possible satellites that it supports in `polaris fetch` command</p><h4><strong>Make </strong><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/196"><strong>AnomalyDetectorConfigurator</strong></a><strong> &amp;&amp; </strong><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/192"><strong>AnomalyDetectorParameters</strong></a><strong> Class — </strong><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/192"><strong>MR192</strong></a><strong> &amp;&amp; </strong><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/196"><strong>MR196</strong></a></h4><p>Make classes for Configurator and parameters of configurator that will be used and would be changable by user and will be used in anomalyDetector</p><h4><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/199">Revamp detector.py Into AnomalyDetector class — MR<strong>199</strong></a></h4><p>Revamp the old detector.py file which contained some functions to detect the anomalies to a Class AnomalyDetector which contained to train, test, detect events and save data. It also uses AnomallyDetectorConfigurator for customizable hyperparameters by users</p><h4><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/202">Output Result Of AnomalyDetector with AnomalyOutput — MR<strong>202</strong></a></h4><p>Make a class to output the results of AnomalyDetector into a nicely formatted json file. The output json contains events detected, metadata of satellite and original values of telemetry.</p><h4><a href="https://gitlab.com/librespacefoundation/polaris/polaris/-/merge_requests/204">Add New Command `Polaris behave` — MR<strong>204</strong></a></h4><p>Add a brand new command polaris behave for command line interface to take input data generated from polaris fetch and detect and output the results from command line itself.</p><h3>Some Initial Graphs generated from AnomalyDetector</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Co03Khodi7tv24_eeIiE3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*G1PEK46_0YzSE6-c06w1Lw.png" /></figure><h3>What’s Next</h3><p>The next goal is to make web based graphs denoting the data and events detected in interactive formats.</p><p>The reports will several functionality like picking a specific date or date range to view the data of a specific window of time. There will be stacked graphs of telemetry and also graphs of individual parameters along with highlights of anomalies detected. And hopefully other functionalities like exporting these reports in different formats like pdf or exporting graphs in image formats etc.</p><p>Also As The project move forwards there is a lot of future work to do like predicting telemetry responsible for anomaly by graph comparison, NaN filling strategies and other kind of data cleaning, timeseries reordering, etc.</p><h3>About Me</h3><p>I am Ayush Bansal, Currently I am pursuing Bachelors in Technology in Electronics and Communications Engineering in Indian Institure of Technology Roorkee. I like Web Development and machine learning.</p><p>Apart from coding I like badminton, movies and riding bike with friends.</p><p>You can contact me by any of the following link.</p><p>Github: <a href="https://github.com/ayu023ban">https://github.com/ayu023ban</a></p><p>Gitlab: <a href="https://gitlab.com/ayu023ban">https://gitlab.com/ayu023ban</a></p><p>Email: ayu023ban@gmail.com</p><p>LinkedIn: <a href="https://www.linkedin.com/in/ayu023ban/">https://www.linkedin.com/in/ayu023ban/</a></p><h3>In The End</h3><p>I am grateful to all the polaris members for helping me out and answering my stupid questions. You all are the coolest………………….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44d095a45453" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Updating Component On Receiving Props And Use of ComponentDidUpdate]]></title>
            <link>https://medium.com/swlh/updating-component-on-receiving-props-and-use-of-componentdidupdate-3cd0db7fbd9f?source=rss-8c649dfc5a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cd0db7fbd9f</guid>
            <category><![CDATA[react-component-lifecycle]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-components]]></category>
            <category><![CDATA[props-and-state]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ayush Bansal]]></dc:creator>
            <pubDate>Sun, 07 Jun 2020 03:48:47 GMT</pubDate>
            <atom:updated>2020-06-10T11:40:21.342Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n7V4Kv9IKpf_UQfxsMsmEA.jpeg" /></figure><h4>Everyday is an adventure when you start using a new framework.</h4><p>When building a component using React there is often a requirement to create a side effect when one of the component props changes. This could be a call to an API to fetch some data, manipulating the DOM, updating some component state, or any number of things. I will show you how to do this both in class Component.</p><h3>Class Component</h3><p>Whenever a class component is updated (either it’s props or state is changed) then <strong>ComponentDidUpdate</strong> function is Called.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a00e1c86cbd8588826fe94a742bc8304/href">https://medium.com/media/a00e1c86cbd8588826fe94a742bc8304/href</a></iframe><p>The first parameter of the function is previous props which is the props before the updation.The other two parameters are previous state and snapshot(we will talk about snapshot later).</p><p>When using <a href="https://eslint.org/">es-lint</a>, you may see an error or a warning about setting state inside the componentDidUpdate method. Setting state inside this method without any guard can cause an infinite loop, as setting state will triggering of componentDidUpdate and this causes infinite loop.</p><p>The Way to handle update is to use if statement which allows the setState function to trigger only when the previous props is not equal to the current props.</p><h3>Example</h3><p>Lets understand this with an example…</p><p>In this example there will be a parent Component and a child Component.</p><p>The <strong>parent Component</strong> Contains a button and a child component. The parent component gives the text to the child component. The button clicking triggers the changing of the text of the parent component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbf366d53a617c70f8f524f938fb4a31/href">https://medium.com/media/fbf366d53a617c70f8f524f938fb4a31/href</a></iframe><p>Now Coming to the <strong>Child Component </strong>it contains two state:color and text. Text is what we want to render and color is the change that we want to render after the clicking.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c53cac9252b3621026bc01fc594be1a1/href">https://medium.com/media/c53cac9252b3621026bc01fc594be1a1/href</a></iframe><h3>GetSnapshotBeforeUpdate</h3><p>The getSnapshotBeforeUpdate() method can also be used to test for changes to props. This method is invoked right before the most recently rendered output is committed to e.g. the DOM.Any value returned by this life cycle will be passed as a parameter to componentDidUpdate() as the third parameter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be67524d39b0e40f19e75c0f4d64fac3/href">https://medium.com/media/be67524d39b0e40f19e75c0f4d64fac3/href</a></iframe><h3>Updating</h3><p>An update can be caused by changes to props or state. These methods are called in the following order when a component is being re-rendered:</p><ul><li>static getDerivedStateFromProps()</li><li>shouldComponentUpdate()</li><li>render()</li><li>getSnapshotBeforeUpdate()</li><li>componentDidUpdate()</li></ul><p>Please share your view on this.</p><p>That’s all for this post I hope this was helpful.</p><p>Keep on learning, keep on <strong>React</strong>ing and <strong>form</strong>ing :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cd0db7fbd9f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/updating-component-on-receiving-props-and-use-of-componentdidupdate-3cd0db7fbd9f">Updating Component On Receiving Props And Use of ComponentDidUpdate</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>