Edge Rewrite
// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21e012f68ff1330

Jump to content

Module talk:ChoroplethMap

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:ChoroplethMap/doc)
Latest comment: 1 month ago by Sophivorus in topic API design

What boundaries are recognized

[edit]

First of all, this is a great idea. Secondly, what boundaries are we using in the case of disputes? Which countries are "recognized" by this template? It sounds silly, but could be a real concern in the case of India/Pakistan, Israel/Palestine, Abkhazia, Transnistria, Somalia, Ukraine/Russia, etc. It looks to me like "lines of actual control" are used in Kashmir, and that the West Bank appears but not Gaza. I think we should establish a consensus on this early to head off discussion and controversy. —Ganesha811 (talk) 12:50, 20 November 2025 (UTC)Reply

Perhaps there could be a different color or a way to notate disputed areas? Wikieditor662 (talk) 19:54, 20 November 2025 (UTC)Reply
That's a good point! But it's not unique to this template, is it? It applies to most of the maps on Wikipedia. Is there a consensus among them? It's a very good point to raise, and it highlights an advantage of the template: when the conflict ends, if the boundaries change, the template's design is updated, and the map for all articles using it is adjusted accordingly. AdrianManera (talk) 20:15, 20 November 2025 (UTC)Reply
Many Wikipedia maps are made ad hoc and there's no consistency between them. In general, we show widely recognized and used boundaries (using the Line of Control in Kashmir, not recognizing Russia's annexation of Eastern Ukraine, etc) but every map is different. The reason it's worth discussing here is because this template may become widely used or even close to standard on Wikipedia, so the issue needs to be sorted out. —Ganesha811 (talk) 20:17, 20 November 2025 (UTC)Reply
Hi! I just wrote Template:Choropleth map#Disputed borders to try to address this issue. Sophivorus (talk) 22:53, 25 May 2026 (UTC)Reply

API design

[edit]

IMO it'd be better to have color1/countries1, color2/countries2, etc. For complex maps it would make it a lot easier to see what countries are what and update the colours.

It's also consistent with other templates such as {{Video game reviews}} which has rev1/rev1Score, rev2/rev2Score, etc.  novov talk edits 22:41, 26 November 2025 (UTC)Reply

Hi! After some thinking and experimenting, I went for an intermediate solution. Rather than having several pairs of parameters (color1/countries1, color2/countries2, etc), we still have a single pair (color/countries) but I changed the syntax from:
{{Choropleth map
| countries =
Mexico (#faa), United States, Brazil
Italy (#aaf), Spain, France, Germany
China (#afa), India
Australia (#faf)
}}
to:
{{Choropleth map
| countries =
#faa: Mexico; United States; Brazil
#aaf: Italy; Spain; France; Germany
#afa: China; India
#faf: Australia
}}
See the template docs for more examples. This new syntax should be much clearer with regards to which colors apply to which countries, and easier to update too. Notice the use of semicolons (;) rather than commas (,). This is to prevent parsing complications when the title of some entity contains a comma, and in languages where commas are used for separating decimals.
Perhaps the main reason for avoiding color1/countries1, is that translating, maintaining and documenting so many parameters is quite annoying. Furthermore, the visual editor still doesn't support well numbered parameters (phab:T54582). Kind regards, Sophivorus (talk) 11:53, 29 May 2026 (UTC)Reply

Small countries

[edit]

It would be useful to mark small countries on the map with circular dots, as the current world map SVG does for countries less than 20,000 square kilometres (7,700 mi2) (see also c:File_talk:BlankMap-World.svg/Documentation). –LaundryPizza03 (d) 06:23, 28 November 2025 (UTC)Reply

Agreed, that would be helpful. —Ganesha811 (talk) 21:41, 12 January 2026 (UTC)Reply
Hi! The new version of the module offers an alternative solution, namely, the possibility to zoom in. I trust this is enough for most use cases. However, if displaying small countries as circles is still desirable, it's now possible to do so by duplicating Commons:Data:ChoroplethMap.map, creating another version that shows small countries as circles, and then loading it via the "source" parameter (see the template documentation). https://geojson.io is a useful tool for the task, should anyone want to tackle it. Sophivorus (talk) 11:35, 29 May 2026 (UTC)Reply

Grant

[edit]

Hi! Due to the great potential of this module, I'm thinking about requesting a grant to implement all the features requested here and at the Spanish Wikipedia, and to spread the module to new wikis and high-visibility articles. Here is a list of the main tasks so far:

  • Add support for a new and better syntax
  • Display small countries as circles
  • Think and implement some convention or solution for countries with disputed borders
  • Add support for automatic, localized legends, as well as custom legends
  • Add support for thumbnail-style for the maps
  • Think and implement some solution to enlarge the maps
  • Add maps for some countries, for example Spain, United States, Argentina, Uruguay...
  • Deploy the map in other top wikis (fr, pt, it, de) and document it
  • Use the map in a few high-visibility articles per wiki, to spread awareness

Thoughts? Support? Objections? Would you like to add any request? Thanks! Sophivorus (talk) 16:13, 13 January 2026 (UTC)Reply

Hi again! The grant request can be found here, in case you want to add your support, objections, or questions. Thanks! Sophivorus (talk) 13:19, 27 January 2026 (UTC)Reply
Good news! The grant request has been approved. I'll be working on this during April and May. Feel free to contact me anytime with ideas and requests. Cheers! Sophivorus (talk) 14:30, 6 March 2026 (UTC)Reply
Good news! Looking forward to the improvements. —Ganesha811 (talk) 15:10, 6 March 2026 (UTC)Reply

Projection

[edit]

What projection is the module currently using? Is it Robinson? It might be good to have the option for a few different choices, like Winkel tripel, Mollweide, Equal Earth projection, and perhaps Albers conic for the regional/continental variants? This would be a good feature to have as you work on the grant. Thanks! —Ganesha811 (talk) 15:17, 6 March 2026 (UTC)Reply

@Sophivorus, hi, just wondering about this question. Thanks! —Ganesha811 (talk) 16:37, 7 May 2026 (UTC)Reply
@Ganesha811 Hi, sorry for the delay, I somehow missed your message. The new version of the module relies on Extension:Kartographer, which in turn relies on Open Street Map. This has many advantages, but also inherits some of its limitations. Currently, there's only two "mapstyles" available (osm-intl and osm), which apparently both use the Web Mercator projection (EPSG:3857). If new projections are added to OSM/Kartographer, they would be trivial to add to the module, but until then, new projections would require a complete rewrite of the module (or more likely, a new module) with a completely different approach (back to SVGs, maybe?), which unfortunately is beyond the scope of this grant. Sophivorus (talk) 12:18, 8 May 2026 (UTC)Reply