Difference between revisions of "Template:Graph:CategoryPie"

From Public Play Space Community
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
<graph>
<graph>{
  "width": 100,
  "height": 100,
  "data": [
    {
      "name": "table",
      "values": [
          {"name":"GAME","color":"#2bddff","data":1},
          {"name":"PLAY","color":"#00d67f","data":1},
          {"name":"SPACE","color":"#0000ff","data":1}
      ],
      "transform": [{"type": "pie", "field": "data"}]
    }
  ],
  "scales": [
    {
      "name": "r",
      "type": "sqrt",
      "domain": {"data": "table", "field": "data"},
      "range": [0, 50]
    }
  ],
  "marks": [
    {
      "type": "arc",
      "from": {"data": "table"},
      "properties": {
        "enter": {
          "x": {"field": {"group": "width"}, "mult": 0.5},
          "y": {"field": {"group": "height"}, "mult": 0.5},
          "startAngle": {"field": "layout_start"},
          "endAngle": {"field": "layout_end"},
          "innerRadius": {"value": 0},
          "outerRadius": {"value": 100}
        },
        "update": {
          "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"}
        }
      }
    }
  ]
}
</graph>
 
<noinclude>
<templatedata>
{
{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"params": {
  "description": "A simple bar chart with embedded data.",
"GAME":{
  "data": {
"type": "boolean",
    "values": [
"default": "1",
      {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
"required": true,
      {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
"suggested": true,
      {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
"description": "State whether this type of parameter is used by the project."},
    ]
"PLAY":{
  },
"type": "boolean",
  "mark": "bar",
"default": "1",
  "encoding": {
"required": true,
    "x": {"field": "a", "type": "ordinal", "axis": {"labelAngle": 0}},
"suggested": true,
    "y": {"field": "b", "type": "quantitative"}
"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>
</graph>
</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