Difference between revisions of "Template:Simple horizontal timeline/doc"
Joelmartin (talk | contribs) m |
Joelmartin (talk | contribs) m (→Example Usage) |
||
Line 190: | Line 190: | ||
}} | }} | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | ||
− | |||
− | |||
{{Simple Horizontal timeline | {{Simple Horizontal timeline | ||
− | |||
|from=1 | |from=1 | ||
|to=24 | |to=24 | ||
Line 253: | Line 250: | ||
|caption=Test Engineering Plan | |caption=Test Engineering Plan | ||
}} | }} | ||
− | |||
− | |||
=== Note Row === | === Note Row === |
Revision as of 04:23, 28 February 2020
![]() | This is a documentation subpage for Template:Simple horizontal timeline. It contains usage information, categories and other content that is not part of the original template page. |
![]() | This template uses Lua: |
This is a Lua implementation of {{Horizontal timeline}}. It has all the functionality of the legacy one with few more features added to it.
Parameters
Basic Plot settings
|bordr=
Border of the plot|bgCol=
Background color of the plot|width=
Width of the timeline plot. Defaults to, can be in100%
orpx
tooem
|caption=
shows a centered text. Can be used to show legends. Intended to be used to label the axis|from=
and|to=
Necessary parameters which denotes the start and end of the timeline axis. The entire timeline (for the entire plot) including other type of rows are drawn to this scale.|to=
may or may not be greater than|from=
. (see|inc=
for more on this) If any bars described using parameters shown below lie outside these values, they will be trimmed or eliminated depending on their position.|inc=
Optional Increment to be added to|from=
to reach|to=
and be displayed along the axis. If not specified it will be automatically calculated. If|to=
is greater than|from=
then|inc=
should be positive and vice versa. If not the outcome is undetermined.
The rown parameter
|rown=
specifies how horizontal rows are drawn. You can have as many rows as you want. Subscript are positive integers. They specify where the row is rendered on the plot. Lower subscript indicate higher on the plot. That is |row3=
will be above |row4=
Three differenct types of rows are possible. They are:
- : Specifies where the axis is drawn. (how it is drawn can be found in the Scale Row section below).
scale
- : Specifies where and how the bars are drawn.
timeline
- : Row that contains arrow marked notes to give explanations to the graph.
note
Generic Parameters
|height=
Applies height ofandtimeline
rows.note
Each of these types of rows have their own attributes specified with an hyphen. For example, the style of a rown can be specified as |rown-style=
. Full list of available attributes and their description can be found below.
Scale Row
|axis-negativeFmt=
,|axis-positiveFmt=
and|axis-zeroFmt=
Formatting options for Axis scale. If you want more customization, (like completely hiding a single label on the axis) use the following:|axis-value=
- Used to replace the value label on the axis (It will work if and only if the exact value appears on it).|axis-marker-value=
- Used to replace the marker point for a label that appears on the axis. (It will work if and only if the exact value appears on it).
|axis-nudge=
Amount of nudge to be applied to the axis label, defaults to.-1.8em
|axis-marker-1878= |axis-1878=
Example Usage
Markup | Renders as |
---|---|
{{Simple Horizontal timeline |from=-2000 |to=2000 |inc=500 |row1=scale }} |
│ −2000 │ −1500 │ −1000 │ −500 │ 0 │ 500 │ 1000 │ 1500 │ 2000 |
Markup | Renders as |
---|---|
{{Simple Horizontal timeline |from=-2000 |to=2000 |inc=500 |row1=scale |axis-negativeFmt=%s BC |axis-positiveFmt=%s AD |axis-zeroFmt= %s AD |axis-nudge=-0.8em }} |
│ 2000 BC │ 1500 BC │ 1000 BC │ 500 BC │ 0 AD │ 500 AD │ 1000 AD │ 1500 AD │ 2000 AD |
Markup | Renders as |
---|---|
{{Simple Horizontal timeline |from=-2000 |to=2000 |inc=500 |row1=scale |axis-nudge=-0.8em |axis--2000=this is minus<br/>two thousand |axis-marker-0=⇑ |axis-0=Changed<br/>axis marker }} |
│ −2000 │ −1500 │ −1000 │ −500 ⇑ Changed axis marker │ 500 │ 1000 │ 1500 │ 2000 |
Timeline Row
|rown-bordertop=
and|rown-borderbottom=
Specifies the top and bottom border for the row.|rown-texttop=
specifies vertical nudge for the bar labels for the entire row.|rown-colour=
or|rown-color=
specifies the row's background color.
- Note: or
colour
both are acceptable variations for the whole module.color
- Note:
|rown-i-from=
Starting point for the bar. This is optional, if not specified, will start from value specified in|from=
.|rown-i-to=
Ending point for the bar.|rown-i-text=
Label for the bar.|rown-i-fontsize=
Font size for the label.|rown-i-texttop=
Vertical nudge for the label of ith bar.|rown-i-colour=
bar colour.|rown-i-border=
bar border (See Known Issues).
- Note on Subscripts:
|rown-i-<attribute>=
denotes thevalue for ith bar on the nth row.attribute
- Here subscript is a positive number used to group rows and their attributed. They may not occur continuous in your script, but are displayed in ascending order.
n
- Subscript is also a positive number which is used to group bar on a specific row.
i
- Note on Subscripts:
Style Parameter of the Timeline Row
|rown-style=
and|rown-i-style=
can be used to provide row specific or bar specific styles. Those styles which repeat for every bar or for every row may be grouped into styles and be applied globally. The style prefixes can be anything other than. See example below on howrow
|styleDefault=
is used to apply style common to all rows and|stylePopes=
/|styleAntiPopes=
are used to specify bar specific styles.
Example Usage
Markup | ||||
---|---|---|---|---|
{{Simple Horizontal timeline |from=1 |to=24 |inc=1 |axis-nudge=-0.5em |styleDefault-height=1.5em |styleDefault-1-border=none; |styleDefault-3-border=none;text-align:left |styleDefault-3-texttop=0em;left:0.5em; |styleDefault-5-border=none;text-align:left |styleDefault-5-texttop=0em;left:0.5em; |styleMEtasks-boxcolour=#F7C000 |styleMEtasks-border=none;border:2px solid #D0A200 |styleEEtasks-boxcolour=#DD4444 |styleEEtasks-border=none;border:2px solid #E20000 |row1=timeline |row1-style=styleDefault |row1-1-to=2 |row1-2-to=4 |row1-2-style=styleMEtasks |row1-3-text=ME Task |row1-3-to=6 |row1-4-to=8 |row1-4-style=styleMEtasks |row1-5-text=ME Task |row2=timeline |row2-style=styleDefault |row2-1-to=3 |row2-2-to=6 |row2-2-style=styleMEtasks |row2-3-text=ME Task |row2-3-to=7 |row2-4-to=9 |row2-4-style=styleEEtasks |row2-5-text=EE Task |row3=timeline |row3-style=styleDefault |row3-1-to=1 |row3-2-to=5 |row3-2-style=styleEEtasks |row3-3-text=EE Task |row3-3-to=3 |row3-4-to=6 |row3-4-style=styleEEtasks |row3-5-text=EE Task |row32=scale |caption=Test Engineering Plan }}
│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 Test Engineering Plan Note Row
Example Usage
Note: Usage Tips
Examples
Known Issues
See also |