Difference between revisions of "Template:Graph:CategoryPie"

From Public Play Space Community
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
<graph>
<graph>{
{
   "width": 100,
  "$schema": "https://vega.github.io/schema/vega/v4.json",
   "height": 100,
   "width": 200,
   "height": 200,
  "autosize": "fit",
 
   "data": [
   "data": [
     {
     {
       "name": "table",
       "name": "table",
       "values": [
       "values": [
        {"id": "Check1", "field": 1},
          {"name":"GAME","color":"#2bddff","data":1},
        {"id": "Check2", "field": 1},
          {"name":"PLAY","color":"#00d67f","data":1},
        {"id": "Check3", "field": 1}
          {"name":"SPACE","color":"#0000ff","data":1}
      ],
      ],
       "transform": [
       "transform": [{"type": "pie", "field": "data"}]
        {
          "type": "pie",
          "field": "field",
          "startAngle": 0,
          "endAngle": 6.29,
          "sort": true
        }
      ]
     }
     }
   ],
   ],
   "scales": [
   "scales": [
     {
     {
       "name": "color",
       "name": "r",
       "type": "ordinal",
       "type": "sqrt",
       "domain": {"data": "table", "field": "id"},
       "domain": {"data": "table", "field": "data"},
       "range": {"scheme": "category20c"}
       "range": [0, 50]
     }
     }
   ],
   ],
   "marks": [
   "marks": [
     {
     {
       "type": "arc",
       "type": "arc",
       "from": {"data": "table"},
       "from": {"data": "table"},
       "encode": {
       "properties": {
         "enter": {
         "enter": {
           "fill": {"scale": "color", "field": "id"},
          "x": {"field": {"group": "width"}, "mult": 0.5},
           "x": {"signal": "width / 2"},
          "y": {"field": {"group": "height"}, "mult": 0.5},
           "y": {"signal": "height / 2"},
          "startAngle": {"field": "layout_start"},
           "startAngle": {"field": "startAngle"},
          "endAngle": {"field": "layout_end"},
           "endAngle": {"field": "endAngle"},
          "innerRadius": {"value": 0},
           "innerRadius": {"value": 60},
          "outerRadius": {"value": 100}
           "outerRadius": {"signal": "width / 2"},
        },
           "cornerRadius": {"value": 0},
        "update": {
           "tooltip": {"field": "tooltip"}
           "fill": {"field": "color"}
        }
      }
    },
    {
      "type": "text",
      "from": {"data": "table"},
      "properties": {
        "enter": {
           "x": {"field": {"group": "width"}, "mult": 0.5},
           "y": {"field": {"group": "height"}, "mult": 0.5},
           "radius": {"scale": "r", "field": "data", "offset": 8},
          "angle": {"value": 25},
           "theta": {"field": "layout_mid"},
           "fill": {"value": "white"},
           "align": {"value": "center"},
           "baseline": {"value": "middle"},
           "text": {"field": "name"},
          "font": {"value": "Bebas Neue Bold"},
          "fontSize": {"value": 25},
          "fontWeight": {"value": "bold"}
         }
         }
       }
       }
Line 55: Line 61:
   ]
   ]
}
}
</graph>
</graph>
 
<noinclude>
<templatedata>
{
"params": {
"GAME":{
"type": "boolean",
"default": "1",
"required": true,
"suggested": true,
"description": "State whether this type of parameter is used by the project."},
"PLAY":{
"type": "boolean",
"default": "1",
"required": true,
"suggested": true,
"description": "State whether this type of parameter is used by the project."},
"SPACE":{
"type": "boolean",
"default": "1",
"required": true,
"suggested": true,
"description": "State whether this type of parameter is used by the project."}
},
"paramOrder": [
"GAME",
"PLAY",
"SPACE"
],
"description": "Template for selecting a parameter to the pie",
"format": "block"
}
</templatedata>
</noinclude>

Latest revision as of 07:38, 20 May 2020


Template for selecting a parameter to the pie

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
GAMEGAME

State whether this type of parameter is used by the project.

Default
1
Booleanrequired
PLAYPLAY

State whether this type of parameter is used by the project.

Default
1
Booleanrequired
SPACESPACE

State whether this type of parameter is used by the project.

Default
1
Booleanrequired