Sofiaml Boo

Sofiaml Boo

1577256563

Understanding of Meter Tag in HTML 5

What is the meter tag?

I this article I am explaining the meter tag. The output of both (progress and meter) tags is the same as we will see but there is the difference that actually the meter tag is used to represent a scalar measurement within a known range. The value can be fractional.Examples

Disk uses, the relevance of a query result, the fraction of a voting population to have selected a specific candidate.

What is the difference between the progress tag and the meter tag? Progress bar is used to display the progress of a specific task. Or a progress element represents the completion progress of a task. Whereas the meter tag is used to represent guages.  We can think that a progress tag represents dynamic data whereas a meter tag represents static data.

Note:

  1. According to the W3C, the meter element should not be used to indicate progress, because to indicate the progress we have the progress tag.
  2. The meter element also does not represent a scalar value of an arbitrary range; for example, it would be wrong to use this to report a weight, or height, unless there is a known maximum value.

Syntax

The Meter tag is an inline element, the same as a header, progress and so on.

Attributes

<meter></meter>   

Apart from the Global Attributes and Event Attributes, the meter tag have 6 more attributes as shown in the following table:

This is image title

The following inequalities must hold, as applicable:

  • min <= value <= max
  • min <= low <= max (if low is specified)
  • min <= high <= max (if high is specified)
  • min <= optimum <= max (if optimum is specified)
  • low <= high (if both low and high are specified)

Note: if you do not specify min or max then the range will be between 0.0 to 1.0 and the value must be in that range.

HTML DOM Meter Object

In the DOM the meter element is defined by METER that represents for HTML 5.

  • How the meter object can be accessed: using the getElementById() method you can access the element.
var x = document.getElementById("[Give id of the meter tag here]");  
  • Create a meter object: You can also create the element dynamically using the createElement() method:
var x = document.createElement("METER");    
  • Meter object properties: The properties of a meter object are given in the following table:

Example 1: This example will show you how can you use a meter element in HTML 5.

<!DOCTYPE html>        
<html lang="en">        
<head>        
    <meta charset="utf-8" />        
</head>        
<body>        
   <b>Meter without value</b>    
   <meter></meter>    
    
   <br/><br/>    
   <b>Meter with value but without min and max attribute</b>    
   <meter value="0.8"></meter>    
    
   <br/><br/>    
   <b>Meter with value, min and max attribute</b>    
   <meter min="0" max="100" value="17"></meter>    
    
   <br/><br/>    
   <b>Meter (when "min <= value < low")</b>    
   <meter  min="0" max="100" value="17" low="25" high="75"></meter>    
    
   <br/><br/>    
   <b>Meter (when "high < value <= max")</b>    
   <meter  min="0" max="100" value="80" low="25" high="75"></meter>    
    
   <br/><br/>    
   <b>Meter (when "low <= value <= high")</b>    
   <meter  min="0" max="100" value="50" low="25" high="75"></meter>    
    
   <br/><br/>    
   <b>Meter with optimum attribute</b>    
   <meter  min="0" max="100" value="24" low="25" high="75" optimum="80"></meter>    
    
   <br/><br/>    
   <b>Meter with optimum attribute</b>    
   <meter  min="0" max="100" value="80" low="25" high="75" optimum="20"></meter>    
    
</body>        
</html>     

The output of example 1:

This is image title

Styling meter element: we can define various types of styles for the meter element using a progress selector.Example 2: This example will explain how to increase the width and height of a meter element.

Example 2: This example will explain how to increase the width and height of a meter element.

<!DOCTYPE html>        
<html lang="en">        
<head>        
    <meta charset="utf-8" />     
   <style>    
   meter {    
     width: 400px;    
     height: 25px;    
   }    
   </style>       
</head>        
<body>        
   <b>Meter without value</b>    
   <meter></meter>    
    
   <br/><br/>    
   <b>Meter with value but without min and max attribute</b>    
   <meter value="0.8"></meter>    
    
   <br/><br/>    
   <b>Meter with value, min and max attribute</b>    
   <meter min="0" max="100" value="17"></meter>    
       
   <br/><br/>    
   <b>Meter (when "min <= value < low")</b>    
   <meter  min="0" max="100" value="17" low="25" high="75"></meter>    
    
   <br/><br/>    
   <b>Meter (when "high < value <= max")</b>    
   <meter  min="0" max="100" value="80" low="25" high="75"></meter>    
    
   <br/><br/>    
   <b>Meter (when "low <= value <= high")</b>    
   <meter  min="0" max="100" value="50" low="25" high="75"></meter>    
    
   <br/><br/>    
   <b>Meter with optimum attribute</b>    
   <meter  min="0" max="100" value="24" low="25" high="75" optimum="80"></meter>    
    
   <br/><br/>    
   <b>Meter with optimum attribute</b>    
   <meter  min="0" max="100" value="80" low="25" high="75" optimum="20"></meter>    
    
</body>        
</html>     

Output of the Example 2:

This is image title

More in styling:

  • WebKit/Blink Browser: like Opera, Googe Chrome and Safari
  • FireFox
  • Internet Explorer

1. WebKit/Blink Browser: According to webkit.org, we can have 5 different pseudo classes that are given in the following table.

This is image title

Example 3:  This example explains how to reset the appearance of a meter element. To reset the appearance we use -webkit-appearance:none;

<!DOCTYPE html>          
<html lang="en">          
<head>          
    <meta charset="utf-8" />       
