Module:Graph/doc

{{#if:{{{1|}}}|| {{Module rating |alpha}}

Module with helper functions for the Graph extension.

map
Creates a JSON object for   to display a political map with colored highlights. In the article namespace the template Template:GraphMap should be used instead. See its page for use cases.

Maps can be found at Special:Prefixindex/Module:Graph/ (for example WorldMap-iso2.json with country borders) and new maps should also be saved under Module:Graph/.

Parameters: }}{{#if:{{{1|}}}||
 * formatjson: format JSON object for better legibility

chart
Creates a JSON object for   to display charts. In the article namespace the template Template:GraphChart should be used instead. See its page for use cases.

Parameters: }}{{#if:{{{1|}}}||
 * formatjson: format JSON object for better legibility

Template wrappers
The functions mapWrapper and chartWrapper are wrappers to pass all parameters of the calling template to the respective map and chart functions. }}

Note: In the editor preview the graph extension creates a canvas element with vector graphics. However, when saving the page a PNG raster graphics is generated instead.