Difference between revisions of "Template:COVID-19 pandemic interactive maps/India"

From blackwiki
Jump to navigation Jump to search
imported>Timbaaa
(Apply scaling to all marks and map)
imported>Timbaaa
(Syncing from sandbox)
 
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
<div id ="interactive-covid-19-india-map" style="float:{{{float|left}}}">
+
<div id ="interactive-covid-19-india-map" style="margin: 8px;">
 
{{#tag:graph
 
{{#tag:graph
 
|{
 
|{
Line 9: Line 9:
 
   "background": "#edf1f7",
 
   "background": "#edf1f7",
 
   "data": [
 
   "data": [
 +
    {
 +
      "name": "population",
 +
      "url": "wikiraw://en.wikipedia.org/Template:COVID-19 pandemic interactive maps/India/Population by region",
 +
      "format": {
 +
        "type": "csv"
 +
      }
 +
    },
 
     {
 
     {
 
       "name": "highlights",
 
       "name": "highlights",
Line 19: Line 26:
 
       },
 
       },
 
       "transform": [
 
       "transform": [
 +
      {{#if: {{{per-capita|}}}
 +
      | {
 +
          "type": "lookup",
 +
          "on": "population",
 +
          "keys": ["id"],
 +
          "onKey": "id",
 +
          "as": ["population"],
 +
          "default": {}
 +
        },
 
         {
 
         {
 +
          "type": "formula",
 +
          "field": "v",
 +
          "expr": "round((parseFloat(datum[''+dateStamp])/datum.population.Population)*{{{per-capita}}})"
 +
        }
 +
      | {
 
           "type": "formula",
 
           "type": "formula",
 
           "field": "v",
 
           "field": "v",
 
           "expr": "parseFloat(datum[''+dateStamp])"
 
           "expr": "parseFloat(datum[''+dateStamp])"
 
         }
 
         }
       ]
+
       }} ]
 +
       
 
     },
 
     },
 
     {
 
     {
Line 256: Line 278:
 
         },
 
         },
 
         "title": {
 
         "title": {
           "fontSize": {"value": 14}
+
           "fontSize": {"value": {{#expr:{{{scale|1}}}*14}}}
 
         },
 
         },
 
         "legend": {
 
         "legend": {
           "x": {"value": {{#expr:{{{scale|1}}}*350}}},
+
           "x": {"value": {{#expr:{{{scale|1}}}*250}}},
 
           "y": {"value": {{#expr:{{{scale|1}}}*60}}}
 
           "y": {"value": {{#expr:{{{scale|1}}}*60}}}
 
         }
 
         }

Latest revision as of 09:15, 9 August 2020


Template documentation[view] [edit] [history] [purge]

Usage example

{{Template:COVID-19 pandemic interactive maps/India
|data-template = Template:COVID-19 pandemic interactive maps/India/India cases by region
|legend-title = Cases
|domain-upper-value = 5e5
}}

{{Template:COVID-19 pandemic interactive maps/India
|data-template = Template:COVID-19 pandemic interactive maps/India/India deaths by region
|legend-title = Deaths
|color-ramp-type = sqrt
|domain-upper-value = 20000
}}

{{Template:COVID-19 pandemic interactive maps/India
|data-template = Template:COVID-19 pandemic interactive maps/India/India cases by region
|legend-title = Cases per million population
|color-ramp-type = linear
|domain-upper-value = 8000
|per-capita = 1000000
|scale = 0.7
}}

{{Template:COVID-19 pandemic interactive maps/India
|data-template = Template:COVID-19 pandemic interactive maps/India/India deaths by region
|legend-title = Deaths per million population
|color-ramp-type = linear
|domain-upper-value = 250
|per-capita = 1000000
|scale = 0.7
}}

Template parameters

A template for creating interactive data visualizations using maps for COVID-19 pandemic in India

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Region wise datadata-template

Dataset used to set the fill color for regions

Example
Template:COVID-19 pandemic interactive maps/India/India cases by region and Template:COVID-19 pandemic interactive maps/India/India deaths by region
Pagerequired
Titletitle

Title for the graph

Default
Interactive COVID-19 map of India
Stringsuggested
Scaling coefficientscale

A percentage value (as a decimal) to resize the map

Default
1.0
Numberoptional
Color ramp typecolor-ramp-type

Type of color ramping on map. Values can be 'linear','log' and 'sqrt'

Default
linear
Stringoptional
Densityper-capita

Creates per-capita map based on provided base

Example
1000000
Numberoptional
Paddingpadding

no description

Default
12
Numberoptional
Minimum value in domain for map coloringdomain-lower-value

Value at which the coloring will begin

Default
1
Numberoptional
Maximum value in domain for map coloringdomain-upper-value

Value at which the coloring will end

Example
100000
Numberrequired
Beginning of color gradientdomain-lower-color

no description

Default
#FFEDBC
Stringoptional
End of color gradientdomain-upper-color

no description

Default
#F83600
Stringoptional
Legend titlelegend-title

Title for the map legend

Example
Cases
Stringrequired

See also