<style>      
meter {      
  width: 300px;      
  height: 25px;      
  -webkit-appearance: none; /* Reset appearance */      
  border: 1px solid #ccc;      
  border-radius: 5px;      
}      
</style>         
</head>          
<body>          
<b>Meter without value</b>      
<meter></meter>      
      
<br/><br/>      
<b>Meter with value but without min and max attribute</b>      
<meter value="0.8"></meter>      
      
<br/><br/>      
<b>Meter with value, min and max attribute</b>      
<meter min="0" max="100" value="17"></meter>      
      
<br/><br/>      
<b>Meter (when "min <= value < low")</b>      
<meter  min="0" max="100" value="17" low="25" high="75"></meter>      
      
<br/><br/>      
<b>Meter (when "high < value <= max")</b>      
<meter  min="0" max="100" value="80" low="25" high="75"></meter>      
      
<br/><br/>      
<b>Meter (when "low <= value <= high")</b>      
<meter  min="0" max="100" value="50" low="25" high="75"></meter>      
      
<br/><br/>      
<b>Meter with optimum attribute</b>      
<meter  min="0" max="100" value="24" low="25" high="75" optimum="80"></meter>      
      
<br/><br/>      
<b>Meter with optimum attribute</b>      
<meter  min="0" max="100" value="80" low="25" high="75" optimum="20"></meter>      
      
</body>          
</html>      

Output of the Example 3:

This is image title

Example 4: How to render the background container?

According to the preceding table I have described that we can render the container using the -webkit-meter-bar pseudo-class, so to apply the rendering I am using the following code:

meter::-webkit-meter-bar {    
  background: none;     
  background-color: whiteSmoke;    
  box-shadow: 0 5px 5px -5px #00F inset;    
  border: 1px solid #0ff;    
  border-radius: 5px;    
}  

Complete Code

<!DOCTYPE html>        
<html lang="en">        
<head>        
    <meta charset="utf-8" />     
<style>    
meter {    
  width: 300px;    
  height: 25px;    
  -webkit-appearance: none; /* Reset appearance */    
  border: 1px solid #F0f;    
  border-radius: 5px;    
}    
meter::-webkit-meter-bar {    
  background: none;     
  background-color: whiteSmoke;    
  box-shadow: 0 5px 5px -5px #00F inset;    
  border: 1px solid #0ff;    
  border-radius: 5px;    
}    
    
</style>       
</head>        
<body>        
<b>Meter without value</b>    
<meter></meter>    
    
<br/><br/>    
<b>Meter with value but without min and max attribute</b>    
<meter value="0.8"></meter>    
    
<br/><br/>    
<b>Meter with value, min and max attribute</b>    
<meter min="0" max="100" value="17"></meter>    
    
<br/><br/>    
<b>Meter (when "min <= value < low")</b>    
<meter  min="0" max="100" value="17" low="25" high="75"></meter>    
    
<br/><br/>    
<b>Meter (when "high < value <= max")</b>    
<meter  min="0" max="100" value="80" low="25" high="75"></meter>    
    
<br/><br/>    
<b>Meter (when "low <= value <= high")</b>    
<meter  min="0" max="100" value="50" low="25" high="75"></meter>    
    
<br/><br/>    
<b>Meter with optimum attribute</b>    
<meter  min="0" max="100" value="24" low="25" high="75" optimum="80"></meter>    
    
<br/><br/>    
<b>Meter with optimum attribute</b>    
<meter  min="0" max="100" value="80" low="25" high="75" optimum="20"></meter>    
    
</body>        
</html>     

Output of the Example 4:

This is image title

Example 5: This example explains how to render the value of the meter element, it means inside the container how to apply the rendering.

According to the table we can render the meter elements using the following pseudo classes:

-webkit-meter-optimum-value  
-webkit-meter-suboptimum-value  
-webkit-meter-even-less-good-value  

Code: I am using the following code:

  1. For -webkit-meter-optimum-value:
meter::-webkit-meter-optimum-value {    
  box-shadow: 0 5px 5px -5px #999 inset;    
  background-image: linear-gradient(    
    25deg,     
    #002900 5%,     
    #003D00 5%,    
    #005200 25%,    
    #007A00 25%,    
    #00A300 55%,    
    #00CC00 55%,    
    #33D633 95%,    
    #66E066 95%,    
    #99EB99 100%    
  );    
  background-size: 100% 100%;    
}   
  1. For -webkit-meter-suboptimum-value:
meter::-webkit-meter-suboptimum-value {    
  box-shadow: 0 5px 5px -5px #999 inset;    
  background-image: linear-gradient(    
    25deg,     
    #333300 5%,     
    #666600 5%,    
    #999900 25%,    
    #CCCC00 25%,    
    #FFFF00 55%,    
    #FFFF33 55%,    
    #FFFFCC 95%,    
    #FF3300 95%,    
    #B22400 100%    
  );    
  background-size: 100% 100%;    
}   
  1. For -webkit-meter-even-less-good-value:
meter::-webkit-meter-even-less-good-value  {    
  box-shadow: 0 5px 5px -5px #999 inset;    
  background-image: linear-gradient(    
    25deg,     
    #000000 5%,     
    #330000 5%,    
    #660000 25%,    
    #990000 25%,    
    #CC0000 55%,    
    #FF0000 55%,    
    #FF3333 95%,    
    #FF6666 95%,    
    #FF9999 100%    
  );    
  background-size: 100% 100%;    
}   

