Wikipedia:Lua/Modul/Graph/en

Vorlagenprogrammierung Diskussionen Lua Unterseiten
Modul Deutsch English Modul: Dokumentation

Module with helper functions for the Graph extension.

Functions for templates

map

Creates a JSON object for <graph> to display a political map with colored highlights. In the article namespace the template {{Graph:Map}} should be used instead. See its page for use cases.

Maps can be found at Spezial:Präfixindex/Modul:Graph/ (for example WorldMap-iso2.json with country borders) and new maps should also be saved under Modul:Graph/.

Parameters:

chart

Creates a JSON object for <graph> to display charts. In the article namespace the template {{Graph:Chart}} should be used instead. See its page for use cases.

Parameters:

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.

Note to developers: New functionality can be tested with the Vega Editor, that also contains a large amount of example code.