<?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 Yi Chen on Medium]]></title>
        <description><![CDATA[Stories by Yi Chen on Medium]]></description>
        <link>https://medium.com/@yichen_90565?source=rss-44e0ce5dca07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L4mJV8QAYAzg-1g4C3Ttgw.jpeg</url>
            <title>Stories by Yi Chen on Medium</title>
            <link>https://medium.com/@yichen_90565?source=rss-44e0ce5dca07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 03:07:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yichen_90565/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[My Victory Journey]]></title>
            <link>https://medium.com/social-tables-tech/my-victory-journey-47361fda9cdb?source=rss-44e0ce5dca07------2</link>
            <guid isPermaLink="false">https://medium.com/p/47361fda9cdb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[social-tables]]></category>
            <category><![CDATA[victory]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[charts]]></category>
            <dc:creator><![CDATA[Yi Chen]]></dc:creator>
            <pubDate>Wed, 30 Nov 2016 17:16:10 GMT</pubDate>
            <atom:updated>2016-11-30T19:51:03.739Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there, I joined the <a href="https://medium.com/social-tables-tech">Social Tables Engineering team</a> three months ago. It has been a great experience so far. Love the culture, love my team, love the product I’m building. ٩( ˃̶͈̀௰˂̶͈́ )و</p><p>Right now I’m working on Guest, a guest list management app. Our main front-end stack is React and Redux. One of our team goals this month is to implement new check-in statistics feature. It’s a brand new view to visualize the check-in data of our guests, including radial bar charts and line charts. The first thing we need to address is to decide which library we should use to build the charts. d3 is our first choice but charting directly with d3 can be difficult while other libraries are often too simplistic.</p><p>Based on our research of chart library built with React and d3, we found two ideal candidates, <a href="https://formidable.com/open-source/victory/">Victory</a> and <a href="http://recharts.org/">Rechart</a>. They both use the <strong>declarative</strong> approach of React/JSX. It’s a natural fit for our stack since we only need to feed the chart components some props. We compared them based on six different criteria: needs coverage, customizable, animation, responsive, mobile support and well-documented. Finally, we decided to use Victory. There are two main reasons. One is that <strong>Victory supports React Native</strong>, which makes it very easy for us to reuse the code in our mobile app. Another reason is that it’s more <strong>customizable</strong>. Using a chart component library can be frustrating sometimes. Like any framework which gives you <strong>high-level abstractions</strong>, there will come a point when <strong>your needs will become very specific and won’t fit in</strong>. Victory provides components like VictoryAxis, VictoryBar, VictoryLine … It covers all our needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*ZcnTw-kGv8hI1KQXa5dW-Q.png" /><figcaption>Check-in Stats using Victory</figcaption></figure><p>Some code you may find useful (code review is very welcome, please leave a comment if you have any suggestions):</p><pre><strong>//</strong>radial bar chart<strong><br>const </strong>colors = {<br>   pink: [&quot;#CB5599&quot;, &quot;#5E6063&quot;],<br>   teal: [&quot;#49C6B7&quot;, &quot;#5E6063&quot;]<br>};</pre><pre>&lt;VictoryPie<br>  data={data}<br>  x=&quot;guest&quot;<br>  y={(datum) =&gt; datum.value}<br>  style={{<br>   labels: {fontSize: 0}<br>  }}<br>  colorScale={colors[color]}<br>  innerRadius={115}<br>/&gt;</pre><pre>//line chart<br>&lt;VictoryChart&gt;<br>   {<br>      data.length &gt; 1 ? &lt;VictoryLine<br>         data={data}<br>         x=&quot;time&quot;<br>         style={{<br>            data: {stroke: colors[color], strokeWidth:4},<br>         }}<br>         y={(datum) =&gt; datum.value}<br>      /&gt; : <strong>null<br>   </strong>}<br>   &lt;VictoryAxis<br>      // x<br>      tickValues={xRange.length &gt; 1 ? xRange : [&quot;8:00 PM&quot;]}<br>      tickFormat={(tick) =&gt; {<br>         <strong>if </strong>(data.length &lt; 1){<br>            <strong>return </strong>tick;<br>         }<br>         <strong>const </strong>time = data[tick-1].time.split(&quot;:&quot;);<br>         <strong>return </strong>formatTime(time);<br>      }}<br>      style={{<br>         axis: {stroke: colors.mediumGray},<br>         ticks: {stroke: colors.mediumGray},<br>         tickLabels: {fontSize: 12, padding: 30, stroke:&quot;#EAEDEF&quot;}<br>      }}<br>   /&gt;<br>   &lt;VictoryAxis<br>      // y<br>      dependentAxis<br>      tickValues={yRange.length &gt; 1 ? yRange : [0, 3, 6]}<br>      style={{<br>         axis: {stroke: &quot;none&quot;},<br>         grid: {stroke:colors.mediumGray},<br>         tickLabels: {fontSize: 12, padding: 30,   stroke:colors.lightGray}<br>      }}<br>   /&gt;<br>   &lt;VictoryScatter<br>      data={data}<br>      x=&quot;time&quot;<br>      style={{<br>         data: {stroke: colors.lightGray, strokeWidth:3, fill:colors.lightGray},<br>         labels: {fontSize: 30},<br>      }}<br>      y={(datum) =&gt; datum.value}<br>   /&gt;<br>   &lt;VictoryVoronoiTooltip<br>      data={data}<br>      labels={(datum) =&gt; datum.value}<br>      y={(datum) =&gt; datum.value}<br>      x=&quot;time&quot;<br>      style={{<br>         labels: {<br>            fill: &quot;white&quot;<br>         },<br>         flyout: {<br>            fill: colors.mediumGray,<br>            strokeWidth: 0<br>         }<br>      }}<br>   /&gt;<br>&lt;/VictoryChart&gt;</pre><p>Overall, it has been a great journey using Victory. The check-in stats view was finished in short amount of time and the result is amazing. Although it took me some time to find information from the library documentation, you can always ask questions through <a href="https://gitter.im/FormidableLabs/victory"><strong>Gitter</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47361fda9cdb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/social-tables-tech/my-victory-journey-47361fda9cdb">My Victory Journey</a> was originally published in <a href="https://medium.com/social-tables-tech">Social Tables Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>