<?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 Rohan Shiva on Medium]]></title>
        <description><![CDATA[Stories by Rohan Shiva on Medium]]></description>
        <link>https://medium.com/@rhnshiva?source=rss-6bc8c1565dcc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nze-KWk-XsQ3GAUa.jpg</url>
            <title>Stories by Rohan Shiva on Medium</title>
            <link>https://medium.com/@rhnshiva?source=rss-6bc8c1565dcc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:58:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rhnshiva/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[Tiger Graph + Streamlit → Dynamically Visualize South Korea COVID-19 Data]]></title>
            <link>https://rhnshiva.medium.com/tiger-graph-streamlit-dynamically-visualize-south-korea-covid-19-data-c197f1200e27?source=rss-6bc8c1565dcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c197f1200e27</guid>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[tigergraph]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[gsql]]></category>
            <dc:creator><![CDATA[Rohan Shiva]]></dc:creator>
            <pubDate>Fri, 29 May 2020 16:34:18 GMT</pubDate>
            <atom:updated>2020-08-04T01:59:15.611Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Getting started</strong></h3><p>Tiger graph is a super fast an intuitive graph database. In this article, we will grabbing data from a graph database and explore the data by using streamlit’s visualization tools.</p><h4><strong>Agenda</strong></h4><p>Setting up Tiger Graph</p><p>Connecting Tiger Graph and Python</p><p>Making a query to get some data</p><p>Intro to Streamlit</p><p>Using our query and Streamlit</p><h4><strong>Setting up Tiger Graph Account</strong></h4><p>Head over to tgcloud.io and login to your account, if you haven’t already make a new account. After you log in, navigate to “My Solutions” and create a solution.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FQew0m5J%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FQew0m5J&amp;image=https%3A%2F%2Fi.imgur.com%2FQew0m5J.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="869" frameborder="0" scrolling="no"><a href="https://medium.com/media/36c8e56c713cca2fc15ea0b9af369c51/href">https://medium.com/media/36c8e56c713cca2fc15ea0b9af369c51/href</a></iframe><p>In this article, we will use the COVID-19 Analysis starter kit to explore Tiger Graph and Streamlit. I will be setting up a basic free box with 50gb of storage. Next, name your solution, give your box a password, and a little description.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FkSl7jPg%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FkSl7jPg&amp;image=https%3A%2F%2Fi.imgur.com%2FkSl7jPg.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="842" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8a24f81d87e69c2aa93d2c5d80d1ba8/href">https://medium.com/media/c8a24f81d87e69c2aa93d2c5d80d1ba8/href</a></iframe><p>Now it’s time to grab a coffee and wait for the box to be ready. After the solution is ready, click on the applications icon and head over to graph studio.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FBHygJPv%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FBHygJPv&amp;image=https%3A%2F%2Fi.imgur.com%2FBHygJPv.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="842" frameborder="0" scrolling="no"><a href="https://medium.com/media/4eced02faca58f9b27d4d72cf92b39ed/href">https://medium.com/media/4eced02faca58f9b27d4d72cf92b39ed/href</a></iframe><p>This is your graph studio, you can design, load data, explore, and write queries here — it is awesome! If you want to learn more about this specific graph database, <a href="https://www.youtube.com/watch?v=s6-QapCEz1M">check out this amazing video</a> by <a href="https://medium.com/u/571f80cc8b69">Jon Herke</a> who created this graph. The video walks you through the setup process and explores the graph and queries. In this article, I will be focusing more on connecting the graph database with python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pXKPSmCbI2eKe8X6eU6ilA.png" /></figure><p>Now that we have our graph ready, let’s connect the graph to python.</p><p>First, we need to install <a href="https://pypi.org/project/pyTigerGraph/"><em>pyTigerGraph</em></a>, a simple python library developed by <a href="https://medium.com/u/2406ce10c3">Parker Erickson</a>.</p><p>You can install pyTigerGraph by simply running this command</p><pre>pip install pyTigerGraph</pre><p>Now we need to grab some secret credentials from our Graph Studio. Head over to Admin — User Management and make a new secret. We will use this secret to create a token. The token is used to make calls to the built-in REST endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUfBKHKnI2rU34RaCkvACg.png" /></figure><p>We can generate a token by running the following code block. Here we are using the functions from pyTigerGraph to make a connection. “host” is the domain of your graph studio, and replace the SECRET from the getToken with your custom secret. If you want to learn more about pyTigerGraph, check out <a href="https://medium.com/@parker.erickson/intro-to-pytigergraph-39eaf62e6232">Parker Erickson’s article on Intro to pyTigerGraph</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*nJTzZOj1XEs51ukozSObzg.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3321b90984be73f662a1e7b3adf0dfab/href">https://medium.com/media/3321b90984be73f662a1e7b3adf0dfab/href</a></iframe><p>Now that we have our token and secret we can make a call to one of our endpoints to run a query. Let’s make a query to get the Age, Sex, Latitude, and Longitude of every patient from the South Korea COVID-19 dataset.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05ac6dc81aca648e0662892679d19cda/href">https://medium.com/media/05ac6dc81aca648e0662892679d19cda/href</a></iframe><h4><strong>Intro to Streamlit</strong></h4><p>Streamlit is an open-source python library that allows you to build beautiful web apps to visualize anything (Machine Learning, Data, and Data Science). In this article, we will dive into the Streamlit, and explore some of the features that streamlit offers!</p><p><strong>Installing and Setting up Streamlit</strong></p><p>Installing streamlit is super simple</p><pre>pip install streamlit</pre><p><strong>Creating an App</strong></p><p>Now, create a file named app.py and import streamlit</p><pre>import streamlit as st</pre><p>Every good app has a title, so lets add one</p><pre>st.title(&#39;Exploring Streamlit&#39;)</pre><p>You can run the app by simply opening the terminal in the folder and running the following command. The FILENAME for us is app.py</p><pre>streamlit run FILENAME<br>streamlit run app.py</pre><p>The app will then run on your local machine and open in a browser!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FarrZtto%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FarrZtto&amp;image=https%3A%2F%2Fi.imgur.com%2FarrZtto.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="644" frameborder="0" scrolling="no"><a href="https://medium.com/media/55640eb82f84e0bbb1f999529656256e/href">https://medium.com/media/55640eb82f84e0bbb1f999529656256e/href</a></iframe><h4><strong>Let’s make a simple addition calculator</strong></h4><pre>st.write(&#39;## Add interactions using widgets!&#39;)<br>a <strong>=</strong> st.slider(&#39;Number 1&#39;)<br>b <strong>=</strong> st.slider(&#39;Number 2&#39;)<br>st.write(&#39;Answer is&#39;, a <strong>+</strong> b)</pre><p>Streamlit automatically detects file changes and prompts you to rerun the app</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FO6ZzVir%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FO6ZzVir&amp;image=https%3A%2F%2Fi.imgur.com%2FO6ZzVir.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="918" frameborder="0" scrolling="no"><a href="https://medium.com/media/375182c2732ba5f2bfe18b8c30f720ff/href">https://medium.com/media/375182c2732ba5f2bfe18b8c30f720ff/href</a></iframe><p><strong>Congratulations</strong> you have successfully built your first streamlit app!</p><p>Now let’s try something more fun. I am using the Titanic Dataset from Kaggle to explore some of streamlit features. I am using pandas to read the data. If you don’t already know about pandas, it is a super popular python library used for data analysis, and manipulation. You can learn more about it here <a href="https://pandas.pydata.org/">https://pandas.pydata.org/</a>.</p><pre>import pandas as pd<br>import streamlit as st</pre><pre>st.title(&#39;Titanic Data Visualization&#39;)<br>data <strong>=</strong> pd.read_csv(&#39;data.csv&#39;) # Pandas reading the data file<br>st.write(data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*pgnLcz5w1dYL8Ovpv028gg.png" /></figure><p>Now let’s add some widget’s to filter the data</p><pre><br>sex <strong>=</strong> st.multiselect(&#39;Sex&#39;, [&#39;male&#39;, &#39;female&#39;])</pre><pre><strong>if</strong>(len(sex)<strong>==</strong>1):<br>   data <strong>=</strong> data[data.Sex<strong>==</strong>sex[0]]</pre><pre>st.write(data)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FrAjNGfV%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FrAjNGfV&amp;image=https%3A%2F%2Fi.imgur.com%2FrAjNGfV.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="894" frameborder="0" scrolling="no"><a href="https://medium.com/media/31423755cf012c8fec6cd4c492ea82e9/href">https://medium.com/media/31423755cf012c8fec6cd4c492ea82e9/href</a></iframe><h4><strong>Using data from our query and Streamlit</strong></h4><p>Now that we know some basics of streamlit and TigerGraph, let’s use the query to visualize the South Korea COVID-19 data.</p><p>We are using <em>Pandas </em>and <em>flat_table</em> to clean up the data and get it ready for streamlit.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b79cd3a29e122a580e87f9722685461/href">https://medium.com/media/6b79cd3a29e122a580e87f9722685461/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FfsuuPGE%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FfsuuPGE&amp;image=https%3A%2F%2Fi.imgur.com%2FfsuuPGE.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="990" frameborder="0" scrolling="no"><a href="https://medium.com/media/af9e982d3173c2365d19f67ce566efce/href">https://medium.com/media/af9e982d3173c2365d19f67ce566efce/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fimgur.com%2FXdVrkKR%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2FXdVrkKR&amp;image=https%3A%2F%2Fi.imgur.com%2FXdVrkKR.gif%3Fnoredirect&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur" width="900" height="990" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c1390e015279b797b7a89b066509a4b/href">https://medium.com/media/3c1390e015279b797b7a89b066509a4b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*nWSZrkmv4O0bWaGDDrbFaQ.gif" /></figure><p>Streamlit is super customizable and you can use it with other great libraries like plotly, matplot, bokeh, and many others. Here is an example of using plotly widgets.</p><pre>pip install plotly</pre><p>Then you can use plotly like this …</p><pre>import plotly.express as px<br></pre><pre>fig = px.line(age, x=&quot;attributes.Age&quot;)</pre><pre>st.plotly_chart(fig)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*3430tJKygX-15NyOmZOEGw.png" /></figure><h4><strong>Conclusion</strong></h4><p>As you can see, both TigerGraph and Streamlit are awesome, this is just the tip of the iceberg — and the possibilities are endless. There are many amazing apps built using streamlit like these — <a href="https://www.streamlit.io/gallery">https://www.streamlit.io/gallery</a>. I hope you learned something!</p><h4>Special thanks to <a href="https://medium.com/u/571f80cc8b69">Jon Herke</a>, <a href="https://medium.com/u/2406ce10c3">Parker Erickson</a>, <a href="https://medium.com/u/b162eedcaf8a">Ramki Pitchala</a>, and <a href="https://medium.com/u/fc0227505fc6">Akash Kaul</a> for helping me write this blog. I hope you learned something and … bye!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c197f1200e27" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>