{"id":59743,"date":"2019-02-02T04:19:13","date_gmt":"2019-02-02T11:19:13","guid":{"rendered":"http:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/"},"modified":"2019-02-02T04:19:13","modified_gmt":"2019-02-02T11:19:13","slug":"using-vue-js-to-create-an-interactive-weather-dashboard-with-apis","status":"publish","type":"post","link":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/","title":{"rendered":"Using Vue.js To Create An Interactive Weather Dashboard With APIs"},"content":{"rendered":"<link rel=\"canonical\" href=\"https:\/\/www.smashingmagazine.com\/2019\/02\/interactive-weather-dashboard-api-vue-js\/\"><title>Using Vue.js To Create An Interactive Weather Dashboard With APIs<\/title><\/p>\n<article>\n<header>\n<h1>Using Vue.js To Create An Interactive Weather Dashboard With APIs<\/h1>\n<address>Souvik Sarkar<\/address>\n<p>                  <time datetime=\"2019-02-01T13:00:18+01:00\">2019-02-01T13:00:18+01:00<\/time><time datetime=\"2019-02-02T00:03:23+00:00\">2019-02-02T00:03:23+00:00<\/time><\/header>\n<p>(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in its size and complexity.<\/p>\n<p>The entire project will be developed using tools from the <a href=\"https:\/\/nodejs.org\/en\/\">Node.js<\/a> + <a href=\"https:\/\/www.npmjs.com\/\">npm<\/a> ecosystem. In particular, we will be heavily relying on the <a href=\"https:\/\/darksky.net\/dev\">Dark Sky API<\/a> for the data, <a href=\"https:\/\/vuejs.org\/\">Vue.js<\/a> for all the heavy lifting, and <a href=\"https:\/\/www.fusioncharts.com\/?utm_source=smashing_mag&#038;utm_medium=blog&#038;utm_campaign=weather_dashboard_vue\">FusionCharts<\/a> for data visualization.<\/p>\n<h4>Prerequisites<\/h4>\n<p>We expect that you are familiar with the following:<\/p>\n<ul>\n<li><strong>HTML5 and CSS3<\/strong> (we will also be using the basic features provided by <a href=\"https:\/\/getbootstrap.com\/\">Bootstrap<\/a>;<\/li>\n<li><strong>JavaScript<\/strong> (especially ES6 way of using the language);<\/li>\n<li><strong>Node.js and npm<\/strong> (the basics of the environment and package management is just fine).<\/li>\n<\/ul>\n<p>Apart from the ones mentioned above, it would be great if you have familiarity with <strong>Vue.js<\/strong>, or any other similar JavaScript framework. We don\u2019t expect you to know about <strong>FusionCharts<\/strong> \u2014 it\u2019s so easy to use that you will learn it on the fly!<\/p>\n<h4>Expected Learnings<\/h4>\n<p>Your key learnings from this project will be:<\/p>\n<ol>\n<li>How to plan about implementing a good dashboard<\/li>\n<li>How to develop applications with Vue.js<\/li>\n<li>How to create data-driven applications<\/li>\n<li>How to visualize data using FusionCharts<\/li>\n<\/ol>\n<p>In particular, each of the sections take you a step closer to the learning goals:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.smashingmagazine.com\/articles\/#weather-dashboard\">An Introduction To The Weather Dashboard<\/a><br \/>This chapter gives you an overview of different aspects of the undertaking.<\/li>\n<li><a href=\"https:\/\/www.smashingmagazine.com\/articles\/#create-project\">Create The Project<\/a><br \/>In this section, you learn about creating a project from scratch using the Vue command-line tool.<\/li>\n<li><a href=\"https:\/\/www.smashingmagazine.com\/articles\/#customize-the-default-project-structure\">Customize The Default Project Structure<\/a><br \/>The default project scaffolding that you get in the previous section is not enough; here you learn the additional stuff needed for the project from a structural point of view.<\/li>\n<li><a href=\"https:\/\/www.smashingmagazine.com\/articles\/#data-acquisition-processing\">Data Acquisition And Processing<\/a><br \/>This section is the meat of the project; all the critical code for acquiring and processing data from the API is showcased here. Expect to spend maximum time on this section.<\/li>\n<li><a href=\"https:\/\/www.smashingmagazine.com\/articles\/#data-visualization-with-fusioncharts\">Data Visualization With FusionCharts<\/a><br \/>Once we have all the data and other moving parts of the project stabilized, this section is dedicated towards visualizing the data using FusionCharts and a bit of CSS. <\/li>\n<\/ol>\n<h3>1. The Dashboard Workflow<\/h3>\n<p>Before we dive into the implementation, it is important to be clear about our plan. We break our plan into four distinct aspects:<\/p>\n<h4>Requirements<\/h4>\n<p>What are our requirements for this project? In other words, what are the things that we want to showcase through our Weather Dashboard? Keeping in mind that our intended audience are probably mere mortals with simple tastes, we would like to show them the following:<\/p>\n<ul>\n<li>Details of the location for which they want to see the weather, along with some primary information about the weather. Since there are no stringent requirements, we will figure out the boring details later. However, at this stage, it is important to note that we will have to provide the audience a search box, so that they can provide input for the location of their interest.<\/li>\n<li>Graphical information about the weather of their location of interest, such as:\n<ul>\n<li>Temperature variation for the day of query<\/li>\n<li>Highlights of today\u2019s weather:\n<ul>\n<li>Wind Speed and Direction<\/li>\n<li>Visibility<\/li>\n<li>UV Index<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Note<\/strong>: <em>The data obtained from the API provides information regarding many other aspects of the weather. We choose not to use all of them for the sake of keeping the code to a minimum.<\/em><\/p>\n<h4>Structure<\/h4>\n<p>Based on the requirements, we can structure our dashboard as shown below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec1788a5-b934-468b-9925-019445dcebfe\/interactive-weather-dashboard-image3.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image3.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec1788a5-b934-468b-9925-019445dcebfe\/interactive-weather-dashboard-image3.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec1788a5-b934-468b-9925-019445dcebfe\/interactive-weather-dashboard-image3.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec1788a5-b934-468b-9925-019445dcebfe\/interactive-weather-dashboard-image3.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec1788a5-b934-468b-9925-019445dcebfe\/interactive-weather-dashboard-image3.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image3.png?w=900\" sizes=\"100vw\" alt=\"Dashboard structure\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec1788a5-b934-468b-9925-019445dcebfe\/interactive-weather-dashboard-image3.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<h4>Data<\/h4>\n<p>Our dashboard is as good as the data we get, because there will be no pretty visualizations without proper data. There are plenty of public APIs that provide weather data \u2014 some of them are free, and some are not. For our project, we will collect data from the <a href=\"https:\/\/darksky.net\/dev\">Dark Sky API<\/a>. However, we will not be able to poll the API endpoint from the client end directly. Don\u2019t worry, we have a workaround that will be revealed just at the right time! Once we get the data for the searched location, we will do some data processing and formatting \u2014 you know, the type of technicalities that helps us pay the bills.<\/p>\n<h4>Visualization<\/h4>\n<p>Once we get clean and formatted data, we plug it in to FusionCharts. There are very few JavaScript libraries in the world as capable as FusionCharts. Out of the vast number of offerings from FusionCharts, we will use only a few \u2014 all written in JavaScript, but works seamlessly when integrated with the <a href=\"https:\/\/www.fusioncharts.com\/vue-js-charts?utm_source=smashing_mag&#038;utm_medium=blog&#038;utm_campaign=weather_dashboard_vue\">Vue wrapper for FusionCharts<\/a>.<\/p>\n<p>Armed with the bigger picture, let\u2019s get our hands dirty \u2014 it\u2019s time to make things concrete! In the next section, you will create the basic Vue project, on top of which we will build further.<\/p>\n<h3>2. Creating The Project<\/h3>\n<p>To create the project, execute the following steps:<\/p>\n<ol>\n<li><strong>Install Node.js + npm<\/strong><br \/>(<em>If you have Node.js installed on your computer, skip this step.<\/em>)<br \/>Node.js comes with npm bundled with it, so you don\u2019t need to install npm separately. Depending on the operating system, download and install Node.js according to the instructions given <a href=\"https:\/\/nodejs.org\/en\/download\/\">here<\/a>.\n<p>Once installed, it\u2019s probably a good idea to verify if the software is working correctly, and what are their versions. To test that, open the command-line\/terminal and execute the following commands:<\/p>\n<pre><code>node --version\nnpm --version\n<\/code><\/pre>\n<\/li>\n<li><strong>Install packages with npm<\/strong><br \/>Once you have npm up and running, execute the following command to install the basic packages necessary for our project.\n<pre><code>npm install -g vue@2 vue-cli@2\n<\/code><\/pre>\n<\/li>\n<li><strong>Initialize project scaffolding with <code>vue-cli<\/code><\/strong><br \/>Assuming that the previous step has gone all well, the next step is to use the <code>vue-cli<\/code> \u2014 a command-line tool from Vue.js, to initialize the project. To do that, execute the following:<\/li>\n<\/ol>\n<ul>\n<li>Initialize the scaffolding with webpack-simple template.\n<pre><code>vue init webpack-simple vue_weather_dashboard\n        <\/code><\/pre>\n<p>        You will be asked a bunch of questions \u2014 accepting the defaults for all but the last question will be good enough for this project; answer <code>N<\/code> for the last one.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/371f9f63-b02f-4492-9b3d-aa1d4a8ccb7c\/interactive-weather-dashboard-image2.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image2.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/371f9f63-b02f-4492-9b3d-aa1d4a8ccb7c\/interactive-weather-dashboard-image2.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/371f9f63-b02f-4492-9b3d-aa1d4a8ccb7c\/interactive-weather-dashboard-image2.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/371f9f63-b02f-4492-9b3d-aa1d4a8ccb7c\/interactive-weather-dashboard-image2.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/371f9f63-b02f-4492-9b3d-aa1d4a8ccb7c\/interactive-weather-dashboard-image2.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image2.png?w=900\" sizes=\"100vw\" alt=\"A screenshot of the command-line\/terminal\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/371f9f63-b02f-4492-9b3d-aa1d4a8ccb7c\/interactive-weather-dashboard-image2.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>        Keep in mind that although <code>webpack-simple<\/code> is excellent for quick prototyping and light application like ours, it is not particularly suited for serious applications or production deployment. If you want to use any other template (although we would advise against it if you are a newbie), or would like to name your project something else, the syntax is:<\/p>\n<pre><code>vue init [template-name] [project-name]\n        <\/code><\/pre>\n<\/li>\n<li>Navigate to the directory created by vue-cli for the project.\n<pre><code>cd vue_weather_dashboard\n        <\/code><\/pre>\n<\/li>\n<li>Install all the packages mentioned in the <code>package.json<\/code>, which has been created by the <code>vue-cli<\/code> tool for the <code>webpack-simple<\/code> template.\n<pre><code>npm install\n        <\/code><\/pre>\n<\/li>\n<li>Start the development server and see your default Vue project working in the browser!\n<pre><code>npm run dev\n        <\/code><\/pre>\n<\/li>\n<\/ul>\n<p>If you are new to <a href=\"https:\/\/vuejs.org\/\">Vue.js<\/a>, take a moment to savor your latest achievement \u2014 you have created a small Vue application and its running at <a href=\"http:\/\/127.0.0.0:8080\/\">localhost:8080<\/a>!<\/p>\n<figure><a href=\"https:\/\/vuejs.org\/\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image4.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c7800541-236a-41cb-97ac-98fd43644c7f\/interactive-weather-dashboard-image4.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c7800541-236a-41cb-97ac-98fd43644c7f\/interactive-weather-dashboard-image4.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c7800541-236a-41cb-97ac-98fd43644c7f\/interactive-weather-dashboard-image4.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c7800541-236a-41cb-97ac-98fd43644c7f\/interactive-weather-dashboard-image4.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image4.png?w=900\" sizes=\"100vw\" alt=\"A screenshot of the Vue.js website\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c7800541-236a-41cb-97ac-98fd43644c7f\/interactive-weather-dashboard-image4.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<h4>Brief Explanation Of The Default Project Structure<\/h4>\n<p>It\u2019s time to take a look at the structure inside the directory <code>vue_weather_dashboard<\/code>, so that you have an understanding of the basics before we start modifying it.<\/p>\n<p>The structure looks something like this:<\/p>\n<pre><code>vue_weather_dashboard\n|--- README.md\n|--- node_modules\/\n|     |--- ...\n|     |--- ...\n|     |--- [many npm packages we installed]\n|     |--- ...\n|     |--- ...\n|--- package.json\n|--- package-lock.json\n|--- webpack.config.js\n|--- index.html\n|--- src\n|     |--- App.vue\n|     |--- assets\n|     |     |--- logo.png\n|     |--- main.js \n<\/code><\/pre>\n<p>Although it might be tempting to skip getting familiar with the default files and directories, if you are new to Vue, we <strong>strongly recommend<\/strong> at least taking a look at the contents of the files. It can be a good educational session and trigger questions that you should pursue on your own, especially the following files:<\/p>\n<ul>\n<li><code>package.json<\/code>, and just a glance at its cousin <code>package-lock.json<\/code><\/li>\n<li><code>webpack.config.js<\/code><\/li>\n<li><code>index.html<\/code><\/li>\n<li><code>src\/main.js<\/code><\/li>\n<li><code>src\/App.vue<\/code><\/li>\n<\/ul>\n<p>A brief explanation of each of the files and directories shown in the tree diagram are given below:<\/p>\n<ul>\n<li><strong>README.md<\/strong><br \/>\nNo prize for guessing \u2014 it is primarily for humans to read and understand the steps necessary for <a href=\"https:\/\/www.smashingmagazine.com\/articles\/#scaffolding\">creating the project scaffolding<\/a>.<\/li>\n<li><strong>node_modules\/<\/strong><br \/>\nThis is the directory where npm downloads the packages necessary for kickstarting the project. The information about the packages necessary are available in the <code>package.json<\/code> file.<\/li>\n<li><strong>package.json<\/strong><br \/>\nThis file is created by the vue-cli tool based on the requirements of the <code>webpack-simple<\/code> template, and contains information about the npm packages (including with their versions and other details) that must be installed. Take a hard look at the content of this file \u2014 this is where you should visit and perhaps edit to add\/delete packages necessary for the project, and then run npm install. Read more about <code>package.json<\/code> <a href=\"https:\/\/docs.npmjs.com\/files\/package.json\">here<\/a>.<\/li>\n<li><strong>package-lock.json<\/strong><br \/>\nThis file is created by npm itself, and is primarily meant for keeping a log of things that npm downloaded and installed.<\/li>\n<li><strong>webpack.config.js<\/strong><br \/>\nThis a JavaScript file that contains the configuration of webpack \u2014 a tool that bundles different aspects of our project together (code, static assets, configuration, environments, mode of use, etc.), and minifies before serving it to the user. The benefit is that all things are tied together automatically, and the user experience enhances greatly because of the improvement in the application\u2019s performance (pages are served quickly and loads faster on the browser). As you might encounter later, this is the file that needs to be inspected when something in the build system does not works the way it is intended to be. Also, when you want to deploy the application, this is one of the key files that needs to be edited (read more <a href=\"https:\/\/webpack.js.org\/guides\/getting-started\/\">here<\/a>).<\/li>\n<li><strong>index.html<\/strong><br \/>\nThis HTML file serves as the matrix (or you can say, template) where data and code is to be embedded dynamically (that\u2019s what Vue primarily does), and then served to the user.<\/li>\n<li><strong>src\/main.js<\/strong><br \/>\nThis JavaScript file contains code that primarily manages top\/project level dependencies, and defines the topmost level Vue component. In short, it orchestrates the JavaScript for the entire project, and serves as the entry point of the application. Edit this file when you need to declare project-wide dependencies on certain node modules, or you want something to be changed about the topmost Vue component in the project.<\/li>\n<li><strong>src\/App.vue<\/strong><br \/>\nIn the previous point, when we were talking about the \u201ctopmost Vue component\u201d, we were essentially talking about this file. Each .vue file in the project is a component, and components are hierarchically related. At the start, we have only one <code>.vue<\/code> file, i.e. <code>App.vue<\/code>, as our only component. But shortly we will add more components to our project (primarily following the structure of the dashboard), and link them in accordance to our desired hierarchy, with App.vue being the ancestor of all. These <code>.vue<\/code> files will contain code in a format that Vue wants us to write. Don\u2019t worry, they are JavaScript code written maintaining a structure that can keep us sane and organized. You have been warned \u2014 by the end of this project, if you are new to Vue, you may get addicted to the <code>template &mdash; script &mdash; style<\/code> way of organizing code!<\/li>\n<\/ul>\n<p>Now that we have created the foundation, it\u2019s time to:<\/p>\n<ul>\n<li>Modify the templates and tweak the configuration files a bit, so that the project behaves just the way we want.<\/li>\n<li>Create new <code>.vue<\/code> files, and implement the dashboard structure with Vue code.<\/li>\n<\/ul>\n<p>We will learn them in the next section, which is going to be a bit long and demands some attention. If you need caffeine or water, or want to discharge \u2014 now is the time!?<\/p>\n<h3>3. Customizing The Default Project Structure<\/h3>\n<p>It\u2019s time to tinker with the foundation that the scaffolded project has given us. Before you start, ensure that the development server provided by <code>webpack<\/code> is running. The advantage of running this server <em>continuously<\/em> is that any changes you make in the source code \u2014 one you save it and refresh the web page \u2014 it gets immediately reflected on the browser.<\/p>\n<p>If you want to start the development server, just execute the following command from the terminal (assuming your current directory is the project directory):<\/p>\n<pre><code>npm run dev\n<\/code><\/pre>\n<p>In the following sections, we will modify some of the existing files, and add some new files.<br \/>\nIt will be followed by brief explanations of the content of those files, so that you have an idea of what those changes are meant to do.<\/p>\n<h4>Modify Existing Files<\/h4>\n<h5>index.html<\/h5>\n<p>Our application is literally a single page application, because there is just one webpage that gets displayed on the browser. We will talk about this later, but first let\u2019s just make our first change \u2014 altering the text within the <code><title><\/code> tag.<\/p>\n<p>With this small revision, the HTML file looks like the following:<\/p>\n<pre><code><!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <!-- Modify the text of the title tag below -->\n    <title>Vue Weather Dashboard<\/title>\n  <\/head>\n  <body>\n    <div id=\"app\"><\/div>\n    <script src=\"\/dist\/build.js\"><\/script>\n  <\/body>\n<\/html>\n<\/code><\/pre>\n<p>Take a moment to refresh the webpage at <code>localhost:8080<\/code>, and see the change reflected on the title bar of the tab on the browser \u2014 it should say \u201cVue Weather Dashboard\u201d. However, this was just to demonstrate you the process of making changes and verifying if it\u2019s working. We have more things to do!<\/p>\n<p>This simple HTML page lacks many things that we want in our project, especially the following:<\/p>\n<ul>\n<li>Some meta information<\/li>\n<li>CDN links to Bootstrap (CSS framework)<\/li>\n<li>link to custom stylesheet (yet to be added in the project)<\/li>\n<li>Pointers to the Google Maps Geolocation API from <code><script><\/code> tag<\/li>\n<\/ul>\n<p>After adding those things, the final <code>index.html<\/code> has the following content:<\/p>\n<div>\n<pre><code><!DOCTYPE html>\n<html lang=\"en\">\n <head>\n   <meta http-equiv=\"Content-Type\" content=\"text\/html;charset=utf-8\" \/>\n   <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n   <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n   <link rel=\"stylesheet\" href=\"\/\/maxcdn.bootstrapcdn.com\/bootstrap\/4.0.0\/css\/bootstrap.min.css\">\n   <link rel=\"stylesheet\" type=\"text\/css\" href=\"src\/css\/style.css\">\n   <title>Weather Dashboard<\/title>\n   <script src=\"https:\/\/maps.googleapis.com\/maps\/api\/js?key=AIzaSyC-lCjpg1xbw-nsCc11Si8Ldg2LKYizqI4&#038;libraries=places\"><\/script>\n <\/head>\n <body>\n   <div id=\"app\"><\/div>\n   <script src=\"\/dist\/build.js\"><\/script>\n <\/body>\n<\/html>\n<\/code><\/pre>\n<\/div>\n<p>Save the file, and refresh the webpage. You might have noticed a slight bump while the page was getting loaded \u2014 it is primarily due to the fact that the page style is now being controlled by Bootstrap, and the style elements like fonts, spacing, etc. are different from the default we had earlier (if you are not sure, roll back to the default and see the difference).<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d68802b5-8099-46e5-a89c-87da85634584\/interactive-weather-dashboard-image5.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image5.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d68802b5-8099-46e5-a89c-87da85634584\/interactive-weather-dashboard-image5.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d68802b5-8099-46e5-a89c-87da85634584\/interactive-weather-dashboard-image5.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d68802b5-8099-46e5-a89c-87da85634584\/interactive-weather-dashboard-image5.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d68802b5-8099-46e5-a89c-87da85634584\/interactive-weather-dashboard-image5.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image5.png?w=900\" sizes=\"100vw\" alt=\"A screenshot when you refresh the webpage with localhost:8080\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d68802b5-8099-46e5-a89c-87da85634584\/interactive-weather-dashboard-image5.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p><strong>Note<\/strong>: <em>One important thing before we move on \u2014 the URL for the Google Maps API contains a key which is a property of FusionCharts. For now, you can use this key to build the project, as we don\u2019t want you to get bogged down by these type of minute details (which can be distractions while you are new). However, we strongly urge you to <a href=\"https:\/\/developers.google.com\/maps\/documentation\/javascript\/get-api-key\">generate and use your own Google Maps API key<\/a> once you have made some progress and feel comfortable to pay attention to these tiny details.<\/em><\/p>\n<h5>package.json<\/h5>\n<p>At the time of writing this, we used certain versions of the npm packages for our project, and we know for sure that those things work together. However, by the time you are executing the project, it is very much possible that the latest stable versions of the packages that npm downloads for you are not the same as we used, and this might break the code (or do things that are beyond our control). Thus, it is very important to have the exact same <code>package.json<\/code> file that was used to build this project, so that our code\/explanations and the results you get are consistent.<\/p>\n<p>The content of the <code>package.json<\/code> file should be:<\/p>\n<div>\n<pre><code>{\n \"name\": \"vue_weather_dashboard\",\n \"description\": \"A Vue.js project\",\n \"version\": \"1.0.0\",\n \"author\": \"FusionCharts\",\n \"license\": \"MIT\",\n \"private\": true,\n \"scripts\": {\n   \"dev\": \"cross-env NODE_ENV=development webpack-dev-server --open --hot\",\n   \"build\": \"cross-env NODE_ENV=production webpack --progress --hide-modules\"\n },\n \"dependencies\": {\n   \"axios\": \"^0.18.0\",\n   \"babel\": \"^6.23.0\",\n   \"babel-cli\": \"^6.26.0\",\n   \"babel-polyfill\": \"^6.26.0\",\n   \"fusioncharts\": \"^3.13.3\",\n   \"moment\": \"^2.22.2\",\n   \"moment-timezone\": \"^0.5.21\",\n   \"vue\": \"^2.5.11\",\n   \"vue-fusioncharts\": \"^2.0.4\"\n },\n \"browserslist\": [\n   \"> 1%\",\n   \"last 2 versions\",\n   \"not ie <\/code><\/pre>\n<\/div>\n<p>We encourage you to go through the new <code>package.json<\/code>, and figure out what are functions of different objects in the json. You may prefer changing the value of the \u201c<code>author<\/code>\u201d key to your name. Also, the packages mentioned in the dependencies will reveal themselves at the right time in the code. For the time being, it\u2019s sufficient to know that:<\/p>\n<ul>\n<li><code>babel<\/code>-related packages are for properly handling the ES6 style code by the browser;<\/li>\n<li><code>axios<\/code> deals with <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Promise\">Promise<\/a>-based HTTP requests;<\/li>\n<li><code>moment<\/code> and moment-timezone are for date\/time manipulation;<\/li>\n<li><code>fusioncharts<\/code> and <code>vue-fusioncharts<\/code> are responsible for rendering charts:<\/li>\n<li><code>vue<\/code>, for obvious reasons.<\/li>\n<\/ul>\n<h5>webpack.config.js<\/h5>\n<p>As with <code>package.json<\/code>, we suggest you to maintain a <code>webpack.config.js<\/code> file that is consistent with the one we used for building the project. However, before making any changes, we recommend you to carefully compare the default code in the <code>webpack.config.js<\/code>, and the code we have provided below. You will notice quite a few differences \u2014 google them and have a basic idea of what they mean. Since explaining webpack configurations in depth is out of the scope of this article, you are on your own in this regard.<\/p>\n<p>The customized <code>webpack.config.js<\/code> file is as follows:<\/p>\n<div>\n<pre><code>var path = require('path')\nvar webpack = require('webpack')\n\nmodule.exports = {\n entry: ['babel-polyfill', '.\/src\/main.js'],\n output: {\n   path: path.resolve(__dirname, '.\/dist'),\n   publicPath: '\/dist\/',\n   filename: 'build.js'\n },\n module: {\n   rules: [\n     {\n       test: \/.css$\/,\n       use: [\n         'vue-style-loader',\n         'css-loader'\n       ],\n     },      {\n       test: \/.vue$\/,\n       loader: 'vue-loader',\n       options: {\n         loaders: {\n         }\n         \/\/ other vue-loader options go here\n       }\n     },\n     {\n       test: \/.js$\/,\n       loader: 'babel-loader',\n       exclude: \/node_modules\/\n     },\n     {\n       test: \/.(png|jpg|gif|svg)$\/,\n       loader: 'file-loader',\n       options: {\n         name: '[name].[ext]?[hash]'\n       }\n     }\n   ]\n },\n resolve: {\n   alias: {\n     'vue$': 'vue\/dist\/vue.esm.js'\n   },\n   extensions: ['*', '.js', '.vue', '.json']\n },\n devServer: {\n   historyApiFallback: true,\n   noInfo: true,\n   overlay: true,\n   host: '0.0.0.0',\n   port: 8080\n },\n performance: {\n   hints: false\n },\n devtool: '#eval-source-map'\n}\n\nif (process.env.NODE_ENV === 'production') {\n module.exports.devtool = '#source-map'\n \/\/ http:\/\/vue-loader.vuejs.org\/en\/workflow\/production.html\n module.exports.plugins = (module.exports.plugins || []).concat([\n   new webpack.DefinePlugin({\n     'process.env': {\n       NODE_ENV: '\"production\"'\n     }\n   }),\n   new webpack.optimize.UglifyJsPlugin({\n     sourceMap: true,\n     compress: {\n       warnings: false\n     }\n   }),\n   new webpack.LoaderOptionsPlugin({\n     minimize: true\n   })\n ])\n}\n<\/code><\/pre>\n<\/div>\n<p>With changes made to the project\u2019s <code>webpack.config.js<\/code>, it\u2019s imperative that you stop the development server which is running (<kbd>Ctrl<\/kbd> + <kbd>C<\/kbd>), and restart it with the following command executed from the project\u2019s directory after installing all the packages mentioned in the <code>package.json<\/code> file:<\/p>\n<pre><code>npm install\n\nnpm run dev\n<\/code><\/pre>\n<p>With this, the ordeal of tweaking the configurations and ensuring that the right packages are in place ends. However, this also marks the journey of modifying and writing code, which is a bit long but also very rewarding!<\/p>\n<h5>src\/main.js<\/h5>\n<p>This file is the key to top-level orchestration of the project \u2014 it is here that we define:<\/p>\n<ul>\n<li>What the top level dependencies are (where to get the most important npm packages necessary);<\/li>\n<li>How to resolve the dependencies, along with instructions to Vue on using plugins\/wrappers, if any;<\/li>\n<li>A Vue instance that manages the topmost component in the project: <code>src\/App.vue<\/code> (the nodal <code>.vue<\/code> file).<\/li>\n<\/ul>\n<p>In line with our goals for the <code>src\/main.js<\/code> file, the code should be:<\/p>\n<div>\n<pre><code>\/\/ Import the dependencies and necessary modules\nimport Vue from 'vue';\nimport App from '.\/App.vue';\nimport FusionCharts from 'fusioncharts';\nimport Charts from 'fusioncharts\/fusioncharts.charts';\nimport Widgets from 'fusioncharts\/fusioncharts.widgets';\nimport PowerCharts from 'fusioncharts\/fusioncharts.powercharts';\nimport FusionTheme from 'fusioncharts\/themes\/fusioncharts.theme.fusion';\nimport VueFusionCharts from 'vue-fusioncharts';\n\n\/\/ Resolve the dependencies\nCharts(FusionCharts);\nPowerCharts(FusionCharts);\nWidgets(FusionCharts);\nFusionTheme(FusionCharts);\n\n\/\/ Globally register the components for project-wide use\nVue.use(VueFusionCharts, FusionCharts);\n\n\/\/ Instantiate the Vue instance that controls the application\nnew Vue({\n el: '#app',\n render: h => h(App)\n})\n<\/code><\/pre>\n<\/div>\n<h5>src\/App.vue<\/h5>\n<p>This is one of the most important files in the entire project, and represents the topmost component in the hierarchy \u2014 the entire application itself, as a whole. For our project, this component will do all the heavy lifting, which we will explore later. For now, we want to get rid of the default boilerplate, and put something of our own.<\/p>\n<p>If you are new to Vue\u2019s way of organizing code, it would be better to get an idea of the general structure within the <code>.vue<\/code> files. The <code>.vue<\/code> files comprises of three sections:<\/p>\n<ul>\n<li><strong>Template<\/strong><br \/>\nThis is where the HTML template for the page is defined. Apart from the static HTML, this section also contains Vue\u2019s way of embedding dynamic content, using the double curly braces <code>{{ }}<\/code>.<\/li>\n<li><strong>Script<\/strong><br \/>\nJavaScript rules this section, and is responsible for generating dynamic content that goes and sits within the HTML template at appropriate places. This section is primarily an object that is exported, and consists of:<\/p>\n<ul>\n<li><strong>Data<\/strong><br \/>\nThis is a function itself, and usually it returns some desired data encapsulated within a nice data structure.<\/li>\n<li><strong>Methods<\/strong><br \/>\nAn object that consists of one or more functions\/methods, each of which usually manipulates data in some way or the other, and also controls the dynamic content of the HTML template.<\/li>\n<li><strong>Computed<\/strong><br \/>\nMuch like the method object discussed above with one important distinction \u2014 while all the functions within the method object are executed whenever any one of them is called, the functions within the computed object behaves much more sensibly, and executes if and only if it has been called.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Style<\/strong><br \/>\nThis section is for CSS styling that applies to the HTML of the page (written within template) \u2014 put the good old CSS here to make your pages beautiful!<\/li>\n<\/ul>\n<p>Keeping the above paradigm in mind, let\u2019s minimally customize the code in <code>App.vue<\/code>:<\/p>\n<pre><code><template>\n  <div id=\"app\">\n    <p>This component\u2019s code is in {{ filename }}<\/p>\n  <\/div>\n<\/template>\n\n<script>\nexport default {\n  data() {\n    return {\n      filename: 'App.vue'\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<p>Remember that the above code snippet is simply for testing out that <code>App.vue<\/code> is working with our own code in it. It will later go on through a lot of changes, but first save the file and refresh the page on the browser.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3ae50e3f-da4c-40ee-b9a4-48d2ac8ebd98\/interactive-weather-dashboard-image7.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image7.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3ae50e3f-da4c-40ee-b9a4-48d2ac8ebd98\/interactive-weather-dashboard-image7.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3ae50e3f-da4c-40ee-b9a4-48d2ac8ebd98\/interactive-weather-dashboard-image7.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3ae50e3f-da4c-40ee-b9a4-48d2ac8ebd98\/interactive-weather-dashboard-image7.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3ae50e3f-da4c-40ee-b9a4-48d2ac8ebd98\/interactive-weather-dashboard-image7.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image7.png?w=900\" sizes=\"100vw\" alt=\"A screenshot of the browser with the message \u201cThis component\u2019s code is in App.vue\u201d\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/3ae50e3f-da4c-40ee-b9a4-48d2ac8ebd98\/interactive-weather-dashboard-image7.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>At this point, it\u2019s probably a good idea to get some help in tooling. Check out the <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/vuejs-devtools\/nhdogjmejiglipccpnnnanhbledajbpd?hl=en\">Vue devtools for Chrome<\/a>, and if you don\u2019t have much problems in using Google Chrome as your default browser for development, install the tool and play around with it a bit. It will come in extremely handy for further development and debugging, when things becomes more complicated.<\/p>\n<h4>Additional Directories And Files<\/h4>\n<p>The next step would be to add additional files, so that the structure of our project becomes complete. We would add the following directories and files:<\/p>\n<ul>\n<li><code>src\/css\/<\/code><br \/>\n\u2014 <code>style.css<\/code><\/li>\n<li><code>src\/assets\/<\/code><br \/>\n\u2014 <a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/calendar.svg\"><code>calendar.svg<\/code><\/a><br \/>\n\u2014 <a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/location.svg\"><code>vlocation.svg<\/code><\/a><br \/>\n\u2014 <a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/search.svg\"><code>search.svg<\/code><\/a><br \/>\n\u2014 <a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/winddirection.svg\"><code>winddirection.svg<\/code><\/a><br \/>\n\u2014 <a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/windspeed.svg\"><code>windspeed.svg<\/code><\/a><\/li>\n<li><code>src\/components\/<\/code><br \/>\n\u2014 <code>Content.vue<\/code><br \/>\n\u2014 <code>Highlights.vue<\/code><br \/>\n\u2014 <code>TempVarChart.vue<\/code><br \/>\n\u2014 <code>UVIndex.vue<\/code><br \/>\n\u2014 <code>Visibility.vue<\/code><br \/>\n\u2014 <code>WindStatus.vue<\/code><\/li>\n<\/ul>\n<p><strong>Note<\/strong>: <em>Save the hyperlinked <code>.svg<\/code> files in your project.<\/em><\/p>\n<p>Create the directories and files mentioned above. The final project structure should like look (remember to delete folders and files from the default structure that are now unnecessary):<\/p>\n<pre><code>vue_weather_dashboard\/\n|--- README.md\n|--- node_modules\/\n|     |--- ...\n|     |--- ...\n|     |--- [many npm packages we installed]\n|     |--- ...\n|     |--- ...\n|--- package.json\n|--- package-lock.json\n|--- webpack.config.js\n|--- index.html\n|--- src\/\n|     |--- App.vue\n|     |--- css\/\n|     |     |--- style.css \n|     |--- assets\/\n|     |     |--- calendar.svg\n|     |     |--- location.svg\n|     |     |--- location.svg\n|     |     |--- winddirection.svg\n|     |     |--- windspeed.svg\n|     |--- main.js\n|     |--- components\/\n|     |     |--- Content.vue\n|     |     |--- Highlights.vue\n|     |     |--- TempVarChart.vue\n|     |     |--- UVIndex.vue\n|     |     |--- Visibility.vue\n|     |     |--- WindStatus.vue\n<\/code><\/pre>\n<p><em>There might be some other files, like<\/em> <code>.babelrc<\/code>, <code>.gitignore<\/code>, <code>.editorconfig<\/code>, <em>etc. in the project\u2019s root folder. You may ignore them safely for now.<\/em><\/p>\n<p>In the following section, we will add minimal content to the newly added files, and test whether they are properly working.<\/p>\n<h5>src\/css\/style.css<\/h5>\n<p>Although it will not be of much use immediately, copy the following code to the file:<\/p>\n<div>\n<pre><code>@import url(\"https:\/\/fonts.googleapis.com\/css?family=Roboto:300,400,500\");\n\n:root {\n   font-size: 62.5%;\n}\n\nbody {\n   font-family: Roboto;\n   font-weight: 400;\n   width: 100%;\n   margin: 0;\n   font-size: 1.6rem;\n}\n\n#sidebar {\n   position: relative;\n   display: flex;\n   flex-direction: column;\n   background-image: linear-gradient(-180deg, #80b6db 0%, #7da7e2 100%);\n}\n\n#search {\n   text-align: center;\n   height: 20vh;\n   position: relative;\n}\n\n#location-input {\n   height: 42px;\n   width: 100%;\n   opacity: 1;\n   border: 0;\n   border-radius: 2px;\n   background-color: rgba(255, 255, 255, 0.2);\n   margin-top: 16px;\n   padding-left: 16px;\n   color: #ffffff;\n   font-size: 1.8rem;\n   line-height: 21px;\n}\n\n#location-input:focus {\n   outline: none;\n}\n\n::placeholder {\n   color: #FFFFFF;\n   opacity: 0.6;\n}\n\n#current-weather {\n   color: #ffffff;\n   font-size: 8rem;\n   line-height: 106px;\n   position: relative;\n}\n\n#current-weather>span {\n   color: #ffffff;\n   font-size: 3.6rem;\n   line-height: 42px;\n   vertical-align: super;\n   opacity: 0.8;\n   top: 15px;\n   position: absolute;\n}\n\n#weather-desc {\n   font-size: 2.0rem;\n   color: #ffffff;\n   font-weight: 500;\n   line-height: 24px;\n}\n\n#possibility {\n   color: #ffffff;\n   font-size: 16px;\n   font-weight: 500;\n   line-height: 19px;\n}\n\n#max-detail,\n#min-detail {\n   color: #ffffff;\n   font-size: 2.0rem;\n   font-weight: 500;\n   line-height: 24px;\n}\n\n#max-detail>i,\n#min-detail>i {\n   font-style: normal;\n   height: 13.27px;\n   width: 16.5px;\n   opacity: 0.4;\n}\n\n#max-detail>span,\n#min-detail>span {\n   color: #ffffff;\n   font-family: Roboto;\n   font-size: 1.2rem;\n   line-height: 10px;\n   vertical-align: super;\n}\n\n#max-summary,\n#min-summary {\n   opacity: 0.9;\n   color: #ffffff;\n   font-size: 1.4rem;\n   line-height: 16px;\n   margin-top: 2px;\n   opacity: 0.7;\n}\n\n#search-btn {\n   position: absolute;\n   right: 0;\n   top: 16px;\n   padding: 2px;\n   z-index: 999;\n   height: 42px;\n   width: 45px;\n   background-color: rgba(255, 255, 255, 0.2);\n   border: none;\n}\n\n#dashboard-content {\n   text-align: center;\n   height: 100vh;\n}\n\n#date-desc,\n#location-desc {\n   color: #ffffff;\n   font-size: 1.6rem;\n   font-weight: 500;\n   line-height: 19px;\n   margin-bottom: 15px;\n}\n\n#date-desc>img {\n   top: -3px;\n   position: relative;\n   margin-right: 10px;\n}\n\n#location-desc>img {\n   top: -3px;\n   position: relative;\n   margin-left: 5px;\n   margin-right: 15px;\n}\n\n#location-detail {\n   opacity: 0.7;\n   color: #ffffff;\n   font-size: 1.4rem;\n   line-height: 20px;\n   margin-left: 35px;\n}\n\n.centered {\n   position: fixed;\n   top: 45%;\n   left: 50%;\n   transform: translate(-50%, -50%);\n}\n\n.max-desc {\n   width: 80px;\n   float: left;\n   margin-right: 28px;\n}\n\n.temp-max-min {\n   margin-top: 40px\n}\n\n#dashboard-content {\n   background-color: #F7F7F7;\n}\n\n.custom-card {\n   background-color: #FFFFFF !important;\n   border: 0 !important;\n   margin-top: 16px !important;\n   margin-bottom: 20px !important;\n}\n\n.custom-content-card {\n   background-color: #FFFFFF !important;\n   border: 0 !important;\n   margin-top: 16px !important;\n   margin-bottom: 0px !important;\n}\n\n.header-card {\n   height: 50vh;\n}\n\n.content-card {\n   height: 43vh;\n}\n\n.card-divider {\n   margin-top: 0;\n}\n\n.content-header {\n   color: #8786A4;\n   font-size: 1.4rem;\n   line-height: 16px;\n   font-weight: 500;\n   padding: 15px 10px 5px 15px;\n}\n\n.highlights-item {\n   min-height: 37vh;\n   max-height: 38vh;\n   background-color: #FFFFFF;\n}\n\n\n.card-heading {\n   color: rgb(33, 34, 68);\n   font-size: 1.8rem;\n   font-weight: 500;\n   line-height: 21px;\n   text-align: center;\n}\n\n.card-sub-heading {\n   color: #73748C;\n   font-size: 1.6rem;\n   line-height: 19px;\n}\n\n.card-value {\n   color: #000000;\n   font-size: 1.8rem;\n   line-height: 21px;\n}\n\nspan text {\n   font-weight: 500 !important;\n}\n\nhr {\n   padding-top: 1.5px;\n   padding-bottom: 1px;\n   margin-bottom: 0;\n   margin-top: 0;\n   line-height: 0.5px;\n}\n\n@media only screen and (min-width: 768px) {\n   #sidebar {\n       height: 100vh;\n   }\n\n   #info {\n       position: fixed;\n       bottom: 50px;\n       width: 100%;\n       padding-left: 15px;\n   }\n\n   .wrapper-right {\n       margin-top: 80px;\n   }\n}\n\n@media only screen and (min-width:1440px) {\n   #sidebar {\n       width: 350px;\n       max-width: 350px;\n       flex: auto;\n   }\n\n   #dashboard-content {\n       width: calc(100% \u2014 350px);\n       max-width: calc(100% \u2014 350px);\n       flex: auto;\n   }\n}\n<\/code><\/pre>\n<\/div>\n<h5>src\/assets\/<\/h5>\n<p>In this directory, download and save the <code>.svg<\/code> files mentioned below:<\/p>\n<ul>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/calendar.svg\"><code>calendar.svg<\/code><\/a><\/li>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/location.svg\"><code>location.svg<\/code><\/a><\/li>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/search.svg\"><code>search.svg<\/code><\/a><\/li>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/winddirection.svg\"><code>winddirection.svg<\/code><\/a><\/li>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/datasouvik\/modified_weather_dashboard\/master\/src\/assets\/windspeed.svg\"><code>windspeed.svg<\/code><\/a><\/li>\n<\/ul>\n<h5>src\/components\/Content.vue<\/h5>\n<p>This is what we call a dumb component \u2014 a placeholder, that is there just to maintain the hierarchy, and essentially passes on data to its child components.<\/p>\n<p>Remember that there is no technical bar for writing all our code in the <code>App.vue<\/code> file, but we take the approach of splitting up the code by nesting the components for two reasons:<\/p>\n<ul>\n<li>To write clean code, which aids readability and maintainability;<\/li>\n<li>To replicate the same structure that we will see on screen, i.e., the hierarchy.<\/li>\n<\/ul>\n<p>Before we nest the component defined in <code>Content.vue<\/code> within the root component <code>App.vue<\/code>, let\u2019s write some toy (but educational) code for <code>Content.vue<\/code>:<\/p>\n<div>\n<pre><code><template>\n  <div>\n    <p>This child components of Content.vue are:<\/p>\n    <ul>\n      <li v-for=\"child in childComponents\">{{ child }}<\/li>\n    <\/ul>\n  <\/div>\n<\/template>\n\n<script>\nexport default {\n  data () {\n    return {\n      childComponents: ['TempVarChart.vue', 'Highlights.vue']\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<\/div>\n<p>In the code, carefully observe and understand the following:<\/p>\n<ul>\n<li>Within the <code><script><\/code> tag (where we obviously write some JavaScript code), we define an object that is exported (made available to other files) by default. This object contains a function <code>data()<\/code>, that returns an array object called <code>childComponents<\/code>, with its elements being names of the component files that should be nested further.<\/li>\n<li>Within the <code><template><\/code> tag (where we write some HTML template), the thing of interest is the <code>\n<ul><\/code>.<\/p>\n<ul>\n<li>Within the unordered list, each list item should be names of the intended child components, as defined in the array object <code>childComponents<\/code>. Moreover, the list should automatically extend till the last element of the array. Seems like we should write a <code>for<\/code>-loop, isn\u2019t it? We do that by using the <code>v-for<\/code> directive provided by Vue.js. The <code>v-for<\/code> directive:\n<ul>\n<li>Acts as an attribute of the <code>\n<li><\/code> tag, iterates through the array, renders the names of the child components where the iterator is mentioned within the <code>{{ }}<\/code> brackets (where we write the text for the list items).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>The code and the explanation above forms the basis of your subsequent understanding of how the script and the template are interrelated, and how we can use the directives provided by Vue.js.<\/p>\n<p>We have learnt quite a lot, but even after all these, we have one thing left to learn about seamlessly connecting components in hierarchy \u2014 passing data down from the parent component to its children. For now, we need to learn how to pass some data from <code>src\/App.vue<\/code> to <code>src\/components\/Content.vue<\/code>, so that we can use the same techniques for the rest of the component nesting in this project.<\/p>\n<p>Data trickling down from the parent to the child components might sound simple, but the devil is in the details! As briefly explained below, there are multiple steps involved in making it work:<\/p>\n<ul>\n<li><strong>Defining and the data<\/strong><br \/>\nFor now, we want some static data to play with \u2014 an object containing hard-coded values about different aspects of weather will just be fine! We create an object called <code>weather_data<\/code> and return it from the <code>data()<\/code> function of <code>App.vue<\/code>. The <code>weather_data<\/code> object is given in the snippet below:<\/li>\n<\/ul>\n<pre><code>weather_data: {\n        location: \"California\",\n        temperature: {\n          current: \"35 C\",\n        },\n        highlights: {\n          uvindex: \"3\",\n          windstatus: {\n            speed: \"20 km\/h\",\n            direction: \"N-E\",\n          },\n          visibility: \"12 km\",\n        },\n      },\n<\/code><\/pre>\n<ul>\n<li><strong>Passing the data from the parent<\/strong><br \/>\nTo pass the data, we need a destination where we want to send the data! In this case, the destination is the <code>Content.vue<\/code> component, and the way to implement it is to:<\/p>\n<ul>\n<li>Assign the <code>weather_data<\/code> object to a <em>custom attribute<\/em> of the <code><Content><\/code> tag<\/li>\n<li>Bind the attribute with the data using the <code>v-bind<\/code>: directive provided by Vue.js, which makes the attribute value dynamic (responsive to changes made in the original data).\n<pre><code><Content v-bind:weather_data=\u201cweather_data\u201d><\/Content>\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Defining and passing the data is handled at the source side of the handshake, which in our case is the <code>App.vue<\/code> file.<\/p>\n<p>The code for the <code>App.vue<\/code> file, at its current status, is given below:<\/p>\n<pre><code><template>\n  <div id=\"app\">\n    <p>This component\u2019s code is in {{ filename }}<\/p>\n    <Content v-bind:weather_data=\"weather_data\"><\/Content>\n  <\/div>\n<\/template>\n\n<script>\nimport Content from '.\/components\/Content.vue'\n\nexport default {\n  name: 'app',\n  components: {\n    'Content': Content\n  },\n  data () {\n    return {\n      filename: 'App.vue',\n      weather_data: {\n        location: \"California\",\n        temperature: {\n          current: \"35 C\",\n        },\n        highlights: {\n          uvindex: \"3\",\n          windstatus: {\n            speed: \"20 km\/h\",\n            direction: \"N-E\",\n          },\n          visibility: \"12 km\",\n        },\n      },\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0c7c18e0-caba-4cb0-b3c3-79e5ee34a62f\/interactive-weather-dashboard-image6.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image6.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0c7c18e0-caba-4cb0-b3c3-79e5ee34a62f\/interactive-weather-dashboard-image6.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0c7c18e0-caba-4cb0-b3c3-79e5ee34a62f\/interactive-weather-dashboard-image6.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0c7c18e0-caba-4cb0-b3c3-79e5ee34a62f\/interactive-weather-dashboard-image6.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0c7c18e0-caba-4cb0-b3c3-79e5ee34a62f\/interactive-weather-dashboard-image6.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image6.png?w=900\" sizes=\"100vw\" alt=\"A screenshot of the browser with the message \u201cThis component\u2019s code is in App.vue. This child components of Content.vue are: TempVarChart.vue, Highlights.vue\u201d\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/0c7c18e0-caba-4cb0-b3c3-79e5ee34a62f\/interactive-weather-dashboard-image6.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>With the data defined and passed from the source (parent component), it is now the child\u2019s responsibility to receive the data and render it appropriately, as explained in the next two steps.<\/p>\n<ul>\n<li><strong>Receiving the data by the child<\/strong><br \/>\nThe child component, in this case <code>Content.vue<\/code>, must receive the <code>weather_data<\/code> object send to it by the parent component <code>App.vue<\/code>. Vue.js provides a mechanism to do so \u2014 all you need is an array object called <a href=\"https:\/\/vuejs.org\/v2\/guide\/components-props.html\"><code>props<\/code><\/a>, defined in the default object exported by <code>Content.vue<\/code>. Each element of the array <code>props<\/code> is a  name of the data objects it wants to receive from its parent. For now, the only data object that it is supposed to receive is <code>weather_data<\/code> from App.vue. Thus, the <code>props<\/code> array looks like:<\/li>\n<\/ul>\n<pre><code><template>\n  \/\/ HTML template code here\n<\/template>\n\n<script>\nexport default {\n  props: [\"weather_data\"],\n  data () {\n    return {\n      \/\/ data here\n    }\n  },\n}\n<\/script>\n\n<style>\n  \/\/ component specific CSS here\n<\/style>\n<\/code><\/pre>\n<ul>\n<li><strong>Rendering the data in the page<\/strong><br \/>\nNow that we have ensured receiving the data, the last task we need to complete is to render the data. For this example, we will directly dump the received data on the web page, just to illustrate the technique. However, in real applications (like the one we are about to build), data normally goes through lots of processing, and only the relevant parts of it are displayed in ways that suits the purpose. For example, in this project we will eventually get raw data from the weather API, clean and format it, feed the data to the data structures necessary for the charts, and then visualize it. Anyway, to display the raw data dump, we will just use the <code>{{ }}<\/code> brackets that Vue understands, as shown in the snippet below:<\/li>\n<\/ul>\n<pre><code><template>\n  <div id=\"pagecontent\">\n    \/\/ other template code here\n    {{ weather_data }}\n  <\/div>\n<\/template>\n<\/code><\/pre>\n<p>It\u2019s now time to assimilate all the bits and pieces. The code for <code>Content.vue<\/code> \u2014 at its current status \u2014 is given below:<\/p>\n<div>\n<pre><code><template>\n  <div id=\"pagecontent\">\n    <p>This child components of Content.vue are:<\/p>\n    <ul>\n      <li v-for=\"child in childComponents\">{{ child }}<\/li>\n    <\/ul>\n    {{ weather_data }}\n  <\/div>\n<\/template>\n\n<script>\nexport default {\n  props: [\"weather_data\"],\n  data () {\n    return {\n      childComponents: ['TempVarChart.vue', 'Highlights.vue']\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n    \n  },\n}\n<\/script>\n\n<style>\n#pagecontent {\n  border: 1px solid black;\n  padding: 2px;\n}\n<\/style>\n<\/code><\/pre>\n<\/div>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec620211-f991-4ce3-9731-710ba32fa3b4\/interactive-weather-dashboard-image9.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image9.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec620211-f991-4ce3-9731-710ba32fa3b4\/interactive-weather-dashboard-image9.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec620211-f991-4ce3-9731-710ba32fa3b4\/interactive-weather-dashboard-image9.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec620211-f991-4ce3-9731-710ba32fa3b4\/interactive-weather-dashboard-image9.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec620211-f991-4ce3-9731-710ba32fa3b4\/interactive-weather-dashboard-image9.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image9.png?w=900\" sizes=\"100vw\" alt=\"A screenshot of the browser with the result of the code provided\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/ec620211-f991-4ce3-9731-710ba32fa3b4\/interactive-weather-dashboard-image9.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>After making the changes discussed above, refresh the webpage on the browser and see how it looks. Take a moment to appreciate the complexity that Vue handles \u2014 if you modify the <code>weather_data<\/code> object in <code>App.vue<\/code>, it gets silently conveyed to <code>Content.vue<\/code>, and eventually to the browser displaying the webpage! Try by changing the value for the key location.<\/p>\n<p>Although we have learned about props and data binding using static data, we will be using dynamic data collected using web APIs in the application, and will <em>change the code accordingly<\/em>.<\/p>\n<h4>Summary<\/h4>\n<p>Before we move on to the rest of the <code>.vue<\/code> files, let\u2019s summarize what we have learnt while we wrote the code for <code>App.vue<\/code> and <code>components\/Content.vue<\/code>:<\/p>\n<ul>\n<li>The <code>App.vue<\/code> file is what we call the root component \u2014 the one that sits at the top of the component hierarchy. The rest of the <code>.vue<\/code> files represents components that are its direct child, grandchild, and so on.<\/li>\n<li>The <code>Content.vue<\/code> file is a dummy component \u2014 its responsibility is to pass on the data to levels below and maintain the structural hierarchy, so that our code remains consistent with the philosophy \u201c*what we see is what we implement*\u201d.<\/li>\n<li>The parent-child relationship of component does not happen out of thin air \u2014 you must <em>register a component<\/em> (either globally or locally, depending on the intended usage of the component), and then <em>nest<\/em> it using custom HTML tags (whose spellings are the exact same as that of the names with which the components has been registered).<\/li>\n<li>Once registered and nested, data is passed on from parent to child components, and the flow is <em>never reverse<\/em> (bad things will happen if the project architecture allows backflow). The parent component is the relative source of the data, and it passes down relevant data to its children using the <code>v-bind<\/code> directive for the attributes of the custom HTML elements. The child receives the data intended for it using props, and then decides on its own what to do with the data.<\/li>\n<\/ul>\n<p>For the rest of the components, we will not indulge in detailed explanation \u2014 we will just write the code based on the learnings from the above summary. The code will be self-evident, and if you get confused about the hierarchy, refer to the diagram below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d907827c-a9e0-4abc-a891-274cc701965f\/interactive-weather-dashboard-image8.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image8.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d907827c-a9e0-4abc-a891-274cc701965f\/interactive-weather-dashboard-image8.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d907827c-a9e0-4abc-a891-274cc701965f\/interactive-weather-dashboard-image8.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d907827c-a9e0-4abc-a891-274cc701965f\/interactive-weather-dashboard-image8.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d907827c-a9e0-4abc-a891-274cc701965f\/interactive-weather-dashboard-image8.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image8.png?w=900\" sizes=\"100vw\" alt=\"A diagram explaining the hierarchy of the code\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/d907827c-a9e0-4abc-a891-274cc701965f\/interactive-weather-dashboard-image8.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>The diagram says that <code>TempVarChart.vue<\/code> and <code>Highlights.vue<\/code> are the direct child of <code>Content.vue<\/code>. Thus, it might be a good idea to prepare <code>Content.vue<\/code> for sending data to those components, which we do using the code below:<\/p>\n<div>\n<pre><code><template>\n  <div id=\"pagecontent\">\n    <p>This child components of Content.vue are:<\/p>\n    <ul>\n      <li v-for=\"child in childComponents\">{{ child }}<\/li>\n    <\/ul>\n    {{ weather_data }}\n    <temp-var-chart :tempVar=\"tempVar\"><\/temp-var-chart>\n    <today-highlights :highlights=\"highlights\"><\/today-highlights>\n  <\/div>\n<\/template>\n\n<script>\nimport TempVarChart from '.\/TempVarChart.vue'\nimport Highlights from '.\/Highlights.vue'\n\nexport default {\n  props: [\"weather_data\"],\n  components: {\n    'temp-var-chart': TempVarChart,\n    'today-highlights': Highlights\n  },\n  data () {\n    return {\n      childComponents: ['TempVarChart.vue', 'Highlights.vue'],\n      tempVar: this.weather_data.temperature,\n      highlights: this.weather_data.highlights,\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<\/div>\n<p>Once you save this code, you will get errors \u2014 don\u2019t worry, it is expected. It will be fixed once you have the rest of the component files ready. If it bothers you not to be able to see the output, comment out the lines containing the custom element tags <code><temp-var-chart><\/code> and <code><today-highlights><\/code>.<\/p>\n<p>For this section, this is the final code of <code>Content.vue<\/code>. For the rest of this section, <em>we will reference to this code<\/em>, and not the previous ones that we wrote for learning.<\/p>\n<h5>src\/components\/TempVarChart.vue<\/h5>\n<p>With its parent component <code>Content.vue<\/code> passing on the data, <code>TempVarChart.vue<\/code> must be set up to receive and render the data, as shown in the code below:<\/p>\n<pre><code><template>\n  <div id=\"tempvarchart\">\n    <p>Temperature Information:<\/p>\n    {{ tempVar }}\n  <\/div>\n<\/template>\n\n<script>\n\nexport default {\n  props: [\"tempVar\"],\n  data () {\n    return {\n\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<h5>src\/components\/Highlights.vue<\/h5>\n<p>This component will also receive data from <code>App.vue<\/code> \u2014 its parent component. After that, it should be linked with its child components, and relevant data should be passed on to them.<\/p>\n<p>Let\u2019s first see the code for receiving data from the parent:<\/p>\n<pre><code><template>\n  <div id=\"highlights\">\n    <p>Weather Highlights:<\/p>\n    {{ highlights }}\n  <\/div>\n<\/template>\n\n<script>\n\nexport default {\n  props: [\"highlights\"],\n  data () {\n    return {\n      \n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<p>At this point, the web page looks like the image below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image10.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image10.png?w=900\" sizes=\"100vw\" alt=\"Result of the code displayed in the browser\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>Now we need to modify the code of <code>Highlights.vue<\/code> to register and nest its child components, followed by passing the data to children. The code for it is as follows:<\/p>\n<pre><code><template>\n  <div id=\"highlights\">\n    <p>Weather Highlights:<\/p>\n    {{ highlights }}\n    <uv-index :highlights=\"highlights\"><\/uv-index>\n    <visibility :highlights=\"highlights\"><\/visibility>\n    <wind-status :highlights=\"highlights\"><\/wind-status>  \n  <\/div>\n<\/template>\n\n<script>\nimport UVIndex from '.\/UVIndex.vue';\nimport Visibility from '.\/Visibility.vue';\nimport WindStatus from '.\/WindStatus.vue';\n\nexport default {\n  props: [\"highlights\"],\n  components: {\n    'uv-index': UVIndex,\n    'visibility': Visibility,\n    'wind-status': WindStatus,\n  },  \n  data () {\n    return {\n      \n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<p>Once you save the code and see the web page, you are <em>expected to see errors<\/em> in the Developer Console tool provided by the browser; they appear because although <code>Highlights.vue<\/code> is sending data, nobody is receiving them. We are yet to write the code for the <em>children<\/em> of <code>Highlights.vue<\/code>.<\/p>\n<p>Observe that we have not done much of the data processing, i.e, we have not extracted the individual factors of weather data that goes under the Highlights section of the dashboard. We could have done that in the <code>data()<\/code> function, but we preferred to keep <code>Highlights.vue<\/code> a dumb component that just passes on the entire data dump it receives to each of the children, who then own their own extracts what is necessary for them. However, we encourage you to try out extracting data in the <code>Highlights.vue<\/code>, and send relevant data down to each child component \u2014 it\u2019s a good practice exercise nonetheless!<\/p>\n<h5>src\/components\/UVIndex.vue<\/h5>\n<p>The code for this component receives the data dump of highlights from <code>Highlights.vue<\/code>, extracts the data for UV Index, and renders it on the page.<\/p>\n<pre><code><template>\n  <div id=\"uvindex\">\n    <p>UV Index: {{ uvindex }}<\/p>\n  <\/div>\n<\/template>\n\n<script>\n\nexport default {\n  props: [\"highlights\"],\n  data () {\n    return {\n      uvindex: this.highlights.uvindex\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<h5>src\/components\/Visibility.vue<\/h5>\n<p>The code for this component receives the data dump of highlights from <code>Highlights.vue<\/code>, extracts the data for Visibility, and renders it on the page.<\/p>\n<pre><code><template>\n  <div id=\"visibility\">\n    <p>Visibility: {{ visibility }}<\/p>\n  <\/div>\n<\/template>\n\n<script>\n\nexport default {\n  props: [\"highlights\"],\n  data () {\n    return {\n      visibility: this.highlights.visibility,\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<h5>src\/components\/WindStatus.vue<\/h5>\n<p>The code for this component receives the data dump of highlights from <code>Highlights.vue<\/code>, extracts the data for Wind Status (speed and direction), and renders it on the page.<\/p>\n<div>\n<pre><code><template>\n  <div id=\"windstatus\">\n    <p>Wind Status:<\/p>\n    <p>Speed \u2014 {{ speed }}; Direction \u2014 {{ direction }}<\/p>\n  <\/div>\n<\/template>\n\n<script>\n\nexport default {\n  props: [\"highlights\"],\n  data () {\n    return {\n      speed: this.highlights.windstatus.speed,\n      direction: this.highlights.windstatus.direction\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<\/div>\n<p>After adding the code for all the components, take a look at the web page on the browser.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image10.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image10.png?w=900\" sizes=\"100vw\" alt=\"Result of the code displayed in the browser\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/b8418772-369a-43ba-a5b5-c781f4fcd697\/interactive-weather-dashboard-image10.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>Not to dishearten, but all these toiling was just to link the components in hierarchy, and test out whether data flow is happening between them or not! In the next section, we will <em>throw away most of the code we have written so far<\/em>, and add a lot more pertaining to the actual project. However, we will certainly retain the structure and nesting of the components; the learnings from this section will allow us to build a decent dashboard with Vue.js.<\/p>\n<h3>4. Data Acquisition And Processing<\/h3>\n<p>Remember the <code>weather_data<\/code> object in <code>App.vue<\/code>? It had some hard-coded data that we used to test whether all the components are working correctly, and also to help you learn some basic aspects of Vue application without getting bogged down in the details of real-world data. However, it\u2019s now time that we shed our shell, and step out into the real world, where data from the API will dominate most of our code.<\/p>\n<h4>Preparing Child Components To Receive And Process Real Data<\/h4>\n<p>In this section, you will get code dump for all the components except <code>App.vue<\/code>. The code will handle receiving real data from <code>App.vue<\/code> (unlike the code we wrote in the previous section to receive and render dummy data).<\/p>\n<p>We strongly encourage to read the code of each component carefully, so that you form an idea of what data each of those components are expecting, and will eventually use in visualization.<\/p>\n<p>Some of the code, and the overall structure, will be similar to the ones you have seen in the previous structure \u2014 so you will not face something drastically different. However, the devil is in the details! So examine the code carefully, and when you have understood them reasonably well, copy the code to the respective component files in your project.<\/p>\n<p><strong>Note<\/strong>: <em>All the components in this section are in the <code>src\/components\/<\/code> directory. So each time, the path will not be mentioned \u2014 only the <code>.vue<\/code> file name will be mentioned to identify the component.<\/em><\/p>\n<h5>Content.vue<\/h5>\n<div>\n<pre><code><template>\n <div style=\"position: relative;\">\n     <temp-var-chart :tempVar=\"tempVar\"><\/temp-var-chart>\n     <today-highlights :highlights=\"highlights\"><\/today-highlights>\n <\/div>\n<\/template>\n\n<script>\nimport TempVarChart from '.\/TempVarChart.vue';\nimport Highlights from '.\/Highlights.vue';\n\nexport default {\n props: ['highlights', 'tempVar'],\n components: {\n   'temp-var-chart': TempVarChart,\n   'today-highlights': Highlights\n },\n}\n<\/script>\n<\/code><\/pre>\n<\/div>\n<p>The following changes have been made from the previous code:<\/p>\n<ul>\n<li>In the <code><template><\/code>, text and data within <code>{{ }}<\/code> has been removed, since we are now just receiving data and passing down to the children, with no rendering specific this component.<\/li>\n<li>In the <code>export default {}<\/code>:\n<ul>\n<li>The <code>props<\/code> have been changed to match the data objects that will be send by the parent: <code>App.vue<\/code>. The reason for changing the props is that <code>App.vue<\/code> itself will display some of the data it acquires from the weather API and other online resources, based on the search query of the user, and pass on the rest of the data. In the dummy code we wrote earlier, <code>App.vue<\/code> was passing on the entire dummy data dump, without any discrimination, and the props of <code>Content.vue<\/code> was set up accordingly.<\/li>\n<li>The data() function now returns nothing, as we are not doing any data manipulation in this component.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>TempVarChart.vue<\/h5>\n<p>This component is supposed to receive detailed temperature projections for the rest of the current day, and eventually display them using FusionCharts. But for the time being, we will display them only as text on the webpage.<\/p>\n<pre><code><template>\n  <div>\n    {{ tempVar.tempToday }}    \n  <\/div>\n<\/template>\n\n<script>\nexport default {\n  props: [\"tempVar\"],\n  components: {},\n  data() {\n    return {\n\n    };\n  },\n  methods: {\n    \n  },\n  \n};\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<h5>Highlights.vue<\/h5>\n<pre><code><template>\n  <div>\n    <uv-index :highlights=\"highlights\"><\/uv-index>\n    <visibility :highlights=\"highlights\"><\/visibility>\n    <wind-status :highlights=\"highlights\"><\/wind-status>\n  <\/div>\n<\/template>\n\n<script>\nimport UVIndex from '.\/UVIndex.vue';\nimport Visibility from '.\/Visibility.vue';\nimport WindStatus from '.\/WindStatus.vue';\n\nexport default {\n  props: [\"highlights\"],\n  components: {\n    'uv-index': UVIndex,\n    'visibility': Visibility,\n    'wind-status': WindStatus,\n  },\n  data () {\n    return {\n\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<p>The changes made from the previous code are:<\/p>\n<ul>\n<li>In the <code><template><\/code>, the text and the data within <code>{{ }}<\/code> has been removed, because this is a dumb component, just like <code>Content.vue<\/code>, whose only job is to pass on the data to children while maintaining the structural hierarchy. Remember that dumb components like <code>Highlights.vue<\/code> and <code>Content.vue<\/code> exists to maintain the parity between the visual structure of the dashboard, and the code we write.<\/li>\n<\/ul>\n<h5>UVIndex.vue<\/h5>\n<p>The changes made to the previous code are as follows:<\/p>\n<ul>\n<li>In the <code><template><\/code> and <code><br \/>\n<style><\/code>, the <code>div id<\/code> has been changed to <code>uvIndex<\/code>, which is more readable.<\/li>\n<li>In the <code>export default {}<\/code>, the <code>data()<\/code> function now returns a string object <code>uvIndex<\/code>, whose value is extracted from the highlights object received by the component using <code>props<\/code>. This <code>uvIndex<\/code> is now temporarily used to display the value as text within the <code><template><\/code>. Later on, we will plug in this value to the data structure suitable for rendering a chart.<\/li>\n<\/ul>\n<h5>Visibility.vue<\/h5>\n<pre><code><template>\n  <div>\n    <p>Visibility: {{ visibility }}<\/p>\n  <\/div>\n<\/template>\n\n<script>\n\nexport default {\n  props: [\"highlights\"],\n  data () {\n    return {\n      visibility: this.highlights.visibility.toString()\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<p>The only change made in this file (with respect to its previous code) is that the definition of the <code>visibility<\/code> object returned by the <code>data()<\/code> function now contains <code>toString()<\/code> at its end, since the value received from the parent will be a floating point number, which needs to be converted into string.<\/p>\n<h5>WindStatus.vue<\/h5>\n<div>\n<pre><code><template>\n  <div>\n    <p>Wind Speed \u2014 {{ windSpeed }}<\/p>\n    <p>Wind Direction \u2014 {{ derivedWindDirection }}, or {{ windDirection }} degree clockwise with respect to true N as 0 degree.<\/p>\n  <\/div>\n<\/template>\n\n<script>\n\nexport default {\n  props: [\"highlights\"],\n  data () {\n    return {\n      windSpeed: this.highlights.windStatus.windSpeed,\n      derivedWindDirection: this.highlights.windStatus.derivedWindDirection,\n      windDirection: this.highlights.windStatus.windDirection\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<\/div>\n<p>The changes made to the previous code are as follows:<\/p>\n<ul>\n<li>Throughout the file, <code>windstatus<\/code> has been renamed as <code>windStatus<\/code>, to promote readability and also to be in sync with the the highlights object that <code>App.vue<\/code> provides with actual data.<\/li>\n<li>Similar naming changes have been made for the speed and direction \u2014 the new ones are <code>windSpeed<\/code> and <code>windDirection<\/code>.<\/li>\n<li>A new object <code>derivedWindDirection<\/code> has come into play (also provided by <code>App.vue<\/code> in the highlights bundle).<\/li>\n<\/ul>\n<p>For now, the received data is rendered as text; later, it will be plugged in to the data structure necessary for visualization.<\/p>\n<h4>Testing With Dummy Data<\/h4>\n<p>Resorting to dummy data repeatedly might be a bit frustrating for you, but there are some good reasons behind it:<\/p>\n<ul>\n<li>We have made a lot of changes to the code of each component, and it\u2019s a good idea to test whether those changes are breaking the code. In other words, we should check that whether the data flow is intact, now that we are about to move to more complex parts of the project.<\/li>\n<li>The real data from the online weather API will need lot of massaging, and it might be overwhelming for you to juggle between the code for data acquisition and processing, and the code for smooth data flow down the components. The idea is to keep the quantum of complexity under control, so that we have a better understanding of the errors we might face.<\/li>\n<\/ul>\n<p>In this section, what we do is essentially hardcode some json data in the <code>App.vue<\/code>, which will obviously be replaced with live data in the near future. There are a lot of similarity between the dummy json structure, and the json structure we will use for the actual data. So it also provides you a rough idea of what to expect from the real data, once we encounter it.<\/p>\n<p>However, we admit that this is far from the ideal approach one might adopt while building such a project from scratch. In the real world, you will often start with the real data source, play around with it a bit to understand what can and should be done to tame it, and then think about the appropriate json data structure to capture the relevant information. We intentionally shielded you from all those dirty work, since it takes you farther from the objective \u2014 learning how to use Vue.js and FusionCharts to build a dashboard.<\/p>\n<p>Let\u2019s now jump into the new code for App.vue:<\/p>\n<div>\n<pre><code><template>\n  <div id=\"app\">\n    <dashboard-content :highlights=\"highlights\" :tempVar=\"tempVar\"><\/dashboard-content>\n  <\/div>\n<\/template>\n\n<script>\nimport Content from '.\/components\/Content.vue'\n\nexport default {\n  name: 'app',\n  components: {\n    'dashboard-content': Content\n  },\n  data () {\n    return {\n      tempVar: {\n        tempToday: [\n          {hour: '11.00 AM', temp: '35'},\n          {hour: '12.00 PM', temp: '36'},\n          {hour: '1.00 PM', temp: '37'},\n          {hour: '2.00 PM', temp: '38'},\n          {hour: '3.00 PM', temp: '36'},\n          {hour: '4.00 PM', temp: '35'},\n        ],\n      },\n      highlights: {\n        uvIndex: 4,\n        visibility: 10,\n        windStatus: {\n          windSpeed: '30 km\/h',\n          windDirection: '30',\n          derivedWindDirection: 'NNE',\n        },\n      },\n    }\n  },\n  methods: {\n\n  },\n  computed: {\n\n  },\n}\n<\/script>\n\n<style>\n\n<\/style>\n<\/code><\/pre>\n<\/div>\n<p>The changes made to the code with respect to its previous version are as follows:<\/p>\n<ul>\n<li>The name of the child component has been changed to dashboard-content, and accordingly the custom HTML element in the <code><template><\/code> has been revised. Note that now we have two attributes \u2014 <code>highlights<\/code> and <code>tempVar<\/code> \u2014 instead of a single attribute that we used earlier with the custom element. Accordingly, the data associated with those attributes have also changed. What\u2019s interesting here is that we can use the <code>v-bind:<\/code> directive, or its shorthand <code>:<\/code> (as we have done here), with multiple attributes of a custom HTML element!<\/li>\n<li>The <code>data()<\/code> function now returns the <code>filename<\/code> object (that existed earlier), along with two new objects (instead of the old <code>weather_data<\/code>): <code>tempVar<\/code> and <code>highlights<\/code>. The structure of the json is appropriate for the code we have written in the child components, so that they can extract the data pieces they need from the dumps. The structures are quite self-explanatory, and you can expect them to be quite similar when we deal with live data. However, the significant change that you will encounter is the absence of hardcoding (obvious, isn\u2019t it) \u2014 we will leave the values blank as the default state, and write code to dynamically update them based on the values we will receive from the weather API.<\/li>\n<\/ul>\n<p>You have written a lot of code in this section, without seeing the actual output. Before you proceed further, take a look at the browser (restart the server with <code>npm run dev<\/code>, if necessary), and bask in the glory of your achievement. The web page that you should see at this point looks like the image below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/32be6750-69fb-4cad-8f0c-8d07ab08d107\/interactive-weather-dashboard-image11.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image11.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/32be6750-69fb-4cad-8f0c-8d07ab08d107\/interactive-weather-dashboard-image11.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/32be6750-69fb-4cad-8f0c-8d07ab08d107\/interactive-weather-dashboard-image11.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/32be6750-69fb-4cad-8f0c-8d07ab08d107\/interactive-weather-dashboard-image11.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/32be6750-69fb-4cad-8f0c-8d07ab08d107\/interactive-weather-dashboard-image11.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image11.png?w=900\" sizes=\"100vw\" alt=\"Result of the code displayed in the browser\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/32be6750-69fb-4cad-8f0c-8d07ab08d107\/interactive-weather-dashboard-image11.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<h4>Code For Data Acquisition And Processing<\/h4>\n<p>This section is going to be the meat of the project, with all the code to be written in <code>App.vue<\/code> for the following:<\/p>\n<ul>\n<li>Location input from the user \u2014 an input box and a call-to-action button is sufficient;<\/li>\n<li>Utility functions for various tasks; these functions will be called later in various parts of the component code;<\/li>\n<li>Getting detailed geolocation data from Google Maps API for JavaScript;<\/li>\n<li>Getting detailed weather data from the Dark Sky API;<\/li>\n<li>Formatting and processing the geolocation and weather data, which will be passed on to the child components.<\/li>\n<\/ul>\n<p>The subsections that follows illustrates how we can implement the tasks laid out for us in the above points. With some exceptions, most of them will follow the sequence.<\/p>\n<h4>Input From The User<\/h4>\n<p>It\u2019s quite obvious that the action starts when the user provides the name of the place for which the weather data needs to be displayed. For this to happen, we need to implement the following:<\/p>\n<ul>\n<li>An input box for entering the location;<\/li>\n<li>A submit button that tells our application that the user has entered the location and it\u2019s time to do the rest. We will also implement the behavior when processing starts upon hitting <kbd>Enter<\/kbd>.<\/li>\n<\/ul>\n<p>The code we show below will be restricted to the HTML template part of <code>App.vue<\/code>. We will just mention the name of the method associated with the click events, and define them later in the methods object of the <script> in App.vue.<\/p>\n<div>\n<pre><code><div id=\"search\">\n           <input\n             id=\"location-input\"\n             type=\"text\"\n             ref=\"input\"\n             placeholder=\"Location?\"\n             @keyup.enter=\"organizeAllDetails\"\n           >\n           <button id=\"search-btn\" @click=\"organizeAllDetails\">\n             <img loading=\"lazy\" decoding=\"async\" src=\".\/assets\/Search.svg\" width=\"24\" height=\"24\">\n           <\/button>\n<\/div>\n<\/code><\/pre>\n<\/div>\n<p>Placing the above snippet in the right place is trivial \u2014 we leave it to you. However, the interesting parts of the snippet are:<\/p>\n<ul>\n<li><code>@keyup.enter=\"organizeAllDetails\"<\/code><\/li>\n<li><code>@click=\"organizeAllDetails\"<\/code><\/li>\n<\/ul>\n<p>As you know from the earlier sections, <code>@<\/code> is Vue\u2019s shorthand for the directive <code>v-on<\/code>:, which is associated with some event. The new thing is \u201c<code>organizeAllDetails<\/code>\u201d \u2014 it\u2019s nothing but the method that will fire once the events (pressing <kbd>Enter<\/kbd> or clicking the button) happens. We are yet to define method, and the puzzle will be complete by the end of this section.<\/p>\n<h4>Text Information Display Controlled By App.vue<\/h4>\n<p>Once the user input triggers the action and lots of data is acquired from the APIs, we encounter the inevitable question \u2014 \u201cWhat to do with all these data?\u201d. Obviously some data massaging is required, but that does not answer our question fully! We need to decide what\u2019s the end use of the data, or more directly, which are the entities that receives different chunks of the acquired and processed data?<\/p>\n<p>The child components of <code>App.vue<\/code>, based on their hierarchy and purpose, are the frontline contenders for the bulk of the data. However, we will also have some data that does not belong to any of those child components, yet are quite informative and makes the dashboard complete. We can make good use of them if we display them as text information directly controlled by <code>App.vue<\/code>, while the rest of the data are passed on to the child for getting displayed as pretty charts ultimately.<\/p>\n<p>With this context in mind, let\u2019s focus on the code for setting the stage of using text data. It\u2019s simple HTML template at this point, on which the data will eventually come and sit.<\/p>\n<div>\n<pre><code><div id=\"info\">\n  <div class=\"wrapper-left\">\n    <div id=\"current-weather\">\n      {{ currentWeather.temp }}\n      <span>\u00b0C<\/span>\n    <\/div>\n    <div id=\"weather-desc\">{{ currentWeather.summary }}<\/div>\n    <div class=\"temp-max-min\">\n      <div class=\"max-desc\">\n        <div id=\"max-detail\">\n          <i>?<\/i>\n          {{ currentWeather.todayHighLow.todayTempHigh }}\n          <span>\u00b0C<\/span>\n        <\/div>\n        <div id=\"max-summary\">at {{ currentWeather.todayHighLow.todayTempHighTime }}<\/div>\n      <\/div>\n      <div class=\"min-desc\">\n        <div id=\"min-detail\">\n          <i>?<\/i>\n          {{ currentWeather.todayHighLow.todayTempLow }}\n          <span>\u00b0C<\/span>\n        <\/div>\n        <div id=\"min-summary\">at {{ currentWeather.todayHighLow.todayTempLowTime }}<\/div>\n      <\/div>\n    <\/div>\n  <\/div>\n  <div class=\"wrapper-right\">\n    <div class=\"date-time-info\">\n      <div id=\"date-desc\">\n        <img loading=\"lazy\" decoding=\"async\" src=\".\/assets\/calendar.svg\" width=\"20\" height=\"20\">\n        {{ currentWeather.time }}\n      <\/div>\n    <\/div>\n    <div class=\"location-info\">\n      <div id=\"location-desc\">\n        <img decoding=\"async\"\n          src=\".\/assets\/location.svg\"\n          width=\"10.83\"\n          height=\"15.83\"\n          style=\"opacity: 0.9;\"\n        >\n        {{ currentWeather.full_location }}\n        <div id=\"location-detail\" class=\"mt-1\">\n          Lat: {{ currentWeather.formatted_lat }}\n          <br>\n          Long: {{ currentWeather.formatted_long }}\n        <\/div>\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n<\/code><\/pre>\n<\/div>\n<p>In the above snippet, you should understand the following:<\/p>\n<ul>\n<li>The stuff inside <code>{{ }}<\/code> \u2014 they are Vue\u2019s way of inserting dynamic data in the HTML template, before it renders in the browser. You have encountered them before, and there is nothing new or surprising. Just keep in mind that these data objects stems from the <code>data()<\/code> method in the <code>export default()<\/code> object of <code>App.vue<\/code>. They have default values that we will set according to our requirements, and then write certain methods to populate the objects with real API data.<\/li>\n<\/ul>\n<p>Don\u2019t worry for not seeing the changes on the browser \u2014 the data is not defined yet, and it\u2019s natural for Vue to not render things that it does not know. However, <strong>once the data is set<\/strong> (and for now, you can even check by hard-coding the data), the text data will be controlled by <code>App.vue<\/code>.<\/p>\n<h4>The <code>data()<\/code> Method<\/h4>\n<p>The <code>data()<\/code> method is a special construct in the <code>.vue<\/code> files \u2014 it contains and returns data objects that are so crucial for the application. Recollect the generic structure of the <code><script><\/code> part in any <code>.vue<\/code> file \u2014 it roughly contains the following:<\/p>\n<div>\n<pre><code><script>\n\/\/ import statements here\n\nexport default {\n    \/\/ name, components, props, etc.\n\n    data() {\n        return {\n            \/\/ the data that is so crucial for the application is defined here.\n            \/\/ the data objects will have certain default values chosen by us.\n            \/\/ The methods that we define below will manipulate the data.\n            \/\/ Since the data is bounded to various attributes and directives, they\n            \/\/ will update as and when the values of the data objects change.\n        }\n    },\n\n    methods: {\n        \/\/ methods (objects whose values are functions) here.\n        \/\/ bulk of dynamic stuff (the black magic part) is controlled from here.\n    },\n\n    computed: {\n        \/\/ computed properties here\n    },\n\n    \/\/ other objects, as necessary\n\n}\n<\/script>\n<\/code><\/pre>\n<\/div>\n<p>So far, you have encountered the names of some of the data objects, but are a lot more. Most of them are relevant for the child components, each of which handles a different aspect of the weather information dump. Given below is the entire <code>data()<\/code> method that we will need for this project \u2014 you will have a fair idea about what data we are expecting from the APIs, and how we are disseminating the data, based on the nomenclature of the objects.<\/p>\n<div>\n<pre><code>data() {\n   return {\n     weatherDetails: false,\n     location: '', \/\/ raw location from input\n     lat: '', \/\/ raw latitude from google maps api response\n     long: '', \/\/ raw longitude from google maps api response\n     completeWeatherApi: '', \/\/ weather api string with lat and long\n     rawWeatherData: '', \/\/ raw response from weather api\n     currentWeather: {\n       full_location: '', \/\/ for full address\n       formatted_lat: '', \/\/ for N\/S\n       formatted_long: '', \/\/ for E\/W\n       time: '',\n       temp: '',\n       todayHighLow: {\n         todayTempHigh: '',\n         todayTempHighTime: '',\n         todayTempLow: '',\n         todayTempLowTime: ''\n       },\n       summary: '',\n       possibility: ''\n     },\n     tempVar: {\n       tempToday: [\n         \/\/ gets added dynamically by this.getSetHourlyTempInfoToday()\n       ],\n     },\n     highlights: {\n       uvIndex: '',\n       visibility: '',\n       windStatus: {\n         windSpeed: '',\n         windDirection: '',\n         derivedWindDirection: ''\n       },\n     }\n   };\n },\n<\/code><\/pre>\n<\/div>\n<p>As you can see, in most cases the default value is empty, because that will suffice at this point. Methods will be written for manipulating the data and filling it up with appropriate values, before it is rendered or passed on to the child components.<\/p>\n<h5>Methods in App.vue<\/h5>\n<p>For <code>.vue<\/code> files, the methods are generally written as values of keys nested in the <code>methods { }<\/code> object. Their primary role is to manipulate the data objects of the component. We will write the methods in <code>App.vue<\/code> keeping the same philosophy in mind. However, based on their purpose, we can categorize the methods of <code>App.vue<\/code> into the following:<\/p>\n<ul>\n<li>Utility methods<\/li>\n<li>Action\/Event oriented methods<\/li>\n<li>Data acquisition methods<\/li>\n<li>Data processing methods<\/li>\n<li>High level glue methods<\/li>\n<\/ul>\n<p>It\u2019s important that you understand this \u2014 we are presenting the methods to you on a platter because we have already figured out how the APIs work, what data they give, and how we should use the data in our project. It\u2019s not that we pulled the methods out of thin air, and wrote some arcane code to deal with the data. For the purpose of learning, it\u2019s a good exercise to diligently read and understand the code for the methods and data. However, when faced with a new project that you have to build from scratch, you must do all the dirty work yourself, and that means experimenting a lot with the APIs \u2014 their programmatic access and their data structure, before glueing them seamlessly with the data structure that your project demands. You will not have any hand holding, and there will be frustrating moments, but that\u2019s all part of maturing as a developer.<\/p>\n<p>In the following subsections, we will explain each of the method types, and also show the implementation of the methods belonging to that category. The method names are quite self-explanatory about their purpose, and so is their implementation, which we believe you will find to be easy enough to follow. However, before that, recollect the general scheme of writing methods in <code>.vue<\/code> files:<\/p>\n<div>\n<pre><code><script>\n\/\/ import statements here\n\nexport default {\n    \/\/ name, components, props, etc.\n\n    data() {\n        return {\n            \/\/ the data that is so crucial for the application is defined here.\n        }\n    },\n\n    methods: {\n        \/\/ methods (objects whose values are functions) here.\n        \/\/ bulk of dynamic stuff (the black magic part) is controlled from here.\n        method_1: function(arg_1) {\n        \n        },\n        method_2: function(arg_1, arg_2) {\n        \n        },\n        method_3: function(arg_1) {\n        \n        },\n        \u2026\u2026.\n    },\n\n    computed: {\n        \/\/ computed properties here\n    },\n\n    \/\/ other objects, as necessary\n\n}\n<\/script>\n<\/code><\/pre>\n<\/div>\n<h4>Utility Methods<\/h4>\n<p>The utility methods, as the name suggests, are methods written primarily for the purpose of modularizing repetitive code used for fringe tasks. They are called by other methods when necessary. Given below are the utility methods for <code>App.vue<\/code>:<\/p>\n<div>\n<pre><code>convertToTitleCase: function(str) {\n     str = str.toLowerCase().split(' ');\n     for (var i = 0; i <\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/\/ To format the \u201cpossibility\u201d (of weather) string obtained from the weather API\nformatPossibility: function(str) {\n     str = str.toLowerCase().split('-');\n     for (var i = 0; i <\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/\/ To convert Unix timestamps according to our convenience\nunixToHuman: function(timezone, timestamp) {\n     \/* READ THIS BEFORE JUDGING & DEBUGGING\n     For any location beyond the arctic circle and the\n     antarctic circle, the goddamn weather api does not return certain\n     keys\/values in each of this.rawWeatherData.daily.data[some_array_index].\n     Due to this, console throws up an error.\n     The code is correct, the problem is with the API.\n     May be later on I will add some padding to tackle missing values.\n     *\/\n     var moment = require('moment-timezone'); \/\/ for handling date & time\n     var decipher = new Date(timestamp * 1000);\n     var human = moment(decipher)\n       .tz(timezone)\n       .format('llll');\n     var timeArray = human.split(' ');\n     var timeNumeral = timeArray[4];\n     var timeSuffix = timeArray[5];\n     var justTime = timeNumeral + ' ' + timeSuffix;\n     var monthDateArray = human.split(',');\n     var monthDate = monthDateArray[1].trim();\n     return {\n       fullTime: human,\n       onlyTime: justTime,\n       onlyMonthDate: monthDate\n     };\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/\/ To convert temperature from fahrenheit to celcius\nfahToCel: function(tempInFahrenheit) {\n     var tempInCelcius = Math.round((5 \/ 9) * (tempInFahrenheit \u2014 32));\n     return tempInCelcius;\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/\/ To convert the air pressure reading from millibar to kilopascal\nmilibarToKiloPascal: function(pressureInMilibar) {\n     var pressureInKPA = pressureInMilibar * 0.1;\n     return Math.round(pressureInKPA);\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/\/ To convert distance readings from miles to kilometers\nmileToKilometer: function(miles) {\n     var kilometer = miles * 1.60934;\n     return Math.round(kilometer);\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/\/ To format the wind direction based on the angle\nderiveWindDir: function(windDir) {\n     var wind_directions_array = [\n       { minVal: 0, maxVal: 30, direction: 'N' },\n       { minVal: 31, maxVal: 45, direction: 'NNE' },\n       { minVal: 46, maxVal: 75, direction: 'NE' },\n       { minVal: 76, maxVal: 90, direction: 'ENE' },\n       { minVal: 91, maxVal: 120, direction: 'E' },\n       { minVal: 121, maxVal: 135, direction: 'ESE' },\n       { minVal: 136, maxVal: 165, direction: 'SE' },\n       { minVal: 166, maxVal: 180, direction: 'SSE' },\n       { minVal: 181, maxVal: 210, direction: 'S' },\n       { minVal: 211, maxVal: 225, direction: 'SSW' },\n       { minVal: 226, maxVal: 255, direction: 'SW' },\n       { minVal: 256, maxVal: 270, direction: 'WSW' },\n       { minVal: 271, maxVal: 300, direction: 'W' },\n       { minVal: 301, maxVal: 315, direction: 'WNW' },\n       { minVal: 316, maxVal: 345, direction: 'NW' },\n       { minVal: 346, maxVal: 360, direction: 'NNW' }\n     ];\n     var wind_direction = '';\n     for (var i = 0; i = wind_directions_array[i].minVal &&\n         windDir <\/code><\/pre>\n<\/div>\n<p>Although we haven\u2019t implemented it, you can take out the utility methods from the <code>.vue<\/code> file, and put it in a separate JavaScript file. All you need to do is import the <code>.js<\/code> file at the start of the script part in the <code>.vue<\/code> file, and you should be good to go. Such approach works really well and keeps the code clean, especially in big applications where you might use lots of methods that are better grouped together based on their purpose. You can apply this approach to all of the method groups listed in this article, and see the effect itself. However, we suggest you do that exercise once you have followed the course presented here, so that you have the big picture understanding of all the parts working in complete sync, and also have a working piece of software which you can refer to, once something breaks while experimenting.<\/p>\n<h4>Action\/Event Oriented Methods<\/h4>\n<p>These methods are generally executed when we need to take an action corresponding to an event. Depending on the case, the event might be triggered from an user interaction, or programmatically. In the <code>App.vue<\/code> file, these methods sit below the utility methods.<\/p>\n<pre><code>makeInputEmpty: function() {\n     this.$refs.input.value = '';\n   },\n<\/code><\/pre>\n<pre><code>makeTempVarTodayEmpty: function() {\n     this.tempVar.tempToday = [];\n   },\n<\/code><\/pre>\n<pre><code>detectEnterKeyPress: function() {\n     var input = this.$refs.input;\n     input.addEventListener('keyup', function(event) {\n       event.preventDefault();\n       var enterKeyCode = 13;\n       if (event.keyCode === enterKeyCode) {\n         this.setHitEnterKeyTrue();\n       }\n     });\n   },\n<\/code><\/pre>\n<div>\n<pre><code>locationEntered: function() {\n     var input = this.$refs.input;\n     if (input.value === '') {\n       this.location = \"New York\";\n     } else {\n       this.location = this.convertToTitleCase(input.value);\n     }\n     this.makeInputEmpty();\n     this.makeTempVarTodayEmpty();\n   },\n<\/code><\/pre>\n<\/div>\n<p>One interesting thing in some of the above code snippets is the use of <code>$ref<\/code>. In simple terms, it\u2019s Vue\u2019s way of associating the code statement containing it, to the HTML construct it is supposed to affect (for more information, read the <a href=\"https:\/\/vuejs.org\/v2\/api\/#vm-refs\">official guide<\/a>). For example, the methods <code>makeInputEmpty()<\/code> and <code>detectEnterKeyPress()<\/code> affects the input box, because in the HTML of the input box we have mentioned the value of the attribute <code>ref<\/code> as <code>input<\/code>.<\/p>\n<h4>Data Acquisition Methods<\/h4>\n<p>We are using the following two APIs in our project:<\/p>\n<ul>\n<li><a href=\"https:\/\/developers.google.com\/maps\/documentation\/geocoding\/intro\">Google Maps Geocoder API<\/a><br \/>\nThis API is for getting the coordinates of the location that the user searches. You will need an API key for yourself, which you can get by following the documentation in the given link. For now, you can use the API key used by FusionCharts, but we request you not to abuse it and get a key of your own. We refer to the JavaScript API from the index.html of this project, and we shall use the constructors provided by it for our code in the <code>App.vue<\/code> file.<\/li>\n<li><a href=\"https:\/\/darksky.net\/dev\">The Dark Sky Weather API<\/a><br \/>\nThis API is for getting the weather data corresponding to the coordinates. However, we won\u2019t be using it directly; we will wrap it within an URL that redirects through one of the FusionCharts\u2019s server. The reason is that if you send a GET request to the API from an entirely client-end application such as ours, it results in the frustrating <code>CORS<\/code> error (more information <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/CORS\">here<\/a> and <a href=\"https:\/\/www.w3.org\/TR\/html5\/infrastructure.html#cors-settings-attribute\">here<\/a>).<\/li>\n<\/ul>\n<p><strong>Important Note<\/strong>: <em>Since we have used Google Maps and Dark Sky APIs, Both these APIs have their own API keys which we have shared with you in this article. This will help you focus on client-side developments rather than the headache of backend implementation. However, <strong>we recommend you to create your own keys<\/strong>, because our APIs keys will come with limits and if these limits exceed you won't be able to try the application by yourself.<\/em><\/p>\n<p>For Google Maps, <a href=\"https:\/\/developers.google.com\/maps\/documentation\/javascript\/get-api-key\">go to this article<\/a> to get your API key. For Dark Sky API, visit <a href=\"https:\/\/darksky.net\/dev\">https:\/\/darksky.net\/dev<\/a> to create your API key and respective endpoints.<\/p>\n<p>With the context in mind, let\u2019s see the implementation of the data acquisition methods for our project.<\/p>\n<div>\n<pre><code>getCoordinates: function() {\n     this.locationEntered();\n     var loc = this.location;\n     var coords;\n     var geocoder = new google.maps.Geocoder();\n     return new Promise(function(resolve, reject) {\n       geocoder.geocode({ address: loc }, function(results, status) {\n         if (status == google.maps.GeocoderStatus.OK) {\n           this.lat = results[0].geometry.location.lat();\n           this.long = results[0].geometry.location.lng();\n           this.full_location = results[0].formatted_address;\n           coords = {\n             lat: this.lat,\n             long: this.long,\n             full_location: this.full_location\n           };\n           resolve(coords);\n         } else {\n           alert(\"Oops! Couldn't get data for the location\");\n         }\n       });\n     });\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/*\nThe coordinates that Google Maps Geocoder API returns are way too accurate\nfor our requirements. We need to bring it into shape before passing the coordinates on \nto the weather API. Although this is a data processing method in its own right, we can\u2019t \nhelp mentioning it right now, because the data acquisition method for the weather API has dependency on the output of this method. \n*\/\nsetFormatCoordinates: async function() {\n     var coordinates = await this.getCoordinates();\n     this.lat = coordinates.lat;\n     this.long = coordinates.long;\n     this.currentWeather.full_location = coordinates.full_location;\n     \/\/ Remember to beautify lat for N\/S\n     if (coordinates.lat > 0) {\n       this.currentWeather.formatted_lat =\n         (Math.round(coordinates.lat * 10000) \/ 10000).toString() + '\u00b0N';\n     } else if (coordinates.lat  0) {\n       this.currentWeather.formatted_long =\n         (Math.round(coordinates.long * 10000) \/ 10000).toString() + '\u00b0E';\n     } else if (coordinates.long <\/code><\/pre>\n<\/div>\n<div>\n<pre><code>\/*\nThis method dynamically creates the the correct weather API query URL, based on the \nformatted latitude and longitude. The complete URL is then fed to the method querying for \nweather data.\nNotice that the base URL used in this method (without the coordinates) points towards a \nFusionCharts server \u2014 we must redirect our GET request to the weather API through a server to avoid the CORS error.\n*\/\nfixWeatherApi: async function() {\n     await this.setFormatCoordinates();\n     var weatherApi =\n       'https:\/\/csm.fusioncharts.com\/files\/assets\/wb\/wb-data.php?src=darksky&lat=' +\n       this.lat +\n       '&long=' +\n       this.long;\n     this.completeWeatherApi = weatherApi;\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>fetchWeatherData: async function() {\n     await this.fixWeatherApi();\n     var axios = require('axios'); \/\/ for handling weather api promise\n     var weatherApiResponse = await axios.get(this.completeWeatherApi);\n     if (weatherApiResponse.status === 200) {\n       this.rawWeatherData = weatherApiResponse.data;\n     } else {\n       alert('Hmm... Seems like our weather experts are busy!');\n     }\n   },\n<\/code><\/pre>\n<\/div>\n<p>Through these methods, we have introduced the concept of <strong>async-await<\/strong> in our code. If you have been a JavaScript developer for some time now, you must be familiar with the <a href=\"http:\/\/callbackhell.com\/\">callback hell<\/a>, which is a direct consequence of the asynchronous way JavaScript is written. ES6 allows us to bypass the cumbersome nested callbacks, and our code becomes much cleaner if we write JavaScript in a synchronous way, using the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/async_function\">async-await<\/a> technique. However, there is a downside. It takes away the speed that asynchronous code gives us, especially for the portions of the code that deals with data being exchanged over the internet. Since this is not a mission-critical application with low latency requirements, and our primary aim is to learn stuff, the clean code is much more preferable over the slightly fast code.<\/p>\n<h4>Data Processing Methods<\/h4>\n<p>Now that we have the methods that will bring the data to us, we need to prepare the ground for properly receiving and processing the data. Safety nets must be cast, and there should be no spills \u2014 data is the new gold (OK, that might be an exaggeration in our context)! Enough with the fuss, let\u2019s get to the point.<\/p>\n<p>Technically, the methods we implement in this section are aimed at getting the data out of the acquisition methods and the data objects in <code>App.vue<\/code>, and sometimes setting the data objects to certain values that suits the purpose.<\/p>\n<pre><code>getTimezone: function() {\n     return this.rawWeatherData.timezone;\n   },\n<\/code><\/pre>\n<pre><code>getSetCurrentTime: function() {\n     var currentTime = this.rawWeatherData.currently.time;\n     var timezone = this.getTimezone();\n     this.currentWeather.time = this.unixToHuman(\n       timezone,\n       currentTime\n     ).fullTime;\n   },\n<\/code><\/pre>\n<div>\n<pre><code>getSetSummary: function() {\n     var currentSummary = this.convertToTitleCase(\n       this.rawWeatherData.currently.summary\n     );\n     if (currentSummary.includes(' And')) {\n       currentSummary = currentSummary.replace(' And', ',');\n     }\n     this.currentWeather.summary = currentSummary;\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>getSetPossibility: function() {\n     var possible = this.formatPossibility(this.rawWeatherData.daily.icon);\n     if (possible.includes(' And')) {\n       possible = possible.replace(' And', ',');\n     }\n     this.currentWeather.possibility = possible;\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>getSetCurrentTemp: function() {\n     var currentTemp = this.rawWeatherData.currently.temperature;\n     this.currentWeather.temp = this.fahToCel(currentTemp);\n   },\n<\/code><\/pre>\n<\/div>\n<pre><code>getTodayDetails: function() {\n     return this.rawWeatherData.daily.data[0];\n   },\n<\/code><\/pre>\n<div>\n<pre><code>getSetTodayTempHighLowWithTime: function() {\n     var timezone = this.getTimezone();\n     var todayDetails = this.getTodayDetails();\n     this.currentWeather.todayHighLow.todayTempHigh = this.fahToCel(\n       todayDetails.temperatureMax\n     );\n     this.currentWeather.todayHighLow.todayTempHighTime = this.unixToHuman(\n       timezone,\n       todayDetails.temperatureMaxTime\n     ).onlyTime;\n     this.currentWeather.todayHighLow.todayTempLow = this.fahToCel(\n       todayDetails.temperatureMin\n     );\n     this.currentWeather.todayHighLow.todayTempLowTime = this.unixToHuman(\n       timezone,\n       todayDetails.temperatureMinTime\n     ).onlyTime;\n   },\n<\/code><\/pre>\n<\/div>\n<pre><code>getHourlyInfoToday: function() {\n     return this.rawWeatherData.hourly.data;\n   },\n<\/code><\/pre>\n<div>\n<pre><code>getSetHourlyTempInfoToday: function() {\n     var unixTime = this.rawWeatherData.currently.time;\n     var timezone = this.getTimezone();\n     var todayMonthDate = this.unixToHuman(timezone, unixTime).onlyMonthDate;\n     var hourlyData = this.getHourlyInfoToday();\n     for (var i = 0; i <\/code><\/pre>\n<\/div>\n<pre><code>getSetUVIndex: function() {\n     var uvIndex = this.rawWeatherData.currently.uvIndex;\n     this.highlights.uvIndex = uvIndex;\n   },\n<\/code><\/pre>\n<div>\n<pre><code>getSetVisibility: function() {\n     var visibilityInMiles = this.rawWeatherData.currently.visibility;\n     this.highlights.visibility = this.mileToKilometer(visibilityInMiles);\n   },\n<\/code><\/pre>\n<\/div>\n<div>\n<pre><code>getSetWindStatus: function() {\n     var windSpeedInMiles = this.rawWeatherData.currently.windSpeed;\n     this.highlights.windStatus.windSpeed = this.mileToKilometer(\n       windSpeedInMiles\n     );\n     var absoluteWindDir = this.rawWeatherData.currently.windBearing;\n     this.highlights.windStatus.windDirection = absoluteWindDir;\n     this.highlights.windStatus.derivedWindDirection = this.deriveWindDir(\n       absoluteWindDir\n     );\n   },\n<\/code><\/pre>\n<\/div>\n<h4>High Level Glue Methods<\/h4>\n<p>With the utility, acquisition, and processing methods out of our way, we are now left with the task of orchestrating the entire thing. We do that by creating high level glue methods, that essentially calls the methods written above in a particular sequence, so that the entire operation is executed seamlessly.<\/p>\n<pre><code>\/\/ Top level for info section\n\/\/ Data in this.currentWeather\norganizeCurrentWeatherInfo: function() {\n     \/\/ data in this.currentWeather\n     \/*\n     Coordinates and location is covered (get & set) in:\n     \u2014 this.getCoordinates()\n     \u2014 this.setFormatCoordinates()\n     There are lots of async-await involved there.\n     So it's better to keep them there.\n     *\/\n     this.getSetCurrentTime();\n     this.getSetCurrentTemp();\n     this.getSetTodayTempHighLowWithTime();\n     this.getSetSummary();\n     this.getSetPossibility();\n   },\n<\/code><\/pre>\n<pre><code>\/\/ Top level for highlights\norganizeTodayHighlights: function() {\n     \/\/ top level for highlights\n     this.getSetUVIndex();\n     this.getSetVisibility();\n     this.getSetWindStatus();\n   },\n<\/code><\/pre>\n<pre><code>\/\/ Top level organization and rendering\norganizeAllDetails: async function() {\n     \/\/ top level organization\n     await this.fetchWeatherData();\n     this.organizeCurrentWeatherInfo();\n     this.organizeTodayHighlights();\n     this.getSetHourlyTempInfoToday();\n   },\n<\/code><\/pre>\n<h5>mounted<\/h5>\n<p>Vue provides instance <a href=\"https:\/\/vuejs.org\/v2\/guide\/instance.html#Instance-Lifecycle-Hooks\">lifecycle hooks<\/a> \u2014 properties that are essentially methods, and gets triggered when the instance lifecycle reaches that stage. For example, <a href=\"https:\/\/vuejs.org\/v2\/api\/#created\">created<\/a>, <a href=\"https:\/\/vuejs.org\/v2\/api\/#mounted\">mounted<\/a>, <a href=\"https:\/\/vuejs.org\/v2\/api\/#beforeUpdate\">beforeUpdate<\/a>, etc., are all very useful lifecycle hooks that allows the programmer to control the instance at a much more granular level than that would have been possible otherwise.<\/p>\n<p>In the code of a Vue component, these lifecycle hooks are implemented just like you would for any other <code>prop<\/code>. For example:<\/p>\n<pre><code><template>\n<\/template>\n\n<script>\n\/\/ import statements\nexport default {\n  data() {\n    return {\n    \/\/ data objects here\n    }\n  },\n  methods: {\n  \/\/ methods here\n  },\n  mounted: function(){\n  \/\/ function body here\n  },\n}\n<\/script>\n\n<style>\n<\/style>\n<\/code><\/pre>\n<p>Armed with this new understanding, take a look at the code below for the <code>mounted<\/code> prop of <code>App.vue<\/code>:<\/p>\n<pre><code>mounted: async function() {\n   this.location = \"New York\";\n   await this.organizeAllDetails();    \n }\n<\/code><\/pre>\n<h4>Complete Code For App.vue<\/h4>\n<p>We have covered a lot of ground in this section, and the last few sections have given you things in bits and pieces. However, it\u2019s important that you have the complete, assembled code for <code>App.vue<\/code> (subject to further modifications in subsequent sections). Here it goes:<\/p>\n<div>\n<pre><code><template>\n <div id=\"ancestor\">\n   <div class=\"container-fluid\" id=\"app\">\n     <div class=\"row\">\n       <div id=\"sidebar\" class=\"col-md-3 col-sm-4 col-xs-12 sidebar\">\n         <div id=\"search\">\n           <input\n             id=\"location-input\"\n             type=\"text\"\n             ref=\"input\"\n             placeholder=\"Location?\"\n             @keyup.enter=\"organizeAllDetails\"\n           >\n           <button id=\"search-btn\" @click=\"organizeAllDetails\">\n             <img loading=\"lazy\" decoding=\"async\" src=\".\/assets\/Search.svg\" width=\"24\" height=\"24\">\n           <\/button>\n         <\/div>\n         <div id=\"info\">\n           <div class=\"wrapper-left\">\n             <div id=\"current-weather\">\n               {{ currentWeather.temp }}\n               <span>\u00b0C<\/span>\n             <\/div>\n             <div id=\"weather-desc\">{{ currentWeather.summary }}<\/div>\n             <div class=\"temp-max-min\">\n               <div class=\"max-desc\">\n                 <div id=\"max-detail\">\n                   <i>?<\/i>\n                   {{ currentWeather.todayHighLow.todayTempHigh }}\n                   <span>\u00b0C<\/span>\n                 <\/div>\n                 <div id=\"max-summary\">at {{ currentWeather.todayHighLow.todayTempHighTime }}<\/div>\n               <\/div>\n               <div class=\"min-desc\">\n                 <div id=\"min-detail\">\n                   <i>?<\/i>\n                   {{ currentWeather.todayHighLow.todayTempLow }}\n                   <span>\u00b0C<\/span>\n                 <\/div>\n                 <div id=\"min-summary\">at {{ currentWeather.todayHighLow.todayTempLowTime }}<\/div>\n               <\/div>\n             <\/div>\n           <\/div>\n           <div class=\"wrapper-right\">\n             <div class=\"date-time-info\">\n               <div id=\"date-desc\">\n                 <img loading=\"lazy\" decoding=\"async\" src=\".\/assets\/calendar.svg\" width=\"20\" height=\"20\">\n                 {{ currentWeather.time }}\n               <\/div>\n             <\/div>\n             <div class=\"location-info\">\n               <div id=\"location-desc\">\n                 <img decoding=\"async\"\n                   src=\".\/assets\/location.svg\"\n                   width=\"10.83\"\n                   height=\"15.83\"\n                   style=\"opacity: 0.9;\"\n                 >\n                 {{ currentWeather.full_location }}\n                 <div id=\"location-detail\" class=\"mt-1\">\n                   Lat: {{ currentWeather.formatted_lat }}\n                   <br>\n                   Long: {{ currentWeather.formatted_long }}\n                 <\/div>\n               <\/div>\n             <\/div>\n           <\/div>\n         <\/div>\n       <\/div>\n       <dashboard-content\n         class=\"col-md-9 col-sm-8 col-xs-12 content\"\n         id=\"dashboard-content\"\n         :highlights=\"highlights\"\n         :tempVar=\"tempVar\"\n       ><\/dashboard-content>\n     <\/div>\n   <\/div>\n <\/div>\n<\/template>\n\n<script>\nimport Content from '.\/components\/Content.vue';\n\nexport default {\n name: 'app',\n props: [],\n components: {\n   'dashboard-content': Content\n },\n data() {\n   return {\n     weatherDetails: false,\n     location: '', \/\/ raw location from input\n     lat: '', \/\/ raw latitude from google maps api response\n     long: '', \/\/ raw longitude from google maps api response\n     completeWeatherApi: '', \/\/ weather api string with lat and long\n     rawWeatherData: '', \/\/ raw response from weather api\n     currentWeather: {\n       full_location: '', \/\/ for full address\n       formatted_lat: '', \/\/ for N\/S\n       formatted_long: '', \/\/ for E\/W\n       time: '',\n       temp: '',\n       todayHighLow: {\n         todayTempHigh: '',\n         todayTempHighTime: '',\n         todayTempLow: '',\n         todayTempLowTime: ''\n       },\n       summary: '',\n       possibility: ''\n     },\n     tempVar: {\n       tempToday: [\n         \/\/ gets added dynamically by this.getSetHourlyTempInfoToday()\n       ],\n     },\n     highlights: {\n       uvIndex: '',\n       visibility: '',\n       windStatus: {\n         windSpeed: '',\n         windDirection: '',\n         derivedWindDirection: ''\n       },\n     }\n   };\n },\n methods: {\n   \/\/ Some utility functions\n   convertToTitleCase: function(str) {\n     str = str.toLowerCase().split(' ');\n     for (var i = 0; i < str.length; i++) {\n       str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n     }\n     return str.join(' ');\n   },\n   formatPossibility: function(str) {\n     str = str.toLowerCase().split('-');\n     for (var i = 0; i < str.length; i++) {\n       str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n     }\n     return str.join(' ');\n   },\n   unixToHuman: function(timezone, timestamp) {\n     \/* READ THIS BEFORE JUDGING &#038; DEBUGGING\n     For any location beyond the arctic circle and the\n     antarctic circle, the goddamn weather api does not return certain\n     keys\/values in each of this.rawWeatherData.daily.data[some_array_index].\n     Due to this, console throws up an error.\n     The code is correct, the problem is with the API.\n     May be later on I will add some padding to tackle missing values.\n     *\/\n     var moment = require('moment-timezone'); \/\/ for handling date &#038; time\n     var decipher = new Date(timestamp * 1000);\n     var human = moment(decipher)\n       .tz(timezone)\n       .format('llll');\n     var timeArray = human.split(' ');\n     var timeNumeral = timeArray[4];\n     var timeSuffix = timeArray[5];\n     var justTime = timeNumeral + ' ' + timeSuffix;\n     var monthDateArray = human.split(',');\n     var monthDate = monthDateArray[1].trim();\n     return {\n       fullTime: human,\n       onlyTime: justTime,\n       onlyMonthDate: monthDate\n     };\n   },\n   fahToCel: function(tempInFahrenheit) {\n     var tempInCelcius = Math.round((5 \/ 9) * (tempInFahrenheit \u2014 32));\n     return tempInCelcius;\n   },\n   milibarToKiloPascal: function(pressureInMilibar) {\n     var pressureInKPA = pressureInMilibar * 0.1;\n     return Math.round(pressureInKPA);\n   },\n   mileToKilometer: function(miles) {\n     var kilometer = miles * 1.60934;\n     return Math.round(kilometer);\n   },\n   deriveWindDir: function(windDir) {\n     var wind_directions_array = [\n       { minVal: 0, maxVal: 30, direction: 'N' },\n       { minVal: 31, maxVal: 45, direction: 'NNE' },\n       { minVal: 46, maxVal: 75, direction: 'NE' },\n       { minVal: 76, maxVal: 90, direction: 'ENE' },\n       { minVal: 91, maxVal: 120, direction: 'E' },\n       { minVal: 121, maxVal: 135, direction: 'ESE' },\n       { minVal: 136, maxVal: 165, direction: 'SE' },\n       { minVal: 166, maxVal: 180, direction: 'SSE' },\n       { minVal: 181, maxVal: 210, direction: 'S' },\n       { minVal: 211, maxVal: 225, direction: 'SSW' },\n       { minVal: 226, maxVal: 255, direction: 'SW' },\n       { minVal: 256, maxVal: 270, direction: 'WSW' },\n       { minVal: 271, maxVal: 300, direction: 'W' },\n       { minVal: 301, maxVal: 315, direction: 'WNW' },\n       { minVal: 316, maxVal: 345, direction: 'NW' },\n       { minVal: 346, maxVal: 360, direction: 'NNW' }\n     ];\n     var wind_direction = '';\n     for (var i = 0; i < wind_directions_array.length; i++) {\n       if (\n         windDir >= wind_directions_array[i].minVal &&\n         windDir <= wind_directions_array[i].maxVal\n       ) {\n         wind_direction = wind_directions_array[i].direction;\n       }\n     }\n     return wind_direction;\n   },\n\n   \/\/ Some basic action oriented functions\n   makeInputEmpty: function() {\n     this.$refs.input.value = '';\n   },\n   makeTempVarTodayEmpty: function() {\n     this.tempVar.tempToday = [];\n   },\n   detectEnterKeyPress: function() {\n     var input = this.$refs.input;\n     input.addEventListener('keyup', function(event) {\n       event.preventDefault();\n       var enterKeyCode = 13;\n       if (event.keyCode === enterKeyCode) {\n         this.setHitEnterKeyTrue();\n       }\n     });\n   },\n   locationEntered: function() {\n     var input = this.$refs.input;\n     if (input.value === '') {\n       this.location = \"New York\";\n     } else {\n       this.location = this.convertToTitleCase(input.value);\n     }\n     this.makeInputEmpty();\n     this.makeTempVarTodayEmpty();\n   },\n  \n   getCoordinates: function() {\n     this.locationEntered();\n     var loc = this.location;\n     var coords;\n     var geocoder = new google.maps.Geocoder();\n     return new Promise(function(resolve, reject) {\n       geocoder.geocode({ address: loc }, function(results, status) {\n         if (status == google.maps.GeocoderStatus.OK) {\n           this.lat = results[0].geometry.location.lat();\n           this.long = results[0].geometry.location.lng();\n           this.full_location = results[0].formatted_address;\n           coords = {\n             lat: this.lat,\n             long: this.long,\n             full_location: this.full_location\n           };\n           resolve(coords);\n         } else {\n           alert(\"Oops! Couldn't get data for the location\");\n         }\n       });\n     });\n   },\n\n   \/\/ Some basic asynchronous functions\n   setFormatCoordinates: async function() {\n     var coordinates = await this.getCoordinates();\n     this.lat = coordinates.lat;\n     this.long = coordinates.long;\n     this.currentWeather.full_location = coordinates.full_location;\n     \/\/ Remember to beautify lat for N\/S\n     if (coordinates.lat > 0) {\n       this.currentWeather.formatted_lat =\n         (Math.round(coordinates.lat * 10000) \/ 10000).toString() + '\u00b0N';\n     } else if (coordinates.lat < 0) {\n       this.currentWeather.formatted_lat =\n         (-1 * (Math.round(coordinates.lat * 10000) \/ 10000)).toString() +\n         '\u00b0S';\n     } else {\n       this.currentWeather.formatted_lat = (\n         Math.round(coordinates.lat * 10000) \/ 10000\n       ).toString();\n     }\n     \/\/ Remember to beautify long for N\/S\n     if (coordinates.long > 0) {\n       this.currentWeather.formatted_long =\n         (Math.round(coordinates.long * 10000) \/ 10000).toString() + '\u00b0E';\n     } else if (coordinates.long < 0) {\n       this.currentWeather.formatted_long =\n         (-1 * (Math.round(coordinates.long * 10000) \/ 10000)).toString() +\n         '\u00b0W';\n     } else {\n       this.currentWeather.formatted_long = (\n         Math.round(coordinates.long * 10000) \/ 10000\n       ).toString();\n     }\n   },\n   fixWeatherApi: async function() {\n     await this.setFormatCoordinates();\n     var weatherApi =\n       'https:\/\/csm.fusioncharts.com\/files\/assets\/wb\/wb-data.php?src=darksky&#038;lat=' +\n       this.lat +\n       '&#038;long=' +\n       this.long;\n     this.completeWeatherApi = weatherApi;\n   },\n   fetchWeatherData: async function() {\n     await this.fixWeatherApi();\n     var axios = require('axios'); \/\/ for handling weather api promise\n     var weatherApiResponse = await axios.get(this.completeWeatherApi);\n     if (weatherApiResponse.status === 200) {\n       this.rawWeatherData = weatherApiResponse.data;\n     } else {\n       alert('Hmm... Seems like our weather experts are busy!');\n     }\n   },\n\n   \/\/ Get and set functions; often combined, because they are short\n\n   \/\/ For basic info \u2014 left panel\/sidebar\n   getTimezone: function() {\n     return this.rawWeatherData.timezone;\n   },\n   getSetCurrentTime: function() {\n     var currentTime = this.rawWeatherData.currently.time;\n     var timezone = this.getTimezone();\n     this.currentWeather.time = this.unixToHuman(\n       timezone,\n       currentTime\n     ).fullTime;\n   },\n   getSetSummary: function() {\n     var currentSummary = this.convertToTitleCase(\n       this.rawWeatherData.currently.summary\n     );\n     if (currentSummary.includes(' And')) {\n       currentSummary = currentSummary.replace(' And', ',');\n     }\n     this.currentWeather.summary = currentSummary;\n   },\n   getSetPossibility: function() {\n     var possible = this.formatPossibility(this.rawWeatherData.daily.icon);\n     if (possible.includes(' And')) {\n       possible = possible.replace(' And', ',');\n     }\n     this.currentWeather.possibility = possible;\n   },\n   getSetCurrentTemp: function() {\n     var currentTemp = this.rawWeatherData.currently.temperature;\n     this.currentWeather.temp = this.fahToCel(currentTemp);\n   },\n   getTodayDetails: function() {\n     return this.rawWeatherData.daily.data[0];\n   },\n   getSetTodayTempHighLowWithTime: function() {\n     var timezone = this.getTimezone();\n     var todayDetails = this.getTodayDetails();\n     this.currentWeather.todayHighLow.todayTempHigh = this.fahToCel(\n       todayDetails.temperatureMax\n     );\n     this.currentWeather.todayHighLow.todayTempHighTime = this.unixToHuman(\n       timezone,\n       todayDetails.temperatureMaxTime\n     ).onlyTime;\n     this.currentWeather.todayHighLow.todayTempLow = this.fahToCel(\n       todayDetails.temperatureMin\n     );\n     this.currentWeather.todayHighLow.todayTempLowTime = this.unixToHuman(\n       timezone,\n       todayDetails.temperatureMinTime\n     ).onlyTime;\n   },\n   getHourlyInfoToday: function() {\n     return this.rawWeatherData.hourly.data;\n   },\n   getSetHourlyTempInfoToday: function() {\n     var unixTime = this.rawWeatherData.currently.time;\n     var timezone = this.getTimezone();\n     var todayMonthDate = this.unixToHuman(timezone, unixTime).onlyMonthDate;\n     var hourlyData = this.getHourlyInfoToday();\n     for (var i = 0; i < hourlyData.length; i++) {\n       var hourlyTimeAllTypes = this.unixToHuman(timezone, hourlyData[i].time);\n       var hourlyOnlyTime = hourlyTimeAllTypes.onlyTime;\n       var hourlyMonthDate = hourlyTimeAllTypes.onlyMonthDate;\n       if (todayMonthDate === hourlyMonthDate) {\n         var hourlyObject = { hour: '', temp: '' };\n         hourlyObject.hour = hourlyOnlyTime;\n         hourlyObject.temp = this.fahToCel(hourlyData[i].temperature).toString();\n         this.tempVar.tempToday.push(hourlyObject);\n         \/*\n         Since we are using array.push(), we are just adding elements\n         at the end of the array. Thus, the array is not getting emptied\n         first when a new location is entered.\n         to solve this problem, a method this.makeTempVarTodayEmpty()\n         has been created, and called from this.locationEntered().\n         *\/\n       }\n     }\n     \/*\n     To cover the edge case where the local time is between 10 \u2014 12 PM,\n     and therefore there are only two elements in the array\n     this.tempVar.tempToday. We need to add the points for minimum temperature\n     and maximum temperature so that the chart gets generated with atleast four points.\n     *\/\n     if (this.tempVar.tempToday.length <= 2) {\n       var minTempObject = {\n         hour: this.currentWeather.todayHighLow.todayTempHighTime,\n         temp: this.currentWeather.todayHighLow.todayTempHigh\n       };\n       var maxTempObject = {\n         hour: this.currentWeather.todayHighLow.todayTempLowTime,\n         temp: this.currentWeather.todayHighLow.todayTempLow\n       };\n       \/*\n       Typically, lowest temp are at dawn,\n       highest temp is around mid day.\n       Thus we can safely arrange like min, max, temp after 10 PM.\n       *\/\n       \/\/ array.unshift() adds stuff at the beginning of the array.\n       \/\/ the order will be: min, max, 10 PM, 11 PM.\n       this.tempVar.tempToday.unshift(maxTempObject, minTempObject);\n     }\n   },\n\n   \/\/ For Today Highlights\n   getSetUVIndex: function() {\n     var uvIndex = this.rawWeatherData.currently.uvIndex;\n     this.highlights.uvIndex = uvIndex;\n   },\n   getSetVisibility: function() {\n     var visibilityInMiles = this.rawWeatherData.currently.visibility;\n     this.highlights.visibility = this.mileToKilometer(visibilityInMiles);\n   },\n   getSetWindStatus: function() {\n     var windSpeedInMiles = this.rawWeatherData.currently.windSpeed;\n     this.highlights.windStatus.windSpeed = this.mileToKilometer(\n       windSpeedInMiles\n     );\n     var absoluteWindDir = this.rawWeatherData.currently.windBearing;\n     this.highlights.windStatus.windDirection = absoluteWindDir;\n     this.highlights.windStatus.derivedWindDirection = this.deriveWindDir(\n       absoluteWindDir\n     );\n   },\n\n   \/\/ top level for info section\n   organizeCurrentWeatherInfo: function() {\n     \/\/ data in this.currentWeather\n     \/*\n     Coordinates and location is covered (get &#038; set) in:\n     \u2014 this.getCoordinates()\n     \u2014 this.setFormatCoordinates()\n     There are lots of async-await involved there.\n     So it's better to keep them there.\n     *\/\n     this.getSetCurrentTime();\n     this.getSetCurrentTemp();\n     this.getSetTodayTempHighLowWithTime();\n     this.getSetSummary();\n     this.getSetPossibility();\n   },\n   organizeTodayHighlights: function() {\n     \/\/ top level for highlights\n     this.getSetUVIndex();\n     this.getSetVisibility();\n     this.getSetWindStatus();\n   },\n\n   \/\/ topmost level orchestration\n   organizeAllDetails: async function() {\n     \/\/ top level organization\n     await this.fetchWeatherData();\n     this.organizeCurrentWeatherInfo();\n     this.organizeTodayHighlights();\n     this.getSetHourlyTempInfoToday();\n   },\n },\n mounted: async function() {\n   this.location = \"New York\";\n   await this.organizeAllDetails();    \n }\n};\n<\/script>\n<\/code><\/pre>\n<\/div>\n<p>And finally, after so much of patience and hard work, you can see the data flow with its raw power! Visit the application on the browser, refresh the page, search for a location in the application\u2019s search box, and hit <kbd>Enter<\/kbd>!<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/a36c5478-9e55-4fc6-8725-0ab2e6af232b\/interactive-weather-dashboard-image13.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image13.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/a36c5478-9e55-4fc6-8725-0ab2e6af232b\/interactive-weather-dashboard-image13.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/a36c5478-9e55-4fc6-8725-0ab2e6af232b\/interactive-weather-dashboard-image13.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/a36c5478-9e55-4fc6-8725-0ab2e6af232b\/interactive-weather-dashboard-image13.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/a36c5478-9e55-4fc6-8725-0ab2e6af232b\/interactive-weather-dashboard-image13.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image13.png?w=900\" sizes=\"100vw\" alt=\"The application as shown in the browser\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/a36c5478-9e55-4fc6-8725-0ab2e6af232b\/interactive-weather-dashboard-image13.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>Now that we are done with all the heavy lifting, take a break. The subsequent sections focus on using the data to create charts that are beautiful and informative, followed by giving our ugly looking application a much deserved grooming session using CSS.<\/p>\n<h3>5. Data Visualization With FusionCharts<\/h3>\n<h4>Fundamental Considerations For Charts<\/h4>\n<p>For the end user, the essence of a dashboard is essentially this: a collection of the filtered and carefully curated information on a particular topic, conveyed through visual\/graphic instruments for quick ingestion. They don\u2019t care about the subtleties of your data pipeline engineering, or how aesthetic your code is \u2014 all they want is a high-level view in 3 seconds. Therefore, our crude application displaying text data means nothing to them, and it\u2019s high time we implement mechanisms to wrap the data with charts.<\/p>\n<p>However, before we dive deep into the implementation of charts, let\u2019s consider some pertinent questions and the possible answers from our perspective:<\/p>\n<ul>\n<li><strong>What type of charts are appropriate for the type of data we are dealing with?<\/strong><br \/>\nWell, the answer has two aspects \u2014 the context, and the purpose. By context, we mean the type of data, and it\u2019s overall fit in the scheme of bigger things, bounded by the scope and audience of the project. And by purpose, we essentially mean \u201cwhat we want to emphasize on?\u201d. For example, we can represent today\u2019s temperature at different times of the day by using a <a href=\"https:\/\/www.fusioncharts.com\/charts\/column-bar-charts\/\">Column chart<\/a> (vertical columns of equal width, with height proportional to the value the column represents). However, we are rarely interested in the individual values, but rather the overall variation and trend throughout the data. To suit the purpose, it is in our best interest to use a <a href=\"https:\/\/www.fusioncharts.com\/dev\/chart-guide\/standard-charts\/line-area-and-column-charts#line-chart-5\">Line chart<\/a>, and we will do that shortly.<\/li>\n<li><strong>What should be kept in mind before selecting a charting library?<\/strong><br \/>\nSince we are doing a project predominantly using JavaScript based technologies, it\u2019s a no-brainer that any charting library that we choose for our project should be a native of the JavaScript world. With that basic premise in mind, we should consider the following before zeroing down on any particular library:<\/p>\n<ul>\n<li><strong>Support for the frameworks of our choice<\/strong>, which in this case, is Vue.js. A project can be developed in other popular JavaScript frameworks like React, or Angular \u2014 check the support of the charting library for your favorite framework. Also, support for other popular programming languages like Python, Java, C++, .Net (AS and VB), especially when the project involves some serious backend stuff, must be considered.<\/li>\n<li><strong>Availability of charts types and features<\/strong>, since it is almost impossible to know beforehand what will be final shape and purpose of the data in the project (especially if the requirements are regulated by your clients in a professional setting). In this case, you should cast your net wide, and choose a charting library that has the widest collection of charts. More importantly, to differentiate your project from others, the library should have have enough features in the form of configurable chart attributes, so that you can fine-tune and customize most aspects of the charts and the right level of granularity. Also, the default chart configurations should be sensible, and the library documentation has to be top notch, for reasons that\u2019s obvious to professional developers.<\/li>\n<li><strong>Learning curve, support community, and balance<\/strong> must also be taken into consideration, especially when you are new to data visualization. On one end of the spectrum, you have proprietary tools like Tableau and Qlickview that costs a bomb, has smooth learning curve, but also comes with so many limitations in terms of customizability, integration, and deployment. On the other end there is d3.js \u2014 vast, free (open source), and customizable to its core, but you have to pay the price of a very steep learning curve to be able to do anything productive with the library.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><em>What you need is the sweet spot \u2014 the right balance between productivity, coverage, customizability, learning curve, and off course, cost. We nudge you to take a look at <a href=\"https:\/\/www.fusioncharts.com\/?utm_source=smashing_mag&#038;utm_medium=blog&#038;utm_campaign=weather_dashboard_vue\">FusionCharts<\/a> \u2014 the world\u2019s most comprehensive and enterprise-ready JavaScript charting library for the web and mobile, that we will be using in this project for creating charts.<\/em><\/p>\n<h4>Introduction To FusionCharts<\/h4>\n<p>FusionCharts is used worldwide as the go-to JavaScript charting library by millions of developers spread across hundreds of countries around the globe. Technically, it\u2019s as loaded and configurable as it can be, with support for integrating it with almost any popular tech stack used for web based projects. Using FusionCharts commercially requires a license, and you have to pay for the license depending on your use case (please contact sales if you are curious). However, we are using FusionCharts in this projects just to try out a few things, and therefore the non-licensed version (comes with a small watermark in your charts, and a few other restrictions). Using the non-licensed version is perfectly fine when you are trying out the charts and using it in your non-commercial or personal projects. If you have plans to deploy the application commercially, please ensure that you have a license from FusionCharts.<\/p>\n<p>Since this is a project involving Vue.js, we will need two modules that needs to be installed, if not done earlier:<\/p>\n<ul>\n<li>The <code>fusioncharts<\/code> module, because it contains everything you will need for creating the charts<\/li>\n<li>The <code>vue-fusioncharts<\/code> module, which is essentially a wrapper for fusioncharts, so that it can be used in a Vue.js project<\/li>\n<\/ul>\n<p>If you have not installed them earlier (as instructed in the third section), install them by executing the following command from the project\u2019s root directory:<\/p>\n<pre><code>npm install fusioncharts vue-fusioncharts --save\n<\/code><\/pre>\n<p>Next, ensure that the <code>src\/main.js<\/code> file of the project has the following code (also mentioned in section 3):<\/p>\n<div>\n<pre><code>import Vue from 'vue';\nimport App from '.\/App.vue';\nimport FusionCharts from 'fusioncharts';\nimport Charts from 'fusioncharts\/fusioncharts.charts';\nimport Widgets from 'fusioncharts\/fusioncharts.widgets';\nimport PowerCharts from 'fusioncharts\/fusioncharts.powercharts';\nimport FusionTheme from 'fusioncharts\/themes\/fusioncharts.theme.fusion';\nimport VueFusionCharts from 'vue-fusioncharts';\n\nCharts(FusionCharts);\nPowerCharts(FusionCharts);\nWidgets(FusionCharts);\nFusionTheme(FusionCharts);\n\nVue.use(VueFusionCharts, FusionCharts);\n\nnew Vue({\n el: '#app',\n render: h => h(App)\n})\n<\/code><\/pre>\n<\/div>\n<p>Perhaps the most critical line in the above snippet is the following:<\/p>\n<pre><code>Vue.use(VueFusionCharts, FusionCharts)\n<\/code><\/pre>\n<p>It instructs Vue to use the vue-fusioncharts module for making sense of many things in the project that are apparently not explicitly defined by us, but is defined in the module itself. Also, this type of statement implies <strong>global<\/strong> declaration, by which we mean that anywhere Vue encounters anything strange in the code of our project (things that we have not explicitly defined about using FusionCharts), it will at least look once in the vue-fusioncharts and fusioncharts node modules for their definitions, before throwing up errors. If we would have used FusionCharts in an isolated part of our project (not using it in almost all of the component files), then perhaps local declaration would have made more sense.<\/p>\n<p>With that, you are all set to use FusionCharts in the project. We will be using quite a few variety of charts, the choice being dependent on the aspect of the weather data that we want to visualize. Also, we will get to see the interplay of data binding, custom components, and watchers in action.<\/p>\n<h4>General Scheme For Using Fusioncharts In <code>.vue<\/code> Files<\/h4>\n<p>In this section, we will explain the general idea of using FusionCharts for creating various charts in the <code>.vue<\/code> files. But first, let\u2019s see the pseudocode that schematically illustrates the core idea.<\/p>\n<pre><code><template>\n  <div>\n    <fusioncharts\n      :attribute_1=\"data_object_1\"\n      :attribute_2=\"data_object_2\"\n         \u2026\n         \u2026\n         ...\n    >\n    <\/fusioncharts>\n  <\/div>\n<\/template>\n\n<script>\nexport default {\n  props: [\"data_prop_received_by_the_component\"],\n  components: {},\n  data() {\n    return {\n      data_object_1: \"value_1\",\n      data_object_2: \"value_2\",\n          \u2026\n          \u2026\n    };\n  },\n  methods: {},\n  computed: {},\n  watch: {\n    data_prop_received_by_the_component: {\n      handler: function() {\n        \/\/ some code\/logic, mainly data manipulation based\n      },\n      deep: true\n    }\n  }\n};\n<\/script>\n\n<style>\n  \/\/ component specific special CSS code here\n<\/style>\n<\/code><\/pre>\n<p>Let\u2019s understand different parts of the above pseudocode:<\/p>\n<ul>\n<li>In the <code><template><\/code>, within the top level <code>\n<div><\/code> (that\u2019s pretty much mandatory for the template HTML code of every component), we have the custom component <code><fusioncharts><\/code>. We have the definition of the component contained in the <code>vue-fusioncharts<\/code> Node module that we have installed for this project. Internally, <code>vue-fusioncharts<\/code> relies on the <code>fusioncharts<\/code> module, which have also been installed. We imported the necessary modules and resolved their dependencies, instructed Vue to use the wrapper globally (throughout the project) in the <code>src\/main.js<\/code> file, and therefore there is no lack of definition for the custom <code><fusioncharts><\/code> component that we have used here. Also, the custom component has custom attributes, and each of the custom attribute is bound to a data object (and in turn, their values), by the <code>v-bind<\/code> directive, for which the shorthand is the colon (<code>:<\/code>) symbol. We will learn about the attributes and their associated data objects in a greater detail, when we discuss some of the specific charts used in this project.<\/li>\n<li>In the <code><script><\/code>, first you declare the props that the component is supposed to receive, and then go on defining the data objects that are bounded to the attributes of <code><fusioncharts><\/code>. The values assigned to the data objects are the values that the attributes of <code><fusioncharts><\/code> pulls in, and the charts are created on the basis of those pulled in values. Apart from these, the most interesting part of the code is the <code>watch { }<\/code> object. This is a very special object in Vue\u2019s scheme of things \u2014 it essentially instructs Vue to watch over any changes happening to certain data, and then take actions based on how the <code>handler<\/code> function for that data has been defined. For example, we want Vue to keep a watch on the <code>prop<\/code> received, i.e., <code>data_prop_received_by_the_component<\/code> in the pseudocode. The <code>prop<\/code> becomes a key in the <code>watch { }<\/code> object, and the value of the key is another object \u2014 a handler method that describes what needs to be done whenever the <code>prop<\/code> changes. With such elegant mechanisms to handle the changes, the app maintains its reactivity. The <code>deep: true<\/code> represents a boolean flag that you can associate with watchers, so that the object being watched is watched rather deeply, i.e., even the changes made in the nested levels of the object are tracked.<br \/>\n(<em>For more information on watchers, consult the <a href=\"https:\/\/vuejs.org\/v2\/api\/#vm-watch\">official documentation<\/a><\/em>).<\/li>\n<\/ul>\n<p>Now that you are equipped with an understanding of the general scheme of things, let\u2019s dive into the specific implementations of the charts in the <code>.vue<\/code> component files. The code will be pretty self-explanatory, and you should try to understand how the specifics fit in the general scheme of things described above.<\/p>\n<h4>Implementation Of Charts In .vue Files<\/h4>\n<p>While the very specifics of the implementation varies from one chart to another, the following explanation is applicable for all of them:<\/p>\n<ul>\n<li><code><template><\/code><br \/>\nAs explained previously, the <code><fusioncharts><\/code> custom component has several attributes, each of them being bound to corresponding data object defined in the <code>data()<\/code> function by using the <code>v-bind<\/code>: directive. The attribute names are quite self-explanatory for what they mean, and figuring out the corresponding data objects is also trivial.<\/li>\n<li><code><script><\/code><br \/>\nIn the <code>data()<\/code> function, the data objects and their values are what makes the charts work, because of the binding done by the <code>v-bind<\/code> (<code>:<\/code>) directives used on the attributes of <code><fusioncharts><\/code>. Before we dive deep into the individual data objects, it\u2019s worth mentioning some general characteristics:<\/p>\n<ul>\n<li>The data objects whose values are either <code>0<\/code> or <code>1<\/code> are boolean in nature, where <code>0<\/code> represents something not available\/turned off, and <code>1<\/code> represents availability\/turned on state. However, be cautious that non-boolean data objects can also have <code>0<\/code> or <code>1<\/code> as their values, besides other possible values \u2014 it depends on the context. For example, <code>containerbackgroundopacity<\/code> with its default value as <code>0<\/code> is boolean, whereas <code>lowerLimit<\/code> with its default value as <code>0<\/code> simply means the number zero is its literal value.<\/li>\n<li>Some data objects deals with CSS properties like margin, padding, font-size, etc. \u2014 the value has an implied unit of \u201cpx\u201d or pixel. Similarly, other data objects can have implicit units associated with their values. For detailed information, please refer to the respective chart attributes page of FusionCharts Dev Center.<\/li>\n<\/ul>\n<\/li>\n<li>In the <code>data()<\/code> function, perhaps the most interesting and non-obvious object is the dataSource. This object has three main objects nested within it:\n<ul>\n<li><strong>chart<\/strong>: This object encapsulates lots of chart attributes related to the configuration and cosmetics of the chart. It is almost a compulsory construct that you will find in all the charts you will create for this project.<\/li>\n<li><strong>colorrange<\/strong>: This object is somewhat specific to the chart under consideration, and is mainly present in charts that deals with multiple colors\/shades to demarcate different sub-ranges of the scale used in chart.<\/li>\n<li>value: This object, again, is present in charts that has a specific value that needs to be highlighted in the range of the scale.<\/li>\n<\/ul>\n<\/li>\n<li>The <code>watch { }<\/code> object is perhaps the most crucial thing that makes this chart, and the other charts used in this project, spring to life. The reactivity of the charts, i.e., the charts updating themselves based on the new values resulting from a new user query is controlled by the watchers defined in this object. For example, we have defined a watcher for the prop <code>highlights<\/code> received by the component, and then defined a handler function to instruct Vue about the necessary actions that it should take, when anything changes about the object being watched in the entire project. This means that whenever <code>App.vue<\/code> yields a new value for any of the object within <code>highlights<\/code>, the information trickles down all the way down to this component, and the new value is updated in the data objects of this component. The chart being bound to the values, also gets updated as a result of this mechanism.<\/li>\n<\/ul>\n<p>The above explanations are quite broad strokes to help us develop an intuitive understanding of the bigger picture. Once you understand the concepts intuitively, you can always consult the documentation of Vue.js and FusionCharts, when something is not clear to you from the code itself. We leave the exercise to you, and from the next subsection onward, we will not explain stuff that we covered in this subsection.<\/p>\n<h5>src\/components\/TempVarChart.vue<\/h5>\n<figure><a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/18ac2859-3c79-4e90-b903-2404db7e69a0\/interactive-weather-dashboard-image14.png\"><br \/>\n\t\t<img decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image14.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/18ac2859-3c79-4e90-b903-2404db7e69a0\/interactive-weather-dashboard-image14.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/18ac2859-3c79-4e90-b903-2404db7e69a0\/interactive-weather-dashboard-image14.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/18ac2859-3c79-4e90-b903-2404db7e69a0\/interactive-weather-dashboard-image14.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/18ac2859-3c79-4e90-b903-2404db7e69a0\/interactive-weather-dashboard-image14.png 2000w\" src=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image14.png\" sizes=\"100vw\" alt=\"A diagram showing Hourly Temperature\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/18ac2859-3c79-4e90-b903-2404db7e69a0\/interactive-weather-dashboard-image14.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<div>\n<pre><code><template>\n <div class=\"custom-card header-card card\">\n   <div class=\"card-body pt-0\">\n     <fusioncharts\n       type=\"spline\"\n       width=\"100%\"\n       height=\"100%\"\n       dataformat=\"json\"       dataEmptyMessage=\"i-https:\/\/i.postimg.cc\/R0QCk9vV\/Rolling-0-9s-99px.gif\"\n       dataEmptyMessageImageScale=39\n       :datasource=\"tempChartData\"\n     >\n     <\/fusioncharts>\n   <\/div>\n  \n <\/div>\n<\/template>\n\n<script>\nexport default {\n props: [\"tempVar\"],\n components: {},\n data() {\n   return {\n     tempChartData: {\n       chart: {\n         caption: \"Hourly Temperature\",\n         captionFontBold: \"0\",\n         captionFontColor: \"#000000\",\n         captionPadding: \"30\",\n         baseFont: \"Roboto\",\n         chartTopMargin: \"30\",\n         showHoverEffect: \"1\",\n         theme: \"fusion\",\n         showaxislines: \"1\",\n         numberSuffix: \"\u00b0C\",\n         anchorBgColor: \"#6297d9\",\n         paletteColors: \"#6297d9\",\n         drawCrossLine: \"1\",\n         plotToolText: \"$label<br><hr><b>$dataValue<\/b>\",\n         showAxisLines: \"0\",\n         showYAxisValues: \"0\",\n         anchorRadius: \"4\",\n         divLineAlpha: \"0\",\n         labelFontSize: \"13\",\n         labelAlpha: \"65\",\n         labelFontBold: \"0\",\n         rotateLabels: \"1\",\n         slantLabels: \"1\",\n         canvasPadding: \"20\"\n       },\n       data: [],\n     },\n   };\n },\n methods: {\n   setChartData: function() {\n     var data = [];\n     for (var i = 0; i < this.tempVar.tempToday.length; i++) {\n       var dataObject = {\n         label: this.tempVar.tempToday[i].hour,\n         value: this.tempVar.tempToday[i].temp\n       };\n       data.push(dataObject);\n     }\n     this.tempChartData.data = data;\n   },\n },\n mounted: function() {\n   this.setChartData();\n },\n watch: {\n   tempVar: {\n     handler: function() {\n       this.setChartData();                                   \n     },\n     deep: true\n   },\n },\n};\n<\/script>\n\n<style>\n<\/style>\n<\/code><\/pre>\n<\/div>\n<h5>src\/components\/UVIndex.vue<\/h5>\n<p>This component contains an extremely useful chart \u2014 the Angular Gauge.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c958d43b-e6c4-47ba-8c01-e049749f0248\/interactive-weather-dashboard-image15.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image15.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c958d43b-e6c4-47ba-8c01-e049749f0248\/interactive-weather-dashboard-image15.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c958d43b-e6c4-47ba-8c01-e049749f0248\/interactive-weather-dashboard-image15.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c958d43b-e6c4-47ba-8c01-e049749f0248\/interactive-weather-dashboard-image15.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c958d43b-e6c4-47ba-8c01-e049749f0248\/interactive-weather-dashboard-image15.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image15.png?w=900\" sizes=\"100vw\" alt=\"UV Index\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c958d43b-e6c4-47ba-8c01-e049749f0248\/interactive-weather-dashboard-image15.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>The code for the component is given below. For detailed information on the chart attributes of Angular Gauge, refer to <a href=\"https:\/\/www.fusioncharts.com\/dev\/chart-guide\/gauges-and-widgets\/angular-gauge?utm_source=smashing_mag&#038;utm_medium=blog&#038;utm_campaign=weather_dashboard_vue\">FusionCharts Dev Center page for Angular Gauge<\/a>.<\/p>\n<div>\n<pre><code><template>\n <div class=\"highlights-item col-md-4 col-sm-6 col-xs-12 border-top\">\n   <div>\n     <fusioncharts\n       :type=\"type\"\n       :width=\"width\"\n       :height=\"height\"\n       :containerbackgroundopacity=\"containerbackgroundopacity\"\n       :dataformat=\"dataformat\"\n       :datasource=\"datasource\"\n     ><\/fusioncharts>\n   <\/div>\n <\/div>\n<\/template>\n\n<script>\nexport default {\n props: [\"highlights\"],\n components: {},\n data() {\n   return {\n     type: \"angulargauge\",\n     width: \"100%\",\n     height: \"100%\",\n     containerbackgroundopacity: 0,\n     dataformat: \"json\",\n     datasource: {\n       chart: {\n         caption: \"UV Index\",\n         captionFontBold: \"0\",\n         captionFontColor: \"#000000\",\n         captionPadding: \"30\",\n         lowerLimit: \"0\",\n         upperLimit: \"15\",\n         lowerLimitDisplay: \"1\",\n         upperLimitDisplay: \"1\",\n         showValue: \"0\",\n         theme: \"fusion\",\n         baseFont: \"Roboto\",\n         bgAlpha: \"0\",\n         canvasbgAlpha: \"0\",\n         gaugeInnerRadius: \"75\",\n         gaugeOuterRadius: \"110\",\n         pivotRadius: \"0\",\n         pivotFillAlpha: \"0\",\n         valueFontSize: \"20\",\n         valueFontColor: \"#000000\",\n         valueFontBold: \"1\",\n         tickValueDistance: \"3\",\n         autoAlignTickValues: \"1\",\n         majorTMAlpha: \"20\",\n         chartTopMargin: \"30\",\n         chartBottomMargin: \"40\"\n       },\n       colorrange: {\n         color: [\n           {\n             minvalue: \"0\",\n             maxvalue: this.highlights.uvIndex.toString(),\n             code: \"#7DA9E0\"\n           },\n           {\n             minvalue: this.highlights.uvIndex.toString(),\n             maxvalue: \"15\",\n             code: \"#D8EDFF\"\n           }\n         ]\n       },\n       annotations: {\n         groups: [\n           {\n             items: [\n               {\n                 id: \"val-label\",\n                 type: \"text\",\n                 text: this.highlights.uvIndex.toString(),\n                 fontSize: \"20\",\n                 font: \"Source Sans Pro\",\n                 fontBold: \"1\",\n                 fillcolor: \"#212529\",\n                 x: \"$gaugeCenterX\",\n                 y: \"$gaugeCenterY\"\n               }\n             ]\n           }\n         ]\n       },\n       dials: {\n         dial: [\n           {\n             value: this.highlights.uvIndex.toString(),\n             baseWidth: \"0\",\n             radius: \"0\",\n             borderThickness: \"0\",\n             baseRadius: \"0\"\n           }\n         ]\n       }\n     }\n   };\n },\n methods: {},\n computed: {},\n watch: {\n   highlights: {\n     handler: function() {\n       this.datasource.colorrange.color[0].maxvalue = this.highlights.uvIndex.toString();\n       this.datasource.colorrange.color[1].minvalue = this.highlights.uvIndex.toString();\n       this.datasource.annotations.groups[0].items[0].text = this.highlights.uvIndex.toString();\n     },\n     deep: true\n   }\n }\n};\n<\/script>\n<\/code><\/pre>\n<\/div>\n<h5>src\/components\/Visibility.vue<\/h5>\n<p>In this component, we use a <a href=\"https:\/\/www.fusioncharts.com\/dev\/chart-guide\/gauges-and-widgets\/linear-gauge\">Horizontal Linear Gauge<\/a> to represent the visibility, as shown in the image below:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/205825ff-05a5-41d7-aa81-cd0a9eab5d21\/interactive-weather-dashboard-image16.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image16.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/205825ff-05a5-41d7-aa81-cd0a9eab5d21\/interactive-weather-dashboard-image16.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/205825ff-05a5-41d7-aa81-cd0a9eab5d21\/interactive-weather-dashboard-image16.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/205825ff-05a5-41d7-aa81-cd0a9eab5d21\/interactive-weather-dashboard-image16.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/205825ff-05a5-41d7-aa81-cd0a9eab5d21\/interactive-weather-dashboard-image16.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image16.png?w=900\" sizes=\"100vw\" alt=\"A screenshot of the Horizontal Linear Gauge representing Air Visibility (16km)\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/205825ff-05a5-41d7-aa81-cd0a9eab5d21\/interactive-weather-dashboard-image16.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>The code for the component is given below. For an in depth understanding of the different attributes of this chart type, please refer to <a href=\"https:\/\/www.fusioncharts.com\/dev\/chart-attributes\/?chart=HLinearGauge&#038;utm_source=smashing_mag&#038;utm_medium=blog&#038;utm_campaign=weather_dashboard_vue\">FusionCharts Dev Center page for Horizontal Linear Gauge<\/a>.<\/p>\n<div>\n<pre><code><template>\n <div class=\"highlights-item col-md-4 col-sm-6 col-xs-12 border-left border-right border-top\">\n   <div>\n     <fusioncharts\n       :type=\"type\"\n       :width=\"width\"\n       :height=\"height\"\n       :containerbackgroundopacity=\"containerbackgroundopacity\"\n       :dataformat=\"dataformat\"\n       :datasource=\"datasource\"\n     >\n     <\/fusioncharts>\n     <\/div>\n <\/div>\n<\/template>\n\n<script>\nexport default {\n props: [\"highlights\"],\n components: {},\n methods: {},\n computed: {},\n data() {\n   return {\n     type: \"hlineargauge\",\n     width: \"100%\",\n     height: \"100%\",\n     containerbackgroundopacity: 0,\n     dataformat: \"json\",\n     creditLabel: false,\n     datasource: {\n       chart: {\n         caption: \"Air Visibility\",\n         captionFontBold: \"0\",\n         captionFontColor: \"#000000\",\n         baseFont: \"Roboto\",\n         numberSuffix: \" km\",\n         lowerLimit: \"0\",\n         upperLimit: \"40\",\n         showPointerShadow: \"1\",\n         animation: \"1\",\n         transposeAnimation: \"1\",\n         theme: \"fusion\",\n         bgAlpha: \"0\",\n         canvasBgAlpha: \"0\",\n         valueFontSize: \"20\",\n         valueFontColor: \"#000000\",\n         valueFontBold: \"1\",\n         pointerBorderAlpha: \"0\",\n         chartBottomMargin: \"40\",\n         captionPadding: \"30\",\n         chartTopMargin: \"30\"\n       },\n       colorRange: {\n         color: [\n           {\n             minValue: \"0\",\n             maxValue: \"4\",\n             label: \"Fog\",\n             code: \"#6297d9\"\n           },\n           {\n             minValue: \"4\",\n             maxValue: \"10\",\n             label: \"Haze\",\n             code: \"#7DA9E0\"\n           },\n           {\n             minValue: \"10\",\n             maxValue: \"40\",\n             label: \"Clear\",\n             code: \"#D8EDFF\"\n           }\n         ]\n       },\n       pointers: {\n         pointer: [\n           {\n             value: this.highlights.visibility.toString()\n           }\n         ]\n       }\n     }\n   };\n },\n watch: {\n   highlights: {\n     handler: function() {\n       this.datasource.pointers.pointer[0].value = this.highlights.visibility.toString();\n     },\n     deep: true\n   }\n }\n};\n<\/script>\n<\/code><\/pre>\n<\/div>\n<h5>src\/components\/WindStatus.vue<\/h5>\n<p>This component displays the wind speed and direction (wind velocity, if you are physics savvy), and it is very difficult to represent a vector using a chart. For such cases, we suggest representing them with the aid of some nice images and text values. Since the representation we have thought about is entirely dependent on CSS, we will implement it in the next section that deals with the CSS. However, take a look at what we are aiming to create:<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/cdf9ab00-3ccc-473b-82f6-ab517c7bf412\/interactive-weather-dashboard-image17.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image17.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/cdf9ab00-3ccc-473b-82f6-ab517c7bf412\/interactive-weather-dashboard-image17.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/cdf9ab00-3ccc-473b-82f6-ab517c7bf412\/interactive-weather-dashboard-image17.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/cdf9ab00-3ccc-473b-82f6-ab517c7bf412\/interactive-weather-dashboard-image17.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/cdf9ab00-3ccc-473b-82f6-ab517c7bf412\/interactive-weather-dashboard-image17.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image17.png?w=900\" sizes=\"100vw\" alt=\"Wind Status: Wind Direction (left) and Wind Speed (right)\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/cdf9ab00-3ccc-473b-82f6-ab517c7bf412\/interactive-weather-dashboard-image17.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<div>\n<pre><code><template>\n <div class=\"highlights-item col-md-4 col-sm-6 col-xs-12 border-top\">\n   <div>\n   <div class=\"card-heading pt-5\">Wind Status<\/div>\n   <div class=\"row pt-4 mt-4\">\n     <div class=\"col-sm-6 col-md-6 mt-2 text-center align-middle\">\n       <p class=\"card-sub-heading mt-3\">Wind Direction<\/p>\n       <p class=\"mt-4\"><img loading=\"lazy\" decoding=\"async\" src=\"..\/assets\/winddirection.svg\" height=\"40\" width=\"40\"><\/p>\n       <p class=\"card-value mt-4\">{{ highlights.windStatus.derivedWindDirection }}<\/p>\n     <\/div>\n     <div class=\"col-sm-6 col-md-6 mt-2\">\n       <p class=\"card-sub-heading mt-3\">Wind Speed<\/p>\n       <p class=\"mt-4\"><img loading=\"lazy\" decoding=\"async\" src=\"..\/assets\/windspeed.svg\" height=\"40\" width=\"40\"><\/p>\n       <p class=\"card-value mt-4\">{{ highlights.windStatus.windSpeed }} km\/h<\/p>\n     <\/div>\n   <\/div>\n   <\/div>\n <\/div>\n<\/template>\n\n<script>\nexport default {\n props: [\"highlights\"],\n components: {},\n data() {\n   return {};\n },\n methods: {},\n computed: {}\n};\n<\/script>\n<\/code><\/pre>\n<\/div>\n<h4>Wrapping Up With Highlights.vue<\/h4>\n<p>Recall that we have already implemented code with CSS for all the components \u2014 except <code>Content.vue<\/code> and <code>Highlights.vue<\/code>. Since <code>Content.vue<\/code> is a dumb component that just relays data, the minimal styling it needs has already been covered. Also, we have already written appropriate code for styling the sidebar and the cards containing the charts. Therefore, all we are left to do is add some stylistic bits to <code>Highlights.vue<\/code>, which primarily involves using the CSS classes:<\/p>\n<div>\n<pre><code><template>\n  <div class=\"custom-content-card content-card card\">\n    <div class=\"card-body pb-0\">\n    <div class=\"content-header h4 text-center pt-2 pb-3\">Highlights<\/div>\n      <div class=\"row\">\n        <uv-index :highlights=\"highlights\"><\/uv-index>\n        <visibility :highlights=\"highlights\"><\/visibility>\n        <wind-status :highlights=\"highlights\"><\/wind-status>\n      <\/div>\n    <\/div>\n  <\/div>\n<\/template>\n\n<script>\nimport UVIndex from \".\/UVIndex.vue\";\nimport Visibility from \".\/Visibility.vue\";\nimport WindStatus from \".\/WindStatus.vue\";\n\nexport default {\n  props: [\"highlights\"],\n  components: {\n    \"uv-index\": UVIndex,\n    \"visibility\": Visibility,\n    \"wind-status\": WindStatus,\n  },\n};\n<\/script>\n<\/code><\/pre>\n<\/div>\n<h4>Deployment And Source Code<\/h4>\n<p>With the charts and style in order, we are done! Take a moment to appreciate the beauty of your creation.<\/p>\n<figure><a href=\"https:\/\/i0.wp.com\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c538b1aa-2c4d-4dd7-8d27-6d0db227ee7c\/interactive-weather-dashboard-image18.png?ssl=1\"><br \/>\n\t\t<img data-recalc-dims=\"1\" decoding=\"async\" srcset=\"http:\/\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image18.png 400w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_800\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c538b1aa-2c4d-4dd7-8d27-6d0db227ee7c\/interactive-weather-dashboard-image18.png 800w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1200\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c538b1aa-2c4d-4dd7-8d27-6d0db227ee7c\/interactive-weather-dashboard-image18.png 1200w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_1600\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c538b1aa-2c4d-4dd7-8d27-6d0db227ee7c\/interactive-weather-dashboard-image18.png 1600w,\n\t\t\t        https:\/\/res.cloudinary.com\/indysigner\/image\/fetch\/f_auto,q_auto\/w_2000\/https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c538b1aa-2c4d-4dd7-8d27-6d0db227ee7c\/interactive-weather-dashboard-image18.png 2000w\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image18.png?w=900\" sizes=\"100vw\" alt=\"The result\"><\/a><figcaption>\n\t\t\t(<a href=\"https:\/\/cloud.netlifyusercontent.com\/assets\/344dbf88-fdf9-42bb-adb4-46f01eedd629\/c538b1aa-2c4d-4dd7-8d27-6d0db227ee7c\/interactive-weather-dashboard-image18.png\">Large preview<\/a>)<br \/>\n\t\t<\/figcaption><\/figure>\n<p>It\u2019s now time for you to deploy your application, and share it with your peers. If you don\u2019t have much idea about deployment and expect us to help you, look <a href=\"https:\/\/www.fusioncharts.com\/resources\/developers\/charting-react-vs-vue-npm-battle-tutorial#production-deployment\">here about our take on deployment ideas<\/a>. The linked article also contains suggestions on how to remove the FusionCharts watermark at the left bottom of every chart.<\/p>\n<p>If you mess up somewhere and want a reference point, the <a href=\"https:\/\/github.com\/datasouvik\/modified_weather_dashboard\">source code is available on Github<\/a>.<\/p>\n<div>\n  <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/logo-red.png?w=900\" alt=\"Smashing Editorial\"><span>(ms, ra, il)<\/span>\n<\/div>\n<\/article>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Vue.js To Create An Interactive Weather Dashboard With APIs Using Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00 (This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too&#8230;<a class=\"moretag\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":4,"featured_media":59744,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[371],"tags":[],"class_list":["post-59743","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-user-experience"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guest Contribution\"\/>\n\t<meta name=\"keywords\" content=\"user experience\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies\" \/>\n\t\t<meta property=\"og:description\" content=\"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-02-02T11:19:13+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-02-02T11:19:13+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#article\",\"name\":\"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies\",\"headline\":\"Using Vue.js To Create An Interactive Weather Dashboard With APIs\",\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/interactive-weather-dashboard-image3.png?fit=400%2C220&ssl=1\",\"width\":400,\"height\":220},\"datePublished\":\"2019-02-02T04:19:13-07:00\",\"dateModified\":\"2019-02-02T04:19:13-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#webpage\"},\"articleSection\":\"User Experience\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"position\":2,\"name\":\"User Experience\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#listItem\",\"name\":\"Using Vue.js To Create An Interactive Weather Dashboard With APIs\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#listItem\",\"position\":3,\"name\":\"Using Vue.js To Create An Interactive Weather Dashboard With APIs\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/\",\"name\":\"Guest Contribution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guest Contribution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#webpage\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/\",\"name\":\"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies\",\"description\":\"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \\u201cHello World\\u201d example, nor too intimidating in\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/interactive-weather-dashboard-image3.png?fit=400%2C220&ssl=1\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#mainImage\",\"width\":400,\"height\":220},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2019\\\/02\\\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\\\/#mainImage\"},\"datePublished\":\"2019-02-02T04:19:13-07:00\",\"dateModified\":\"2019-02-02T04:19:13-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies","description":"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in","canonical_url":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/","robots":"max-image-preview:large","keywords":"user experience","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#article","name":"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies","headline":"Using Vue.js To Create An Interactive Weather Dashboard With APIs","author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image3.png?fit=400%2C220&ssl=1","width":400,"height":220},"datePublished":"2019-02-02T04:19:13-07:00","dateModified":"2019-02-02T04:19:13-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#webpage"},"isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#webpage"},"articleSection":"User Experience"},{"@type":"BreadcrumbList","@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.taterboy.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","position":2,"name":"User Experience","item":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#listItem","name":"Using Vue.js To Create An Interactive Weather Dashboard With APIs"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#listItem","position":3,"name":"Using Vue.js To Create An Interactive Weather Dashboard With APIs","previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}}]},{"@type":"Organization","@id":"https:\/\/www.taterboy.com\/blog\/#organization","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","url":"https:\/\/www.taterboy.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author","url":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/","name":"Guest Contribution","image":{"@type":"ImageObject","@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Guest Contribution"}},{"@type":"WebPage","@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#webpage","url":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/","name":"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies","description":"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#breadcrumblist"},"author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"creator":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image3.png?fit=400%2C220&ssl=1","@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#mainImage","width":400,"height":220},"primaryImageOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/#mainImage"},"datePublished":"2019-02-02T04:19:13-07:00","dateModified":"2019-02-02T04:19:13-07:00"},{"@type":"WebSite","@id":"https:\/\/www.taterboy.com\/blog\/#website","url":"https:\/\/www.taterboy.com\/blog\/","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","og:type":"article","og:title":"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies","og:description":"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in","og:url":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/","article:published_time":"2019-02-02T11:19:13+00:00","article:modified_time":"2019-02-02T11:19:13+00:00","twitter:card":"summary","twitter:title":"Using Vue.js To Create An Interactive Weather Dashboard With APIs | Design for Immersive Technologies","twitter:description":"Using Vue.js To Create An Interactive Weather Dashboard With APIsUsing Vue.js To Create An Interactive Weather Dashboard With APIs Souvik Sarkar 2019-02-01T13:00:18+01:002019-02-02T00:03:23+00:00(This is a sponsored article.) In this tutorial, you will build a simple weather dashboard from scratch. It will be a client-end application that is neither a \u201cHello World\u201d example, nor too intimidating in"},"aioseo_meta_data":{"post_id":"59743","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2021-02-07 22:41:25","updated":"2026-09-01 03:37:08","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/\" title=\"User Experience\">User Experience<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tUsing Vue.js To Create An Interactive Weather Dashboard With APIs\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.taterboy.com\/blog"},{"label":"User Experience","link":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/"},{"label":"Using Vue.js To Create An Interactive Weather Dashboard With APIs","link":"https:\/\/www.taterboy.com\/blog\/2019\/02\/using-vue-js-to-create-an-interactive-weather-dashboard-with-apis\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8wzr5-fxB","jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2019\/02\/interactive-weather-dashboard-image3.png?fit=400%2C220&ssl=1","_links":{"self":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/59743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/comments?post=59743"}],"version-history":[{"count":0,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/59743\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media\/59744"}],"wp:attachment":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media?parent=59743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/categories?post=59743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/tags?post=59743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}