Difference between revisions of "Template:Catgraph"
From FollowTheScore
Line 17: | Line 17: | ||
*DPL | *DPL | ||
}}</td> | }}</td> | ||
− | <td> {{#input: name= namespace2 |type= select | value = {{ | + | <td> {{#input: name= namespace2 |type= select | value = {{#DPLvar:namespace2}} | |
*all | *all | ||
*main | *main | ||
Line 29: | Line 29: | ||
<tr bgcolor="#ddffff"> | <tr bgcolor="#ddffff"> | ||
<td align="right"> category </td> | <td align="right"> category </td> | ||
− | <td> {{#input: name= category1 | value = {{ | + | <td> {{#input: name= category1 | value = {{#DPLvar:category1}} |type= select |
| *? {{#dpl: namespace=Category | format=,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Category | format=,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
− | <td> {{#input: name= category2 | value = {{ | + | <td> {{#input: name= category2 | value = {{#DPLvar:category2}} |type= select |
| *? {{#dpl: namespace=Category | format = ,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Category | format = ,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
Line 38: | Line 38: | ||
<tr bgcolor="#ffddff"> | <tr bgcolor="#ffddff"> | ||
<td align="right"> uses </td> | <td align="right"> uses </td> | ||
− | <td> {{#input: name= uses1 | value = {{ | + | <td> {{#input: name= uses1 | value = {{#DPLvar:uses1}} |type= select |
| *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
− | <td> {{#input: name= uses2 | value = {{ | + | <td> {{#input: name= uses2 | value = {{#DPLvar:uses2}} |type= select |
| *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
Line 47: | Line 47: | ||
<tr bgcolor="#ddeeff"> | <tr bgcolor="#ddeeff"> | ||
<td align="right"> title like</td> | <td align="right"> title like</td> | ||
− | <td> {{#input: name= titlematch1 | value = {{ | + | <td> {{#input: name= titlematch1 | value = {{#DPLvar:titlematch1}} }} |
− | <td> {{#input: name= titlematch2 | value = {{ | + | <td> {{#input: name= titlematch2 | value = {{#DPLvar:titlematch2}} }} |
</td> | </td> | ||
<tr bgcolor="#ffffdd"> | <tr bgcolor="#ffffdd"> | ||
<td align="right"> links from </td> | <td align="right"> links from </td> | ||
− | <td> {{#input: name= linksfrom1 | value = {{ | + | <td> {{#input: name= linksfrom1 | value = {{#DPLvar:linksfrom1}} }} |
− | <td> {{#input: name= linksfrom2 | value = {{ | + | <td> {{#input: name= linksfrom2 | value = {{#DPLvar:linksfrom2}} }} |
</td> | </td> | ||
</tr> | </tr> | ||
<tr bgcolor="#ffffdd"> | <tr bgcolor="#ffffdd"> | ||
<td align="right"> links to </td> | <td align="right"> links to </td> | ||
− | <td> {{#input: name= linksto1 | value = {{ | + | <td> {{#input: name= linksto1 | value = {{#DPLvar:linksto1}} }} |
− | <td> {{#input: name= linksto2 | value = {{ | + | <td> {{#input: name= linksto2 | value = {{#DPLvar:linksto2}} }} |
</td> | </td> | ||
</tr> | </tr> | ||
Line 66: | Line 66: | ||
</table> | </table> | ||
show: namespace {{#input: name= shownamespace | show: namespace {{#input: name= shownamespace | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:shownamespace}} | |
*yes | *yes | ||
*no | *no | ||
}}graph {{#input: name= graph | }}graph {{#input: name= graph | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:graph}} | |
*svg | *svg | ||
*png | *png | ||
Line 76: | Line 76: | ||
*gdl | *gdl | ||
}}catlinks {{#input: name= catlinks | }}catlinks {{#input: name= catlinks | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:catlinks}} | |
*no | *no | ||
*yes | *yes | ||
Line 82: | Line 82: | ||
<small>[[:Template:Catgraph|reset]] [[:Template:Catlist|list]] [[Template:Wgraph defaults|layout]]</small><br> | <small>[[:Template:Catgraph|reset]] [[:Template:Catlist|list]] [[Template:Wgraph defaults|layout]]</small><br> | ||
layout {{#input: name= layout | layout {{#input: name= layout | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:layout}} | |
*normal | *normal | ||
*forcedir | *forcedir | ||
Line 96: | Line 96: | ||
*minoutdegree | *minoutdegree | ||
*tree | *tree | ||
− | }}userparm {{#input: name= userparm | size=80 | value = {{ | + | }}userparm {{#input: name= userparm | size=80 | value = {{#DPLvar:userparm}} |
}}}} | }}}} | ||
<!-------------------------------------------------------------------------------------------------------------> | <!-------------------------------------------------------------------------------------------------------------> | ||
− | {{#if:{{ | + | {{#if:{{#DPLvar:layout}}| |
− | {{#if:{{ | + | {{#if:{{#DPLvar:name}}| |
==== {{{name}}} ==== | ==== {{{name}}} ==== | ||
|}} | |}} | ||
Line 108: | Line 108: | ||
{{#dpl: | {{#dpl: | ||
|debug=1 | |debug=1 | ||
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:namespace1}}|all||{{#if:{{#DPLvar:namespace1}}|{{#ifeq:{{#DPLvar:namespace1}}|main|namespace=|namespace=#DPLvar:{{namespace1}}}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:category1}}|?||{{#if:{{#DPLvar:category1}}|category={{#DPLvar:category1}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:uses1}}|?||{{#if:{{#DPLvar:uses1}}|uses=Template:{{#DPLvar:uses1}}}}}} |
− | |titlematch={{ | + | |titlematch={{#DPLvar:titlematch1}} |
|linksto={{#dpl: | |linksto={{#dpl: | ||
|debug=1 | |debug=1 | ||
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:namespace2}}|all||{{#if:{{#DPLvar:namespace2}}|{{#ifeq:{{#DPLvar:namespace2}}|main|namespace=|namespace={{#DPLvar:namespace2}}}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:category2}}|?||{{#if:{{#DPLvar:category2}}|category={{#DPLvar:category2}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:uses2}}|?||{{#if:{{#DPLvar:uses2}}|uses=Template:{{#DPLvar:uses2}}}}}} |
− | |titlematch={{ | + | |titlematch={{#DPLvar:titlematch2}} |
|format=,%PAGE%¦,,\n | |format=,%PAGE%¦,,\n | ||
}} | }} | ||
− | |addcategories={{ | + | |addcategories={{#DPLvar:catlinks}} |
− | |format=, edge "%PAGE%" to "%PAGESEL%" {type '%NAMESPACE%'}\n node "%PAGE%" {type '%CATNAMES% | + | |format=, edge "%PAGE%" to "%PAGESEL%" {type '%NAMESPACE%'}\n node "%PAGE%" {type '%CATNAMES%.%NAMESPACE%' href "%PAGE%" },\n, |
}} | }} | ||
− | layout={{ | + | layout={{#DPLvar:layout|dfs}} |
− | {{ | + | {{#DPLvar:userparm}} |
}} | }} | ||
}} | }} |
Revision as of 18:44, 19 August 2012
As an example try and select 'DPL Manual' in both category boxes ...
or select namespace 'main' and 'category', use algorithm 'forcedir' and add "attraction=200" as a manual parameter.
{{#form: name= demo |method=get |action=/dpldemo/index.php| {{#input: name= title |type= hidden | value = Template:Catgraph }}
select | from | to |
namespace | {{#input: name= namespace1 |type= select | value = |
|
{{#input: name= namespace2 |type= select | value = |
|
category | {{#input: name= category1 | value = |type= select
| *?
|
{{#input: name= category2 | value = |type= select
| *?
|
uses | {{#input: name= uses1 | value = |type= select
| *?
|
{{#input: name= uses2 | value = |type= select
| *?
|
title like | {{#input: name= titlematch1 | value = }} | {{#input: name= titlematch2 | value = }} |
links from | {{#input: name= linksfrom1 | value = }} | {{#input: name= linksfrom2 | value = }} |
links to | {{#input: name= linksto1 | value = }} | {{#input: name= linksto2 | value = }} |
show: namespace {{#input: name= shownamespace
|type= select | value = |
- yes
- no
}}graph {{#input: name= graph
|type= select | value = |
- svg
- png
- wgl
- gdl
}}catlinks {{#input: name= catlinks
|type= select | value = |
- no
- yes
}}{{#input: type = submit | value = create graph }}
reset list layout
layout {{#input: name= layout
|type= select | value = |
- normal
- forcedir
- dfs
- minbackward
- maxdepth
- mindepth
- maxdegree
- maxindegree
- maxoutdegree
- mindegree
- minindegree
- minoutdegree
- tree
}}userparm {{#input: name= userparm | size=80 | value = }}}}