Difference between revisions of "Template:Graph:CategoryPie"

From Public Play Space Community
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
<graph>
<graph>{
{
   "width": 100,
   "width": 400,
   "height": 100,
   "height": 100,
  "padding": {"top": 30, "left": 30, "bottom": 30, "right": 10},
   "data": [
   "data": [
     {
     {
       "name": "aggregate",
       "name": "table",
       "values": [
       "values": [
        {"label": "Category A", "mean": 1, "lo": 0,   "hi": 2},
          {"name":"GAME","color":"#2bddff","data":1},
        {"label": "Category B", "mean": 2, "lo": 1.5, "hi": 2.5},
          {"name":"PLAY","color":"#00d67f","data":1},
        {"label": "Category C", "mean": 3, "lo": 1.7, "hi": 4.3},
          {"name":"SPACE","color":"#0000ff","data":1}
        {"label": "Category D", "mean": 4, "lo": 3,  "hi": 5},
      ],
        {"label": "Category E", "mean": 5, "lo": 4.1, "hi": 5.9}
      "transform": [{"type": "pie", "field": "data"}]
      ]
     }
     }
   ],
   ],
   "scales": [
   "scales": [
     {
     {
       "name": "y",
       "name": "r",
       "type": "ordinal",
       "type": "sqrt",
      "range": "height",
       "domain": {"data": "table", "field": "data"},
       "domain": {"data": "aggregate", "field": "label"}
       "range": [0, 50]
    },
    {
      "name": "x",
      "type": "linear",
      "domain": {"data": "aggregate", "field": "hi"},
       "range": [100, 400],
      "nice": true,
      "zero": true
     }
     }
  ],
  "axes": [
    {"type": "x", "scale": "x", "ticks": 6}
   ],
   ],
   "marks": [
   "marks": [
     {
     {
       "type": "text",
       "type": "arc",
       "from": {"data": "aggregate"},
       "from": {"data": "table"},
       "properties": {
       "properties": {
         "enter": {
         "enter": {
           "x": {"value": 0},
           "x": {"field": {"group": "width"}, "mult": 0.5},
           "y": {"scale": "y", "field": "label"},
           "y": {"field": {"group": "height"}, "mult": 0.5},
           "baseline": {"value": "middle"},
           "startAngle": {"field": "layout_start"},
           "fill": {"value": "#000"},
           "endAngle": {"field": "layout_end"},
           "text": {"field": "label"},
           "innerRadius": {"value": 0},
           "font": {"value": "Helvetica Neue"},
           "outerRadius": {"value": 100}
           "fontSize": {"value": 13}
        },
        "update": {
           "fill": {"field": "color"}
         }
         }
       }
       }
     },
     },
     {
     {
       "type": "rect",
       "type": "text",
       "from": {"data": "aggregate"},
       "from": {"data": "table"},
       "properties": {
       "properties": {
         "enter": {
         "enter": {
           "x": {"scale": "x", "field": "lo"},
           "x": {"field": {"group": "width"}, "mult": 0.5},
           "x2": {"scale": "x", "field": "hi"},
           "y": {"field": {"group": "height"}, "mult": 0.5},
           "y": {"scale": "y", "field": "label", "offset": -1},
           "radius": {"scale": "r", "field": "data", "offset": 8},
           "height": {"value": 1},
           "angle": {"value": 25},
           "fill": {"value": "#888"}
           "theta": {"field": "layout_mid"},
        }
          "fill": {"value": "white"},
      }
          "align": {"value": "center"},
    },
          "baseline": {"value": "middle"},
    {
           "text": {"field": "name"},
      "type": "symbol",
           "font": {"value": "Bebas Neue Bold"},
      "from": {"data": "aggregate"},
           "fontSize": {"value": 25},
      "properties": {
           "fontWeight": {"value": "bold"}
        "enter": {
           "x": {"scale": "x", "field": "mean"},
           "y": {"scale": "y", "field": "label"},
           "size": {"value": 40},
           "fill": {"value": "#000"}
         }
         }
       }
       }
Line 79: Line 62:
}
}
</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