Complete Code:

<!DOCTYPE html>        
<html lang="en">  
   <head>  
      <meta charset="utf-8" />  
      <style>    
         meter {    
         width: 300px;    
         height: 25px;    
         -webkit-appearance: none; /* Reset appearance */    
         border: 1px solid #F0f;    
         border-radius: 5px;    
         }    
         meter::-webkit-meter-bar {    
         background: none;     
         background-color: whiteSmoke;    
         box-shadow: 0 5px 5px -5px #00F inset;    
         border: 1px solid #0ff;    
         border-radius: 5px;    
         }    
         meter::-webkit-meter-optimum-value {    
         box-shadow: 0 5px 5px -5px #999 inset;    
         background-image: linear-gradient(    
         25deg,     
         #002900 5%,     
         #003D00 5%,    
         #005200 25%,    
         #007A00 25%,    
         #00A300 55%,    
         #00CC00 55%,    
         #33D633 95%,    
         #66E066 95%,    
         #99EB99 100%    
         );    
         background-size: 100% 100%;    
         }    
         meter::-webkit-meter-suboptimum-value {    
         box-shadow: 0 5px 5px -5px #999 inset;    
         background-image: linear-gradient(    
         25deg,     
         #333300 5%,     
         #666600 5%,    
         #999900 25%,    
         #CCCC00 25%,    
         #FFFF00 55%,    
         #FFFF33 55%,    
         #FFFFCC 95%,    
         #FF3300 95%,    
         #B22400 100%    
         );    
         background-size: 100% 100%;    
         }    
         meter::-webkit-meter-even-less-good-value  {    
         box-shadow: 0 5px 5px -5px #999 inset;    
         background-image: linear-gradient(    
         25deg,     
         #000000 5%,     
         #330000 5%,    
         #660000 25%,    
         #990000 25%,    
         #CC0000 55%,    
         #FF0000 55%,    
         #FF3333 95%,    
         #FF6666 95%,    
         #FF9999 100%    
         );    
         background-size: 100% 100%;    
         }    
      </style>  
   </head>  
   <body>        
      <b>Meter without value</b>    
      <meter></meter>    
      <br/><br/>    
      <b>Meter with value but without min and max attribute</b>    
      <meter value="0.8"></meter>    
      <br/><br/>    
      <b>Meter with value, min and max attribute</b>    
      <meter min="0" max="100" value="17"></meter>    
      <br/><br/>    
      <b>Meter (when "min <= value < low")</b>    
      <meter  min="0" max="100" value="17" low="25" high="75"></meter>    
      <br/><br/>    
      <b>Meter (when "high < value <= max")</b>    
      <meter  min="0" max="100" value="80" low="25" high="75"></meter>    
      <br/><br/>    
      <b>Meter (when "low <= value <= high")</b>    
      <meter  min="0" max="100" value="50" low="25" high="75"></meter>    
      <br/><br/>    
      <b>Meter with optimum attribute</b>    
      <meter  min="0" max="100" value="24" low="25" high="75" optimum="80"></meter>    
      <br/><br/>    
      <b>Meter with optimum attribute</b>    
      <meter  min="0" max="100" value="80" low="25" high="75" optimum="20"></meter>    
   </body>  
</html> 

Output of the Example 5:

This is image title

2. FireFox Browser: For the FireFox browser use “-moz” instead of “-webkit” and everything else is the same.

3. Internet Explorer: In IE you can use all these properties directly, like appearance.

Thank you for reading ! I hope this tutorial will surely help!

#HTML #HTML5 #Metertag #tutorial #html

What is GEEK

Buddha Community

Understanding of Meter Tag in HTML 5
Angela  Dickens

Angela Dickens

1596090180

Commonly Used HTML Tags with Examples

HTML tags are keywords used in HTML to display web-pages with certain properties. They are further used for defining HTML elements. An HTML element consists of a starting tag, some content, and an ending tag. The web browser reads the HTML document from top to bottom, left to right. Each HTML tag defines a new property that helps in rendering the website.

HTML Tags

HTML Tags

The ‘<>’ brackets contain an HTML tag. There are two types of HTML tags- empty tags or singleton tags and container tags. Singleton tags or empty tags do not contain any content such as an image or a paragraph and hence do not need to be closed, whereas container tags should be closed.

Syntax

  1. Some Content

Examples of:

Empty tag: 
,


,etc.

Container tags: 

Paragraph

Link

  1. <!DOCTYPE>
  2. Paragraph

  3. Heading

  4. Bold
  5. Italic
  6. Underline

Output-

HTML Tags example

Head tags:

,<style>,<script>,<link>,<meta> and <base>. <p>Text-formatting tags:</p> <p><h>,<b>,<strong>,<small>,<pre>,<i>,<em>,<sub>,<sup>,<ins>,<dfn>,<del>,<div> and <span>.</p> <p>Link tags:</p> <p><a>, <base>.</p> <p>List tags:</p> <ul>, <ol>, <li>, <dl>, <dd> <p>Table tags:</p> <table> ,<tr> , <td>, <th>, <thead>, <tbody>, <tfoot>. <p>Form tags:</p> <form>, <input>, <select>, <option>, <button>, <label>, <fieldset>, <textarea>. <p>Scripting tags:</p> <script>, <noscript> Image and Object tags: <img>, <figure>, <figcaption>, <area>, <map>, <object>. Here is an alphabetical list of tags used in HTML.

