Hoppa till innehållet

Mall:Graph:Map/dok: Skillnad mellan sidversioner

Från Wikipedia
Innehåll som raderades Innehåll som lades till
Märke: 2017-källredigering
Märke: 2017-källredigering
 
(4 mellanliggande sidversioner av samma användare visas inte)
Rad 1: Rad 1:
{{Dokumentationssida}}
{{Dokumentationssida}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->


This template is used to create a world [[Koropletkarta|choropleth map]] where certain countries are highlighted as needed.
== Användning ==


=== Parametrar ===
== Parameters ==
{{Lua|Module:Graph}}
*'''basemap''': Sets the base file to be used for getting the JSON data and creating boundaries. Optimally, this would mean that it would be easy to change files as needed for different administrative divisions, but it is currently reccomended not to use that parameter and allow the template to keep its default value.
* '''[any two digit country code (must be uppercase)]''': Sets the color that that country will be in on the map (for example <code>IT=green</code> would color Italy green and <code>TD=#f53aaa</code> would color Chad in the color produced by hex RGB code <nowiki>#f53aaa</nowiki>). The template uses [[ISO 3166-1 alpha-2]] for the country code. There are, however, some exceptions for (partly) unrecognized states:
"KOSOVO", "NORTHERN_CYPRUS", "SOMALILAND" must be used.
* '''scale''': Sets the size of the map. There is no exact width-height control available. By default, this is set to 90.
* '''projection''': Sets what projection the map will use. By default it is set to equirectangular. [https://d3-wiki.readthedocs.io/zh_CN/master/Geo-Projections/ Here] are some available projections - be warned that not all of them work.


=== Exempel ===
== Usage ==
<code><nowiki>{{Graph:Map|US=red}}</nowiki></code>
<pre>
{{Graph:Map
{{Graph:Map|US=red}}

| basemap = WorldMap-iso2.json
<code><nowiki>{{Graph:Map|US=blue|KOSOVO=red|scale=80}}</nowiki></code>
{{Graph:Map|US=blue|KOSOVO=red|scale=80}}

<code><nowiki>{{Graph:Map|DE=green|FR=#a12aaa|CN=#000000|IT=green|scale=100|projection=mercator}}</nowiki></code> (note that French Guiana is also colored in)
{{Graph:MapF|DE=green|FR=#a12aaa|CN=#000000|IT=green|scale=100|projection=mercator}}

Because of Lua functionality, you can now make maps with numerical values and sliding color scales.
{{collapse|title=Template code|<code><nowiki>{{Graph:Map
| scale = 100
| scale = 100
| projection = conicEqualArea
| projection = conicEqualArea
Rad 37: Rad 52:
| TW=23146 | TZ=44973 | UA=46050 | UG=33987 | US=312247 | UY=3372 | UZ=27769 | VE=29043
| 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
| VN=89047 | VU=236 | YE=22763 | ZA=51452 | ZM=13217 | ZW=13077
}}</nowiki></code>}}
}}

</pre>ergibt<br />
{{Graph:Map
{{Graph:Map
| basemap = WorldMap-iso2.json
| scale = 100
| scale = 100
| projection = conicEqualArea
| projection = conicEqualArea
Rad 71: Rad 85:
}}
}}


=== Associerad kategori ===
== Examples ==
<nowiki>{{</nowiki>[[:en:Template:JAL destmap]]<nowiki>}}</nowiki> - Map of Japan Airlines destinations
<!-- VID BEHOV KAN MAN HÄR LÄGGA TILL:
Artiklar med denna mall placeras i [[:Kategori:XXX]].
-->


<code><nowiki>{{JAL destmap|scale=100}}</nowiki></code>
== Omdirigeringar ==
{{JAL destmap|scale=100}}


== Se även ==
== Issues ==
Very small countries (Singapore, Vatican City) and supranational groups aren't shown on the map. Also, unless if the map is in its own template, it is hard to get a bigger version to show up.

==See also==
* [[:en:Wikipedia:Coloring cartographic maps#Choose the colors|Choose the colors]]
* {{tl|Choropleth world map}}
* {{tl|Animerad världskarta}}
* {{tl|Maplink}}
* {{tl|GeoLänk}}


<includeonly>
<includeonly>
<!-- KATEGORIER NEDAN -->
<!-- KATEGORIER NEDAN -->
[[Kategori:Diagrammallar]]

[[Kategori:Kartor]]
[[Kategori:Lua-baserade mallar]]
</includeonly>
</includeonly>

Nuvarande version från 12 juni 2021 kl. 20.12

This template is used to create a world choropleth map where certain countries are highlighted as needed.

Parameters

[redigera wikitext]
  • basemap: Sets the base file to be used for getting the JSON data and creating boundaries. Optimally, this would mean that it would be easy to change files as needed for different administrative divisions, but it is currently reccomended not to use that parameter and allow the template to keep its default value.
  • [any two digit country code (must be uppercase)]: Sets the color that that country will be in on the map (for example IT=green would color Italy green and TD=#f53aaa would color Chad in the color produced by hex RGB code #f53aaa). The template uses ISO 3166-1 alpha-2 for the country code. There are, however, some exceptions for (partly) unrecognized states:

"KOSOVO", "NORTHERN_CYPRUS", "SOMALILAND" must be used.

  • scale: Sets the size of the map. There is no exact width-height control available. By default, this is set to 90.
  • projection: Sets what projection the map will use. By default it is set to equirectangular. Here are some available projections - be warned that not all of them work.

{{Graph:Map|US=red}}


{{Graph:Map|US=blue|KOSOVO=red|scale=80}}


{{Graph:Map|DE=green|FR=#a12aaa|CN=#000000|IT=green|scale=100|projection=mercator}} (note that French Guiana is also colored in) Mall:Graph:MapF

Because of Lua functionality, you can now make maps with numerical values and sliding color scales.


{{en:Template:JAL destmap}} - Map of Japan Airlines destinations

{{JAL destmap|scale=100}} Mall:JAL destmap

Very small countries (Singapore, Vatican City) and supranational groups aren't shown on the map. Also, unless if the map is in its own template, it is hard to get a bigger version to show up.