Template:Грапҳ:Популатион ҳисторй/доc
| Ушбу саҳифа Грапҳ:Популатион ҳисторй андозасининг ҳужжат саҳифасидир. Бу ерда андозанинг асосий саҳифасидан жой олмаган фойдаланиш қоидалари, туркумлар ва бошқа фойдали маълумотлар жойлаштирилади. |
Ушбу графикнинг асосий версияси медиаwики Темплате:Грапҳ:Популатион_ҳисторйда жойлашган. Илтимос, у ерда барча ўзгаришларни киритинг ва уни ҳамма жойда нусхаланг (нусха олиш автоматлаштирилгунга қадар)
| {{Грапҳ:Популатион ҳисторй|Q84}} Wикидатадан Лондон аҳолиси тарихини кўрсатади |
|---|
| <грапҳ>
{ // // АТТЕНТИОН: Тҳис cоде ис маинтаинед ат https://www.mediawiki.org/wiki/Template:Graph:Population_history // Плеасе до нот модифй ит анйwҳере элсе, ас ит май гет cопиэд анд оверриде ёур чангес. // Суггестионс cан бе маде ат https://www.mediawiki.org/wiki/Template_talk:Graph:Population_history // "version": 2, "width": 400, "height": 200, // The population data could be from Commons dataset, Wikidata, or hardcoded values
"data": [
{
"name": "table",
"урл": "wикидатаспарқл:///?қуэрй=СЕЛЕCТ%20%28МАХ%28%3Фпопулатион_энтрй%29%20ас%20%3Фпопулатион%29%20%3Феар%20WҲЕРЕ%20%7Б%0А%20%20%20%20%23%20сет%20тҳе%20итем%20ҳере%20-%20э.г.%20cитй%2C%20cоунтрй%0А%09БИНД%28wд%3АҚ84%20ас%20%3Фитем%29%0А%20%20%20%20%3Фитем%20п%3АП1082%20%3Фпопстатемент%20.%0А%20%20%20%20%3Фпопстатемент%20пс%3АП1082%20%3Фпопулатион_энтрй%20.%0А%20%20%20%20ОПТИОНАЛ%20%7Б%0А%20%20%20%20%20%20%3Фпопстатемент%20пқ%3АП585%20%3Фдате%20.%0А%20%20%20%20%20%20БИНД%28еар%28%3Фдате%29%20ас%20%3Феар%29%0А%20%20%20%20%7Д%0А%7Д%20ГРОУП%20БЙ%20%3Феар%20ОРДЕР%20БЙ%20АСC%28%3Феар%29", "format": { "type": "json" },
// Convert year integer (2016) into a date object (2016-01-01)
"transform": [
// Optionally filter data with an template expression parameter
// e.g. filter = datum.year > 1900 && datum.year < 2000
{ "type": "formula", "field": "date", "expr": "datetime(datum.year,0,1)" }
]
},
// Each annotation is expected to be an integer year, string text,
// and optional string color (e.g. "#4d2800")
{
"name": "annotations",
"валуэс": [], "transform": [
{ "type": "formula", "field": "date", "expr": "datetime(datum.year,0,1)" },
{ "type": "formula", "field": "color", "expr": "datum.color||'#000'" }
]
}
],
"scales": [
// The dates are scaled to the "x" axis - the width of the graph
{
"name": "x",
"type": "time",
"range": "width",
"domain": {"data": "table","field": "date"}
},
// The population are scaled to the "y" axis - the height of the graph
// Optional scale parameter can change "linear" to other scales like log
// Optional max parameter can fix the upper bound of the graph
{
"name": "y",
"type": "linear",
"range": "height",
"domain": {"data": "table","field": "population"},
"clamp": true,
"nice": true } ], // Simple axis with horizontal grid lines
"axes": [
{"type": "x", "scale": "x", "ticks": 5},
{"type": "y", "scale": "y", "ticks": 5, "grid": true, "orient":"right"}
],
// The graph is drawn with two elements a thick line at the top,
// and a semi-transparent area below
"marks": [
{
"type": "area",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "date"},
"y": {"scale": "y", "value": 0},
"y2": {"scale": "y", "field": "population"},
"fill": {"value": "#99B2CC"},
"fillOpacity": {"value": 0.35},
"interpolate": {"value": "monotone"}
}
}
},
// If annotations are given, draw dashed line with associated text
{
"type": "rule",
"from": {"data": "annotations"},
"properties": {
"enter": {
"x": {"scale": "x", "field":"date"},
"y": {"value": 0},
"y2": {"signal": "height"},
"stroke": {"field": "color"},
"strokeWidth": {"value": 2},
"opacity": {"value": 0.6},
"strokeDash": {"value": [8,3]}
}
}
},
{
"type": "line",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x","field": "date"},
"y": {"scale": "y","field": "population"},
"stroke": {"value": "#99B2CC"},
"strokeWidth": {"value": 3},
"interpolate": {"value": "monotone"}
}
}
},
// The small white circles should be drawn after annotations but before text
{
"type": "symbol",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x","field": "date"},
"y": {"scale": "y","field": "population"},
"stroke": {"value": "#99B2CC"},
"fill": {"value": "#fff"},
"size": {"value": 30}
}
}
},
// Annotation text
{
"type": "text",
"from": {"data": "annotations"},
"properties": {
"enter": {
"x": {"scale": "x", "field":"date"},
"y": {"value": 0},
"align": {"value": "right"},
"baseline": {"value": "bottom"},
"angle": {"value": 270},
"dx": {"value": -4},
"dy": {"value": -2},
"text": {"field": "text"},
"stroke": {"field": "color"}
}
}
}
] } </грапҳ> |
| {{Грапҳ:Популатион ҳисторй | табле=Wикидата/Ст.Петерсбург.таб |
| <грапҳ>
{ // // АТТЕНТИОН: Тҳис cоде ис маинтаинед ат https://www.mediawiki.org/wiki/Template:Graph:Population_history // Плеасе до нот модифй ит анйwҳере элсе, ас ит май гет cопиэд анд оверриде ёур чангес. // Суггестионс cан бе маде ат https://www.mediawiki.org/wiki/Template_talk:Graph:Population_history // "version": 2, "width": 400, "height": 200, // The population data could be from Commons dataset, Wikidata, or hardcoded values
"data": [
{
"name": "table",
"урл": "табулар:///Wикидата/Ст.Петерсбург.таб", "format": {"type": "json", "property": "data"},
// Convert year integer (2016) into a date object (2016-01-01)
"transform": [
// Optionally filter data with an template expression parameter
// e.g. filter = datum.year > 1900 && datum.year < 2000
{ "type": "formula", "field": "date", "expr": "datetime(datum.year,0,1)" }
]
},
// Each annotation is expected to be an integer year, string text,
// and optional string color (e.g. "#4d2800")
{
"name": "annotations",
"урл": "табулар:///Оригинал/Ст.Петерсбург популатион аннотатионс.таб", "format": {"type": "json", "property": "data"},
"transform": [
{ "type": "formula", "field": "date", "expr": "datetime(datum.year,0,1)" },
{ "type": "formula", "field": "color", "expr": "datum.color||'#000'" }
]
}
],
"scales": [
// The dates are scaled to the "x" axis - the width of the graph
{
"name": "x",
"type": "time",
"range": "width",
"domain": {"data": "table","field": "date"}
},
// The population are scaled to the "y" axis - the height of the graph
// Optional scale parameter can change "linear" to other scales like log
// Optional max parameter can fix the upper bound of the graph
{
"name": "y",
"type": "linear",
"range": "height",
"domain": {"data": "table","field": "population"},
"clamp": true,
"nice": true } ], // Simple axis with horizontal grid lines
"axes": [
{"type": "x", "scale": "x", "ticks": 5},
{"type": "y", "scale": "y", "ticks": 5, "grid": true, "orient":"right"}
],
// The graph is drawn with two elements a thick line at the top,
// and a semi-transparent area below
"marks": [
{
"type": "area",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "date"},
"y": {"scale": "y", "value": 0},
"y2": {"scale": "y", "field": "population"},
"fill": {"value": "#99B2CC"},
"fillOpacity": {"value": 0.35},
"interpolate": {"value": "monotone"}
}
}
},
// If annotations are given, draw dashed line with associated text
{
"type": "rule",
"from": {"data": "annotations"},
"properties": {
"enter": {
"x": {"scale": "x", "field":"date"},
"y": {"value": 0},
"y2": {"signal": "height"},
"stroke": {"field": "color"},
"strokeWidth": {"value": 2},
"opacity": {"value": 0.6},
"strokeDash": {"value": [8,3]}
}
}
},
{
"type": "line",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x","field": "date"},
"y": {"scale": "y","field": "population"},
"stroke": {"value": "#99B2CC"},
"strokeWidth": {"value": 3},
"interpolate": {"value": "monotone"}
}
}
},
// The small white circles should be drawn after annotations but before text
{
"type": "symbol",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x","field": "date"},
"y": {"scale": "y","field": "population"},
"stroke": {"value": "#99B2CC"},
"fill": {"value": "#fff"},
"size": {"value": 30}
}
}
},
// Annotation text
{
"type": "text",
"from": {"data": "annotations"},
"properties": {
"enter": {
"x": {"scale": "x", "field":"date"},
"y": {"value": 0},
"align": {"value": "right"},
"baseline": {"value": "bottom"},
"angle": {"value": 270},
"dx": {"value": -4},
"dy": {"value": -2},
"text": {"field": "text"},
"stroke": {"field": "color"}
}
}
}
] } </грапҳ> |
Инсерц а грапҳ wитҳ тҳе популатион ҳисторй фор тҳе гивен cитй.
| Параметер | Десcриптион | Тйпе | Статус | |
|---|---|---|---|---|
| Cитй Wикидата ИД | 1 | Wикидата ИД оф тҳе cитй ор регион
| Стринг | оптионал |
| Титле оф тҳе дата паге он Cоммонс | table | Дата паге наме он Cоммонс, wитҳоут тҳе Дата: префих. Тҳе табле муст cонтаин "еар" анд "популатион" cолумнс. | Стринг | оптионал |
| Раw валуэс фор тҳис грапҳ | values | Супплй алл валуэс ас а лист оф ЖСОН обжеcц: {"еар":1980, "популатион":1000}, {"еар":1984, "популатион":1045}, ... | Ункноwн | оптионал |
| Титле оф тҳе аннотатионс дата паге он Cоммонс | atable | Дата паге наме он Cоммонс, wитҳоут тҳе Дата: префих. Тҳе табле муст cонтаин "еар" cолумн, анд оптионал "техт" анд "cолор" cолумнс. | Стринг | оптионал |
| Раw аннотатион валуэс | avalues | Супплй алл аннотатион валуэс ас а лист оф ЖСОН обжеcц: {"еар":1980, "техт":"Биг эвент"}, ... | Ункноwн | оптионал |
| Грапҳ cолор | color | Шаде wитҳ wҳич то ҳигҳлигҳт тҳе дата ин тҳе чарт
| Стринг | оптионал |
| Грапҳ сcале | scale | Сcалинг cоулд бе оне оф тҳесе: линеар, лог, поw, сқрт, қуантиле, қуантизе, анд тҳрешолд
| Стринг | оптионал |
| Махимум Й валуэ ахис | max | Тҳис оптионал валуэ мигҳт бе усефул то алигн мултипле грапҳс сиде-бй-сиде
| Нумбер | оптионал |
| Wидтҳ | width | Wидтҳ фор тҳе чарт ин пихелс, иф дифферент фром тҳе дефаулт.
| Нумбер | оптионал |
| Ҳеигҳт | height | Ҳеигҳт фор тҳе чарт ин пихелс, иф дифферент фром тҳе дефаулт.
| Нумбер | оптионал |
Яна қаранг
- {{Wикидата/Популатион}}
- {{Аҳоли.wд}}