साँचा:Simple Horizontal timeline/doc
साँचा:lua This is a Lua implementation of साँचा:tl. It has all the functionality of the legacy one with few more features added to it.
Parameters
Basic Plot settings
- साँचा:para Border of the plot
- साँचा:para Background color of the plot
- साँचा:para Width of the timeline plot. Defaults to साँचा:code, can be in साँचा:code or साँचा:code too
|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 साँचा:para should be positive and vice versa. If not the outcome is undetermined.
The rowसाँचा:sub parameter
|rowसाँचा:sub=
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:
- साँचा:code: Specifies where the axis is drawn. (how it is drawn can be found in the Scale Row section below).
- साँचा:code: Specifies where and how the bars are drawn.
- साँचा:code: Row that contains arrow marked notes to give explanations to the graph.
Generic Parameters
|height=
Applies height of साँचा:code and साँचा:code rows.
Each of these types of rows have their own attributes specified with an hyphen. For example, the style of a rowसाँचा:sub can be specified as |rowसाँचा:sub-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 साँचा:code.
|axis-marker-1878= |axis-1878=
Example Usage
ऐसा लिखें | ऐसा दिखायी देगा |
---|---|
{{Simple Horizontal timeline |from=-2000 |to=2000 |inc=500 |row1=scale }} |
│ −2000 │ −1500 │ −1000 │ −500 │ 0 │ 500 │ 1000 │ 1500 │ 2000 |
Timeline Row
- साँचा:para and साँचा:para Specifies the top and bottom border for the row.
- साँचा:para specifies vertical nudge for the bar labels for the entire row.
- साँचा:para or साँचा:para specifies the row's background color.
- Note: साँचा:code or साँचा:code both are acceptable variations for the whole module.
- साँचा:para Starting point for the bar. This is optional, if not specified, will start from value specified in साँचा:para.
- साँचा:para Ending point for the bar.
- साँचा:para Label for the bar.
- साँचा:para Font size for the label.
- साँचा:para Vertical nudge for the label of iसाँचा:sup bar.
- साँचा:para bar colour.
- साँचा:para bar border (See Known Issues).
- Note on Subscripts:
- साँचा:para denotes the साँचा:code value for iसाँचा:sup bar on the nसाँचा:sup row.
- Here subscript साँचा:code 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.
- Subscript साँचा:code is also a positive number which is used to group bar on a specific row.
- Note on Subscripts:
Style Parameter of the Timeline Row
- साँचा:para and साँचा:para 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 साँचा:code. See example below on how साँचा:para is used to apply style common to all rows and साँचा:para/साँचा:para are used to specify bar specific styles.
Example Usage
साँचा:cot साँचा:code साँचा:cob साँचा:cot
Popes and Antipopes of the Catholic Church from 1003 - 1254
Note Row
- साँचा:para Necessary parameter. Specifies where the note is placed
- साँचा:para Specifies the content of the note
- साँचा:para and साँचा:para Specifies the nudge applied to the note. Defaults to साँचा:code
- साँचा:para Specifies the arrow Character. Defaults to साँचा:code. Nullify with साँचा:code.
Example Usage
ऐसा लिखें | ऐसा दिखायी देगा |
---|---|
{{Simple Horizontal timeline |from=-600 |to=0 |row1=note |row1-1-text='''Minor events''' |row1-1-shift=-2.8em |row1-1-arrow= |row1-1-at=-590 |row1-2-at=-542 |row1-2-text=[[End-Ediacaran extinction|End-Ediacaran?]] |row1-3-at=-420 |row1-3-text=[[Lau event]] |row1-4-at=-183 |row1-4-text=[[Toarcian turnover]] |row1-4-lift=-1em |row1-4-shift=-4.8 |row1-6-at=-91.5 |row1-6-text=[[Cenomanian-Turonian boundary event|Cenomanian-Turonian]] |row1-6-lift=-1.3em |row1-6-shift=-5.1 |row2=scale |axis-nudge=-0.8em |caption=Millions of years before present }} |
│ −600 │ −480 │ −360 │ −240 │ −120 │ 0 Millions of years before present |
Note: साँचा:para is missing. Same as n, i does not have to be continuous.
Usage Tips
- You can use timeline inside साँचा:tl for a collapsible frame. See साँचा:tl for a working example.
- It is possible to render only a single row by directly calling the module as {{#invoke:Horizontal timeline | showOneRow | ...}}. See साँचा:tl or साँचा:tl for a working example.
- Different browsers have different ways of rendering. It's probably worth checking your finished timeline in at least IE, Firefox and Chrome if you are making a particularly complex timeline.
Examples
Known Issues
- Left and bottom border for bars (not rows) will not render properly in old browsers which lacks support for CSS3 Box-sizing.(Refer here for full supported browser list) All modern browsers provides at-least minimal support for this. Also only in extereme circumstances you will need to set bar border. Most of the time row border will be sufficient. Hence this should not be a problem.