<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: HM</title>
    <description>The latest articles on DEV Community by HM (@hieumdd).</description>
    <link>https://dev.to/hieumdd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F544051%2F99f955f1-46d7-47e0-a96f-1dd06ae0bc2f.png</url>
      <title>DEV Community: HM</title>
      <link>https://dev.to/hieumdd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hieumdd"/>
    <language>en</language>
    <item>
      <title>

Custom Data Studio Viz - Part 2: Critical</title>
      <dc:creator>HM</dc:creator>
      <pubDate>Wed, 04 Aug 2021 14:22:39 +0000</pubDate>
      <link>https://dev.to/hieumdd/build-a-custom-data-studio-visualization-with-chart-js-part-2-critical-l8k</link>
      <guid>https://dev.to/hieumdd/build-a-custom-data-studio-visualization-with-chart-js-part-2-critical-l8k</guid>
      <description>&lt;h2&gt;
  
  
  [CRITICAL] Adjustments to the boilerplate for development &amp;amp; deployment
&lt;/h2&gt;

&lt;p&gt;To start developing your project, you can type in &lt;code&gt;npm run start&lt;/code&gt;, as this will open up a localhost server for you to develop the viz, with live-reloading.&lt;/p&gt;

&lt;p&gt;However, as up &lt;strong&gt;2021-08-01&lt;/strong&gt;, the current boilerplate generated by &lt;code&gt;npx @google/dscc-gen viz&lt;/code&gt; will not allow you to do &lt;code&gt;npm run start&lt;/code&gt; or &lt;code&gt;npm run build:dev&lt;/code&gt; yet. This is covered in a &lt;a href="https://github.com/googledatastudio/tooling/issues/190"&gt;Github Issue&lt;/a&gt; right now.&lt;/p&gt;

&lt;p&gt;The comment by &lt;a href="https://github.com/googledatastudio/tooling/issues/190#issuecomment-784799968"&gt;@sesi&lt;/a&gt; wrapped the solution beautifully. While it is never recommended that you make changes to &lt;code&gt;node_modules&lt;/code&gt; folder, it is a quick and dirty fix that make our life easier for now.&lt;/p&gt;

</description>
      <category>datastudio</category>
      <category>javascript</category>
      <category>chartjs</category>
      <category>datavisualization</category>
    </item>
    <item>
      <title>Custom Data Studio Viz - Part 1: Intro</title>
      <dc:creator>HM</dc:creator>
      <pubDate>Wed, 04 Aug 2021 14:22:29 +0000</pubDate>
      <link>https://dev.to/hieumdd/build-a-custom-data-studio-visualization-with-chart-js-part-1-intro-3j4d</link>
      <guid>https://dev.to/hieumdd/build-a-custom-data-studio-visualization-with-chart-js-part-1-intro-3j4d</guid>
      <description>&lt;p&gt;Data Studio is the perfect tool to use for data visualization. It has native connection to most of your usual data sources, ranging from standard MySQL, PostgreSQL to modern data warehouses/analytics engine like BigQuery. It provides basics charts &amp;amp; visualization for a wide range of users, from the basic non-tech-savvy individuals to superusers who are already accustomed to creating visualizations in Python, R, or JavaScript.&lt;/p&gt;

&lt;p&gt;On visualization parts, it already serves the everyday common users with the most common types of graphs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u9Rjksoe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owc7qgkq39hq1pq68wp3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u9Rjksoe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owc7qgkq39hq1pq68wp3.png" alt="Provided Visualizations on Data Studio"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, as I start to venture further into projects, in which there are multiple clients who want something unique, heavily customized versions of some types of charts that it is not already available in either the provided charts or the community charts, it was then that I tried to do something bold, creating my &lt;strong&gt;own visualization&lt;/strong&gt;, using Data Studio Custom Visualization with Javascripts. And the library that I used to make chart is Chart.js, since it is simple and does the job well.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;This is the chart that the client want to make, it is called a &lt;strong&gt;Arc Reactor Chart&lt;/strong&gt;. The name is familliar to me, since I've already seen this type of charts on some other visualizations platform like PowerBI or Tableau, but the problem is that Data Studio does not have it natively, hence I need to custom build it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cy4N4WpR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amtolw34ee0i276xaoxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cy4N4WpR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amtolw34ee0i276xaoxv.png" alt="Arc Reactor Chart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack/Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Google Cloud Platform: Since you already using Data Studio, this should be familiar to you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/storage"&gt;Google Cloud Storage&lt;/a&gt;: This is where you "host" your visualizations files&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/sdk/docs/install"&gt;gcloud SDK&lt;/a&gt;: To build &amp;amp; push your products into GCS&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Node.js: For npm&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://developers.google.com/datastudio/visualization/local-dev"&gt;dscc-gen&lt;/a&gt;: Easy boilerplate to start our project. This will initiate all the required files&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.chartjs.org/docs/2.9.4/"&gt;chart.js&lt;/a&gt;: Chart.js, the go to library to make visualzations. I'll use v2.9.4 since I want other Chart.js plugin to work along well with it&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create a GCP Project &amp;amp; a GCS Bucket
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/resource-manager/docs/creating-managing-projects"&gt;Creating &amp;amp; Managing Projects&lt;/a&gt;.&lt;br&gt;
We will start by creating a GCP Project. IIRC, it does not require adding your billing info yet, as it provides us a generous $300 free trial credits to help us being naughty inside Google's proud cloud systems.&lt;/p&gt;

&lt;p&gt;This should be the final results of the above step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eaq7bjd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xnz7tpizp3of52tkwhh6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eaq7bjd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xnz7tpizp3of52tkwhh6.png" alt="GCP Project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you will be creating a GCS Bucket to host our data. The bucket should be &lt;strong&gt;Public to the Internet&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/storage/docs/creating-buckets"&gt;Creating Buckets&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/storage/docs/access-control/making-data-public"&gt;Making the Bucket Public&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This should how it would look.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nBn6KdtO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/drhfpx48050kml2b9evc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nBn6KdtO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/drhfpx48050kml2b9evc.png" alt="GCS Bucket"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After getting your bucket, create 2 folders, &lt;code&gt;/dev&lt;/code&gt; and &lt;code&gt;/prod&lt;/code&gt;. This is where we are going to host our visualizations.&lt;/p&gt;

&lt;p&gt;By the end of this step, you would need to note down the paths to our buckets, which are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;gs://your-bucket/dev&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gs://your-bucket/prod&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Using gcloud
&lt;/h2&gt;

&lt;p&gt;You will need to install &lt;a href="https://cloud.google.com/sdk/docs/install"&gt;gcloud SDK&lt;/a&gt;. After that, open up a new terminal and type in &lt;code&gt;gcloud auth login&lt;/code&gt; to login to your account &amp;amp; to select your current projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initialize the Project
&lt;/h2&gt;

&lt;p&gt;Using your favorite terminal, cd into your desired folder, and type &lt;code&gt;npx @google/dscc-gen viz&lt;/code&gt;. This would walk you through the initialization of your new project. You will need to provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project name&lt;/li&gt;
&lt;li&gt;Path to dev folder on GCS&lt;/li&gt;
&lt;li&gt;Path to prod folder on GCS
When the wizard is done, you will have your project initialized, and you can start developing your visualization here using your IDE.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>datastudio</category>
      <category>javascript</category>
      <category>chartjs</category>
      <category>datavisualization</category>
    </item>
  </channel>
</rss>
