Interested Article - Graph:Количество станций Петербургского метрополитена
keira
- 2020-06-21
- 1
{{ Graph:Количество станций Петербургского метрополитена | ylabel=Количество станций | xlabel=Год }}
График, показывающий рост количества станций Петербургского метрополитена. Станции сгруппированы по линиям. Линии обозначены цветом.
Данные для шаблона находятся на странице (см. внимательно на СО указанной страницы соответствие номеров линий на нынешней схеме и в данных).
Параметр | Описание | Тип | Статус | |
---|---|---|---|---|
width |
width
|
ширина графика
|
Число | предложенный |
height |
height
|
высота графика
|
Число | предложенный |
ylabel |
ylabel
|
без описания
|
Строковый (без форматирования) | необязательный |
xlabel |
xlabel
|
без описания |
Строковый (без форматирования) | необязательный |
<graph>
{
//
// ATTENTION: This code is maintained at https://en.wikipedia.org/wiki/Template:Graph:Saint_Petersburg_Metro_expansion
// Please do not modify it anywhere else, as it may get copied and override your changes.
// Suggestions can be made at https://en.wikipedia.org/wiki/Template_talk:Graph:Saint_Petersburg_Metro_expansion
//
// This graph uses data from https://en.wikipedia.org/wiki/Template:Graph:Saint_Petersburg_Metro_expansion/Data-json
"version": 2,
"width": 800,
"height": 400,
"data": [
{
"name": "table",
"url": "wikiraw://en.wikipedia.org/Template:Graph:Saint_Petersburg Metro expansion/Data-json",
"format": {"type": "json"}
},
{
"name": "stats",
"source": "table",
"transform": [
{ "type": "aggregate", "groupby": ["y"], "summarize": [{"field": "n", "ops": ["sum"]}] },
]
}
],
"scales": [
{
"name": "scale_years",
"type": "linear",
"domain": {"data": "table", "field": "y"},
"range": "width",
"zero": false
},
{
"name": "scale_stations",
"type": "linear",
"domain": {"data": "stats", "field": "sum_n"},
"range": "height"
},
{
"name": "scale_colour",
"type": "ordinal",
"domain": [1,2,3,4,5,6],
"range": [ "#EF161E", "#0000ff", "#008000", "#ffa500", "#540099", "#964b00"]
}
],
"axes": [
{
"type": "x",
"scale": "scale_years",
"title": "Year",
"values": [1955,1965,1975,1985,1995,2005,2015,2025],
"subdivide": 8,
"tickSizeMinor": 4,
"tickSizeEnd": 0,
"format": "d"
},
{
"type": "y",
"scale": "scale_stations",
"title": "Number of stations"
},
{
"type": "y",
"scale": "scale_stations",
"title": "Number of stations",
"orient": "right"
}
],
"marks": [
{
"type": "group",
"from": {
"data": "table",
"transform": [
{"type": "stack","groupby": "y","sortby":"l", "field": "n"},
{"type": "facet","groupby": ["l"]}
]
},
"marks": [
{
"type": "area",
"properties": {
"enter": {
"interpolate": {"value": "linear"},
"x": {"scale": "scale_years","field": "y"},
"y": {"scale": "scale_stations","field": "layout_start"},
"y2": {"scale": "scale_stations","field": "layout_end"},
"fill": {"scale": "scale_colour","field": "l"}
}
}
}
]
}
]
}
</graph>
keira
- 2020-06-21
- 1