#html tutorials #html image tags #html link tags #html list tags #html tags #html

smm captain

1650364405

Best Instagram Hashtags for Reels, Giveaways, Travel, Fashion

Pick the right hash tags and enjoy likes and comments on the post.

Making engaging reels about the travels, fashion, fitness, contest, and more, the results are not satisfactory. All you get is a few likes, comments and nothing else. You need the engagement on your post to bring more business to you. How can you bring interaction to the content? Indeed you can buy real instagram likes uk to get high rates. But how can you make the Instagram world hit the likes button under the post? You need to boost the reach. You must present your content to the right audiences to get higher interaction rates. 

Your Instagram #tags are the power tool that works like magic for influencers and businesses. The blue text with # is the magical option that increases the viability of the posts. The Instagram algorithm keeps on changing, and now the engagement on the post is a must to place the content at a higher place in followers’ feed. For this, you require more likes and comments under the post. For this, you must lift the reach by using perfect tags.

Why are hashtags popular on Instagram?

Let me clear it for you. Do you know how many active users this digital handle has? It is about 2B and more, and the count is changing every day. Each of the followers must be posting something on the handles. Thousands of profit must be of a similar niche as yours. If you are the business and running the clothing brands, then many other companies deal with clothes. So, customers or followers have many choices to choose from. Why would they follow you or purchase from your companies?

Your reply must be that you offer quality material at the best rates. But how does anyone finds out about you? Indeed you can buy active instagram followers uk to bring more fans, but how can you boost the reach of your voices. All businesses must represent their product to the right audiences, but how?

Of course, hashtags.

Table of Contents

Not all Hashtags are for you

There are some basic tags that you can use, but if you are more specific about your approach, choose the relevant tags for your business. Your #tags game must be industry oriented. So in this part, you will learn about the famous tags as per various niches. 

Tags for Travel Niche

Indeed this niche is famous on Instagram, and influencers earn handsome amounts. These #tags are best for you if you possess a similar place. Use them smartly and rightly!

#TravelPhotography

#PicOfTheDay

#NaturePhotography

#TravelBlogger

#beautiful

#landscape

#adventure

#explore

#instatravel

#photo

#trip

#summer

#travelgram

#photography

#art

#travel

#wanderlust

#nature

#instagood

#PhotoOfTheDay

Tags for Fashion Industry

After thee travel next most famous niche is fashion. You can earn handsome amount form it. But for this you need to pick the right tags form the following:

  1. #bhfyp
  2. #smile
  3. #OutfitOfTheDay
  4. #FashionPhotography
  5. #FollowBack
  6. #ootd
  7. #FashionBlogger
  8. #WhatIWore
  9. #follow
  10. #fashionista
  11. #PhotoOfTheDay
  12. #StyleInspo
  13. #instastyle
  14. #love
  15. #CurrentlyWearing
  16. #FashionBlog
  17. #ShoppingAddict
  18. #LookGoodFeelGood
  19. #FashionAddict
  20. #FashionStyle
  21. #BeautyDoesntHaveToBePain
  22. #style
  23. #fashion
  24. #FollowForFollowBack
  25. #fashionable
  26. #l
  27. #PicOfTheDay
  28. #fashiongram

Tags for fitness Influencers

So, what to boost your fitness business then uses these tags and enjoys likes:

  1. #exercise
  2. #bodybuilding
  3. #life
  4. #gymlife
  5. #motivation
  6. #healthy
  7. #lifestyle
  8. #health
  9. #gym
  10. #sport
  11. #training
  12. #workout
  13. #HealthyLifestyle
  14. #muscle
  15. #fit
  16. #CrossFit
  17. #fitness
  18. #FitFam
  19. #goals
  20. #PersonalTrainer
  21. #FitnessMotivation

Best Tags for Giveaway

So, are you arranging the giveaway and want a maximum number of people to participate? If so, then it is time to boost the reach vis using these tags

  1. #giveaway
  2. #sweepstakes
  3. #WinItWednesday
  4. #freebie
  5. #ContestAlert
  6. #ContestEntry
  7. #instacontest
  8. #instagiveaway
  9. #WinIt
  10. #contest
  11. #GiveawayAlert
  12. #giveaway

The popular #tags for Reels

Are you the reels queen, or do you want to become the one? Then these below mentioned tags are for you. But don’t go for all of them because you can use only thirty of them. Pick it smartly!

  1. #ReelsInstagram
  2. #VideoOfTheDay
  3. #ReelsIndia
  4. #ReelSteady
  5. #disney
  6. #ForYouPage
  7. #InstagramReels
  8. #bhfyp
  9. #instareels
  10. #reelsinsta
  11. #fyp
  12. #ReelsOfInstagram
  13. #TikTokIndia
  14. #HolaReels
  15. #reels
  16. #ReelsBrasil
  17. #k
  18. #ReelsVideo
  19. #instareel
  20. #music

#tags for foodie

Do you love to eat and what to share your experience with another foodie on Instagram? If you are visiting any cafe, then before uploading, always add one of the following tags!

  1. #instafood
  2. #FoodBlogger
  3. #lunch
  4. #PicOfTheDay
  5. #instadaily
  6. #FoodPhotography
  7. #PhotoOfTheDay
  8. #food
  9. #healthy
  10. #foodie
  11. #FoodLover
  12. #bhfyp
  13. #instagood
  14. #tasty
  15. #delicious
  16. #foodstagram
  17. #homemade
  18. #cooking
  19. #FoodPorn
  20. #love
  21. #foodgasm
  22. #foodies
  23. #HealthyFood
  24. #dinner
  25. #yummy
  26. #restaurant

