Vorlage:Graph:Map/Doku
Diese Vorlage dient zur Darstellung von politischen Karten mit farbigen Markierungen mittels der Graph-Erweiterung.
Parameter
{{Wikipedia:Lua/Modul/Graph/de|map}}
Kopiervorlage
{{Graph:Map |basemap = WorldMap-iso2.json |<!-- Afghanistan --> AF = |<!-- Ägypten --> EG = |<!-- Albanien --> AL = |<!-- Algerien --> DZ = |<!-- Andorra --> AD = |<!-- Angola --> AO = |<!-- Antigua und Barbuda --> AG = |<!-- Äquatorialguinea --> GQ = |<!-- Argentinien --> AR = |<!-- Armenien --> AM = |<!-- Aserbaidschan --> AZ = |<!-- Äthiopien --> ET = |<!-- Australien --> AU = |<!-- Bahamas --> BS = |<!-- Bahrain --> BH = |<!-- Bangladesch --> BD = |<!-- Barbados --> BB = |<!-- Belarus --> BY = |<!-- Belgien --> BE = |<!-- Belize --> BZ = |<!-- Benin --> BJ = |<!-- Bhutan --> BT = |<!-- Bolivien --> BO = |<!-- Bosnien und Herzegowina --> BA = |<!-- Botswana --> BW = |<!-- Brasilien --> BR = |<!-- Brunei Darussalam --> BN = |<!-- Bulgarien --> BG = |<!-- Burkina Faso --> BF = |<!-- Burundi --> BI = |<!-- Chile --> CL = |<!-- China, Volksrepublik --> CN = |<!-- Costa Rica --> CR = |<!-- Côte d’Ivoire (Elfenbeinküste) --> CI = |<!-- Dänemark --> DK = |<!-- Deutschland --> DE = |<!-- Dominikanische Republik --> DO = |<!-- Dschibuti --> DJ = |<!-- Ecuador --> EC = |<!-- El Salvador --> SV = |<!-- Eritrea --> ER = |<!-- Estland --> EE = |<!-- Falklandinseln --> FK = |<!-- Fidschi --> FJ = |<!-- Finnland --> FI = |<!-- Frankreich --> FR = |<!-- Französische Süd- und Antarktisgebiete --> TF = |<!-- Frankreich, Neukaledonien --> NC = |<!-- Gabun --> GA = |<!-- Gambia --> GM = |<!-- Georgien --> GE = |<!-- Ghana --> GH = |<!-- Grenada --> GD = |<!-- Griechenland --> GR = |<!-- Grönland --> GL = |<!-- Guatemala --> GT = |<!-- Guinea --> GN = |<!-- Guinea-Bissau --> GW = |<!-- Guyana --> GY = |<!-- Haiti --> HT = |<!-- Honduras --> HN = |<!-- Indien --> IN = |<!-- Indonesien --> ID = |<!-- Irak --> IQ = |<!-- Iran --> IR = |<!-- Irland --> IE = |<!-- Island --> IS = |<!-- Israel --> IL = |<!-- Italien --> IT = |<!-- Jamaika --> JM = |<!-- Japan --> JP = |<!-- Jemen --> YE = |<!-- Jordanien --> JO = |<!-- Kambodscha --> KH = |<!-- Kamerun --> CM = |<!-- Kanada --> CA = |<!-- Kap Verde --> CV = |<!-- Kasachstan --> KZ = |<!-- Katar --> QA = |<!-- Kenia --> KE = |<!-- Kirgisistan --> KG = |<!-- Kiribati --> KI = |<!-- Kolumbien --> CO = |<!-- Komoren --> KM = |<!-- Kongo, Demokratische Republik (ehem. Zaire) --> CD = |<!-- Kongo, Republik (ehem. K.-Brazzaville) --> CG = |<!-- Korea, Demokratische Volksrepublik (Nordkorea) --> KP = |<!-- Korea, Republik (Südkorea) --> KR = |<!-- Kosovo --> KOSOVO = |<!-- Kroatien --> HR = |<!-- Kuba --> CU = |<!-- Kuwait --> KW = |<!-- Laos --> LA = |<!-- Lesotho --> LS = |<!-- Lettland --> LV = |<!-- Libanon --> LB = |<!-- Liberia --> LR = |<!-- Libyen --> LY = |<!-- Liechtenstein --> LI = |<!-- Litauen --> LT = |<!-- Luxemburg --> LU = |<!-- Madagaskar --> MG = |<!-- Malawi --> MW = |<!-- Malaysia --> MY = |<!-- Malediven --> MV = |<!-- Mali --> ML = |<!-- Malta --> MT = |<!-- Marokko --> MA = |<!-- Marshallinseln --> MH = |<!-- Mauretanien --> MR = |<!-- Mauritius --> MU = |<!-- Mazedonien --> MK = |<!-- Mexiko --> MX = |<!-- Mikronesien, Föderierte Staaten von --> FM = |<!-- Moldawien (Republik Moldau) --> MD = |<!-- Monaco --> MC = |<!-- Mongolei --> MN = |<!-- Montenegro --> ME = |<!-- Mosambik --> MZ = |<!-- Myanmar (Burma) --> MM = |<!-- Namibia --> NA = |<!-- Nauru --> NR = |<!-- Nepal --> NP = |<!-- Neuseeland --> NZ = |<!-- Nicaragua --> NI = |<!-- Niederlande --> NL = |<!-- Niger --> NE = |<!-- Nigeria --> NG = |<!-- Nordzypern --> NORTHERN_CYPRUS = |<!-- Norwegen --> NO = |<!-- Oman --> OM = |<!-- Österreich --> AT = |<!-- Osttimor --> TL = |<!-- Pakistan --> PK = |<!-- Palästina --> PS = |<!-- Palau --> PW = |<!-- Panama --> PA = |<!-- Papua-Neuguinea --> PG = |<!-- Paraguay --> PY = |<!-- Peru --> PE = |<!-- Philippinen --> PH = |<!-- Polen --> PL = |<!-- Portugal --> PT = |<!-- Puerto Rico --> PR = |<!-- Republik China (Taiwan) --> TW = |<!-- Ruanda --> RW = |<!-- Rumänien --> RO = |<!-- Russische Föderation --> RU = |<!-- Salomonen --> SB = |<!-- Sambia --> ZM = |<!-- Samoa --> WS = |<!-- San Marino --> SM = |<!-- Sao Tome and Principe --> ST = |<!-- Saudi-Arabien --> SA = |<!-- Schweden --> SE = |<!-- Schweiz --> CH = |<!-- Senegal --> SN = |<!-- Serbien --> RS = |<!-- Seychellen --> SC = |<!-- Sierra Leone --> SL = |<!-- Simbabwe --> ZW = |<!-- Singapur --> SG = |<!-- Slowakei --> SK = |<!-- Slowenien --> SI = |<!-- Somalia --> SO = |<!-- Somaliland --> SOMALILAND = |<!-- Spanien --> ES = |<!-- Sri Lanka --> LK = |<!-- St. Kitts und Nevis --> KN = |<!-- St. Lucia --> LC = |<!-- St. Vincent und die Grenadinen --> VC = |<!-- Südafrika --> ZA = |<!-- Sudan --> SD = |<!-- Südsudan --> SS = |<!-- Suriname --> SR = |<!-- Swasiland --> SZ = |<!-- Syrien --> SY = |<!-- Tadschikistan --> TJ = |<!-- Tansania --> TZ = |<!-- Thailand --> TH = |<!-- Togo --> TG = |<!-- Tonga --> TO = |<!-- Trinidad und Tobago --> TT = |<!-- Tschad --> TD = |<!-- Tschechien --> CZ = |<!-- Tunesien --> TN = |<!-- Türkei --> TR = |<!-- Turkmenistan --> TM = |<!-- Tuvalu --> TV = |<!-- Uganda --> UG = |<!-- Ukraine --> UA = |<!-- Ungarn --> HU = |<!-- Uruguay --> UY = |<!-- Usbekistan --> UZ = |<!-- Vanuatu --> VU = |<!-- Venezuela --> VE = |<!-- Vereinigte Arabische Emirate --> AE = |<!-- Vereinigte Staaten von Amerika --> US = |<!-- Vereinigtes Königreich --> GB = |<!-- Vietnam --> VN = |<!-- Westsahara --> EH = |<!-- Zentralafrikanische Republik --> CF = |<!-- Zypern --> CY = }}
Beispiele
Weltkarte
Beispiel für einfache Farbmarkierungen (basierend auf der zur Graph-Erweiterung mitgelieferten Karte mit Staatsgrenzen):
{{Graph:Map|basemap=WorldMap-iso2.json|DE=blue|CN=green|RU=#cc0333}}
ergibt
<graph>{"version":2,"height":1,"marks":[{"type":"path","properties":{"enter":{"path":{"field":"layout_path"}},"update":{"fill":{"field":"zipped.v"}},"hover":{"fill":{"value":"darkgrey"}}},"from":{"data":"countries"}}],"data":[{"name":"highlights","values":[{"id":"RU","v":"#cc0333"},{"id":"DE","v":"blue"},{"id":"CN","v":"green"}]},{"transform":[{"type":"geopath","translate":[0,0],"value":"data","projection":"equirectangular","scale":100},{"onKey":"id","type":"lookup","default":{"v":"silver"},"keys":["id"],"on":"highlights","as":["zipped"]}],"url":"wikiraw:///Modul%3AGraph%2FWorldMap-iso2.json","name":"countries","format":{"feature":"countries","type":"topojson"}}],"width":1}</graph>
Beispiel für Zahlenwerte (hier Bevölkerungszahlen):
{{Graph:Map | basemap = WorldMap-iso2.json | scale = 100 | projection = conicEqualArea | colorScale = category10 | domainMin = 1000 | domainMax = 1500000 | defaultValue = red | scaleType = log | legend = yes | AE=8442 | AF=28398 | AL=3150 | AM=2963 | AO=19549 | AR=40374 | AT=8402 | AU=22404 | AZ=9095 | BA=3846 | BD=151125 | BE=10941 | BF=15540 | BG=7389 | BI=9233 | BJ=9510 | BN=401 | BO=10157 | BR=195210 | BS=360 | BT=717 | BW=1969 | BY=9491 | BZ=309 | CA=34126 | CD=62191 | CF=4350 | CG=4112 | CH=7831 | CI=18977 | CL=17151 | CM=20624 | CN=1359821 | CO=46445 | CR=4670 | CU=11282 | CY=1104 | NORTHERN_CYPRUS=313 | CZ=10554 | DE=83017 | DJ=834 | DK=5551 | DO=10017 | DZ=37063 | EC=15001 | EE=1299 | EG=78076 | EH=515 | ER=5741 | ES=46182 | ET=87095 | FI=5368 | FJ=861 | FK=3 | FR=63231 | GA=1556 | GB=62066 | GE=4389 | GH=24263 | GL=57 | GM=1681 | GN=10876 | GQ=696 | GR=11110 | GT=14342 | GW=1587 | GY=786 | HN=7621 | HR=4338 | HT=9896 | HU=10015 | ID=240676 | IE=4468 | IL=7420 | IN=1205625 | IQ=30962 | IR=74462 | IS=318 | IT=60509 | JM=2741 | JO=6455 | JP=127353 | KE=40909 | KG=5334 | KH=14365 | KP=24501 | KOSOVO = 1895 | KR=48454 | KW=2992 | KZ=15921 | LA=6396 | LB=4341 | LK=20759 | LR=3958 | LS=2009 | LT=3068 | LU=508 | LV=2091 | LY=6041 | MA=31642 | MD=3573 | ME=620 | MG=21080 | MK=2102 | ML=13986 | MM=51931 | MN=2713 | MR=3609 | MW=15014 | MX=117886 | MY=28276 | MZ=23967 | NA=2179 | NC=246 | NE=15894 | NG=159708 | NI=5822 | NL=16615 | NO=4891 | NP=26846 | NZ=4368 | OM=2803 | PA=3678 | PE=29263 | PG=6859 | PH=93444 | PK=173149 | PL=38199 | PR=3710 | PS=4013 | PT=10590 | PY=6460 | QA=1750 | RO=21861 | RS=9647 | RU=143618 | RW=10837 | SA=27258 | SB=526 | SD=35652 | SE=9382 | SI=2054 | SK=5433 | SL=5752 | SN=12951 | SO=9636 | SOMALILAND=3500 | SR=525 | SS=9941 | SV=6218 | SY=21533 | SZ=1193 | TD=11721 | TG=6306 | TH=66402 | TJ=7627 | TL=1079 | TM=5042 | TN=10632 | TR=72138 | TT=1328 | TW=23146 | TZ=44973 | UA=46050 | UG=33987 | US=312247 | UY=3372 | UZ=27769 | VE=29043 | VN=89047 | VU=236 | YE=22763 | ZA=51452 | ZM=13217 | ZW=13077 }}
ergibt
<graph>{"scales":[{"domainMin":1000,"type":"log","name":"color","domainMax":1500000,"zero":false,"range":"category10","domain":{"data":"highlights","field":"v"},"nice":true}],"version":2,"legends":[{"offset":120,"properties":{"legend":{"strokeWidth":{"value":1.5},"stroke":{"value":"silver"}},"title":{"fontSize":{"value":14}},"labels":{"fontSize":{"value":12}}},"fill":"color"}],"height":1,"marks":[{"type":"path","properties":{"enter":{"path":{"field":"layout_path"}},"update":{"fill":{"scale":"color","field":"zipped.v"}},"hover":{"fill":{"value":"darkgrey"}}},"from":{"data":"countries"}}],"data":[{"name":"highlights","values":[{"id":"FK","v":3},{"id":"EC","v":15001},{"id":"PS","v":4013},{"id":"MK","v":2102},{"id":"KOSOVO","v":1895},{"id":"US","v":312247},{"id":"DK","v":5551},{"id":"BS","v":360},{"id":"ES","v":46182},{"id":"PK","v":173149},{"id":"IS","v":318},{"id":"NP","v":26846},{"id":"GH","v":24263},{"id":"KH","v":14365},{"id":"MX","v":117886},{"id":"EH","v":515},{"id":"CH","v":7831},{"id":"NORTHERN_CYPRUS","v":313},{"id":"JP","v":127353},{"id":"KP","v":24501},{"id":"CA","v":34126},{"id":"BA","v":3846},{"id":"SY","v":21533},{"id":"FI","v":5368},{"id":"GA","v":1556},{"id":"MY","v":28276},{"id":"LY","v":6041},{"id":"NA","v":2179},{"id":"CI","v":18977},{"id":"BI","v":9233},{"id":"SA","v":27258},{"id":"CY","v":1104},{"id":"BY","v":9491},{"id":"GY","v":786},{"id":"GQ","v":696},{"id":"ZA","v":51452},{"id":"NI","v":5822},{"id":"IQ","v":30962},{"id":"CF","v":4350},{"id":"LV","v":2091},{"id":"AF","v":28398},{"id":"BF","v":15540},{"id":"BN","v":401},{"id":"CN","v":1359821},{"id":"SV","v":6218},{"id":"VN","v":89047},{"id":"ZW","v":13077},{"id":"SN","v":12951},{"id":"TN","v":10632},{"id":"NG","v":159708},{"id":"YE","v":22763},{"id":"PA","v":3678},{"id":"JO","v":6455},{"id":"CG","v":4112},{"id":"RW","v":10837},{"id":"EG","v":78076},{"id":"NZ","v":4368},{"id":"KW","v":2992},{"id":"BG","v":7389},{"id":"MW","v":15014},{"id":"BO","v":10157},{"id":"AO","v":19549},{"id":"DO","v":10017},{"id":"CO","v":46445},{"id":"TW","v":23146},{"id":"LB","v":4341},{"id":"UY","v":3372},{"id":"LK","v":20759},{"id":"TG","v":6306},{"id":"UA","v":46050},{"id":"BW","v":1969},{"id":"UG","v":33987},{"id":"PG","v":6859},{"id":"SK","v":5433},{"id":"KG","v":5334},{"id":"RO","v":21861},{"id":"GW","v":1587},{"id":"MG","v":21080},{"id":"SO","v":9636},{"id":"NO","v":4891},{"id":"QA","v":1750},{"id":"CZ","v":10554},{"id":"TH","v":66402},{"id":"SI","v":2054},{"id":"CD","v":62191},{"id":"PT","v":10590},{"id":"BD","v":151125},{"id":"SZ","v":1193},{"id":"LT","v":3068},{"id":"CL","v":17151},{"id":"SS","v":9941},{"id":"AL","v":3150},{"id":"SR","v":525},{"id":"ID","v":240676},{"id":"SOMALILAND","v":3500},{"id":"SL","v":5752},{"id":"TT","v":1328},{"id":"AT","v":8402},{"id":"BT","v":717},{"id":"SD","v":35652},{"id":"TD","v":11721},{"id":"NC","v":246},{"id":"GM","v":1681},{"id":"PY","v":6460},{"id":"RS","v":9647},{"id":"IT","v":60509},{"id":"TL","v":1079},{"id":"GT","v":14342},{"id":"HT","v":9896},{"id":"ET","v":87095},{"id":"PL","v":38199},{"id":"ML","v":13986},{"id":"NL","v":16615},{"id":"RU","v":143618},{"id":"EE","v":1299},{"id":"DE","v":83017},{"id":"LA","v":6396},{"id":"BE","v":10941},{"id":"AE","v":8442},{"id":"LU","v":508},{"id":"PH","v":93444},{"id":"NE","v":15894},{"id":"CM","v":20624},{"id":"MN","v":2713},{"id":"AM","v":2963},{"id":"VU","v":236},{"id":"IE","v":4468},{"id":"MA","v":31642},{"id":"GE","v":4389},{"id":"VE","v":29043},{"id":"AU","v":22404},{"id":"ZM","v":13217},{"id":"SE","v":9382},{"id":"GL","v":57},{"id":"LR","v":3958},{"id":"PE","v":29263},{"id":"MM","v":51931},{"id":"TM","v":5042},{"id":"ME","v":620},{"id":"HU","v":10015},{"id":"MD","v":3573},{"id":"OM","v":2803},{"id":"LS","v":2009},{"id":"CU","v":11282},{"id":"FJ","v":861},{"id":"MR","v":3609},{"id":"TZ","v":44973},{"id":"UZ","v":27769},{"id":"PR","v":3710},{"id":"KE","v":40909},{"id":"KR","v":48454},{"id":"GB","v":62066},{"id":"TR","v":72138},{"id":"KZ","v":15921},{"id":"JM","v":2741},{"id":"MZ","v":23967},{"id":"BJ","v":9510},{"id":"IN","v":1205625},{"id":"DJ","v":834},{"id":"IL","v":7420},{"id":"BZ","v":309},{"id":"DZ","v":37063},{"id":"SB","v":526},{"id":"HN","v":7621},{"id":"AR","v":40374},{"id":"BR","v":195210},{"id":"CR","v":4670},{"id":"GN","v":10876},{"id":"ER","v":5741},{"id":"FR","v":63231},{"id":"GR","v":11110},{"id":"HR","v":4338},{"id":"IR","v":74462},{"id":"TJ","v":7627},{"id":"AZ","v":9095}]},{"transform":[{"type":"geopath","translate":[0,0],"value":"data","projection":"conicEqualArea","scale":100},{"onKey":"id","type":"lookup","default":{"v":"red"},"keys":["id"],"on":"highlights","as":["zipped"]}],"url":"wikiraw:///Modul%3AGraph%2FWorldMap-iso2.json","name":"countries","format":{"feature":"countries","type":"topojson"}}],"width":1}</graph>
Österreich
Die Österreichkarte kann mit feature = bezirke
, laender
oder gemeinden
verwendet werden. Die id
folgt dem Schema der Gemeindekennzahl.
Länder
{{Graph:Map | basemap = AT.json | projection = mercator | scale = 3000 | center = 9.53095237318183,46.37585374215964 | feature = laender | scaleType = linear | colorScale = category10 | legend= yes | 1=11 <!-- Burgenland --> | 2=13 <!-- Kärnten --> | 3=100 <!-- Niederösterreich --> | 4=60 <!-- usw --> | 5=38 | 6=147 | 7=108 | 8=19 | 9=172 }}
ergibt
<graph>{"scales":[{"type":"linear","name":"color","zero":false,"range":"category10","domain":{"data":"highlights","field":"v"},"nice":true}],"version":2,"legends":[{"offset":120,"properties":{"legend":{"strokeWidth":{"value":1.5},"stroke":{"value":"silver"}},"title":{"fontSize":{"value":14}},"labels":{"fontSize":{"value":12}}},"fill":"color"}],"height":1,"marks":[{"type":"path","properties":{"enter":{"path":{"field":"layout_path"}},"update":{"fill":{"scale":"color","field":"zipped.v"}},"hover":{"fill":{"value":"darkgrey"}}},"from":{"data":"laender"}}],"data":[{"name":"highlights","values":[{"id":1,"v":11},{"id":4,"v":60},{"id":8,"v":19},{"id":9,"v":172},{"id":6,"v":147},{"id":7,"v":108},{"id":5,"v":38},{"id":3,"v":100},{"id":2,"v":13}]},{"transform":[{"type":"geopath","center":[9.53095237318183,46.37585374215964],"translate":[0,0],"value":"data","projection":"mercator","scale":3000},{"onKey":"id","type":"lookup","default":{"v":0},"keys":["id"],"on":"highlights","as":["zipped"]}],"url":"wikiraw:///Modul%3AGraph%2FAT.json","name":"laender","format":{"feature":"laender","type":"topojson"}}],"width":1}</graph>
Bezirke
{{Graph:Map | basemap = AT.json | projection = mercator | scale = 3000 | center = 9.53095237318183,46.37585374215964 | defaultValue = silver | feature = bezirke | 707=blue <!-- Bezirk Lienz --> }}
ergibt
<graph>{"version":2,"height":1,"marks":[{"type":"path","properties":{"enter":{"path":{"field":"layout_path"}},"update":{"fill":{"field":"zipped.v"}},"hover":{"fill":{"value":"darkgrey"}}},"from":{"data":"bezirke"}}],"data":[{"name":"highlights","values":[{"id":707,"v":"blue"}]},{"transform":[{"type":"geopath","center":[9.53095237318183,46.37585374215964],"translate":[0,0],"value":"data","projection":"mercator","scale":3000},{"onKey":"id","type":"lookup","default":{"v":"silver"},"keys":["id"],"on":"highlights","as":["zipped"]}],"url":"wikiraw:///Modul%3AGraph%2FAT.json","name":"bezirke","format":{"feature":"bezirke","type":"topojson"}}],"width":1}</graph>
Gemeinden
{{Graph:Map | basemap = AT.json | projection = mercator | scale = 3000 | center = 9.53095237318183,46.37585374215964 | feature = gemeinden | 50408 = red <!-- Flachau --> }}
ergibt
<graph>{"version":2,"height":1,"marks":[{"type":"path","properties":{"enter":{"path":{"field":"layout_path"}},"update":{"fill":{"field":"zipped.v"}},"hover":{"fill":{"value":"darkgrey"}}},"from":{"data":"gemeinden"}}],"data":[{"name":"highlights","values":[{"id":50408,"v":"red"}]},{"transform":[{"type":"geopath","center":[9.53095237318183,46.37585374215964],"translate":[0,0],"value":"data","projection":"mercator","scale":3000},{"onKey":"id","type":"lookup","default":{"v":"silver"},"keys":["id"],"on":"highlights","as":["zipped"]}],"url":"wikiraw:///Modul%3AGraph%2FAT.json","name":"gemeinden","format":{"feature":"gemeinden","type":"topojson"}}],"width":1}</graph>
Anmerkung
Nach dem Abspeichern einer neuen Karte kann es passieren, dass die Karte nicht angezeigt wird, da der Wikipedia-Kartenrenderer ein wenig Zeit benötigt. Wenn man die Seite nach wenigen Sekunden neulädt, sollte die Karte dann erscheinen.
Lua
Verwendetes Modul: Graph #map
Siehe auch
- {{Graph:Chart}} für Diagramme
- {{Coordinate}} für einen einzelnen Punkt auf einer Landkarte
- {{Positionskarte}} für mehrere Punkte auf einer Karte