Difference between revisions of "User:Fbstj/test/graph"

From The Coppermind
Jump to navigation Jump to search
(Created page with "with the Article Statistics as of 2019-07-27 <graph mode=interactive> { "version": 2, "width": 500, "height": 500, "data": [ { "name": "table", "value...")
 
m (test)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
with the Article Statistics as of 2019-07-27
+
with the Article Statistics as of 2019-08-20
   
<graph mode=interactive>
+
<graph>
 
{
 
{
 
"version": 2,
 
"version": 2,
"width": 500,
+
"width": 300,
"height": 500,
+
"height": 300,
 
"data": [
 
"data": [
 
{
 
{
"name": "table",
+
"name": "X",
"values": [1351,683,836,230],
+
"values": [
"transform": [{"type": "pie","field": "data"}]
+
{"count":182, "label":"Stubs", "color":"gray" },
  +
{"count":843, "label":"Middling", "color":"blue" },
  +
{"count":703, "label":"Reviewing", "color":"orange" },
  +
{"count":1391, "label":"Complete", "color":"green" },
  +
],
  +
"transform": [{"type": "pie","field": "count"}]
 
}
 
}
 
],
 
],
Line 17: Line 22:
 
"name": "r",
 
"name": "r",
 
"type": "sqrt",
 
"type": "sqrt",
"domain": {"data": "table","field": "data"},
+
"domain": {"data": "X","field": "count"},
 
"range": [20,300]
 
"range": [20,300]
 
}
 
}
Line 24: Line 29:
 
{
 
{
 
"type": "arc",
 
"type": "arc",
"from": {"data": "table"},
+
"from": {"data": "X"},
 
"properties": {
 
"properties": {
 
"enter": {
 
"enter": {
Line 31: Line 36:
 
"startAngle": {"field": "layout_start"},
 
"startAngle": {"field": "layout_start"},
 
"endAngle": {"field": "layout_end"},
 
"endAngle": {"field": "layout_end"},
"innerRadius": {"value": 20},
+
"innerRadius": {"value": 0},
"outerRadius": {"scale": "r","field": "data"},
+
"outerRadius": {"field":"count", "scale": "r"},
"stroke": {"value": "#fff"}
+
"stroke": {"value": "white"},
 
"fill": {"field": "color"}
 
},
 
},
"update": {"fill": {"value": "{{{1|#ccc}}}"} },
 
"hover": {"fill": {"value": "pink"} }
 
 
}
 
}
 
},
 
},
 
{
 
{
 
"type": "text",
 
"type": "text",
"from": {"data": "table"},
+
"from": {"data": "X"},
 
"properties": {
 
"properties": {
 
"enter": {
 
"enter": {
 
"x": {"field": {"group": "width"},"mult": 0.5},
 
"x": {"field": {"group": "width"},"mult": 0.5},
 
"y": {"field": {"group": "height"},"mult": 0.5},
 
"y": {"field": {"group": "height"},"mult": 0.5},
"radius": {"scale": "r","field": "data","offset": 8},
+
"radius": {"field": "count", "scale": "r","offset": -50},
 
"theta": {"field": "layout_mid"},
 
"theta": {"field": "layout_mid"},
"fill": {"value": "#000"},
+
"fill": {"value": "white"},
 
"align": {"value": "center"},
 
"align": {"value": "center"},
 
"baseline": {"value": "middle"},
 
"baseline": {"value": "middle"},
"text": {"field": "data"}
+
"text": {"field": "label"}, "fontWeight":{"value": "bold",}
  +
}
  +
}
  +
}
  +
]
  +
}
  +
</graph>
  +
  +
  +
<graph>
  +
{
  +
"version": 2,
  +
"data": [
  +
{
  +
"name": "X",
  +
"values": [
  +
{"count":182, "label":"Stubs", "color":"gray" },
  +
{"count":843, "label":"Partial", "color":"blue" },
  +
{"count":703, "label":"Unreviewed", "color":"orange" },
  +
{"count":1391, "label":"Complete", "color":"green" },
  +
],
  +
"transform": [{"type": "pie","field": "count"}]
  +
}
  +
],
  +
"marks": [
  +
{
  +
"type": "arc",
  +
"from": {"data": "X"},
  +
"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": 400},
  +
"stroke": {"value": "white"},
  +
"fill": {"field": "color"}
  +
},
  +
}
  +
},
  +
{
  +
"type": "text",
  +
"from": {"data": "X"},
  +
"properties": {
  +
"enter": {
  +
"x": {"field": {"group": "width" },"mult": 0.5},
  +
"y": {"field": {"group": "height"},"mult": 0.5},
  +
"radius": {"value": "300"},
  +
"theta": {"field": "layout_mid"},
 
"fill": {"value": "white"},
  +
"align": {"value": "center"},
  +
"baseline": {"value": "middle"},
  +
"text": {"field": "label"}, "fontWeight":{"value": "bold"}, "fontSize": {"value":"30"}
 
}
 
}
 
}
 
}

Latest revision as of 20:16, 20 August 2019

with the Article Statistics as of 2019-08-20

<graph> {

 "version": 2,
 "width": 300,
 "height": 300,
 "data": [
   {
     "name": "X",
     "values": [

{"count":182, "label":"Stubs", "color":"gray" }, {"count":843, "label":"Middling", "color":"blue" }, {"count":703, "label":"Reviewing", "color":"orange" }, {"count":1391, "label":"Complete", "color":"green" }, ],

     "transform": [{"type": "pie","field": "count"}]
   }
 ],
 "scales": [
   {
     "name": "r",
     "type": "sqrt",
     "domain": {"data": "X","field": "count"},
     "range": [20,300]
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {"data": "X"},
     "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": {"field":"count", "scale": "r"},
         "stroke": {"value": "white"},
         "fill": {"field": "color"}
       },
     }
   },
   {
     "type": "text",
     "from": {"data": "X"},
     "properties": {
       "enter": {
         "x": {"field": {"group": "width"},"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "radius": {"field": "count", "scale": "r","offset": -50},
         "theta": {"field": "layout_mid"},
         "fill": {"value": "white"},
         "align": {"value": "center"},
         "baseline": {"value": "middle"},
         "text": {"field": "label"}, "fontWeight":{"value": "bold",}
       }
     }
   }
 ]

} </graph>


<graph> {

 "version": 2,
 "data": [
   {
     "name": "X",
     "values": [

{"count":182, "label":"Stubs", "color":"gray" }, {"count":843, "label":"Partial", "color":"blue" }, {"count":703, "label":"Unreviewed", "color":"orange" }, {"count":1391, "label":"Complete", "color":"green" }, ],

     "transform": [{"type": "pie","field": "count"}]
   }
 ],
 "marks": [
   {
     "type": "arc",
     "from": {"data": "X"},
     "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": 400},
         "stroke": {"value": "white"},
         "fill": {"field": "color"}
       },
     }
   },
   {
     "type": "text",
     "from": {"data": "X"},
     "properties": {
       "enter": {
         "x": {"field": {"group": "width" },"mult": 0.5},
         "y": {"field": {"group": "height"},"mult": 0.5},
         "radius": {"value": "300"},
         "theta": {"field": "layout_mid"},
         "fill": {"value": "white"},
         "align": {"value": "center"},
         "baseline": {"value": "middle"},
         "text": {"field": "label"}, "fontWeight":{"value": "bold"}, "fontSize": {"value":"30"}
       }
     }
   }
 ]

} </graph>