How to Pick the proper tags or find the best one for you?

There is a long list of each niche, and you can use all of them. If you are confused about what to pick and whatnot, here is the guide to choosing the perfect tag.

  1. Use the search function. Just mentions a keyword applicable to your content and choose the Tags tab. This handle will then provide you with a hashtags list. Search for relevant #tags with fair usage ( 50K)
  2. Use the tags that others use in your sector.

Study your competition. Review their post and study the tags they are using.

Ava Watson

Ava Watson

1595318322

Know Everything About HTML With HTML Experts

HTML stands for a hypertext markup language. For the designs to be displayed in web browser HTML is the markup language. Technologies like Cascading style sheets (CSS) and scripting languages such as JavaScript assist HTML. With the help of HTML websites and the web, designs are created. Html has a wide range of academic applications. HTML has a series of elements. HTML helps to display web content. Its elements tell the web how to display the contents.

The document component of HTML is known as an HTML element. HTML element helps in displaying the web pages. An HTML document is a mixture of text nodes and HTML elements.

Basics of HTML are-

The simple fundamental components oh HTML is

  1. Head- the setup information for the program and web pages is carried in the head
  2. Body- the actual substance that is to be shown on the web page is carried in the body
  3. HTML- information starts and ends with and labels.
  4. Comments- come up in between

Html versions timeline

  1. HTML was created in 1990. Html is a program that is updated regularly. the timeline for the HTML versions is
  2. HTML 2- November, 1995
  3. HTML 3- January, 1997
  4. HTML 4- December, 1997; April, 1998; December, 1999; May, 2000
  5. HTML 5- October, 2014; November, 2016; December, 2017

HTML draft version timelines are

  1. October 1991
  2. June 1992
  3. November 1992
  4. June 1993
  5. November 1993
  6. November 1994
  7. April 1995
  8. January 2008
  9. HTML 5-
    2011, last call
    2012 candidate recommendation
    2014 proposed recommendation and recommendation

HTML helps in creating web pages. In web pages, there are texts, pictures, colouring schemes, tables, and a variety of other things. HTML allows all these on a web page.
There are a lot of attributes in HTML. It may get difficult to memorize these attributes. HTML is a tricky concept. Sometimes it gets difficult to find a single mistake that doesn’t let the web page function properly.

Many minor things are to be kept in mind in HTML. To complete an HTML assignment, it is always advisable to seek help from online experts. These experts are well trained and acknowledged with the subject. They provide quality content within the prescribed deadline. With several positive reviews, the online expert help for HTML assignment is highly recommended.

#html assignment help #html assignment writing help #online html assignment writing help #html assignment help service online #what is html #about html

Nat  Grady

Nat Grady

1670915040

How to Create a Live Dashboards with Airtable and React

Reporting and visualizing data is crucial to businesses of all sizes. Dashboards allow users to efficiently access and use this data for a range of business operations. In this article, Toptal Full-stack Engineer Dylan Golow demonstrates how he created a powerful dashboard for telemedicine using Airtable, Typeform, and React.

Whether a company is a large enterprise or a budding startup, collecting data from users and customers, and reporting on or visualizing that data is crucial to the business.

I recently worked with a telemedicine startup based in Brazil. Its mission is to provide remote care and monitoring by connecting patients to medical professionals and health coaches. The core need was to create an interface for the coaches and health professionals to easily review a patient’s information and most important metrics related to their particular situation: a dashboard.

Enter Typeform and Airtable.

Typeform

Typeform is one of the go-to data collection tools that enables responsive web experiences for users completing a survey. It also comes with several features that make surveys more intelligent, especially when combined:

  • Logic Jumps
  • Hidden Fields

Surveys can be shared via URLs that can be pre-seeded with values for the hidden fields, which can then be used to implement logic jumps and alter the behavior of the survey for the user with the link.

Airtable Uses

Airtable is a spreadsheet-database hybrid and a collaborative cloud platform. Its focus on point and click functionality means that non-technical users can configure it without coding. Airtable has a multitude of use cases in any business or project.

You can use an Airtable Base for:

  • CRM (Client Relationship Management)
  • HRIS (Human Resources Information System)
  • Project Management
  • Content Planning
  • Event Planning
  • User Feedback

There are many more potential use cases. You can explore Airtable case studies here.

If you are not familiar with Airtable, the conceptual data model breaks down like this:

  • Workspace - Composed of Bases
  • Base - Composed of Tables
  • Table - Composed of Fields (columns) and rows
  • View - A perspective on Table data with optional filters and reduced Fields
  • Field - A column of a Table with a Field Type; see here for more information on Field Types

Apart from providing a cloud-hosted database with familiar spreadsheet features, here are some of the reasons the platform is so powerful:

 

Depiction of technical and non-technical users working with Airtable.

 

For non-technical users, Airtable provides:

  • An easy to use front-end interface
  • Automations that can be created with point-and-click configuration to send emails, process rows of data, schedule appointments in calendars, and more
  • Multiple types of views that allow teams to collaborate on the same Base and tables
  • Airtable Apps that can be installed from the marketplace to supercharge a Base

