Difference between revisions of "Module:Weather/doc"
Jump to navigation
Jump to search
blackwiki>Johnuniq (overview) |
blackwiki>Johnuniq (add palette and show function) |
||
| Line 28: | Line 28: | ||
---- | ---- | ||
{{#invoke:weather|CfromF|14 23 32 41 50 59 68 77 86 95 104 113 122}} | {{#invoke:weather|CfromF|14 23 32 41 50 59 68 77 86 95 104 113 122}} | ||
| + | </pre> | ||
| + | |||
| + | '''Optional parameter''' | ||
| + | *<code>|palette=</code>''name'' | ||
| + | *:Where ''name'' is the built-in name of a palette: | ||
| + | *::cool (default) | ||
| + | *::cool2 (modified) | ||
| + | *::cool2avg (modified and intended for average temperatures) | ||
| + | |||
| + | == Testing == | ||
| + | One of the following can be previewed in a sandbox to display graphs showing how the red/green/blue colors vary with temperature. A table of the resulting colors is also displayed; the table shows °C values. | ||
| + | <pre> | ||
| + | {{#invoke:weather|show}} | ||
| + | {{#invoke:weather|show|palette=cool}} | ||
| + | {{#invoke:weather|show|palette=cool2}} | ||
| + | {{#invoke:weather|show|palette=cool2avg}} | ||
</pre> | </pre> | ||
Revision as of 10:19, 12 September 2016
This module can be used to display temperatures in a table. It is under development and is intended to be efficient so a page can hold many tables.
- Input numbers must use a hyphen if negative (Unicode minus "−" would give an error).
- All displayed numbers (including inputs) use Unicode minus if negative.
- The input consists of 13 values, separated by any number of spaces.
- Each of the 13 values must be a number. Any invalid value results in the corresponding cell being blank with no error message or tracking category.
The following functions are available:
Function Input Output ------------------------- CtoF °C °C (°F) FfromC °C °F (°C) CfromF °F °C (°F) FtoC °F °F (°C)
The following templates use the module:
An example using the above templates and therefore the module is at:
The output can be examined by entering the following example at Special:ExpandTemplates. The output from each of the following lines is identical.
{{#invoke:weather|CtoF|-10 -5 0 5 10 15 20 25 30 35 40 45 50}}
----
{{#invoke:weather|CfromF|14 23 32 41 50 59 68 77 86 95 104 113 122}}
Optional parameter
|palette=name- Where name is the built-in name of a palette:
- cool (default)
- cool2 (modified)
- cool2avg (modified and intended for average temperatures)
- Where name is the built-in name of a palette:
Testing
One of the following can be previewed in a sandbox to display graphs showing how the red/green/blue colors vary with temperature. A table of the resulting colors is also displayed; the table shows °C values.
{{#invoke:weather|show}}
{{#invoke:weather|show|palette=cool}}
{{#invoke:weather|show|palette=cool2}}
{{#invoke:weather|show|palette=cool2avg}}