Help:DPL/manual/dplmatrix

From Guild Wars 2 Wiki
Jump to navigationJump to search

This is an auxiliary function module within the DPL package. It takes an indented list of data, and provides a matrix summary view of the same data. It can also be combined with the outputs of regular DPL queries.

Usage[edit]

 {{#dplmatrix: name | yes | no | mode | indented list }}

Parameters[edit]

There are five parameters which must be given in the order listed here:

  1. The name of the matrix. Appears in the upper left cell. Arbitrary wiki formatting (even images) are possible.
  2. The symbol for cells which symbolize that the row and column are related (yes). Default is "x".
  3. The symbol for cells which symbolize the absence of a link between the row and column (no). Defaults to blank cell.
  4. The mode ('normal' or 'flip'); default is 'normal'. When 'flip' is specified, rows and columns will be exchanged.
  5. The indented list.
    • source items must start in column 1
    • target items must be indented by at least one space (these are sorted alphabetically for the output display)
    • after the item name you can add "~~" and a 'label'. Row and column titles of the matrix will contain hyperlinks to the items. If labels are specified, they will be used instead of the item names.
    • lines which are empty or contain only spaces are silently ignored.
    • if a source line is not followed by one or more target lines an empty table row (or column in flip mode) will be shown.
    • if the same source line appears multiple times, the targets will be combined.

Examples[edit]

Example 1 (normal matrix)

Input:

{{#dplmatrix:Matrix 1|{{yes}}|{{no}}|normal|
Asura
  Helmet
  Gloves
Charr ~~ Rytlock
  Gloves
Human
Norn
  Boots
Charr ~~ Rytlock
  Leggings
}}

Output:

Matrix 1 Boots Gloves Helmet Leggings
Asura 0No 1Yes 1Yes 0No
Rytlock 0No 1Yes 0No 1Yes
Human 0No 0No 0No 0No
Norn 1Yes 0No 0No 0No
Example 2 (flipped matrix)
Input:
{{#dplmatrix:Matrix 1|{{yes}}|{{no}}|flip|
Asura
  Helmet
  Gloves
Charr ~~ Rytlock
  Gloves
Human
Norn
  Boots
Charr ~~ Rytlock
  Leggings
}}
Output:
Matrix 1 Asura Rytlock Human Norn
Boots 0No 0No 0No 1Yes
Gloves 1Yes 1Yes 0No 0No
Helmet 1Yes 0No 0No 0No
Leggings 0No 1Yes 0No 0No

Note[edit]

  • Examples on this page have the CSS class table.dplmatrix defined for this page only with custom CSS.