For developers, Airtable provides:

  • A well-documented back-end API
  • A scripting environment that allows developers to automate actions within a Base
  • Automations that can also trigger custom developed scripts that run within the Airtable environment, extending the capabilities of automations

You can learn more on Airtable here.

Getting Started: Typeform to Airtable

Typeform surveys were already configured by the client, and the next step was to plan how that data would land in Airtable and then be turned into a dashboard. There are many questions to consider when creating dashboards on top of any database: How should we structure the data? What data will need to be processed prior to visualization? Should we sync the Base with Google Sheets and use Google Data Studio? Should we export and find another third-party tool?

Fortunately for developers, not only does Airtable provide automations and scripting to handle the data processing steps, but it has also made it possible to build custom applications and interfaces on top of an Airtable Base with Airtable Apps.

Custom Apps in Airtable

Custom Apps in Airtable have been around since the Airtable Blocks SDK was released at the beginning of 2018, and were recently renamed to Apps. The release of Blocks was huge in that it meant that creators now had the ability to develop, as Airtable puts it, “An infinitely recombinable Lego kit.”

More recently with the change to apps, the Airtable Marketplace made it possible to share apps publicly, as well.

Airtable Apps provide businesses with an infinitely recombinable Lego kit they can tailor to their needs.

In order to build a custom app in Airtable, a JavaScript developer must know how to use React, one of the most popular JavaScript libraries for building user interfaces. Airtable provides a component library of functional React components and hooks, which are a huge help for rapidly building a consistent UI and determining how you will manage state within the app and its components.

Check out Airtable’s Getting Started article for more information and Airtable on GitHub for examples of apps.

Airtable Dashboard Requirements

After reviewing the dashboard mockups with the client team, the types of data to be used were clear. We would need a series of dashboard components that would display as text on the dashboard and charts of different metrics that could be tracked over time.

Coaches and medical professionals needed to be able to build a custom dashboard for each patient, so we needed a flexible way to add and remove charts. Other static data relative to each patient would be displayed no matter the patient selected.

In this case, the dashboard sections boiled down to:

  • General Information - Patient Name, Email, Phone Number, Contact Preference, Date of Birth, Age
  • Objectives - Goals the patient has based on survey results
  • Some Stats - BMI, Height, and Weight
  • Medicine Use - Listing all prescription drugs already used by a patient
  • Family History of Conditions - Helpful in diagnosing certain conditions
  • Charts - A section where the Airtable dashboard user could add a chart and configure which metric it would visualize over time

 

Image showing an Airtable Dashboard mockup.

 

One way to approach all of the sections except for charts would be to hard-code all the columns for objectives, medicine use, and family history into the dashboard. However, that would not allow the client team to add new questions to a Typeform survey nor add a new column to an Airtable table to present that data on the dashboard without having a developer update the custom app.

A more elegant and extensible solution to this challenge was finding a way to tag columns as relevant to a particular dashboard section and retrieve those columns using the metadata that Airtable exposes when using the Table and Field models.

This was achieved using Field Descriptions as a place to tag a column from the Table as relevant to a dashboard section to be displayed to the user. Then, we could ensure only those with the Creator role (the administrators) for the Base had the ability to modify these Field Descriptions to alter what appears on the dashboard. To illustrate this solution, we will focus mostly on the items in General Information and how to present Charts.

Creating a #TAG# System

Given the dashboard sections, it made sense to make reusable tags for some sections and specific tags for certain columns. For items like patient name, email, and phone number, #NAME#, #EMAIL#, and #PHONE# were added to each Field’s description, respectively. That would allow that information to be retrieved via the Table metadata like this:

const name = table ? table.fields.filter(field => field.description?.includes("#NAME#"))

For areas of the dashboard that would need to draw from many tagged columns we would have the following tags for each dashboard section:

  • OBJ - Objectives
  • FAM - Family History
  • MED - Medicine Usage
  • CAN - Family History specific to cancer
  • CHART - Any column that should be sourced for adding charts; must be a quantity

In addition, it was important to separate the name of a column in a Table from the label it would receive on the dashboard, so anything that received a #TAG# would also have the ability to receive two #LABEL# tags in its Field Description. A Field Description would look like this:

 

Screenshot showcasing the use of tags in a field description.

 

In case the #LABEL# tags are missing, we will display the column name from the Table.

We can parse out the label set in the description with a simple function like this after retrieving the field with the previous code example:

// utils.js

export const setLabel = (field, labelTag = "#LABEL#") => {
   const labelTags = (field.description?.match(new RegExp(labelTag, "g")) || []).length;
   let label;
   if (labelTags === 2) label = field.description?.split(`${labelTag}`)[1];
   if (!label || label?.trim() === '') label = field.name;
   return {...field, label, name: field.name, description: field.description};
}

With this #TAG# system, we achieve three main things:

  • Column names (fields) in the Table can be changed as desired.
  • Labels for data in the dashboard can be distinct from column names.
  • Dashboard sections for Objectives, Medicine Usage, Family History, and Charts can be updated by the client team without touching a line of code.

Persisting State in Airtable

In React, we use state and pass it to components as props in order to re-render that component if its state changes. Normally this is tied to an API call that fuels a dashboard component, but in Airtable we already have all the data and simply need to filter what we are displaying based on which patient we are viewing. In addition, if we use state, it will not persist the data past a refresh in the dashboard itself.

