Template:Articles by Quality Pie Graph/doc

From Podpedia

Usage[edit source]

This template will display a pie chart of your quality assessment data, that belong to a particular WikiProject. The syntax is as follows:

{{AbQ Pie
 |topic=
 |full=
 |unassessed-show=
 |FA=
 |A=
 |GA=
 |B=
 |C=
 |Start=
 |Stub=
 |FL=
 |List=
 |Unassessed=
}}

Parameters[edit source]

  • |topic= (required) - set so that the quality categories are: "Foo-Class topic articles".
  • |full= (optional) - if set to yes it will show full legend. By default, only the categories with articles show in the legend.
  • |unassessed-show= (optional) - if set to yes it will show unassessed articles.
  • |FA=, |A=, |GA=, |B=, |C=, |Start=, |Stub=, |FL=, |List=, |Unassessed= (optional) - if set to a standard or HTML5 web color it will change the appropriate rating. By default, they are set to the standard rating colors.

Examples[edit source]

Basic[edit source]

{{AbQ Pie|topic=Cheeses}}

will result in:

<graph> {

 "version": 2,
 "axes": [],
 "data": [
   {
     "name": "table",
     "values": [
 
      
 









     ]
   }
 ],
 "height": 250,
 "legends": [
   {
     "fill": "color",
     "offset": 20,
     "properties": {},
     "title": "Article Rating"
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {
       "data": "table",
       "transform": [{"type": "pie","field": "val"}]
     },
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "startAngle": {"field": "layout_start"},
         "endAngle": {"field": "layout_end"},
         "fill": {"field": "idx","scale": "color"},
         "innerRadius": {"value": 0},
         "outerRadius": {"value": 125},
         "stroke": {"value": "white"}
       }
     }
   }
 ],
 "padding": "auto",
 "scales": [
   {
     "domain": {"data": "table", "field": "idx"},
     "name": "color",
     "type": "ordinal",
     "range": [
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                   ]
   }
 ],
 "width": 300

} </graph>

Full Legend[edit source]

By using the |full= with yes, you can show the entire legend - even if there are no articles in the categories.

{{AbQ Pie|topic=Cheeses|full=yes}}

will result in:

<graph> {

 "version": 2,
 "axes": [],
 "data": [
   {
     "name": "table",
     "values": [

{ "col": "data", "idx": "★ FA: 0", "val": 0 },

{ "col": "data", "idx": "A-class: 0", "val": 0 },

{ "col": "data", "idx": "GA: 0", "val": 0 },

{ "col": "data", "idx": "B-class: 0", "val": 0 },

{ "col": "data", "idx": "C-class: 0", "val": 0 },

{ "col": "data", "idx": "Start: 0", "val": 0 },

{ "col": "data", "idx": "Stub: 0", "val": 0 },

{ "col": "data", "idx": "★ FL: 0", "val": 0 },

{ "col": "data", "idx": "List: 0", "val": 0 },


     ]
   }
 ],
 "height": 250,
 "legends": [
   {
     "fill": "color",
     "offset": 20,
     "properties": {},
     "title": "Article Rating"
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {
       "data": "table",
       "transform": [{"type": "pie","field": "val"}]
     },
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "startAngle": {"field": "layout_start"},
         "endAngle": {"field": "layout_end"},
         "fill": {"field": "idx","scale": "color"},
         "innerRadius": {"value": 0},
         "outerRadius": {"value": 125},
         "stroke": {"value": "white"}
       }
     }
   }
 ],
 "padding": "auto",
 "scales": [
   {
     "domain": {"data": "table", "field": "idx"},
     "name": "color",
     "type": "ordinal",
     "range": [
                       "#6699FF",
                       "#66FFFF",
                       "#66FF66",
                       "#B2FF66",
                       "#FFFF66",
                       "#FFAA66",
                       "#FF6666",
                       "#6699FF",
                       "#AA88FF",
                       
                   ]
   }
 ],
 "width": 300

} </graph>

Unassessed Articles[edit source]

By using the |unassessed-show= with yes, you can visualise the unassessed articles with the other categories.

