create new tag
view all tags

Matrix Plugin

Generates a matrix in table form. Input are two lists, containing the values for the x and y axis. The lists may be given directly, or as TWiki variables.

In effect, it is similar to a nested use of the FOREACH variable (see ForEachPlugin), but it will work better for complex substitutions in the cell content, since there is only one "replace". Also, it is easier to use.

Basic Usage

Using the two lists X and Y defined at the end of this topic, we generate an X*Y matrix like this:

  xtext="Eins, Zwei, Drei"
  corner="Letter \ Digit"

This gives

%MATRIX{ x="1,2,3" y="a,b,c" corner="Letter \ Digit" cell="$x:$y" xtext="Eins, Zwei, Drei" ytext="Aa,Bb,Cc"}%


The parameters prefixed with $ will be provided for the templates, whenever it makes sense from the context. In particular, in the cell template, $x, $y, $xtext and $ytext are available.

NameSorted ascending Description Template variable
cell Template for cell Template
corner Text for the upper left corner of the matrix  
verbatim For debugging. If true, shows generated Twiki markup  
x The horizontal values $x
xtext Concomitant for x, can be used in templates $xtext
xtitle Title template for x Template
y The vertical values $y
ytext Concomitant for y, can be used in templates $ytext
ytitle Title template for y Template

Additionally, to allow delayed rendering of generated TWiki variable calls, the variable $percnt can be used.

  • Set X=1,2,3
  • Set Y=a,b,c

-- RuedigerPlantiko - 2012-11-09

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2012-11-21 - RuedigerPlantiko
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.MatrixPlugin.