So, how can we persist a value past refresh to keep a dashboard filtered? Fortunately, Airtable provides a hook for this called useGlobalConfig in which it maintains a key-value store for an app installation on a dashboard. We simply need to implement the logic of retrieving values from this key-value store when the app loads to fuel our dashboard components.

What is even more useful about using the useGlobalConfig hook is that when its values are set, the dashboard component and its child components re-render, so you can use the Global Config like you would use a state variable in a typical React implementation.

Introducing Charts

Airtable provides examples of charts with its Simple Chart App, which uses React Charts, a React wrapper on Chart.js (chart-ception).

In the Simple Chart App, we have one chart for the whole app, but in our Dashboard App, we need the ability for the user to add and remove their own charts from their own dashboard. What’s more, in discussion with the client team, it seems that certain metrics would be better viewed on the same chart (like readings for diastolic and systolic blood pressure).

With this we have the following items to tackle:

  • Persisting state for each user’s chart (or even better using Global Config)
  • Allowing multiple metrics per chart

This is where the power of the Global Config comes in handy, as we can use the key-value store to maintain the selected metrics and anything else about our list of charts. As we configure a chart in the UI, the chart component itself will be re-rendered due to updates to the Global Config. For the charting section of the dashboard, here is a gist with the components for reference, focusing on dashboard charts.js and single chart.js.

The table passed to each chart is what is used for its metadata to find the fields, whereas the records passed have already been filtered by the patient selected at the top-level dashboard component that imports dashboard_charts/index.js.

Note that the fields listed as options in the dropdown for a chart are pulled using the #CHART# tag we mentioned before, with this line in a useEffect hook:

// single_chart/index.js

…
useEffect(() => {
  (async () => {

...

    if (table) {
      const tempFieldOptions = table.fields.filter(field =>    
        field.description?.includes('#CHART#')).map(field => {
          return {
            ...setLabel(field),
            value: field.id
          }
       });
       setFieldSelectOptions([...tempFieldOptions]);
    }
  })();
}, [table, records, fields]);


...

The code above shows how the setLabel function referenced earlier is used with the #TAG# to add anything provided in the #LABEL# tags and display it for the option in the field dropdown.

Our chart component takes advantage of the multi-axis capabilities provided by Chart.js, which is shown with React Charts. We just extended it via the UI with the user’s ability to add a dataset and a chart type (line or bar).

The key to using Global Config, in this case, is to know that each key can only hold a string | boolean | number | null | GlobalConfigArray | GlobalConfigObject (see Global Config Value reference).

We have the following items to maintain per chart:

  • chartTitle which is autogenerated and can be renamed by the user
  • fields array in which each item has:
    • field as fieldId from Airtable
    • chartOption as one line | bar as the Chart.js docs indicate
    • color as the Airtable color from the colorUtils
    • hex as the hex code relating to the Airtable color

To manage this, I found it most convenient to stringify this data as an object instead of setting Global Config keys and values all the way down. See the example below (globalConfig.json in the gist), which includes Global Config values to filter records by the patient and some related variables used to support a typeahead filtering component (thanks to react-bootstrap-typeahead):

{
 "xCharts": {
   "chart-1605425876029": "{\"fields\":[{\"field\":\"fldxLfpjdmYeDOhXT\",\"chartOption\":\"line\",\"color\":\"blueBright\",\"hex\":\"#2d7ff9\"},{\"field\":\"fldqwG8iFazZD5CLH\",\"chartOption\":\"line\",\"color\":\"blueLight1\",\"hex\":\"#9cc7ff\"}],\"chartTitle\":\"Gráfico criado em 11/15/2020, 2:37:56 AM\"}",
   "chart-1605425876288": "{\"fields\":[{\"field\":\"fldGJZIdRlq3V3cKu\",\"chartOption\":\"line\",\"color\":\"blue\",\"hex\":\"#1283da\"}],\"chartTitle\":\"Gráfico criado em 11/15/2020, 2:37:56 AM\"}",
   "chart-1605425876615": "{\"fields\":[{\"field\":\"fld1AnNcfvXm8DiNs\",\"chartOption\":\"line\",\"color\":\"blueLight1\",\"hex\":\"#9cc7ff\"},{\"field\":\"fldryX5N6vUYWbdzy\",\"chartOption\":\"line\",\"color\":\"blueDark1\",\"hex\":\"#2750ae\"}],\"chartTitle\":\"Gráfico criado em 11/15/2020, 2:37:56 AM\"}",
   "chart-1605425994036": "{\"fields\":[{\"field\":\"fld9ak8Ja6DPweMdJ\",\"chartOption\":\"line\",\"color\":\"blueLight2\",\"hex\":\"#cfdfff\"},{\"field\":\"fldxVgXdZSECMVEj6\",\"chartOption\":\"line\",\"color\":\"blue\",\"hex\":\"#1283da\"}],\"chartTitle\":\"Gráfico criado em 11/15/2020, 2:39:54 AM\"}",
   "chart-1605430015978": "{\"fields\":[{\"field\":\"fldwdMJkmEGFFSqMy\",\"chartOption\":\"line\",\"color\":\"blue\",\"hex\":\"#1283da\"},{\"field\":\"fldqwG8iFazZD5CLH\",\"chartOption\":\"line\",\"color\":\"blueLight1\",\"hex\":\"#9cc7ff\"}],\"chartTitle\":\"New Chart\"}",
   "chart-1605430916029": "{\"fields\":[{\"field\":\"fldCuf3I2V027YAWL\",\"chartOption\":\"line\",\"color\":\"blueLight1\",\"hex\":\"#9cc7ff\"},{\"field\":\"fldBJjtRkWUTuUf60\",\"chartOption\":\"line\",\"color\":\"blueDark1\",\"hex\":\"#2750ae\"}],\"chartTitle\":\"Gráfico criado em 11/15/2020, 4:01:56 AM\"}",
   "chart-1605431704374": "{\"fields\":[{\"field\":\"fld7oBtl3iiHNHqoJ\",\"chartOption\":\"line\",\"color\":\"blue\",\"hex\":\"#1283da\"}],\"chartTitle\":\"Gráfico criado em 11/15/2020, 4:15:04 AM\"}"
 },
 "xPatientEmail": "elle@gmail.com",
 "xTypeaheadValue": "Elle Gold (elle@gmail.com)",
 "xSelectedValue": "[{\"label\":\"Elle Gold (elle@gmail.com)\",\"id\":\"elle@gmail.com\",\"name\":\"Elle Gold\",\"email\":\"elle@gmail.com\"}]"
}

