Template:Infobox country/doc
Example from en:Canada showing all available parameters:
Code
Canada |
||
|---|---|---|
Canada, geo-political divisions shown.
|
||
| <graph mode="interactive">
{ "width": 250,
"height": 100,
"padding": 0,
"idkey": "properties.code",
"mark": {
"strokeWidth":0.5,
"strokeOpacity":0.5
},
"signals": [
{"name": "country", "init": "CA"},
{"name": "centerLat", "init": "56.130366"},
{"name": "centerLon", "init": "-106.346771"},
{"name": "miniX", "init": {"expr":"155+50+((centerLon)*95/360)-5"} },
{"name": "miniY", "init": {"expr":"60+20+((centerLat)*-40/140)+5"} },
{"name": "tooltip",
"init": {"expr": "{x: 0, y: 0, datum: false }"},
"streams": [
{"type": "@map:mouseout, @map:touchstart", "expr": "{x: 0, y: 0, datum: false }" },
{"type": "@map:mouseover, @map:touchstart", "expr": "{x: eventX(), y: eventY(), datum: eventItem().datum}" }
]
}
],
"data": [
{
"name": "highlights",
"values": [
{
"code": "CA",
"v": "royalblue"
},{
"code": "",
"v": "orangered"
}
],
"default": { "v":"#ccc" }
},{
"name": "mini",
"url": "wikiraw:///Template:Graph:Map/Inner/Worldmap2c-json",
"format": {"type": "topojson", "feature": "collection"},
"transform": [{
"type": "geopath",
"projection": "equirectangular",
"scale": 15,
"translate": [202, 84]
}]
},{
"name": "world",
"url": "wikiraw:///Template:Graph:Map/Inner/Worldmap2c-json",
"format": {"type": "topojson", "feature": "collection"},
"transform": [{
"type": "geopath",
"projection": "equirectangular",
"scale": 125,
"rotate":[{"expr":"(centerLon * -1)-25"},{"expr":"(centerLat * -1) - 6"},0],
"translate": [{"expr":"(width/2)+-20"}, {"expr":"(height/2)+0"}]
},{
"type": "formula",
"field": "my_id",
"expr": "datum.properties.code"
},{
"type": "formula",
"field": "my_name",
"expr": "datum.properties.name"
},{
"type": "formula",
"field": "my_width",
"expr": "length(datum.properties.name)*7+10"
},{
"type": "lookup",
"keys": ["my_id"],
"on": "highlights",
"onKey": "code",
"as": ["zipped"],
"values": ["v"],
"default": {"v": "#ccc"}
}]
},{
"name": "dummyValue",
"values": [{}]
}],
"marks": [
{
"name": "map",
"type": "path",
"from": {"data": "world"},
"properties": {
"enter": {
"fill":{"value": "#ccc"},
"stroke": {"value": "#eee"},
"path": {"field": "layout_path"}
},
"update": {"fill": {"field": "zipped.v"} },
"hover": {"fill": {"value": "lightsteelblue"} }
}
},{
"type": "rect",
"properties": {
"enter": {
"x":{"value":155},
"y":{"value":60},
"width":{"value": 100},
"height":{"value": 45},
"fill":{"value": "#fff"},
"stroke":{"value":"#ccc"}
}
}
},{
"type": "path",
"from": {"data": "mini"},
"properties": {
"enter": {
"stroke": {"value": "#999"},
"strokeWidth":{"value": 0},
"background":{"value": "#fff"},
"path": {"field": "layout_path"}
},
"update": {
"fill": {"value": "#333"},
"strokeWidth":{"value": 0}
}
}
},{
"type": "symbol",
"properties": {
"enter": {
"shape":"circle",
"x": {"signal":"miniX"},
"y": {"signal":"miniY"},
"size": {"value": 40},
"stroke": {"value": "lightsteelblue"},
"fill": {"value": "royalblue"}
}
}
},{
"name": "tooltip",
"type": "group",
"from": {
"data": "dummyValue",
"transform": [
{"type": "filter", "test": "tooltip.datum"},
{"type": "formula", "field": "offsetX", "expr": "5"},
{"type": "formula", "field": "offsetY", "expr": "15"},
{"type": "formula", "field": "lookupCountry", "expr": "tooltip.datum.properties.code"},
{ "type": "lookup", "on": "world", "onKey": "my_id", "keys": ["lookupCountry"], "as": ["mapDataVal"], "default": null }, {"type": "formula", "field": "tipWidth", "expr": "datum.mapDataVal ? datum.mapDataVal.my_width : '90'"},
{"type": "formula", "field": "tipHeight", "expr": "20"},
{"type": "formula", "field": "alignLeft", "expr": "tooltip.x > width - datum.offsetX - datum.tipWidth"},
{"type": "formula", "field": "alignTop", "expr": "tooltip.y > height - datum.offsetY - datum.tipHeight"},
{"type": "formula", "field": "x", "expr": "max(0, tooltip.x + (datum.alignLeft ? -datum.offsetX-datum.tipWidth : datum.offsetX ))"},
{"type": "formula", "field": "y", "expr": "tooltip.y + (datum.alignTop ? -1 : 1) * datum.offsetY"},
{"type": "formula", "field": "name", "expr": "datum.mapDataVal ? datum.mapDataVal.my_name : '?xyz?'"},
]},
"properties": {
"update": {
"x": {"field": "x" }, "y": {"field": "y" },
"width": {"field": "tipWidth" },
"height": {"field": "tipHeight" },
"fill": {"value": "#fff"},
"fillOpacity": {"value": 0.90},
"stroke": {"value": "#aaa"},
"strokeWidth": {"value": 0.5}
} },
"marks": [
{
"type": "text",
"properties": {
"update": {
"x": {"value": 6}, "y": {"value": 14},
"width": {"field": "tipWidth" },
"text": {"template": "{{parent.name}}"},
"font": {"value":"Lucida Console, Monaco, monospace"},
"limit": {"value": "60"},
"fill": {"value": "#666"}
} } },
]}
]
} </graph>Location of Canada
|
||
| National Office | Markham, Ontario | |
| National Assembly | Canada | |
| Statistics: | ||
| Population | ||
| - | UN, 2016[1] | 36,289,822 |
| Bahá'í pop. | ||
| - | Bahá'í source | 30,000 |
| Clusters | 136 | |
| Local Assemblies | 255 | |
| History: Firsts |
||
| - | Local Bahá'í | Edith Magee |
| - | Local Assembly | Dec. 10, 1922, Montreal |
| - | National Assembly | 1925, with United States 1948, independently |
| - | National Convention | April, 1948 |
| How to contact: | ||
| - | Phone | See here |
| - | info [at] ca.bahai.org | |
| - | Address | 7200 Leslie Street Thornhill Ontario L3T 6L8 |
| Official Website | http://www.ca.bahai.org/ | |
{{Infobox Country
|country_name = Canada
|image = Map Canada political-geo.png
|img_caption = Canada, geo-political divisions shown.
|locator = yes
|locator_zoom = 2
|locator_hscroll = -20
|locator_vscroll = 0
|national_office = Markham, Ontario
|national_assembly = Canada
|population_bahai = 30,000
|clusters = 136
|local_assemblies = 255
|first_bahai =
|first_local_believer = [[Edith Magee]]
|first_pioneers =
|first_local_assembly = Dec. 10, 1922, Montreal
|first_national_assembly = 1925, with United States<br>1948, independently
|first_national_convention = April, 1948
|phone = [http://www.ca.bahai.org/main.cfm?SID=118 See here]
|fax =
|email = info [at] ca.bahai.org
|address = 7200 Leslie Street<br>Thornhill Ontario<br>L3T 6L8
|official_site = http://www.ca.bahai.org/
}}
Blank:
{{Infobox Country
|country_name =
|image =
|img_caption =
|locator =
|national_office =
|national_assembly =
|population_bahai =
|population_civil =
|clusters =
|local_assemblies =
|localities =
|first_bahai =
|first_local_believer =
|first_pioneers =
|first_local_assembly =
|first_national_assembly =
|first_national_convention =
|phone =
|fax =
|email =
|address =
|official_site =
}}
