Template:Graph:Map/doc
This is a documentation subpage for
Template documentation[edit source]Template:Terminate sentence ensures a sentence ends with a specified terminator (default: a period). It avoids adding duplicate terminators and can optionally trim trailing spaces. It attempts to ignore trailing closing quotes or brackets when deciding whether a terminator is already present. Usage[edit source]Basic: {{Terminate sentence|This is a sentence}}
→ This is a sentence.
Named parameters: {{Terminate sentence
|text=He said "Hello"
|term=.
}}
→ He said "Hello".
Custom terminator: {{Terminate sentence|text=Warning|term=!}}
→ Warning!
Avoid duplicate terminator: {{Terminate sentence|text=Already done.|term=.}}
→ Already done.
Trim trailing spaces: {{Terminate sentence|text=Ends with space |trim=yes}}
→ Ends with space.
Skip processing: {{Terminate sentence|text=No changes here|skip=yes}}
→ No changes here
Append a note: {{Terminate sentence|text=Complete|note=(source: 2025)}}
→ Complete. (source: 2025)
Parameters[edit source]
Behavior details[edit source]
Examples[edit source]
{{Terminate sentence|text=He whispered "hush"|term=.}}
→ He whispered "hush".
{{Terminate sentence|text=Complete (verified)|term=.}}
→ Complete (verified).
{{Terminate sentence|text=Alert|term=!}}
→ Alert!
{{Terminate sentence|text=Wait...|term=.|allowdup=yes}}
→ Wait.... Best practices[edit source]
Lua-powered variant (optional)[edit source]For more robust detection (including multilingual quotes and punctuation), create -- Module:TerminateUtil
local M = {}
local closing = {
[")"] = true, ["]"] = true, ["}"] = true,
['"'] = true, ["'"] = true, ["”"] = true, ["’"] = true, ["»"] = true, ["›"] = true
}
local function trimRight(s)
return (s:gsub("%s+$",""))
end
function M.lastVisibleChar(args)
local s = args.s or ""
s = trimRight(s)
local i = #s
while i > 0 do
local c = s:sub(i,i)
if closing[c] then
i = i - 1
else
return c
end
end
return ""
end
return M
Then update the template to call: {{#invoke:TerminateUtil|lastVisibleChar|s=text}}
This improves detection for closing quotes and brackets. See also[edit source]It may contain usage information, categories and other content that is not part of the original template page. |
This template is used to create a world choropleth map where certain countries are highlighted as needed.
Parameters
[edit source]| This template uses Lua: |
- 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=greenwould color Italy green andTD=#f53aaawould 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.
Usage
[edit source]{{Highlighted world map by country|US=red}}
{{Highlighted world map by country|US=blue|KOSOVO=red|scale=80}}
{{Highlighted world map by country|DE=green|FR=#a12aaa|CN=#000000|IT=green|scale=100|projection=mercator}} (note that French Guiana is also colored in)
Because of Lua functionality, you can now make maps with numerical values and sliding color scales.
| Template code |
|---|
{{Graph:Highlighted world map by country
| 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
}} |
Examples
[edit source]{{Template:JAL destmap}} - Map of Japan Airlines destinations
{{JAL destmap|scale=100}}
Trouble seeing this map? Look here for an image version.
Issues
[edit source]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.
Subtemplates
[edit source]Template:Graph:Highlighted world map by country/Inner - Inner template handling graph data, harder to modifydepreciated for a Lua based solution