Note: All data contained above, and the data included in the animations below, are not real patient data.

Here’s a look at the final result:

 

Animated display of Airtable dashboard UI.

 

What About the Typeahead?

In order to filter by patient, we needed a way to select a patient and then filter the records based on this patient. In this section, we review how this was achieved.

For the typeahead, react-bootstrap-typeahead was an easy choice, as the only steps left were preparing the options for the typeahead, mixing it with an Airtable input for styling and loading bootstrap, and some other styles for our menu. Dropping components from your favorite component libraries into an Airtable app is not as straightforward as in typical React web development; however, there are only a few extra steps to get everything to look the way you would expect.

Here is the final result:

 

Animated GIF showcasing the filter-by-patient functionality.

 

To render the Airtable input and keep all our styles consistent, react-bootstrap-typeahead comes with a renderInput prop. See more on how to modify the rendering of the component here.

For the bootstrap styles and to override our menu items, the following two utils were used from Airtable:

See frontend.js in the gist for an excerpt of the typeahead implementation.

This line was used to load bootstrap globally:

// frontend/index.js

loadCSSFromURLAsync('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');

You will notice some added logic for things like handling style changes on hover or restyling links (<a></a>) to get the familiar bootstrap look and feel. This also includes the handling of setting the Global Config values for the typeahead and filtering of records so that if a user leaves their dashboard, refreshes their page, or would like to share this dashboard with others, the app persists the selected patient in the Dashboard App. This also allows the users to install multiple copies of this same app side by side in the same Airtable Dashboard with different patients selected or with different charts.

Keep in mind that a dashboard in Airtable is also available to all users of the Base, so these custom app installations on a dashboard will be filtered to the same patients and charts no matter which users are looking at the dashboard at the same time.

Let’s recap what we’ve covered for far:

  1. Airtable allows both non-technical users and technical users to collaborate in Airtable.
  2. Typeform comes with an Airtable integration that allows non-technical users to map Typeform results to Airtable.
  3. Airtable Apps provide a powerful way to supercharge its Airtable Base, whether selecting from the marketplace or building a custom app.
  4. Developers can extend Airtable rapidly in nearly any way imaginable with these apps. Our example above took only three weeks to design and implement (with enormous help from existing libraries, of course).
  5. A #TAG# system can be used to modify the dashboard without requiring code changes by developers. There are better and worse use cases for this. Be sure to limit permissions to the Creator role if using this strategy.
  6. Using Global Config allows developers to persist data within an app installation. Mix this into your state management strategy to seed data for your components.
  7. Don’t expect to drag and drop components from other libraries and projects directly into your Airtable App. Styles can be loaded using the loadCSSFromString and loadCSSFromURLAsync utils provided by Airtable.

Future-proofing

Use a more sophisticated middleware

With Typeform and Airtable, it’s easy and cost-effective to configure the mapping of questions to columns.

However, there is one big drawback: If you have a survey of more than 100 questions mapped to Airtable and you need to modify a mapping, you must delete the entire mapping and start again. This is clearly not ideal, but for a free integration, we can deal with this.

Other options would be having a Zapier (or similar) integration manage the data between Typeform and Airtable.Then you could modify the mapping of any question to any column without starting from scratch. This would have its own cost considerations to factor in as well.

Hopefully, some of the lessons learned and communicated here will help others who are looking to build solutions with Airtable.

Finally, you can check out the gist with the files discussed in this article.

Original article source at: https://www.toptal.com/

#react #dashboards 

Alisha  Larkin

Alisha Larkin

1617789060

HTML Tutorial For Beginners

The prospect of learning HTML can seem confusing at first: where to begin, what to learn, the best ways to learn — it can be difficult to get started. In this article, we’ll explore the best ways for learning HTML to assist you on your programming journey.

What is HTML?

Hypertext Markup Language (HTML) is the standard markup language for documents meant to be displayed in a web browser. Along with Cascading Style Sheets (CSS) and JavaScript, HTML completes the trio of essential tools used in creating modern web documents.

HTML provides the structure of a webpage, from the header and footer sections to paragraphs of text, videos, and images. CSS allows you to set the visual properties of different HTML elements, like changing colors, setting the order of blocks on the screen, and defining which elements to display. JavaScript automates changes to HTML and CSS, for example, making the font larger in a paragraph when a user clicks a button on the page.

#html #html-css #html-fundamentals #learning-html #html-css-basics #html-templates