{{AbQ Pie|topic=AFC|unassessed-show=yes}}

will result in:

<graph> {

 "version": 2,
 "axes": [],
 "data": [
   {
     "name": "table",
     "values": [
 
      
 









     ]
   }
 ],
 "height": 250,
 "legends": [
   {
     "fill": "color",
     "offset": 20,
     "properties": {},
     "title": "Article Rating"
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {
       "data": "table",
       "transform": [{"type": "pie","field": "val"}]
     },
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "startAngle": {"field": "layout_start"},
         "endAngle": {"field": "layout_end"},
         "fill": {"field": "idx","scale": "color"},
         "innerRadius": {"value": 0},
         "outerRadius": {"value": 125},
         "stroke": {"value": "white"}
       }
     }
   }
 ],
 "padding": "auto",
 "scales": [
   {
     "domain": {"data": "table", "field": "idx"},
     "name": "color",
     "type": "ordinal",
     "range": [
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                   ]
   }
 ],
 "width": 300

} </graph>

Different Colours[edit source]

By using the |FA=, |A=, |GA=, |B=, |C=, |Start=, |Stub=, |FL=, |List= or |Unassessed= with a web color, you can change the chart color.

{{AbQ Pie|topic=AFC|Start=black|Stub=#FFC0CB|C=#c5405b}}

will result in:

<graph> {

 "version": 2,
 "axes": [],
 "data": [
   {
     "name": "table",
     "values": [
 
      
 









     ]
   }
 ],
 "height": 250,
 "legends": [
   {
     "fill": "color",
     "offset": 20,
     "properties": {},
     "title": "Article Rating"
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {
       "data": "table",
       "transform": [{"type": "pie","field": "val"}]
     },
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "startAngle": {"field": "layout_start"},
         "endAngle": {"field": "layout_end"},
         "fill": {"field": "idx","scale": "color"},
         "innerRadius": {"value": 0},
         "outerRadius": {"value": 125},
         "stroke": {"value": "white"}
       }
     }
   }
 ],
 "padding": "auto",
 "scales": [
   {
     "domain": {"data": "table", "field": "idx"},
     "name": "color",
     "type": "ordinal",
     "range": [
                       
                       
                       
                       
                       
                       
                       
                       
                       
                       
                   ]
   }
 ],
 "width": 300

} </graph>

Acknowledgement[edit source]

This template came from an idea first created by User:Kopiersperre on Version 1.0 Editorial Team's statistics page.

See also[edit source]

Standard class types
Featured article FA  Featured list FL  Featured media FM  A-Class article A 
{{class|FA}} {{class|FL}} {{class|FM}} {{class|A}}
 GA  B-Class article B  C-Class article C  Start-Class article Start 
{{class|GA}} {{class|B}} {{class|C}} {{class|Start}}
Stub-Class article Stub   List   NA   ??? 
{{class|Stub}} {{class|List}} {{class|NA}} {{class|Unassessed}}
Non-standard class types
Bplus-Class article Bplus  Current-Class article Current  Future-Class article Future  SIA-Class article SIA 
{{class|Bplus}} {{class|Current}} {{class|Future}} {{class|SIA}}
A-Class list AL  B-Class list BL  C-Class list CL  Start-Class list SL 
{{class|AL}} {{class|BL}} {{class|CL}} {{class|SL}}
Wikipedia Book Book  Category page Category  Disambiguation page Disambig   Draft 
{{class|Book}} {{class|Category}} {{class|Disambig}} {{class|Draft}}
 File   Merge   Needed   Portal 
{{class|File}} {{class|Merge}} {{class|Needed}} {{class|Portal}}
 Project  Redirect page Redirect   Template   User 
{{class|Project}} {{class|Redirect}} {{class|Template}} {{class|User}}
Importance types
 Top   High   Mid   Low 
{{importance|Top}} {{importance|High}} {{importance|Mid}} {{importance|Low}}
 Bottom   NA   ??? 
{{importance|Bottom}} {{importance|NA}} {{importance|Unknown}}
Class
Importance
Hybrid
Others
Tool to add multiple templates to quality assessment pages